/* Hack The Nest theme: forest green + EMU gold, Space Mono + Inter (same tokens as the CTF platform). */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(/static/fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url(/static/fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(/static/fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url(/static/fonts/inter-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Space Mono"; font-weight: 400; font-display: swap; src: url(/static/fonts/space-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Space Mono"; font-weight: 700; font-display: swap; src: url(/static/fonts/space-mono-latin-700-normal.woff2) format("woff2"); }

:root {
  color-scheme: dark;
  /* CTF palette */
  --sky-0: #0d1e0e; --sky-1: #152b17; --sky-2: #1f3a21; --field: #0c1a0d;
  --gold: #f3c04a; --gold-dim: #c9971f; --leaf: #43c06a; --mint: #5fd3a0; --dawn: #e8873c; --insane: #f0556b;
  --on-gold: #06140d;

  /* dashboard tokens, mapped onto the palette */
  --bg: var(--sky-0); --panel: var(--sky-1); --raised: var(--sky-2);
  --ink: #e9f2ec; --muted: #8ba697; --faint: #739580;
  --line: #2f5131; --line-2: #406b42;
  --accent: var(--gold); --accent-bg: rgba(243,192,74,0.10); --link: var(--mint);
  --high: var(--insane); --high-bg: rgba(240,85,107,0.14);
  --med: var(--dawn); --med-bg: rgba(232,135,60,0.14);
  --low: #c6c35a; --low-bg: rgba(198,195,90,0.13);
  --ok: var(--leaf); --ok-bg: rgba(67,192,106,0.14);
  --info: var(--muted); --info-bg: rgba(255,255,255,0.05);
  --mono: "Space Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; position: relative; color: var(--ink); font: 14px/1.5 var(--sans); background: var(--bg); }
/* gold dawn glow on top, forest glow at the bottom, faint sparkle field (as on the CTF) */
body::after { content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(90% 60% at 50% -10%, rgba(243,192,74,0.09), transparent 60%),
              radial-gradient(130% 60% at 50% 114%, rgba(13,120,62,0.26), transparent 62%), var(--bg); }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .45;
  background-image:
    radial-gradient(1.4px 1.4px at 20% 30%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.2px 1.2px at 70% 20%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1.1px 1.1px at 40% 70%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.2px 1.2px at 55% 42%, rgba(243,192,74,0.5), transparent),
    radial-gradient(1px 1px at 92% 85%, rgba(95,211,160,0.5), transparent);
  background-size: 480px 480px, 560px 560px, 520px 520px, 700px 700px, 500px 500px; }
::selection { background: var(--gold); color: var(--on-gold); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a strong { color: var(--ink); }
code, .mono { font-family: var(--mono); font-size: 12px; }
code { background: var(--field); border: 1px solid var(--line); color: var(--mint); padding: 0 5px; border-radius: 5px; }
h1 { font-family: var(--mono); font-size: 21px; margin: 0 0 4px; font-weight: 700; letter-spacing: -0.01em; }
h1::before { content: "> "; color: var(--gold); }
h2 { font-family: var(--mono); font-size: 14px; margin: 0 0 12px; font-weight: 700; color: var(--ink); }
h3 { font-size: 14px; margin: 0; font-weight: 600; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }

/* ---- top bar: dark, anchored, gold→green hairline ---- */
header.top { background: rgba(4,15,9,0.94); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid rgba(255,255,255,0.06); }
header.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold) 25%, var(--leaf) 75%, transparent); opacity: .55; }
.top-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 26px; height: 58px; }
.brand { font-family: var(--mono); font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 9px; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: linear-gradient(145deg, var(--gold), var(--gold-dim)); color: var(--on-gold); font-size: 11px; box-shadow: 0 0 0 1px rgba(243,192,74,.35), 0 0 18px rgba(243,192,74,.18); }
.brand .ver { font-size: 10px; color: var(--on-gold); background: var(--gold); padding: 1px 6px; border-radius: 5px; letter-spacing: .02em; }
nav { display: flex; gap: 4px; }
nav a { font-family: var(--mono); font-size: 13px; color: var(--muted); padding: 6px 11px; border-radius: 7px; }
nav a:hover { text-decoration: none; color: var(--ink); background: rgba(255,255,255,0.06); }
nav a.on { color: var(--gold); background: rgba(243,192,74,0.10); box-shadow: inset 0 0 0 1px rgba(243,192,74,0.28); }
.statusbar { margin-left: auto; display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 12.5px; font-family: var(--mono); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; margin-right: 6px; box-shadow: 0 0 8px var(--ok); }
.pulse.err { background: var(--high); box-shadow: 0 0 8px var(--high); }
.clock { padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); color: var(--ink); font-weight: 700; }
.clock.live { background: var(--ok-bg); border-color: rgba(67,192,106,.35); color: var(--leaf); }
.clock.before { color: var(--gold); border-color: rgba(243,192,74,.3); }
.logout { margin: 0; }
.logout button { font: 12px var(--mono); color: var(--muted); background: none; border: 1px solid rgba(255,255,255,0.12); border-radius: 7px; padding: 4px 10px; cursor: pointer; }
.logout button:hover { color: var(--ink); border-color: var(--line-2); }

main { max-width: 1280px; margin: 0 auto; padding: 26px 24px 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 18px; }
.panel.flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: 2fr 1fr; } .g2e { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .g2, .g2e { grid-template-columns: 1fr; } .top-inner { gap: 14px; overflow-x: auto; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line-2); }
.stat .n { font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--gold); }
.stat .l { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.stat.high .n { color: var(--high); } .stat.high::before { background: var(--high); }
.stat.med .n { color: var(--med); } .stat.med::before { background: var(--med); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-family: var(--mono); font-weight: 700; color: var(--muted); font-size: 11px; text-transform: lowercase; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--field); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, tr:hover td { background: rgba(255,255,255,0.02); }
tr.click:hover td { background: var(--accent-bg); cursor: pointer; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; font-family: var(--mono); font-size: 11px; font-weight: 700; white-space: nowrap; }
.chip.high { background: var(--high-bg); color: var(--high); } .chip.medium { background: var(--med-bg); color: var(--med); }
.chip.low { background: var(--low-bg); color: var(--low); } .chip.info, .chip.clean { background: var(--info-bg); color: var(--info); }
.chip.ok, .chip.cleared { background: var(--ok-bg); color: var(--ok); }
.chip.reviewing { background: var(--accent-bg); color: var(--gold); }
.chip.disqualified { background: var(--high); color: #fff; }
.chip.unreviewed { background: transparent; color: var(--faint); border: 1px dashed var(--line-2); }
.sev-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.sev-dot.high { background: var(--high); } .sev-dot.medium { background: var(--med); } .sev-dot.low { background: var(--low); } .sev-dot.info { background: var(--faint); }

.score { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.score .bar { flex: 1; height: 6px; background: var(--field); border-radius: 99px; overflow: hidden; }
.score .bar span { display: block; height: 100%; border-radius: 99px; }
.score .num { font-family: var(--mono); font-size: 12px; width: 24px; text-align: right; }
.flags { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.flags div { display: flex; align-items: center; gap: 6px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--raised); color: var(--ink); font: 700 12.5px var(--mono); cursor: pointer; transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--gold); text-decoration: none; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.btn.primary:hover { background: #f7cf6d; }
.btn.small { padding: 3px 9px; font-size: 11.5px; }
.btn.danger { color: var(--high); } .btn.danger:hover { border-color: var(--high); }
input[type=text], input[type=password], input[type=datetime-local], input[type=number], select, textarea {
  font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(243,192,74,0.15); }
input[type=file] { color: var(--muted); font-size: 12.5px; }
input[type=file]::file-selector-button { font: 700 12px var(--mono); color: var(--ink); background: var(--raised); border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 10px; margin-right: 10px; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--gold); }
textarea { width: 100%; font-family: var(--mono); font-size: 12.5px; }
label.f { display: block; margin-bottom: 14px; } label.f > span { display: block; font-weight: 600; margin-bottom: 4px; } label.f small { display: block; color: var(--muted); margin-top: 3px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { font-family: var(--mono); font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 8px; color: var(--muted); border: 1px solid var(--line); background: var(--panel); }
.tabs a:hover { text-decoration: none; color: var(--ink); border-color: var(--line-2); }
.tabs a.on { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.msg { padding: 10px 14px; border-radius: 8px; background: var(--accent-bg); border-left: 3px solid var(--gold); margin-bottom: 14px; }
.msg.err { background: var(--high-bg); border-left-color: var(--high); color: var(--high); }

.finding { border: 1px solid var(--line); border-left: 3px solid var(--faint); border-radius: 0 8px 8px 0; padding: 14px 16px; margin-bottom: 10px; background: var(--panel); }
.finding.high { border-left-color: var(--high); } .finding.medium { border-left-color: var(--med); } .finding.low { border-left-color: var(--low); }
.finding .head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.finding .detail { margin: 6px 0 0; color: var(--muted); }
.finding ul.ev { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; }
.finding ul.ev li { margin: 2px 0; }
.why { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; margin-top: 10px; padding: 12px 14px; background: var(--field); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.why dt { color: var(--muted); font-weight: 600; } .why dd { margin: 0; }
details > summary { cursor: pointer; list-style: none; } details > summary::-webkit-details-marker { display: none; }
details.log { border-bottom: 1px solid var(--line); }
details.log > summary { display: grid; grid-template-columns: 112px 92px 1fr 220px 18px; gap: 14px; padding: 11px 16px; align-items: center; }
details.log > summary:hover { background: rgba(255,255,255,0.03); }
details.log[open] > summary { background: var(--raised); }
details.log .body { padding: 4px 16px 16px; }
.caret { color: var(--faint); transition: transform .15s; } details[open] .caret { transform: rotate(90deg); color: var(--gold); }
.users a { margin-right: 6px; }
.timeline { position: relative; height: 130px; border-bottom: 1px solid var(--line-2); margin: 8px 0 22px; }
.timeline .b { position: absolute; bottom: 0; width: 6px; margin-left: -3px; background: var(--leaf); border-radius: 2px 2px 0 0; opacity: .9; }
.timeline .b.late, .timeline .b.early { background: var(--high); } .timeline .b.force { background: var(--med); }
.timeline .cp { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--gold-dim); }
.timeline .ax { position: absolute; bottom: -20px; font-size: 11px; font-family: var(--mono); color: var(--faint); transform: translateX(-50%); }
.empty { padding: 36px; text-align: center; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; } .kv dt { color: var(--muted); }

/* ---- login ---- */
body.auth { display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 400px; }
.login .crest { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 22px; text-align: center; }
.login .crest .mark { width: 54px; height: 54px; border-radius: 14px; font-size: 17px; }
.login .crest .word { font-family: var(--mono); font-weight: 700; font-size: 19px; }
.login .crest .word .ver { font-size: 10px; vertical-align: 3px; margin-left: 6px; }
.login .card { background: rgba(21,43,23,0.88); border: 1px solid var(--line); border-radius: 12px; padding: 22px 22px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); position: relative; overflow: hidden; }
.login .card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--gold), var(--leaf)); }
.login .prompt { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.login .prompt b { color: var(--leaf); font-weight: 700; } .login .prompt i { font-style: normal; color: var(--gold); }
.login .cursor { display: inline-block; width: 7px; height: 14px; background: var(--gold); vertical-align: -2px; margin-left: 3px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .login .cursor { animation: none; } }
.login label.f > span { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 400; }
.login input[type=text], .login input[type=password] { width: 100%; padding: 10px 12px; font-family: var(--mono); font-size: 13.5px; }
.login .btn.primary { width: 100%; justify-content: center; padding: 10px; font-size: 13.5px; margin-top: 4px; }
.login .foot { text-align: center; margin-top: 16px; font-size: 12px; color: var(--faint); font-family: var(--mono); }
