/* =========================================================================
   HOUSE VPN — CONTROL CENTER
   Gunmetal surfaces, chrome text, champagne-gold signal (from the logo).
   ========================================================================= */

:root {
  /* Surfaces */
  --bg-core: #0f131a;
  --bg-sunken: #0b0e14;
  --bg-surface: #151a23;
  --bg-raised: #1b212c;
  --bg-hover: #212836;
  --bg-card: var(--bg-surface);

  /* Lines */
  --line: #232a37;
  --line-strong: #2e3647;
  --border-subtle: var(--line);

  /* Text (chrome) */
  --text-primary: #e9edf3;
  --text-secondary: #9aa5b8;
  --text-muted: #636e82;
  --text-faint: #475164;

  /* Brand gold (logo infinity) */
  --gold: #d8b47a;
  --gold-bright: #f1d6a4;
  --gold-deep: #a9823f;
  --gold-primary: var(--gold);
  --gold-soft: rgba(216, 180, 122, 0.12);
  --gold-line: rgba(216, 180, 122, 0.32);
  --gold-glow: rgba(216, 180, 122, 0.22);
  --gold-gradient: linear-gradient(135deg, #f1d6a4 0%, #d8b47a 45%, #a9823f 100%);
  --border-gold: var(--gold-line);

  /* Status */
  --live: #3ccf8e;
  --live-soft: rgba(60, 207, 142, 0.12);
  --info: #6ea8fe;
  --info-soft: rgba(110, 168, 254, 0.12);
  --warn: #f0b04f;
  --warn-soft: rgba(240, 176, 79, 0.12);
  --danger: #f06b5d;
  --danger-soft: rgba(240, 107, 93, 0.12);
  --accent-success: var(--live);
  --accent-danger: var(--danger);
  --accent-warning: var(--warn);
  --accent-info: var(--info);

  /* Shape & type */
  --sidebar-width: 252px;
  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-ui: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --ease-in: cubic-bezier(0.5, 0, 0.75, 0);
  --dur-fast: 140ms;
  --dur: 240ms;
  --dur-slow: 480ms;
  --transition-smooth: all var(--dur) var(--ease-out);

  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --shadow-pop: 0 24px 64px -16px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.04);

  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { scrollbar-width: thin; scrollbar-color: #2e3647 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a3242; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #3a4458; background-clip: padding-box; }
::selection { background: rgba(216, 180, 122, 0.3); color: #fff; }

html { -webkit-text-size-adjust: 100%; }

body.dashboard-body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: 'ss01', 'cv11';
  background: var(--bg-core);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}

.hidden { display: none !important; }
.font-mono { font-family: var(--font-mono) !important; font-feature-settings: 'zero' 1; letter-spacing: -0.01em; }
.font-xs { font-size: 0.72rem !important; }
.text-gold { color: var(--gold) !important; }
.text-gold-bright { color: var(--gold-bright) !important; font-weight: 600; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.flex-1 { flex: 1; min-width: 0; }
.flex-2 { flex: 2; min-width: 0; }
.flex-align-center { align-items: center; }

/* =========================================================================
   1. SIGN-IN
   ========================================================================= */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--bg-sunken);
  overflow: hidden;
  transition: opacity 420ms var(--ease-out), filter 420ms var(--ease-out);
}

.auth-gate-overlay.leaving {
  opacity: 0;
  filter: blur(6px);
  pointer-events: none;
}

.auth-backdrop { position: absolute; inset: 0; pointer-events: none; }

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  will-change: transform;
}
.orb-a {
  width: 520px; height: 520px;
  left: 50%; top: 50%;
  margin: -420px 0 0 -460px;
  background: radial-gradient(circle, rgba(216, 180, 122, 0.35), transparent 65%);
  animation: orbDrift 18s ease-in-out infinite alternate;
}
.orb-b {
  width: 460px; height: 460px;
  left: 50%; top: 50%;
  margin: -60px 0 0 -40px;
  background: radial-gradient(circle, rgba(110, 140, 190, 0.22), transparent 65%);
  animation: orbDrift 22s ease-in-out infinite alternate-reverse;
}
.auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 40px 32px 28px;
  background: rgba(21, 26, 35, 0.78);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  animation: cardRise 700ms var(--ease-out) both;
}

.auth-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, rgba(241, 214, 164, 0.55), transparent 35%, transparent 70%, rgba(216, 180, 122, 0.25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.auth-emblem {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  animation: emblemIn 900ms var(--ease-spring) 120ms both;
}
.auth-logo { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 24px rgba(216, 180, 122, 0.25)); }

.auth-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #fff;
  animation: fadeUp 600ms var(--ease-out) 200ms both;
}
.auth-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 6px 0 28px;
  animation: fadeUp 600ms var(--ease-out) 260ms both;
}

.auth-form { display: flex; flex-direction: column; gap: 4px; }
.auth-form > * { animation: fadeUp 600ms var(--ease-out) both; }
.auth-form > *:nth-child(1) { animation-delay: 320ms; }
.auth-form > *:nth-child(2) { animation-delay: 380ms; }
.auth-form > *:nth-child(3) { animation-delay: 420ms; }
.auth-form > *:nth-child(4) { animation-delay: 460ms; margin-top: 8px; }

.input-icon-wrap { position: relative; }
.input-icon-wrap > svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--dur) var(--ease-out);
}
.input-icon-wrap .luxury-input { padding-left: 40px; height: 46px; }
.input-icon-wrap:focus-within > svg { color: var(--gold); }
.totp-input { letter-spacing: 0.4em; font-size: 1rem !important; }

#totp-group:not(.hidden) { animation: expandIn 360ms var(--ease-out) both; }

.auth-footer {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  animation: fadeIn 600ms var(--ease-out) 600ms both;
}

.auth-card.shake { animation: shake 420ms var(--ease-out); }

/* =========================================================================
   2. SHELL
   ========================================================================= */
.dashboard-shell { display: flex; min-height: 100vh; }

.dashboard-shell.entering .dash-sidebar { animation: slideInLeft 620ms var(--ease-out) both; }
.dashboard-shell.entering .topbar { animation: fadeDown 560ms var(--ease-out) 120ms both; }

/* ---------- Sidebar ---------- */
.dash-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: var(--bg-sunken);
  border-right: 1px solid var(--line);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 18px;
}
.brand-logo { width: 38px; height: 38px; object-fit: contain; }
.brand-text h2 {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: #fff;
  line-height: 1.2;
}
.brand-tag { font-size: 0.78rem; color: var(--text-muted); }

.sidebar-menu {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 12px 16px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-group-label {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-faint);
  padding: 16px 12px 6px;
}
.nav-group-label:first-of-type { padding-top: 6px; }

.nav-indicator {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(216, 180, 122, 0.16), rgba(216, 180, 122, 0.05));
  border: 1px solid rgba(216, 180, 122, 0.22);
  pointer-events: none;
  opacity: 0;
  transition:
    transform 180ms cubic-bezier(0.2, 0.9, 0.3, 1),
    height 150ms ease-out,
    opacity 120ms ease;
  z-index: 0;
}
.nav-indicator::before {
  content: '';
  position: absolute;
  left: -13px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold-gradient);
  box-shadow: 0 0 12px var(--gold-glow);
}
.nav-indicator.ready { opacity: 1; }

.nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  transition: color var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}
.nav-item svg { flex-shrink: 0; transition: transform var(--dur) var(--ease-spring); }
.nav-item:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.03); }
.nav-item:hover svg { transform: scale(1.08); }
.nav-item:active svg { transform: scale(0.92); }
.nav-item.active { color: var(--gold-bright); background: transparent; }
.nav-item.active svg { color: var(--gold); }
.nav-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.badge-pill {
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  transition: transform var(--dur) var(--ease-spring), background var(--dur);
}
.badge-pill.live { background: var(--live-soft); color: var(--live); }
.badge-pill.warn { background: var(--warn-soft); color: var(--warn); }
.badge-pill.gold { background: var(--gold-soft); color: var(--gold); }
.badge-pill.danger { background: var(--danger-soft); color: var(--danger); }
.badge-pill.bump { animation: bump 420ms var(--ease-spring); }

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 12px 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--line);
}
.server-heartbeat { display: flex; align-items: center; gap: 10px; min-width: 0; }
.heartbeat-dot {
  position: relative;
  width: 8px; height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--live);
}
.heartbeat-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--live);
  animation: ping 2.4s var(--ease-out) infinite;
}
.hb-title { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.hb-status { display: block; font-size: 0.74rem; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.logout-btn {
  width: 34px; height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}
.logout-btn:hover { color: var(--danger); border-color: rgba(240, 107, 93, 0.4); background: var(--danger-soft); }

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(5, 7, 10, 0.6);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease-out);
}

/* ---------- Main ---------- */
.dash-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
  padding: 0 32px 48px;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 -32px 24px;
  padding: 18px 32px;
  background: rgba(15, 19, 26, 0.78);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease-out);
}
.topbar.scrolled { border-bottom-color: var(--line); }

.topbar-title-wrap { flex: 1; min-width: 0; }
.topbar-title-wrap h1 {
  font-size: 1.45rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  color: #fff;
  line-height: 1.25;
}
.topbar-sub { display: block; font-size: 0.86rem; color: var(--text-secondary); }
.topbar-title-wrap.swap h1, .topbar-title-wrap.swap .topbar-sub { animation: titleSwap 420ms var(--ease-out) both; }
.topbar-title-wrap.swap .topbar-sub { animation-delay: 50ms; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); transition: background var(--dur); }
.sync-chip.ok .sync-dot { background: var(--live); box-shadow: 0 0 0 3px var(--live-soft); }
.sync-chip.stale .sync-dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.sync-chip.flash .sync-dot { animation: bump 500ms var(--ease-spring); }

.icon-action-btn {
  width: 34px; height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-surface);
  color: var(--text-secondary);
  transition: color var(--dur), border-color var(--dur), background var(--dur), transform 500ms var(--ease-out) !important;
}
.icon-action-btn:hover { color: var(--gold); border-color: var(--gold-line); background: var(--bg-raised); }
.icon-action-btn.spinning svg { animation: spin 700ms var(--ease-out); }
.menu-toggle { display: none; }

.admin-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px 0 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
}
.admin-avatar {
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: #241a0a;
  font-weight: 700;
  font-size: 0.85rem;
}
.admin-meta { display: flex; flex-direction: column; line-height: 1.2; }
.admin-meta strong { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.admin-meta span { font-size: 0.72rem; color: var(--text-muted); }

/* =========================================================================
   3. TAB PANES — High-performance, instant switching
   ========================================================================= */
.tab-pane {
  display: none;
  opacity: 0;
}
.tab-pane.active {
  display: block;
  opacity: 1;
  animation: tabFadeIn 120ms ease-out forwards;
}

@keyframes tabFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* =========================================================================
   4. LIVE HERO (overview signature)
   ========================================================================= */
.live-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(200px, 0.8fr) minmax(0, 2fr);
  grid-template-areas:
    "primary chart"
    "stats stats";
  gap: 0;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(216, 180, 122, 0.10), transparent 50%),
    linear-gradient(180deg, var(--bg-raised), var(--bg-surface));
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.hero-primary { grid-area: primary; padding: 28px 28px 24px; display: flex; flex-direction: column; justify-content: center; }
.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.live-dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--live);
}
.live-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--live);
  animation: ping 2s var(--ease-out) infinite;
}
.hero-number {
  font-size: clamp(3.4rem, 6vw, 4.8rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1;
  margin: 10px 0 8px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff 30%, #c9cfd9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-number.tick { animation: tick 600ms var(--ease-out); }
.hero-caption { font-size: 0.86rem; color: var(--text-muted); }

.hero-chart {
  grid-area: chart;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 24px 16px 0;
  min-height: 200px;
}
.spark { width: 100%; height: 150px; overflow: visible; }
.spark-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-line.online { stroke: var(--gold); filter: drop-shadow(0 4px 10px rgba(216, 180, 122, 0.35)); }
.spark-line.vpn { stroke: var(--live); stroke-dasharray: 4 4; opacity: 0.8; }
.spark path { transition: d 600ms var(--ease-out); }
.spark-wrap { position: relative; }
.spark-head {
  position: absolute;
  z-index: 1;
  width: 9px; height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 0 4px rgba(216, 180, 122, 0.25), 0 0 16px rgba(216, 180, 122, 0.6);
  opacity: 0;
  transition: left 600ms var(--ease-out), top 600ms var(--ease-out), opacity 300ms;
}
.spark-head.on { opacity: 1; }
.spark-head::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--gold);
  animation: ping 2s var(--ease-out) infinite;
}

.hero-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.hero-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-swatch { width: 14px; height: 2px; border-radius: 2px; display: inline-block; }
.lg-swatch.online { background: var(--gold); }
.lg-swatch.vpn { background: repeating-linear-gradient(90deg, var(--live) 0 4px, transparent 4px 7px); }
.lg-note { margin-left: auto; }
.spark-range-group {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.spark-range-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.spark-range-btn:hover { color: var(--text); }
.spark-range-btn.active {
  background: rgba(216, 180, 122, 0.18);
  color: var(--gold-bright);
}

.hero-stats {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  background: rgba(11, 14, 20, 0.35);
}
.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 28px;
  transition: background var(--dur) var(--ease-out);
}
.hero-stat + .hero-stat { border-left: 1px solid var(--line); }
.hero-stat:hover { background: rgba(255, 255, 255, 0.015); }
.hs-label { font-size: 0.82rem; color: var(--text-secondary); }
.hs-value {
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.hs-value.font-mono { font-size: 1.45rem; letter-spacing: -0.04em; }
.hs-note, .metric-trend { font-size: 0.78rem; color: var(--text-muted); }
.metric-trend.text-gold::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  margin-right: 6px;
  vertical-align: 1px;
}

/* =========================================================================
   5. PANELS & GRIDS
   ========================================================================= */
.overview-dual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.overview-dual-grid.reverse { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.releases-dual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.giveaway-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.5fr);
  gap: 20px;
  align-items: start;
}

.card-panel {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-1);
  margin-bottom: 20px;
  min-width: 0;
}
.overview-dual-grid > .card-panel,
.releases-dual-grid > .card-panel,
.giveaway-grid > .card-panel { margin-bottom: 0; }
.tab-pane > .overview-dual-grid { margin-bottom: 20px; }
.card-panel.narrow, .card-panel.max-w-4xl { max-width: 760px; }

.panel-header { margin-bottom: 18px; }
.panel-header.flex-between { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-title-group h3 {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
}
.panel-sub { display: block; margin-top: 2px; font-size: 0.84rem; color: var(--text-secondary); }

.ghost-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-xs);
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 0.84rem;
  font-weight: 500;
  transition: background var(--dur), color var(--dur);
}
.ghost-link::after {
  content: '';
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--dur) var(--ease-spring);
}
.ghost-link:hover { background: var(--gold-soft); color: var(--gold-bright); }
.ghost-link:hover::after { transform: translateX(3px) rotate(45deg); }

/* Spec list */
.server-specs-list { display: flex; flex-direction: column; }
.spec-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.86rem;
}
.spec-row:last-child { border-bottom: 0; padding-bottom: 0; }
.spec-row:first-child { padding-top: 0; }
.spec-name { color: var(--text-secondary); }
.spec-val { color: var(--text-primary); font-size: 0.8rem; text-align: right; }

/* =========================================================================
   6. TABLES
   ========================================================================= */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 12px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
}
.table-responsive::-webkit-scrollbar {
  height: 6px;
}
.table-responsive::-webkit-scrollbar-track {
  background: var(--bg-sunken);
  border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
  background: var(--gold-deep);
}

.luxury-table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 0.84rem;
}
.luxury-table th {
  position: sticky;
  top: 0;
  padding: 12px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
.luxury-table th:first-child, .luxury-table td:first-child { padding-left: 20px; }
.luxury-table th:last-child, .luxury-table td:last-child { padding-right: 20px; }
.luxury-table .th-right, .luxury-table td.td-actions { text-align: right; }
.luxury-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(35, 42, 55, 0.7);
  color: var(--text-primary);
  vertical-align: middle;
  white-space: nowrap;
  transition: background var(--dur-fast) ease;
}
.luxury-table td:has(.reason-tag) { white-space: normal; min-width: 220px; }
.luxury-table tbody tr:last-child td { border-bottom: 0; }
.luxury-table tbody tr { transition: background var(--dur-fast) ease; }
.luxury-table tbody tr:hover td { background: rgba(255, 255, 255, 0.025); }
.luxury-table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.luxury-table.mini td { padding-top: 10px; padding-bottom: 10px; }

.table-empty {
  text-align: center !important;
  color: var(--text-muted);
  padding: 44px 16px !important;
  font-size: 0.88rem;
}
.table-empty.error { color: var(--danger); }

/* Sort headers */
.sortable-th { cursor: pointer; user-select: none; transition: color var(--dur-fast); }
.sortable-th:hover { color: var(--text-primary) !important; }
.sortable-th.active-sort { color: var(--gold) !important; }
.sort-icon { display: inline-block; margin-left: 3px; font-size: 0.7rem; color: var(--gold); opacity: 0.9; }

/* Status pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: currentColor; flex-shrink: 0; }
.status-pill.vpn_active { background: var(--live-soft); color: var(--live); }
.status-pill.vpn_active .status-dot { box-shadow: 0 0 0 0 rgba(60, 207, 142, 0.5); animation: dotPulse 2s var(--ease-out) infinite; }
.status-pill.app_open { background: var(--info-soft); color: var(--info); }
.status-pill.offline { background: rgba(255, 255, 255, 0.04); color: var(--text-muted); }
.status-pill.online { background: var(--live-soft); color: var(--live); }
.status-pill.standby { background: var(--warn-soft); color: var(--warn); }

.country-cell { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.country-flag { font-size: 1rem; }

.discord-id-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 0.8rem;
}
.discord-id-cell strong { font-weight: 500; color: #b9c2ff !important; }
.discord-mini-icon { width: 14px; height: 14px; flex-shrink: 0; }

.wl-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 500;
  white-space: nowrap;
  vertical-align: middle;
}
.wl-badge.wl-ban { color: var(--live); background: var(--live-soft); }
.wl-badge.wl-update { color: var(--warn); background: var(--warn-soft); }

.device-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; white-space: nowrap; }

.reason-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
}
.reason-tag.watchdog { background: var(--warn-soft); color: var(--warn); }
.reason-tag.crash { background: var(--danger-soft); color: #ff8b7f; }

/* Shared-config highlights */
.config-shared-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 4px 0 8px;
  border-radius: 6px;
  background: var(--cfg-bg, var(--gold-soft));
  border: 1px solid var(--cfg-border, var(--gold-line));
  color: var(--cfg-color, var(--gold));
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease-spring), filter var(--dur);
}
.config-shared-badge:hover { transform: translateY(-1px); filter: brightness(1.18); }
.config-shared-badge .cfg-icon { font-size: 0.7rem; }
.config-shared-badge .cfg-badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
}
.luxury-table tr.row-shared-config td { background: var(--cfg-bg, rgba(240, 176, 79, 0.04)); }
.luxury-table tr.row-shared-config td:first-child { box-shadow: inset 3px 0 0 var(--cfg-color, var(--gold)); }
.luxury-table tr.row-shared-config:hover td { filter: brightness(1.15); }
.luxury-table tr.row-shared-config:hover td:first-child { box-shadow: inset 4px 0 0 var(--gold); }

.config-dup-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--warn-soft);
  border: 1px solid rgba(240, 176, 79, 0.4);
  cursor: pointer;
  white-space: nowrap;
}
.dup-tag {
  display: inline-flex; align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.66rem;
  font-weight: 600;
}

/* =========================================================================
   7. FORMS
   ========================================================================= */
.settings-form { display: flex; flex-direction: column; }
.form-group { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; min-width: 0; }
.form-row { display: flex; gap: 14px; }
.form-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary);
}
.label-hint { font-weight: 400; color: var(--text-muted); font-size: 0.8rem; }

.form-section {
  border: 0;
  padding: 0;
  margin: 0 0 8px;
}
.form-section + .form-section { padding-top: 20px; border-top: 1px solid var(--line); }
.form-section legend {
  float: left;
  width: 100%;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.form-section legend + * { clear: both; }

.luxury-input, .luxury-textarea {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: var(--bg-sunken);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), background var(--dur);
}
.luxury-textarea, textarea.luxury-input {
  height: auto;
  min-height: 92px;
  padding: 11px 14px;
  line-height: 1.55;
  resize: vertical;
}
.luxury-input::placeholder, .luxury-textarea::placeholder { color: var(--text-faint); }
.luxury-input:hover, .luxury-textarea:hover { border-color: #3a4357; }
.luxury-input:focus, .luxury-textarea:focus {
  border-color: var(--gold);
  background: #0d1118;
  box-shadow: 0 0 0 4px rgba(216, 180, 122, 0.12);
}
.luxury-input.readonly { color: var(--text-secondary); background: var(--bg-raised); cursor: text; }
.luxury-input.font-mono, .luxury-textarea.font-mono { font-size: 0.84rem; }

input[type="number"].luxury-input::-webkit-inner-spin-button { opacity: 0.4; }
input[type="datetime-local"].luxury-input { color-scheme: dark; }
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(0.75) sepia(0.6) saturate(3) hue-rotate(350deg);
  opacity: 0.8;
}

.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.chip-btn {
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  transition: var(--transition-smooth);
}
.chip-btn:hover { color: var(--gold-bright); border-color: var(--gold-line); background: var(--gold-soft); }
.chip-btn:active { transform: scale(0.95); }

/* Toggle row */
.toggle-control-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color var(--dur), background var(--dur);
}
.toggle-control-label:hover { border-color: var(--line-strong); }
.toggle-control-label:has(input:checked) { border-color: rgba(216, 180, 122, 0.3); background: linear-gradient(90deg, rgba(216, 180, 122, 0.06), var(--bg-raised)); }
.toggle-text { display: flex; flex-direction: column; gap: 2px; }
.toggle-text strong { font-size: 0.88rem; font-weight: 500; color: var(--text-primary); }
.toggle-text span { font-size: 0.8rem; color: var(--text-muted); }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #2a3142;
  transition: background var(--dur) var(--ease-out), box-shadow var(--dur);
}
.slider::before {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #c9d0db;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 380ms var(--ease-spring), width 200ms var(--ease-out), background var(--dur);
}
.switch input:active + .slider::before { width: 22px; }
.switch input:checked + .slider { background: var(--gold); box-shadow: 0 0 16px -2px var(--gold-glow); }
.switch input:checked + .slider::before { transform: translateX(18px); background: #fff; }
.switch input:checked:active + .slider::before { transform: translateX(14px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--gold); outline-offset: 2px; }

/* =========================================================================
   8. BUTTONS
   ========================================================================= */
.luxury-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform var(--dur-fast) var(--ease-out),
    background var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out),
    color var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out);
}
.luxury-btn:active { transform: scale(0.97); }
.luxury-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.settings-form > .luxury-btn, .settings-form > .btn-group { margin-top: 6px; align-self: flex-start; }

.luxury-btn.primary {
  background: var(--gold-gradient);
  color: #241a0a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 6px 18px -6px rgba(216, 180, 122, 0.55);
}
.luxury-btn.primary::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 700ms var(--ease-out);
}
.luxury-btn.primary:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 10px 26px -6px rgba(216, 180, 122, 0.65); transform: translateY(-1px); }
.luxury-btn.primary:hover::after { transform: translateX(120%); }
.luxury-btn.primary:active { transform: translateY(0) scale(0.97); }

.luxury-btn.secondary {
  background: var(--bg-raised);
  border-color: var(--line-strong);
  color: var(--text-primary);
}
.luxury-btn.secondary:hover { background: var(--bg-hover); border-color: #3c4559; }

.luxury-btn.danger {
  background: var(--danger-soft);
  border-color: rgba(240, 107, 93, 0.28);
  color: #ff8b7f;
}
.luxury-btn.danger:hover { background: rgba(240, 107, 93, 0.2); border-color: rgba(240, 107, 93, 0.5); }
.luxury-btn.danger.solid { background: var(--danger); color: #fff; border-color: transparent; }
.luxury-btn.danger.solid:hover { background: #f5806f; }

.luxury-btn.small { height: 34px; padding: 0 13px; font-size: 0.82rem; }
.luxury-btn.micro { height: 28px; padding: 0 10px; font-size: 0.76rem; font-weight: 500; border-radius: 7px; }
.luxury-btn.lg { height: 48px; font-size: 0.95rem; }
.luxury-btn.block { width: 100%; }

.luxury-btn.wl { background: transparent; border-color: var(--line-strong); color: var(--text-secondary); }
.luxury-btn.wl:hover { border-color: var(--gold-line); color: var(--gold); }
.luxury-btn.wl.wl-on { background: var(--live-soft); border-color: rgba(60, 207, 142, 0.35); color: var(--live); }
.luxury-btn.wl.wl-on:hover { background: var(--danger-soft); border-color: rgba(240, 107, 93, 0.4); color: var(--danger); }

.btn-group { display: flex; flex-wrap: wrap; gap: 10px; }

.btn-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(36, 26, 10, 0.25);
  border-top-color: #241a0a;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* =========================================================================
   9. DEVICES TOOLBAR
   ========================================================================= */
.devices-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.search-wrap { position: relative; flex: 1 1 260px; max-width: 360px; }
.search-wrap svg {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--dur);
}
.search-wrap:focus-within svg { color: var(--gold); }
.luxury-search {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-sunken);
  color: var(--text-primary);
  font-size: 0.86rem;
  outline: none;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.luxury-search::placeholder { color: var(--text-faint); }
.luxury-search:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(216, 180, 122, 0.12); }

.filter-tabs {
  position: relative;
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  overflow-x: auto;
  max-width: 100%;
}
.filter-indicator {
  position: absolute;
  top: 3px; bottom: 3px; left: 0;
  width: 0;
  border-radius: 6px;
  background: var(--bg-hover);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 420ms var(--ease-spring), width 320ms var(--ease-out), background var(--dur);
  pointer-events: none;
}
.filter-indicator.dup { background: rgba(240, 176, 79, 0.16); }
.filter-btn {
  position: relative;
  z-index: 1;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--dur);
}
.filter-btn:hover { color: var(--text-primary); }
.filter-btn.active { color: #fff; }
.filter-btn.filter-duplicate { color: var(--warn); display: inline-flex; align-items: center; gap: 6px; }
.filter-btn.filter-duplicate.active { color: var(--gold-bright); }
.filter-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--warn-soft);
}

.clean-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  margin-left: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition-smooth);
}
.clean-btn:hover { color: var(--warn); border-color: rgba(240, 176, 79, 0.45); background: var(--warn-soft); }
.clean-btn:active { transform: scale(0.97); }

/* =========================================================================
   10. UPLOAD
   ========================================================================= */
.drop-zone {
  position: relative;
  padding: 40px 24px;
  text-align: center;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--line-strong);
  background: var(--bg-sunken);
  cursor: pointer;
  transition: border-color var(--dur), background var(--dur), transform var(--dur) var(--ease-out);
}
.drop-zone:hover { border-color: var(--gold-line); background: #0d1118; }
.drop-zone.dragover {
  border-color: var(--gold);
  border-style: solid;
  background: linear-gradient(180deg, rgba(216, 180, 122, 0.08), var(--bg-sunken));
  transform: scale(1.01);
}
.drop-zone.dragover .drop-icon { transform: translateY(-6px) scale(1.06); background: var(--gold-soft); color: var(--gold-bright); }
.file-hidden-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--gold);
  transition: transform 400ms var(--ease-spring), background var(--dur), color var(--dur);
}
.drop-zone:hover .drop-icon { transform: translateY(-3px); }
.drop-zone-content h4 { font-size: 1rem; font-weight: 600; color: #fff; margin-bottom: 4px; }
.drop-zone-content p { font-size: 0.86rem; color: var(--text-secondary); }
.drop-zone-content p strong { color: var(--gold); font-weight: 500; }
.upload-note { display: block; margin-top: 14px; font-size: 0.78rem; color: var(--text-muted); }

.upload-progress-container { margin-top: 22px; text-align: left; animation: fadeUp 300ms var(--ease-out) both; }
.progress-info-row { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 8px; }
.progress-bar-track { height: 6px; border-radius: 999px; background: var(--bg-hover); overflow: hidden; }
.progress-bar-fill {
  position: relative;
  height: 100%;
  border-radius: inherit;
  background: var(--gold-gradient);
  transition: width 260ms var(--ease-out);
  overflow: hidden;
}
.progress-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmer 1.2s linear infinite;
  background-size: 50% 100%;
  background-repeat: no-repeat;
}

.direct-download-card { margin-top: 20px; display: flex; flex-direction: column; gap: 7px; }
.copy-url-row { display: flex; gap: 8px; }
.copy-url-row .luxury-btn.copied { background: var(--live-soft); color: var(--live); border-color: rgba(60, 207, 142, 0.35); }

/* =========================================================================
   11. BROADCAST
   ========================================================================= */
.broadcast-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.broadcast-form .luxury-textarea { min-height: 96px; font-family: inherit; }
.broadcast-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.broadcast-hint { font-size: 0.8rem; color: var(--text-muted); }

.broadcast-list { display: flex; flex-direction: column; gap: 8px; }
.broadcast-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold);
  animation: fadeUp 360ms var(--ease-out) both;
}
.broadcast-item-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.broadcast-text { font-size: 0.88rem; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
.broadcast-time { font-size: 0.76rem; color: var(--text-muted); }
.broadcast-empty {
  padding: 18px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
}

/* =========================================================================
   12. MODALS
   ========================================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 8, 12, 0.66);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: overlayIn 260ms var(--ease-out) both;
}
.modal-card {
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--bg-surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  animation: modalIn 420ms var(--ease-spring) both;
}
.modal-overlay.closing { animation: overlayOut 200ms var(--ease-in) both; }
.modal-overlay.closing .modal-card { animation: modalOut 200ms var(--ease-in) both; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 0;
}
.modal-header h3 { font-size: 1.08rem; font-weight: 600; letter-spacing: -0.01em; color: #fff; }
.modal-close {
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  transition: background var(--dur), color var(--dur), transform var(--dur) var(--ease-spring);
}
.modal-close:hover { background: var(--bg-hover); color: #fff; transform: rotate(90deg); }
.modal-body { padding: 18px 22px 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.confirm-card { max-width: 420px; }
.confirm-message { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.65; white-space: pre-line; }

.modal-card.wide { max-width: 760px; }
.winners-meta { font-size: 0.84rem; color: var(--text-secondary); margin-bottom: 14px; }
.winner-rank {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg-raised);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-secondary);
}
.winner-rank.first { background: var(--gold-gradient); color: #241a0a; font-weight: 700; }
.winner-sub { font-size: 0.76rem; color: var(--text-muted); }

/* =========================================================================
   13. TOASTS
   ========================================================================= */
.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.luxury-toast {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: rgba(27, 33, 44, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-pop);
  font-size: 0.88rem;
  color: var(--text-primary);
  overflow: hidden;
  animation: toastIn 480ms var(--ease-spring) both;
}
.luxury-toast svg { flex-shrink: 0; }
.luxury-toast::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--toast-c, var(--gold));
  transform-origin: left;
  animation: toastTimer 4s linear both;
  opacity: 0.7;
}
.luxury-toast.success { --toast-c: var(--live); }
.luxury-toast.error { --toast-c: var(--danger); }
.luxury-toast.gold { --toast-c: var(--gold); }
.luxury-toast.leaving { animation: toastOut 280ms var(--ease-in) both; }

/* =========================================================================
   14. KEYFRAMES
   ========================================================================= */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.995); } to { opacity: 1; transform: none; } }
@keyframes cardRise { from { opacity: 0; transform: translateY(24px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes emblemIn { from { opacity: 0; transform: scale(0.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes titleSwap { from { opacity: 0; transform: translateY(6px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes expandIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlayOut { to { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes modalOut { to { opacity: 0; transform: translateY(8px) scale(0.97); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(32px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px) scale(0.96); } }
@keyframes toastTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 0% { transform: scale(1); opacity: 0.6; } 80%, 100% { transform: scale(2.8); opacity: 0; } }
@keyframes dotPulse { 0% { box-shadow: 0 0 0 0 rgba(60, 207, 142, 0.5); } 70%, 100% { box-shadow: 0 0 0 6px rgba(60, 207, 142, 0); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes tick { 0% { filter: brightness(1.6); transform: translateY(-2px); } 100% { filter: none; transform: none; } }
@keyframes shimmer { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@keyframes orbDrift { from { transform: translate(0, 0) scale(1); } to { transform: translate(60px, 40px) scale(1.1); } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }

/* =========================================================================
   15. RESPONSIVE
   ========================================================================= */
@media (max-width: 1280px) {
  .giveaway-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1180px) {
  .overview-dual-grid, .overview-dual-grid.reverse, .releases-dual-grid { grid-template-columns: 1fr; }
  .live-hero { grid-template-columns: 1fr; grid-template-areas: "primary" "chart" "stats"; }
  .hero-primary { padding-bottom: 0; }
  .hero-chart { padding: 8px 24px 16px; min-height: 0; }
  .spark { height: 120px; }
}

@media (max-width: 1024px) {
  .dash-sidebar {
    transform: translateX(-100%);
    transition: transform 380ms var(--ease-out);
    box-shadow: var(--shadow-pop);
  }
  .dashboard-shell.nav-open .dash-sidebar { transform: none; }
  .dashboard-shell.nav-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .dashboard-shell.entering .dash-sidebar { animation: none; }
  .dash-main { margin-left: 0; padding: 0 20px 40px; }
  .topbar { margin: 0 -20px 20px; padding: 14px 20px; }
  .menu-toggle { display: grid; }
}

@media (max-width: 720px) {
  .admin-meta, .sync-chip #sync-text { display: none; }
  .admin-pill { padding: 0 4px; }
  .sync-chip { padding: 0 11px; }
  .topbar-sub { display: none; }
  .topbar-title-wrap h1 { font-size: 1.2rem; }
  .hero-stats { grid-template-columns: 1fr; }
  .hero-stat + .hero-stat { border-left: 0; border-top: 1px solid var(--line); }
  .hero-stat { flex-direction: row; align-items: baseline; flex-wrap: wrap; column-gap: 10px; padding: 14px 20px; }
  .hs-label { flex: 1; }
  .hs-note, .hero-stat .metric-trend { flex-basis: 100%; }
  .hero-primary { padding: 22px 20px 0; }
  .hero-chart { padding: 8px 20px 14px; }
  .lg-note { display: none; }
  .form-row { flex-direction: column; gap: 0; }
  .card-panel { padding: 18px 16px; }
  .table-responsive { margin: 10px 0 0; padding: 0; width: 100%; }
  .panel-header.flex-between { flex-direction: column; align-items: stretch; }
  .panel-header.flex-between > .luxury-btn, .panel-header.flex-between > .ghost-link { align-self: flex-start; }
  .search-wrap { max-width: none; flex-basis: 100%; }
  .clean-btn { margin-left: 0; }
  .broadcast-form-actions { flex-direction: column-reverse; align-items: stretch; }
  .toast-stack { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
  .luxury-toast { min-width: 0; max-width: none; }
  .settings-form > .luxury-btn { align-self: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
  .auth-orb { animation: none !important; }
}

/* =========================================================================
   PLATFORM SEPARATION & SWITCHING (PC Windows vs Mobile Android)
   ========================================================================= */

.nav-item.nav-item-sub {
  height: 34px;
  padding: 0 10px 0 22px;
  font-size: 0.82rem;
  opacity: 0.82;
  gap: 10px;
}
.nav-item.nav-item-sub .nav-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-item.nav-item-sub .badge-pill {
  padding: 0 7px;
  height: 20px;
  font-size: 0.72rem;
}
.nav-item.nav-item-sub:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.035);
}
.nav-item.nav-item-sub.active {
  opacity: 1;
  color: var(--gold-bright);
}

.platform-segment-tabs {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  max-width: 100%;
  overflow-x: auto;
}

.platform-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.platform-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.platform-btn.active {
  color: #fff;
  background: var(--bg-raised);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 2px 6px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-strong);
}

.platform-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}
.platform-btn.active .platform-count {
  background: var(--gold-soft);
  color: var(--gold-bright);
}

/* Releases platform switcher */
.releases-platform-selector {
  margin-bottom: 20px;
}
.platform-segment-tabs.lg {
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--line);
}
.platform-segment-tabs.lg .platform-btn {
  height: 40px;
  padding: 0 20px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.platform-segment-tabs.lg .platform-btn.active {
  background: linear-gradient(135deg, rgba(216, 180, 122, 0.15) 0%, rgba(27, 33, 44, 0.9) 100%);
  border-color: var(--gold-line);
  color: var(--gold-bright);
}

/* Table Platform Tags */
.platform-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  white-space: nowrap;
}
.platform-tag.windows {
  background: rgba(110, 168, 254, 0.12);
  color: #8bb9fe;
  border: 1px solid rgba(110, 168, 254, 0.28);
}
.platform-tag.android {
  background: rgba(60, 207, 142, 0.12);
  color: #4eedaa;
  border: 1px solid rgba(60, 207, 142, 0.28);
}

/* Compact, zero-horizontal-scroll Devices Table & Pagination */
.devices-table-scroll {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  overflow-x: auto;
}
.devices-table-compact th,
.devices-table-compact td {
  padding: 9px 10px;
}
.devices-table-compact th:first-child,
.devices-table-compact td:first-child { padding-left: 14px; }
.devices-table-compact th:last-child,
.devices-table-compact td:last-child { padding-right: 14px; }
.devices-table-compact .cell-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.devices-table-compact .cell-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 175px;
}
.devices-table-compact .cell-ellipsis {
  display: inline-block;
  max-width: 165px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.devices-table-compact .config-cell-ellipsis {
  display: inline-block;
  max-width: 195px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.devices-table-compact .config-shared-badge {
  max-width: 215px;
}
.devices-table-compact .config-shared-badge .cfg-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.devices-table-compact .wl-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.devices-table-compact .wl-badge {
  margin-left: 0;
}
.devices-table-compact .platform-tag {
  width: fit-content;
  font-size: 0.7rem;
  padding: 1px 6px;
}
.devices-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-surface);
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pagination-size-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  margin-right: 6px;
}
.pagination-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.78rem;
  cursor: pointer;
}
.pagination-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pagination-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--gold);
}
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pagination-page-num {
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  color: var(--gold);
  min-width: 48px;
  text-align: center;
}
