/* ============================================================
   蓝海选品雷达 · Design System v3.0
   参考风格: 成熟SaaS产品（Jungle Scout / Shopify / Ahrefs）
   基调: 白色为主，清晰专业
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  /* 品牌色 - 专业蓝 */
  --brand-primary: #2563eb;
  --brand-primary-hover: #3b82f6;
  --brand-primary-dim: rgba(37,99,235,0.08);
  --brand-primary-light: #dbeafe;

  /* 增长绿 */
  --brand-accent: #059669;
  --brand-accent-hover: #10b981;
  --brand-accent-dim: rgba(5,150,105,0.08);
  --brand-accent-light: #d1fae5;

  /* 功能色 */
  --warning: #d97706;
  --warning-hover: #f59e0b;
  --warning-dim: rgba(217,119,6,0.08);
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-hover: #ef4444;
  --danger-dim: rgba(220,38,38,0.06);
  --danger-light: #fee2e2;
  --info: #2563eb;

  /* 背景层级 - 白色基调 */
  --bg-page: #f8f9fb;
  --bg-white: #ffffff;
  --bg-surface: #ffffff;
  --bg-elevated: #f1f3f6;
  --bg-hover: #eef0f4;
  --bg-active: #e5e7eb;

  /* 边框 */
  --border: #e2e5ea;
  --border-light: #eef0f4;
  --border-focus: var(--brand-primary);

  /* 文字 */
  --text-primary: #1a1d23;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --text-link: var(--brand-primary);
  --text-link-hover: var(--brand-primary-hover);

  /* 阴影 - 轻量，适合白色背景 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-glow: 0 0 0 3px rgba(37,99,235,0.1);

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;

  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* 动效 */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover {
  color: var(--text-link-hover);
}

::selection {
  background: var(--brand-primary-dim);
  color: var(--brand-primary);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* =====================
   SIDEBAR
   ===================== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 240px;
  height: 100vh;
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  z-index: 50;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-2xl);
  padding: 0 var(--space-sm);
}

.sidebar-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--brand-primary), #4f46e5);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  color: white;
}

.sidebar-logo h1 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.sidebar-logo .logo-sub {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 400;
  display: block;
  margin-top: -2px;
}

.sidebar .nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar .nav-section {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: var(--space-md) var(--space-sm) var(--space-xs);
  margin-top: var(--space-sm);
  font-weight: 600;
}

.sidebar .nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
}

.sidebar .nav a:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.sidebar .nav a.active {
  background: var(--brand-primary-dim);
  color: var(--brand-primary);
  font-weight: 600;
}

.sidebar .nav a.active::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--brand-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.sidebar .nav .badge {
  margin-left: auto;
  background: var(--brand-accent-dim);
  color: var(--brand-accent);
  font-size: 10px;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.sidebar .nav .badge-pro {
  background: var(--warning-dim);
  color: var(--warning);
}

/* ---- User Box ---- */
.sidebar .user-box {
  margin-top: auto;
  padding: var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

.sidebar .user-box .user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-sm);
}

.sidebar .user-box .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand-primary), #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar .user-box .email {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 600;
  display: block;
  line-height: 1.3;
  word-break: break-all;
}

.sidebar .user-box .plan {
  font-size: 11px;
  color: var(--brand-accent);
  display: block;
  font-weight: 500;
}
.sidebar .user-box .plan.pro { color: var(--warning); }
.sidebar .user-box .plan.expired { color: var(--danger); }

.sidebar .user-box .actions {
  display: flex;
  gap: 6px;
  margin-top: var(--space-sm);
}

/* ---- Admin Link ---- */
.sidebar .nav a.admin-link {
  display: none;
  padding: 8px 12px;
  background: var(--warning-dim);
  color: var(--warning);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-top: var(--space-sm);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}
.sidebar .nav a.admin-link:hover {
  background: var(--warning);
  color: #fff;
}

/* =====================
   MAIN CONTENT
   ===================== */
.main {
  margin-left: 240px;
  padding: var(--space-2xl) var(--space-3xl);
  min-height: 100vh;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-2xl);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.page-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.page-header .subtitle {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.page-header .actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
}

/* =====================
   BUTTONS
   ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--duration-fast) var(--ease-out);
  font-family: inherit;
  white-space: nowrap;
  line-height: 1;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37,99,235,0.3);
}
.btn-primary:hover {
  background: var(--brand-primary-hover);
  box-shadow: 0 2px 6px rgba(37,99,235,0.4);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--brand-accent);
  color: #fff;
}
.btn-success:hover {
  background: var(--brand-accent-hover);
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}
.btn-warning:hover {
  background: var(--warning-hover);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: var(--danger-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 11px;
  border-radius: var(--radius-sm);
}

/* 向后兼容 — JS旧类名 */
.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.btn-upgrade {
  padding: 10px 24px;
  background: var(--warning);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  transition: all var(--duration-fast) var(--ease-out);
}
.btn-upgrade:hover {
  background: var(--warning-hover);
  transform: translateY(-1px);
}

/* =====================
   INPUTS & FORMS
   ===================== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all var(--duration-fast) var(--ease-out);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

input::placeholder {
  color: var(--text-tertiary);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
}

/* =====================
   CARDS
   ===================== */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-normal) var(--ease-out);
}

.card:hover {
  border-color: var(--text-tertiary);
  box-shadow: var(--shadow-md);
}

/* ---- Stat Cards ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-fast) var(--ease-out);
}

.stat-card:hover {
  border-color: var(--text-tertiary);
  box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
  font-size: 20px;
  margin-bottom: var(--space-xs);
}

.stat-card .num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card .num.green { color: var(--brand-accent); }
.stat-card .num.blue { color: var(--brand-primary); }
.stat-card .num.amber { color: var(--warning); }
.stat-card .num.red { color: var(--danger); }

.stat-card .label {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* =====================
   DEMAND CARDS (选品卡片)
   ===================== */
.demand-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: var(--space-md);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.demand-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background var(--duration-fast) var(--ease-out);
}

.demand-card:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 4px 16px rgba(37,99,235,0.1);
  transform: translateY(-1px);
}

.demand-card:hover::before {
  background: var(--brand-primary);
}

.demand-card .rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  text-align: center;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13px;
  margin-right: var(--space-md);
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.demand-card .rank.gold {
  background: linear-gradient(135deg, rgba(217,119,6,0.12), rgba(217,119,6,0.04));
  color: var(--warning);
  border: 1px solid rgba(217,119,6,0.15);
}

.demand-card .rank.silver {
  background: linear-gradient(135deg, rgba(156,163,175,0.12), rgba(156,163,175,0.04));
  color: var(--text-tertiary);
  border: 1px solid rgba(156,163,175,0.15);
}

.demand-card .rank.bronze {
  background: linear-gradient(135deg, rgba(180,130,80,0.12), rgba(180,130,80,0.04));
  color: #b48250;
  border: 1px solid rgba(180,130,80,0.15);
}

.demand-card .title-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.demand-card .title {
  color: var(--brand-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.4;
  flex: 1;
}

.demand-card .title:hover {
  color: var(--brand-primary-hover);
  text-decoration: underline;
}

.demand-card .score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-accent);
  flex-shrink: 0;
}

.demand-card .score-badge .score-label {
  font-size: 9px;
  color: var(--text-tertiary);
  font-weight: 400;
}

.demand-card .meta {
  margin-top: var(--space-sm);
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  align-items: center;
}

.demand-card .meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.demand-card .summary {
  margin-top: var(--space-sm);
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* =====================
   MODALS
   ===================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.modal.show {
  display: flex;
  animation: modalFadeIn 200ms var(--ease-out);
}

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

.modal-content {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 250ms var(--ease-out);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-lg);
}

.modal-content .modal-header h2,
.modal-content .modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.modal-content .close,
.modal-content .close-btn {
  float: right;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color var(--duration-fast);
}

.modal-content .close:hover,
.modal-content .close-btn:hover {
  color: var(--text-primary);
}

/* ---- Score Grid (detail modal) ---- */
.score-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.score-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
}

.score-item .dim {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
  font-weight: 500;
}

.score-item .val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.score-item .bar {
  margin-top: 6px;
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.score-item .bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease-out);
}

.bar-green { background: var(--brand-accent); }
.bar-blue { background: var(--brand-primary); }
.bar-amber { background: var(--warning); }
.bar-orange { background: #ea580c; }
.bar-red { background: var(--danger); }

/* ---- Handbook ---- */
.handbook {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
  font-size: 13px;
  line-height: 1.7;
}

.handbook h3, .handbook h4 {
  color: var(--brand-primary);
  margin: var(--space-md) 0 var(--space-sm);
}
.handbook h3:first-child, .handbook h4:first-child { margin-top: 0; }
.handbook p { margin: 4px 0; color: var(--text-secondary); }

/* =====================
   UPGRADE BANNER
   ===================== */
.upgrade-banner {
  background: linear-gradient(135deg, var(--warning-light), var(--bg-white));
  border: 1px solid rgba(217,119,6,0.25);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  margin-top: var(--space-xl);
}

.upgrade-banner h3 {
  color: var(--warning);
  margin-bottom: var(--space-sm);
  font-size: 15px;
}

.upgrade-banner p {
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
  font-size: 13px;
}

/* =====================
   EXPIRY BANNER
   ===================== */
.expiry-banner {
  background: linear-gradient(135deg, var(--warning-light), var(--bg-white));
  border: 1px solid rgba(217,119,6,0.25);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: var(--space-lg);
  display: none;
  align-items: center;
  gap: var(--space-lg);
}
.expiry-banner .icon { font-size: 24px; }
.expiry-banner .text { flex: 1; }
.expiry-banner .text h4 { color: var(--warning); font-size: 14px; margin-bottom: 2px; }
.expiry-banner .text p { color: var(--text-tertiary); font-size: 12px; margin: 0; }

.expiry-banner .btn-renew {
  padding: 6px 16px;
  background: var(--warning);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-out);
}
.expiry-banner .btn-renew:hover { background: var(--warning-hover); transform: translateY(-1px); }

.expiry-banner.expired {
  background: linear-gradient(135deg, var(--danger-light), var(--bg-white));
  border-color: rgba(220,38,38,0.25);
}
.expiry-banner.expired .text h4 { color: var(--danger); }
.expiry-banner.expired .btn-renew { background: var(--danger); }
.expiry-banner.expired .btn-renew:hover { background: var(--danger-hover); }

/* =====================
   TOAST
   ===================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  display: none;
  animation: toastSlideIn 250ms var(--ease-out);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-success {
  background: var(--brand-accent-light);
  color: var(--brand-accent);
  border: 1px solid rgba(5,150,105,0.25);
}
.toast-error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(220,38,38,0.2);
}
.toast-info {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  border: 1px solid rgba(37,99,235,0.2);
}

/* =====================
   LOADING & EMPTY STATES
   ===================== */
.loading {
  color: var(--text-tertiary);
  text-align: center;
  padding: var(--space-3xl);
  font-size: 14px;
}

.empty-state,
.empty {
  color: var(--text-tertiary);
  text-align: center;
  padding: 60px 20px;
  font-size: 14px;
}
.empty-state h3,
.empty h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  font-size: 16px;
}
.empty-state p,
.empty p {
  color: var(--text-tertiary);
}

/* =====================
   TABS
   ===================== */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 9px 18px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all var(--duration-fast) var(--ease-out);
  font-family: inherit;
}
.tab:hover { color: var(--text-secondary); }
.tab.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

/* =====================
   BROADCAST BAR
   ===================== */
.broadcast-bar {
  background: linear-gradient(135deg, var(--bg-page), var(--bg-white));
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
  overflow: hidden;
  position: relative;
  margin-bottom: var(--space-lg);
}

.broadcast-bar::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(to right, transparent, var(--bg-page));
  z-index: 1;
  pointer-events: none;
}

.broadcast-track {
  display: flex;
  animation: scroll-left 180s linear infinite;
  white-space: nowrap;
  width: max-content;
}
.broadcast-track:hover { animation-play-state: paused; }

.broadcast-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-tertiary);
  font-size: 12px;
  padding: 0 28px;
  flex-shrink: 0;
  cursor: default;
}
.broadcast-item .email { color: var(--brand-primary); font-weight: 600; }
.broadcast-item .action { color: var(--text-secondary); }
.broadcast-item .amount { color: var(--warning); font-weight: 600; }

@keyframes scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* =====================
   PAGINATION
   ===================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding: var(--space-md) 0;
}
.pagination .page-info { color: var(--text-tertiary); font-size: 12px; }

/* =====================
   TABLES
   ===================== */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

thead { background: var(--bg-elevated); }

th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

tr:hover td { background: var(--bg-elevated); }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
}
.badge-admin { background: var(--warning-dim); color: var(--warning); }
.badge-pro { background: var(--brand-accent-dim); color: var(--brand-accent); }
.badge-free { background: var(--bg-elevated); color: var(--text-tertiary); }

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: var(--space-lg);
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .main {
    margin-left: 0;
    padding: var(--space-lg);
  }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .score-grid { grid-template-columns: repeat(3, 1fr); }
  .page-header { flex-direction: column; align-items: flex-start; }
  .sidebar .nav a.active::before { display: none; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-content { padding: var(--space-lg); }
}
