:root {
  --navy: #0b1f3a;
  --teal: #127a8a;
  --gold: #c88b1b;
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1b2233;
  --muted: #6b7280;
  --border: #e3e6ee;
}

/* ---------- top nav ---------- */
.topnav {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--navy);
  color: white;
  padding: 0 28px;
  height: 56px;
  font-size: 14px;
}
.topnav .brand {
  color: white; text-decoration: none; font-weight: 700;
  display: flex; align-items: center; gap: 8px; font-size: 16px;
}
.topnav .brand-mark { color: var(--gold); }
.topnav .nav-tabs { display: flex; gap: 4px; flex: 1; }
.topnav .nav-tab {
  color: rgba(255,255,255,0.78); text-decoration: none; padding: 8px 14px;
  border-radius: 6px; font-weight: 500;
}
.topnav .nav-tab:hover { background: rgba(255,255,255,0.08); color: white; }
.topnav .nav-tab.active { background: var(--teal); color: white; }
.topnav .nav-user {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: rgba(255,255,255,0.82);
}
.topnav .nav-user .signout {
  color: white; text-decoration: underline; font-size: 12px;
}
.topnav .nav-user .role-badge {
  background: rgba(255,255,255,0.12); padding: 2px 8px;
  border-radius: 10px; font-size: 11px;
}
.topnav .nav-user .role-super-admin { background: var(--gold); color: white; }

/* dashboard tiles */
.tile-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px; margin-top: 8px;
}
.stat-tile {
  background: white; border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px;
}
.stat-tile .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-tile .value { font-size: 26px; color: var(--navy); font-weight: 700; margin-top: 4px; }
.stat-tile .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }

.cta-big {
  display: block; text-align: center; padding: 18px;
  background: linear-gradient(135deg, var(--teal), var(--navy));
  color: white; text-decoration: none; border-radius: 12px;
  font-weight: 600; font-size: 16px; margin-top: 16px;
}
.cta-big:hover { filter: brightness(1.05); }

.activity-row {
  display: grid; grid-template-columns: 180px 1fr auto;
  gap: 14px; padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.activity-row .ts { color: var(--muted); white-space: nowrap; }
.activity-row .desc { color: var(--text); }
.activity-row a { color: var(--teal); }

.upload-list {
  margin-top: 10px; display: flex; flex-direction: column; gap: 4px;
  font-size: 12px;
}
.upload-list .item {
  display: flex; justify-content: space-between;
  background: #fafbff; border: 1px solid var(--border);
  border-radius: 4px; padding: 4px 10px;
}
.upload-list .item.primary { border-color: var(--teal); }
.upload-list .item .primary-tag {
  background: var(--teal); color: white; padding: 0 6px; border-radius: 10px;
  font-size: 10px; margin-left: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header {
  background: linear-gradient(135deg, var(--navy), var(--teal));
  color: white;
  padding: 28px 32px;
}
header h1 { margin: 0; font-size: 24px; }
header .tag { margin: 6px 0 0; opacity: 0.85; max-width: 720px; }

main {
  max-width: 920px;
  margin: 24px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(11, 31, 58, 0.04);
}
.card h2 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--navy);
  letter-spacing: 0.01em;
}

label {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  margin-top: 4px;
  background: white;
}
textarea { resize: vertical; }

.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.row {
  display: flex;
  gap: 8px;
  align-items: end;
}
.row label { flex: 0 0 100%; margin-bottom: 0; }
.row input { flex: 1; }
.row button { flex: 0 0 auto; }

button, .button {
  background: white;
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.primary, .primary.button {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
  font-weight: 600;
}
button.primary:hover, .primary.button:hover { background: #0f6776; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.actions { display: flex; align-items: center; gap: 16px; }
.status { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
code { background: #f0f2f7; padding: 0 4px; border-radius: 3px; font-size: 12px; }

.bar {
  height: 8px;
  background: #eef0f7;
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}
#bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 0.4s ease;
}

.scripts {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.script-item {
  background: #fafbff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
}
.script-item .num { color: var(--teal); font-weight: 700; margin-right: 6px; }

.browser {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  max-height: 280px;
  overflow: auto;
  background: #fafbff;
}
.browser .dir-row {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  background: #eef1f8;
  font-size: 12px;
  color: var(--muted);
  display: flex; justify-content: space-between; gap: 8px;
}
.browser .entry {
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #f0f2f7;
}
.browser .entry:hover { background: #eef5f8; }
.browser .entry.dir { color: var(--navy); font-weight: 600; }

.hidden { display: none; }

#download-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 16px;
}
