/* Brand: taken from the IVB logo — deep navy ground, teal line-art wordmark. */
:root {
  --bg: #022029;        /* logo background */
  --bg-2: #03262f;
  --surface: #052d37;
  --surface-2: #083641;
  --line: #0c414c;
  --line-2: #13525e;
  --text: #e8f7f6;
  --muted: #8fbdbc;
  --faint: #5b8b8d;

  --brand: #4dcdc7;     /* logo teal */
  --brand-soft: #8fe3de;
  --brand-deep: #2a9e99;
  --amber: #f4b942;     /* reserved for "waiting" states and Gold medals */
  --teal: var(--brand);
  --mint: var(--brand-soft);
  --red: #e5484d;
  --green: #3ecf8e;

  --gold: #f4b942;
  --silver: #c8d1d8;
  --bronze: #d08a4b;
  --diamond: #7dd3fc;
  --emerald: #34d399;
  --platinum: #e6e8eb;

  --accent: var(--brand);
  --accent-ink: #022029;

  --radius: 10px;
  --radius-lg: 14px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Archivo', 'Inter', system-ui, sans-serif;
  color-scheme: dark;
}


* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg); /* solid, so the logo's own navy background blends in */
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 20px;
}
.logo { display: block; line-height: 0; border-radius: 4px; }
.logo img { height: 30px; width: auto; }
.logo:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a, .nav button {
  background: none; border: 0; cursor: pointer; text-decoration: none;
  color: var(--muted); padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
.nav a:hover, .nav button:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: var(--text); background: var(--surface-2); }
.nav .who { color: var(--faint); font-size: 13px; padding: 0 8px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 32px 20px 80px; }

/* ---------- type ---------- */
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--mint);
  margin: 0 0 10px;
}
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(34px, 6vw, 58px); font-weight: 800; line-height: 1; text-transform: uppercase; }
h1 .dot { color: var(--accent); }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
.lede { color: var(--muted); max-width: 560px; margin: 14px 0 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  padding: 9px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); border-color: var(--accent); }
.btn-danger { color: #ffb4b6; border-color: #5a2a2e; background: #2a1517; }
.btn-success { color: #b6f5d6; border-color: #1f5a41; background: #0f2a20; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface); }
.btn-sm { padding: 5px 10px; font-size: 13px; }

.seg {
  display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px;
  flex-wrap: wrap;
}
.seg button {
  border: 0; background: none; cursor: pointer; padding: 8px 16px; border-radius: 8px;
  color: var(--muted); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg.big button { padding: 10px 20px; font-size: 15px; }
.seg.big button.on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.seg .sub { font-weight: 500; font-size: 12px; opacity: .75; }

.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }

label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 10px 12px; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.input.filled { border-color: color-mix(in srgb, var(--accent) 70%, transparent); background: color-mix(in srgb, var(--accent) 7%, var(--bg-2)); }
textarea.input { resize: vertical; min-height: 90px; }
.help { font-size: 12px; color: var(--faint); margin-top: 5px; }
.field { margin-bottom: 16px; }
.field-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px;
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card-head .note { font-size: 12px; color: var(--faint); margin-top: 2px; }

.grid { display: grid; gap: 16px; }
.grid-boards { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.pill.pending { background: #3a2e10; color: var(--amber); }
.pill.approved { background: #0f2f24; color: var(--green); }
.pill.rejected { background: #351719; color: #ff9a9e; }
.pill.linkedin { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent); }
.pill.instagram { background: color-mix(in srgb, var(--brand-soft) 12%, transparent); color: var(--brand-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-soft) 30%, transparent); }

/* ---------- leaderboard ---------- */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.stats { display: flex; gap: 0; border-top: 1px solid var(--line); margin: 0 0 28px; flex-wrap: wrap; }
.stat { padding: 14px 32px 0 0; min-width: 130px; }
.stat b { display: block; font-family: var(--display); font-size: 26px; font-weight: 800; color: var(--accent); line-height: 1.1; }
.stat span { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 8px;
}
.row + .row { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.row.top { background: var(--bg-2); border-top-color: transparent; margin-bottom: 4px; }
.row.me { box-shadow: inset 0 0 0 1px var(--accent); }
.rank {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; color: var(--muted); background: var(--surface-2);
}
.rank.m-gold { background: var(--gold); color: #2a1d00; }
.rank.m-silver { background: var(--silver); color: #1c2328; }
.rank.m-bronze { background: var(--bronze); color: #2a1404; }
.rank.m-diamond { background: var(--diamond); color: #04263a; }
.rank.m-emerald { background: var(--emerald); color: #032a1b; }
.rank.m-platinum { background: var(--platinum); color: #1f2329; }
.who-cell { min-width: 0; }
.who-cell .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-cell .meta { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-cell .meta a { color: var(--mint); text-decoration: none; }
.who-cell .meta a:hover { text-decoration: underline; }
.value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.value small { display: block; font-size: 11px; color: var(--faint); font-weight: 500; }
.empty { padding: 22px 10px; text-align: center; color: var(--faint); font-size: 14px; }
.more { margin-top: 8px; width: 100%; }

.medal-legend { display: flex; gap: 6px; }
.medal-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.milestones { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.milestone .amount { font-family: var(--display); font-size: 30px; font-weight: 800; color: var(--accent); line-height: 1; margin: 6px 0 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip { background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; }

.section-title { display: flex; align-items: baseline; gap: 12px; margin: 40px 0 16px; }

/* ---------- auth ---------- */
.auth { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 400px; padding: 32px; }
.auth h1 { font-size: 34px; margin-bottom: 6px; }

.alert { border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.alert.error { background: #2a1517; border-color: #5a2a2e; color: #ffb4b6; }
.alert.ok { background: #0f2a20; border-color: #1f5a41; color: #b6f5d6; }
.alert.info { background: var(--bg-2); border-color: var(--line-2); color: var(--muted); }

/* ---------- student ---------- */
.layout-2 { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 920px) { .layout-2 { grid-template-columns: 1fr; } }

.dropzone {
  border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 26px 18px; text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s; background: var(--bg-2);
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--bg-2)); }
.dropzone strong { color: var(--text); }

.shots { display: grid; gap: 10px; margin-top: 12px; }
.shot {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px;
}
.shot img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: #000; }
.shot .shot-info { min-width: 0; display: grid; gap: 6px; }
.shot .fname { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot select { padding: 6px 8px; font-size: 13px; }
.shot .status { font-size: 12px; color: var(--faint); }
.shot .status.ok { color: var(--green); }
.shot .status.warn { color: var(--amber); }

.progress { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.group-title { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--mint); margin: 22px 0 12px; }
.sum-line { display: flex; justify-content: space-between; padding: 10px 12px; background: var(--bg-2); border-radius: 8px; font-size: 14px; margin-top: -4px; margin-bottom: 16px; }

.history { display: grid; gap: 10px; }
.hist { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.hist-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hist-head .when { margin-left: auto; font-size: 12px; color: var(--faint); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-size: 13px; margin-top: 10px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.note-box { margin-top: 10px; font-size: 13px; padding: 8px 10px; border-left: 2px solid var(--brand); background: var(--surface); border-radius: 0 6px 6px 0; }

.standing { display: grid; gap: 8px; }
.standing-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.standing-row:last-child { border-bottom: 0; }

details.ocr-raw summary { cursor: pointer; font-size: 12px; color: var(--faint); }
details.ocr-raw pre { white-space: pre-wrap; font-size: 11px; color: var(--muted); max-height: 160px; overflow: auto; background: var(--bg); padding: 8px; border-radius: 6px; }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button {
  border: 0; background: none; cursor: pointer; padding: 10px 14px; color: var(--muted); font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center;
}
.tabs button.on { color: var(--text); border-bottom-color: var(--brand); }
.tabs .count { background: var(--amber); color: #2a1d00; border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 800; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input { width: auto; min-width: 150px; }
.toolbar .grow { flex: 1; min-width: 200px; }

.review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; }
@media (max-width: 900px) { .review { grid-template-columns: 1fr; } }
.review + .review { margin-top: 16px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.thumb { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); cursor: zoom-in; background: #000; aspect-ratio: 3/4; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.thumb span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; padding: 4px 6px; background: rgba(0,0,0,.7); }
.edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.edit-grid label { font-size: 12px; margin-bottom: 4px; }
.edit-grid .input { padding: 7px 10px; font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mint); font-weight: 700; padding: 10px; border-bottom: 1px solid var(--line-2); }
table.list td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr.dq td { opacity: .55; }
.table-wrap { overflow-x: auto; }

.lightbox { position: fixed; inset: 0; background: rgba(0, 8, 10, .92); z-index: 100; display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-height: 92vh; max-width: 96vw; border-radius: 8px; }

.modal-bg { position: fixed; inset: 0; background: rgba(0, 8, 10, .75); z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 24px; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; }
.modal h2 { margin-bottom: 12px; }

.creds { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--bg); border-radius: 8px; padding: 12px; max-height: 260px; overflow: auto; white-space: pre; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--line-2); padding: 10px 18px; border-radius: 10px; z-index: 120; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; color: var(--text); font-size: 14px; margin: 0; }
.switch input { width: 18px; height: 18px; accent-color: var(--brand); }

.phase-edit { display: grid; grid-template-columns: 90px 1fr 1fr auto; gap: 10px; align-items: center; margin-bottom: 10px; }
@media (max-width: 600px) { .phase-edit { grid-template-columns: 1fr 1fr; } }

@media (max-width: 640px) {
  .wrap { padding: 22px 16px 60px; }
  .grid-boards { grid-template-columns: 1fr; }
  .topbar-inner { padding: 10px 16px; gap: 10px; }
  .nav a, .nav button { padding: 6px 8px; }
  .nav .who { display: none; }
  .card { padding: 16px; }
}

/* ---------- brand details ---------- */
h1 .dot, .dot { color: var(--brand); }
.seg.big button.on { background: var(--brand); color: var(--accent-ink); }
.stat b { color: var(--brand); }
.btn-primary:focus-visible, .btn:focus-visible, .seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--brand) 35%, transparent); }

/* Thin teal frame + corner ticks echo the logo's outlined letterforms. */
.hero h1 { position: relative; }
.card { position: relative; }
.card::before {
  content: ''; position: absolute; top: -1px; left: 18px; width: 28px; height: 2px;
  background: var(--brand); border-radius: 0 0 2px 2px; opacity: .85;
}
.modal .card::before, .auth .card::before { left: 32px; }

/* ---------- student: phase & verification ---------- */
.phase-banner {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; margin-bottom: 18px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius);
}
.phase-banner .live-dot { flex: none; }
#sub-form.closed #drop, #sub-form.closed #fields { opacity: .45; pointer-events: none; }

.check { font-size: 12px; margin-top: 5px; min-height: 0; }
.check:empty { display: none; }
.check.screenshot, .check.previous, .check.ok { color: var(--brand); }
.check.manual { color: var(--amber); }
.input.manual { border-color: color-mix(in srgb, var(--amber) 55%, transparent); }

.verdict { margin: 22px 0 0; padding: 12px 14px; border-radius: var(--radius); font-size: 14px; border: 1px solid; }
.verdict.ok { background: color-mix(in srgb, var(--brand) 9%, var(--bg-2)); border-color: color-mix(in srgb, var(--brand) 45%, transparent); color: var(--brand-soft); }
.verdict.wait { background: #2a2310; border-color: #5a4a1c; color: #f6d38a; }

/* ---------- admin ---------- */
.thumb.gone { display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--muted); background: var(--bg-2); cursor: default; padding: 8px; }
.radios { display: grid; gap: 10px; }
.radio { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); cursor: pointer; margin: 0; color: var(--text); font-weight: 500; }
.radio:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, var(--bg-2)); }
.radio input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.radio .help { display: block; margin-top: 2px; }
.alert.small { font-size: 13px; padding: 8px 12px; }
.check.edited { color: #ff9a9e; font-weight: 600; }
