/* Du Panel — IPTV admin design system, derived from Purakura Play */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* surfaces */
  --bg-0: #0A0E11;
  --bg-1: #0F1417;
  --bg-2: #161D22;
  --bg-3: #1B242B;
  --bg-card: #11171B;
  --bg-input: #0C1114;

  /* ink */
  --ink-0: #F5F8FA;
  --ink-1: #C9D2D8;
  --ink-2: #8B97A0;
  --ink-3: #56646E;
  --ink-4: #2F3A43;

  /* lines */
  --line: rgba(255,255,255,0.06);
  --line-2: rgba(255,255,255,0.10);
  --line-strong: rgba(255,255,255,0.16);
  --line-accent: rgba(63,227,214,0.40);
  --line-accent-soft: rgba(63,227,214,0.20);

  /* brand */
  --turq: #27AE85;
  --turq-2: #2BC295;
  --accent: #3FE3D6;
  --accent-soft: rgba(63,227,214,0.10);
  --accent-glow: rgba(63,227,214,0.45);
  --accent-glow-soft: rgba(63,227,214,0.20);

  /* signal */
  --live: #FF2D45;
  --live-soft: rgba(255,45,69,0.12);
  --amber: #FFB23F;
  --amber-soft: rgba(255,178,63,0.12);
  --gold: #E8C46B;
  --red: #FF4D5E;
  --green: #3FCF8E;
  --blue: #5B9DFF;
  --purple: #B07BE8;

  /* type */
  --font-display: 'Sora', system-ui, sans-serif;
  --font-ui: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 14px;
  --r-2xl: 18px;
  --r-pill: 999px;

  /* spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 48px;

  /* chrome */
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg-0); color: var(--ink-1); font-family: var(--font-ui); font-size: 13px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

/* ───── Layout ───── */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-1); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 14px 10px 24px; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 8px 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.sidebar-brand .mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--turq), var(--accent)); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; color: #04201E; font-size: 14px; box-shadow: 0 0 14px rgba(39,174,133,0.45); }
.sidebar-brand .name { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink-0); letter-spacing: -0.01em; }
.sidebar-brand .name small { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 9px; letter-spacing: 0.18em; color: var(--ink-2); text-transform: uppercase; margin-top: 1px; }
.nav-section { margin-top: 16px; padding: 0 8px; }
.nav-section-title { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.18em; color: var(--ink-3); text-transform: uppercase; padding: 8px 6px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-md); color: var(--ink-2); font-size: 13px; font-weight: 500; position: relative; cursor: pointer; }
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--ink-1); }
.nav-item.active { background: var(--accent-soft); color: var(--ink-0); }
.nav-item.active::before { content: ''; position: absolute; left: -4px; top: 8px; bottom: 8px; width: 3px; background: var(--accent); border-radius: 0 2px 2px 0; box-shadow: 0 0 12px var(--accent-glow); }
.nav-item .ico { width: 16px; height: 16px; flex-shrink: 0; display: grid; place-items: center; }
.nav-item .ico svg { width: 16px; height: 16px; }
.nav-item .badge { margin-left: auto; font-family: var(--font-mono); font-size: 9.5px; padding: 2px 6px; border-radius: var(--r-pill); background: rgba(255,255,255,0.06); color: var(--ink-2); }
.nav-item .badge.live { background: var(--live-soft); color: var(--live); }
.nav-item .badge.warn { background: var(--amber-soft); color: var(--amber); }
.nav-sub { padding-left: 28px; display: none; padding-bottom: 4px; }
.nav-item.expanded + .nav-sub { display: block; }
.nav-sub .nav-item { padding: 5px 10px; font-size: 12.5px; }
.nav-sub .nav-item::before { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 24px; height: var(--topbar-h); background: var(--bg-0); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.crumb { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ink-3); text-transform: uppercase; }
.crumb .sep { opacity: 0.5; }
.crumb .current { color: var(--ink-0); }
.topbar-stats { display: flex; align-items: center; gap: 4px; margin-left: 24px; padding-left: 24px; border-left: 1px solid var(--line); }
.tstat { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-md); font-family: var(--font-mono); font-size: 11px; color: var(--ink-1); }
.tstat .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.tstat .dot.up { background: var(--green); box-shadow: 0 0 8px rgba(63,207,142,0.6); }
.tstat .dot.live { background: var(--live); box-shadow: 0 0 8px rgba(255,45,69,0.6); animation: pulse 1.6s linear infinite; }
.tstat .v { color: var(--ink-0); font-weight: 600; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-search { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); min-width: 240px; }
.topbar-search input { background: none; border: none; outline: none; flex: 1; font-size: 12px; color: var(--ink-1); }
.topbar-search input::placeholder { color: var(--ink-3); }
.kbd { font-family: var(--font-mono); font-size: 9.5px; padding: 1px 6px; background: rgba(255,255,255,0.06); border-radius: 4px; color: var(--ink-2); }
.icon-btn { width: 32px; height: 32px; border-radius: var(--r-md); display: grid; place-items: center; color: var(--ink-2); position: relative; }
.icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--ink-0); }
.icon-btn .dot-indicator { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: var(--r-pill); border: 1px solid var(--line); }
.user-chip:hover { background: rgba(255,255,255,0.04); }
.user-avatar { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #FF4D5E, #B07BE8); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 11px; color: white; }
.user-chip .who { font-size: 12px; color: var(--ink-0); font-weight: 500; }
.user-chip .who small { display: block; font-family: var(--font-mono); font-size: 9px; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; }

/* page header */
.page { padding: 24px 32px 48px; max-width: 1640px; margin: 0 auto; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.page-eyebrow .star { color: var(--accent); margin-right: 6px; }
.page-title { font-family: var(--font-display); font-weight: 700; font-size: 28px; letter-spacing: -0.02em; color: var(--ink-0); margin: 6px 0 4px; }
.page-sub { color: var(--ink-2); font-size: 13px; max-width: 60ch; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ───── Buttons ───── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--r-md); font-size: 12.5px; font-weight: 500; color: var(--ink-1); border: 1px solid var(--line-2); background: var(--bg-2); transition: 120ms; }
.btn:hover { background: var(--bg-3); border-color: var(--line-strong); color: var(--ink-0); }
.btn .ico { width: 14px; height: 14px; }
.btn-primary { background: var(--accent); color: #04201E; border-color: transparent; font-weight: 600; box-shadow: 0 6px 20px rgba(63,227,214,0.22); }
.btn-primary:hover { background: var(--turq-2); color: #04201E; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,0.04); }
.btn-danger { background: transparent; border-color: rgba(255,77,94,0.30); color: var(--red); }
.btn-danger:hover { background: rgba(255,77,94,0.08); }
.btn-sm { padding: 4px 10px; font-size: 11.5px; }
.btn-xs { padding: 2px 8px; font-size: 11px; gap: 4px; }
.btn-icon { padding: 6px; }

/* ───── Surfaces ───── */
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-2xl); }
.card-head { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink-0); margin: 0; letter-spacing: -0.01em; }
.card-head .sub { color: var(--ink-2); font-size: 12px; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 20px; }
.card-body.no-pad { padding: 0; }

/* ───── KPI strip ───── */
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.kpi { padding: 16px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-xl); position: relative; overflow: hidden; }
.kpi .label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--ink-3); text-transform: uppercase; }
.kpi .value { font-family: var(--font-display); font-weight: 700; font-size: 28px; color: var(--ink-0); letter-spacing: -0.02em; margin: 6px 0 2px; line-height: 1; }
.kpi .value small { font-family: var(--font-mono); font-weight: 500; font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; margin-left: 4px; }
.kpi .delta { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-2); display: flex; align-items: center; gap: 4px; }
.kpi .delta.up { color: var(--green); }
.kpi .delta.down { color: var(--red); }
.kpi .sparkline { position: absolute; right: 12px; bottom: 12px; opacity: 0.7; }

/* ───── Tables ───── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; padding: 10px 16px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line); font-weight: 500; background: var(--bg-1); }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink-1); vertical-align: middle; }
.tbl tbody tr { transition: 120ms; }
.tbl tbody tr:hover { background: rgba(255,255,255,0.025); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl td.num, .tbl th.num { font-family: var(--font-mono); text-align: right; }
.tbl td.center, .tbl th.center { text-align: center; }
.tbl .row-id { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.tbl .row-primary { color: var(--ink-0); font-weight: 500; }
.tbl-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg-1); border-radius: var(--r-2xl) var(--r-2xl) 0 0; flex-wrap: wrap; }
.tbl-toolbar .group { display: flex; gap: 4px; align-items: center; }
.tbl-toolbar .spacer { flex: 1; }
.search-box { display: flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--bg-input); border: 1px solid var(--line); border-radius: var(--r-md); min-width: 200px; }
.search-box input { background: none; border: none; outline: none; flex: 1; font-size: 12px; color: var(--ink-1); }
.search-box input::placeholder { color: var(--ink-3); }

/* ───── Badges / pills ───── */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: var(--r-pill); font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.08em; background: rgba(255,255,255,0.06); color: var(--ink-1); text-transform: uppercase; }
.pill.live { background: var(--live-soft); color: var(--live); }
.pill.live .dot { width: 5px; height: 5px; background: var(--live); border-radius: 50%; box-shadow: 0 0 6px var(--live); animation: pulse 1.6s linear infinite; }
.pill.online { background: rgba(63,207,142,0.10); color: var(--green); }
.pill.online .dot { width: 5px; height: 5px; background: var(--green); border-radius: 50%; box-shadow: 0 0 6px rgba(63,207,142,0.6); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.error { background: rgba(255,77,94,0.12); color: var(--red); }
.pill.off { background: rgba(255,255,255,0.04); color: var(--ink-3); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.installing { background: rgba(91,157,255,0.12); color: var(--blue); }
.pill.installing .dot { width: 5px; height: 5px; background: var(--blue); border-radius: 50%; animation: pulse 1.6s linear infinite; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border-radius: var(--r-sm); background: rgba(255,255,255,0.04); border: 1px solid var(--line); font-family: var(--font-mono); font-size: 10px; color: var(--ink-2); }

/* ───── Meters ───── */
.meter { display: flex; align-items: center; gap: 10px; }
.meter-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; min-width: 60px; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); transition: width 400ms; }
.meter-fill.warn { background: var(--amber); box-shadow: 0 0 8px var(--amber-soft); }
.meter-fill.danger { background: var(--red); box-shadow: 0 0 8px rgba(255,77,94,0.4); }
.meter-fill.ok { background: var(--green); }
.meter-value { font-family: var(--font-mono); font-size: 11px; color: var(--ink-1); min-width: 36px; text-align: right; }

.ring { --p: 50; --c: var(--accent); width: 44px; height: 44px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255,255,255,0.06) 0); display: grid; place-items: center; position: relative; }
.ring::after { content: ''; position: absolute; inset: 4px; background: var(--bg-card); border-radius: 50%; }
.ring span { position: relative; z-index: 1; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-0); font-weight: 600; }

/* ───── Forms ───── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.field .req { color: var(--accent); margin-left: 2px; }
.field input, .field select, .field textarea { width: 100%; background: var(--bg-input); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 9px 12px; color: var(--ink-0); font-size: 13px; outline: none; transition: 120ms; font-family: var(--font-ui); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--line-accent); box-shadow: 0 0 0 3px var(--accent-glow-soft); }
.field .hint { font-size: 11px; color: var(--ink-3); }
.field.mono input { font-family: var(--font-mono); }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.field-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.toggle { position: relative; width: 36px; height: 20px; background: rgba(255,255,255,0.08); border-radius: 999px; cursor: pointer; transition: 120ms; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: var(--ink-2); border-radius: 50%; transition: 180ms; }
.toggle.on { background: var(--accent); }
.toggle.on::after { left: 18px; background: #04201E; }
.checkbox { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line-strong); display: inline-grid; place-items: center; cursor: pointer; }
.checkbox.on { background: var(--accent); border-color: var(--accent); }
.checkbox.on::after { content: '✓'; color: #04201E; font-size: 11px; font-weight: 800; }

/* Section break for long pages */
.section-break { padding: 64px 0 20px; display: flex; align-items: center; gap: 16px; }
.section-break .bar { flex: 1; height: 1px; background: var(--line); }
.section-break .label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; color: var(--ink-3); text-transform: uppercase; }

/* Empty / placeholder */
.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 24px; padding: 0 4px; }
.tab { padding: 10px 16px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tab:hover { color: var(--ink-0); }
.tab.active { color: var(--ink-0); border-bottom-color: var(--accent); }
.tab .count { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); margin-left: 6px; padding: 1px 6px; border-radius: var(--r-pill); background: rgba(255,255,255,0.04); }
.tab.active .count { color: var(--accent); background: var(--accent-soft); }

/* Inline action buttons in tables */
.row-actions { display: flex; gap: 2px; opacity: 0.7; transition: 120ms; }
tr:hover .row-actions { opacity: 1; }
.row-action { width: 26px; height: 26px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--ink-2); }
.row-action:hover { background: rgba(255,255,255,0.06); color: var(--ink-0); }
.row-action.danger:hover { color: var(--red); background: rgba(255,77,94,0.08); }

/* Status dot column */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.up { background: var(--green); box-shadow: 0 0 8px rgba(63,207,142,0.6); }
.status-dot.live { background: var(--live); box-shadow: 0 0 8px var(--live); animation: pulse 1.6s linear infinite; }
.status-dot.warn { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.status-dot.down { background: var(--red); box-shadow: 0 0 8px var(--red); }
.status-dot.off { background: var(--ink-3); }
.status-dot.installing { background: var(--blue); animation: pulse 1.6s linear infinite; }

/* Chart placeholder */
.chart { background: linear-gradient(to top, var(--accent-soft) 0%, transparent 100%); border-radius: var(--r-md); position: relative; overflow: hidden; }
.chart-line { position: absolute; inset: 0; pointer-events: none; }

/* Drawer / panel */
.panel-tools { display: flex; gap: 6px; align-items: center; padding: 8px 12px; background: var(--bg-1); border-radius: var(--r-md); border: 1px solid var(--line); }

/* Grain overlay */
.grain { position: fixed; inset: 0; pointer-events: none; opacity: 0.05; mix-blend-mode: overlay; z-index: 100; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* Compact list */
.cmpct-list { display: flex; flex-direction: column; }
.cmpct-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.cmpct-row:last-child { border-bottom: none; }
.cmpct-row:hover { background: rgba(255,255,255,0.02); }
.cmpct-row .lbl { color: var(--ink-2); width: 140px; font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.10em; }
.cmpct-row .val { color: var(--ink-0); }
.cmpct-row .val.mono { font-family: var(--font-mono); font-size: 12px; }

/* Grid card list (servers) */
.srv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.srv-card { padding: 18px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-2xl); position: relative; }
.srv-card.online { border-color: rgba(63,207,142,0.18); }
.srv-card.offline { border-color: rgba(255,77,94,0.18); }
.srv-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.srv-card-head .name { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--ink-0); }
.srv-card-head .id { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
.srv-card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin-bottom: 14px; }
.srv-card-stat .lbl { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 4px; }
.srv-card-foot { display: flex; gap: 6px; align-items: center; padding-top: 14px; border-top: 1px solid var(--line); }
.srv-card-foot .meta { display: flex; gap: 12px; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); flex: 1; }

/* Login / setup */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at top, rgba(39,174,133,0.10), transparent 60%), var(--bg-0); }
.auth-card { width: 100%; max-width: 420px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-2xl); padding: 36px; }
.auth-card .brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-card .brand .mark { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, var(--turq), var(--accent)); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; color: #04201E; font-size: 22px; box-shadow: 0 0 28px rgba(39,174,133,0.45); }
.auth-card h1 { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; color: var(--ink-0); margin: 0; text-align: center; }
.auth-card .eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; color: var(--accent); text-transform: uppercase; text-align: center; }

/* Activity feed */
.feed-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 12px; align-items: start; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.feed-row:last-child { border-bottom: none; }
.feed-row .what { color: var(--ink-1); }
.feed-row .what b { color: var(--ink-0); font-weight: 600; }
.feed-row .when { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); }

/* ───── Layout toggle + top-menu layout ───── */
.layout-seg { display: flex; gap: 2px; padding: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.layout-seg button { display: flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.layout-seg button svg { width: 12px; height: 12px; }
.layout-seg button:hover { color: var(--ink-1); }
.layout-seg button.on { background: var(--accent-soft); color: var(--accent); }
.app.layout-top { grid-template-columns: 1fr; }
.app.layout-top .sidebar { display: none; }
.app.layout-top .topbar { border-bottom: none; }
.app.layout-top .topbar .crumb { display: none; }
.app.layout-top .topbar-stats { margin-left: 0; padding-left: 0; border-left: none; }
.topbar .brand-inline { display: none; align-items: center; gap: 10px; margin-right: 8px; }
.topbar .brand-inline .mark { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, var(--turq), var(--accent)); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; color: #04201E; font-size: 12px; box-shadow: 0 0 12px rgba(39,174,133,0.45); }
.topbar .brand-inline .name { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink-0); }
.app.layout-top .topbar .brand-inline { display: flex; }
.topmenu { display: none; position: sticky; top: var(--topbar-h); z-index: 19; background: var(--bg-1); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0 16px; }
.app.layout-top .topmenu { display: flex; }
.tm-item { position: relative; }
.tm-item > a { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); border-bottom: 2px solid transparent; }
.tm-item > a .ico { width: 14px; height: 14px; display: grid; place-items: center; }
.tm-item > a .ico svg { width: 14px; height: 14px; }
.tm-item > a .caret { font-size: 9px; opacity: 0.5; margin-left: -2px; }
.tm-item:hover > a { color: var(--ink-0); background: rgba(255,255,255,0.03); }
.tm-item.active > a { color: var(--ink-0); border-bottom-color: var(--accent); }
.tm-sub { display: none; position: absolute; top: 100%; left: 0; min-width: 240px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 0 0 var(--r-lg) var(--r-lg); box-shadow: 0 24px 48px -16px rgba(0,0,0,0.7); padding: 6px; z-index: 30; }
.tm-item:hover .tm-sub { display: block; }
.tm-sub .grp { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px 4px; }
.tm-sub a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); font-size: 12.5px; color: var(--ink-1); }
.tm-sub a:hover { background: rgba(255,255,255,0.05); color: var(--ink-0); }
.tm-sub a.active { background: var(--accent-soft); color: var(--ink-0); }
.tm-sub a .badge { font-family: var(--font-mono); font-size: 9.5px; padding: 1px 6px; border-radius: var(--r-pill); background: rgba(255,255,255,0.06); color: var(--ink-2); }
.tm-sub a .badge.live { background: var(--live-soft); color: var(--live); }
.tm-sub a .badge.warn { background: var(--amber-soft); color: var(--amber); }

/* responsive chrome — keep toggle + user chip visible at narrow widths */
.tstat { white-space: nowrap; }
.topbar-right { flex-shrink: 0; }
.topbar-search { min-width: 0; flex: 1 1 160px; max-width: 280px; }
.topbar-search input { min-width: 0; }
.topbar-stats { overflow: hidden; min-width: 0; }
.topmenu { overflow-x: auto; scrollbar-width: none; }
.topmenu::-webkit-scrollbar { display: none; }
@media (max-width: 1280px) { .tstat:nth-child(n+3) { display: none; } .topbar-search { display: none; } .tm-item > a { padding: 12px 10px; gap: 6px; } }
@media (max-width: 1000px) { .tstat:nth-child(n+2) { display: none; } .tm-item > a .ico { display: none; } .tm-item > a { font-size: 12px; padding: 12px 9px; } .topbar { padding: 0 14px; gap: 10px; } .topbar-stats { margin-left: 12px; padding-left: 12px; } }
@media (max-width: 760px) { .user-chip .who { display: none; } .layout-seg button span { display: none; } }
