/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-page:    #F7F8FA;
  --bg-card:    #FFFFFF;
  --bg-sidebar: #FFFFFF;
  --bg-input:   #FFFFFF;
  --bg-hover:   #F0F4FF;
  --bg-active:  #EEF2FF;

  /* Borders */
  --border-subtle: #E8EAED;
  --border-input:  #D1D5DB;
  --border-focus:  #3B5BDB;

  /* Text */
  --text-primary:   #111827;
  --text-secondary: #6B7280;
  --text-tertiary:  #9CA3AF;
  --text-link:      #3B5BDB;

  /* Accent */
  --accent:       #3B5BDB;
  --accent-hover: #3451C7;
  --accent-light: #EEF2FF;

  /* Status badges — soft pastels */
  --status-review-bg:       #EEF2FF;
  --status-review-text:     #3B5BDB;
  --status-draft-bg:        #F3F4F6;
  --status-draft-text:      #6B7280;
  --status-generating-bg:   #FFF7ED;
  --status-generating-text: #C2410C;
  --status-complete-bg:     #F0FDF4;
  --status-complete-text:   #15803D;

  /* Shadows */
  --shadow-card:       0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.08);

  /* Radius */
  --radius-sm:    6px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --radius-badge: 20px;
  --radius:       8px; /* legacy alias */

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Legacy vars referenced in JS inline styles */
  --primary:      #3B5BDB;
  --primary-light:#3451C7;
  --text-muted:   #6B7280;
  --text:         #111827;
  --bg-grey:      #F7F8FA;
  --border:       #E8EAED;
  --accent-approve: #16A34A;
  --accent-reject:  #DC2626;
  --accent-enrich:  #3B5BDB;
  --bg:           #FFFFFF;
  --bg-card:      #FFFFFF;
  --shadow:       0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.layout, .app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 16px 10px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-logo {
  padding: 8px 10px 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}

.sidebar-logo .logo-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  line-height: 1.3;
}

.sidebar-logo .logo-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

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

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

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

.sidebar-nav a.active {
  background: var(--bg-active);
  color: var(--accent);
}

.sidebar-nav .nav-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
}

.sidebar-bottom {
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.btn-logout, .signout-btn {
  width: 100%;
  padding: 8px 10px;
  background: none;
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.btn-logout:hover, .signout-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ── Main content ──────────────────────────────────────────────────────────── */
.main-content {
  margin-left: 220px;
  flex: 1;
  padding: var(--space-xl) var(--space-xl) var(--space-xl);
  min-height: 100vh;
  overflow-x: clip; /* clip without creating a scroll container — preserves sticky column positioning */
}

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

.page-header h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.page-header .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-body {
  flex: 1;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border: 1px solid transparent;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  text-decoration: none;
  color: white;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-input);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.btn-danger {
  background: none;
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
}

.btn-danger:hover:not(:disabled) {
  color: #DC2626;
  border-color: #FCA5A5;
  background: #FFF5F5;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline:hover:not(:disabled) {
  background: var(--accent-light);
}

.btn-approve {
  background: #F0FDF4;
  color: #15803D;
  border: 1px solid #86EFAC;
  padding: 4px 10px;
  font-size: 12px;
}

.btn-approve:hover:not(:disabled) {
  background: #DCFCE7;
}

.btn-reject {
  background: #FFF5F5;
  color: #DC2626;
  border: 1px solid #FCA5A5;
  padding: 4px 10px;
  font-size: 12px;
}

.btn-reject:hover:not(:disabled) {
  background: #FEE2E2;
}

.btn-enrich {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid #C7D2FE;
  padding: 4px 10px;
  font-size: 12px;
}

.btn-enrich:hover:not(:disabled) {
  background: #C7D2FE;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* ── Campaign grid ─────────────────────────────────────────────────────────── */
.campaign-grid, .campaigns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
}

/* ── Campaign card ─────────────────────────────────────────────────────────── */
.campaign-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.campaign-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: #C7D2FE;
}

.campaign-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

/* Support both old (.campaign-card-title) and new (.campaign-name) class names */
.campaign-card-title, .campaign-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  line-height: 1.3;
}

.campaign-card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.campaign-card-meta span {
  font-size: 12px;
  color: var(--text-secondary);
}

.campaign-card-meta strong {
  color: var(--text-secondary);
  font-weight: 500;
}

.campaign-card-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.stat-chip {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
}

.stat-chip strong {
  color: var(--text-primary);
  font-weight: 600;
}

.campaign-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 2px;
}

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--radius-badge);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0;
  text-transform: none;
}

.badge-draft     { background: #F3F4F6; color: #6B7280; }
.badge-generating{ background: #FFF7ED; color: #C2410C; }
.badge-review    { background: #EEF2FF; color: #3B5BDB; }
.badge-enriching { background: #F5F3FF; color: #7C3AED; }
.badge-complete  { background: #F0FDF4; color: #15803D; }
.badge-pending   { background: #F3F4F6; color: #6B7280; }
.badge-approved  { background: #F0FDF4; color: #15803D; }
.badge-rejected  { background: #FFF5F5; color: #DC2626; }
.badge-enriched  { background: #EEF2FF; color: #3B5BDB; }

/* Confidence text colours */
.conf-high      { color: #15803D; font-weight: 500; }
.conf-medium    { color: #C2410C; font-weight: 500; }
.conf-low       { color: #DC2626; font-weight: 500; }
.conf-guessed   { color: #DC2626; font-weight: 500; }
.conf-not_found { color: var(--text-tertiary); }

/* ── Tables ────────────────────────────────────────────────────────────────── */
.table-wrap, .table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: var(--bg-page);
  color: var(--text-secondary);
  padding: 10px 13px;
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-subtle);
  text-transform: none;
  letter-spacing: 0;
}

tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background: #FAFAFA;
}

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

tbody tr.row-approved td { background: #F0FDF4 !important; }
tbody tr.row-approved:hover td { background: #DCFCE7 !important; }
tbody tr.row-rejected td { background: #FFF5F5 !important; opacity: 0.75; }
tbody tr.row-rejected:hover td { background: #FEE2E2 !important; }
tbody tr.row-enriched td { background: #EEF2FF !important; }
tbody tr.row-enriched:hover td { background: #E0E7FF !important; }
tbody tr.row-duplicate td { background: #FAFAFA !important; opacity: 0.65; }
tbody tr.row-duplicate:hover td { background: #F3F4F6 !important; }

td {
  padding: 10px 13px;
  vertical-align: middle;
  color: var(--text-primary);
}

td.truncate {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td.wrap-cell {
  white-space: nowrap;
  overflow: visible;
  vertical-align: middle;
}

td a {
  color: var(--accent);
  text-decoration: none;
}

td a:hover {
  text-decoration: underline;
}

.actions-cell {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
  align-items: center;
}

/* ── Stats row ─────────────────────────────────────────────────────────────── */
.stats-row {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

/* Support both .stat-box (existing) and .stat-card (new) */
.stat-box, .stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 90px;
  box-shadow: var(--shadow-card);
}

.stat-box .stat-num, .stat-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}

.stat-box .stat-label, .stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Tabs ──────────────────────────────────────────────────────────────────── */
/* Support both .tabs (existing) and .tab-bar (new) */
.tabs, .tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-lg);
}

.tab-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ── Section header ────────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.section-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Info bar ──────────────────────────────────────────────────────────────── */
.info-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
  font-size: 13px;
  color: var(--text-secondary);
  box-shadow: var(--shadow-card);
}

.info-bar strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl);
  max-width: 700px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 0;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0;
  text-transform: none;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0;
}

.form-input,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  padding: 8px 11px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  width: 100%;
}

.form-input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59,91,219,0.1);
}

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

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

/* ── Back link ─────────────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: var(--space-md);
  transition: color 0.15s;
}

.back-link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

/* ── Login ─────────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 380px;
  max-width: 94vw;
  box-shadow: var(--shadow-card-hover);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .logo-main {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.login-logo .logo-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.login-card .form-group {
  margin-bottom: 14px;
}

.login-card .btn-primary,
.login-card .btn.btn-primary {
  width: 100%;
  justify-content: center;
  padding: 10px;
  font-size: 14px;
  margin-top: 8px;
}

.error-msg {
  background: #FFF5F5;
  border: 1px solid #FCA5A5;
  color: #DC2626;
  border-radius: var(--radius-md);
  padding: 9px 13px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}

.error-msg.show {
  display: block;
}

/* ── Loading overlay ───────────────────────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.loading-overlay.show {
  display: flex;
}

.loading-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  text-align: center;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.loading-sub {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  background: var(--text-primary);
  color: white;
  border-radius: var(--radius-md);
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 500;
  max-width: 320px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  animation: slide-in 0.2s ease;
}

.toast.success { background: #15803D; }
.toast.error   { background: #DC2626; }
.toast.info    { background: var(--text-primary); }

@keyframes slide-in {
  from { transform: translateX(16px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(2px);
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  width: 500px;
  max-width: 95vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-tertiary);
  line-height: 1;
  padding: 2px;
  transition: color 0.15s;
}

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

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

/* ── Score chip ────────────────────────────────────────────────────────────── */
.score-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
}

.score-high   { background: #F0FDF4; color: #15803D; }
.score-medium { background: #FEF9C3; color: #854D0E; }
.score-low    { background: #FFF5F5; color: #DC2626; }

/* ── Notes inline ──────────────────────────────────────────────────────────── */
.notes-field {
  display: none;
  margin-top: 6px;
}

.notes-field.open {
  display: block;
}

.notes-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
  min-height: 50px;
  background: var(--bg-input);
}

/* ── Progress bar ──────────────────────────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--border-subtle);
  border-radius: 20px;
  height: 6px;
  overflow: hidden;
  width: 200px;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 20px;
  transition: width 0.3s;
}

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-secondary);
}

.empty-state .empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

/* ── Card (generic) ────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
}

/* ── Pagination ────────────────────────────────────────────────────────────── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 10px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.pagination-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 16px;
  transition: background 0.15s;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-hover);
}

.pagination-btn:disabled {
  color: var(--text-tertiary);
  cursor: not-allowed;
}

/* ── Links ─────────────────────────────────────────────────────────────────── */
a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Toggle (do-not-contact) ───────────────────────────────────────────────── */
.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #D1D5DB;
  border-radius: 20px;
  transition: 0.2s;
}

.toggle-slider:before {
  position: absolute;
  content: '';
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: #DC2626;
}

.toggle input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

/* ── Checkboxes ────────────────────────────────────────────────────────────── */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid #D1D5DB;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  flex-shrink: 0;
}

input[type="checkbox"]:checked {
  background: #3B5BDB;
  border-color: #3B5BDB;
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="checkbox"]:disabled {
  background: #F3F4F6;
  border-color: #E5E7EB;
  cursor: not-allowed;
}

input[type="checkbox"]:disabled:checked {
  background: #D1D5DB;
  border-color: #D1D5DB;
}

input[type="checkbox"]:indeterminate {
  background: #3B5BDB;
  border-color: #3B5BDB;
}

input[type="checkbox"]:indeterminate::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 6.5px;
  width: 8px;
  height: 2px;
  background: white;
  border: none;
  transform: none;
}

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

/* ── Utilities ─────────────────────────────────────────────────────────────── */
.text-muted, .text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-small { font-size: 12px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
