/* Hive Control — admin dashboard styles. Neutral base, honey accent, light + dark. */

:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f9f9f7;
  --surface-3: #f1f1ee;
  --hover: rgba(24, 24, 20, 0.04);
  --border: #e7e6e1;
  --border-strong: #d6d4cd;
  --text: #1b1b18;
  --text-2: #5d5c56;
  --text-3: #8d8b83;

  --honey: #e8930c;
  --honey-strong: #b86e00;
  --honey-soft: #fdf3e1;
  --honey-ring: rgba(232, 147, 12, 0.32);
  --on-honey: #1d1300;

  --green: #1f8a4c;  --green-soft: #e6f4ec;
  --red: #c93a2b;    --red-soft: #fbeae7;
  --blue: #2f6bd8;   --blue-soft: #e8effc;
  --violet: #6e4bd8; --violet-soft: #efeafc;
  --grey-soft: #efeeea;

  --chart-1: #e8930c;
  --chart-2: #2f6bd8;
  --grid: #ecebe6;

  --shadow-sm: 0 1px 2px rgba(20, 18, 10, 0.05);
  --shadow: 0 1px 2px rgba(20, 18, 10, 0.04), 0 4px 16px rgba(20, 18, 10, 0.06);
  --shadow-lg: 0 12px 40px rgba(20, 18, 10, 0.16), 0 2px 6px rgba(20, 18, 10, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 232px;
  --sidebar-mini: 68px;
  --topbar: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0e; --surface: #171715; --surface-2: #1c1c1a; --surface-3: #232320; --hover: rgba(255, 255, 240, 0.04);
    --border: #2a2a27; --border-strong: #3a3a36; --text: #ededE8; --text-2: #a9a8a0; --text-3: #75746d;
    --honey: #f5a524; --honey-strong: #ffbe4d; --honey-soft: rgba(245, 165, 36, 0.12); --honey-ring: rgba(245, 165, 36, 0.35); --on-honey: #1d1300;
    --green: #4cc483; --green-soft: rgba(76, 196, 131, 0.13); --red: #f0705f; --red-soft: rgba(240, 112, 95, 0.13);
    --blue: #6f9cf0; --blue-soft: rgba(111, 156, 240, 0.13); --violet: #a48af0; --violet-soft: rgba(164, 138, 240, 0.14); --grey-soft: #262623;
    --chart-1: #f5a524; --chart-2: #6f9cf0; --grid: #252522;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f0e; --surface: #171715; --surface-2: #1c1c1a; --surface-3: #232320; --hover: rgba(255, 255, 240, 0.04);
  --border: #2a2a27; --border-strong: #3a3a36; --text: #ededE8; --text-2: #a9a8a0; --text-3: #75746d;
  --honey: #f5a524; --honey-strong: #ffbe4d; --honey-soft: rgba(245, 165, 36, 0.12); --honey-ring: rgba(245, 165, 36, 0.35); --on-honey: #1d1300;
  --green: #4cc483; --green-soft: rgba(76, 196, 131, 0.13); --red: #f0705f; --red-soft: rgba(240, 112, 95, 0.13);
  --blue: #6f9cf0; --blue-soft: rgba(111, 156, 240, 0.13); --violet: #a48af0; --violet-soft: rgba(164, 138, 240, 0.14); --grey-soft: #262623;
  --chart-1: #f5a524; --chart-2: #6f9cf0; --grid: #252522;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font: 14px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01", "tnum"; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -0.01em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
::selection { background: var(--honey-ring); }
:focus-visible { outline: 2px solid var(--honey); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; transition: grid-template-columns 0.2s ease; }
.shell.mini { grid-template-columns: var(--sidebar-mini) 1fr; }

.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px;
  padding: 14px 12px; border-right: 1px solid var(--border); background: var(--surface); z-index: 30; overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 6px; margin-bottom: 14px; font-weight: 650; letter-spacing: -0.02em; font-size: 15px; white-space: nowrap; }
.brand .logo { width: 30px; height: 30px; flex: none; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-top: -3px; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); padding: 14px 10px 6px; white-space: nowrap; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; white-space: nowrap; transition: background 0.12s, color 0.12s;
}
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.active { background: var(--honey-soft); color: var(--text); }
.nav a.active svg { color: var(--honey-strong); }
.nav a .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--honey); color: var(--on-honey); font-size: 11px; font-weight: 650; display: grid; place-items: center; }
.nav a .count.quiet { background: var(--surface-3); color: var(--text-2); }
.sidebar .spacer { flex: 1; }
.collapse-btn { justify-content: flex-start; }
.shell.mini .brand-text, .shell.mini .nav-label, .shell.mini .nav a span, .shell.mini .nav a .count, .shell.mini .collapse-btn span { display: none; }
.shell.mini .nav a { justify-content: center; padding: 0; }
.shell.mini .nav a .count:not(.quiet) { display: block; position: absolute; top: 5px; right: 9px; min-width: 8px; width: 8px; height: 8px; padding: 0; font-size: 0; }
.shell.mini .brand { justify-content: center; padding: 0; }
.shell.mini .collapse-btn svg { transform: rotate(180deg); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border);
}
.btn.menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 520px; }
.search > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 38px; padding: 0 64px 0 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: var(--honey); box-shadow: 0 0 0 3px var(--honey-ring); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
kbd { font: 500 11px var(--mono); color: var(--text-3); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; background: var(--surface-2); }
.results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 420px; overflow: auto;
}
.results a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); }
.results a.sel, .results a:hover { background: var(--hover); }
.results .empty-row { padding: 14px; color: var(--text-3); text-align: center; }
.topbar .grow { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; background: none; }
.user-chip:hover { background: var(--hover); border-color: var(--border); }
.user-chip .who { text-align: left; line-height: 1.2; }
.user-chip .who b { display: block; font-weight: 600; font-size: 13px; }
.menu { position: absolute; right: 16px; top: calc(var(--topbar) - 4px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.menu .head { padding: 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: none; border: 0; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--hover); }

.view { padding: 28px 32px 64px; max-width: 1440px; width: 100%; margin: 0 auto; }
.view.fade { animation: fade 0.18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; letter-spacing: -0.025em; font-weight: 680; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; margin-bottom: 14px; }
.back:hover { color: var(--text); }

/* ------------------------------------------------------------ controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface); font-weight: 550; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg.i { width: 16px; height: 16px; }
.btn.primary { background: var(--honey); border-color: var(--honey); color: var(--on-honey); }
.btn.primary:hover { background: color-mix(in srgb, var(--honey) 88%, #000); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { background: color-mix(in srgb, var(--red) 88%, #000); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.danger-text { color: var(--red); }

.input, select.input, textarea.input {
  height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); outline: none; min-width: 0;
  transition: border-color 0.12s, box-shadow 0.12s;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238d8b83' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:focus { border-color: var(--honey); box-shadow: 0 0 0 3px var(--honey-ring); }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 16px; height: 16px; }
.input-icon .input { padding-left: 34px; width: 100%; }
label.field { display: grid; gap: 6px; font-weight: 550; font-size: 13px; }
label.field .hint { font-weight: 400; color: var(--text-3); font-size: 12px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 10px; border: 1px solid var(--border); overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button, .seg a { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--text-2); font-weight: 550; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.seg button:hover, .seg a:hover { color: var(--text); }
.seg .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg .n { font-size: 11px; color: var(--text-3); font-weight: 600; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input-icon { flex: 1; min-width: 200px; max-width: 360px; }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--grey-soft); color: var(--text-2); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.chip.plain::before { display: none; }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.honey { background: var(--honey-soft); color: var(--honey-strong); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.violet { background: var(--violet-soft); color: var(--violet); }
.chip.live::before { animation: pulse 1.8s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ------------------------------------------------------------ cards, tiles */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 620; letter-spacing: -0.01em; }
.card-head .sub { color: var(--text-3); font-size: 12.5px; }
.card-body { padding: 16px 18px 18px; }
.card-body.flush { padding: 8px 0 4px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: 2fr 1fr; align-items: start; }

.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 16px; }
.tile { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.tile .k { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 550; font-size: 13px; }
.tile .k svg { width: 16px; height: 16px; color: var(--text-3); }
.tile .v { font-size: 28px; font-weight: 680; letter-spacing: -0.03em; line-height: 1.15; }
.tile .v small { font-size: 14px; color: var(--text-3); font-weight: 550; letter-spacing: 0; }
.tile .d { font-size: 12.5px; color: var(--text-3); }
.tile .d b { color: var(--green); font-weight: 600; }
.tile .d b.warn { color: var(--red); }
.tile .spark { position: absolute; right: 16px; top: 18px; width: 64px; height: 24px; opacity: .9; }
.tile.accent { background: linear-gradient(135deg, var(--honey-soft), var(--surface) 70%); }
a.tile:hover { border-color: var(--border-strong); }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; }
.t th:first-child { border-top-left-radius: var(--radius); }
.t th:last-child { border-top-right-radius: var(--radius); }
.t th.sort { cursor: pointer; user-select: none; }
.t th.sort:hover { color: var(--text); }
.t th.sort.on { color: var(--text); }
.t th .arrow { display: inline-block; margin-left: 4px; opacity: 0.8; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background 0.1s; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover, .t tbody tr.sel { background: var(--hover); }
.t td.r, .t th.r { text-align: right; }
.t td.actions { text-align: right; white-space: nowrap; }
.t td.actions .btn + .btn { margin-left: 6px; }
.t .check { width: 40px; padding-right: 0; }
.t input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--honey); cursor: pointer; }
.card > .table-wrap > .t th { background: transparent; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 13px; flex-wrap: wrap; }
.pager .btns { display: flex; gap: 6px; align-items: center; }

.who-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.who-cell .name { font-weight: 600; }
.who-cell .sub { font-size: 12px; color: var(--text-3); }
.av {
  width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; font-weight: 650; font-size: 12.5px; letter-spacing: -0.02em;
  color: var(--av-fg, var(--honey-strong)); background: var(--av-bg, var(--honey-soft)); overflow: hidden;
}
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.round { border-radius: 50%; }
.av.lg { width: 64px; height: 64px; border-radius: 16px; font-size: 22px; }
.av.sm { width: 24px; height: 24px; border-radius: 7px; font-size: 10.5px; }

/* ------------------------------------------------------------ states */
.empty { padding: 48px 24px; text-align: center; color: var(--text-2); }
.empty .art { width: 52px; height: 52px; margin: 0 auto 12px; color: var(--text-3); display: grid; place-items: center; border-radius: 14px; background: var(--surface-3); }
.empty .art svg { width: 24px; height: 24px; }
.empty h4 { margin: 0 0 4px; color: var(--text); font-size: 14.5px; font-weight: 620; }
.empty p { margin: 0; font-size: 13px; }
.empty.error .art { background: var(--red-soft); color: var(--red); }
.skel { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 16px; }
.skel-tiles div { height: 108px; border-radius: var(--radius); }
.skel-block { height: 300px; border-radius: var(--radius); }
.skel-row { height: 14px; margin: 14px 18px; }

/* ------------------------------------------------------------ charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--grid); }
.chart .axis text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .tip {
  position: absolute; pointer-events: none; background: var(--text); color: var(--bg); border-radius: 8px; padding: 6px 10px; font-size: 12px;
  white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); box-shadow: var(--shadow); opacity: 0; transition: opacity 0.1s;
}
.chart .tip b { font-weight: 650; }
.chart .tip.on { opacity: 1; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 3px; border-radius: 2px; background: var(--c); }

/* ------------------------------------------------------------ feed / lists */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--border); align-items: flex-start; }
.feed li:first-child { border-top: 0; }
.feed .dot { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.feed .dot svg { width: 15px; height: 15px; }
.feed .dot.red { background: var(--red-soft); color: var(--red); }
.feed .dot.green { background: var(--green-soft); color: var(--green); }
.feed .dot.honey { background: var(--honey-soft); color: var(--honey-strong); }
.feed .body { flex: 1; min-width: 0; }
.feed .body .line { overflow: hidden; text-overflow: ellipsis; }
.feed .body .meta { color: var(--text-3); font-size: 12px; }
.feed a.link, a.link { color: var(--text); font-weight: 600; border-bottom: 1px solid var(--border-strong); }
a.link:hover { border-color: var(--honey); }

.room-mini { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--border); }
.room-mini:first-child { border-top: 0; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; box-shadow: 0 0 0 3px var(--green-soft); animation: pulse 1.8s infinite; }
.room-mini .name { flex: 1; min-width: 0; font-weight: 600; }
.hives { display: inline-flex; gap: 3px; }
.hives i { width: 12px; height: 13px; background: var(--surface-3); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.hives i.on { background: var(--honey); }

/* ------------------------------------------------------------ player header */
.profile { padding: 22px; display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.profile .info { flex: 1; min-width: 240px; }
.profile h1 { margin: 0; font-size: 22px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile .ids { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-top: 8px; color: var(--text-2); font-size: 13px; }
.profile .ids span { display: inline-flex; gap: 6px; align-items: center; }
.copy { background: none; border: 0; padding: 2px; color: var(--text-3); cursor: pointer; border-radius: 5px; display: inline-grid; place-items: center; }
.copy:hover { color: var(--text); background: var(--hover); }
.copy svg { width: 14px; height: 14px; }
.profile .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.statrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border-top: 1px solid var(--border); }
.statrow > div { padding: 14px 22px; border-left: 1px solid var(--border); }
.statrow > div:first-child { border-left: 0; }
.statrow .k { font-size: 12px; color: var(--text-3); font-weight: 550; }
.statrow .v { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; margin-top: 2px; }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
.banner.red { background: var(--red-soft); color: var(--red); }
.banner.honey { background: var(--honey-soft); color: var(--honey-strong); }
.banner .body { color: var(--text); }
.banner .body b { color: inherit; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 22px 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 12px; color: var(--text-2); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-color: var(--honey); }
.tabs a .n { font-size: 11px; background: var(--surface-3); color: var(--text-2); border-radius: 10px; padding: 0 6px; font-weight: 600; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 9px 22px; margin: 0; }
.kv dt { color: var(--text-3); font-weight: 500; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
pre.code {
  margin: 0; padding: 16px; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); overflow: auto; max-height: 560px;
  font: 12.5px/1.6 var(--mono); color: var(--text-2); border-top: 1px solid var(--border);
}
pre.code .k { color: var(--blue); }
pre.code .s { color: var(--green); }
pre.code .n { color: var(--honey-strong); }

/* ------------------------------------------------------------ reports, tickets, rooms */
.report { padding: 16px 18px; display: grid; gap: 10px; }
.report + .report { border-top: 1px solid var(--border); }
.report .top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.report .reason { font-size: 14.5px; }
.report .evidence { font-size: 13px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 8px 10px; border-radius: 8px; overflow-wrap: anywhere; }
.report .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--text-3); font-size: 12.5px; }
.report .foot .btns { display: flex; gap: 6px; flex-wrap: wrap; }

.split { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 16px; align-items: stretch; }
.split-bar { align-items: center; margin-bottom: 14px; }
.split-bar .input-icon { max-width: none; }
.split-bar .seg { justify-self: start; }
/* empty states fill their card so side-by-side cards look even */
.split > .card { display: flex; flex-direction: column; }
.split > .card:has(> .empty:only-child) { min-height: 220px; }
.split > .card > .empty:only-child { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.ticket-list { align-self: start; }
.split > .ticket-list:has(> .empty:only-child) { align-self: stretch; }
.ticket-list a { display: block; padding: 12px 16px; border-top: 1px solid var(--border); }
.ticket-list a:first-child { border-top: 0; }
.ticket-list a:hover { background: var(--hover); }
.ticket-list a.on { background: var(--honey-soft); }
.ticket-list .row1 { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ticket-list .subj { margin-top: 2px; color: var(--text-2); font-size: 13px; }
.transcript { padding: 6px 0; max-height: 70vh; overflow: auto; }
.msg { display: flex; gap: 12px; padding: 8px 18px; }
.msg:hover { background: var(--hover); }
.msg .b { min-width: 0; }
.msg .h { display: flex; gap: 8px; align-items: baseline; }
.msg .h b { font-weight: 620; }
.msg .h span { font-size: 11.5px; color: var(--text-3); }
.msg .c { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.msg.cont { padding-top: 0; }
.msg.cont .av { visibility: hidden; height: 0; }
.sysline { text-align: center; color: var(--text-3); font-size: 12px; padding: 10px 18px; }

.rooms { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.room { padding: 18px; display: grid; gap: 14px; }
.room .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.room h3 { margin: 0; font-size: 15px; }
.room .meta { color: var(--text-3); font-size: 12.5px; }
.honeycomb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cell {
  height: 58px; border-radius: 10px; border: 1px dashed var(--border-strong); display: flex; flex-direction: column; justify-content: center; padding: 0 10px;
  color: var(--text-3); font-size: 12px; min-width: 0;
}
.cell.on { border: 1px solid transparent; background: var(--honey-soft); color: var(--text); }
.cell.on:hover { border-color: var(--honey); }
.cell .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell .h { font-size: 11px; color: var(--text-3); }
.meter { height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--honey); border-radius: 4px; }

.rank { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; background: var(--surface-3); color: var(--text-2); }
.rank.r1 { background: #f8d77a; color: #5a3d00; }
.rank.r2 { background: #dfe2e6; color: #3c4148; }
.rank.r3 { background: #ecc2a0; color: #5a2e10; }
.lvl { min-width: 160px; }
.lvl .meter { margin-top: 5px; }

/* ------------------------------------------------------------ dialogs, toasts */
dialog.modal {
  border: 1px solid var(--border); border-radius: 16px; padding: 0; width: min(480px, calc(100vw - 32px)); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(15, 12, 5, 0.45); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop 0.16s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
.modal-head { display: flex; gap: 14px; padding: 20px 22px 0; align-items: flex-start; }
.modal-head .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--honey-soft); color: var(--honey-strong); }
.modal-head .ic.red { background: var(--red-soft); color: var(--red); }
.modal-head h2 { margin: 0; font-size: 16.5px; letter-spacing: -0.015em; }
.modal-head p { margin: 4px 0 0; color: var(--text-2); }
.modal-body { padding: 18px 22px; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets button { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 550; font-size: 13px; }
.presets button:hover { border-color: var(--text-3); }
.presets button.on { border-color: var(--honey); background: var(--honey-soft); box-shadow: 0 0 0 1px var(--honey) inset; }

.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 100; width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); animation: slide 0.2s ease;
}
.toast .ic { color: var(--green); margin-top: 1px; }
.toast.err .ic { color: var(--red); }
.toast .t { flex: 1; }
.toast .t b { display: block; font-weight: 620; }
.toast .t span { color: var(--text-2); font-size: 13px; }
.toast.out { opacity: 0; transform: translateY(6px); transition: 0.2s; }
@keyframes slide { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------ sign-in */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--honey-soft), transparent 70%),
    var(--bg);
}
.auth-card { width: min(400px, 100%); padding: 34px 30px 26px; text-align: center; position: relative; box-shadow: var(--shadow); }
.auth-card .logo { width: 56px; height: 56px; margin: 0 auto 16px; }
.auth-card h1 { margin: 0; font-size: 22px; letter-spacing: -0.025em; }
.auth-card > p { margin: 6px 0 24px; color: var(--text-2); }
.discord-btn { width: 100%; height: 44px; background: #5865f2; border-color: #5865f2; color: #fff; font-size: 14.5px; border-radius: 10px; }
.discord-btn:hover { background: #4752c4; border-color: #4752c4; }
.discord-btn svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.auth-card .note { margin-top: 18px; font-size: 12.5px; color: var(--text-3); }
.auth-card .alert { text-align: left; display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; margin-bottom: 18px; background: var(--red-soft); color: var(--red); }
.auth-card .alert .body { color: var(--text); font-size: 13px; }
.auth-card .alert b { color: var(--red); display: block; }
.auth-card form { display: grid; gap: 10px; text-align: left; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.auth-card .divider { margin-top: 14px; }
.hexbg { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.5; color: var(--border); -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 75%); }

.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell, .shell.mini { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg); }
  .shell.open .sidebar { transform: none; }
  .shell.mini .brand-text, .shell.mini .nav-label, .shell.mini .nav a span, .shell.mini .nav a .count { display: revert; }
  .shell.mini .nav a { justify-content: flex-start; padding: 0 10px; }
  .collapse-btn { display: none !important; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 25; }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 8px; }
  .user-chip .who { display: none; }
  .search kbd { display: none; }
  .search input { padding-right: 12px; }
  .topbar .grow { display: none; }
  .search { max-width: none; }
  .view { padding: 20px 16px 48px; }
  .cols-2, .split { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 21px; }
  .tile .v { font-size: 24px; }
  .statrow > div { border-left: 0; border-top: 1px solid var(--border); padding: 12px 18px; }
  .statrow { grid-template-columns: repeat(2, 1fr); border-top: 0; }
  .statrow > div:nth-child(odd) { border-right: 1px solid var(--border); }
  .profile { padding: 18px; }
  .t.stack thead { display: none; }
  .t.stack, .t.stack tbody, .t.stack tr, .t.stack td { display: block; }
  .t.stack tr { padding: 10px 14px; border-bottom: 1px solid var(--border); position: relative; }
  .t.stack tr:last-child { border-bottom: 0; }
  .t.stack td { border: 0; padding: 2px 14px 2px 0; text-align: left !important; display: inline-block; vertical-align: middle; }
  .t.stack td.lead, .t.stack td.actions { display: block; padding-right: 0; }
  .t.stack td[data-l]:not(.lead):not(.actions):not(:empty)::before { content: attr(data-l) " "; color: var(--text-3); font-size: 12px; }
  .t.stack td[data-l=""]::before, .t.stack td[data-l="Status"]::before { content: none !important; }
  .t.stack td.lead { margin-bottom: 4px; }
  .t.stack td.actions { padding-top: 8px; }
  .t.stack td.hide-sm { display: none; }
  .t.stack .check { position: absolute; right: 14px; top: 12px; width: auto; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 14px; }
  .tile .spark { display: none; }
  .toasts { left: 16px; right: 16px; bottom: 16px; width: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ------------------------------------------------------------ live (realtime feed) */
.live-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--green-soft); color: var(--green); white-space: nowrap; transition: background .2s, color .2s, transform .2s;
}
.live-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: live-ring 2s infinite; }
.live-pill.off { background: var(--surface-3); color: var(--text-3); }
.live-pill.off .dot { animation: none; }
.live-pill.bump { transform: scale(1.08); }
@keyframes live-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
.muted-bell { color: var(--text-3); }

.live-pops { position: fixed; top: calc(var(--topbar) + 12px); right: 20px; z-index: 90; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.pop {
  pointer-events: auto; position: relative; overflow: hidden; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px 14px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); color: var(--text);
  animation: pop-in .42s cubic-bezier(.2, 1.3, .3, 1) both; transform-origin: top right; cursor: default;
}
a.pop { cursor: pointer; }
a.pop:hover { border-color: var(--border-strong); }
.pop .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.pop.green .ic { background: var(--green-soft); color: var(--green); }
.pop.red .ic { background: var(--red-soft); color: var(--red); }
.pop.honey .ic { background: var(--honey-soft); color: var(--honey-strong); }
.pop.blue .ic { background: var(--blue-soft); color: var(--blue); }
.pop .t { flex: 1; min-width: 0; }
.pop .t b { display: block; font-weight: 640; }
.pop .t span { display: block; color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop .when { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.pop .bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--honey); transform-origin: left; animation: pop-bar linear forwards; opacity: .75; }
.pop.green .bar { background: var(--green); } .pop.red .bar { background: var(--red); } .pop.blue .bar { background: var(--blue); }
.pop.hold .bar { animation-play-state: paused; }
.pop.out { animation: pop-out .26s ease forwards; }
@keyframes pop-in { from { opacity: 0; transform: translateX(28px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes pop-out { to { opacity: 0; transform: translateX(24px) scale(.96); } }
@keyframes pop-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* new rows/cards after a live refresh, and numbers that changed */
.live-new { animation: live-new 2.2s ease-out; }
tr.live-new td { animation: live-new 2.2s ease-out; }
@keyframes live-new { 0% { background: color-mix(in srgb, var(--honey) 28%, transparent); box-shadow: inset 3px 0 0 var(--honey); } 100% { background: transparent; box-shadow: inset 3px 0 0 transparent; } }
.feed li.live-new, .report.live-new, .ticket-list a.live-new { animation: live-slide .5s cubic-bezier(.2, 1.2, .3, 1), live-new 2.2s ease-out; }
@keyframes live-slide { from { opacity: 0; transform: translateY(-8px); } }
[data-num-key] { display: inline-block; transition: color .3s; }
[data-num-key].bump { color: var(--honey-strong); animation: num-bump .5s ease; }
@keyframes num-bump { 30% { transform: scale(1.12); } }
.nav a .count.bump { animation: num-bump .5s ease; }
.live-feed .dot { transition: transform .2s; }
@media (max-width: 860px) { .live-pill .lbl { display: none; } .live-pill { padding: 0 9px; } .live-pops { top: calc(var(--topbar) + 8px); right: 16px; } }
