/* admin.superorbit.app. System fonts only: the page loads nothing from anywhere else (see the CSP). */
:root {
  color-scheme: light;
  --bg: #f5f7fb; --panel: #ffffff; --panel-2: #f0f3fa; --line: #e2e7f1; --text: #0f1424; --muted: #5d6680; --faint: #8a93aa;
  --accent: #3d6fe6; --accent-soft: #e8efff; --accent-ink: #ffffff; --brand: #5b8cff; --chart: #3d6fe6; --grid: #e8ecf4;
  --good: #1d8a54; --good-soft: #e3f5ec; --warn: #a76200; --warn-soft: #fdf1dc; --bad: #c42b3a; --bad-soft: #fde7ea;
  --shadow: 0 1px 2px rgba(15, 20, 36, .05), 0 4px 16px rgba(15, 20, 36, .05);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) { color-scheme: dark;
    --bg: #0a0b0f; --panel: #13151b; --panel-2: #191c24; --line: #262a36; --text: #eef1f8; --muted: #a2a8b8; --faint: #6f7689;
    --accent: #5b8cff; --accent-soft: #18233f; --accent-ink: #0b1433; --chart: #5b8cff; --grid: #20242f;
    --good: #4cc98a; --good-soft: #10261b; --warn: #f0b04a; --warn-soft: #2a1f0c; --bad: #ff6b7a; --bad-soft: #2d1216;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); }
}
:root[data-theme='dark'] { color-scheme: dark;
  --bg: #0a0b0f; --panel: #13151b; --panel-2: #191c24; --line: #262a36; --text: #eef1f8; --muted: #a2a8b8; --faint: #6f7689;
  --accent: #5b8cff; --accent-soft: #18233f; --accent-ink: #0b1433; --chart: #5b8cff; --grid: #20242f;
  --good: #4cc98a; --good-soft: #10261b; --warn: #f0b04a; --warn-soft: #2a1f0c; --bad: #ff6b7a; --bad-soft: #2d1216;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.hidden { display: none !important; }
.gap-top { margin-top: 16px; }
hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 4px 0; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side-col { background: var(--panel); border-right: 1px solid var(--line); }
.shell > div { min-width: 0; }
.side { position: sticky; top: 0; height: 100vh; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 16px; }
.brand-mark { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #a3bdff, var(--brand) 55%, #2a4fb8); box-shadow: 0 0 0 3px var(--accent-soft); }
.brand small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--muted); font-weight: 550; font-size: 14px; }
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; text-align: center; }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; display: grid; gap: 8px; padding: 10px; font-size: 12.5px; color: var(--muted); }
.side-foot .row { display: flex; gap: 6px; flex-wrap: wrap; }
.main { padding: 28px 32px 60px; max-width: 1240px; width: 100%; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- pieces ---------- */
.grid { display: grid; gap: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card > h2 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tile { padding: 16px 18px; }
.tile .label { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.tile .value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cols-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.cols-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.big { height: 48px; padding: 0 22px; font-size: 16px; border-radius: 12px; width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 36px; min-width: 0; }
textarea { padding: 10px 12px; height: auto; min-height: 90px; width: 100%; resize: vertical; }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input[type='search'] { flex: 1 1 220px; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 650; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.pill.new { background: var(--accent-soft); color: var(--accent); }
.pill.looking, .pill.medium { background: var(--warn-soft); color: var(--warn); }
.pill.fixing { background: var(--accent-soft); color: var(--accent); }
.pill.fixed, .pill.good, .pill.active { background: var(--good-soft); color: var(--good); }
.pill.urgent, .pill.high, .pill.bad, .pill.past_due { background: var(--bad-soft); color: var(--bad); }
.pill.trialing { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

.needs { display: grid; gap: 8px; }
.need { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); color: var(--text); font-size: 14px; }
.need:hover { text-decoration: none; filter: brightness(.98); }
.need .dot { flex: none; }
.need.high .dot { color: var(--bad); } .need.medium .dot { color: var(--warn); } .need.low .dot { color: var(--accent); }
.need .go { margin-left: auto; color: var(--faint); }

/* the funnel and ranked bars */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 180px) 1fr 92px; align-items: center; gap: 10px; font-size: 13.5px; }
.bar-track { height: 10px; border-radius: 6px; background: var(--grid); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: var(--chart); min-width: 2px; }
.bar-row .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .mark { fill: var(--chart); }
.chart .mark:hover { opacity: .8; }
.chart .line { stroke: var(--chart); stroke-width: 2; fill: none; }

/* reports */
.report-list { display: grid; }
.report { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.report:hover { background: var(--panel-2); }
.report:last-child { border-bottom: none; }
.report .t { font-weight: 600; overflow-wrap: anywhere; }
.report .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.report .side-pills { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.src { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }
.detail { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.log { white-space: pre; overflow: auto; max-height: 340px; background: var(--panel-2); border-radius: 10px; padding: 12px; font: 12px/1.5 var(--mono); }
.shot { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; }
.msg { padding: 10px 0; border-bottom: 1px solid var(--line); }
.msg:last-child { border-bottom: none; }
.msg .who { font-weight: 650; font-size: 13px; }
.stack { display: grid; gap: 12px; }

/* discord */
.thread { padding: 14px 4px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.thread:last-child { border-bottom: none; }
.thread .top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.thread .t { font-weight: 650; }
.reply { font-size: 13.5px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 10px; overflow-wrap: anywhere; }
.reply b { color: var(--text); font-weight: 600; }

/* sign in */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.gate-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 32px 28px; display: grid; gap: 16px; text-align: center; }
.gate-card .brand-mark { width: 52px; height: 52px; margin: 0 auto 4px; }
.gate-card form { display: grid; gap: 10px; text-align: left; }
.gate-card input { height: 44px; width: 100%; }
.note { font-size: 13px; color: var(--muted); }
.error { color: var(--bad); font-size: 13.5px; font-weight: 550; }
.ok { color: var(--good); font-size: 13.5px; font-weight: 550; }
.secret { padding: 12px; border-radius: 10px; background: var(--panel-2); font: 13px/1.5 var(--mono); overflow-wrap: anywhere; user-select: all; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; z-index: 20; box-shadow: var(--shadow); }

/* ---------- phone ---------- */
.topbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side-col { display: none; }
  .topbar nav { min-width: 0; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 10; background: var(--panel); border-bottom: 1px solid var(--line); flex-direction: column; }
  .topbar .bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-weight: 700; }
  .topbar .bar .btn { margin-left: auto; }
  .topbar nav { display: flex; overflow-x: auto; gap: 4px; padding: 0 10px 10px; scrollbar-width: none; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a { padding: 6px 12px; border-radius: 18px; color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; background: var(--panel-2); }
  .topbar nav a.on { background: var(--accent); color: var(--accent-ink); }
  .main { padding: 18px 14px 50px; }
  h1 { font-size: 21px; }
  .cols-2, .cols-even, .detail { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile .value { font-size: 24px; }
  .bar-row { grid-template-columns: 96px 1fr 76px; }
  .hide-phone { display: none; }
}
