/* ROS Origin Admin - the one stylesheet. Tokens and shapes are the accepted
   mockup's (.superpowers/sdd/2026-10-17-admin-panel-phase1/mockup-dashboard.html
   and mockup-pages.html). Light is :root; dark is [data-theme=dark], and
   prefers-color-scheme when no theme was chosen (a browser with scripts off).
   WARNING: this file is served immutable for a year at /static/v1/ - a change
   here needs a new version in the URL (render.go staticPrefix). */

:root {
  --bg:#f5f6f8; --panel:#ffffff; --side:#ffffff; --line:#e6e8ec; --line2:#eef0f3;
  --text:#1b1f27; --muted:#667085; --faint:#98a2b3;
  --accent:#3b6cf6; --accent-soft:#eaf0ff; --accent-text:#2550c9;
  --ok:#12a150; --ok-soft:#e7f6ee; --warn:#b7791f; --warn-soft:#fdf4e3;
  --bad:#d13c3c; --bad-soft:#fdecec; --shadow:0 1px 2px rgba(16,24,40,.06);
  color-scheme: light;
}
:root[data-theme=dark] {
  --bg:#0f1218; --panel:#171b23; --side:#131720; --line:#262c38; --line2:#1f2430;
  --text:#e6e9ef; --muted:#9aa3b2; --faint:#6b7486;
  --accent:#6b93ff; --accent-soft:#1f2a44; --accent-text:#a9c1ff;
  --ok:#3fcf86; --ok-soft:#14291f; --warn:#e3b257; --warn-soft:#2c2412;
  --bad:#ff6b6b; --bad-soft:#2d1719; --shadow:none;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg:#0f1218; --panel:#171b23; --side:#131720; --line:#262c38; --line2:#1f2430;
    --text:#e6e9ef; --muted:#9aa3b2; --faint:#6b7486;
    --accent:#6b93ff; --accent-soft:#1f2a44; --accent-text:#a9c1ff;
    --ok:#3fcf86; --ok-soft:#14291f; --warn:#e3b257; --warn-soft:#2c2412;
    --bad:#ff6b6b; --bad-soft:#2d1719; --shadow:none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 14px/1.45 Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--text); background: var(--bg);
}
a { color: var(--accent-text); }
svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8;
      stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* shell */
.ap { display: flex; min-height: 100vh; }

/* sidebar */
.side { width: 220px; flex: none; background: var(--side); border-right: 1px solid var(--line);
        padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 700; font-size: 15px; }
.logo i { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid;
          place-items: center; color: #fff; font-style: normal; font-size: 13px; }
.grp { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
       color: var(--faint); padding: 14px 10px 6px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
       color: var(--muted); text-decoration: none; }
.nav:hover { background: var(--line2); color: var(--text); }
.nav.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav .count { margin-left: auto; font-size: 11px; background: var(--line2); color: var(--muted);
              padding: 1px 7px; border-radius: 10px; }
.side .foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line);
              display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft);
          color: var(--accent-text); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.foot small { display: block; color: var(--faint); font-size: 12px; }
.foot .build { font-family: ui-monospace, Consolas, monospace; }

/* main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; container-type: inline-size; }
.head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 18px 24px;
        border-bottom: 1px solid var(--line); background: var(--panel); }
.head h1 { font-size: 20px; margin: 0; }
.head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.head .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.head form { margin: 0; }
.body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }

/* pills and buttons */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
        padding: 3px 10px; border-radius: 999px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--accent-soft); color: var(--accent-text); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.iconbtn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line);
           background: var(--panel); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.iconbtn:hover { background: var(--line2); }
.btn { display: inline-flex; align-items: center; gap: 6px; font-family: inherit; font-weight: 600; font-size: 12px; line-height: 1;
       padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel);
       color: var(--text); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--line2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.dangerfill { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { padding: 5px 9px; font-size: 12px; }
.btn[disabled] { opacity: .4; cursor: default; }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.card .ch { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line2); }
.card .ch h3 { margin: 0; font-size: 14px; }
.card .ch .sub { color: var(--faint); font-size: 12px; }
.card .ch .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card .cb { padding: 14px 16px; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--faint); padding: 8px 16px;
     border-bottom: 1px solid var(--line2); }
td { padding: 10px 16px; border-bottom: 1px solid var(--line2); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
td.act { text-align: right; white-space: nowrap; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); }

/* forms */
label { font-size: 12px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 5px; }
.field { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
         background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
.field:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.note { font-size: 12px; color: var(--faint); }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 13px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }

/* audit log: the filter row and the pager */
.acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.acts form.acts { margin-bottom: 0; }
.acts .push { margin-left: auto; }
.field.chipsel { width: auto; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600;
                 color: var(--muted); background: var(--panel); }
.pager { margin: 14px 0 0; justify-content: center; }
/* admin accounts page and the confirm step */
.stack { display: flex; flex-direction: column; gap: 14px; }
.narrow { max-width: 560px; }
.inl { display: inline-flex; gap: 6px; align-items: center; margin: 0 0 0 6px; }
td.act .inl:first-child { margin-left: 0; }
details.pop > summary { list-style: none; cursor: pointer; width: fit-content; margin-bottom: 10px; }
details.pop > summary::-webkit-details-marker { display: none; }
.stack p { margin: 0; font-size: 13px; line-height: 1.5; }
.pill.mute { background: var(--line2); color: var(--muted); }
td.wrap { overflow-wrap: anywhere; max-width: 360px; }

/* dashboard */
.contents { display: contents; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { padding: 16px; }
.kpi .lbl { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.kpi .num { font-size: 28px; font-weight: 700; margin: 6px 0 2px; letter-spacing: -.02em; }
.kpi .num.ok, .h .val.ok { color: var(--ok); }
.kpi .num.bad, .h .val.bad { color: var(--bad); }
.kpi .hint { font-size: 12px; color: var(--faint); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 0; }
.seg span, .seg button { padding: 5px 12px; font-family: inherit; font-weight: 600; font-size: 12px;
                         line-height: 1.2; color: var(--muted); background: none; border: 0; }
.seg button { cursor: pointer; }
.seg button:hover { background: var(--line2); }
.seg .on, .seg button.on:hover { background: var(--accent); color: #fff; }
.q { display: grid; grid-template-columns: 80px 1fr 44px auto; align-items: center; gap: 12px; padding: 9px 0;
     border-bottom: 1px solid var(--line2); }
.q.noctl { grid-template-columns: 80px 1fr 44px; }
.q:last-child { border-bottom: 0; }
.q .m { font-weight: 600; }
.q .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.q form.inl { margin: 0; }
.bar { height: 6px; border-radius: 6px; background: var(--line2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.health { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.h .lbl { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.h .val { font-weight: 700; font-size: 16px; }
.feed div { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line2); font-size: 13px; }
.feed div:last-child { border-bottom: 0; }
.feed time { color: var(--faint); width: 52px; flex: none; font-size: 12px; }
.feed p { margin: 0; }

/* login */
.loginwrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line);
         border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.login .logo { padding: 0 0 6px; justify-content: center; }
.login .btn.primary { justify-content: center; padding: 10px; }
.login .note { text-align: center; }

@container (max-width: 980px) {
  .head .right { margin-left: 0; }
  .grid2 { grid-template-columns: 1fr; }
  .kpis, .kpis.k3, .health { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .ap { flex-direction: column; }
  .side { width: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .head, .body { padding-left: 16px; padding-right: 16px; }
}

/* players page: the search row, filter chips and the character card */
.field.search { flex: 1; min-width: 220px; width: auto; }
.chip { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
        border: 1px solid var(--line); color: var(--muted); background: var(--panel); text-decoration: none; }
.chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.who { padding: 16px; border-bottom: 1px solid var(--line2); }
.who h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.who small { color: var(--faint); }
.who .pillrow { margin-top: 6px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 16px; }
.kv div { background: var(--bg); border-radius: 8px; padding: 9px 11px; }
.kv small { display: block; color: var(--faint); font-size: 11px; }
.kv b { font-size: 14px; }
.sec { padding: 12px 16px; border-top: 1px solid var(--line2); }
.sec h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.sec .acts { margin-bottom: 0; }

/* server stats (page_stats.go, stats.html): the answer, four tiles, folded
   sections. From the accepted mockup v4
   (.superpowers/sdd/2026-10-17-admin-server-stats/mockup-stats.html). */
.sel { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px;
       padding: 6px 10px; font-size: 13px; background: var(--panel); }
.verdict { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: 14px;
           border: 1px solid var(--line); background: var(--panel); }
.verdict .big { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 20px;
                font-weight: 800; flex: none; background: var(--line2); color: var(--muted); }
.verdict.ok .big { background: var(--ok-soft); color: var(--ok); }
.verdict.warn .big { background: var(--warn-soft); color: var(--warn); }
.verdict.bad .big { background: var(--bad-soft); color: var(--bad); }
.verdict h2 { margin: 0; font-size: 19px; }
.verdict p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.verdict p.note { color: var(--faint); font-size: 12px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 14px 16px;
        border-top: 4px solid var(--line); }
.tile.ok { border-top-color: var(--ok); }
.tile.warn { border-top-color: var(--warn); }
.tile.bad { border-top-color: var(--bad); }
.tile .t { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.tile .state { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--faint); }
.tile.ok .state { color: var(--ok); }
.tile.warn .state { color: var(--warn); }
.tile.bad .state { color: var(--bad); }
.tile .say { margin: 8px 0 10px; font-size: 13px; line-height: 1.4; min-height: 36px; }
.tile .nums { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.tile .nums b { display: block; font-size: 16px; color: var(--text); }
.tile .nums b.na { font-size: 12px; font-weight: 600; color: var(--faint); }
details.sec { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
details.sec + details.sec { margin-top: 10px; }
details.sec > summary { list-style: none; cursor: pointer; padding: 13px 16px; display: flex; align-items: center;
                        gap: 10px; font-weight: 600; font-size: 14px; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::before { content: "\25B8"; color: var(--faint); transition: transform .15s; }
details.sec[open] > summary::before { transform: rotate(90deg); }
details.sec > summary .sub { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--faint); }
details.sec .in { padding: 0 16px 14px; overflow-x: auto; }
.lane { display: flex; gap: 6px; flex-wrap: wrap; }
.lane span { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--line2); color: var(--muted); }
td.r { color: var(--bad); font-weight: 600; }
svg.line { width: 100%; height: 60px; display: block; }
svg.line path { stroke: var(--accent); fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark-empty { height: 60px; border-radius: 8px; background: var(--line2); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid3.metrics { margin-top: 14px; }
.metric { background: var(--bg); border-radius: 10px; padding: 9px 11px; font-size: 12px; color: var(--faint);
          overflow-wrap: anywhere; }
.metric b { display: block; font-size: 15px; color: var(--text); }
.cores { margin-top: 14px; max-width: 520px; }
.cores .q { padding: 4px 0; border-bottom: 0; }
.seg a { padding: 5px 12px; font-weight: 600; font-size: 12px; line-height: 1.2; color: var(--muted); text-decoration: none; }
.seg a:hover { background: var(--line2); }
.seg a.on { background: var(--accent); color: #fff; }
@container (max-width: 980px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3 { grid-template-columns: 1fr; }
}
