@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  color-scheme: dark;
  --bg: #090a0f;
  --bg-elev: #0f111a;
  --surface: #121521;
  --surface-2: #181c2b;
  --surface-3: #1f2437;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --line-highlight: rgba(255, 255, 255, 0.18);
  --text: #f3f5f8;
  --muted: #949eb1;
  --faint: #5e677a;
  --primary: #6366f1;
  --primary-2: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  --telegram: #2aabee;
  --cta: #6366f1;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 56px -8px rgba(0, 0, 0, 0.68), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  --inset: #0b0d14;
  --soft: rgba(255, 255, 255, 0.025);
  --hover: rgba(255, 255, 255, 0.05);
  --sidebar-bg: rgba(11, 13, 20, 0.88);
  --topbar-bg: rgba(9, 10, 15, 0.78);
  --login-bg: linear-gradient(165deg, rgba(22, 26, 42, 0.92) 0%, rgba(13, 15, 24, 0.96) 100%);
  --nav-active-bg: rgba(99, 102, 241, 0.14);
  --nav-active-text: #e0e7ff;
  --err-text: #fca5a5;
  --overlay-bg: rgba(4, 6, 12, 0.72);
  --grid-line: rgba(255, 255, 255, 0.018);
  --glow-1: rgba(99, 102, 241, 0.13);
  --glow-2: rgba(16, 185, 129, 0.07);
  --ok-text: #34d399;
  --run-text: #818cf8;
  --wait-text: #fbbf24;
  --fail-text: #f87171;
  --tg-text: #38bdf8;
  --apk-text: #c084fc;
  --web-text: #2dd4bf;
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 244px;
  --topbar: 60px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, ui-monospace, monospace;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fb;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --line: rgba(15, 23, 42, 0.075);
  --line-strong: rgba(15, 23, 42, 0.14);
  --line-highlight: rgba(15, 23, 42, 0.22);
  --text: #0f172a;
  --muted: #526077;
  --faint: #94a3b8;
  --primary: #4f46e5;
  --primary-2: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.16);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 44px -10px rgba(15, 23, 42, 0.16), 0 0 1px 1px rgba(15, 23, 42, 0.06);
  --inset: #f8fafc;
  --soft: rgba(15, 23, 42, 0.024);
  --hover: rgba(15, 23, 42, 0.045);
  --sidebar-bg: rgba(255, 255, 255, 0.9);
  --topbar-bg: rgba(246, 248, 251, 0.82);
  --login-bg: #ffffff;
  --nav-active-bg: rgba(79, 70, 229, 0.09);
  --nav-active-text: #4338ca;
  --err-text: #dc2626;
  --overlay-bg: rgba(15, 23, 42, 0.42);
  --grid-line: rgba(15, 23, 42, 0.025);
  --glow-1: rgba(79, 70, 229, 0.07);
  --glow-2: rgba(16, 185, 129, 0.05);
  --ok-text: #059669;
  --run-text: #4f46e5;
  --wait-text: #d97706;
  --fail-text: #dc2626;
  --tg-text: #0284c7;
  --apk-text: #7c3aed;
  --web-text: #0d9488;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 80; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(800px 400px at 15% -8%, var(--glow-1), transparent 60%),
    radial-gradient(650px 340px at 90% -5%, var(--glow-2), transparent 55%);
  z-index: 0;
}

#app { position: relative; z-index: 1; min-height: 100dvh; }

/* ==================== LOGIN ==================== */
.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
}
.login-card {
  width: min(416px, 100%);
  background: var(--login-bg);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 36px 32px 32px;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 15%; right: 15%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.55), transparent);
}
.login-theme { position: fixed; top: 20px; right: 20px; z-index: 10; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; flex: none;
  overflow: hidden;
  background: #0b1220;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-card .brand-mark { width: 72px; height: 72px; border-radius: 18px; }
.login-card h1 { margin: 18px 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -0.025em; }
.login-card p.lead { margin: 0 0 24px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }

/* ==================== FORMS & INPUTS ==================== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 500; letter-spacing: 0.01em; }
.field input, .field select, .field textarea, .input, .select, .textarea {
  width: 100%;
  background: var(--inset);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  min-height: 38px;
  font-size: 13.5px;
  color: var(--text);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:disabled, .field select:disabled { opacity: 0.6; cursor: not-allowed; }
.field textarea, .textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, .select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}
.captcha-row { display: grid; grid-template-columns: 1fr 116px; gap: 10px; align-items: end; margin-bottom: 12px; }
.captcha-img {
  height: 38px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line-strong);
  background: #fff; cursor: pointer; padding: 0;
  transition: border-color 150ms;
}
.captcha-img:hover { border-color: var(--primary); }
.captcha-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.err { color: var(--err-text); font-size: 12.5px; min-height: 18px; margin: 4px 0 8px; }

.pkg-row input {
  width: 100%;
  background: var(--inset);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  min-height: 36px;
  font-size: 13px;
  color: inherit;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.pkg-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  min-height: 38px; padding: 0 15px; font-size: 13.5px; font-weight: 500;
  white-space: nowrap;
  transition: transform 120ms var(--ease), background 150ms var(--ease), border-color 150ms var(--ease), box-shadow 150ms var(--ease), opacity 150ms;
}
.btn:active:not(:disabled) { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  width: 100%;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); color: #ffffff; }

.btn-cta {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-weight: 600;
}
.btn-cta:hover:not(:disabled) { filter: brightness(1.08); color: #ffffff; }

.btn-ghost {
  background: var(--soft);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--hover);
  border-color: var(--line-highlight);
  color: var(--text);
}

.btn-tg {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-tg:hover:not(:disabled) { filter: brightness(1.07); color: #ffffff; }

.btn-danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.28);
  color: var(--fail-text);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.45);
}

.btn-sm { min-height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.btn-icon { width: 34px; min-height: 34px; padding: 0; border-radius: 8px; }
.btn-icon svg { width: 17px; height: 17px; }

/* ==================== APP SHELL & SIDEBAR ==================== */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 3px;
  backdrop-filter: blur(20px);
}
.logo-row {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 8px 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.logo-row strong { display: block; font-size: 14.5px; font-weight: 700; letter-spacing: -0.02em; }
.logo-row small { color: var(--muted); font-size: 11.5px; display: block; margin-top: 1px; }

.nav-group {
  margin: 14px 0 4px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  user-select: none;
}
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left; background: transparent; border: 1px solid transparent;
  color: var(--muted); border-radius: var(--radius-sm); padding: 8px 10px; min-height: 38px;
  font-size: 13.5px; font-weight: 500;
  transition: background 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease);
}
.nav-btn svg { width: 17px; height: 17px; flex: none; opacity: 0.8; transition: opacity 140ms; }
.nav-btn:hover { background: var(--hover); color: var(--text); }
.nav-btn:hover svg { opacity: 1; }
.nav-btn.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
  border-color: rgba(99, 102, 241, 0.22);
  font-weight: 600;
}
.nav-btn.active svg { opacity: 1; color: var(--primary); }

.sidebar .spacer { flex: 1; }
.user-box {
  padding: 12px 10px 4px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.user-box-info {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--surface-3); border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--text); flex: none;
}
.user-meta { min-width: 0; }
.user-meta strong {
  display: block; color: var(--text); font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-meta small { display: block; color: var(--faint); font-size: 11px; font-family: var(--mono); }

/* ==================== TOPBAR & MAIN ==================== */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar);
  display: flex; align-items: center; gap: 10px;
  padding: 0 24px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.topbar h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.topbar .grow { flex: 1; }
.search {
  width: min(280px, 38vw);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  min-height: 34px;
  font-size: 13px;
  transition: border-color 150ms, box-shadow 150ms;
}
.search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}
.content { padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ==================== SEGMENTED TABBAR ==================== */
.tabbar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}
.tab-btn {
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 150ms var(--ease);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.on {
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ==================== BENTO STATS CARDS ==================== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 180ms var(--ease), transform 180ms var(--ease);
}
.stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-highlight), transparent);
}
.stat:hover { border-color: var(--line-strong); }
.stat span {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 6px;
}
.stat b {
  display: block;
  font-size: 26px;
  font-weight: 700;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}
.stat .faint { margin-top: 6px; font-size: 12px; font-variant-numeric: tabular-nums; }

/* ==================== MEMBER LINKS WORKBENCH ==================== */
.my-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.link-box {
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.link-box-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.link-box-sub {
  font-size: 11.5px;
  color: var(--muted);
}
.copy-group {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: auto;
}
.copy-group input, .copy-group select {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 6px 10px;
  min-height: 32px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text);
}
.copy-group select { font-family: var(--font); font-size: 12.5px; }
.copy-group input:focus, .copy-group select:focus {
  border-color: var(--primary);
  outline: none;
}

/* ==================== PANELS & TABLES ==================== */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.panel-hd {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.01);
}
.panel-hd strong { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.section-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  margin-bottom: 12px;
}
.section-bar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-bar-title { font-size: 14px; font-weight: 600; color: var(--text); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--soft);
  white-space: nowrap;
}
tbody tr { transition: background 120ms; }
tbody tr:hover td { background: var(--soft); }

.app-ico {
  width: 38px; height: 38px; border-radius: 10px;
  object-fit: cover; background: var(--inset);
  border: 1px solid var(--line-strong);
  flex: none;
}
.app-name-cell { font-weight: 600; color: var(--text); line-height: 1.35; }
.mono { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 12px; }
.row-actions { display: flex; flex-wrap: nowrap; gap: 6px; justify-content: flex-end; align-items: center; white-space: nowrap; }

/* ==================== BADGES ==================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 600;
  border: 1px solid transparent;
  line-height: 1.4;
  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.b-ok { color: var(--ok-text); background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.22); }
.b-run { color: var(--run-text); background: rgba(99, 102, 241, 0.14); border-color: rgba(99, 102, 241, 0.24); }
.b-wait { color: var(--wait-text); background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.22); }
.b-fail { color: var(--fail-text); background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.22); }
.b-off { color: var(--muted); background: rgba(148, 163, 184, 0.1); border-color: rgba(148, 163, 184, 0.16); }
.b-tg { color: var(--tg-text); background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.22); }
.b-apk { color: var(--apk-text); background: rgba(192, 132, 252, 0.12); border-color: rgba(192, 132, 252, 0.22); }
.b-web { color: var(--web-text); background: rgba(45, 212, 191, 0.12); border-color: rgba(45, 212, 191, 0.22); }

.empty {
  padding: 52px 20px; text-align: center; color: var(--muted);
}
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 15px; font-weight: 600; }
.empty p { margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.pager {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.01);
}

/* ==================== MODALS & OVERLAY ==================== */
.overlay {
  position: fixed; inset: 0; background: var(--overlay-bg); z-index: 40;
  display: grid; place-items: center; padding: 20px;
  backdrop-filter: blur(6px);
}
.modal {
  width: min(680px, 100%); max-height: min(88dvh, 860px); overflow: auto;
  background: var(--bg-elev); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-hd h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-bd { padding: 20px; }
.modal-ft {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--line);
  background: var(--soft);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.choice {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px;
}
.choice button {
  text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; min-height: 84px;
}
.choice button.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.choice strong { display: block; margin-bottom: 4px; }
.choice span { color: var(--muted); font-size: 12.5px; }

.drop {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 28px 20px;
  text-align: center; color: var(--muted); background: var(--inset);
  transition: border-color 160ms, background 160ms;
}
.drop:hover, .drop.over { border-color: var(--primary); background: rgba(99, 102, 241, 0.06); }
.drop input { display: none; }

.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 11px 16px; min-width: 220px;
  box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}
.toast::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none;
}
.toast.ok { border-color: rgba(16, 185, 129, 0.4); }
.toast.err { border-color: rgba(239, 68, 68, 0.45); }
.toast.err::before { background: var(--danger); }

.cards { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 16px; align-items: start; }
.help-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.help-list li { margin: 8px 0; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; cursor: pointer; margin-bottom: 10px; }
.switch input { width: 16px; height: 16px; accent-color: var(--primary); }
.job { padding: 11px 0; border-bottom: 1px solid var(--line); }
.job:last-child { border-bottom: 0; }
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: 36px; z-index: 12;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: 10px; min-width: 168px; padding: 5px; box-shadow: var(--shadow-lg);
}
.menu-pop button {
  display: block; width: 100%; text-align: left; background: transparent; border: 0;
  padding: 7px 10px; border-radius: 6px; color: var(--text); font-size: 12.5px;
}
.menu-pop button:hover { background: var(--hover); }

.hamb { display: none; }
.topbar .btn-cta { flex-shrink: 0; }

/* ==================== PROMO STATS CHARTS & FILTERS ==================== */
.nw { white-space: nowrap; }
[v-cloak] { display: none; }

.ps-row { cursor: pointer; }
.ps-caret { display: inline-block; color: var(--faint); font-size: 11px; transition: transform 160ms var(--ease); }
.ps-caret.open { transform: rotate(90deg); color: var(--primary); }
.ps-sub-row > td, .ps-sub-row:hover > td { background: var(--inset); padding: 10px 16px 14px 36px; }
.ps-sub-table { font-size: 12.5px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ps-sub-table th, .ps-sub-table td { padding: 8px 12px; }
.ps-sub-table thead th { background: var(--soft); }

.ps-chart { max-height: 430px; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.ps-day { display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: center; }
.ps-day-label { color: var(--muted); font-size: 11.5px; text-align: right; }
.ps-bars { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ps-bar-row { display: grid; grid-template-columns: 36px 1fr 38px; gap: 8px; align-items: center; }
.ps-bar-tag { color: var(--faint); font-size: 11px; white-space: nowrap; }
.ps-bar-track { height: 8px; border-radius: 999px; background: rgba(148, 163, 184, 0.1); overflow: hidden; }
.ps-bar { height: 100%; border-radius: 999px; transition: width 240ms var(--ease); }
.ps-bar-dl { background: linear-gradient(90deg, #475569, #94a3b8); }
.ps-bar-a { background: linear-gradient(90deg, #4f46e5, #818cf8); }
.ps-bar-b { background: linear-gradient(90deg, #059669, #34d399); }
.ps-bar-acc { background: linear-gradient(90deg, #d97706, #f59e0b); }
.ps-bar-val { color: var(--muted); font-size: 11.5px; text-align: right; }

.ps-filter {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  background: var(--soft);
}
.ps-filter select, .ps-filter input {
  background: var(--inset); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  min-height: 34px; padding: 5px 10px; color: inherit; font-size: 13px;
}
.ps-filter select:focus, .ps-filter input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); outline: none;
}
.ps-filter select { min-width: 130px; }
.ps-filter input { min-width: 150px; }
.ps-filter .btn { width: auto; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .my-links-grid, .cards, .grid-2, .grid-3, .choice { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(82vw, 260px); z-index: 30;
    transform: translateX(-105%); transition: transform 220ms var(--ease);
  }
  .sidebar.open { transform: none; }
  .hamb { display: inline-flex; }
  .content { padding: 16px; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 25; backdrop-filter: blur(3px); }
  .topbar { padding: 0 16px; }
  .topbar .grow { display: none; }
  .topbar .btn-cta { margin-left: auto; }
  .search { display: none; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat b { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
