/* ============================================================
   TELEMAMBA DESIGN SYSTEM v2
   Telestars-dark blue-black base · PLATINUM accent (silver/white/dark blue/black) · sharp cards
   Simple like ops-desk. Inter everywhere, mono for money.
   Platinum silver = the brand accent, used boldly (primary buttons, active nav,
   live metrics). Telegram blue ONLY for TG entities.
   ============================================================ */

/* ── Fonts (self-hosted) ── */
@font-face { font-family: "Bebas Neue"; src: url("/fonts/bebas-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/sgro-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/sgro-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jbmono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jbmono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

/* ── Tokens ── */
:root {
  /* surfaces — deep blue-black ladder (Telestars-like) */
  --bg: #070B14;
  --surface: #0C1322;
  --raised: #111A2E;
  --overlay: #16203A;

  /* borders */
  --line: #1B2438;
  --line-strong: #27324A;

  /* text */
  --text: #EEF2F9;
  --text-2: #93A0B8;
  --text-3: #55617A;

  /* brand */
  --acc: #C9D5EA;          /* platinum silver */
  --acc-hover: #E6ECF7;    /* bright platinum */
  --acc-down: #9AA9C4;     /* worn silver */
  --acc-wash: rgba(201, 213, 234, 0.10);
  --acc-glow: rgba(220, 230, 246, 0.22);
  /* platinum metal gradient — the ONE brand finish, reuse everywhere */
  --plat: linear-gradient(180deg, #FFFFFF 0%, #E8EDF5 45%, #98A5BC 100%);

  /* semantic */
  --ok: #2ECC71;
  --ok-wash: rgba(46, 204, 113, 0.13);
  --danger: #FF4D4D;
  --danger-wash: rgba(255, 77, 77, 0.13);
  --warn: #FFB020;
  --tg: #229ED9;
  --tg-wash: rgba(34, 158, 217, 0.13);

  /* type */
  --font-ui: "Inter", -apple-system, sans-serif;
  --font-tech: "Space Grotesk", "Inter", sans-serif;   /* buttons, labels, nav — technical edge */
  --font-display: "Bebas Neue", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* radius — SHARP. Depth via borders, aggression via edges. */
  --r: 2px;        /* cards, drawers, modals */
  --r-sm: 2px;     /* buttons, inputs, nav items */
  --r-full: 2px;   /* badges, segments — sharp too; circles only for dots/avatars */

  /* scale (4px grid) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px;

  /* motion */
  --fast: 120ms ease-out;
  --move: 150ms ease-out;

  --sidebar-w: 200px;
  --topbar-h: 48px;
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; overscroll-behavior-x: none; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--acc); color: #0B0E16; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--acc-down); }

/* ── Typography helpers ── */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}
/* platinum text — silver metallic gradient for display headings */
.platinum {
  background: linear-gradient(180deg, #FFFFFF 0%, #E8EDF5 45%, #98A5BC 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.star-sep { color: var(--acc); font-size: 0.85em; margin: 0 6px; }
.label {
  font-family: var(--font-tech);
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.11em;
  color: var(--text-3);
}
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.t2 { color: var(--text-2); }
.t3 { color: var(--text-3); }

/* ── Buttons — sharp, bold, platinum primary ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 14px;
  font-family: var(--font-tech);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--raised);
  color: var(--text);
  transition: background var(--fast), border-color var(--fast), color var(--fast), box-shadow var(--fast);
  user-select: none; white-space: nowrap;
}
.btn:hover { background: var(--overlay); border-color: var(--acc); }
.btn:active { background: var(--surface); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid #E6ECF7; outline-offset: 1px; }

.btn-primary {
  background: var(--plat);
  border-color: #FFFFFF; color: #0B0E16;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.6), 0 0 20px var(--acc-glow);
}
.btn-primary:hover { background: linear-gradient(180deg, #FFFFFF 0%, #F2F5FA 55%, #B4C0D6 100%); box-shadow: 3px 3px 0 rgba(0,0,0,0.6), 0 0 26px rgba(220,230,246,0.35); }
.btn-primary:active { box-shadow: 1px 1px 0 rgba(0,0,0,0.6); }

.btn-outline { background: transparent; border-color: var(--acc); color: var(--acc); }
.btn-outline:hover { background: var(--acc-wash); border-color: var(--acc); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--raised); border-color: transparent; color: var(--text); }

.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #0B0E16; }

.btn-lg { height: 40px; padding: 0 var(--s5); font-size: 13px; border-radius: 2px; }
.btn-sm { height: 24px; padding: 0 var(--s2); font-size: 10.5px; border-radius: 2px; }

/* ── Inputs ── */
.input, .select, .textarea {
  width: 100%; height: 30px; padding: 0 var(--s2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 12.5px;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.textarea { height: auto; min-height: 80px; padding: var(--s2) var(--s3); resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-wash); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2355617A' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 30px;
}
.field { display: flex; flex-direction: column; gap: var(--s1); margin-bottom: var(--s4); }
.field .label { margin-bottom: 2px; }

/* ── Cards / KPI ── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}
.kpi {
  display: flex; flex-direction: column; gap: var(--s1);
  padding: var(--s3) var(--s3) var(--s3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}
.kpi .label { display: flex; align-items: center; justify-content: space-between; }
.kpi .num {
  font-size: 22px; font-weight: 600; line-height: 1.15;
  background: var(--plat);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.kpi .delta { font-size: 11px; font-family: var(--font-mono); color: var(--text-3); }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--danger); }
.kpi.hot { border-color: rgba(201, 213, 234, 0.45); background: linear-gradient(160deg, rgba(220, 230, 246, 0.08), transparent 55%), var(--surface); }
.kpi.hot .num {
  background: var(--plat);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ── Tables ── */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th {
  text-align: left; padding: 5px var(--s2);
  font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-3);
  font-family: var(--font-tech);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.tbl td { padding: 7px var(--s2); border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background var(--fast); }
.tbl tbody tr:hover { background: var(--raised); box-shadow: inset 3px 0 0 var(--acc); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl .num { text-align: right; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }

/* ── Badges & status dots ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 18px; padding: 0 7px;
  font-size: 10px; font-weight: 600;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  background: var(--raised);
}
.badge.acc { background: var(--plat); border-color: #FFFFFF; color: #0B0E16; font-weight: 700; }
.badge.ok { background: var(--ok-wash); border-color: transparent; color: var(--ok); }
.badge.danger { background: var(--danger-wash); border-color: transparent; color: var(--danger); }
.badge.tg { background: var(--tg-wash); border-color: transparent; color: var(--tg); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.ok { background: var(--ok); }
.dot.danger { background: var(--danger); }
.dot.tg { background: var(--tg); }
.dot.live { background: var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── Tabs ── */
.tabs { display: flex; gap: var(--s1); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; width: max-content; }
.tab {
  padding: 6px var(--s4); border-radius: 7px;
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  transition: all var(--fast);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--acc); background: var(--acc-wash); }

/* ── Segbar ── */
.segbar { display: flex; gap: var(--s2); overflow-x: auto; white-space: nowrap; padding-bottom: 2px; }
.seg {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 11px;
  font-family: var(--font-tech);
  font-size: 11px; font-weight: 500; color: var(--text-2);
  border: 1px solid var(--line); border-radius: var(--r-full);
  background: var(--surface);
  transition: all var(--fast); flex: none;
}
.seg { white-space: nowrap; }
.seg:hover { border-color: var(--text-3); color: var(--text); }
.seg.active {
  border-color: #FFFFFF; color: #0B0E16;
  background: var(--plat);
  font-weight: 700; box-shadow: 2px 2px 0 rgba(0,0,0,0.55);
}
.seg .cnt { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
.seg.active .cnt { color: rgba(11, 14, 22, 0.75); }

/* ── Drawer ── */
.drawer-veil {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(3, 5, 10, 0.72);
  opacity: 0; transition: opacity var(--move);
}
.drawer-veil.open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(560px, 100vw);
  background: var(--surface);
  border-left: 3px solid #C9D5EA;
  transform: translateX(100%); transition: transform var(--move);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.drawer-body { flex: 1; overflow-y: auto; padding: var(--s4); }

/* ── Modal ── */
.modal-veil {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(3, 5, 10, 0.78);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s4);
}
.modal {
  width: 100%; max-width: 420px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: var(--s5);
}
.modal h3 { font-size: 15px; font-weight: 600; margin-bottom: var(--s2); }
.modal p { color: var(--text-2); font-size: 13px; margin-bottom: var(--s4); }
.modal .row { display: flex; gap: var(--s2); justify-content: flex-end; }

/* ── Toasts ── */
.toasts { position: fixed; bottom: var(--s4); right: var(--s4); z-index: 80; display: flex; flex-direction: column; gap: var(--s2); }
.toast {
  display: flex; align-items: center; gap: var(--s2);
  padding: var(--s3) var(--s4);
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  border-left: 3px solid var(--text-3);
  font-size: 12.5px;
  animation: toastIn var(--move);
  max-width: 340px;
}
.toast.ok { border-left-color: var(--ok); }
.toast.danger { border-left-color: var(--danger); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Skeletons ── */
.skel { background: var(--raised); border-radius: 6px; position: relative; overflow: hidden; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.skel-row { height: 14px; margin: var(--s2) 0; }

/* ── Empty state ── */
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--s3); padding: var(--s16) var(--s4); text-align: center; }
.empty img, .empty svg { opacity: 0.16; }
.empty .label { font-size: 11px; }

/* ── App layout ── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none;
  background: linear-gradient(180deg, #090E1A 0%, #060A12 100%);
  border-right: 1px solid var(--line-strong);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  height: max(var(--topbar-h), env(titlebar-area-height, var(--topbar-h))); padding: 0 var(--s4);
  border-bottom: 1px solid var(--line-strong);
  position: relative;
  flex: none;
}
.sidebar .brand::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, #FFFFFF, #C9D5EA 45%, rgba(152,165,188,0.25));
}
.sidebar .brand > span:first-child { display: inline-flex; align-items: center; }
.sidebar .brand img, .sidebar .brand svg { width: 34px; height: 34px; }
.sidebar .brand .name {
  font-family: var(--font-display); font-size: 24px; letter-spacing: 0.05em; text-transform: uppercase;
  background: linear-gradient(180deg, #FFFFFF 0%, #E8EDF5 45%, #98A5BC 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar nav { flex: 1; overflow-y: auto; padding: var(--s4) var(--s2) var(--s3); }
.navsec { margin-bottom: var(--s4); }
.navsec > .label { display: flex; align-items: center; gap: 6px; padding: var(--s1) var(--s3) var(--s1) var(--s4); color: var(--text-3); }
.navsec > .label::before { content: ""; width: 8px; height: 2px; background: var(--plat); flex: none; }
.navitem {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 34px; padding: 0 var(--s4);
  font-family: var(--font-tech);
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  border-radius: 0;
  border-left: 3px solid transparent;
  transition: all var(--fast);
  text-align: left;
}
.navitem:hover { color: var(--text); background: rgba(255,255,255,0.03); transform: translateX(2px); }
.navitem.active {
  color: #FFF; font-weight: 700; border-left-color: #E6ECF7;
  background: linear-gradient(90deg, rgba(220,230,246,0.16), transparent 75%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.navitem .ico { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--text-3); transition: color var(--fast); }
.navitem:hover .ico { color: var(--text-2); }
.navitem.active .ico { color: #E6ECF7; }
.sidebar .foot { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: max(var(--topbar-h), env(titlebar-area-height, var(--topbar-h))); flex: none;
  display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--s5);
  padding-left: max(var(--s5), env(titlebar-area-x, 0px));
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 40;
  -webkit-app-region: drag; app-region: drag;
}
.topbar button, .topbar input, .topbar select { -webkit-app-region: no-drag; app-region: no-drag; }
.topbar .crumb {
  position: relative;
  font-family: var(--font-display); font-size: 18px; letter-spacing: 0.05em; text-transform: uppercase;
  background: linear-gradient(180deg, #FFFFFF 0%, #E8EDF5 45%, #98A5BC 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.topbar .spacer { flex: 1; }
.content { padding: var(--s4); flex: 1; }

.viewhead { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); flex-wrap: wrap; }
.viewhead h2 {
  font-family: var(--font-display); font-size: 24px; letter-spacing: 0.04em; text-transform: uppercase;
  background: linear-gradient(180deg, #FFFFFF 0%, #E8EDF5 45%, #98A5BC 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.viewhead .sub { color: var(--text-2); font-size: 11.5px; width: 100%; margin-top: -4px; }
.viewhead .spacer { flex: 1; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s2); margin-bottom: var(--s4); }

/* ── Mobile bottom nav ── */
.botnav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--surface);
  border-top: 1px solid var(--line-strong);
  padding-bottom: env(safe-area-inset-bottom);
}
.botnav .navitem {
  flex-direction: column; gap: 3px; height: 56px; padding: var(--s2) 0;
  justify-content: center; font-size: 10px; font-weight: 600;
  border-radius: 0;
}
.botnav .navitem.active { background: none; color: #FFF; }
.botnav .navitem.active .ico { color: #E6ECF7; }
.botnav .navitem .ico { width: auto; font-size: 17px; }

/* ── Responsive: fluid at EVERY width ──
   ≥1081px full sidebar · 641–1080px icon rail · ≤640px bottom nav.
   Fans table columns: .c2 hidden <640 · .c3 hidden <900 · .c4 hidden <1150. */
@media (max-width: 1150px) { .tbl-fans .c4 { display: none; } }
@media (max-width: 900px)  { .tbl-fans .c3 { display: none; } }

@media (max-width: 1080px) {
  .sidebar { width: 60px; }
  .sidebar .brand { justify-content: center; padding: 0; }
  .sidebar .brand .name { display: none; }
  .navsec > .label { visibility: hidden; height: 10px; padding: 0; }
  .navitem { font-size: 0; gap: 0; justify-content: center; padding: 0; }
  .navitem .ico { font-size: 16px; width: auto; }
  .sidebar .foot { display: none; }
}
@media (max-width: 640px) {
  .sidebar { display: none; }
  .botnav { display: flex; }
  .botnav .navitem { flex: 1; font-size: 10px; gap: 3px; padding: var(--s2) 0; justify-content: center; }
  .botnav .navitem .ico { font-size: 17px; }
  .content { padding: var(--s3); padding-bottom: 84px; }
  .drawer { width: 100vw; border-left: 0; }
  .kpi .num { font-size: 22px; }
  .tbl-fans .c2 { display: none; }
  .viewhead h2 { font-size: 24px; }
  .fanprev { display: none !important; }
}

/* ── Login ── */
.gate {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(700px 420px at 50% -10%, rgba(220, 230, 246, 0.10), transparent 65%),
    var(--bg);
  padding: var(--s4);
}
.gate-box {
  position: relative;
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: var(--s10) var(--s8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 24px 80px rgba(0, 0, 0, 0.55);
}
.gate-box::before {
  content: ""; position: absolute; top: -1px; left: -1px; right: -1px; height: 3px;
  background: var(--plat);
}
.gate-box .mark { display: flex; justify-content: center; margin-bottom: var(--s5); position: relative; }
.gate-box h1 {
  font-family: var(--font-display); font-size: 40px; text-align: center; letter-spacing: 0.06em; text-transform: uppercase;
  background: linear-gradient(180deg, #FFFFFF 0%, #E8EDF5 45%, #98A5BC 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.gate-box .sub {
  text-align: center; margin: var(--s1) 0 var(--s8);
  font-size: 12.5px; color: var(--text-2);
}
.gate-box form { display: flex; flex-direction: column; gap: var(--s3); }
.gate-box .input { height: 44px; }
.gate-box .btn { height: 44px; border-radius: var(--r-sm); font-size: 14px; }
.gate-err { text-align: center; color: var(--danger); font-size: 12px; min-height: 18px; }
.gate-foot { text-align: center; margin-top: var(--s6); font-size: 11px; color: var(--text-3); }

/* ── AGGRESSIVE PASS ── */
.hazard { height: 2px; background: var(--plat); opacity: 0.9; }
.btn-primary { box-shadow: 3px 3px 0 rgba(0,0,0,0.55), 0 0 18px var(--acc-glow); }
.btn-primary:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 rgba(0,0,0,0.55); }
.kpi.hot { border-color: var(--acc); border-width: 1px; position: relative; overflow: hidden; }
.kpi.hot::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--acc); }

/* ── Fan hover preview card ── */
.fanprev {
  position: fixed; z-index: 55; width: 300px; pointer-events: none;
  background: var(--raised); border: 1px solid var(--acc); border-radius: var(--r);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.5); padding: var(--s3) var(--s4);
  font-size: 12px;
}
.fanprev .row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.fanprev .row b { font-weight: 600; }

/* ── Chat dock (ops-desk style full overlay) ── */
.dock-veil { position: fixed; inset: 0; z-index: 60; background: rgba(3,5,10,0.82); }
.dock {
  position: fixed; inset: 16px; z-index: 61;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
  border-top: 3px solid #C9D5EA;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.5);
  display: flex; flex-direction: column; overflow: hidden;
}
.dock-head {
  flex: none; display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line-strong);
  background: var(--raised);
}
.dock-head .who { font-weight: 700; font-size: 15px; }
.dock-head .meta { color: var(--text-2); font-size: 12px; }
.dock-body { flex: 1; display: flex; min-height: 0; }
.dock-side {
  width: 300px; flex: none; overflow-y: auto; padding: var(--s4);
  border-right: 1px solid var(--line);
}
.dock-side h4 { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--acc); margin: var(--s4) 0 var(--s2); }
.dock-side h4:first-child { margin-top: 0; }
.dock-chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dock-msgs { flex: 1; overflow-y: auto; padding: var(--s4); display: flex; flex-direction: column; gap: 6px; }
.dock-compose { flex: none; border-top: 1px solid var(--line-strong); padding: var(--s3) var(--s4); }
.dock-tools { display: flex; gap: 8px; margin-bottom: 8px; }
.bubble {
  max-width: 72%; padding: 8px 12px; font-size: 13px; white-space: pre-wrap; word-break: break-word;
  border-radius: var(--r);
}
.bubble.in { align-self: flex-start; background: var(--raised); border: 1px solid var(--line); }
.bubble.out { align-self: flex-end; background: var(--plat); color: #10131C; border: 1px solid #FFFFFF; font-weight: 500; }
.bubble .stamp { display: block; font-size: 10px; margin-top: 3px; opacity: 0.65; }
/* info fields */
.inforow { display: grid; grid-template-columns: 104px 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.inforow .label { font-size: 9.5px; }
.inforow .input, .inforow .select { height: 28px; font-size: 12px; background: var(--raised); }
/* tag chips */
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; }
.tagchip {
  font-family: var(--font-tech);
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border: 1px solid var(--line-strong); border-radius: var(--r-full);
  font-size: 11px; font-weight: 600; color: var(--text-2); cursor: pointer;
  transition: all var(--fast); background: var(--raised);
}
.tagchip:hover { border-color: var(--acc); color: var(--text); }
.tagchip.on { background: var(--plat); border-color: #FFFFFF; color: #10131C; }
@media (max-width: 900px) {
  .dock { inset: 0; border: 0; border-radius: 0; }
  .dock-body { flex-direction: column; }
  .dock-side { width: 100%; max-height: 38vh; border-right: 0; border-bottom: 1px solid var(--line-strong); }
}
/* media grid */
.mediagrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s3); }
.mediacard { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--raised); cursor: pointer; transition: border-color var(--fast); }
.mediacard:hover { border-color: var(--acc); }
.mediacard img, .mediacard video { width: 100%; height: 120px; object-fit: cover; display: block; background: var(--bg); }
.mediacard .cap { padding: 6px 8px; font-size: 10.5px; color: var(--text-2); display: flex; justify-content: space-between; gap: 6px; }

/* ── Dock bar — minimized chats (ops-desk style) ── */
.dockbar {
  position: fixed; right: 12px; bottom: 12px; z-index: 59;
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end;
  max-width: 70vw;
}
.dockpill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 12px;
  background: var(--raised); border: 1px solid var(--acc);
  border-radius: var(--r); font-size: 11.5px; font-weight: 600;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.5);
  cursor: pointer; transition: background var(--fast);
}
.dockpill:hover { background: var(--overlay); }
.dockpill .u {
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--plat); color: #0B0E16;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r);
}
.dockpill .x { color: var(--text-3); font-size: 12px; padding-left: 2px; }
.dockpill .x:hover { color: var(--danger); }
@media (max-width: 640px) { .dockbar { bottom: 70px; } }

/* ── Automation view ── */
.auto-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); align-items: start; }
.auto-col { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.auto-full { margin-bottom: var(--s3); }
@media (max-width: 980px) { .auto-cols { grid-template-columns: 1fr; } }

/* calendar (Scheduled DMs) */
.schedwrap { display: grid; grid-template-columns: 320px 1fr; gap: var(--s5); align-items: start; }
@media (max-width: 980px) { .schedwrap { grid-template-columns: 1fr; } }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cal-head .mon { font-family: var(--font-tech); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; flex: 1; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { text-align: center; font-family: var(--font-tech); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); padding: 3px 0; }
.cal-day {
  position: relative; height: 38px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-2);
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r);
  cursor: pointer; transition: border-color var(--fast), background var(--fast);
}
.cal-day:hover { border-color: var(--acc-down); color: var(--text); }
.cal-day.dim { opacity: 0.32; }
.cal-day.today { border-color: var(--acc); }
.cal-day.sel { background: var(--plat); border-color: #FFFFFF; color: #0B0E16; font-weight: 700; }
.cal-day .cnt {
  font-size: 8.5px; line-height: 1; color: var(--acc);
  font-weight: 700;
}
.cal-day.sel .cnt { color: rgba(11,14,22,0.7); }

.autocard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: inset 0 1px 0 rgba(255,255,255,0.09); }
.autocard-head { display: flex; align-items: center; gap: 10px; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.autocard-head .ttl { font-family: var(--font-tech); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.autocard-head .spacer { flex: 1; }
.autocard-sub { padding: var(--s2) var(--s4) 0; color: var(--text-3); font-size: 11.5px; }
.autocard-body { padding: var(--s3) var(--s4) var(--s4); }
.autocard-body.off { opacity: 0.4; pointer-events: none; user-select: none; }

/* switch — sharp platinum */
.switch { position: relative; width: 42px; height: 22px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch .sl {
  position: absolute; inset: 0; background: var(--overlay);
  border: 1px solid var(--line-strong); border-radius: var(--r); transition: all var(--fast);
}
.switch .sl::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  background: var(--text-3); border-radius: var(--r); transition: all var(--fast);
}
.switch input:checked + .sl { background: var(--plat); border-color: #FFFFFF; }
.switch input:checked + .sl::before { left: 22px; background: #0B0E16; }

/* variant rows */
.varrow { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.varrow .idx {
  flex: none; width: 22px; height: 22px; margin-top: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-3);
  border: 1px solid var(--line); border-radius: var(--r); background: var(--raised);
}
.varrow .textarea { flex: 1; min-height: 42px; font-size: 12.5px; }
.varrow .rm { flex: none; margin-top: 3px; }

/* follow-up steps */
.steprow { border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); padding: var(--s2) var(--s3) var(--s3); margin-bottom: var(--s2); }
.steprow-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.steprow-head .stepno { font-family: var(--font-tech); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--acc); }
.steprow-head .input { width: 72px; height: 26px; font-size: 12px; }
.steprow .textarea { min-height: 42px; font-size: 12.5px; background: var(--bg); }

/* scheduled + manager rows */
.listrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.listrow:last-of-type { border-bottom: 0; }
.listrow .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addrow { display: flex; gap: 8px; margin-top: var(--s3); flex-wrap: wrap; align-items: center; }
.addrow .input, .addrow .select { height: 30px; }
.addrow input[type="datetime-local"] { font-family: var(--font-mono); font-size: 11.5px; padding: 0 6px; }
.listrow .when { width: 106px; flex: none; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
@media (max-width: 640px) {
  .addrow > * { flex: 1 1 100%; }
  .addrow .btn { width: 100%; }
}

/* empty state inside grids spans full width (centered cobra) */
.mediagrid .empty { grid-column: 1 / -1; }

/* arrivals chart — hover tooltip with the day's count */
.arr-bar { position: relative; flex: 1; border-radius: 1px; cursor: default; }
.arr-bar:hover { outline: 1px solid var(--acc); }
.arr-bar:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--overlay); border: 1px solid var(--acc); border-radius: var(--r);
  padding: 3px 8px; font-family: var(--font-mono); font-size: 10.5px; white-space: nowrap;
  color: var(--text); z-index: 20; box-shadow: 2px 2px 0 rgba(0,0,0,0.5); pointer-events: none;
}
