/* PulsePop Hub — console design system (2.1) */
:root {
  --bg: #f5f6fa; --panel: #ffffff; --panel-2: #f2f4f8; --panel-3: #e9ecf3;
  --ink: #0f1222; --ink-2: #3f4658; --ink-3: #737b8f; --line: #e3e6ee; --line-2: #d4d9e3;
  --accent: #6d4aff; --accent-2: #5433e6; --accent-soft: #efebff; --accent-ink: #4b2fd6;
  --ok: #0f9f5a; --ok-soft: #e4f6ec; --warn: #b3640b; --warn-soft: #fdf1dd; --bad: #dc2f3c; --bad-soft: #fde8ea; --info: #1d6fe0; --info-soft: #e5effd;
  --r: 14px; --r-sm: 10px; --side: 248px;
  --shadow: 0 1px 2px rgba(15,18,34,.04), 0 6px 20px -10px rgba(15,18,34,.10);
  --shadow-lg: 0 24px 60px -20px rgba(15,18,34,.35);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0c12; --panel: #13151d; --panel-2: #1a1d27; --panel-3: #222634; --ink: #eef0f7; --ink-2: #b8bfcf; --ink-3: #848ca0;
  --line: #242836; --line-2: #2f3446; --accent: #9b85ff; --accent-2: #7c5cff; --accent-soft: #221c40; --accent-ink: #b9a9ff;
  --ok: #34c77e; --ok-soft: #0f2a1c; --warn: #f0a238; --warn-soft: #2d2010; --bad: #ff5d68; --bad-soft: #321418; --info: #5ea2ff; --info-soft: #11223b;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c12; --panel: #13151d; --panel-2: #1a1d27; --panel-3: #222634; --ink: #eef0f7; --ink-2: #b8bfcf; --ink-3: #848ca0;
    --line: #242836; --line-2: #2f3446; --accent: #9b85ff; --accent-2: #7c5cff; --accent-soft: #221c40; --accent-ink: #b9a9ff;
    --ok: #34c77e; --ok-soft: #0f2a1c; --warn: #f0a238; --warn-soft: #2d2010; --bad: #ff5d68; --bad-soft: #321418; --info: #5ea2ff; --info-soft: #11223b;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5); color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 var(--font); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── shell ─────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--panel) calc(var(--side) - 1px), var(--line) calc(var(--side) - 1px), var(--line) var(--side), transparent var(--side)); }
.content { min-width: 0; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 750; letter-spacing: -.02em; font-size: 14.5px; white-space: nowrap; }
.brand i { width: 30px; height: 30px; border-radius: 9px; background: conic-gradient(from 210deg, var(--accent), #b06bff, var(--accent-2)); position: relative; box-shadow: 0 6px 16px -6px var(--accent); }
.brand i::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #fff; }
.brand small { margin-left: auto; font-weight: 600; font-size: 10.5px; color: var(--ink-3); border: 1px solid var(--line); padding: 1px 7px; border-radius: 99px; }
.nav-group { margin-top: 14px; }
.nav-group > span { display: block; padding: 0 10px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); font-weight: 560; font-size: 13.5px; }
.nav a:hover { background: var(--panel-2); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent-ink); }
.nav a.on svg.i { stroke: var(--accent); }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--bad); color: #fff; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.who { min-width: 0; flex: 1; line-height: 1.25; } .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .who small { color: var(--ink-3); font-size: 11.5px; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--panel-2); color: var(--ink); }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(160%); border-bottom: 1px solid var(--line); }
.top .menu { display: none; }
.search { position: relative; flex: 1; max-width: 460px; }
.search svg.i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 16px; height: 16px; }
.search input { width: 100%; height: 38px; padding: 0 60px 0 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 600 11px var(--mono); color: var(--ink-3); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; background: var(--panel-2); }
.top .sp { flex: 1; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 650; color: var(--ink-2); border: 1px solid var(--line); border-radius: 99px; padding: 5px 11px; background: var(--panel); }
.live b { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); position: relative; }
.live b::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: var(--ok); opacity: .35; animation: pulse 2s ease-out infinite; }
@keyframes pulse { from { transform: scale(.6); opacity: .5 } to { transform: scale(1.9); opacity: 0 } }
main { width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 28px 64px; }
.scrim { display: none; }

/* ── page furniture ─────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head > div:first-child { flex: 1; min-width: 240px; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.03em; margin: 0 0 4px; font-weight: 760; }
h2 { letter-spacing: -.01em; }
.lead { color: var(--ink-3); margin: 0 0 22px; max-width: 760px; }
.page-head .lead { margin: 0; }
.grid { display: grid; gap: 16px; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.halves { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.thirds { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { font-size: 15px; margin: 0 0 12px; font-weight: 700; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; } .card-head h2 { margin: 0; flex: 1; }
.tile { position: relative; overflow: hidden; }
.tile .k { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.tile .k svg.i { width: 16px; height: 16px; color: var(--accent); }
.tile .v { font-size: 28px; font-weight: 760; letter-spacing: -.035em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; transition: color .3s; }
.tile .v.bump { color: var(--accent); }
.tile.alert .v { color: var(--bad); }
.tile::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(closest-side, var(--accent-soft), transparent); pointer-events: none; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 6px; }
.chart span { flex: 1; min-width: 3px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent)); transition: opacity .2s; }
.chart span:hover { opacity: .75; }
.bar { height: 8px; border-radius: 99px; background: var(--panel-3); overflow: hidden; } .bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #b06bff); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; } tbody tr:hover td { background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
tr.row-link, tr[data-href] { cursor: pointer; }
.table-wrap { overflow-x: auto; }
.card.table-wrap { padding: 6px 8px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 2px 9px; border-radius: 99px; background: var(--panel-2); color: var(--ink-2); white-space: nowrap; border: 1px solid transparent; }
.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-ink); } .pill.blue { background: var(--info-soft); color: var(--info); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--ink-3); } .dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font: inherit; font-weight: 620; cursor: pointer; white-space: nowrap; transition: background .15s, transform .08s, box-shadow .15s; }
.btn:hover { background: var(--panel-2); } .btn:active { transform: translateY(1px); }
.btn svg.i { width: 16px; height: 16px; }
.btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -10px var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); } .btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--panel-2); }
.btn.sm { height: 31px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.input, select, textarea { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--panel); color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s; }
.input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea { height: auto; padding: 10px 12px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 620; margin-bottom: 14px; color: var(--ink-2); }
label.f small { font-weight: 400; color: var(--ink-3); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; margin-bottom: 12px; cursor: pointer; } label.check small { display: block; color: var(--ink-3); font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; background: var(--ok-soft); color: var(--ok); font-weight: 600; border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); }
.flash.err { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); white-space: pre-line; }
.flash.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.flash.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.feed { display: flex; flex-direction: column; }
.feed > div { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; min-width: 0; }
.feed > div:last-child { border: 0; }
.feed .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .new { animation: flash 1.6s ease; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
.sub { color: var(--ink-3); font-size: 12.5px; }
.codebox { font-family: var(--mono); font-size: 12.5px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; word-break: break-all; }
.secret { filter: blur(6px); transition: filter .2s; cursor: pointer; } .secret.shown { filter: none; }
.pager { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; } .pager a, .pager span { padding: 6px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; background: var(--panel); } .pager .on { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 16px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { white-space: nowrap; }
.tabs a { padding: 6px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tabs a.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-3); }
.empty svg.i { width: 34px; height: 34px; color: var(--ink-3); margin-bottom: 8px; stroke-width: 1.4; }
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding-left: 42px; min-height: 30px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--accent-soft); color: var(--accent-ink); }
.steps li b { display: block; margin-bottom: 2px; }
.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 16px; font-size: 13.5px; } .kv dt { color: var(--ink-3); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; }
.toast.on { opacity: 1; transform: none; }

/* ── auth pages (no sidebar) ───────────────────────── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent 60%), radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--info) 14%, transparent), transparent 60%), var(--bg); }
.auth .card { width: min(440px, 100%); padding: 32px; box-shadow: var(--shadow-lg); }
.auth .brand { justify-content: center; padding-bottom: 20px; font-size: 17px; }
.auth h1 { font-size: 22px; text-align: center; }
.auth .lead { text-align: center; margin-bottom: 22px; }

/* ── responsive ─────────────────────────────────────── */
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 50; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(8,10,20,.45); z-index: 40; }
  .top { padding: 0 14px; }
  .top .menu { display: inline-grid; }
  .live span, .search kbd { display: none; }
  main { padding: 20px 14px 48px; }
  .halves { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: stretch; }
  h1 { font-size: 22px; }
}
@media (max-width: 520px) {
  .search { max-width: none; min-width: 0; }
  .search input { padding-right: 12px; }
  .flash { align-items: flex-start; }
  .page-head > div:first-child { min-width: 0; }
  .live { display: none; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile .v { font-size: 22px; }
  .card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .side, .top { display: none; } .shell { display: block; } }
dialog { border: 0; border-radius: 18px; padding: 0; max-width: 540px; width: calc(100% - 32px); background: var(--panel); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(8,10,20,.5); backdrop-filter: blur(3px); }
dialog .card { box-shadow: none; border: 0; }
