/* ============================================================
   Paid Sites Scraper — Portal Design System
   ============================================================ */

:root {
  --sidebar-bg: #0c1222;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(99, 102, 241, 0.18);
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #e0e7ff;
  --brand: #6366f1;
  --brand-dark: #4f46e5;
  --brand-glow: rgba(99, 102, 241, 0.35);
  --surface: #ffffff;
  --page-bg: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --radius: 0.875rem;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---- App shell ---- */
.app-body {
  min-height: 100vh;
  background: var(--page-bg);
}

.main-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.08), transparent),
    var(--page-bg);
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

@media (min-width: 1024px) {
  .main-content { padding: 1.75rem 2rem 2.5rem; }
}

/* ---- Sidebar ---- */
.sidebar {
  display: none;
  width: 16.5rem;
  flex-shrink: 0;
  flex-direction: column;
  background: linear-gradient(180deg, #0f172a 0%, #0c1222 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

@media (min-width: 1024px) {
  .sidebar { display: flex; }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px var(--brand-glow);
}

.sidebar-brand-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.sidebar-brand-sub {
  font-size: 0.6875rem;
  color: var(--sidebar-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all 0.15s ease;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}

.sidebar-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.25);
}

.sidebar-link svg {
  width: 1.25rem;
  height: 1.25rem;
  opacity: 0.85;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--sidebar-text);
  text-decoration: none;
}

.sidebar-footer a:hover { color: #c7d2fe; }

/* ---- Top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

@media (min-width: 1024px) {
  .topbar { padding: 0.75rem 2rem; }
}

.page-heading h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
  margin: 0;
}

.page-subtitle {
  margin: 0.125rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem 0.375rem 0.375rem;
  border-radius: 9999px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.user-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
}

.logout-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.375rem 0.625rem;
  border-radius: 0.5rem;
  transition: background 0.15s;
}

.logout-link:hover {
  background: #f1f5f9;
  color: var(--text);
}

.mobile-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.mobile-nav a {
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  background: #f1f5f9;
  color: #475569;
}

.mobile-nav a.active {
  background: var(--brand);
  color: #fff;
}

.menu-btn {
  padding: 0.5rem;
  border: none;
  background: #f1f5f9;
  border-radius: 0.5rem;
  color: #475569;
  cursor: pointer;
}

@media (min-width: 1024px) {
  .menu-btn { display: none; }
}

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border-radius: 0.625rem;
  background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
  padding: 0.5625rem 1.125rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 8px var(--brand-glow), var(--shadow-sm);
  transition: transform 0.1s, box-shadow 0.15s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--brand-glow);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border-radius: 0.625rem;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.5625rem 1.125rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.625rem;
  background: linear-gradient(180deg, #ef4444, #dc2626);
  padding: 0.5625rem 1.125rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-sm {
  display: inline-flex;
  align-items: center;
  border-radius: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-sm.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-sm.btn-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

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

.btn-sm.btn-ghost:hover { background: #f8fafc; }

/* ---- Cards & stats ---- */
.card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.card-body { padding: 1.5rem; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5,1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-grid2 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1200px) {
    .stat-grid2 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .stat-grid2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stat-grid2 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 640px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1280px) {
  .stat-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
  .stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}

.stat-card {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1.25rem 1.25rem 1.25rem 1.375rem;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

.stat-card.accent-green::before { background: linear-gradient(180deg, #34d399, #10b981); }
.stat-card.accent-slate::before { background: linear-gradient(180deg, #94a3b8, #64748b); }
.stat-card.accent-blue::before { background: linear-gradient(180deg, #60a5fa, #3b82f6); }
.stat-card.accent-purple::before { background: linear-gradient(180deg, #a78bfa, #8b5cf6); }
.stat-card.accent-amber::before { background: linear-gradient(180deg, #fbbf24, #f59e0b); }

.stat-card-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.stat-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.green { background: #ecfdf5; color: #059669; }
.stat-icon.slate { background: #f1f5f9; color: #64748b; }
.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }

.stat-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  margin-top: 0.375rem;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-hint {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---- Action bar ---- */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ---- Tables ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead {
  background: #f8fafc;
}

.data-table th {
  padding: 0.875rem 1.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.12s;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

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

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 9999px;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-green { background: #d1fae5; color: #047857; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #ede9fe; color: #6d28d9; }

.pulse-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: #10b981;
  animation: portal-pulse 2s ease-in-out infinite;
}

@keyframes portal-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.site-name { font-weight: 600; color: var(--text); }
.site-slug {
  display: block;
  font-family: ui-monospace, monospace;
  font-size: 0.6875rem;
  color: #94a3b8;
  margin-top: 0.125rem;
}

/* ---- Forms ---- */
.field-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}

.field-input {
  width: 100%;
  border-radius: 0.625rem;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-input {
  min-width: 12rem;
  border-radius: 0.625rem;
  border: 1px solid var(--border);
  padding: 0.5rem 0.875rem 0.5rem 2.25rem;
  font-size: 0.875rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") 0.625rem center / 1rem no-repeat;
}

.filter-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
}

.filter-panel .field-group {flex:1; min-width: 10rem; }
.filter-actions {
  display: flex;
  gap: 0.625rem;
  flex-shrink: 0;
}
/* ---- Log viewer ---- */
.log-viewer {
  max-height: 28rem;
  overflow: auto;
  margin: 0;
  padding: 1.25rem 1.5rem;
  background: #0f172a;
  color: #e2e8f0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  font-size: 0.75rem;
  color: #94a3b8;
}

.log-terminal { border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }

/* ---- Login page ---- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .login-page { grid-template-columns: 1.1fr 1fr; }
}

.login-hero {
  display: none;
  position: relative;
  padding: 3rem;
  background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 45%, #312e81 100%);
  color: #fff;
  overflow: hidden;
}

@media (min-width: 900px) {
  .login-hero { display: flex; flex-direction: column; justify-content: space-between; }
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.4), transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(168, 85, 247, 0.3), transparent 40%);
  pointer-events: none;
}

.login-hero-content { position: relative; z-index: 1; }

.login-hero h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 1.5rem 0 0.75rem;
}

.login-hero p {
  font-size: 1rem;
  color: #c7d2fe;
  line-height: 1.6;
  max-width: 24rem;
}

.login-features {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  backdrop-filter: blur(8px);
}

.login-feature-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-feature span {
  font-size: 0.875rem;
  font-weight: 500;
  color: #e0e7ff;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: #f8fafc;
}

.login-form-wrap {
  width: 100%;
  max-width: 26rem;
}

.login-form-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-form-header .mobile-logo {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 24px var(--brand-glow);
}

@media (min-width: 900px) {
  .login-form-header .mobile-logo { display: none; }
}

.login-form-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  margin: 0;
}

.login-form-header p {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.input-group { margin-bottom: 1.25rem; }

.input-wrap {
  position: relative;
}

.input-wrap svg {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.125rem;
  height: 1.125rem;
  color: #94a3b8;
  pointer-events: none;
}

.input-wrap .field-input {
  padding-left: 2.75rem;
}

.alert-error {
  margin-bottom: 1.25rem;
  padding: 0.875rem 1rem;
  border-radius: 0.625rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.875rem;
  font-weight: 500;
}

.btn-login {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.9375rem;
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state svg {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  opacity: 0.4;
}

/* ---- Toast ---- */
.portal-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  padding: 0.875rem 1.25rem;
  border-radius: 0.75rem;
  background: #0f172a;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.portal-toast.show { opacity: 1; }

.htmx-request.btn-primary,
.htmx-request.btn-secondary { opacity: 0.7; cursor: wait; }

.link-brand {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}

.link-brand:hover { color: var(--brand-dark); }

.text-success { color: #059669; }
.text-danger { color: #dc2626; }
.text-muted { color: var(--text-muted); }

/* ---- Dashboard (distinct from Sites page) ---- */
.dash-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 8px 32px rgba(79, 70, 229, 0.35);
}

.dash-hero-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dash-hero-desc {
  margin: 0.375rem 0 0;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 28rem;
}

.dash-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.dash-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
  .dash-metrics { grid-template-columns: repeat(5, 1fr); }
}

.dash-metric-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 1.125rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.dash-metric-num {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.dash-metric-lbl {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.dash-progress-wrap {
  margin-bottom: 1.5rem;
  padding: 1.125rem 1.25rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.dash-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.625rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.dash-progress-track {
  height: 0.625rem;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.dash-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.dash-layout {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 1024px) {
  .dash-layout { grid-template-columns: 1fr 18rem; }
}

.dash-workers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.875rem;
  padding: 1.25rem 1.5rem 1.5rem;
}

.dash-worker-card {
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.dash-worker-card:hover {
  border-color: #a5b4fc;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.dash-worker-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.625rem;
}

.dash-worker-name {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text);
}

.dash-worker-slug {
  font-family: ui-monospace, monospace;
  font-size: 0.6875rem;
  color: #94a3b8;
  margin-top: 0.125rem;
}

.dash-worker-actions {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.875rem;
}

.dash-empty-workers {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.dash-empty-workers p {
  margin: 0.75rem 0 1rem;
  font-size: 0.9375rem;
}

.dash-idle-list {
  padding: 0.5rem 0;
}

.dash-idle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.dash-idle-row:last-child { border-bottom: none; }

.dash-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1rem;
}

.dash-panel-title {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.dash-health-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-health-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.dash-health-list li:last-child { border-bottom: none; }

.dash-metric {
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--brand);
}

.dash-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
}

.dash-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 0.875rem 0.5rem;
  border-radius: 0.625rem;
  border: 1px solid #f1f5f9;
  background: #f8fafc;
  text-decoration: none;
  transition: all 0.15s;
}

.dash-tile:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  transform: translateY(-2px);
}

.dash-tile-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
}

.dash-tile-icon.blue { background: #dbeafe; color: #2563eb; }
.dash-tile-icon.purple { background: #ede9fe; color: #7c3aed; }
.dash-tile-icon.slate { background: #f1f5f9; color: #475569; }
.dash-tile-icon.green { background: #d1fae5; color: #059669; }
.dash-tile-icon.amber { background: #fef3c7; color: #d97706; }
.dash-tile-icon.indigo { background: #e0e7ff; color: #4338ca; }

.dash-tile-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}


.run-btn,
.log-btn,
.download-btn {
    width: 90px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.download-btn {
    width: 45px;
}