/* racksh · panel. Same design system as the mockup (web/maqueta). */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/PlusJakartaSans-latin.woff2") format("woff2");
}
:root {
  --bg: #F4F6FB; --surface: #FFFFFF; --sunk: #F1F3F9; --ink: #121921; --ink-2: #37414F; --muted: #667085; --faint: #98A2B3;
  --rule: #E4E7EF; --rule-2: #EEF0F6;
  --brand: #018BFC; --accent: #0870CE; --accent-2: #065DAD; --accent-soft: #E6F2FE; --on-accent: #FFFFFF;
  --ok: #0F9F6E; --ok-soft: #E3F6EE; --warn: #B86E00; --warn-soft: #FDF3DC; --bad: #D92D20; --bad-soft: #FDECEA;
  --drift: #0B83A3; --drift-soft: #E0F4FA;
  --t-blue: #0870CE; --t-blue-b: #E6F2FE; --t-teal: #0E9384; --t-teal-b: #DEF5F1; --t-amber: #B86E00; --t-amber-b: #FDF1D6;
  --t-rose: #D6336C; --t-rose-b: #FCE9F0; --t-green: #0F9F6E; --t-green-b: #E3F6EE;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 2px 6px rgba(16,24,40,.05);
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "DejaVu Sans Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0D111A; --surface: #151B27; --sunk: #1B2231; --ink: #E7EAF2; --ink-2: #C4CAD6; --muted: #98A2B3; --faint: #667085;
    --rule: #252D3D; --rule-2: #1E2533;
    --brand: #2E9DFF; --accent: #5AB0FF; --accent-2: #85C4FF; --accent-soft: #10263D; --on-accent: #0D111A;
    --ok: #3CCB93; --ok-soft: #12291F; --warn: #F2B544; --warn-soft: #2C2412; --bad: #F97066; --bad-soft: #33191A;
    --drift: #4CC3E0; --drift-soft: #102A33;
    --t-blue: #5AB0FF; --t-blue-b: #10263D; --t-teal: #3CC7B6; --t-teal-b: #10292A; --t-amber: #F2B544; --t-amber-b: #2C2412;
    --t-rose: #F47FA0; --t-rose-b: #33191F; --t-green: #3CCB93; --t-green-b: #12291F;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D111A; --surface: #151B27; --sunk: #1B2231; --ink: #E7EAF2; --ink-2: #C4CAD6; --muted: #98A2B3; --faint: #667085;
  --rule: #252D3D; --rule-2: #1E2533;
  --brand: #2E9DFF; --accent: #5AB0FF; --accent-2: #85C4FF; --accent-soft: #10263D; --on-accent: #0D111A;
  --ok: #3CCB93; --ok-soft: #12291F; --warn: #F2B544; --warn-soft: #2C2412; --bad: #F97066; --bad-soft: #33191A;
  --drift: #4CC3E0; --drift-soft: #102A33;
  --t-blue: #5AB0FF; --t-blue-b: #10263D; --t-teal: #3CC7B6; --t-teal-b: #10292A; --t-amber: #F2B544; --t-amber-b: #2C2412;
  --t-rose: #F47FA0; --t-rose-b: #33191F; --t-green: #3CCB93; --t-green-b: #12291F;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono, code { font-family: var(--mono); font-size: .92em; }
code { background: var(--sunk); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wordmark { display: block; height: 19px; width: auto; color: var(--ink); }
.brand-fill { fill: var(--brand); }

/* shell */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100%; }
.side { background: var(--surface); border-right: 1px solid var(--rule); padding: 18px 14px 20px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px; text-decoration: none; color: inherit; }
.brand img { width: 40px; height: auto; }
.brand .tag { font-size: 12px; color: var(--muted); margin-top: 3px; }
.navgrp { display: grid; gap: 2px; }
.navgrp > span { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 6px; }
.navgrp a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 500; text-decoration: none; }
.navgrp a .ic { color: var(--faint); }
.navgrp a:hover { background: var(--sunk); }
.navgrp a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.navgrp a[aria-current="page"] .ic { color: var(--accent); }
.side .foot { margin-top: auto; font-size: 12px; color: var(--faint); padding: 0 8px; }
.col { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 32px; background: var(--bg); border-bottom: 1px solid var(--rule); }
.crumbs { color: var(--muted); font-size: 13px; }
.crumbs b { color: var(--ink); font-weight: 600; }
.top .sp { flex: 1; }
.ib { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--rule); background: var(--surface); border-radius: 12px; cursor: pointer; color: var(--ink-2); }
.user { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border: 1px solid var(--rule); background: var(--surface); border-radius: 999px; }
.av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12.5px; }
.user b { display: block; font-size: 13px; line-height: 1.2; }
.user span { font-size: 11.5px; color: var(--muted); }
main { padding: 28px 32px 48px; }
.sec { display: grid; gap: 22px; max-width: 1240px; }
.pagehead h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.pagehead p { color: var(--muted); margin-top: 4px; }

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 16px 20px; border-bottom: 1px solid var(--rule-2); }
.card-h h3 { font-size: 15px; font-weight: 600; }
.card-b { padding: 18px 20px; }
.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.stat { padding: 18px 20px; display: grid; gap: 8px; }
.stat .l { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat .big { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat .big small { font-size: 14px; font-weight: 500; color: var(--muted); }
.stat.ok .big { color: var(--ok); } .stat.warn .big { color: var(--warn); } .stat.bad .big { color: var(--bad); } .stat.drift .big { color: var(--drift); }
.tile { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--t-blue-b); color: var(--t-blue); }
.tile.rose { background: var(--t-rose-b); color: var(--t-rose); } .tile.teal { background: var(--t-teal-b); color: var(--t-teal); }
.tile.amber { background: var(--t-amber-b); color: var(--t-amber); } .tile.green { background: var(--t-green-b); color: var(--t-green); }

.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px 3px 8px; border-radius: 999px; white-space: nowrap; background: var(--sunk); color: var(--muted); }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st.Ready { background: var(--ok-soft); color: var(--ok); } .st.Progressing { background: var(--accent-soft); color: var(--accent); }
.st.Failed { background: var(--bad-soft); color: var(--bad); } .st.Drifted { background: var(--drift-soft); color: var(--drift); }
.st.Planned { background: var(--warn-soft); color: var(--warn); }

.tbl { overflow-x: auto; }
.tbl table { width: 100%; border-collapse: collapse; min-width: 600px; }
.tbl th, .tbl td { text-align: left; padding: 12px 20px; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
.tbl th { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--sunk); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.r, .tbl th.r { text-align: right; }
.list { display: grid; }
.li { display: flex; align-items: flex-start; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--rule-2); }
.li:last-child { border-bottom: 0; }
.li .txt { flex: 1; min-width: 0; }
.li .txt b { font-weight: 600; }
.li .txt .small { display: block; color: var(--muted); }
details summary { cursor: pointer; color: var(--accent); font-size: 12.5px; margin-top: 6px; }
pre.diff { margin: 8px 0 0; padding: 12px 14px; overflow-x: auto; font: 12px/1.6 var(--mono); background: var(--sunk); border-radius: 10px; white-space: pre; }
.empty { padding: 28px 20px; color: var(--muted); text-align: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.link { border-color: transparent; background: none; color: var(--muted); padding: 0 8px; }
.field { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password] { border: 1px solid var(--rule); background: var(--surface); border-radius: 10px; padding: 10px 12px; width: 100%; font-size: 15px; font-weight: 400; }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input.code { font: 22px var(--mono); letter-spacing: .3em; text-align: center; }
.msg { padding: 12px 16px; border-radius: 12px; font-size: 13.5px; }
.msg.error { background: var(--bad-soft); color: var(--bad); }
.msg.ok { background: var(--ok-soft); color: var(--ok); }

/* sign-in pages */
.auth { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; }
.auth .card { width: 100%; max-width: 420px; }
.auth .card-b { display: grid; gap: 16px; padding: 28px; }
.auth .brand { justify-content: center; margin-bottom: 4px; }
.auth h1 { font-size: 20px; font-weight: 700; text-align: center; }
.auth .lead { color: var(--muted); text-align: center; }
.qr { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 12px; border: 1px solid var(--rule); }
.qr svg { width: 200px; height: 200px; }
.secret { font-family: var(--mono); font-size: 13px; word-break: break-all; text-align: center; background: var(--sunk); padding: 8px; border-radius: 8px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side .navgrp { display: flex; }
  .side .navgrp > span, .side .foot { display: none; }
  .top, main { padding-left: 16px; padding-right: 16px; }
  .user .who { display: none; }
}
