/* ══════════════════════════════════════════════
   NEWSBOT PRO — DASHBOARD STYLES
   Brand: Navy (#1a3a5c) + Red (#e63946) + Inter/Playfair/JetBrains
   Dark newsroom terminal aesthetic
══════════════════════════════════════════════ */
:root {
  /* Dark navy backgrounds (deepest → lightest) */
  --bg:          #070f1a;
  --bg2:         #0d1f35;
  --bg3:         #142b47;
  --bg4:         #1a3a5c;

  /* Borders */
  --border:      #1e3a5a;
  --border2:     #152b44;

  /* Brand accent — Signal Red */
  --accent:      #e63946;
  --accent2:     #c1121f;
  --accent-glow: rgba(230,57,70,0.22);
  --accent-bg:   rgba(230,57,70,0.1);

  /* Text */
  --text1:       #f0f6fc;
  --text2:       #8baac7;
  --text3:       #4d7090;

  /* Status */
  --success:     #22c55e;
  --success-bg:  rgba(34,197,94,0.1);
  --warn:        #f59e0b;
  --warn-bg:     rgba(245,158,11,0.1);
  --error:       #ef4444;
  --error-bg:    rgba(239,68,68,0.1);
  --info:        #3b82f6;
  --info-bg:     rgba(59,130,246,0.1);

  /* Platform colours */
  --wp:   #21759b;  --wp-bg:   rgba(33,117,155,0.12);
  --ig:   #e1306c;  --ig-bg:   rgba(225,48,108,0.12);
  --fb:   #1877f2;  --fb-bg:   rgba(24,119,242,0.12);
  --yt:   #ff0000;  --yt-bg:   rgba(255,0,0,0.1);
  --tt:   #69c9d0;  --tt-bg:   rgba(105,201,208,0.12);

  /* Layout */
  --sidebar-w:  224px;
  --topbar-h:   60px;
  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 4px 28px rgba(0,0,0,0.5);
  --transition: 0.18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text1);
  overflow: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
.hidden { display: none !important; }

/* ══════════════════════════════════════════════
   SETUP SCREEN
══════════════════════════════════════════════ */
#setup-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(230,57,70,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(26,58,92,0.4) 0%, transparent 50%),
    var(--bg);
}
.setup-card {
  width: 440px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 44px 40px 40px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(230,57,70,0.06);
  text-align: center;
}

/* Setup logo — N mark + red dot */
.setup-logo { margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; }
.setup-logo-icon {
  width: 68px; height: 68px;
  background: linear-gradient(135deg, var(--bg4), #0f2540);
  border-radius: 18px;
  border: 1px solid rgba(230,57,70,0.25);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px var(--border);
}
.setup-logo-letter {
  font-family: 'Playfair Display', serif;
  font-size: 40px; font-weight: 800; color: #fff; line-height: 1;
}
.setup-logo-dot {
  position: absolute; top: 8px; right: 8px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.setup-wordmark {
  font-family: 'Playfair Display', serif;
  font-size: 20px; font-weight: 800; color: var(--text1);
  letter-spacing: -0.3px; margin-bottom: 6px;
}
.setup-pro {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px;
  letter-spacing: 1.5px; margin-left: 6px;
  vertical-align: middle; line-height: 1.4;
}
.setup-card h1 {
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 600; color: var(--text2);
  margin-bottom: 6px;
}
.setup-card p { color: var(--text3); margin-bottom: 28px; font-size: 13px; line-height: 1.6; }

/* ══════════════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════════════ */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════ */
#sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Brand lockup in sidebar */
.brand {
  padding: 18px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--bg4), #0f2540);
  border-radius: 9px;
  border: 1px solid rgba(230,57,70,0.3);
  display: flex; align-items: center; justify-content: center;
  position: relative; flex-shrink: 0;
}
.brand-icon-n {
  font-family: 'Playfair Display', serif;
  font-size: 20px; font-weight: 800; color: #fff; line-height: 1;
}
.brand-icon-dot {
  position: absolute; top: 2px; right: 2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 14px; font-weight: 800; color: var(--text1);
  line-height: 1; letter-spacing: -0.2px;
}
.brand-pro {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 8px; font-weight: 700;
  padding: 1px 5px; border-radius: 3px;
  letter-spacing: 1.5px; margin-left: 4px;
  vertical-align: middle; line-height: 1.5;
}
.brand-sub {
  font-size: 10px; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1px; margin-top: 2px;
}
.live-dot {
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  margin-left: auto;
  box-shadow: 0 0 8px rgba(34,197,94,0.5);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* Sidebar nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 13px; font-weight: 500;
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg3); color: var(--text1); }
.nav-item.active {
  background: var(--accent-bg);
  color: #ff8f96;
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px;
  min-width: 20px; text-align: center;
  font-family: 'JetBrains Mono', monospace;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px; flex-shrink: 0;
}
.conn-status { display: flex; align-items: center; gap: 6px; color: var(--text2); margin-bottom: 4px; }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.conn-dot.disconnected { background: var(--error); }
#last-sync { color: var(--text3); font-family: 'JetBrains Mono', monospace; font-size: 10px; }

/* ══════════════════════════════════════════════
   MAIN + TOPBAR
══════════════════════════════════════════════ */
#main {
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
#topbar {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}
#page-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px; font-weight: 800; letter-spacing: -0.3px;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 600;
  color: var(--text3);
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.topbar-pro {
  color: var(--accent);
  margin-left: 3px;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.btn-icon {
  width: 34px; height: 34px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2);
  transition: all var(--transition);
}
.btn-icon:hover { color: var(--text1); border-color: var(--accent); }
.btn-icon svg { width: 16px; height: 16px; }
.btn-icon.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.admin-badge {
  background: var(--accent-bg);
  border: 1px solid rgba(230,57,70,0.3);
  color: #ff8f96;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════════
   VIEWS
══════════════════════════════════════════════ */
.view {
  flex: 1; overflow-y: auto;
  padding: 20px 24px;
}

/* ══════════════════════════════════════════════
   PIPELINE STAGES (Overview stat cards)
══════════════════════════════════════════════ */
.pipeline-stages {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stage-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}
.stage-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.stage-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 0 0 var(--radius) var(--radius);
}
.stage-card.s1::after { background: var(--info); }
.stage-card.s2::after { background: var(--warn); }
.stage-card.s3::after { background: #7c3aed; }
.stage-card.s4::after { background: #06b6d4; }
.stage-card.s5::after { background: var(--success); }
.stage-card.s6::after { background: var(--error); }
.stage-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px; font-weight: 600;
  line-height: 1; margin-bottom: 6px;
}
.stage-label { font-size: 11px; color: var(--text2); font-weight: 500; }
.stage-sublabel {
  font-size: 10px; color: var(--text3); margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
}

/* ══════════════════════════════════════════════
   OVERVIEW GRID
══════════════════════════════════════════════ */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
}
.card-badge {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
  font-family: 'JetBrains Mono', monospace;
}

/* Activity Feed */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border2);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; margin-top: 1px;
}
.activity-icon.youtube  { background: var(--yt-bg); }
.activity-icon.rss      { background: var(--warn-bg); }
.activity-icon.social   { background: var(--ig-bg); }
.activity-icon.trends   { background: var(--info-bg); }
.activity-icon.ai       { background: var(--accent-bg); }
.activity-icon.image    { background: rgba(6,182,212,0.1); }
.activity-icon.brand    { background: rgba(236,72,153,0.1); }
.activity-icon.audio    { background: rgba(251,146,60,0.1); }
.activity-icon.video    { background: rgba(16,185,129,0.1); }
.activity-icon.publish  { background: var(--success-bg); }
.activity-title { font-size: 12.5px; font-weight: 500; color: var(--text1); line-height: 1.4; margin-bottom: 3px; }
.activity-meta  { font-size: 11px; color: var(--text3); font-family: 'JetBrains Mono', monospace; }

/* Platform Stats */
.platform-stat {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border2);
}
.platform-stat:last-child { border-bottom: none; }
.platform-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.platform-dot.wp { background: var(--wp); }
.platform-dot.ig { background: var(--ig); }
.platform-dot.fb { background: var(--fb); }
.platform-dot.yt { background: var(--yt); }
.platform-name { font-size: 12.5px; font-weight: 500; flex: 1; }
.platform-count { font-size: 18px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.platform-bar-wrap { width: 80px; height: 4px; background: var(--bg3); border-radius: 2px; overflow: hidden; }
.platform-bar { height: 100%; border-radius: 2px; }

/* Source Health */
.source-health-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border2);
  font-size: 12px;
}
.source-health-item:last-child { border-bottom: none; }
.health-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.health-name { flex: 1; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.health-time { color: var(--text3); font-size: 11px; white-space: nowrap; font-family: 'JetBrains Mono', monospace; }

/* ══════════════════════════════════════════════
   VIEW TOOLBAR
══════════════════════════════════════════════ */
.view-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-tab {
  padding: 6px 14px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text2);
  font-size: 12px; font-weight: 500;
  transition: all var(--transition);
}
.filter-tab:hover { color: var(--text1); background: var(--bg3); border-color: var(--border); }
.filter-tab.active {
  background: var(--accent-bg);
  border-color: rgba(230,57,70,0.4);
  color: #ff8f96; font-weight: 600;
}

.search-wrap {
  position: relative; display: flex; align-items: center;
}
.search-wrap svg { position: absolute; left: 10px; width: 14px; height: 14px; color: var(--text3); }
.search-input {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 12px 7px 32px;
  color: var(--text1); font-size: 13px; width: 220px;
  transition: border-color var(--transition);
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-input::placeholder { color: var(--text3); }

/* ══════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════ */
.table-wrap {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: auto;
  max-height: calc(100vh - 220px);
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--bg3); color: var(--text3);
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; padding: 10px 14px; text-align: left;
  position: sticky; top: 0; z-index: 1;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border2);
  vertical-align: middle; font-size: 12.5px;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(255,255,255,0.015); }
.table-loading { text-align: center; color: var(--text3); padding: 40px !important; }
.icon-col { width: 38px; text-align: center !important; }
.icon-col + .icon-col { padding-left: 0; }
.title-cell { max-width: 240px; }
.title-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 500; color: var(--text1); display: block;
}
.title-sub { font-size: 11px; color: var(--text3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'JetBrains Mono', monospace; }

/* ══════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: 10px; font-weight: 700; white-space: nowrap;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.3px;
}
.badge-new        { background: var(--info-bg);    color: #93c5fd; }
.badge-processing { background: var(--warn-bg);    color: #fcd34d; }
.badge-processed  { background: var(--success-bg); color: #86efac; }
.badge-error      { background: var(--error-bg);   color: #fca5a5; }
.badge-rejected   { background: var(--bg3);        color: var(--text3); }
.badge-youtube    { background: var(--yt-bg);      color: #fca5a5; }
.badge-rss        { background: var(--warn-bg);    color: #fcd34d; }
.badge-social     { background: var(--ig-bg);      color: #f9a8d4; }
.badge-trends     { background: var(--info-bg);    color: #93c5fd; }
.badge-active     { background: var(--success-bg); color: #86efac; }
.badge-inactive   { background: var(--bg3);        color: var(--text3); }

.check-icon { font-size: 14px; }
.check-yes  { color: var(--success); }
.check-no   { color: var(--border); }

/* ══════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════ */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 14px 0;
}
.page-btn {
  min-width: 32px; height: 32px; padding: 0 8px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text2);
  font-size: 12px; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  transition: all var(--transition);
}
.page-btn:hover   { background: var(--bg3); color: var(--text1); }
.page-btn.active  { background: var(--accent-bg); border-color: var(--accent); color: #ff8f96; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { font-size: 12px; color: var(--text3); padding: 0 8px; font-family: 'JetBrains Mono', monospace; }

/* ══════════════════════════════════════════════
   ACTION BUTTONS
══════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 8px 16px; font-size: 13px; font-weight: 700;
  transition: all var(--transition);
  letter-spacing: 0.2px;
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-primary.full-width { width: 100%; justify-content: center; padding: 12px; }
.btn-primary svg { width: 14px; height: 14px; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); border-radius: var(--radius-sm);
  padding: 8px 14px; font-size: 13px; font-weight: 500;
  transition: all var(--transition);
}
.btn-secondary:hover { background: var(--border); color: var(--text1); border-color: var(--text3); }

.btn-warn {
  background: var(--warn-bg); border: 1px solid rgba(245,158,11,0.25);
  color: var(--warn); border-radius: var(--radius-sm);
  padding: 6px 14px; font-size: 12px; font-weight: 600;
  transition: all var(--transition);
}
.btn-warn:hover { background: rgba(245,158,11,0.18); }

.btn-danger {
  background: var(--error-bg); border: 1px solid rgba(239,68,68,0.25);
  color: var(--error); border-radius: var(--radius-sm);
  padding: 6px 14px; font-size: 12px; font-weight: 600;
  transition: all var(--transition);
}
.btn-danger:hover { background: rgba(239,68,68,0.18); }

.btn-sm { padding: 4px 10px !important; font-size: 11px !important; }
.action-row { display: flex; gap: 6px; align-items: center; }

/* Toggle switch */
.toggle-wrap { display: flex; align-items: center; gap: 8px; }
.toggle {
  position: relative; width: 36px; height: 20px;
  background: var(--border); border-radius: 20px;
  cursor: pointer; transition: background var(--transition);
  flex-shrink: 0;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: ''; position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform var(--transition);
}
.toggle.on::after { transform: translateX(16px); }

/* ══════════════════════════════════════════════
   ANALYTICS
══════════════════════════════════════════════ */
.analytics-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 20px;
}
.analytics-kpi {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  border-left: 3px solid var(--accent);
}
.analytics-kpi .kpi-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px; font-weight: 600;
  line-height: 1; margin-bottom: 4px;
}
.analytics-kpi .kpi-label { font-size: 11px; color: var(--text2); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.analytics-kpi .kpi-change { font-size: 11px; margin-top: 6px; font-family: 'JetBrains Mono', monospace; }
.kpi-up   { color: var(--success); }
.kpi-down { color: var(--error); }

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.chart-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.chart-card.span2 { grid-column: span 2; }
.chart-card-header { margin-bottom: 16px; }
.chart-card-header h3 {
  font-size: 12px; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: 1px;
  font-family: 'JetBrains Mono', monospace;
}
.chart-wrap { height: 220px; position: relative; }
.chart-card.span2 .chart-wrap { height: 240px; }

/* ══════════════════════════════════════════════
   PUBLISHED GRID
══════════════════════════════════════════════ */
.platform-tabs {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.platform-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 20px;
  color: var(--text2); font-size: 12px; font-weight: 500;
  transition: all var(--transition);
}
.platform-tab:hover  { background: var(--bg3); color: var(--text1); }
.platform-tab.active { background: var(--accent-bg); border-color: rgba(230,57,70,0.4); color: #ff8f96; font-weight: 600; }
.wp-dot, .ig-dot, .fb-dot, .yt-dot, .tt-dot {
  width: 8px; height: 8px; display: inline-block; border-radius: 50%;
}
.wp-dot { background: var(--wp); }
.ig-dot { background: var(--ig); }
.fb-dot { background: var(--fb); }
.yt-dot { background: var(--yt); }
.tt-dot { background: var(--tt); }

.published-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.pub-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all var(--transition);
}
.pub-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.pub-card-img { width: 100%; height: 150px; object-fit: cover; background: var(--bg3); display: block; }
.pub-card-img-placeholder {
  width: 100%; height: 150px;
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  color: var(--text3); font-size: 24px;
}
.pub-card-body { padding: 12px; }
.pub-card-title {
  font-size: 13px; font-weight: 600; line-height: 1.4;
  margin-bottom: 8px; color: var(--text1);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pub-card-meta { font-size: 11px; color: var(--text3); display: flex; align-items: center; justify-content: space-between; font-family: 'JetBrains Mono', monospace; }
.pub-card-platforms { display: flex; gap: 4px; margin-top: 8px; }
.platform-chip { padding: 2px 7px; border-radius: 10px; font-size: 10px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.platform-chip.wp { background: var(--wp-bg); color: #7dd3fc; }
.platform-chip.ig { background: var(--ig-bg); color: #f9a8d4; }
.platform-chip.fb { background: var(--fb-bg); color: #93c5fd; }
.platform-chip.yt { background: var(--yt-bg); color: #fca5a5; }
.platform-chip.tt { background: var(--tt-bg); color: #69c9d0; }

/* ══════════════════════════════════════════════
   SETTINGS
══════════════════════════════════════════════ */
.settings-layout { display: flex; flex-direction: column; gap: 16px; max-width: 820px; }
.settings-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.settings-card-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.settings-card-header svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.settings-card-header h3 {
  font-size: 14px; font-weight: 700;
  font-family: 'Playfair Display', serif;
}
.settings-hint { font-size: 12px; color: var(--text3); margin-bottom: 14px; line-height: 1.6; }

/* Engine credentials */
.settings-card-wide { }
.settings-hint code {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; color: var(--text2);
}
.creds-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.creds-toolbar-spacer { flex: 1; }
.creds-reveal {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text2); cursor: pointer; user-select: none;
}
.creds-reveal input { accent-color: var(--accent); cursor: pointer; }
.creds-group { margin-bottom: 22px; }
.creds-group:last-child { margin-bottom: 0; }
.creds-group-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--text1);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding-bottom: 8px; margin-bottom: 14px;
  border-bottom: 1px dashed var(--border2);
}
.creds-group-icon { font-size: 14px; }
.creds-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 16px;
}
.creds-field { margin-bottom: 0; }
.creds-field input {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
}

.danger-actions { display: flex; flex-direction: column; gap: 1px; }
.danger-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--border2);
}
.danger-item:last-child { border-bottom: none; }
.danger-item strong { font-size: 13px; color: var(--text1); display: block; margin-bottom: 3px; font-weight: 600; }
.danger-item p { font-size: 12px; color: var(--text3); }

/* ══════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════ */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text2); margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.label-hint { font-size: 11px; font-weight: 400; color: var(--text3); text-transform: none; letter-spacing: 0; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px;
  color: var(--text1); font-size: 13px;
  transition: border-color var(--transition);
  font-family: 'Inter', sans-serif;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group select option { background: var(--bg2); }
.form-actions { display: flex; gap: 10px; margin-top: 16px; }
.form-error {
  background: var(--error-bg); border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5; padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; margin-top: 12px;
  border-left: 3px solid var(--error);
}
.form-result { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-top: 12px; }
.form-result.success { background: var(--success-bg); border: 1px solid rgba(34,197,94,0.25); color: #86efac; border-left: 3px solid var(--success); }
.form-result.error   { background: var(--error-bg);   border: 1px solid rgba(239,68,68,0.25);  color: #fca5a5; border-left: 3px solid var(--error); }

/* ══════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════ */
#modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
#modal-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 14px; width: 100%; max-width: 680px;
  max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(230,57,70,0.1);
}
#modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  flex-shrink: 0; background: var(--bg3);
  border-radius: 14px 14px 0 0;
}
#modal-title {
  font-size: 15px; font-weight: 800;
  font-family: 'Playfair Display', serif;
}
#modal-close-btn {
  width: 30px; height: 30px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); transition: all var(--transition);
}
#modal-close-btn svg { width: 14px; height: 14px; }
#modal-close-btn:hover { background: var(--accent-bg); border-color: var(--accent); color: #ff8f96; }
#modal-body { padding: 20px; overflow-y: auto; flex: 1; }

/* Content detail modal */
.content-detail { display: flex; flex-direction: column; gap: 14px; }
.detail-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text3); margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace;
}
.detail-value { font-size: 13px; color: var(--text1); line-height: 1.6; }
.detail-value a { color: #ff8f96; }
.detail-value a:hover { text-decoration: underline; }
.detail-image { width: 100%; max-height: 200px; object-fit: cover; border-radius: var(--radius-sm); }
.detail-platforms { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.detail-platform {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.detail-platform.published { background: var(--success-bg); color: #86efac; }
.detail-platform.unpublished { background: var(--bg3); color: var(--text3); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ══════════════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════════════ */
#toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  box-shadow: var(--shadow); min-width: 280px;
  animation: slideIn 0.2s ease;
  font-size: 13px;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--error); }
.toast.info    { border-left: 3px solid var(--info); }
.toast.warn    { border-left: 3px solid var(--warn); }
.toast-icon { font-size: 16px; }
.toast-msg  { flex: 1; }

/* ══════════════════════════════════════════════
   SKELETON LOADING
══════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-list { height: 200px; border-radius: var(--radius-sm); }

/* ══════════════════════════════════════════════
   SCROLLBAR
══════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg4); }

/* ══════════════════════════════════════════════
   THEME TRANSITION — smooth swap on toggle
══════════════════════════════════════════════ */
body,
#sidebar, #main, #topbar, .card, .stage-card,
.filter-tab, .platform-tab, .data-table td,
.data-table th, .analytics-kpi, .chart-card,
.settings-card, .pub-card, .toast, #modal-box,
.btn-primary, .btn-secondary, .search-input,
.form-group input, .form-group select, .page-btn {
  transition:
    background-color 0.25s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

/* ══════════════════════════════════════════════
   LIGHT THEME — NewsBot Pro editorial palette
   Mirrors the marketing page: white + navy + red
══════════════════════════════════════════════ */
body.light-theme {
  /* Backgrounds */
  --bg:          #f8fafc;
  --bg2:         #ffffff;
  --bg3:         #f1f5f9;
  --bg4:         #e2e8f0;

  /* Borders */
  --border:      #e2e8f0;
  --border2:     #f1f5f9;

  /* Accent — same red, same energy */
  --accent:      #e63946;
  --accent2:     #c1121f;
  --accent-glow: rgba(230,57,70,0.12);
  --accent-bg:   rgba(230,57,70,0.07);

  /* Text */
  --text1:       #1e293b;
  --text2:       #475569;
  --text3:       #94a3b8;

  /* Status (slightly richer on white) */
  --success:     #16a34a;
  --success-bg:  rgba(22,163,74,0.08);
  --warn:        #d97706;
  --warn-bg:     rgba(217,119,6,0.08);
  --error:       #dc2626;
  --error-bg:    rgba(220,38,38,0.08);
  --info:        #2563eb;
  --info-bg:     rgba(37,99,235,0.08);

  /* Platform chips — more muted on white */
  --wp-bg:   rgba(33,117,155,0.1);
  --ig-bg:   rgba(225,48,108,0.1);
  --fb-bg:   rgba(24,119,242,0.1);
  --yt-bg:   rgba(220,38,38,0.1);
  --tt-bg:   rgba(105,201,208,0.1);

  /* Shadow */
  --shadow:  0 4px 20px rgba(0,0,0,0.08);
}

/* ── Setup screen ── */
body.light-theme #setup-screen {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(230,57,70,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(26,58,92,0.06) 0%, transparent 50%),
    #f8fafc;
}
body.light-theme .setup-card {
  box-shadow: 0 8px 40px rgba(0,0,0,0.1);
}

/* ── Brand icon: always stays navy regardless of theme ── */
body.light-theme .brand-icon,
body.light-theme .setup-logo-icon {
  background: linear-gradient(135deg, #1a3a5c, #0f2540);
  border-color: rgba(230,57,70,0.3);
}

/* ── Sidebar ── */
body.light-theme #sidebar {
  background: #ffffff;
  border-right-color: #e2e8f0;
}
body.light-theme .brand {
  border-bottom-color: #e2e8f0;
}
body.light-theme .sidebar-footer {
  border-top-color: #e2e8f0;
}
body.light-theme .live-dot {
  box-shadow: 0 0 8px rgba(22,163,74,0.4);
}
body.light-theme .nav-item { color: #64748b; }
body.light-theme .nav-item:hover { background: #f8fafc; color: #1e293b; }
body.light-theme .nav-item.active { background: rgba(230,57,70,0.06); color: #c1121f; }
body.light-theme .nav-item.active::before { background: #e63946; }

/* ── Topbar ── */
body.light-theme #topbar {
  background: #ffffff;
  border-bottom-color: #e63946;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
body.light-theme #page-title { color: #1a3a5c; }
body.light-theme .btn-icon {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}
body.light-theme .btn-icon:hover { border-color: #e63946; color: #e63946; }
body.light-theme .admin-badge {
  background: rgba(230,57,70,0.06);
  border-color: rgba(230,57,70,0.2);
  color: #c1121f;
}
body.light-theme .topbar-brand { color: #94a3b8; border-color: #e2e8f0; }
body.light-theme .topbar-pro { color: #e63946; }

/* ── Cards & stage cards ── */
body.light-theme .card,
body.light-theme .stage-card,
body.light-theme .analytics-kpi,
body.light-theme .chart-card,
body.light-theme .settings-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
body.light-theme .stage-card:hover { border-color: #e63946; }
body.light-theme .card-header { border-bottom-color: #f1f5f9; }

/* ── Tables ── */
body.light-theme .table-wrap {
  background: #ffffff;
  border-color: #e2e8f0;
}
body.light-theme .data-table th {
  background: #f8fafc;
  color: #94a3b8;
  border-bottom-color: #e2e8f0;
}
body.light-theme .data-table td { border-bottom-color: #f1f5f9; }
body.light-theme .data-table tbody tr:hover td { background: rgba(26,58,92,0.025); }
body.light-theme .title-text { color: #1e293b; }
body.light-theme .title-sub  { color: #94a3b8; }

/* ── Badges ── */
body.light-theme .badge-new        { background: rgba(37,99,235,0.08);    color: #1d4ed8; }
body.light-theme .badge-processing { background: rgba(217,119,6,0.08);    color: #92400e; }
body.light-theme .badge-processed  { background: rgba(22,163,74,0.08);    color: #166534; }
body.light-theme .badge-error      { background: rgba(220,38,38,0.08);    color: #991b1b; }
body.light-theme .badge-rejected   { background: #f1f5f9;                 color: #94a3b8; }
body.light-theme .badge-active     { background: rgba(22,163,74,0.08);    color: #166534; }
body.light-theme .badge-inactive   { background: #f1f5f9;                 color: #94a3b8; }
body.light-theme .badge-youtube    { background: rgba(220,38,38,0.08);    color: #991b1b; }
body.light-theme .badge-rss        { background: rgba(217,119,6,0.08);    color: #92400e; }
body.light-theme .badge-social     { background: rgba(225,48,108,0.08);   color: #9d174d; }
body.light-theme .badge-trends     { background: rgba(37,99,235,0.08);    color: #1d4ed8; }
body.light-theme .check-no         { color: #cbd5e1; }

/* ── Filter & platform tabs ── */
body.light-theme .filter-tab {
  background: #ffffff; border-color: #e2e8f0; color: #64748b;
}
body.light-theme .filter-tab:hover { background: #f8fafc; color: #1e293b; }
body.light-theme .filter-tab.active {
  background: rgba(230,57,70,0.06);
  border-color: rgba(230,57,70,0.3);
  color: #c1121f;
}
body.light-theme .platform-tab { background: #ffffff; border-color: #e2e8f0; color: #64748b; }
body.light-theme .platform-tab:hover { background: #f8fafc; color: #1e293b; }
body.light-theme .platform-tab.active {
  background: rgba(230,57,70,0.06);
  border-color: rgba(230,57,70,0.3);
  color: #c1121f;
}

/* ── Pagination ── */
body.light-theme .page-btn { background: #ffffff; border-color: #e2e8f0; color: #64748b; }
body.light-theme .page-btn:hover { background: #f8fafc; color: #1e293b; }
body.light-theme .page-btn.active { background: rgba(230,57,70,0.07); border-color: #e63946; color: #c1121f; }

/* ── Search ── */
body.light-theme .search-input { background: #ffffff; border-color: #e2e8f0; color: #1e293b; }
body.light-theme .search-input::placeholder { color: #cbd5e1; }

/* ── Published cards ── */
body.light-theme .pub-card { background: #ffffff; border-color: #e2e8f0; }
body.light-theme .pub-card:hover { border-color: #e63946; }
body.light-theme .pub-card-img-placeholder { background: #f1f5f9; }
body.light-theme .pub-card-title { color: #1e293b; }
body.light-theme .pub-card-meta  { color: #94a3b8; }
body.light-theme .platform-chip.wp { background: rgba(33,117,155,0.1);   color: #0e4d6e; }
body.light-theme .platform-chip.ig { background: rgba(225,48,108,0.1);   color: #9d174d; }
body.light-theme .platform-chip.fb { background: rgba(24,119,242,0.1);   color: #1e40af; }
body.light-theme .platform-chip.yt { background: rgba(220,38,38,0.1);    color: #991b1b; }
body.light-theme .platform-chip.tt { background: rgba(105,201,208,0.1);  color: #0e7490; }

/* ── Forms ── */
body.light-theme .form-group input,
body.light-theme .form-group select,
body.light-theme .form-group textarea,
body.light-theme .webhook-item input {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #1e293b;
}
body.light-theme .form-group label { color: #64748b; }
body.light-theme .settings-card-header { border-bottom-color: #f1f5f9; }
body.light-theme .danger-item { border-bottom-color: #f1f5f9; }
body.light-theme .danger-item strong { color: #1e293b; }
body.light-theme .trigger-btn { color: #c1121f; background: rgba(230,57,70,0.06); border-color: rgba(230,57,70,0.2); }
body.light-theme .trigger-btn:hover { background: #e63946; color: #fff; }

/* ── Buttons ── */
body.light-theme .btn-secondary {
  background: #f8fafc; border-color: #e2e8f0; color: #475569;
}
body.light-theme .btn-secondary:hover { background: #f1f5f9; color: #1e293b; border-color: #cbd5e1; }

/* ── Modal ── */
body.light-theme #modal-box { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
body.light-theme #modal-head { background: #f8fafc; border-bottom-color: #e2e8f0; }
body.light-theme #modal-close-btn { background: #ffffff; border-color: #e2e8f0; color: #64748b; }
body.light-theme #modal-close-btn:hover { background: rgba(230,57,70,0.06); border-color: #e63946; color: #c1121f; }
body.light-theme .detail-value a { color: #c1121f; }
body.light-theme .detail-platform.published  { background: rgba(22,163,74,0.08); color: #166534; }
body.light-theme .detail-platform.unpublished { background: #f1f5f9; color: #94a3b8; }

/* ── Toasts ── */
body.light-theme .toast { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }

/* ── Skeleton ── */
body.light-theme .skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
}

/* ── Scrollbar ── */
body.light-theme ::-webkit-scrollbar-track { background: #f8fafc; }
body.light-theme ::-webkit-scrollbar-thumb { background: #e2e8f0; }
body.light-theme ::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

/* ── Activity feed ── */
body.light-theme .activity-item { border-bottom-color: #f1f5f9; }
body.light-theme .activity-title { color: #1e293b; }
body.light-theme .activity-meta  { color: #94a3b8; }
body.light-theme .platform-stat  { border-bottom-color: #f1f5f9; }
body.light-theme .source-health-item { border-bottom-color: #f1f5f9; }
body.light-theme .health-name { color: #475569; }
body.light-theme .health-time { color: #94a3b8; }
body.light-theme .card-badge { background: #f8fafc; border-color: #e2e8f0; color: #64748b; }

/* ══════════════════════════════════════════════
   ENHANCEMENT ADDITIONS
   ──────────────────────────────────────────────
   1. Date range bar  2. Bulk bar  3. Notif bell
   4. Shortcuts popover  5. Leaderboard
══════════════════════════════════════════════ */

/* ── 1. Date Range Bar (Analytics) ── */
.date-range-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.range-tabs { display: flex; gap: 4px; }
.range-tab {
  padding: 5px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.15s ease;
}
.range-tab:hover { border-color: rgba(230,57,70,0.4); color: var(--text1); }
.range-tab.active {
  background: var(--accent-bg);
  border-color: rgba(230,57,70,0.4);
  color: #ff8f96;
  font-weight: 600;
}
body.light-theme .range-tab { background: #f8fafc; border-color: #e2e8f0; color: #64748b; }
body.light-theme .range-tab.active { background: rgba(230,57,70,0.08); border-color: rgba(193,18,31,0.4); color: #c1121f; }

/* ── 2. Bulk Action Bar (Pipeline) ── */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--accent-bg);
  border: 1px solid rgba(230,57,70,0.3);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
#bulk-count {
  font-size: 12px;
  font-weight: 700;
  color: #ff8f96;
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
}
body.light-theme .bulk-bar { background: rgba(230,57,70,0.06); border-color: rgba(193,18,31,0.25); }
body.light-theme #bulk-count { color: #c1121f; }
.row-check {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--accent);
}
th .row-check-header {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--accent);
}

/* ── 3. Notification Bell ── */
.notif-wrap { position: relative; }
.notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  padding: 0 4px;
  pointer-events: none;
}
.notif-panel {
  position: absolute;
  top: 48px;
  right: 0;
  width: 320px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
  overflow: hidden;
  max-height: 400px;
  display: flex;
  flex-direction: column;
}
.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text1);
  background: var(--bg3);
}
.notif-header button {
  background: none;
  border: none;
  font-size: 11px;
  color: var(--text3);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.notif-header button:hover { color: var(--accent); }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border2);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12px;
}
.notif-item:hover { background: var(--bg3); }
.notif-item-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.notif-item-body strong { display: block; color: var(--text1); margin-bottom: 2px; font-size: 12px; }
.notif-item-body span { color: var(--text3); font-family: 'JetBrains Mono', monospace; font-size: 10px; }
body.light-theme .notif-panel { background: #ffffff; border-color: #e2e8f0; }
body.light-theme .notif-header { background: #f8fafc; border-color: #e2e8f0; color: #1e293b; }
body.light-theme .notif-item { border-bottom-color: #f1f5f9; }
body.light-theme .notif-item:hover { background: #f8fafc; }
body.light-theme .notif-item-body strong { color: #1e293b; }

/* ── 4. Keyboard Shortcuts Popover ── */
.shortcuts-popover {
  position: absolute;
  top: 64px;
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  z-index: 200;
  min-width: 240px;
  box-shadow: var(--shadow);
}
.shortcuts-popover h4 {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border2);
  font-size: 12px;
  color: var(--text2);
}
.shortcut-row:last-child { border-bottom: none; }
.shortcut-key {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--accent);
  font-size: 11px;
}
body.light-theme .shortcuts-popover { background: #ffffff; border-color: #e2e8f0; }
body.light-theme .shortcut-row { color: #475569; border-color: #f1f5f9; }
body.light-theme .shortcut-key { background: #f8fafc; border-color: #e2e8f0; color: #c1121f; }

/* Relative positioning wrapper for shortcuts btn */
.shortcuts-wrap { position: relative; }

/* ── 5. Source Performance Leaderboard ── */
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border2);
}
.leaderboard-row:last-child { border-bottom: none; }
.lb-rank {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  width: 22px;
  flex-shrink: 0;
}
.lb-name {
  flex: 1;
  font-size: 12px;
  color: var(--text1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
}
.lb-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text1);
  flex-shrink: 0;
}
.lb-bar-wrap {
  width: 56px;
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  flex-shrink: 0;
}
.lb-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}
body.light-theme .leaderboard-row { border-bottom-color: #f1f5f9; }
body.light-theme .lb-name { color: #1e293b; }
body.light-theme .lb-count { color: #1e293b; }
body.light-theme .lb-bar-wrap { background: #f1f5f9; }

/* ── SIDEBAR SUITE NAV ── */
.sb-suite { padding: 10px 0 8px; border-bottom: 1px solid var(--border2); margin-bottom: 8px; }
.sb-suite-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text3); margin-bottom: 5px; padding: 0 4px; }
.sb-suite-links { display: flex; flex-direction: column; gap: 1px; }
.sb-suite-link { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; text-decoration: none; font-size: 11.5px; font-weight: 500; color: var(--text3); transition: background 0.15s, color 0.15s; }
.sb-suite-link svg { width: 13px; height: 13px; flex-shrink: 0; opacity: 0.6; }
.sb-suite-link:hover { background: var(--hover); color: var(--text1); }
.sb-suite-link:hover svg { opacity: 1; }
body.light-theme .sb-suite { border-bottom-color: #e2e8f0; }
body.light-theme .sb-suite-link:hover { background: #f1f5f9; }
