/* ============================================================
   Vidoy Admin — design tokens
   Warna aksen = pink Vidoy dari dashboard lama (#FE6081).
   ============================================================ */
:root {
  --font: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --bg: #141118;
  --panel: #1c1822;
  --panel-2: #241f2b;
  --line: #322c3a;
  --line-soft: #2a2531;
  --text: #eeeaf3;
  --muted: #9c94a8;
  --accent: #fe6081;
  --accent-ink: #1a0b10;
  --accent-soft: rgba(254, 96, 129, .14);
  --ok: #3fd08c;
  --ok-soft: rgba(63, 208, 140, .14);
  --warn: #f2b544;
  --warn-soft: rgba(242, 181, 68, .14);
  --bad: #ff5d6c;
  --bad-soft: rgba(255, 93, 108, .14);
  --info: #86a8ff;

  --r-lg: 14px;
  --r: 10px;
  --r-sm: 7px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px rgba(0, 0, 0, .28);
  --sidebar: 236px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f5f3f7;
  --panel: #ffffff;
  --panel-2: #f7f5f9;
  --line: #e2dde8;
  --line-soft: #eeebf2;
  --text: #1d1924;
  --muted: #6c6477;
  --accent: #e8466b;
  --accent-ink: #fff;
  --accent-soft: rgba(232, 70, 107, .1);
  --ok: #178a57;
  --ok-soft: rgba(23, 138, 87, .1);
  --warn: #a86b00;
  --warn-soft: rgba(168, 107, 0, .1);
  --bad: #d63447;
  --bad-soft: rgba(214, 52, 71, .1);
  --info: #3a63d6;
  --shadow: 0 1px 2px rgba(30, 20, 40, .05), 0 8px 24px rgba(30, 20, 40, .06);
  color-scheme: light;
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 14px/1.5 var(--font);
  font-feature-settings: "tnum" 1, "cv11" 1;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
a { color: inherit; }
code { font-size: .92em; padding: .1em .35em; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line-soft); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--r-sm); }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.i { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }

/* ============================================================
   Shell
   ============================================================ */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line-soft);
  padding: 18px 12px 12px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 18px; text-decoration: none; font-size: 16px; font-weight: 500;
}
.brand svg { width: 30px; height: 28px; fill: var(--accent); }
.brand b { font-weight: 700; }
.sidebar nav { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 18px; }
.nav-heading { color: var(--muted); font-size: 12px; font-weight: 500; padding: 0 10px 6px; }
.nav-link {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--muted); text-decoration: none; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--panel-2); color: var(--text); }
.nav-link.is-active { background: var(--accent-soft); color: var(--text); }
.nav-link.is-active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-link.is-active .i { color: var(--accent); }
.nav-badge {
  margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px;
  background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; text-align: center;
}
.sidebar-foot {
  display: flex; align-items: center; gap: 8px;
  border-top: 1px solid var(--line-soft); padding: 12px 4px 0; margin-top: 12px;
}
.who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.who-text { display: grid; min-width: 0; line-height: 1.25; }
.who-text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text small { color: var(--muted); font-size: 12px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700;
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  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) 86%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar h1 { font-size: 19px; }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.clock { color: var(--muted); font-size: 13px; padding: 0 6px; }
.topbar .menu-btn { display: none; }
.content { padding: 24px 28px 96px; display: grid; gap: 20px; align-content: start; }

.scrim { display: none; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 50; left: 0; top: 0; width: 272px;
    transform: translateX(-100%); transition: transform .25s var(--ease);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .45); }
  .topbar .menu-btn { display: inline-grid; }
  .topbar { padding: 0 14px; }
  .content { padding: 16px 14px 96px; }
  .clock { display: none; }
}

/* ============================================================
   Controls
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text);
  font: 500 13.5px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { border-color: color-mix(in srgb, var(--text) 25%, var(--line)); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.06); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #06170f; font-weight: 600; }
.btn-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn); }
.btn-bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); }
.btn-ghost { background: transparent; }
.btn.is-busy { opacity: .7; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: var(--r-sm); border: 1px solid transparent; background: transparent;
  color: var(--muted); cursor: pointer; font: inherit;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }

input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  height: 36px; padding: 0 11px; min-width: 0;
}
textarea { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"], input[type="radio"] { height: auto; accent-color: var(--accent); }
input[type="date"] { color-scheme: inherit; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 500; }
.hint { color: var(--muted); font-size: 12px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row > .field { min-width: 140px; }
.grow { flex: 1 1 220px; }
.stack { display: grid; gap: 16px; }
.row-actions { display: flex; gap: 10px; justify-content: flex-end; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; }

.segmented { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.segmented legend { font-size: 13px; font-weight: 500; margin-bottom: 6px; padding: 0; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented span {
  display: inline-block; padding: 7px 13px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--bg); color: var(--muted); cursor: pointer; font-weight: 500;
}
.segmented input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================
   Surfaces
   ============================================================ */
.panel {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 18px; min-width: 0;
}
.panel.narrow { max-width: 760px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { font-size: 15px; }

.banner { padding: 10px 28px; font-size: 13.5px; border-bottom: 1px solid var(--line-soft); }
.content > .banner { border: 1px solid; border-radius: var(--r); padding: 10px 14px; }
.banner-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.banner-warn b, .banner-warn code { color: var(--text); }

.alert { padding: 10px 12px; border-radius: var(--r-sm); font-size: 13.5px; }
.alert-bad { background: var(--bad-soft); color: var(--bad); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1; justify-content: flex-end; }
.filters input[type="search"] { flex: 1 1 240px; }
.filters input[type="date"] { width: 150px; }
.toolbar .tabs { flex: none; }
.result-line { margin: -4px 0 12px; }

.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line-soft); }
.tab {
  border: 0; background: transparent; color: var(--muted);
  font: 500 13.5px var(--font); padding: 7px 14px; border-radius: var(--r-sm); cursor: pointer;
}
.tab.is-active { background: var(--panel-2); color: var(--text); box-shadow: 0 0 0 1px var(--line); }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { overflow-x: auto; margin: 0 -18px; }
.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table th {
  text-align: left; font-size: 12.5px; font-weight: 500; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--panel);
}
.table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 18px; }
.table th:last-child, .table td:last-child { padding-right: 18px; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.table .num { text-align: right; white-space: nowrap; }
.table .center { text-align: center; }
.table .act { text-align: right; width: 1%; white-space: nowrap; }
.table .empty td { text-align: center; padding: 48px 12px; color: var(--muted); }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line-soft); margin-top: 0; }
.pager { display: flex; align-items: center; gap: 10px; }

.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12.5px; }
.cell-mono { font-size: 12.5px; word-break: break-all; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--panel-2); flex: none; }
.person a { text-decoration: none; }
.person a:hover { color: var(--accent); }
.person-sm { display: inline-flex; gap: 8px; }
.person-sm img { width: 22px; height: 22px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--panel-2); color: var(--muted);
}
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.chip-accent { background: var(--accent-soft); color: var(--accent); }
button.chip { border: 0; cursor: pointer; font-family: inherit; }

.method { display: flex; align-items: center; gap: 10px; }
.method img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; background: #fff; padding: 3px; flex: none; }
.copy { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px 4px; border-radius: 4px; font: inherit; font-size: 12px; }
.copy:hover { color: var(--text); background: var(--panel-2); }
.copy.done { color: var(--ok); }

.switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span {
  position: absolute; inset: 0; border-radius: 99px; background: var(--line);
  transition: background .2s;
}
.switch span::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .2s var(--ease);
}
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + span { opacity: .5; }

tr.row-leave { opacity: 0; transition: opacity .4s; }
tr.row-new td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* ============================================================
   Overview
   ============================================================ */
.kpis { display: grid; grid-template-columns: 1.35fr repeat(4, 1fr); gap: 14px; }
.kpis-3 { grid-template-columns: repeat(3, 1fr); }
.kpi {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  padding: 16px 16px 14px; box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; gap: 6px;
}
.kpi h2 { font-size: 13px; font-weight: 500; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.kpi-lead { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 16%, var(--panel)) 0%, var(--panel) 65%); border-color: color-mix(in srgb, var(--accent) 22%, var(--line-soft)); }
.kpi-lead .kpi-value { font-size: 32px; }
.kpi-note { margin: 0; color: var(--muted); font-size: 12.5px; }
.kpi-split { display: flex; gap: 18px; margin: 4px 0 0; }
.kpi-split div { display: grid; }
.kpi-split dt { color: var(--muted); font-size: 12px; }
.kpi-split dd { margin: 0; font-weight: 600; }
.delta { font-size: 13px; font-weight: 600; color: var(--muted); }
.delta.up { color: var(--ok); }
.delta.down { color: var(--warn); }
.margin-bar { height: 6px; border-radius: 99px; background: var(--bad-soft); overflow: hidden; margin-top: 4px; }
.margin-bar span { display: block; height: 100%; width: 0; background: var(--ok); border-radius: 99px; transition: width .6s var(--ease); }
.spark { height: 46px; margin: auto -6px -6px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: live 2s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

.grid-2-1 { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.chart-lg { min-height: 340px; }
.chart-md { min-height: 300px; }
.totals { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.totals div { display: grid; }
.totals dt { color: var(--muted); font-size: 12px; }
.totals dd { margin: 0; font-weight: 600; font-size: 15px; }
.totals dd.neg { color: var(--bad); }

.map { height: 220px; }
.rank { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.rank li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 6px 0; }
.rank .bar { grid-column: 1 / -1; height: 4px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.rank .bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.rank b { font-weight: 600; }

.stat h2 { font-size: 13px; font-weight: 500; color: var(--muted); }
.stat-value { font-size: 24px; font-weight: 700; margin: 6px 0 2px; }
.stat p { margin: 0; }
.stat-link { text-decoration: none; transition: border-color .15s; }
.stat-link:hover { border-color: var(--accent); }

@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi-lead { grid-column: span 3; }
}
@media (max-width: 1100px) {
  .grid-2-1 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .kpis, .kpis-3 { grid-template-columns: 1fr 1fr; }
  .kpi-lead { grid-column: 1 / -1; }
  .grid-4 { grid-template-columns: 1fr; }
  .kpi-value { font-size: 22px; }
}

/* ============================================================
   Payout queue — elemen utama halaman finance
   ============================================================ */
.queue {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 40px;
  padding: 22px 24px; border-radius: var(--r-lg);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 55%),
    var(--panel);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line-soft));
  box-shadow: var(--shadow);
}
.queue h2 { font-size: 14px; font-weight: 500; color: var(--muted); }
.queue-amount { font-size: clamp(32px, 4.6vw, 52px); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; margin-top: 6px; }
.queue-sub { color: var(--muted); font-size: 15px; margin-top: 4px; }
.queue-sub b { color: var(--text); }
.queue-facts { display: flex; gap: 36px; margin: 0; }
.queue-facts div { display: grid; gap: 2px; }
.queue-facts dt { color: var(--muted); font-size: 12.5px; }
.queue-facts dd { margin: 0; font-size: 22px; font-weight: 700; }
.queue-facts dd.late { color: var(--warn); }
.queue-facts dd.overdue { color: var(--bad); }

.age { font-weight: 600; font-size: 12.5px; }
.age-fresh { color: var(--ok); }
.age-mid { color: var(--text); }
.age-late { color: var(--warn); }
.age-overdue { color: var(--bad); }
.amount { font-weight: 700; font-size: 15px; }

.modal { border: 0; padding: 0; background: transparent; color: var(--text); max-width: min(560px, calc(100vw - 24px)); width: 100%; }
.modal-wide { max-width: min(960px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(8, 5, 12, .6); backdrop-filter: blur(3px); }
.modal[open] .modal-card { animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 24px 64px rgba(0, 0, 0, .45); }
.modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; }
.modal-head { border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { font-size: 16px; }
.modal-foot { border-top: 1px solid var(--line-soft); justify-content: flex-end; }
.modal-body { padding: 18px; }
.payout-detail { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: start; }
.qr { background: #fff; border-radius: var(--r); padding: 8px; aspect-ratio: 1; display: grid; place-items: center; color: #555; font-size: 12px; text-align: center; }
.qr svg { width: 100%; height: auto; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; font-weight: 500; word-break: break-all; }
.kv .big { font-size: 20px; font-weight: 700; }
@media (max-width: 520px) { .payout-detail { grid-template-columns: 1fr; } .qr { max-width: 180px; } }

/* ============================================================
   Videos
   ============================================================ */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.vcard {
  position: relative; border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden;
  background: var(--bg); transition: border-color .15s;
}
.vcard.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.vthumb { position: relative; aspect-ratio: 16 / 9; background: var(--panel-2); cursor: pointer; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; }
.vthumb .vplay {
  position: absolute; right: 8px; bottom: 8px; border: 0; border-radius: 6px; padding: 4px 9px;
  background: rgba(0, 0, 0, .7); color: #fff; font: 600 12px var(--font); cursor: pointer;
}
.vpick {
  position: absolute; left: 8px; top: 8px; width: 22px; height: 22px; margin: 0; z-index: 2; cursor: pointer;
}
.vbody { padding: 10px 12px 12px; display: grid; gap: 4px; }
.vtitle { font-weight: 600; font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vmeta { color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.vmeta a { color: var(--muted); }
.vmeta a:hover { color: var(--accent); }
.vskel { aspect-ratio: 16 / 13; border-radius: var(--r); background: linear-gradient(90deg, var(--panel-2), var(--line-soft), var(--panel-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.scroll-status { text-align: center; color: var(--muted); padding: 24px 0 4px; font-size: 13px; }
.player { aspect-ratio: 16 / 9; background: #000; border-radius: var(--r-sm); overflow: hidden; }
.player iframe { width: 100%; height: 100%; border: 0; }

.action-bar {
  position: fixed; left: 50%; bottom: 20px; z-index: 30; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 99px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .4);
  animation: rise .22s var(--ease);
}
.action-bar .btn { border-radius: 99px; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 16px); } }
@media (min-width: 961px) { .action-bar { margin-left: calc(var(--sidebar) / 2); } }

/* ============================================================
   Misc
   ============================================================ */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast {
  padding: 11px 14px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35); font-size: 13.5px; animation: rise-r .2s var(--ease);
  border-left: 3px solid var(--info);
}
.toast-ok { border-left-color: var(--ok); }
.toast-bad { border-left-color: var(--bad); }
.toast-warn { border-left-color: var(--warn); }
@keyframes rise-r { from { opacity: 0; transform: translateY(8px); } }

.error-state { max-width: 460px; margin: 10vh auto; text-align: center; display: grid; gap: 10px; justify-items: center; }
.error-code { font-size: 64px; font-weight: 700; color: var(--accent); letter-spacing: -.04em; line-height: 1; }
.error-state p { color: var(--muted); margin: 0 0 8px; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(60% 50% at 50% 0%, var(--accent-soft), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 18px; }
.auth-brand { display: flex; gap: 14px; align-items: center; }
.auth-brand svg { width: 42px; height: 38px; fill: var(--accent); flex: none; }
.auth-brand h1 { font-size: 20px; }
.auth-brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.auth-title { font-size: 18px; }

.country-bars { display: grid; gap: 6px; margin-top: 6px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.detail-grid div { background: var(--bg); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 10px; }
.detail-grid dt { color: var(--muted); font-size: 12px; }
.detail-grid dd { margin: 0; font-weight: 700; font-size: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 640px) {
  .filters { justify-content: stretch; }
  .filters > * { flex: 1 1 140px; }
  .filters input[type="date"] { width: auto; }
  .toolbar .tabs { width: 100%; }
  .toolbar .tab { flex: 1; padding: 7px 6px; }
}

/* ============================================================
   Servers
   ============================================================ */
.kpis-4 { grid-template-columns: 1.35fr repeat(3, 1fr); }
.row-dim td { opacity: .6; }
.modal-foot .grow { flex: 1 1 auto; }
#server-modal { max-width: min(720px, calc(100vw - 24px)); }
@media (max-width: 1280px) { .kpis-4 { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   Shared: header icons, tones, copy icon, payout cancel
   ============================================================ */
.th-i { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.th-i .i { width: 15px; height: 15px; opacity: .7; flex: none; }
th.num .th-i { justify-content: flex-end; }
.kpi h2 .i, .panel-head h2 .i { width: 16px; height: 16px; opacity: .75; }
.panel-head h2 { display: flex; align-items: center; gap: 8px; }
.tone-ok { color: var(--ok) !important; }
.tone-warn { color: var(--warn) !important; }
.tone-bad { color: var(--bad) !important; }
.chip-info { background: color-mix(in srgb, var(--info) 16%, transparent); color: var(--info); }
.chip .i { width: 13px; height: 13px; margin-right: 3px; vertical-align: -2px; }
.icon-copy { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; vertical-align: middle; }
.icon-copy .i { width: 15px; height: 15px; }
.icon-copy:hover { background: var(--panel-2); color: var(--text); }
.icon-copy.done { color: var(--ok); }
.name-line { display: flex; align-items: center; gap: 4px; }
.person-text { min-width: 0; }
.wallet-line { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.wallet-line .i { width: 14px; height: 14px; color: var(--accent); }
.wallet-line b { color: var(--text); font-weight: 600; }
.status-cell { white-space: nowrap; }
.status-cell .chip + .chip { margin-left: 4px; }
.btn .i { width: 16px; height: 16px; }
.btn { gap: 6px; }
.btn-ghost-bad { color: var(--muted); }
.btn-ghost-bad:hover { color: var(--bad); background: var(--bad-soft); }
.modal .banner { border: 1px solid; border-radius: var(--r); padding: 10px 14px; line-height: 1.5; }

/* ============================================================
   Videos — privacy mode
   ============================================================ */
.privacy-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 12px; border-radius: var(--r); background: var(--panel-2); border: 1px dashed var(--line); font-size: 13px; }
.privacy-state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.privacy-state .i { width: 18px; height: 18px; }
.videos-revealed .privacy-bar { border-style: solid; border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); }
.videos-revealed .privacy-state { color: var(--warn); }
.vcard.is-private .vthumb img { filter: blur(18px) saturate(.6); transform: scale(1.15); }
.vcard.is-private .vthumb { overflow: hidden; }
.vcard.is-private .vtitle { letter-spacing: .2em; color: var(--muted); }
.vprivate { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.6); pointer-events: none; }
.check-top { align-items: flex-start; }
.check-top input { margin-top: 3px; }
.table-compact td, .table-compact th { padding-top: 8px; padding-bottom: 8px; }

/* ============================================================
   THEME — neutral dark (Oct 2026)
   Outer charcoal frame, near-black app, flat cards, sparse accents.
   Primary color (--accent) comes from Settings (inline <style> in head).
   ============================================================ */
:root {
  --font: "Geist", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --outer: #28282D;
  --bg: #0B0B0C;
  --sidebar-bg: #141414;
  --panel: #0D0D0E;
  --panel-head: #191919;
  --panel-2: #151516;
  --hover: #1C1C1E;
  --nav-active: #232325;
  --line: #292929;
  --line-soft: #1F1F21;
  --text: #FFFFFF;
  --text-2: #D4D4D6;
  --muted: #929292;
  --ok: #16B88A;
  --ok-soft: rgba(22, 184, 138, .12);
  --bad: #E94D63;
  --bad-soft: rgba(233, 77, 99, .12);
  --warn: #D9A441;
  --warn-soft: rgba(217, 164, 65, .12);
  --info: #8E9BB0;
  --r-lg: 14px;
  --r: 12px;
  --r-sm: 8px;
  --shadow: none;
  --sidebar: 240px;
  --frame: 10px;
}
[data-theme="light"] {
  --outer: #DADADF;
  --bg: #F7F7F8;
  --sidebar-bg: #EFEFF1;
  --panel: #FFFFFF;
  --panel-head: #F4F4F5;
  --panel-2: #F4F4F5;
  --hover: #ECECEE;
  --nav-active: #E2E2E5;
  --line: #E2E2E5;
  --line-soft: #EBEBED;
  --text: #0B0B0C;
  --text-2: #2A2A2E;
  --muted: #6B6B70;
  --ok: #0F9A73;
  --ok-soft: rgba(15, 154, 115, .1);
  --bad: #D4384F;
  --bad-soft: rgba(212, 56, 79, .1);
  --warn: #A9741A;
  --warn-soft: rgba(169, 116, 26, .1);
  --info: #5B6B85;
  --shadow: none;
}

body { background: var(--outer); font-feature-settings: "tnum" 1; letter-spacing: -.003em; }
body:not(.bare) { padding: var(--frame); }
code, .mono { font-family: var(--mono); }

/* App frame */
.shell {
  min-height: calc(100vh - var(--frame) * 2);
  background: var(--bg);
  border: 1px solid #333338;
  border-radius: 16px;
  overflow: clip;
}
[data-theme="light"] .shell { border-color: #CFCFD4; }
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  top: var(--frame);
  height: calc(100vh - var(--frame) * 2);
  padding: 16px 12px 12px;
}
.brand { padding: 4px 10px 20px; font-size: 15px; font-weight: 600; gap: 10px; }
.brand .brand-mark { width: 26px; height: 24px; fill: var(--accent); flex: none; }
.brand .brand-logo { width: 28px; height: 28px; border-radius: 7px; object-fit: contain; flex: none; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-heading { color: #6E6E73; font-size: 11.5px; font-weight: 500; letter-spacing: .02em; padding: 0 10px 6px; }
.nav-link { border-radius: 10px; color: var(--muted); font-weight: 500; }
.nav-link .i { color: inherit; }
.nav-link:hover { background: var(--hover); color: var(--text); }
.nav-link.is-active { background: var(--nav-active); color: var(--text); }
.nav-link.is-active::before { display: none; }
.nav-link.is-active .i { color: var(--text); }
.sidebar-foot { border-top: 1px solid var(--line); }

.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  z-index: 30;
}
.topbar h1 { font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.content { gap: 16px; }

/* Cards: flat, thin border, lighter header strip */
.panel, .kpi, .queue, .modal-card, .bw-strip, .status-hero, .node, .vcard, .auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: none;
}
.panel { padding: 0 18px 18px; overflow: hidden; }
.panel > .panel-head,
.panel > header.panel-head {
  margin: 0 -18px 16px;
  padding: 11px 18px;
  background: var(--panel-head);
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.panel-head h2 { font-size: 13.5px; font-weight: 600; }
.panel > .toolbar:first-child { margin: 0 -18px 14px; padding: 12px 18px; background: var(--panel-head); border-bottom: 1px solid var(--line); }
.panel:not(:has(> .panel-head:first-child)):not(:has(> .toolbar:first-child)) { padding-top: 18px; }
.auth { background: var(--bg); }

.kpi { padding: 0 16px 14px; gap: 6px; overflow: hidden; }
.kpi > h2:first-child {
  margin: 0 -16px 8px;
  padding: 9px 16px;
  background: var(--panel-head);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}
.kpi-value { color: var(--text); font-weight: 600; letter-spacing: -.025em; }
.kpi-lead { background: var(--panel); border-color: var(--line); }
.kpi-note { color: var(--muted); }

.queue { background: var(--panel); padding: 22px 24px; }
.queue h2 { color: var(--muted); }
.queue-paid .queue-amount { color: var(--ok); }
.queue-cancelled .queue-amount { color: var(--muted); }

/* Controls */
input, select, textarea { background: var(--panel-2); border-color: var(--line); border-radius: var(--r-sm); }
input:focus, select:focus, textarea:focus { border-color: #4A4A4F; box-shadow: none; }
[data-theme="light"] input:focus, [data-theme="light"] select:focus, [data-theme="light"] textarea:focus { border-color: #B5B5BA; }
.btn { background: var(--panel-2); border-color: var(--line); border-radius: var(--r-sm); font-weight: 500; box-shadow: none; }
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.btn-bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.tabs { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.tab { border-radius: 8px; color: var(--muted); }
.tab.is-active { background: var(--nav-active); color: var(--text); box-shadow: none; }
.chip { border-radius: 6px; font-weight: 500; }
.table th { color: var(--muted); font-weight: 500; font-size: 12px; background: transparent; border-bottom-color: var(--line); }
.table td { border-bottom-color: var(--line-soft); }
.table tbody tr:hover td { background: #111113; }
[data-theme="light"] .table tbody tr:hover td { background: #FAFAFA; }
.modal-card { box-shadow: 0 16px 40px rgba(0, 0, 0, .35); }
.modal-head { background: var(--panel-head); border-bottom: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.banner { box-shadow: none; }
.toast { box-shadow: 0 8px 24px rgba(0, 0, 0, .3); border-color: var(--line); }

/* No glow pulses */
@keyframes live { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.live-dot, .node-dot[data-up="1"] { box-shadow: none; }

/* Range tools, all-time strip, settings */
.range-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.range-tools .filters { gap: 8px; align-items: center; }
.range-tools input[type="date"] { height: 32px; }
.alltime-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.alltime-grid > div { display: grid; gap: 2px; padding: 4px 18px; border-left: 1px solid var(--line); }
.alltime-grid > div:first-child { border-left: 0; padding-left: 0; }
.alltime-grid b { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-row input[type="color"] { width: 44px; height: 36px; padding: 2px; cursor: pointer; }
.color-row input[name="accent_hex"] { width: 110px; text-transform: uppercase; }
.swatches { display: flex; gap: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.logo-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-preview { width: 64px; height: 64px; border-radius: 12px; border: 1px dashed var(--line); display: grid; place-items: center; background: var(--panel-2); overflow: hidden; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.stack-sm { display: grid; gap: 6px; }
.settings-preview { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 8px; }
.pv-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pv-nav { padding: 6px 12px; border-radius: 10px; background: var(--nav-active); font-weight: 500; }
.form-foot { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.vtech { font-family: var(--mono); font-size: 11.5px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; }
.auth-brand .brand-mark { width: 30px; height: 28px; fill: var(--accent); }
.auth-brand .brand-logo { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; }
body.bare { background: var(--bg); }

@media (max-width: 1100px) { .alltime-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } .alltime-grid > div { border-left: 0; padding: 0; } }
@media (max-width: 860px) {
  body:not(.bare) { padding: 0; }
  .shell { border-radius: 0; border: 0; min-height: 100vh; }
  .sidebar { top: 0; height: 100vh; }
}
.form-section { font-size: 14px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
details.tpl { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; }
details.tpl[open] { display: grid; gap: 10px; }
details.tpl summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; list-style: none; }
details.tpl summary::before { content: "▸"; color: var(--muted); }
details.tpl[open] summary::before { content: "▾"; }
.ask-msg { margin: 0; color: var(--text-2); line-height: 1.55; }
