/* ============================================================
   Aura300 — Automation Tests UI
   Professional design system (dark + light).
   Violet identity, refined. Every --variable and class name
   referenced by the inline view scripts is preserved across
   both themes; new components are additive.
   ============================================================ */

/* ── Theme tokens ─────────────────────────────────────── */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:        #090a0e;
  --bg-grad:
    radial-gradient(1100px 620px at 90% -12%, rgba(124,109,250,0.16), transparent 60%),
    radial-gradient(820px 520px at -8% 2%, rgba(96,165,250,0.09), transparent 58%),
    radial-gradient(620px 620px at 50% 120%, rgba(139,123,255,0.06), transparent 60%);
  --surface:   #14161c;
  --surface2:  #1b1e26;
  --surface3:  #232630;
  --border:    #282c36;
  --border-strong: #383d4a;
  --border-subtle: #1d2027;
  --text:      #edeff5;
  --muted:     #8b909c;
  --faint:     #626977;
  --accent:    #8b7bff;
  --accent-strong: #7c6dfa;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(139,123,255,0.15);
  --accent-glow: rgba(124,109,250,0.38);

  --pass:     #34d399;
  --fail:     #f87171;
  --warn:     #fbbf24;
  --skip:     #9ca3af;
  --info:     #60a5fa;

  /* Semantic tinted surfaces */
  --pass-bg:  rgba(52,211,153,0.13);
  --fail-bg:  rgba(248,113,113,0.13);
  --warn-bg:  rgba(251,191,36,0.13);
  --info-bg:  rgba(96,165,250,0.13);

  --critical-bg:  rgba(248,113,113,0.10);
  --warning-bg:   rgba(251,191,36,0.10);
  --all-clear-bg: rgba(52,211,153,0.10);

  --code-bg:   #08090c;
  --code-text: #a5c8ff;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.44), 0 1px 1px rgba(0,0,0,0.30);
  --shadow-md: 0 2px 6px rgba(0,0,0,0.34), 0 10px 28px rgba(0,0,0,0.40);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.40), 0 28px 64px rgba(0,0,0,0.55);

  --radius:    13px;
  --radius-sm: 9px;
  --radius-lg: 18px;

  --skeleton-1: #1b1e26;
  --skeleton-2: #23272f;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Cascadia Code", ui-monospace, "Courier New", Courier, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg:        #f1f3f8;
  --bg-grad:
    radial-gradient(1100px 620px at 90% -12%, rgba(124,109,250,0.13), transparent 60%),
    radial-gradient(820px 520px at -8% 2%, rgba(96,165,250,0.11), transparent 58%),
    radial-gradient(620px 620px at 50% 120%, rgba(139,123,255,0.05), transparent 60%);
  --surface:   #ffffff;
  --surface2:  #f2f4f8;
  --surface3:  #e6e9f1;
  --border:    #dde0e9;
  --border-strong: #c6ccd7;
  --border-subtle: #ebedf3;
  --text:      #161922;
  --muted:     #64707f;
  --faint:     #97a0ad;
  --accent:    #6d5cf5;
  --accent-strong: #5b48f0;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(109,92,245,0.11);
  --accent-glow: rgba(109,92,245,0.26);

  --pass:     #15a34a;
  --fail:     #dc2626;
  --warn:     #d97706;
  --skip:     #6b7280;
  --info:     #2563eb;

  --pass-bg:  rgba(21,163,74,0.11);
  --fail-bg:  rgba(220,38,38,0.09);
  --warn-bg:  rgba(217,119,6,0.11);
  --info-bg:  rgba(37,99,235,0.09);

  --critical-bg:  rgba(220,38,38,0.07);
  --warning-bg:   rgba(217,119,6,0.10);
  --all-clear-bg: rgba(21,163,74,0.09);

  --code-bg:   #f5f6fa;
  --code-text: #1e40af;

  --shadow-sm: 0 1px 2px rgba(16,24,40,0.06), 0 1px 1px rgba(16,24,40,0.04);
  --shadow-md: 0 2px 6px rgba(16,24,40,0.06), 0 12px 28px rgba(16,24,40,0.10);
  --shadow-lg: 0 10px 30px rgba(16,24,40,0.12), 0 30px 60px rgba(16,24,40,0.16);

  --skeleton-1: #e9ecf3;
  --skeleton-2: #f4f6fa;
}

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

html, body {
  margin: 0; padding: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: var(--accent); text-decoration: none; transition: color 0.12s; }
a:hover { text-decoration: underline; }

code, pre, .mono { font-family: var(--font-mono); }

/* Numeric alignment in tables, latency, ids, tokens. */
.mono, .lat-label, .run-id, .step-table td, .settings-table td, table.af td {
  font-variant-numeric: tabular-nums;
}

::selection { background: var(--accent-soft); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Motion ──────────────────────────────────────────── */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
main { animation: fade-in-up 0.32s cubic-bezier(0.22,0.61,0.36,1) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ── Nav ─────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 58px;
  box-shadow: var(--shadow-sm);
}
nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  margin-right: 22px;
  letter-spacing: 1.8px;
  background: linear-gradient(120deg, var(--accent), #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
nav .brand::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 3px;
  background: linear-gradient(140deg, var(--accent), #c4b5fd);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 14px var(--accent-glow);
  -webkit-text-fill-color: initial;
  transform: rotate(45deg);
}
nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
/* Nav icons — masked so they inherit link color. */
nav a::before {
  content: "";
  width: 15px; height: 15px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
  opacity: 0.85;
}
#nav-dashboard::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1.5'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1.5'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1.5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1.5'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1.5'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1.5'/%3E%3C/svg%3E"); }
#nav-history::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v5h5'/%3E%3Cpath d='M3.05 13A9 9 0 1 0 6 5.3L3 8'/%3E%3Cpath d='M12 7v5l4 2'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v5h5'/%3E%3Cpath d='M3.05 13A9 9 0 1 0 6 5.3L3 8'/%3E%3Cpath d='M12 7v5l4 2'/%3E%3C/svg%3E"); }
#nav-runner::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='6 3 20 12 6 21 6 3'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='6 3 20 12 6 21 6 3'/%3E%3C/svg%3E"); }
#nav-autofix::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18v3h3l6.3-6.3a4 4 0 0 0 5.4-5.4l-2.5 2.5-2.5-.6-.6-2.5z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18v3h3l6.3-6.3a4 4 0 0 0 5.4-5.4l-2.5 2.5-2.5-.6-.6-2.5z'/%3E%3C/svg%3E"); }
#nav-settings::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E"); }
nav a:hover { color: var(--text); background: var(--surface2); text-decoration: none; }
nav a.active { color: var(--accent); background: var(--accent-soft); }
nav a.active::after {
  content: "";
  position: absolute;
  left: 13px; right: 13px;
  bottom: -10px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ── Theme toggle ────────────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.theme-toggle:active { transform: translateY(0); }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: inline; }
:root[data-theme="light"] .theme-toggle .icon-sun  { display: inline; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ── Layout ──────────────────────────────────────────── */
main { padding: 32px 24px 56px; max-width: 1400px; margin: 0 auto; }
h1 {
  font-size: 23px;
  font-weight: 750;
  margin: 0 0 24px;
  color: var(--text);
  letter-spacing: -0.02em;
}
h2 {
  font-size: 12px;
  font-weight: 650;
  margin: 0 0 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Scenario category groups (settings/runner checkboxes, dashboard cards) ── */
.scenario-group { margin-bottom: 12px; }
.scenario-group:last-child { margin-bottom: 0; }
.scenario-group-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

/* ── Suite sections (dashboard: daily + weekly panels) ── */
.suite-section { margin-bottom: 40px; }
.suite-section + .suite-section {
  border-top: 1px solid var(--border);
  padding-top: 28px;
}
.suite-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.suite-title h2 { margin: 0; font-size: 14px; color: var(--text); }
.suite-desc { font-size: 11px; color: var(--muted); }

/* ── Stat tiles (dashboard KPIs) ─────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
@media (max-width: 860px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.stat:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.8;
}
.stat.pass::before { background: var(--pass); }
.stat.fail::before { background: var(--fail); }
.stat.warn::before { background: var(--warn); }
.stat.info::before { background: var(--info); }
.stat-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  margin-bottom: 8px;
}
.stat-value {
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-value .unit { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stat.pass .stat-value { color: var(--pass); }
.stat.fail .stat-value { color: var(--fail); }
.stat.warn .stat-value { color: var(--warn); }
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ── Empty state ─────────────────────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 56px 24px;
  color: var(--muted);
}
.empty .empty-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 22px;
  margin-bottom: 2px;
}
.empty .empty-title { font-size: 14px; font-weight: 650; color: var(--text); }
.empty .empty-hint { font-size: 12px; color: var(--muted); max-width: 380px; }

/* ── Skeleton loaders ────────────────────────────────── */
@keyframes skeleton-shimmer { 100% { background-position: -200% 0; } }
.skeleton {
  background: linear-gradient(90deg, var(--skeleton-1) 0%, var(--skeleton-2) 40%, var(--skeleton-1) 80%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.3s ease-in-out infinite;
  border-radius: 6px;
}
.skel-card {
  height: 52px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.skel-line { height: 12px; border-radius: 6px; margin: 8px 0; }
.skel-stat { height: 92px; border-radius: var(--radius); border: 1px solid var(--border); }

/* ── Status banner ───────────────────────────────────── */
.status-banner {
  position: relative;
  border-radius: var(--radius);
  padding: 16px 22px 16px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 650;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.status-banner::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}
.status-banner.critical { background: var(--critical-bg);  border: 1px solid color-mix(in srgb, var(--fail) 45%, transparent); color: var(--fail); }
.status-banner.warning  { background: var(--warning-bg);   border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); color: var(--warn); }
.status-banner.ok       { background: var(--all-clear-bg); border: 1px solid color-mix(in srgb, var(--pass) 45%, transparent); color: var(--pass); }
.status-banner.critical::before { background: var(--fail); }
.status-banner.warning::before  { background: var(--warn); }
.status-banner.ok::before       { background: var(--pass); }
.status-banner .sub { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: auto; text-align: right; }

/* ── Severity pills ──────────────────────────────────── */
.sev {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.4;
  vertical-align: middle;
}
.sev.CRITICAL { background: var(--fail-bg); color: var(--fail);  border: 1px solid color-mix(in srgb, var(--fail) 40%, transparent); }
.sev.WARNING  { background: var(--warn-bg); color: var(--warn);  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.sev.INFO     { background: var(--info-bg); color: var(--info);  border: 1px solid color-mix(in srgb, var(--info) 40%, transparent); }

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius);
  transition: background 0.12s;
}
.card-header:hover { background: var(--surface2); border-radius: var(--radius) var(--radius) 0 0; }
.card-header strong { letter-spacing: -0.01em; }
.card-body {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: none;
}
.card-body.open { display: block; }
.chevron {
  color: var(--faint);
  font-size: 10px;
  transition: transform 0.18s ease, color 0.15s;
  margin-left: auto;
  flex-shrink: 0;
}
.card-header:hover .chevron { color: var(--muted); }
.chevron.open { transform: rotate(90deg); }

/* ── CRM dot ─────────────────────────────────────────── */
.crm-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 0%, transparent);
}
.crm-dot.GetTimely     { background: #7c6dfa; box-shadow: 0 0 8px rgba(124,109,250,0.55); }
.crm-dot.ClientDiary   { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.5); }
.crm-dot.AesthetiDocs  { background: #3b82f6; box-shadow: 0 0 8px rgba(59,130,246,0.5); }
.crm-dot.Barespace     { background: #f59e0b; box-shadow: 0 0 8px rgba(245,158,11,0.5); }
.crm-dot.Trybe         { background: #ec4899; box-shadow: 0 0 8px rgba(236,72,153,0.5); }
.crm-dot.Unknown       { background: #6b7280; }

/* ── CRM badge ───────────────────────────────────────── */
.crm-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.2px;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* ── Latency bar ─────────────────────────────────────── */
.lat-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}
.lat-track {
  width: 64px;
  height: 6px;
  background: var(--surface3);
  border-radius: 999px;
  overflow: hidden;
}
.lat-fill {
  height: 100%;
  border-radius: 999px;
  background-image: linear-gradient(to right, rgba(255,255,255,0.16), rgba(255,255,255,0));
  transition: width 0.3s ease;
}
.lat-label { font-size: 10px; color: var(--muted); min-width: 36px; font-family: var(--font-mono); }

/* ── Step table ──────────────────────────────────────── */
.step-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
  table-layout: fixed;
}
.step-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.step-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.step-table tr:last-child td { border-bottom: none; }
/* Fixed column widths keep every card's steps in perfect alignment. */
.step-table th:nth-child(1), .step-table td:nth-child(1) { width: 30%; }
.step-table th:nth-child(2), .step-table td:nth-child(2) { width: 56px; text-align: center; }
.step-table th:nth-child(3), .step-table td:nth-child(3) { width: 90px; }
.step-table th:nth-child(4), .step-table td:nth-child(4) { width: 110px; }
.step-table th:nth-child(5), .step-table td:nth-child(5) { width: auto; }
.step-table th:nth-child(6), .step-table td:nth-child(6) { width: 44px; text-align: right; }
.step-table td:nth-child(5) {
  color: var(--muted);
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Status icons ────────────────────────────────────── */
.ic-ok    { color: var(--pass); font-weight: 700; }
.ic-fail  { color: var(--fail); font-weight: 700; }
.ic-skip  { color: var(--skip); }
.ic-warn  { color: var(--warn); }
.ic-run   { color: var(--info); }
.ic-slots { color: var(--skip); }

/* ── JSON panel ──────────────────────────────────────── */
.json-row td { padding: 0 !important; }
.json-panel {
  display: none;
  padding: 10px 12px;
  background: var(--code-bg);
  border-top: 1px solid var(--border);
}
.json-panel.open { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.json-pane h4 { margin: 0 0 6px; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.json-pane pre {
  margin: 0;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--code-text);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface);
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ── Expand btn ──────────────────────────────────────── */
.btn-json {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-mono);
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.btn-json:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ── Run history list ────────────────────────────────── */
.run-head,
.run-row {
  display: grid;
  grid-template-columns: 96px 168px 100px 84px 90px 116px 1fr 24px;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
}
.run-head {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.run-row {
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.12s;
}
.run-row:last-child { border-bottom: none; }
.run-row:hover { background: var(--surface2); }
.run-id  { color: var(--accent); font-weight: 700; font-family: var(--font-mono); }
.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  text-transform: capitalize;
}
.pill.complete { background: var(--pass-bg); color: var(--pass); border: 1px solid color-mix(in srgb, var(--pass) 40%, transparent); }
.pill.running  { background: var(--info-bg); color: var(--info); border: 1px solid color-mix(in srgb, var(--info) 40%, transparent); }
.pill.error    { background: var(--fail-bg); color: var(--fail); border: 1px solid color-mix(in srgb, var(--fail) 40%, transparent); }
.pill.manual    { background: var(--surface2); color: var(--muted);  border: 1px solid var(--border); }
.pill.scheduled { background: var(--surface2); color: var(--accent); border: 1px solid var(--border); }
.pill.webhook   { background: var(--surface2); color: var(--warn);   border: 1px solid var(--border); }
.pill.daily     { background: var(--surface2); color: var(--info);   border: 1px solid var(--border); }
.pill.weekly    { background: var(--surface2); color: var(--accent); border: 1px solid var(--border); }

/* ── 3-col runner layout ─────────────────────────────── */
.runner-layout {
  display: grid;
  grid-template-columns: 264px 1fr 232px;
  gap: 16px;
  height: calc(100vh - 100px);
}
.runner-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.runner-panel-header {
  padding: 13px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface2);
}
.runner-panel-body { flex: 1; overflow-y: auto; padding: 12px 14px; }

/* ── Live log ────────────────────────────────────────── */
.log-entry {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 2px 0;
  font-size: 11px;
  font-family: var(--font-mono);
}
.log-ts   { color: var(--faint); flex-shrink: 0; }
.log-salon { color: var(--accent); flex-shrink: 0; width: 28px; text-align: right; }
.log-msg  { flex: 1; }

/* ── Settings table ──────────────────────────────────── */
.settings-table {
  width: 100%;
  border-collapse: collapse;
}
.settings-table th {
  text-align: left;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--surface2);
}
.settings-table th:first-child { border-top-left-radius: var(--radius); }
.settings-table th:last-child  { border-top-right-radius: var(--radius); }
.settings-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.settings-table tr:last-child td { border-bottom: none; }
.settings-table tbody tr { transition: background 0.12s; }
.settings-table tbody tr:hover { background: var(--surface2); }

/* ── Form elements ───────────────────────────────────── */
input[type=text], input[type=url], input[type=password], input[type=number], input[type=email], select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
input:hover, select:hover { border-color: var(--border-strong); }
input::placeholder { color: var(--faint); }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238b909c' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  transition: border-color 0.12s, color 0.12s, background 0.12s, transform 0.1s, box-shadow 0.12s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  position: relative;
  background: linear-gradient(120deg, var(--accent-strong), var(--accent));
  border-color: transparent;
  color: var(--accent-contrast);
  box-shadow: 0 3px 14px var(--accent-glow);
  overflow: hidden;
}
/* Subtle top sheen on primary buttons. */
.btn.primary::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.18), transparent);
  pointer-events: none;
}
.btn.primary:hover { filter: brightness(1.07); color: var(--accent-contrast); border-color: transparent; transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
.btn.primary:active { transform: translateY(0); }
.btn.danger { border-color: color-mix(in srgb, var(--fail) 50%, var(--border)); color: var(--fail); }
.btn.danger:hover { background: var(--fail-bg); border-color: var(--fail); color: var(--fail); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }

/* ── CRM section header ──────────────────────────────── */
.crm-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Checkbox item ───────────────────────────────────── */
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s;
}
.check-item:hover { color: var(--text); background: var(--surface2); }

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }
