/* ============================================
   R-Advertising Prospecting Agent — Design System
   ============================================ */

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

:root {
  /* Colors */
  --primary: #1E3A5F;
  --primary-light: #2A4F7F;
  --primary-dark: #152B47;
  --accent: #E8431A;
  --accent-light: #F06A42;
  --accent-dark: #C33812;
  --success: #2D7A4F;
  --success-light: #E6F4ED;
  --warning: #B85C00;
  --warning-light: #FFF3E0;
  --danger: #A0202A;
  --danger-light: #FDEDEF;

  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  --bg-page: #F5F6F8;
  --bg-card: #FFFFFF;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 16px;
  --text-lg: 20px;
  --text-xl: 24px;
  --text-2xl: 32px;

  /* Layout */
  --sidebar-width: 240px;
  --topbar-height: 56px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
}

html { font-size: 14px; }
body {
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--gray-800);
  background: var(--bg-page);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.sidebar {
  width: var(--sidebar-width);
  background: var(--primary);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.2s;
}

.sidebar-brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: var(--text-md);
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  gap: 10px;
}
.sidebar-brand span { color: var(--accent); }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.7);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.sidebar-nav a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  text-decoration: none;
}
.sidebar-nav a.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-right: 3px solid var(--accent);
}
.sidebar-nav a .nav-icon {
  width: 20px;
  text-align: center;
  font-size: var(--text-md);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.4);
}

.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--gray-500);
}
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--primary); text-decoration: none; }
.breadcrumb .separator { color: var(--gray-300); }
.breadcrumb .current { color: var(--gray-800); font-weight: 500; }

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

.main-content { padding: 24px; flex: 1; }

/* ---------- Typography ---------- */
h1 { font-size: var(--text-2xl); font-weight: 600; color: var(--gray-900); }
h2 { font-size: var(--text-xl); font-weight: 600; color: var(--gray-900); }
h3 { font-size: var(--text-lg); font-weight: 600; color: var(--gray-900); }
h4 { font-size: var(--text-md); font-weight: 600; color: var(--gray-800); }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header-left { display: flex; align-items: center; gap: 12px; }
.page-header .counter {
  background: var(--gray-100);
  color: var(--gray-600);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: var(--text-sm);
  font-weight: 500;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

/* Status badges */
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-blue { background: #DBEAFE; color: #1D4ED8; }
.badge-green { background: #DCFCE7; color: #15803D; }
.badge-red { background: #FEE2E2; color: #B91C1C; }
.badge-yellow { background: #FEF3C7; color: #92400E; }
.badge-purple { background: #F3E8FF; color: #7C3AED; }
.badge-teal { background: #CCFBF1; color: #0F766E; }
.badge-orange { background: #FFEDD5; color: #C2410C; }

/* Specific semantic badges */
.badge-status-uncrawled { background: var(--gray-100); color: var(--gray-600); }
.badge-status-running { background: #DBEAFE; color: #1D4ED8; }
.badge-status-success { background: #DCFCE7; color: #15803D; }
.badge-status-error { background: #FEE2E2; color: #B91C1C; }

.badge-ecommerce { background: #DCFCE7; color: #15803D; }
.badge-vitrine { background: var(--gray-100); color: var(--gray-600); }
.badge-inconnu { background: #FEF3C7; color: #92400E; }

.badge-b2b { background: #DBEAFE; color: #1D4ED8; }
.badge-b2c { background: #F3E8FF; color: #7C3AED; }
.badge-mixte { background: #CCFBF1; color: #0F766E; }

.badge-tpe { background: var(--gray-100); color: var(--gray-600); font-size: 11px; }
.badge-pme { background: #DBEAFE; color: #1D4ED8; font-size: 11px; }
.badge-eti { background: #FEF3C7; color: #92400E; font-size: 11px; }
.badge-ge { background: #F3E8FF; color: #7C3AED; font-size: 11px; }

.badge-cms {
  background: var(--gray-50);
  color: var(--gray-500);
  border: 1px solid var(--gray-200);
  font-size: 11px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font);
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }

/* Sizes */
.btn-sm { padding: 6px 12px; font-size: var(--text-xs); }
.btn-md { padding: 8px 16px; font-size: var(--text-sm); }
.btn-lg { padding: 10px 20px; font-size: var(--text-base); }

/* Variants */
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-light); }

.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-secondary:hover { background: var(--gray-200); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B82533; }

.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }

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

/* ---------- Form Inputs ---------- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 4px;
}
.form-hint {
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-top: 4px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 8px 12px;
  font-family: var(--font);
  font-size: var(--text-base);
  color: var(--gray-800);
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
}
.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(160,32,42,0.1);
}
.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background: var(--gray-50);
  color: var(--gray-400);
  cursor: not-allowed;
}

.form-textarea { min-height: 80px; resize: vertical; }

.form-search {
  padding-left: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239CA3AF' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

.form-error-msg {
  font-size: var(--text-xs);
  color: var(--danger);
  margin-top: 4px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3,
.card-header h4 { margin: 0; }
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Stat card */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-label {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-bottom: 4px;
}
.stat-card .stat-value {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--gray-900);
}
.stat-card .stat-sub {
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-top: 4px;
}
.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* ---------- Tables ---------- */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.table thead th {
  background: var(--gray-50);
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--gray-50); }
.table tbody tr.selected { background: #EFF6FF; }

.table .cell-main {
  font-weight: 500;
  color: var(--gray-900);
}

.table .actions {
  display: flex;
  gap: 4px;
}
.table .actions .btn { padding: 4px 8px; font-size: 12px; }

/* Checkbox in tables */
.table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--gray-100);
}
.pagination-info {
  font-size: var(--text-sm);
  color: var(--gray-500);
}
.pagination-buttons {
  display: flex;
  gap: 4px;
}
.pagination-buttons .btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}
.pagination-buttons .btn:hover { background: var(--gray-50); }
.pagination-buttons .btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- Filters ---------- */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
}
.filters-bar .form-group { margin-bottom: 0; }
.filters-bar .form-input,
.filters-bar .form-select { min-width: 160px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--gray-100);
  border-radius: 16px;
  font-size: var(--text-xs);
  color: var(--gray-700);
  cursor: pointer;
}
.chip.active { background: var(--primary); color: #fff; }
.chip .chip-remove {
  width: 14px; height: 14px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  cursor: pointer;
}
.chip .chip-remove:hover { background: rgba(0,0,0,0.1); }

/* ---------- Progress bar ---------- */
.progress {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}
.progress-bar-primary { background: var(--primary); }
.progress-bar-accent { background: var(--accent); }
.progress-bar-success { background: var(--success); }

.progress-sm { height: 6px; }
.progress-lg { height: 12px; }

/* Mini score bar */
.score-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  font-weight: 500;
}
.score-bar .progress { width: 60px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { margin: 0; }
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
  color: var(--gray-400);
  border-radius: var(--radius-sm);
  font-size: 18px;
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-600); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 280px;
  animation: slideIn 0.3s ease;
}
.toast-success { background: #DCFCE7; color: #15803D; border-left: 4px solid #15803D; }
.toast-error { background: #FEE2E2; color: #B91C1C; border-left: 4px solid #B91C1C; }
.toast-info { background: #DBEAFE; color: #1D4ED8; border-left: 4px solid #1D4ED8; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}
.empty-state h3 {
  color: var(--gray-600);
  margin-bottom: 8px;
}
.empty-state p {
  color: var(--gray-400);
  font-size: var(--text-sm);
  margin-bottom: 20px;
}

/* ---------- Loader / Spinner ---------- */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 36px; height: 36px; border-width: 4px; }

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

/* ---------- Tooltip ---------- */
.tooltip-wrapper {
  position: relative;
  display: inline-flex;
}
.tooltip-wrapper .tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-800);
  color: #fff;
  font-size: var(--text-xs);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  pointer-events: none;
}
.tooltip-wrapper .tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--gray-800);
}
.tooltip-wrapper:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--gray-200);
}
.timeline-item {
  position: relative;
  padding-bottom: 20px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-item .timeline-date {
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-bottom: 2px;
}
.timeline-item .timeline-text {
  font-size: var(--text-sm);
  color: var(--gray-700);
}

/* ---------- Log / Terminal ---------- */
.log-terminal {
  background: #1a1a2e;
  color: #c8d6e5;
  border-radius: var(--radius-lg);
  padding: 16px;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: var(--text-xs);
  line-height: 1.7;
  max-height: 300px;
  overflow-y: auto;
}
.log-terminal .log-line { display: flex; gap: 12px; }
.log-terminal .log-time { color: #636e72; min-width: 80px; }
.log-terminal .log-ok { color: #55efc4; }
.log-terminal .log-error { color: #ff7675; }
.log-terminal .log-info { color: #74b9ff; }
.log-terminal .log-warn { color: #ffeaa7; }

/* ---------- Score gauge (circle) ---------- */
.score-gauge {
  width: 120px;
  height: 120px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.score-gauge svg { transform: rotate(-90deg); }
.score-gauge .gauge-bg { fill: none; stroke: var(--gray-200); stroke-width: 8; }
.score-gauge .gauge-fill { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.5s; }
.score-gauge .gauge-text {
  position: absolute;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--gray-900);
}

/* ---------- Steps ---------- */
.steps {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
}
.step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  font-size: var(--text-sm);
  color: var(--gray-400);
  position: relative;
}
.step:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.step:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.step .step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--gray-200);
  color: var(--gray-500);
}
.step.active { background: #EFF6FF; border-color: #93C5FD; color: var(--primary); }
.step.active .step-num { background: var(--primary); color: #fff; }
.step.done { background: var(--success-light); border-color: #86EFAC; color: var(--success); }
.step.done .step-num { background: var(--success); color: #fff; }

/* ---------- Grids ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* ---------- Toggle switch ---------- */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  display: inline-block;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-300);
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--success); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ---------- Bulk actions bar ---------- */
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #EFF6FF;
  border-bottom: 1px solid #BFDBFE;
  font-size: var(--text-sm);
  color: var(--primary);
}
.bulk-actions .bulk-count { font-weight: 600; }

/* ---------- Section spacing ---------- */
.section { margin-bottom: 24px; }
.section-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 12px;
}

/* ---------- Detail header ---------- */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.detail-header-left { display: flex; flex-direction: column; gap: 8px; }
.detail-header-left h1 { line-height: 1.2; }
.detail-header-badges { display: flex; gap: 6px; }
.detail-header-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Info grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.info-item label {
  display: block;
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.info-item span {
  font-size: var(--text-sm);
  color: var(--gray-800);
  font-weight: 500;
}

/* ---------- Slider input ---------- */
.form-range {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--gray-200);
  border-radius: 3px;
  outline: none;
}
.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .filters-bar { flex-direction: column; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }

  .menu-toggle { display: flex !important; }
}

.menu-toggle {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  background: none; border: none;
  cursor: pointer;
  color: var(--gray-600);
  font-size: 20px;
}

/* ---------- Dropdown menu ---------- */
.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 50;
  padding: 4px 0;
}
.dropdown-menu.active { display: block; }
.dropdown-menu a,
.dropdown-menu button {
  display: block;
  width: 100%;
  padding: 8px 14px;
  font-size: var(--text-sm);
  font-family: var(--font);
  color: var(--gray-700);
  text-decoration: none;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}
.dropdown-menu a:hover,
.dropdown-menu button:hover { background: var(--gray-50); text-decoration: none; }

/* ---------- Utility ---------- */
.text-muted { color: var(--gray-500); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { color: var(--primary); cursor: pointer; }
.link:hover { text-decoration: underline; }
