/* ════════════════════════════════════════════════════════════════════
   prerendered.io Customer Dashboard — Design System v2
   Corporate-grade dark UI · Unified with Admin · Every detail
   ════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens (shared with admin) ── */
:root {
  --bg:            #0a0b10;
  --surface:       #0f1117;
  --surface-2:     #13151e;
  --surface-3:     #1a1c28;
  --surface-hover: #1f2133;

  --border:        #1e2235;
  --border-hover:  #282d45;
  --border-active: #323856;

  --text:          #e2e8f0;
  --text-dim:      #8892a8;
  --text-muted:    #5f6a84;

  --primary:       #6366f1;
  --primary-hover: #818cf8;
  --primary-ghost: rgba(99, 102, 241, 0.08);
  --primary-ring:  rgba(99, 102, 241, 0.25);

  --success:       #4ade80;
  --warning:       #fbbf24;
  --danger:        #f87171;
  --info:          #6366f1;

  --shadow-xs:     0 1px 2px rgba(0,0,0,0.24);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md:     0 4px 6px -1px rgba(0,0,0,0.35), 0 2px 4px -2px rgba(0,0,0,0.2);
  --shadow-lg:     0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.25);
  --shadow-overlay:0 25px 50px -12px rgba(0,0,0,0.55);

  --radius-xs:     4px;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     14px;
  --radius-xl:     20px;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px;

  --transition:      150ms ease;
  --transition-slow: 250ms ease;
  --ease-out:        cubic-bezier(0.16, 1, 0.3, 1);

  --bg-input:        var(--surface-2);
}


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

::selection {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.14); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.07) transparent; }


/* ── Typography ── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 14px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  letter-spacing: -0.025em;
  color: var(--text);
}

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

code {
  font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}


/* ════════════════════════════════════════════════════════════════════
   Auth Pages (Login / Signup / Forgot / Reset)
   ════════════════════════════════════════════════════════════════════ */

.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--sp-6);
  background:
    radial-gradient(ellipse 600px 400px at 50% 40%, rgba(99,102,241,0.06) 0%, transparent 70%),
    var(--bg);
}

.auth-box {
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: var(--sp-10) var(--sp-8);
  width: 420px;
  max-width: 100%;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.03);
  animation: authReveal 0.4s var(--ease-out) both;
}

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

.auth-links {
  text-align: center;
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
}

.auth-links a {
  color: var(--text-dim);
  margin: 0 var(--sp-3);
  transition: color var(--transition);
  font-weight: 500;
}

.auth-links a:hover {
  color: var(--primary);
}

.auth-message {
  text-align: center;
  padding: var(--sp-6) 0;
}

.auth-message h3 {
  margin-bottom: var(--sp-3);
  letter-spacing: -0.02em;
  font-size: 1.1rem;
}

.auth-message p {
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.6;
}


/* ════════════════════════════════════════════════════════════════════
   Brand
   ════════════════════════════════════════════════════════════════════ */

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  user-select: none;
  white-space: nowrap;
}

.logo-lg {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: var(--sp-8);
}

.logo-sub {
  font-weight: 400;
  font-size: 0.82em;
  color: var(--text-dim);
}


/* ════════════════════════════════════════════════════════════════════
   Forms
   ════════════════════════════════════════════════════════════════════ */

input, select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: var(--sp-3) var(--sp-3);
  font-size: 0.85rem;
  font-family: inherit;
  width: 100%;
  height: 40px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

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

input:hover, select:hover, textarea:hover {
  border-color: var(--border-hover);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
  background: var(--surface-3);
}

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

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  vertical-align: middle;
}

input[readonly] {
  opacity: 0.7;
  cursor: default;
}

input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2371717a' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5l-5-5h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.form-group {
  margin-bottom: var(--sp-5);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-error {
  color: var(--danger);
  font-size: 0.84rem;
  margin-top: var(--sp-3);
  text-align: center;
  display: none;
  font-weight: 500;
}

.form-success {
  color: var(--success);
  font-size: 0.84rem;
  margin-top: var(--sp-3);
  text-align: center;
  display: none;
  font-weight: 500;
}

/* Taller CTA on auth pages */
.auth-box button[type="submit"] {
  height: 42px;
  font-size: 0.88rem;
  margin-top: var(--sp-2);
}


/* ════════════════════════════════════════════════════════════════════
   Buttons
   ════════════════════════════════════════════════════════════════════ */

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 36px;
  padding: 0 var(--sp-4);
  font-size: 0.84rem;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: -0.01em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}

button:hover {
  background: var(--surface-3);
  border-color: var(--border-hover);
  transform: translateY(-0.5px);
}

button:active {
  transform: translateY(0.5px);
}

button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.btn-primary {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

.btn-danger {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--danger);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.5);
}

.btn-sm {
  height: 30px;
  padding: 0 var(--sp-3);
  font-size: 0.78rem;
}


/* ════════════════════════════════════════════════════════════════════
   App Layout
   ════════════════════════════════════════════════════════════════════ */

.app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--sp-8) 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* ════════════════════════════════════════════════════════════════════
   Header — sticky, frosted glass
   ════════════════════════════════════════════════════════════════════ */

header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-8);
  margin: 0 calc(-1 * var(--sp-8));
  margin-bottom: var(--sp-5);
  background: rgba(9, 9, 11, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
}


/* ════════════════════════════════════════════════════════════════════
   Navigation Tabs
   ════════════════════════════════════════════════════════════════════ */

#nav {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-6);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#nav::-webkit-scrollbar {
  display: none;
}

#nav {
  scrollbar-width: none;
}

#nav button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  padding: var(--sp-3) var(--sp-5);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  white-space: nowrap;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-bottom: -1px;
}

#nav button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

#nav button.active {
  color: var(--text);
  border-bottom-color: var(--primary);
  font-weight: 600;
}



/* ════════════════════════════════════════════════════════════════════
   Cards
   ════════════════════════════════════════════════════════════════════ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-slow);
}

.card:hover {
  border-color: var(--border-hover);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.card-title {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}


/* ════════════════════════════════════════════════════════════════════
   Stats Grid (Customer)
   ════════════════════════════════════════════════════════════════════ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.stats-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-5) var(--sp-4);
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  border-color: var(--border-hover);
}

.stat-card[onclick], .stat-card[style*="cursor:pointer"] {
  cursor: pointer;
}

.stat-card[onclick]:hover, .stat-card[style*="cursor:pointer"]:hover {
  border-color: var(--primary-ring);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  transition: all var(--transition);
}

.stat-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-card-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.stat-card-sub {
  font-size: 0.6rem;
  color: var(--text-dim);
  opacity: 0.7;
  margin-top: 2px;
}


/* ════════════════════════════════════════════════════════════════════
   Section Dividers
   ════════════════════════════════════════════════════════════════════ */

.section-divider {
  display: flex;
  align-items: center;
  margin: var(--sp-8) 0 var(--sp-5);
  gap: var(--sp-4);
}

.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-title {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}


/* ════════════════════════════════════════════════════════════════════
   Side-by-Side Panels
   ════════════════════════════════════════════════════════════════════ */

.side-by-side {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-4);
}

.side-by-side-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.side-card {
  min-height: 120px;
}


/* ════════════════════════════════════════════════════════════════════
   Usage Bar
   ════════════════════════════════════════════════════════════════════ */

.usage-section {
  margin-bottom: var(--sp-5);
}

.usage-bar-outer {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  height: 20px;
  overflow: hidden;
  margin: var(--sp-3) 0;
}

.usage-bar-inner {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-md);
  transition: width 0.4s ease;
}

.usage-bar-inner.warning {
  background: var(--warning);
}

.usage-bar-inner.danger {
  background: var(--danger);
}

.usage-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}


/* ════════════════════════════════════════════════════════════════════
   Plan Badges
   ════════════════════════════════════════════════════════════════════ */

.plan-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  font-size: 0.65rem;
  padding: 0 var(--sp-3);
  border-radius: var(--radius-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.plan-free {
  background: var(--primary-ghost);
  color: var(--primary);
}

.plan-starter {
  background: rgba(52, 211, 153, 0.10);
  color: var(--success);
}

.plan-pro {
  background: rgba(251, 191, 36, 0.10);
  color: var(--warning);
}

.plan-business {
  background: rgba(248, 113, 113, 0.10);
  color: var(--danger);
}

.plan-agency {
  background: rgba(139, 92, 246, 0.10);
  color: #a78bfa;
}

.plan-operator {
  background: rgba(239, 68, 68, 0.10);
  color: #ef4444;
}


/* ════════════════════════════════════════════════════════════════════
   Domain List
   ════════════════════════════════════════════════════════════════════ */

.domain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-3);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  margin: 0 calc(-1 * var(--sp-3));
  border-radius: var(--radius-sm);
}

.domain-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

.domain-name {
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}

.domain-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.domain-status {
  font-size: 0.68rem;
  padding: 2px var(--sp-2);
  border-radius: var(--radius-xs);
  font-weight: 700;
}

.status-verified {
  background: rgba(52, 211, 153, 0.10);
  color: var(--success);
}

.status-pending {
  background: rgba(251, 191, 36, 0.10);
  color: var(--warning);
}


/* ════════════════════════════════════════════════════════════════════
   Sites Page — Header, Cards, Detail
   ════════════════════════════════════════════════════════════════════ */

.sites-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--sp-5);
}

.sites-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.sites-subtitle {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.sites-empty {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.sites-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.sites-empty h3 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.sites-empty p {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Site cards grid */
.site-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.site-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform 80ms ease;
}

.site-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary-ring);
  transform: translateY(-1px);
}

.site-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.site-card-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.site-card-dot.live {
  background: var(--success);
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.4);
}

.site-card-dot.pending {
  background: var(--warning);
}

.site-card-domain {
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.site-card-badge {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.site-card-badge.verified {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
}

.site-card-badge.pending {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warning);
}

.site-card-origin {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
}

.site-card-stat {
  text-align: center;
}

.site-card-stat-val {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.site-card-stat-lbl {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.site-card-footer {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: right;
}

.site-card-verify {
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.78rem;
  color: var(--warning);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Domain detail redesign */
.detail-back-row {
  margin-bottom: var(--sp-4);
}

.detail-back-link {
  color: var(--text-dim);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color var(--transition);
}

.detail-back-link:hover {
  color: var(--primary);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.detail-domain-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.detail-origin {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.detail-actions {
  display: flex;
  gap: var(--sp-2);
  flex-shrink: 0;
  align-items: center;
}

.btn-danger-ghost {
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: var(--danger);
}

.btn-danger-ghost:hover {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.4);
}

.detail-verify-banner {
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: var(--sp-4);
  font-size: 0.82rem;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: var(--sp-4);
}

.detail-metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}

.detail-metric-val {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.detail-metric-lbl {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.detail-metric-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.detail-top-bots {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: var(--sp-4);
}

.detail-top-bots-lbl {
  color: var(--text-muted);
}

.detail-bot-chip {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 10px;
  margin: 2px 3px;
  font-size: 0.72rem;
}

.detail-bot-count {
  color: var(--text-muted);
  font-size: 0.65rem;
}


/* ════════════════════════════════════════════════════════════════════
   Bot Overview — Line Chart Cards
   ════════════════════════════════════════════════════════════════════ */

/* Summary bar at top */
.bot-overview-summary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-5);
}

.bot-overview-stats {
  display: flex;
  gap: var(--sp-8);
  margin-bottom: var(--sp-4);
}

.bot-overview-stats > div {
  display: flex;
  flex-direction: column;
}

.bos-value {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.bos-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.bot-overview-chart-wrap {
  border-top: 1px solid var(--border);
  padding-top: var(--sp-3);
}

/* Per-company card */
/* Bot mini card grid (compact view) */
.bot-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: var(--sp-4);
}

.bot-mini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.bot-mini-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.bot-mini-card.bot-mini-active {
  border-color: var(--primary);
  background: var(--primary-ghost);
}

.bot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-3);
  transition: border-color var(--transition-slow);
}

.bot-card:hover {
  border-color: var(--border-hover);
}

.bot-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-4);
}

.bot-card-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.bot-card-arrow {
  font-size: 0.6rem;
  color: var(--text-dim);
  transition: transform 0.2s ease;
  display: inline-block;
  width: 12px;
}

.bot-card-arrow.expanded {
  transform: rotate(90deg);
}

.bot-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.bot-card-count {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 500;
}

.bot-card-total {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}

.bot-card-total-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: 4px;
}

.bot-card-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: var(--sp-2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

.bot-meta-sep {
  margin: 0 4px;
  color: var(--text-muted);
}

.bot-card-chart {
  margin-top: var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
}

/* Line chart */
.line-chart-wrap {
  position: relative;
}

.bot-line-chart {
  display: block;
  width: 100%;
  overflow: visible;
}

.bot-line-chart .chart-dot {
  transition: opacity 0.15s ease;
}

.bot-line-chart:hover .chart-dot {
  opacity: 0.6 !important;
}

.bot-line-chart .chart-dot:hover {
  opacity: 1 !important;
  r: 3 !important;
}

.chart-date-labels {
  position: relative;
  height: 18px;
  margin-top: 4px;
}

.chart-date-labels span {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.62rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* First label aligns left, last aligns right to avoid overflow */
.chart-date-labels span:first-child {
  transform: translateX(0);
}

.chart-date-labels span:last-child {
  transform: translateX(-100%);
}

/* Children (expanded sub-bots) */
.bot-card-children {
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

.bot-child-row {
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}

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

.bot-child-info {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.bot-child-name {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.bot-child-meta {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.bot-child-chart {
  /* Uses compact=true in buildLineChart for smaller height */
}

/* Shared (still used in live activity, top bots, etc.) */
.bot-name {
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.bot-meta {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.bot-category {
  display: inline-block;
  font-size: 0.58rem;
  padding: 1px var(--sp-2);
  border-radius: var(--radius-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: var(--sp-2);
  vertical-align: middle;
}


/* ════════════════════════════════════════════════════════════════════
   Days Selector
   ════════════════════════════════════════════════════════════════════ */

.days-selector {
  display: flex;
  gap: var(--sp-1);
  margin-bottom: var(--sp-3);
}

.days-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-dim);
  padding: var(--sp-1) var(--sp-3);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  height: 26px;
}

.days-btn:hover {
  border-color: var(--text-dim);
  color: var(--text);
  transform: translateY(-0.5px);
}

.days-btn.active {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}


/* ════════════════════════════════════════════════════════════════════
   Live Activity Feed
   ════════════════════════════════════════════════════════════════════ */

.live-feed {
  max-height: 300px;
  overflow-y: auto;
}

.live-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  transition: background var(--transition);
}

.live-item:last-child {
  border-bottom: none;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 4px currentColor;
}

.live-time {
  font-size: 0.7rem;
  color: var(--text-dim);
  min-width: 58px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
}

.live-path {
  color: var(--text-dim);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}


/* ════════════════════════════════════════════════════════════════════
   Mission Control (Crawler Grid)
   ════════════════════════════════════════════════════════════════════ */

.crawler-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-3);
}

.crawler-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-4) var(--sp-5);
  transition: border-color var(--transition);
}

.crawler-card:hover {
  border-color: var(--border-hover);
}

.crawler-domain {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: var(--sp-1);
  letter-spacing: -0.01em;
}

.crawler-meta {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.crawler-progress {
  margin-top: var(--sp-3);
  background: var(--bg);
  border-radius: var(--radius-xs);
  height: 4px;
  overflow: hidden;
}

.crawler-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-xs);
  transition: width 0.5s ease;
}

.crawler-status-active {
  color: var(--success);
  font-weight: 700;
}

.crawler-status-queued {
  color: var(--warning);
  font-weight: 700;
}


/* ════════════════════════════════════════════════════════════════════
   Horizontal Bar Charts
   ════════════════════════════════════════════════════════════════════ */

.hbar-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-2);
  font-size: 0.8rem;
  transition: background var(--transition);
  margin: 0 calc(-1 * var(--sp-2));
  border-radius: var(--radius-xs);
}

.hbar-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.hbar-label {
  min-width: 130px;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 500;
}

.hbar-flag {
  margin-right: var(--sp-1);
}

.hbar-track {
  flex: 1;
  background: var(--surface-2);
  border-radius: var(--radius-xs);
  height: 14px;
  overflow: hidden;
  min-width: 0;
}

.hbar-fill {
  height: 100%;
  border-radius: var(--radius-xs);
  transition: width 0.4s ease;
}

.hbar-count {
  min-width: 44px;
  text-align: right;
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--text-dim);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}


/* ════════════════════════════════════════════════════════════════════
   Top Tables
   ════════════════════════════════════════════════════════════════════ */

.top-table {
  width: 100%;
  font-size: 0.82rem;
  border-collapse: collapse;
}

.top-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  padding: var(--sp-3) var(--sp-3);
  border-bottom: 1px solid var(--border-hover);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.top-table td {
  padding: var(--sp-3) var(--sp-3);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.top-table tbody tr {
  transition: background var(--transition);
}

.top-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.top-table .rank {
  color: var(--text-muted);
  font-size: 0.68rem;
  width: 24px;
  font-weight: 600;
}

.top-table .truncate {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ════════════════════════════════════════════════════════════════════
   Log Table
   ════════════════════════════════════════════════════════════════════ */

.log-table {
  width: 100%;
  font-size: 0.82rem;
  border-collapse: collapse;
  table-layout: fixed;
}

.log-table .truncate {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  padding: var(--sp-3) var(--sp-3);
  border-bottom: 1px solid var(--border-hover);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}

.log-table td {
  padding: var(--sp-3) var(--sp-3);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.log-table tbody tr {
  transition: background var(--transition);
}

.log-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}


/* ════════════════════════════════════════════════════════════════════
   Stat Rows (key-value pairs)
   ════════════════════════════════════════════════════════════════════ */

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}

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

.stat-label {
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 500;
}

.stat-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}


/* ════════════════════════════════════════════════════════════════════
   Log Charts (Bot Activity / Visitor Traffic)
   ════════════════════════════════════════════════════════════════════ */

.chart-timeline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 90px;
}

.chart-tbar {
  flex: 1;
  min-width: 0;
  border-radius: 2px 2px 0 0;
  transition: height 0.3s ease, opacity var(--transition);
  position: relative;
}

.chart-tbar:hover {
  opacity: 0.75;
}

.chart-labels {
  display: flex;
  gap: 2px;
}

.chart-labels span {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 0.58rem;
  color: var(--text-muted);
  padding-top: var(--sp-2);
  font-variant-numeric: tabular-nums;
}

.log-stats {
  display: flex;
  gap: var(--sp-6);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.log-stat {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
}

.log-stat .ls-val {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.log-stat .ls-lbl {
  font-size: 0.63rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.status-stack {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--sp-3);
  background: var(--surface-2);
}

.status-stack-seg {
  transition: width 0.5s ease;
}

.status-legend {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  font-size: 0.72rem;
}

.status-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}


/* ════════════════════════════════════════════════════════════════════
   Modals
   ════════════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: overlayIn 200ms ease both;
}

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

.modal {
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  width: 480px;
  max-width: 92vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-overlay), 0 0 0 1px rgba(255,255,255,0.04);
  animation: modalIn 250ms var(--ease-out) both;
}

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

.modal h2 {
  font-size: 1.05rem;
  margin-bottom: var(--sp-5);
  letter-spacing: -0.02em;
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.modal-actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
}


/* ════════════════════════════════════════════════════════════════════
   Verify Instructions
   ════════════════════════════════════════════════════════════════════ */

.verify-box {
  background: var(--primary-ghost);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  margin-top: var(--sp-5);
}

.verify-box h3 {
  font-size: 0.9rem;
  margin-bottom: var(--sp-3);
  letter-spacing: -0.01em;
}

.verify-box p {
  font-size: 0.84rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.verify-code {
  display: block;
  background: var(--bg);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
  word-break: break-all;
  color: var(--primary);
  border: 1px solid var(--border);
  margin: var(--sp-3) 0;
}


/* ════════════════════════════════════════════════════════════════════
   Badges
   ════════════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 var(--sp-2);
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-success {
  background: rgba(52, 211, 153, 0.10);
  color: var(--success);
}

.badge-warning {
  background: rgba(251, 191, 36, 0.10);
  color: var(--warning);
}

.badge-danger {
  background: rgba(248, 113, 113, 0.10);
  color: var(--danger);
}

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


/* ════════════════════════════════════════════════════════════════════
   Toast Notifications
   ════════════════════════════════════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: var(--sp-8);
  right: var(--sp-8);
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-6);
  font-size: 0.84rem;
  font-weight: 500;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: toastIn 300ms var(--ease-out) both;
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

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


/* ════════════════════════════════════════════════════════════════════
   Empty State
   ════════════════════════════════════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: var(--sp-10) var(--sp-6);
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}


/* ════════════════════════════════════════════════════════════════════
   Detail Expand Rows (Bot Activity / Visitor Traffic)
   ════════════════════════════════════════════════════════════════════ */

.detail-expand {
  background: var(--surface-2);
  border-top: 1px solid var(--border-hover);
  border-bottom: 1px solid var(--border-hover);
  padding: var(--sp-5) var(--sp-6);
  animation: detailSlide 200ms var(--ease-out) both;
}

@keyframes detailSlide {
  from { opacity: 0; max-height: 0; padding: 0 var(--sp-6); }
  to   { opacity: 1; max-height: 400px; }
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4) var(--sp-8);
}

.detail-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.detail-value {
  display: block;
  font-size: 0.84rem;
  color: var(--text);
}

.row-active td {
  background: rgba(99, 102, 241, 0.04) !important;
  border-bottom-color: var(--border-hover) !important;
}

.bot-log-row:hover td,
.access-log-row:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* IP hover indicator */
.le-ip {
  transition: color var(--transition), border-color var(--transition);
}

.le-ip:hover {
  color: var(--primary) !important;
  border-bottom-color: var(--primary) !important;
}


/* ════════════════════════════════════════════════════════════════════
   Bot Tooltip
   ════════════════════════════════════════════════════════════════════ */

.bot-tooltip {
  position: fixed;
  background: var(--surface-3);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.72rem;
  color: var(--text);
  pointer-events: none;
  z-index: 90;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  line-height: 1.5;
}


/* ════════════════════════════════════════════════════════════════════
   Utilities
   ════════════════════════════════════════════════════════════════════ */

.flex { display: flex; align-items: center; }
.gap-sm { gap: var(--sp-2); }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 0.84rem; }

/* ════════════════════════════════════════════════════════════════════
   Responsive
   ════════════════════════════════════════════════════════════════════ */

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

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

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

  .bot-overview-stats {
    gap: var(--sp-4);
  }

  .bot-card-header {
    flex-direction: column;
    gap: var(--sp-2);
  }

  .bot-card-name {
    font-size: 0.85rem;
  }

  .modal {
    width: 95vw;
    padding: var(--sp-6);
  }

  .app {
    padding: 0 var(--sp-4) 0;
  }

  header {
    margin-left: calc(-1 * var(--sp-4));
    margin-right: calc(-1 * var(--sp-4));
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }

  .hbar-label {
    min-width: 90px;
    max-width: 110px;
  }
}

@media (max-width: 640px) {
  .auth-box {
    padding: var(--sp-6);
  }

  header {
    flex-direction: column;
    gap: var(--sp-3);
  }

  .domain-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
  }

  .card-header {
    flex-direction: column;
    gap: var(--sp-3);
    align-items: flex-start;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-card-value {
    font-size: 1.2rem;
  }

  .bot-identity {
    min-width: 80px;
    max-width: 100px;
  }

  .bot-timeline {
    height: 24px;
  }

  .hbar-label {
    min-width: 70px;
    max-width: 90px;
  }

  /* Nav tabs: horizontal scroll on mobile */
  #nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    scrollbar-width: none;
  }
  #nav::-webkit-scrollbar { display: none; }
  #nav button { flex-shrink: 0; }

  /* Account page: single column */
  .account-cards { grid-template-columns: 1fr; }
  .account-hero { flex-direction: column; text-align: center; }
  .account-hero > div:last-child { margin-left: 0; text-align: center; }

  /* Tab summaries: stack on mobile */
  .tab-summaries { grid-template-columns: 1fr; }

  /* Domain cards: single column */
  .domain-cards { grid-template-columns: 1fr; }

  /* Site cards: single column */
  .site-cards { grid-template-columns: 1fr; }
  .site-card-stats { grid-template-columns: repeat(2, 1fr); }

  /* Detail: stack actions */
  .detail-header { flex-direction: column; }
  .detail-actions { flex-wrap: wrap; }
  .detail-metrics { grid-template-columns: repeat(2, 1fr); }

  /* Filter bar: wrap nicely */
  .filter-bar { gap: 8px; }
  .filter-group select, .filter-group input { min-width: 100px; }
  .filter-search { min-width: 120px; }

  /* Setup guide code blocks: smaller text */
  .setup-code { font-size: 0.7rem; }

}


/* ════════════════════════════════════════════════════════════════════
   Cookie Consent Banner
   ════════════════════════════════════════════════════════════════════ */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
  padding: var(--sp-4) var(--sp-6);
  animation: slideUp 0.3s var(--ease-out);
}

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

.cookie-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.cookie-inner p {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.cookie-actions {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-shrink: 0;
}

.cookie-link {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: underline;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .cookie-inner {
    flex-direction: column;
    text-align: center;
  }
  .cookie-actions {
    justify-content: center;
  }
}


/* ════════════════════════════════════════════════════════════════════
   Setup Guide
   ════════════════════════════════════════════════════════════════════ */

.setup-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-3);
  overflow: hidden;
  transition: border-color var(--transition);
}

.setup-section:hover {
  border-color: var(--border-hover);
}

.setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer;
  gap: var(--sp-4);
}

.setup-header:hover {
  background: var(--surface-hover);
}

.setup-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.setup-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.setup-arrow {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.setup-section.expanded .setup-arrow {
  transform: rotate(180deg);
}

.setup-body {
  display: none;
  padding: 0 var(--sp-5) var(--sp-5);
}

.setup-section.expanded .setup-body {
  display: block;
}

.setup-code-wrap {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.setup-copy {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  padding: 2px 10px;
  font-size: 0.7rem;
  background: var(--surface-3);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  z-index: 1;
  transition: all var(--transition);
}

.setup-copy:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.setup-code {
  padding: var(--sp-4);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-dim);
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}

/* ═══════════════════════════════════════
   BILLING
   ═══════════════════════════════════════ */

.billing-current { margin-bottom: 0; }
.billing-current .card { padding: var(--sp-5); }

.billing-current-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--sp-5);
}

.billing-current-plan {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

.billing-sub-status {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.billing-usage-section {
  margin-bottom: var(--sp-5);
}

.billing-usage-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: var(--sp-4);
}

.billing-meter {
  margin-bottom: var(--sp-3);
}

.billing-meter-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}

.billing-meter-header strong {
  color: var(--text);
}

.billing-meter-track {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.billing-meter-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.billing-meter-pct {
  font-size: 0.72rem;
  margin-top: 0.2rem;
  font-weight: 600;
}

.billing-cost-breakdown {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
}

.billing-cost-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-dim);
  padding: 0.35rem 0;
}

.billing-cost-row + .billing-cost-row {
  border-top: 1px solid var(--border);
}

.billing-cost-row span:last-child {
  font-weight: 600;
  color: var(--text);
}

/* Plan comparison grid */
.billing-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--sp-3);
}

.billing-plan-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}

.billing-plan-card:hover {
  border-color: var(--text-dim);
}

.billing-plan-active {
  border-color: var(--primary);
  background: var(--surface-2);
}

.billing-plan-upgrade:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.billing-plan-header {
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}

.billing-plan-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.billing-plan-price {
  font-size: 1.6rem;
  font-weight: 800;
}

.billing-plan-price span {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-dim);
}

.billing-plan-features {
  flex: 1;
  margin-bottom: var(--sp-3);
}

.billing-feature {
  font-size: 0.78rem;
  color: var(--text-dim);
  padding: 0.3rem 0;
}

.billing-feature + .billing-feature {
  border-top: 1px solid var(--border);
}

.billing-feature-val {
  color: var(--text);
  font-weight: 600;
}

.billing-plan-action {
  margin-top: auto;
  text-align: center;
}

.billing-plan-current {
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
  padding: 0.5rem 0;
}

.billing-plan-btn {
  width: 100%;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
}

.billing-plan-btn-down {
  width: 100%;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.billing-plan-btn-down:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.billing-plan-savings {
  font-size: 0.7rem;
  color: var(--success);
  margin-top: 0.4rem;
  text-align: center;
}

/* Billing FAQ */
.billing-faq {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}

.billing-faq-item {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
}

.billing-faq-item h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.billing-faq-item p {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .billing-plans-grid { grid-template-columns: 1fr; }
  .billing-faq { grid-template-columns: 1fr; }
  .billing-current-header { flex-direction: column; gap: 0.75rem; }
}


/* ── Dashboard Pyramid ── */

/* Health banner at very top */
.dash-health {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.dash-health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-health-text {
  font-size: 0.85rem;
  font-weight: 500;
}

.dash-health-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-left: auto;
}

/* Domain cards grid */
.domain-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}

.domain-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.domain-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.domain-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.domain-card-name {
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-card-badge {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.domain-card-badge.verified {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
}

.domain-card-badge.pending {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warning);
}

.domain-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.domain-card-metric {
  text-align: center;
}

.domain-card-metric-value {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.domain-card-metric-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Bottom row of domain card: errors + last crawl */
.domain-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Tab summary strip */
.tab-summaries {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 1.5rem;
}

.tab-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}

.tab-summary-card:hover {
  border-color: var(--primary-ring);
  background: var(--surface-hover);
}

.tab-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.tab-summary-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tab-summary-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.tab-summary-card:hover .tab-summary-arrow {
  transform: translateX(3px);
  color: var(--primary);
}

.tab-summary-body {
  font-size: 0.8rem;
  line-height: 1.5;
}

.tab-summary-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.tab-summary-stat-value {
  font-weight: 700;
  font-size: 0.85rem;
}

.tab-summary-stat-label {
  color: var(--text-dim);
  font-size: 0.72rem;
}

/* Mini usage bar inside summary card */
.mini-usage-bar {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.mini-usage-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 300ms ease;
}

/* ── Tab Context Bar (pyramid back-navigation) ── */
.tab-context-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

.tab-context-back {
  color: var(--text-dim);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
  white-space: nowrap;
}

.tab-context-back:hover {
  color: var(--primary);
}

.tab-context-sep {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.tab-context-title {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.tab-context-metrics {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text-dim);
  font-size: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tab-context-metrics .ctx-metric {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.tab-context-metrics .ctx-val {
  font-weight: 700;
  color: var(--text);
}

/* ── Account page styles ── */
.account-hero {
  background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(139,92,246,0.06) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.account-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  text-transform: uppercase;
}

.account-info h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.account-info .account-email {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.account-info .account-since {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.account-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1rem;
}

/* ── Timeline Legend ── */
.timeline-legend {
  display: flex;
  gap: 12px;
  font-size: 0.65rem;
  color: var(--text-dim);
}
.timeline-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.timeline-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  font-style: normal;
}

.stacked-bar {
  transition: opacity 0.15s ease;
}
.stacked-bar:hover {
  opacity: 0.8 !important;
}

/* ── Log Filter Bars ── */
.log-filters { margin-bottom: 0; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.filter-group label {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.filter-group select,
.filter-group input {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 0.8rem;
  min-width: 120px;
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--primary);
  outline: none;
}

.filter-search { flex: 1; min-width: 150px; }
.filter-search input { width: 100%; }

.filter-clear {
  align-self: flex-end;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.filter-active-count {
  font-size: 0.7rem;
  color: var(--primary);
  font-weight: 600;
  padding: 2px 6px;
  background: rgba(99,102,241,0.1);
  border-radius: 4px;
  margin-left: auto;
  align-self: center;
}

/* ── App Footer ── */
.app-footer {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: auto;
  border-top: 1px solid var(--border);
}
.app-footer a { color: var(--text-dim); }
.app-footer a:hover { color: var(--primary); }
