/* Sendora Admin Panel — Styles */
:root {
  --bg: #080c14;
  --bg2: #0d1220;
  --bg3: #111827;
  --bg4: #1a2235;
  --border: rgba(99,130,255,0.12);
  --border2: rgba(99,130,255,0.22);
  --accent: #6382ff;
  --accent2: #4ade80;
  --accent3: #f472b6;
  --accent4: #fb923c;
  --text: #e8edf8;
  --text2: #8896b3;
  --text3: #5a6882;
  --danger: #f87171;
  --warn: #fbbf24;
  --success: #4ade80;
  --glow: 0 0 40px rgba(99,130,255,0.15);
  --glow2: 0 0 20px rgba(99,130,255,0.25);
  --radius: 12px;
  --sidebar: 260px;
  --font: 'DM Sans', sans-serif;
  --font-display: 'Syne', sans-serif;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%; background: var(--bg);
  color: var(--text); font-family: var(--font);
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

#app { display: flex; height: 100vh; overflow: hidden; }

/* ── Login ── */
#login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; width: 100%;
  background: radial-gradient(ellipse at 60% 40%, rgba(99,130,255,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 80%, rgba(74,222,128,0.05) 0%, transparent 50%),
              var(--bg);
}

.login-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 20px; padding: 48px 44px; width: 400px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.5), var(--glow);
  animation: fadeUp 0.5s ease;
}

.login-logo {
  font-family: var(--font-display); font-size: 28px; font-weight: 800;
  letter-spacing: -0.5px; margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.login-sub { color: var(--text2); font-size: 13px; margin-bottom: 36px; }

.field { margin-bottom: 18px; }
.field label { display: block; color: var(--text2); font-size: 12px; font-weight: 500;
               letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 8px; }
.field input {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px; color: var(--text);
  font-family: var(--font); font-size: 14px; outline: none;
  transition: border var(--transition), box-shadow var(--transition);
}
.field input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,130,255,0.15);
}

.btn-primary {
  width: 100%; background: var(--accent); color: white; border: none;
  border-radius: 10px; padding: 13px; font-family: var(--font-display);
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all var(--transition); margin-top: 8px;
  position: relative; overflow: hidden;
}
.btn-primary:hover {
  background: #7b9bff; box-shadow: 0 8px 24px rgba(99,130,255,0.4);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.1), transparent);
}

.login-err { color: var(--danger); font-size: 13px; margin-top: 12px; text-align: center;
             padding: 10px; background: rgba(248,113,113,0.1); border-radius: 8px; }

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar); min-height: 100vh; background: var(--bg2);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  flex-shrink: 0; position: relative; z-index: 10;
  animation: slideRight 0.4s ease;
}

.sidebar-logo {
  padding: 24px 24px 20px;
  font-family: var(--font-display); font-size: 20px; font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo span { font-weight: 300; opacity: 0.6; -webkit-text-fill-color: var(--text2); }

nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.nav-section { font-size: 10px; font-weight: 600; letter-spacing: 0.1em;
               text-transform: uppercase; color: var(--text3); padding: 12px 12px 6px; }

.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 9px; color: var(--text2); cursor: pointer; font-size: 13.5px;
  font-weight: 500; transition: all var(--transition); margin-bottom: 2px;
  position: relative; user-select: none;
}
.nav-item:hover { background: rgba(99,130,255,0.08); color: var(--text); }
.nav-item.active {
  background: rgba(99,130,255,0.15); color: var(--accent);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-item .icon { font-size: 16px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--accent); color: white;
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px;
  min-width: 18px; text-align: center;
}

.sidebar-footer {
  padding: 16px; border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 8px;
  border-radius: 9px; background: var(--bg3); cursor: pointer;
}
.sidebar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white; flex-shrink: 0;
}
.sidebar-name { font-size: 13px; font-weight: 500; }
.sidebar-role { font-size: 11px; color: var(--text3); }

/* ── Main content ── */
#main {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; animation: fadeIn 0.4s ease 0.1s both;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 60px; background: var(--bg2);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}

.page-title {
  font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.2px;
}

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

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 9px; font-family: var(--font);
  font-size: 13px; font-weight: 500; cursor: pointer; border: none;
  transition: all var(--transition); white-space: nowrap;
}
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: #7b9bff; box-shadow: 0 4px 16px rgba(99,130,255,0.35); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg3); color: var(--text); border-color: var(--border2); }
.btn-danger { background: rgba(248,113,113,0.15); color: var(--danger); border: 1px solid rgba(248,113,113,0.2); }
.btn-danger:hover { background: rgba(248,113,113,0.25); }
.btn-success { background: rgba(74,222,128,0.15); color: var(--success); border: 1px solid rgba(74,222,128,0.2); }
.btn-success:hover { background: rgba(74,222,128,0.25); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: 8px; }

#content {
  flex: 1; overflow-y: auto; padding: 28px;
  background: radial-gradient(ellipse at 70% 0%, rgba(99,130,255,0.04) 0%, transparent 50%),
              var(--bg);
}

/* ── Stats ── */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px;
}

.stat-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; position: relative; overflow: hidden;
  transition: all var(--transition); cursor: default;
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: var(--glow); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent-color, var(--accent));
}
.stat-card.green::before { background: var(--accent2); }
.stat-card.pink::before { background: var(--accent3); }
.stat-card.orange::before { background: var(--accent4); }

.stat-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
              text-transform: uppercase; color: var(--text3); margin-bottom: 10px; }
.stat-value { font-family: var(--font-display); font-size: 32px; font-weight: 800;
              letter-spacing: -1px; color: var(--text); }
.stat-delta { font-size: 12px; color: var(--text3); margin-top: 4px; }
.stat-delta.up { color: var(--accent2); }
.stat-icon { position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
             font-size: 36px; opacity: 0.07; }

/* ── Tables ── */
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; }

.filters {
  display: flex; gap: 10px; padding: 14px 20px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap; align-items: center;
}

.filter-input {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 12px; color: var(--text);
  font-family: var(--font); font-size: 13px; outline: none;
  transition: border var(--transition);
}
.filter-input:focus { border-color: var(--accent); }
.filter-input::placeholder { color: var(--text3); }
select.filter-input { cursor: pointer; }
option { background: var(--bg3); }

.search-wrap { position: relative; }
.search-wrap input { padding-left: 34px; min-width: 200px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
               color: var(--text3); font-size: 14px; pointer-events: none; }

table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text3);
  background: var(--bg3); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1;
}
thead th:first-child { padding-left: 20px; }

tbody tr {
  border-bottom: 1px solid var(--border); transition: background var(--transition);
  cursor: pointer;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(99,130,255,0.04); }
tbody tr.selected { background: rgba(99,130,255,0.09); }
td {
  padding: 12px 16px; font-size: 13px; color: var(--text2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px;
}
td:first-child { padding-left: 20px; color: var(--text); }

.checkbox { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600;
}
.badge-blue { background: rgba(99,130,255,0.15); color: var(--accent); }
.badge-green { background: rgba(74,222,128,0.15); color: var(--accent2); }
.badge-red { background: rgba(248,113,113,0.15); color: var(--danger); }
.badge-orange { background: rgba(251,146,60,0.15); color: var(--accent4); }
.badge-gray { background: rgba(88,101,129,0.2); color: var(--text3); }
.badge-pink { background: rgba(244,114,182,0.15); color: var(--accent3); }

/* ── Pagination ── */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text3);
}
.page-btns { display: flex; gap: 4px; }
.page-btn {
  padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--text2); cursor: pointer; font-size: 12px;
  transition: all var(--transition);
}
.page-btn:hover { background: var(--bg3); color: var(--text); }
.page-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.3; cursor: default; }

/* ── Progress ── */
.progress-wrap { background: var(--bg3); border-radius: 99px; height: 6px; overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.5s ease; position: relative; overflow: hidden;
}
.progress-bar::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(200%); } }

/* ── Broadcast card ── */
.bc-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 12px;
  transition: all var(--transition);
}
.bc-card:hover { border-color: var(--border2); }
.bc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bc-id { font-family: var(--font-display); font-size: 13px; font-weight: 700;
         color: var(--text3); font-variant-numeric: tabular-nums; }
.bc-stats-row { display: flex; gap: 20px; margin: 12px 0; }
.bc-stat { text-align: center; }
.bc-stat-v { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text); }
.bc-stat-l { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; }
.bc-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Charts ── */
.chart-wrap { padding: 20px; }
.mini-chart { display: flex; align-items: flex-end; gap: 4px; height: 60px; }
.mini-bar {
  flex: 1; border-radius: 4px 4px 0 0;
  background: linear-gradient(to top, var(--accent), rgba(99,130,255,0.3));
  transition: all 0.3s ease; cursor: pointer; position: relative;
}
.mini-bar:hover { opacity: 0.8; }
.mini-bar .tooltip {
  position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%);
  background: var(--bg4); border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 8px; font-size: 11px; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 0.15s;
}
.mini-bar:hover .tooltip { opacity: 1; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(8,12,20,0.85);
  backdrop-filter: blur(4px); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 16px; padding: 28px; width: 560px; max-width: 95vw;
  max-height: 85vh; overflow-y: auto;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text3); font-size: 20px;
               cursor: pointer; padding: 4px; border-radius: 6px; transition: color var(--transition); }
.modal-close:hover { color: var(--text); }

.form-field { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text2);
              letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 8px; }
.form-input {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 9px; padding: 10px 14px; color: var(--text);
  font-family: var(--font); font-size: 14px; outline: none;
  transition: border var(--transition), box-shadow var(--transition);
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,130,255,0.12); }
textarea.form-input { resize: vertical; min-height: 90px; }
select.form-input { cursor: pointer; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 14px; color: var(--text); }
.toggle-desc { font-size: 12px; color: var(--text3); margin-top: 2px; }
.toggle {
  position: relative; width: 40px; height: 22px;
  background: var(--bg4); border-radius: 99px; cursor: pointer;
  transition: background var(--transition); flex-shrink: 0;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: white; transition: transform var(--transition);
}
.toggle.on::after { transform: translateX(18px); }

.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }

/* ── Misc ── */
.invite-link {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 9px;
  padding: 12px 16px; font-size: 13px; font-family: monospace;
  color: var(--accent2); word-break: break-all; margin-top: 12px;
}

.empty { text-align: center; padding: 60px 20px; color: var(--text3); }
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-text { font-size: 15px; font-weight: 500; color: var(--text2); margin-bottom: 6px; }

.loading { display: flex; align-items: center; justify-content: center;
           padding: 60px; color: var(--text3); gap: 12px; }
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border2);
  border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg2); border: 1px solid var(--border2); border-radius: 10px;
  padding: 12px 18px; font-size: 13px; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4); min-width: 260px;
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.toast.success { border-color: rgba(74,222,128,0.3); }
.toast.error { border-color: rgba(248,113,113,0.3); }
.toast-icon { font-size: 16px; }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideRight { from { transform: translateX(-100%); } to { transform: translateX(0); } }

.page { animation: fadeUp 0.3s ease; }

.table-wrap { overflow-x: auto; }

.utm-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.utm-chip {
  padding: 4px 12px; border-radius: 99px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg3); color: var(--text2);
  cursor: pointer; transition: all var(--transition);
}
.utm-chip:hover, .utm-chip.active {
  background: rgba(99,130,255,0.15); border-color: var(--accent); color: var(--accent);
}

.selection-bar {
  display: none; align-items: center; justify-content: space-between;
  padding: 10px 20px; background: rgba(99,130,255,0.12);
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.selection-bar.visible { display: flex; animation: fadeIn 0.15s ease; }

.help-section { margin-bottom: 28px; }
.help-title { font-family: var(--font-display); font-size: 16px; font-weight: 700;
              margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.help-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.help-step {
  display: flex; gap: 16px; padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.help-step:last-child { border-bottom: none; }
.help-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(99,130,255,0.15); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}
.help-step-title { font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.help-step-text { color: var(--text2); font-size: 13px; line-height: 1.6; }
.help-code {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 8px; font-family: monospace; font-size: 12px; color: var(--accent2);
}

.contact-card {
  background: linear-gradient(135deg, rgba(99,130,255,0.08), rgba(74,222,128,0.05));
  border: 1px solid var(--border2); border-radius: var(--radius); padding: 28px;
  text-align: center;
}
.contact-title { font-family: var(--font-display); font-size: 20px; font-weight: 800;
                margin-bottom: 8px; }
.contact-sub { color: var(--text2); font-size: 14px; margin-bottom: 24px; }

.file-drop {
  border: 2px dashed var(--border); border-radius: 10px; padding: 24px;
  text-align: center; color: var(--text3); cursor: pointer;
  transition: all var(--transition); margin-bottom: 14px;
}
.file-drop:hover, .file-drop.over {
  border-color: var(--accent); color: var(--accent); background: rgba(99,130,255,0.05);
}
.attached-files { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.attached-file {
  display: flex; align-items: center; gap: 6px; background: var(--bg3);
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; font-size: 12px;
}
.attached-file button {
  background: none; border: none; color: var(--text3); cursor: pointer; font-size: 14px; line-height: 1;
}
.attached-file button:hover { color: var(--danger); }

.channel-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.channel-info { display: flex; align-items: center; gap: 12px; }
.channel-avatar {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.channel-name { font-weight: 600; font-size: 14px; }
.channel-username { font-size: 12px; color: var(--text3); }

.series-timeline {
  display: flex; gap: 0; overflow-x: auto; padding: 16px 20px; align-items: center;
}
.series-step {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 16px; font-size: 12px; min-width: 140px; position: relative;
}
.series-step:not(:last-child)::after {
  content: '→'; position: absolute; right: -18px; top: 50%; transform: translateY(-50%);
  color: var(--text3); font-size: 16px;
}
.series-connector { width: 32px; flex-shrink: 0; text-align: center; color: var(--text3); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.text-muted { color: var(--text3); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-gap { display: flex; gap: 10px; align-items: center; }
.hidden { display: none !important; }

.user-select-list { max-height: 300px; overflow-y: auto; }
.user-select-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background var(--transition);
}
.user-select-item:hover { background: rgba(99,130,255,0.06); }
.user-select-item.checked { background: rgba(99,130,255,0.1); }

.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 0 rgba(74,222,128,0.4);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.4); }
  70% { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

.audience-pill {
  padding: 7px 16px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--bg3); color: var(--text2); cursor: pointer;
  font-size: 13px; font-weight: 500; transition: all var(--transition);
}
.audience-pill.active {
  background: rgba(99,130,255,0.15); border-color: var(--accent); color: var(--accent);
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile & Tablet
   ══════════════════════════════════════════════════════════════════════ */

/* ── Mobile (< 768px) ── */
@media (max-width: 767px) {
  html, body { overflow: auto; }

  #app { flex-direction: column; height: auto; min-height: 100vh; }

  /* Sidebar → Bottom navigation */
  #sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    width: 100%; min-height: auto; height: 56px;
    flex-direction: row; justify-content: space-around;
    border-right: none; border-top: 1px solid var(--border);
    padding: 0; z-index: 100;
    animation: none;
  }

  .sidebar-logo, .sidebar-footer, .nav-section { display: none; }

  nav { display: flex; flex-direction: row; justify-content: space-around;
        padding: 0; flex: 1; align-items: center; overflow-x: auto; overflow-y: hidden; }

  .nav-item {
    flex-direction: column; gap: 2px; padding: 6px 8px;
    font-size: 9px; margin-bottom: 0; border-radius: 8px;
  }
  .nav-item .icon { font-size: 18px; }
  .nav-item.active::before { display: none; }
  .nav-item span:not(.icon) { display: block; max-width: 60px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-badge { position: absolute; top: 2px; right: 2px;
                min-width: 14px; font-size: 8px; padding: 0 3px; }
  .live-dot { display: none; }  /* hide live badge on mobile nav */

  /* Main content */
  #main { margin-left: 0; padding-bottom: 70px; }

  .topbar { padding: 0 16px; height: 52px; }
  .page-title { font-size: 16px; }
  .topbar-actions .btn { padding: 6px 10px; font-size: 12px; }
  .topbar-actions .btn span { display: none; }  /* icon-only */

  #content { padding: 16px; }

  /* Stats — 1 column */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-value { font-size: 24px; }
  .stat-icon { display: none; }

  /* Two-col → 1 column */
  .two-col { grid-template-columns: 1fr; }

  /* Tables → Cards */
  .table-wrap { overflow-x: visible; }
  table, thead, tbody, th, tr, td { display: block; }
  thead { display: none; }
  tbody tr {
    margin-bottom: 12px; border: 1px solid var(--border);
    border-radius: 10px; padding: 8px;
    background: var(--bg2);
  }
  tbody tr:hover { background: var(--bg3); }
  td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 8px; max-width: 100%;
    border-bottom: 1px solid var(--border);
    white-space: normal; overflow: visible; text-overflow: unset;
    font-size: 12px;
  }
  td:last-child { border-bottom: none; }
  td:first-child { padding-left: 8px; color: var(--text); }
  td::before {
    content: attr(data-label);
    font-size: 11px; font-weight: 600; color: var(--text3);
    text-transform: uppercase; letter-spacing: 0.05em;
    flex-shrink: 0; margin-right: 8px;
  }
  td[data-label=""]::before { content: none; }
  td[data-label="ID"], td[data-label="Имя"] { font-weight: 600; }

  /* Cards */
  .card { border-radius: 10px; }
  .card-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .card-title { font-size: 14px; }

  /* Filters */
  .filters { padding: 10px 16px; gap: 8px; }
  .filter-input { font-size: 12px; padding: 6px 10px; }
  .search-wrap input { min-width: 120px; }

  /* Pagination */
  .pagination { padding: 10px 16px; flex-direction: column; gap: 8px; align-items: flex-start; }

  /* Modals */
  .modal { width: calc(100vw - 32px); padding: 20px; border-radius: 12px; }
  .modal-overlay { padding: 16px; align-items: flex-end; }
  .modal-overlay.open .modal { transform: translateY(0) scale(1); }
  .modal-footer { flex-direction: column; }
  .modal-footer .btn { width: 100%; justify-content: center; }

  /* Broadcast cards */
  .bc-card { padding: 14px; }
  .bc-stats-row { gap: 12px; overflow-x: auto; }
  .bc-stat-v { font-size: 16px; }

  /* Forms */
  .form-field { margin-bottom: 12px; }

  /* Login */
  .login-card { width: calc(100vw - 32px); padding: 32px 24px; border-radius: 16px; }

  /* Charts */
  canvas { max-height: 180px; }
  .mini-chart { height: 50px; }

  /* Selection bar */
  .selection-bar { flex-direction: column; gap: 8px; align-items: flex-start; }
  .selection-bar .flex-gap { flex-wrap: wrap; }

  /* Topbar actions on mobile */
  .topbar-actions { gap: 8px; }
}

/* ── Tablet (768px – 1024px) ── */
@media (min-width: 768px) and (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  #sidebar { width: 72px; }
  .sidebar-logo { font-size: 16px; padding: 16px 12px 14px; }
  .sidebar-logo span { display: none; }
  .nav-item { padding: 8px 4px; justify-content: center; }
  .nav-item span:not(.icon) { display: none; }
  .nav-section { font-size: 9px; padding: 8px 4px 4px; }
  .sidebar-footer { padding: 10px; }
  .sidebar-user { padding: 4px; }
  .sidebar-name, .sidebar-role { display: none; }
  .sidebar-avatar { margin: 0 auto; }
  .sidebar-footer .btn { padding: 4px 6px; font-size: 10px; margin-left: auto; }

  #main { margin-left: 72px; }

  .bc-stats-row { gap: 14px; }
  .two-col { grid-template-columns: 1fr; }

  /* Table → card list on tablet */
  table, thead, tbody, th, tr, td { display: block; }
  thead { display: none; }
  tbody tr {
    margin-bottom: 10px; border: 1px solid var(--border);
    border-radius: 10px; background: var(--bg2);
  }
  tbody tr:hover { background: var(--bg3); }
  td {
    display: flex; justify-content: space-between;
    padding: 8px 14px; max-width: 100%;
    white-space: normal; overflow: visible; text-overflow: unset;
    font-size: 12px; border-bottom: 1px solid var(--border);
  }
  td:last-child { border-bottom: none; }
  td::before {
    content: attr(data-label);
    font-size: 11px; font-weight: 600; color: var(--text3);
    text-transform: uppercase; flex-shrink: 0; margin-right: 8px;
  }
  td[data-label=""]::before { content: none; }
}

/* ── Touch optimizations ── */
@media (hover: none) {
  .btn-primary:hover { transform: none; box-shadow: none; }
  .btn-accent:hover { transform: none; box-shadow: none; }
  tbody tr:hover { background: transparent; }
}

/* ── Mobile toast ── */
@media (max-width: 767px) {
  #toast-container { bottom: 70px; right: 12px; left: 12px; }
  .toast { min-width: unset; width: 100%; }
}

/* ── Mobile modal close area ── */
@media (max-width: 767px) {
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; width: 100%; max-height: 90vh; }
}
