/* ═══════════════════════════════════════════════════════
   Mid-States Scraper Dashboard — Design System
   ═══════════════════════════════════════════════════════ */

:root {
  /* Color palette — dark mode with blue/violet accents */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a2035;
  --bg-card-hover: #1f2847;
  --bg-input: #151b2e;
  --bg-sidebar: #0d1220;

  --border-primary: #1e293b;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(99, 102, 241, 0.3);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #818cf8;

  --accent-primary: #6366f1;
  --accent-primary-hover: #7c7ff7;
  --accent-glow: rgba(99, 102, 241, 0.15);

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

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --sidebar-width: 240px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--accent-glow);
}

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

html {
  font-size: 14px;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

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

a:hover {
  color: var(--accent-primary-hover);
}

button {
  cursor: pointer;
  font-family: inherit;
}

/* ─── Layout ─── */
#app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-primary);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 22px;
  color: var(--accent-primary);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.logo-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.logo-sub {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
  margin-top: 0;
  padding-left: 28px;
  letter-spacing: 0.2px;
}

.nav-links {
  list-style: none;
  padding: 12px 10px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13px;
  transition: all 0.2s ease;
  margin-bottom: 2px;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  color: var(--text-primary);
  background: var(--accent-glow);
  box-shadow: inset 3px 0 0 var(--accent-primary);
}

.nav-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-link.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-primary);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s;
}

.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.status-dot.disconnected {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

/* ─── Main Content ─── */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  background: var(--bg-primary);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── Stats Grid ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--stat-color, var(--accent-primary)), transparent);
  opacity: 0.6;
}

.stat-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Table ─── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  background: var(--bg-card);
}

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

thead th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-primary);
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}

tbody tr {
  transition: background 0.15s;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
}

.badge-muted {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 0 16px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

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

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-accent);
  color: var(--text-primary);
}

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

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-primary);
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

/* ─── Progress Bar ─── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-primary), #a78bfa);
  transition: width 0.5s ease;
}

/* ─── Grid ─── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

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

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state-text {
  font-size: 15px;
  font-weight: 500;
}

/* ─── Loader ─── */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 32px;
}

.loader-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: loaderPulse 1.2s ease-in-out infinite;
}

.loader-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.loader-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes loaderPulse {

  0%,
  80%,
  100% {
    transform: scale(0.5);
    opacity: 0.4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ─── Results Grid (Store × Product matrix) ─── */
.results-grid-wrapper {
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
}

.results-grid-wrapper table {
  font-size: 12px;
}

.results-grid-wrapper th,
.results-grid-wrapper td {
  padding: 6px 10px;
  white-space: nowrap;
  min-width: 80px;
}

.cell-yes {
  background: var(--success-bg);
  color: var(--success);
  font-weight: 600;
  text-align: center;
}

.cell-no {
  color: var(--text-muted);
  text-align: center;
}

.cell-error {
  background: var(--danger-bg);
  color: var(--danger);
  text-align: center;
}

/* ─── Run Detail Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  width: 90vw;
  max-width: 900px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.modal-close {
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.15s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0.5;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ─── Toolbar ─── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.search-input {
  flex: 1;
  max-width: 320px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ─── Mobile Sidebar Toggle (hidden on desktop) ─── */
#sidebarToggle {
  display: none;
}

#sidebarBackdrop {
  display: none;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  #sidebarToggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    z-index: 40;
    box-shadow: var(--shadow-sm);
    transition: background 0.2s, border-color 0.2s;
  }

  #sidebarToggle:hover,
  #sidebarToggle:focus-visible {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    outline: none;
  }

  /* Sidebar becomes an overlay that slides in from the left */
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 35;
    box-shadow: var(--shadow-lg);
  }

  #sidebar.open {
    transform: translateX(0);
  }

  #sidebarBackdrop.visible {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 30;
    animation: fadeIn 0.2s ease;
  }

  #content {
    padding: 64px 16px 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ─── Tooltip ─── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ─── Danger Button ─── */
.btn-danger {
  background: var(--danger);
  color: white;
}

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

/* ─── Header Actions ─── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─── Schedule Options ─── */
.schedule-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.schedule-option:hover {
  border-color: var(--border-accent);
  background: rgba(255, 255, 255, 0.02);
}

.schedule-option input[type="radio"] {
  accent-color: var(--accent-primary);
  width: 16px;
  height: 16px;
}

.schedule-option-content {
  display: flex;
  flex-direction: column;
}

.schedule-option-content strong {
  font-size: 13px;
  color: var(--text-primary);
}

.schedule-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: slideUp 0.3s ease;
}

/* ─── Active Run Banner ─── */
.active-run-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(167, 139, 250, 0.05));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: fadeIn 0.3s ease;
}

.active-run-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--accent-glow);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.active-run-info {
  flex: 1;
}

.active-run-title {
  font-size: 14px;
  font-weight: 600;
}

.active-run-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Tabs ─── */
.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-primary);
}

.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  margin-bottom: -1px;
}

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

.tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-primary);
}

/* ─── Detail List (key-value pairs) ─── */
.detail-list {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
  font-size: 13px;
}

.detail-label {
  color: var(--text-muted);
  font-weight: 500;
}

.detail-value {
  color: var(--text-primary);
}

/* ─── Running Status Dot ─── */
.status-dot.running {
  background: var(--accent-primary);
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.5);
  animation: statusPulse 1.5s ease-in-out infinite;
}

@keyframes statusPulse {

  0%,
  100% {
    box-shadow: 0 0 6px rgba(99, 102, 241, 0.3);
  }

  50% {
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.7);
  }
}

/* ─── Bar Chart (horizontal) ─── */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-label {
  width: 160px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  flex: 1;
  height: 20px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 0.6s ease;
  min-width: 2px;
}

.bar-value {
  width: 80px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* ─── Trend Chart (vertical bars) ─── */
.trend-chart {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  height: 200px;
  padding: 16px 8px 0;
}

.trend-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 60px;
  height: 100%;
  justify-content: flex-end;
}

.trend-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
  min-height: 4px;
}

.trend-label {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.trend-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── Mini Coverage Bar (in tables) ─── */
.mini-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ─── Form Inputs ─── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* ─── Danger Icon Button ─── */
.btn-icon-danger {
  color: var(--text-muted);
}

.btn-icon-danger:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-bg);
}

/* ─── Global Scraper Progress Banner ─── */
#globalRunBanner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  animation: bannerSlideDown 0.3s ease;
}

.global-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 28px;
  background: linear-gradient(135deg, #4338ca, #6366f1, #7c3aed);
  color: white;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  position: relative;
  overflow: hidden;
}

.global-banner-pulse {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: bannerPulse 2s ease-in-out infinite;
}

@keyframes bannerPulse {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

@keyframes bannerSlideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.global-banner-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.global-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 1;
}

.global-banner-text strong {
  font-size: 14px;
  font-weight: 700;
}

.global-banner-detail {
  font-size: 12px;
  opacity: 0.85;
}

.global-banner-actions {
  display: flex;
  gap: 8px;
  z-index: 1;
  flex-shrink: 0;
}

.global-banner-completed {
  background: linear-gradient(135deg, #166534, #16a34a, #22c55e) !important;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4) !important;
}

.global-banner-completed .global-banner-pulse {
  display: none;
}

.global-banner-cancelled {
  background: linear-gradient(135deg, #92400e, #d97706, #f59e0b) !important;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4) !important;
}

.global-banner-cancelled .global-banner-pulse {
  display: none;
}

.global-banner-failed {
  background: linear-gradient(135deg, #991b1b, #dc2626, #ef4444) !important;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4) !important;
}

.global-banner-failed .global-banner-pulse {
  display: none;
}
