:root {
  --bg: #0B0E13;
  --bg-2: #181C22;
  --panel: #111419;
  --border: rgba(255,255,255,0.08);
  --text: #FFFFFF;
  --muted: #9CA5B1;
  --accent: #1264F3;
  --ok: #00C560;
  --ok-dim: #0A8A46;
  --accent-dim: #0D52CC;
  --warn: #FFB300;
  --danger: #FF1744;
  --info: #1677FF;
  --r: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent); }

.brand { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 700; color: var(--accent); }
.brand svg { width: 20px; height: 20px; fill: var(--accent); }
.brand em { font-style: normal; color: var(--text); font-weight: 400; }
.orgname { margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--border);
  font-weight: 400; font-size: 13px; color: var(--muted); }

/* ────────────────────────────── auth ────────────────────────────── */
.auth { min-height: 100svh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(110% 80% at 50% 10%, #0d1a2b, var(--bg) 65%); }
.auth-card { width: min(420px, 100%); padding: 26px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--r); }
.auth-tabs { display: flex; gap: 6px; margin: 20px 0 16px; }
.auth-tabs button { flex: 1; height: 36px; border: 1px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.auth-tabs button.on { background: rgba(18,100,243,0.12); border-color: var(--accent-dim); color: var(--accent); }
#auth-form label { display: block; margin-bottom: 12px; }
#auth-form span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--muted); margin-bottom: 4px; }
#auth-form input { width: 100%; height: 38px; padding: 0 12px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px; }
#auth-form input:focus { outline: none; border-color: var(--accent-dim); }
.err { color: var(--danger); font-size: 13px; }
.auth-note { margin-top: 18px; font-size: 12px; color: var(--muted); }

/* ────────────────────────────── shell ────────────────────────────── */
.top { display: flex; align-items: center; gap: 18px; padding: 10px clamp(12px, 3vw, 28px);
  border-bottom: 1px solid var(--border); background: rgba(10,15,24,0.9);
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; }
.tabs button { height: 34px; padding: 0 16px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.tabs button:hover { color: var(--text); }
.tabs button.on { background: rgba(18,100,243,0.12); border-color: var(--accent-dim); color: var(--accent); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who { font-size: 12px; color: var(--muted); }

main { max-width: 1240px; margin: 0 auto; padding: 22px clamp(12px, 3vw, 28px) 60px; }
.pane h2 { margin: 0; font-size: 17px; }
.col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

#auth-form button.primary { width: 100%; }
button.primary { height: 38px; padding: 0 20px; border: 1px solid var(--accent-dim); border-radius: 8px;
  background: rgba(18,100,243,0.16); color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; }
button.primary:hover { background: rgba(18,100,243,0.26); }
button.primary.sm { height: 32px; padding: 0 14px; font-size: 13px; }
button.ghost, a.ghost { height: 32px; padding: 0 12px; display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--muted);
  font-size: 12px; cursor: pointer; text-decoration: none; }
button.ghost:hover, a.ghost:hover { color: var(--accent); border-color: var(--accent-dim); }
button.danger { border-color: #7d2530; color: var(--danger); background: rgba(255,23,68,0.08); }

/* ────────────────────────────── lists ────────────────────────────── */
.split { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.list { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; min-height: 44px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; }
.row.sel { border-color: var(--accent-dim); background: rgba(18,100,243,0.07); }
.row .main { min-width: 0; }
.row b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row small { color: var(--muted); }
.row.clickable { cursor: pointer; }
.empty { color: var(--muted); }

.rowform { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.rowform input, .rowform select { height: 36px; padding: 0 10px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13px; min-width: 130px; }
.rowform input:focus, .rowform select:focus { outline: none; border-color: var(--accent-dim); }

/* ──────────────────────────── readiness ──────────────────────────── */
.m-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.m-head h3 { margin: 0 0 2px; font-size: 20px; }
.m-sub { color: var(--muted); font-size: 12px; }
.status-pill { padding: 8px 18px; border-radius: 999px; font-weight: 700; font-size: 14px;
  letter-spacing: 0.6px; border: 1px solid; }
.st-READY { color: var(--ok); border-color: var(--ok-dim); background: rgba(0,197,96,0.12); }
.st-BLOCKED { color: var(--danger); border-color: #7d2530; background: rgba(255,23,68,0.12); }
.st-INCOMPLETE { color: var(--muted); border-color: var(--border); background: rgba(255,255,255,0.05); }

.m-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 16px 0; }
.m-form label span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--muted); margin-bottom: 3px; }
.m-form input, .m-form select { width: 100%; height: 36px; padding: 0 10px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13px; }

.score-wrap { display: flex; align-items: center; gap: 16px; margin: 14px 0; }
.score { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.score small { font-size: 13px; color: var(--muted); font-weight: 400; }
.dims { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; margin-top: 8px; }
.dim { padding: 10px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; }
.dim .k { display: flex; justify-content: space-between; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.7px; color: var(--muted); margin-bottom: 4px; }
.dim p { margin: 0; font-size: 12.5px; line-height: 1.45; }
.lv-ok { color: var(--ok); font-weight: 700; }
.lv-warn { color: var(--warn); font-weight: 700; }
.lv-block { color: var(--danger); font-weight: 700; }
.lv-unknown { color: var(--muted); font-weight: 700; }
.dim.b-ok { border-left: 3px solid var(--ok-dim); }
.dim.b-warn { border-left: 3px solid var(--warn); }
.dim.b-block { border-left: 3px solid var(--danger); }
.dim.b-unknown { border-left: 3px solid var(--border); }

.frat { margin-top: 14px; padding: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; }
.frat h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--muted); }
.frat table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.frat td { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.frat td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.m-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100;
  padding: 9px 16px; background: var(--panel); border: 1px solid var(--accent-dim);
  border-radius: 999px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.badge { padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; }
.bd-overdue { background: rgba(255,23,68,0.15); color: var(--danger); }
.bd-urgent { background: rgba(255,179,0,0.15); color: var(--warn); }
.bd-due-soon { background: rgba(109,178,255,0.12); color: var(--info); }

.allowset { display: inline-flex; align-items: center; gap: 12px; padding: 0 6px; font-size: 12px; color: var(--muted); }
.allowset label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.allowset input { accent-color: var(--accent); }
.newmission { display: flex; gap: 8px; margin-bottom: 12px; }
.newmission input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13px; }
.newmission input:focus { outline: none; border-color: var(--accent-dim); }

/* ─────────────────────── auth value panel ─────────────────────── */
.auth { grid-template-columns: minmax(0, 520px) minmax(0, 420px); gap: clamp(24px, 5vw, 70px); }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-hero { max-width: 460px; } }
.ah-kicker { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 2px; color: var(--accent); }
.auth-hero h1 { margin: 0; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.08; letter-spacing: -0.02em; }
.ah-lede { margin: 16px 0 0; color: var(--muted); font-size: 15px; }
.ah-lede em { color: var(--text); font-style: normal; font-weight: 600; }
.ah-points { margin: 22px 0 0; padding: 0; list-style: none; }
.ah-points li { position: relative; padding: 10px 0 10px 22px; font-size: 13.5px; color: var(--muted);
  border-top: 1px solid var(--border); }
.ah-points li::before { content: ""; position: absolute; left: 2px; top: 17px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--accent); }
.ah-points b { color: var(--text); }
.ah-note { margin: 18px 0 0; font-size: 12px; color: var(--muted); }

/* ─────────────────── interaction polish (shared) ─────────────────── */
::selection { background: rgba(18, 100, 243, 0.28); color: #eafff7; }
:focus-visible { outline: 2px solid var(--accent-dim); outline-offset: 2px; border-radius: 4px; }
button, a, input, select { transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease; }
* { scrollbar-width: thin; scrollbar-color: #3A414B transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #3A414B; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #4A525E; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }
@media (prefers-reduced-motion: reduce) {
  button, a, input, select { transition: none; }
}
