/* NAPP Performance Lab — navy / electric blue / fire orange, condensed military headings */
@font-face { font-family: "Oswald"; font-weight: 600; font-display: swap; src: url(/static/fonts/oswald-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Oswald"; font-weight: 700; font-display: swap; src: url(/static/fonts/oswald-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Rajdhani"; font-weight: 600; font-display: swap; src: url(/static/fonts/rajdhani-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Rajdhani"; font-weight: 700; font-display: swap; src: url(/static/fonts/rajdhani-latin-700-normal.woff2) format("woff2"); }

:root {
    --bg: #070d18; --panel: #0d1626; --panel-2: #142034; --panel-3: #1a2a44; --border: #1f3150;
    --text: #e8eef8; --muted: #8a9bb5; --blue: #1f7bff; --blue-2: #3d9bff; --blue-glow: rgba(31, 123, 255, .35);
    --orange: #ff7a1a; --fire: #ff4d1a; --danger: #ff4d4d; --ok: #2fd27a; --warn: #ffb020; --purple: #a259ff;
    --head: "Oswald", "Arial Narrow", sans-serif; --tac: "Rajdhani", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, "Segoe UI", sans-serif; }
a { color: var(--blue-2); }
h1 { font-family: var(--head); font-weight: 600; font-size: 26px; letter-spacing: .5px; margin: 0 0 16px; }
h1 .accent { color: var(--muted); font-weight: 600; }
h3 { font-family: var(--tac); font-weight: 700; font-size: 18px; letter-spacing: .3px; margin: 0 0 12px; }
.muted { color: var(--muted); } .small { font-size: 12px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 220px; flex-shrink: 0; background: linear-gradient(180deg, #0b1426, #070d18); border-right: 1px solid var(--border);
           display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar-logo { display: block; padding: 14px 22px 6px; }
.sidebar-logo img { width: 100%; display: block; filter: drop-shadow(0 6px 14px rgba(0,0,0,.6)); }
.nav { padding: 6px 0; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 20px; color: #c3cfe3; text-decoration: none;
         font-family: var(--tac); font-weight: 600; font-size: 16px; border-left: 3px solid transparent; }
.nav a i { width: 20px; text-align: center; color: var(--blue-2); }
.nav a:hover { background: var(--panel-2); color: #fff; }
.nav a.active { background: linear-gradient(90deg, var(--blue), rgba(31,123,255,.15)); color: #fff; border-left-color: #8cc4ff; }
.nav a.active i { color: #fff; }
.sidebar-art { margin-top: auto; height: 170px; position: relative; overflow: hidden;
               background: linear-gradient(180deg, #070d18 0%, rgba(7,13,24,0) 35%, rgba(7,13,24,.2) 60%, #070d18 100%),
                           url(/static/img/sidebar-soldier.jpg) center / cover no-repeat; }
.sidebar-art-text { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-family: var(--head);
                    font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: 2px; text-shadow: 0 2px 10px #000; }
.sidebar-art-text span { display: block; font-family: var(--tac); font-size: 12px; letter-spacing: 2px; color: #cfd8e6; margin-top: 4px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- banner ---------- */
.banner { position: relative; display: flex; align-items: stretch; min-height: 118px; border-bottom: 1px solid var(--border);
          background: radial-gradient(ellipse at 60% 120%, rgba(255,90,20,.25), transparent 55%), linear-gradient(90deg, #08101f, #0b1730 55%, #08101f); }
.banner-title { padding: 14px 24px; z-index: 1; }
.banner-kicker { font-family: var(--head); font-weight: 700; font-size: 20px; letter-spacing: 3px; color: #fff; line-height: 1.1; }
.banner-kicker::after { content: ""; display: inline-block; width: 46px; height: 4px; margin-left: 10px; vertical-align: middle;
                        background: linear-gradient(90deg, var(--fire), var(--orange)); }
.banner-name { font-family: var(--head); font-weight: 700; font-size: 38px; line-height: 1.05; letter-spacing: 1px;
               color: var(--blue-2); text-shadow: 0 0 18px var(--blue-glow); }
.banner-slogan { font-family: var(--tac); font-weight: 600; font-size: 13px; letter-spacing: 3px; color: #c7d2e4; margin-top: 4px; }
.banner-slogan b { color: var(--blue-2); margin: 0 4px; }
.banner-art { flex: 1; min-width: 120px; position: relative;
              background: linear-gradient(90deg, #0a1428 0%, rgba(10,20,40,0) 30%, rgba(10,20,40,0) 70%, #08101f 100%),
                          url(/static/img/banner-soldier.jpg) center 30% / cover no-repeat; }
.banner-art span { position: absolute; right: 18px; bottom: 14px; font-family: var(--head); font-style: italic; font-weight: 700;
                   font-size: 20px; line-height: 1.05; text-align: right; color: var(--blue-2); text-shadow: 0 2px 8px #000; transform: skewX(-8deg); }
.banner-side { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; justify-content: center; z-index: 1; }
.user-card, .ai-card { display: flex; align-items: center; gap: 10px; background: rgba(13,22,38,.85); border: 1px solid var(--border);
                       border-radius: 8px; padding: 7px 12px; min-width: 230px; }
.avatar { font-size: 22px; color: #c3cfe3; width: 26px; text-align: center; }
.user-name { font-family: var(--tac); font-weight: 700; font-size: 16px; line-height: 1.1; }
.user-team { font-size: 12px; color: var(--orange); font-weight: 600; }
.user-links { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.user-links a, .user-links button { color: var(--muted); background: none; border: 0; cursor: pointer; font-size: 15px; padding: 0; }
.user-links a:hover, .user-links button:hover { color: #fff; }
.user-links form { margin: 0; }
.ai-card .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 8px var(--danger); flex-shrink: 0; }
.ai-connected .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.ai-model-missing .dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.ai-name { font-family: var(--tac); font-weight: 700; font-size: 14px; line-height: 1.1; }
.ai-state { font-size: 12px; color: var(--ok); line-height: 1.2; }
.ai-offline .ai-state { color: var(--danger); } .ai-model-missing .ai-state { color: var(--warn); }
.ai-sub { font-size: 11px; color: var(--muted); }
.env-badge { background: var(--orange); color: #000; font-weight: 700; padding: 0 6px; border-radius: 3px; font-size: 11px; }

.content { flex: 1; padding: 20px 24px; }
.footbar { display: flex; align-items: center; gap: 18px; padding: 10px 24px; border-top: 1px solid var(--border); background: #060b15;
           font-family: var(--tac); font-weight: 600; letter-spacing: 3px; font-size: 12px; color: #c7d2e4; }
.footbar i { flex: 1; height: 2px; background: linear-gradient(90deg, var(--blue), transparent); }
.footbar b { color: var(--blue-2); }

/* ---------- building blocks ---------- */
.card { background: linear-gradient(180deg, var(--panel), #0b1322); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.card-head a { font-size: 13px; text-decoration: none; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.stats.four { grid-template-columns: repeat(4, 1fr); }
.stat { display: flex; align-items: center; gap: 14px; margin: 0; }
.stat-icon { width: 52px; height: 52px; border-radius: 10px; display: grid; place-items: center; font-size: 24px; flex-shrink: 0; }
.i-blue { background: rgba(31,123,255,.18); color: var(--blue-2); } .i-green { background: rgba(47,210,122,.15); color: var(--ok); }
.i-orange { background: rgba(255,122,26,.15); color: var(--orange); } .i-purple { background: rgba(162,89,255,.16); color: var(--purple); }
.i-red { background: rgba(255,77,77,.15); color: var(--danger); }
.stat-value { font-family: var(--head); font-size: 30px; font-weight: 600; line-height: 1; }
.stat-label { color: #c3cfe3; font-weight: 600; }
.stat-sub { color: var(--muted); font-size: 12px; }
.empty { text-align: center; padding: 40px 16px; }
.empty i { font-size: 40px; color: var(--blue-2); margin-bottom: 12px; }
.empty p { color: var(--muted); max-width: 520px; margin: 0 auto 16px; }
.warn { border-color: var(--warn); color: #ffd98a; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td:first-child { white-space: normal; word-break: break-all; }
th { color: var(--muted); font-weight: 600; font-family: var(--tac); font-size: 14px; letter-spacing: .5px; }
.actions { text-align: right; }
.btn { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(180deg, var(--blue-2), var(--blue)); color: #fff;
       border: 0; border-radius: 7px; padding: 9px 16px; cursor: pointer; text-decoration: none; font: 600 15px var(--tac); letter-spacing: .5px;
       box-shadow: 0 4px 14px var(--blue-glow); }
.btn:hover { filter: brightness(1.1); }
.btn.big { padding: 12px 22px; font-size: 18px; }
.btn.small { padding: 4px 10px; font-size: 13px; box-shadow: none; }
.btn.danger { background: linear-gradient(180deg, #ff6b6b, var(--danger)); box-shadow: none; }
.btn.ghost { background: var(--panel-2); box-shadow: none; border: 1px solid var(--border); }
.btn.wide { width: 100%; justify-content: center; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 5px; font-size: 12px; font-weight: 600; background: var(--panel-3); }
.status { padding: 2px 8px; border-radius: 5px; font-size: 12px; font-weight: 600; background: var(--panel-3); }
.status-done { color: var(--ok); background: rgba(47,210,122,.12); } .status-failed { color: var(--danger); background: rgba(255,77,77,.12); }
.status-running, .status-queued { color: var(--warn); background: rgba(255,176,32,.12); }

/* ---------- dashboard ---------- */
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.welcome h1 { margin: 0; } .welcome h1 i { color: #ffc531; font-size: 22px; }
.welcome p { margin: 2px 0 0; color: var(--muted); }
.welcome-right { display: flex; align-items: center; gap: 18px; }
.clock { text-align: right; color: #c3cfe3; font-size: 13px; }
.dash-row { display: grid; gap: 16px; }
.dash-row.r1 { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); }
.dash-row.r2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, .9fr); }
.vgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.vcard { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; text-decoration: none; color: inherit; display: block; }
.vthumb { position: relative; aspect-ratio: 16 / 9; background: #0a1220 center / cover no-repeat; display: grid; place-items: center; color: var(--muted); }
.vthumb .badge { position: absolute; left: 6px; top: 6px; width: 34px; }
.vthumb .dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.75); padding: 1px 6px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.vinfo { padding: 8px 10px; }
.vname { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vmeta { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.profile { display: flex; gap: 14px; align-items: center; }
.profile .pad { font-size: 64px; color: var(--blue-2); text-shadow: 0 0 24px var(--blue-glow); }
.kv { width: 100%; font-size: 13px; }
.kv td { border: 0; padding: 3px 0; white-space: nowrap; }
.kv td:first-child { color: var(--muted); word-break: normal; }
.kv td:last-child { color: var(--blue-2); font-weight: 600; text-align: right; }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.mini { display: flex; gap: 8px; align-items: center; background: var(--panel-2); border-radius: 8px; padding: 8px; }
.mini .stat-icon { width: 36px; height: 36px; font-size: 16px; }
.mini b { display: block; font-family: var(--head); font-size: 18px; font-weight: 600; line-height: 1.1; }
.mini span { font-size: 11px; color: var(--muted); }
.rec-list a { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 8px; background: var(--panel-2); margin-bottom: 8px;
              color: inherit; text-decoration: none; }
.rec-list a:hover { background: var(--panel-3); }
.rec-list i.cat { font-size: 20px; color: var(--blue-2); width: 26px; text-align: center; }
.rec-list b { display: block; font-size: 14px; } .rec-list span { font-size: 12px; color: var(--muted); }
.rec-list .fa-chevron-right { margin-left: auto; color: var(--muted); }
.quick a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 8px; border-radius: 8px; background: var(--panel-2);
           color: var(--text); text-decoration: none; font-weight: 600; }
.quick a:first-child { background: linear-gradient(90deg, var(--blue), var(--blue-2)); }
.quick a i:first-child { color: var(--blue-2); width: 18px; text-align: center; } .quick a:first-child i { color: #fff; }
.quick a .fa-chevron-right { margin-left: auto; color: var(--muted); }

/* ---------- reports / labs ---------- */
table.recs td { white-space: normal; vertical-align: top; }
table.recs td.why { max-width: 420px; color: var(--muted); }
td.suggested { color: var(--ok); font-weight: 700; font-size: 15px; }
.conf { padding: 2px 8px; border-radius: 5px; font-size: 12px; font-weight: 600; background: var(--panel-3); }
.conf-high { color: var(--ok); } .conf-medium { color: var(--warn); } .conf-low { color: var(--muted); }
.timeline { display: flex; height: 18px; border-radius: 4px; overflow: hidden; }
.timeline .tl { flex: 1; }
.tl { display: inline-block; width: 12px; height: 12px; background: #4a5568; }
.tl-gameplay { background: var(--ok); } .tl-dead, .tl-killcam { background: var(--danger); }
.legend { margin-top: 8px; color: var(--muted); font-size: 12px; display: flex; gap: 8px; align-items: center; }
.summary { white-space: pre-wrap; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs img { width: 220px; border-radius: 6px; border: 1px solid var(--border); }
details summary { cursor: pointer; font-weight: 600; }
details h4 { margin: 16px 0 4px; color: var(--muted); }
.charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.chart { min-width: 0; }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; margin-bottom: 4px; }
.field input, .field select { width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
                              border-radius: 6px; padding: 7px 9px; font: inherit; }
.field input:focus, .field select:focus { outline: 2px solid var(--blue); border-color: transparent; }
form#settings-form > .btn { position: sticky; bottom: 12px; }
.card.narrow { max-width: 480px; }

/* ---------- upload ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 16px; border: 2px dashed #2b4570;
            border-radius: 10px; text-align: center; background: rgba(31,123,255,.04); }
.dropzone i { font-size: 44px; color: var(--blue-2); }
.dropzone.over { border-color: var(--blue-2); background: rgba(31,123,255,.1); }
.dropzone .btns { display: flex; gap: 10px; margin-top: 8px; }
.queue { margin-top: 16px; }
.qrow { display: grid; grid-template-columns: minmax(0, 1fr) 220px 200px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.qname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qstate { font-size: 13px; color: var(--muted); }
.qstate.ok { color: var(--ok); } .qstate.bad { color: var(--danger); } .qstate.skip { color: var(--warn); }
.progress { height: 8px; background: var(--panel-3); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--blue-2)); transition: width .2s; }
.howto ol { margin: 0; padding-left: 20px; } .howto li { margin-bottom: 4px; }
code { background: var(--panel-2); padding: 2px 6px; border-radius: 4px; font-family: ui-monospace, monospace; }

/* ---------- sign-in pages ---------- */
body.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px;
            background: radial-gradient(ellipse at 50% 110%, rgba(255,90,20,.18), transparent 50%), var(--bg); }
.auth-box { width: 100%; max-width: 400px; }
.auth-logo { display: block; width: 150px; margin: -6px auto 6px; }
.auth-title { text-align: center; font-family: var(--head); font-weight: 700; font-size: 22px; letter-spacing: 1px; color: var(--blue-2); margin-bottom: 14px; }
.error { background: rgba(255,77,77,.12); border: 1px solid var(--danger); color: #ffb4ae; border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; }
.qr { background: #fff; padding: 8px; border-radius: 6px; width: fit-content; margin: 8px auto; }
.qr svg { display: block; }
.steps { padding-left: 20px; margin: 0 0 8px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 16px; }

@media (max-width: 1100px) {
    .banner-art { display: none; }
    .dash-row.r1, .dash-row.r2 { grid-template-columns: minmax(0, 1fr); }
    .stats.four { grid-template-columns: repeat(2, 1fr); }
}
.dropzone .btns i { font-size: 16px; color: inherit; }
.nav a { font-size: 15px; white-space: nowrap; }
.profile .pad { font-size: 48px; }
.profile .kv { min-width: 0; }
.profile { min-width: 0; }
.photo-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; }
.photo-card p { margin: 0; }
.photo-status { grid-column: 1 / -1; font-size: 14px; }
.photo-status:empty { display: none; }
.photo-status.ok { color: var(--ok); } .photo-status.bad { color: var(--danger); }
.hl, .field.filled input, .field.filled select { background: rgba(255,176,32,.14); border-color: var(--warn); }
.hl { padding: 0 4px; border-radius: 3px; color: var(--warn); }
.tunable { color: var(--orange); font-size: 12px; }
.note { color: var(--warn); }
.field.check input { background: rgba(255,77,77,.14); border-color: var(--danger); }
.field.check > span::after { content: "  ⚠ please check"; color: var(--danger); font-size: 12px; font-weight: 600; }
.checkmsg { color: #ffb4ae; }
.profile-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs { display: inline-flex; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.tabs a { padding: 8px 18px; border-radius: 6px; color: var(--muted); text-decoration: none; font: 700 16px var(--tac); letter-spacing: .5px; }
.tabs a.active { background: linear-gradient(180deg, var(--blue-2), var(--blue)); color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.mode-chip { display: inline-block; padding: 0 7px; border-radius: 4px; font: 700 11px var(--tac); letter-spacing: .5px; vertical-align: middle;
             background: rgba(31,123,255,.18); color: var(--blue-2); }
.mode-chip.mode-warzone { background: rgba(255,122,26,.16); color: var(--orange); }
h1 .mode-chip { font-size: 14px; padding: 2px 10px; }
.mode-pick { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; font-weight: 600; }
.mode-pick label { cursor: pointer; } .mode-pick input { accent-color: var(--blue); }
.mode-select { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 5px; padding: 2px 4px; }
.kvh { color: var(--muted) !important; font-size: 11px; }
.kv td:nth-child(2), .kv td:nth-child(3) { padding-left: 10px; }
.inline-form label { color: var(--muted); font-weight: 600; }
.inline-form select { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 5px; padding: 3px 6px; }
.plan-group { margin: 16px 0 6px; font: 700 16px var(--tac); color: var(--blue-2); }
.plan-group:first-of-type { margin-top: 0; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.check-row { display: flex; gap: 8px; align-items: center; margin: 4px 0 12px; }
.ok-text { color: var(--ok); } .warn-text { color: var(--warn); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.request-link { text-align: center; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.inline-input { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font: inherit; }
.wide-input { min-width: 280px; flex: 1; }
