/* Norbi Beta Hub operator panel. Tokens mirror client/norbi-beta-tester/src/styles.css. */
:root {
  --bg: #0b0e12; --surface: #101419; --surface-2: #14191f; --line: #252b33; --line-soft: #1e242b;
  --text: #e8edf3; --text-soft: #abb4bd; --muted: #79838e; --muted-2: #68737e;
  --cyan: #37d4dc; --cyan-soft: #5bdce2; --amber: #f2b421; --green: #57dc74; --red: #f0aaaa;
  font-family: Inter, ui-sans-serif, "Segoe UI", system-ui, sans-serif; color: var(--text); background: var(--bg);
  font-synthesis: none; -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 72% -10%, #172126 0, transparent 34%), var(--bg); }
a { color: var(--cyan); text-decoration: none; } a:hover { color: #65e8ee; }
button, input, select { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #65e8ee; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Shell */
.shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; border-right: 1px solid #20262d; background: #0d1015; padding: 28px 18px 18px; display: flex; flex-direction: column; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 10px 34px; color: inherit; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; transform: rotate(45deg); border: 1px solid #41d9e1; color: #52e5ed; font-weight: 900; background: #142124; box-shadow: 0 0 22px #27b9c733; flex: none; }
.brand-mark span { display: block; transform: rotate(-45deg); }
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: 19px; letter-spacing: .02em; font-weight: 700; }
.brand-text span { font-size: 11px; color: #3ed9e2; }
.nav { display: grid; gap: 5px; }
.nav a { color: #8f99a5; display: flex; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; }
.nav a svg { width: 17px; height: 17px; flex: none; }
.nav a:hover { color: #fff; background: #171c22; }
.nav a[aria-current="page"] { color: #dffcff; background: linear-gradient(90deg, #193038, #121b20); box-shadow: inset 2px 0 #41dce4; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid #20262d; padding: 20px 8px 2px; display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; }
.avatar { width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center; background: #12171d; border: 1px solid #64707b; color: #d7e0e6; font-size: 11px; font-weight: 800; }
.who { display: flex; flex-direction: column; font-size: 11px; min-width: 0; }
.who small { color: #707b87; margin-top: 3px; }
.who form { display: inline; } .who button { border: 0; background: none; color: var(--cyan); padding: 0; cursor: pointer; font-size: 11px; }
.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 42px; border-bottom: 1px solid #20262d; display: flex; justify-content: flex-end; align-items: center; padding: 0 36px; gap: 18px; background: #0b0f13cc; font-size: 11px; color: #82909a; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #41d69c; box-shadow: 0 0 10px #41d69c; margin-right: 7px; }
.dot.warn { background: var(--amber); box-shadow: none; }
.content { flex: 1; padding: 30px clamp(20px, 3vw, 48px) 24px; display: flex; flex-direction: column; gap: 22px; }
.content.with-rail { display: grid; grid-template-columns: minmax(0, 1fr) 282px; gap: 28px; align-items: start; }
.main { min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.rail { display: grid; align-content: start; gap: 12px; }
.footer { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid #20262d; color: #4f5963; font-size: 9px; padding: 12px 36px; background: #0c1014; }

/* Page head */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 25px; flex-wrap: wrap; }
.eyebrow { font-size: 9px; letter-spacing: .2em; font-weight: 800; color: var(--cyan-soft); text-transform: uppercase; }
.page-head h1 { font-size: 25px; line-height: 1; margin: 10px 0 9px; letter-spacing: -.035em; }
.page-head p { margin: 0; color: #8b949e; font-size: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 750; padding: 11px 15px; }
.button.primary { background: var(--cyan); color: #071114; box-shadow: 0 7px 22px #20c5d124; } .button.primary:hover { background: #65e8ee; color: #071114; }
.button.ghost { background: transparent; border: 1px solid #333c46; color: #9ba6b0; } .button.ghost:hover { color: #fff; border-color: #4a626b; }

/* KPIs and cards */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi, .card { border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(145deg, #14191f, #101419); }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; color: inherit; }
.kpi .label { font-size: 9px; letter-spacing: .16em; font-weight: 800; color: var(--cyan-soft); text-transform: uppercase; }
.kpi strong { font-size: 30px; line-height: 1; color: #f0f4f7; letter-spacing: -.03em; }
.kpi small { font-size: 10px; color: var(--muted); }
.kpi.alert { border-color: #4a3812; } .kpi.alert .label { color: var(--amber); }
.card { padding: 17px; display: flex; flex-direction: column; gap: 12px; }
.card h3 { margin: 0; font-size: 12px; }
.card.alert { border-color: #4a3812; } .card.alert h3 { color: var(--amber); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kv { margin: 0; } .kv div { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.kv dt { color: var(--muted-2); white-space: nowrap; } .kv dd { margin: 0; color: var(--text-soft); text-align: right; overflow-wrap: anywhere; }
.list { display: flex; flex-direction: column; gap: 9px; font-size: 11px; }
.list div { display: flex; justify-content: space-between; gap: 10px; }
.meter { height: 6px; border-radius: 3px; background: #1a2027; overflow: hidden; } .meter i { display: block; height: 100%; background: var(--cyan); }
.online { color: #50db70; font-size: 10px; display: flex; gap: 6px; align-items: center; }

/* Tables */
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; overflow: hidden; box-shadow: 0 22px 60px #0004; }
.panel-title { padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); color: #818b96; font-size: 9px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; display: flex; justify-content: space-between; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th { height: 44px; padding: 0 16px; text-align: left; background: var(--surface-2); border-bottom: 1px solid var(--line); color: #818b96; font-size: 9px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; white-space: nowrap; }
tbody td { padding: 12px 16px; border-bottom: 1px solid #293039; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #13181e; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell { display: flex; flex-direction: column; gap: 4px; }
.cell strong { font-size: 12px; }
.mono { font-family: "Cascadia Mono", ui-monospace, Consolas, monospace; font-size: 11px; color: #c5ced6; }
.muted { color: var(--muted); font-size: 10px; }
.with-icon { display: flex; align-items: center; gap: 12px; }
.game { width: 40px; height: 40px; border-radius: 7px; display: grid; place-items: center; font-weight: 900; font-size: 12px; border: 1px solid #66511f; color: #ffb234; background: linear-gradient(145deg, #282313, #0e1114); flex: none; }
.game.g1 { color: #ff9c34; border-color: #6e5131; background: linear-gradient(145deg, #463119, #101519); }
.game.g2 { color: #d4c9aa; border-color: #665b4b; background: linear-gradient(145deg, #4a443c, #171715); }
.game.g3 { color: #7ef5fa; border-color: #277f86; background: linear-gradient(145deg, #154d52, #101b1f); }
.empty { padding: 32px 20px; color: var(--muted); text-align: center; font-size: 12px; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; padding: 4px 9px; border-radius: 999px; border: 1px solid #2c343d; background: var(--surface-2); color: #8f99a5; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { color: var(--green); border-color: #1f4a2c; background: #12261a; }
.chip.info { color: var(--cyan); border-color: #1e4a50; background: #0e2024; }
.chip.warn { color: var(--amber); border-color: #4a3812; background: #241c0c; }
.chip.bad { color: var(--red); border-color: #693b3b; background: #2a1717; }
.sev { font-weight: 700; } .sev.critical, .sev.fatal { color: var(--red); } .sev.high, .sev.error { color: #ff9c34; } .sev.medium, .sev.warning { color: var(--amber); } .sev.low, .sev.info, .sev.debug { color: #8f99a5; }

/* Filters and pagination */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters form { display: contents; }
.filter { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; padding: 7px 12px; border-radius: 6px; border: 1px solid #313a44; background: #1d242b; color: #bac3cc; cursor: pointer; }
.filter:hover { color: #fff; border-color: #4a626b; }
.filter.on { border-color: #285860; background: #18353a; color: #56e2e7; }
.filters .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.filters select { background: #0b0f13; border: 1px solid #303943; color: #e7edf2; border-radius: 5px; padding: 7px 10px; font-size: 11px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.pager nav { display: flex; gap: 6px; }
.pager a, .pager span.cur { display: inline-flex; padding: 7px 12px; border-radius: 6px; border: 1px solid #313a44; background: #1d242b; color: #bac3cc; font-weight: 600; }
.pager span.cur { border-color: #285860; background: #18353a; color: #56e2e7; }

/* Detail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.detail .card h2 { font-size: 16px; margin: 8px 0 0; line-height: 1.3; }
.prose { font-size: 12px; line-height: 1.55; color: #c5ced6; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.step { display: grid; grid-template-columns: 14px 1fr; gap: 10px; font-size: 10px; color: var(--text-soft); }
.step i { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); margin-top: 3px; }
.step small { color: var(--muted-2); display: block; margin-top: 2px; }
.attachment { border: 1px solid #1e3a40; background: #101a1e; border-radius: 7px; padding: 12px; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; }
.attachment i { height: 40px; border-radius: 5px; background: linear-gradient(135deg, #1b2b31, #0f171b); border: 1px solid #285860; display: block; }
pre.code { margin: 0; background: #0b0f13; border: 1px solid #303943; border-radius: 6px; padding: 12px; font-size: 11px; line-height: 1.5; overflow: auto; max-height: 360px; color: #c5ced6; }
.notice { display: flex; gap: 9px; background: #0e2024; border: 1px solid #20454b; color: #75969d; padding: 11px; border-radius: 5px; font-size: 10px; line-height: 1.5; }
.notice.danger { background: #2a1717; border-color: #693b3b; color: var(--red); }
.notice.success { background: #153029; border-color: #285143; color: #6ddcaf; }

/* Auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(420px, 100%); background: #12171d; border: 1px solid #323b45; border-radius: 9px; box-shadow: 0 35px 100px #000c; display: flex; flex-direction: column; gap: 10px; padding: 26px; }
.auth-card .brand { padding: 0 0 12px; }
.auth-card h1 { font-size: 20px; margin: 4px 0 2px; }
.auth-card p { color: #89949f; font-size: 12px; line-height: 1.6; margin: 0 0 8px; }
.auth-card label { font-size: 10px; color: #aab4bd; font-weight: 700; margin-top: 5px; display: block; }
.auth-card input:not([type=checkbox]) { width: 100%; background: #0b0f13; border: 1px solid #303943; color: #e7edf2; border-radius: 5px; padding: 11px 12px; outline: none; margin-top: 6px; }
.auth-card input:focus { border-color: #43d5dc; box-shadow: 0 0 0 3px #3dd7de15; }
.auth-card .check { display: flex; gap: 9px; align-items: center; font-size: 11px; color: #89949f; margin-top: 8px; }
.auth-card .check input { accent-color: #3dd7df; }
.auth-card .button { width: 100%; margin-top: 12px; }
.auth-card .error { color: var(--red); font-size: 11px; margin: 4px 0 0; }
.auth-card ul.codes { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.auth-card ul.codes li { font-family: "Cascadia Mono", ui-monospace, Consolas, monospace; font-size: 11px; background: #0b0f13; border: 1px solid #303943; border-radius: 5px; padding: 8px 10px; }
.qr { background: #fff; padding: 12px; border-radius: 7px; display: grid; place-items: center; }
.qr svg { width: 180px; height: 180px; }

/* Responsive */
@media (max-width: 1120px) { .content.with-rail { grid-template-columns: 1fr; } .rail { grid-template-columns: repeat(3, minmax(0, 1fr)); } .detail { grid-template-columns: 1fr; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
  .brand { padding: 0; }
  .nav { display: flex; overflow: auto; gap: 4px; padding-bottom: 4px; }
  .nav a { white-space: nowrap; padding: 10px 12px; }
  .sidebar-bottom { display: none; }
  .topbar { display: none; }
  .content { padding: 22px 16px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head h1 { font-size: 26px; }
  .rail { grid-template-columns: 1fr; }
  .footer { padding: 12px 16px; }
}
