/* ─────────────────────────────────────────────
   Prism v2 — Main Stylesheet
   ───────────────────────────────────────────── */

/* ── Light theme (default) ────────────────────── */
:root {
  --bg: #f5f7fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f9fb;
  --bg-input: #f0f2f5;
  --border: #e2e6ed;
  --border-light: #d0d5dd;
  --text: #1a1d26;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-dim: rgba(99,102,241,0.10);
  --green: #16a34a;
  --green-dim: rgba(22,163,74,0.10);
  --yellow: #ca8a04;
  --yellow-dim: rgba(202,138,4,0.10);
  --red: #dc2626;
  --red-dim: rgba(220,38,38,0.10);
  --orange: #ea580c;
  --orange-dim: rgba(234,88,12,0.10);
  --blue: #2563eb;
  --blue-dim: rgba(37,99,235,0.10);
  --purple: #9333ea;
  --sidebar-width: 220px;
  --topbar-height: 56px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* ── Variable aliases ──────────────────────────────
   Legacy / alternative names used by individual page templates.
   These live at :root so they resolve in BOTH light and dark themes,
   because the RHS (--bg-card, --text-muted, etc.) is itself re-bound
   under [data-theme="dark"] below. Adding names here instead of
   search-replacing every template keeps the blast radius small.
   ─────────────────────────────────────────────── */
:root {
  --card:           var(--bg-card);
  --card-alt:       var(--bg-card-hover);
  --surface:        var(--bg-card);
  --bg-elevated:    var(--bg-card-hover);
  --bg-lighter:     var(--bg-card-hover);
  --bg-tinted:      var(--bg-card-hover);
  --muted:          var(--text-muted);
  --faint:          var(--text-dim);
  --text-secondary: var(--text-muted);
  --border-subtle:  var(--border);
  --blue-light:     var(--blue-dim);
  --purple-light:   var(--accent-dim);
}

/* ── Dark theme ─────────────────────────────────── */
[data-theme="dark"] {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-card-hover: #1f2235;
  --bg-input: #13151f;
  --border: #2a2d3e;
  --border-light: #353850;
  --text: #e2e8f0;
  --text-muted: #8892a4;
  --text-dim: #555f72;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-dim: rgba(99,102,241,0.15);
  --green: #22c55e;
  --green-dim: rgba(34,197,94,0.12);
  --yellow: #eab308;
  --yellow-dim: rgba(234,179,8,0.12);
  --red: #ef4444;
  --red-dim: rgba(239,68,68,0.12);
  --orange: #f97316;
  --orange-dim: rgba(249,115,22,0.12);
  --blue: #3b82f6;
  --blue-dim: rgba(59,130,246,0.12);
  --purple: #a855f7;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-icon { font-size: 20px; color: var(--accent); }
.logo-text { font-weight: 700; font-size: 13px; color: var(--text); letter-spacing: 0.02em; }
.logo-version {
  font-size: 10px; color: var(--text-dim);
  background: var(--accent-dim); padding: 1px 5px; border-radius: 4px;
  margin-left: auto;
}

.nav-links { list-style: none; padding: 12px 8px; flex: 1; }
.nav-links li { margin-bottom: 2px; }
.nav-links a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  position: relative;
}
.nav-links a:hover { background: var(--bg-card-hover); color: var(--text); }
.nav-links a.active { background: var(--accent-dim); color: var(--accent-hover); }
.nav-icon { font-size: 15px; width: 18px; text-align: center; }

/* ── Locked nav items (Fix 2) — an unverified active project's feature
   links render dimmed with a lock badge, routing to the verify page
   instead of the feature, rather than disappearing outright. */
.nav-links a.nav-locked,
.nav-section-body a.nav-locked {
  opacity: 0.55;
  cursor: pointer;
}
.nav-links a.nav-locked:hover { opacity: 0.85; background: var(--bg-card-hover); color: var(--text); }
.nav-lock-badge { margin-left: auto; font-size: 11px; opacity: 0.9; }

.badge {
  margin-left: auto; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
}
.badge-warn { background: var(--yellow-dim); color: var(--yellow); }
.badge-critical { background: var(--red-dim); color: var(--red); }

.sidebar-footer {
  padding: 8px 8px 10px;
  border-top: 1px solid var(--border);
}
.api-link { color: var(--text-dim); font-size: 12px; text-decoration: none; }
.api-link:hover { color: var(--accent); }

/* ── Quick-find (nav filter) ───────────────────── */
.nav-quickfind-wrap {
  position: relative;
  margin: 10px 10px 2px;
}
.nav-quickfind-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 38px 6px 26px;
  font-size: 12px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.nav-quickfind-input::placeholder { color: var(--text-dim); }
.nav-quickfind-input:focus {
  border-color: var(--accent);
  background: var(--bg-card);
}
.nav-quickfind-icon {
  position: absolute;
  left: 8px; top: 50%; transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-dim);
  pointer-events: none;
}
.nav-quickfind-kbd {
  position: absolute;
  right: 6px; top: 50%; transform: translateY(-50%);
  font-size: 9px; font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-card-hover, var(--bg));
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  pointer-events: none;
  opacity: 0.7;
}

/* ── Collapsible nav sections (Ahrefs-style groups) ──── */
.nav-spacer { height: 6px; }

.nav-section { list-style: none; margin: 6px 0 2px; }
.nav-section-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 6px 10px 6px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  text-align: left;
}
.nav-section-toggle:hover {
  color: var(--text-muted);
  background: var(--bg-card-hover);
}
.nav-section-chev {
  display: inline-block;
  width: 10px;
  font-size: 9px;
  color: var(--text-dim);
  transition: transform 0.15s;
}
.nav-section-text { flex: 1; }

.nav-section-body {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
}
.nav-section.nav-section-open > .nav-section-body {
  max-height: 400px;   /* generous cap; content dictates actual height */
}
.nav-section-body li { margin-bottom: 2px; }

/* PRO badge on locked nav items */
.nav-badge-pro {
  margin-left: auto;
  background: var(--text-dim);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}

/* Empty state when filter matches nothing */
.nav-empty-hint {
  padding: 12px 10px;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  font-style: italic;
  list-style: none;
}

/* ── Project switcher ────────────────────────── */
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 14px 10px 4px;
  list-style: none;
}
.project-switcher-wrap {
  position: relative;
}
.project-switcher-wrap > a {
  display: flex;
  align-items: center;
  gap: 9px;
}
.project-switcher-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-switcher-arrow {
  font-size: 10px;
  color: var(--text-dim);
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.project-switcher-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 4px;
  z-index: 250;
  max-height: 280px;
  overflow-y: auto;
}
.project-switcher-wrap:hover .project-switcher-dropdown {
  display: block;
}
.project-switcher-wrap:hover .project-switcher-arrow {
  transform: rotate(180deg);
}
.project-dd-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 6px 10px 4px;
}
.project-dd-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: calc(var(--radius-sm) - 1px);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-dd-item:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}
.project-dd-item.current {
  color: var(--accent);
  font-weight: 600;
}
.project-dd-check {
  color: var(--accent);
  font-size: 11px;
  flex-shrink: 0;
}
.project-dd-divider {
  height: 1px;
  background: var(--border);
  margin: 3px 6px;
}
.project-dd-all {
  color: var(--text-dim);
  font-size: 12px;
}

/* ── User menu dropdown ─────────────────────── */
.user-menu-wrap {
  position: relative;
}
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.user-menu-trigger:hover {
  background: var(--bg-card-hover);
}
.user-menu-trigger.open {
  background: var(--bg);
  border-color: var(--border);
}
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6f42c1, #0d6efd);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-info {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.user-name {
  font-size: 12px; font-weight: 600;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
}
.user-plan {
  font-size: 10px; font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 3px;
  padding: 0 5px;
  width: fit-content;
}
/* Founding Member badge — shown to the first 100 paid users forever.
   Gold to differentiate from the plan chip; do not restyle without updating
   /founding-members public copy too. */
.fm-badge {
  font-size: 10px; font-weight: 700;
  color: #f4b400;
  background: rgba(244, 180, 0, 0.12);
  border: 1px solid rgba(244, 180, 0, 0.38);
  border-radius: 3px;
  padding: 0 5px;
  width: fit-content;
  letter-spacing: 0.01em;
  margin-top: 2px;
}
.user-menu-chevron {
  font-size: 9px;
  color: var(--text-dim);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.user-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  padding: 4px;
  display: none;
  z-index: 200;
}
.user-dropdown.open {
  display: block;
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: calc(var(--radius-sm) - 1px);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.12s;
}
.user-dropdown-item:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}
.user-dropdown-item.active {
  background: var(--accent-dim);
  color: var(--accent-hover);
}
.user-dropdown-icon {
  font-size: 13px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 3px 6px;
}
.user-dropdown-logout {
  color: var(--red, #ef4444);
}
.user-dropdown-logout:hover {
  background: rgba(239, 68, 68, 0.08);
  color: var(--red, #ef4444);
}

/* ── Main content ────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 90;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}
.topbar-left { font-size: 13px; color: var(--text-muted); flex: 0 1 auto; min-width: 0; }
.topbar-left a { color: var(--text-muted); text-decoration: none; }
.topbar-left a:hover { color: var(--accent); }
.topbar-right { font-size: 12px; color: var(--text-dim); flex: 0 0 auto; }

.page-body {
  padding: 28px;
  flex: 1 1 auto;
  width: 100%;
  max-width: 1400px;
  box-sizing: border-box;
  display: block;
}
.page-body > * { max-width: 100%; box-sizing: border-box; }

/* ── Page header ─────────────────────────────── */
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--text); }
.page-header p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ── Stat cards ──────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); margin: 4px 0 2px; line-height: 1; }
.stat-sub { font-size: 11px; color: var(--text-muted); }
.stat-card.accent { border-color: var(--accent); background: var(--accent-dim); }
.stat-card.green { border-color: var(--green); background: var(--green-dim); }
.stat-card.yellow { border-color: var(--yellow); background: var(--yellow-dim); }
.stat-card.red { border-color: var(--red); background: var(--red-dim); }

/* ── Cards ───────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.card-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  flex: 1 1 auto;
  min-width: 0;
}
.card-body { padding: 20px; }
.card-meta {
  font-size: 11px; color: var(--text-dim);
  flex: 0 1 auto;
  min-width: 0;
  text-align: right;
  max-width: 60%;
}

/* ── Tables ──────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  font-size: 11px; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 9px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-card-hover); }
td a { color: var(--accent); text-decoration: none; }
td a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ── Score pills ─────────────────────────────── */
.score {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 22px;
  border-radius: 4px; font-size: 12px; font-weight: 700;
}
.score-good { background: var(--green-dim); color: var(--green); }
.score-ok   { background: var(--yellow-dim); color: var(--yellow); }
.score-bad  { background: var(--red-dim); color: var(--red); }

.score-lg {
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  border-radius: 50%; font-size: 20px; font-weight: 800;
  border: 3px solid;
}
.score-lg.good { border-color: var(--green); color: var(--green); background: var(--green-dim); }
.score-lg.ok   { border-color: var(--yellow); color: var(--yellow); background: var(--yellow-dim); }
.score-lg.bad  { border-color: var(--red); color: var(--red); background: var(--red-dim); }

/* ── Severity badges ─────────────────────────── */
.sev {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em;
}
.sev-critical { background: var(--red-dim); color: var(--red); }
.sev-high     { background: var(--orange-dim); color: var(--orange); }
.sev-medium   { background: var(--yellow-dim); color: var(--yellow); }
.sev-low      { background: var(--blue-dim); color: var(--blue); }

/* ── Change type tags ────────────────────────── */
.tag {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 4px; text-transform: uppercase;
}
.tag-content   { background: var(--blue-dim); color: var(--blue); }
.tag-keyword   { background: var(--accent-dim); color: var(--accent); }
.tag-heading   { background: var(--purple-dim, rgba(168,85,247,0.12)); color: var(--purple); }
.tag-link      { background: var(--green-dim); color: var(--green); }
.tag-meta      { background: var(--yellow-dim); color: var(--yellow); }
.tag-technical { background: var(--red-dim); color: var(--red); }
.tag-schema    { background: var(--orange-dim); color: var(--orange); }

/* ── Buttons ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; text-decoration: none; transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text); }
.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid var(--red); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── Form elements ───────────────────────────── */
.form-row { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 20px; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 11px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
input, select, textarea {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  padding: 8px 12px; font-size: 13px; outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder { color: var(--text-dim); }
.input-wide { min-width: 300px; }

/* ── Grid layouts ────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.mb-20 { margin-bottom: 20px; }
.mb-28 { margin-bottom: 28px; }
.mt-16 { margin-top: 16px; }

/* ── Signal rows ─────────────────────────────── */
.signal-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.signal-row:last-child { border-bottom: none; }
.signal-icon { font-size: 16px; width: 22px; text-align: center; }
.signal-label { flex: 1; font-size: 13px; color: var(--text-muted); }
.signal-status { font-size: 12px; font-weight: 600; }
.signal-ok { color: var(--green); }
.signal-warn { color: var(--yellow); }
.signal-missing { color: var(--red); }

/* ── Chart containers ────────────────────────── */
.chart-container { position: relative; height: 220px; }
.chart-container-lg { position: relative; height: 300px; }

/* ── Page list items ─────────────────────────── */
.page-item {
  display: grid; grid-template-columns: 1fr auto auto auto auto;
  align-items: center; gap: 16px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
  text-decoration: none;
}
.page-item:last-child { border-bottom: none; }
.page-item:hover { background: var(--bg-card-hover); }
.page-url { font-size: 13px; font-weight: 500; color: var(--accent); }
.page-url small { display: block; font-size: 11px; color: var(--text-dim); font-weight: 400; margin-top: 2px; }
.page-meta { font-size: 11px; color: var(--text-dim); text-align: right; }

/* ── Insight cards ───────────────────────────── */
.insight-item {
  padding: 13px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg);
  margin-bottom: 10px;
}
.insight-item:last-child { margin-bottom: 0; }
.insight-header { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.insight-type { font-size: 10px; font-weight: 700; text-transform: uppercase; }
.insight-type.ranking_increase { color: var(--green); }
.insight-type.ranking_drop { color: var(--red); }
.insight-type.aio_gained { color: var(--accent); }
.insight-type.aio_lost { color: var(--orange); }
.insight-confidence { margin-left: auto; font-size: 11px; color: var(--text-dim); }
.insight-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ── Alert items ─────────────────────────────── */
.alert-item {
  padding: 14px 18px; border-radius: var(--radius-sm);
  border-left: 3px solid var(--border); background: var(--bg);
  margin-bottom: 10px; display: flex; gap: 14px; align-items: flex-start;
}
.alert-item.critical { border-left-color: var(--red); background: var(--red-dim); }
.alert-item.high     { border-left-color: var(--orange); }
.alert-item.medium   { border-left-color: var(--yellow); }
.alert-item.low      { border-left-color: var(--blue); }
.alert-body { flex: 1; }
.alert-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.alert-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.alert-time { font-size: 11px; color: var(--text-dim); white-space: nowrap; margin-top: 4px; }

/* ── Empty state ─────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--text-dim);
}
.empty-icon { font-size: 36px; margin-bottom: 12px; }
.empty-text { font-size: 14px; }

/* ── Modal ───────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 500;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; width: 480px; max-width: 95vw;
  box-shadow: var(--shadow);
}
.modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 18px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── Progress bars ───────────────────────────── */
.progress-bar {
  height: 6px; background: var(--border); border-radius: 3px; overflow: hidden;
  margin-top: 6px;
}
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.4s; }
.fill-green  { background: var(--green); }
.fill-yellow { background: var(--yellow); }
.fill-red    { background: var(--red); }
.fill-accent { background: var(--accent); }

/* ── URL chip ────────────────────────────────── */
.url-chip {
  font-size: 11px; color: var(--text-dim);
  background: var(--bg); border: 1px solid var(--border);
  padding: 3px 8px; border-radius: 4px;
  font-family: monospace; max-width: 400px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Toast notification ──────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 18px;
  font-size: 13px; color: var(--text);
  box-shadow: var(--shadow); z-index: 999;
  transform: translateY(20px); opacity: 0;
  transition: all 0.25s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }

/* ── GEO platform badges ─────────────────────── */
.platform-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px;
}
.platform-google_aio  { background: rgba(66,133,244,0.15); color: #4285f4; }
.platform-perplexity  { background: rgba(99,102,241,0.15); color: #6366f1; }
.platform-chatgpt     { background: rgba(16,185,129,0.15); color: #10b981; }
.platform-gemini      { background: rgba(168,85,247,0.15); color: #a855f7; }

/* ── Tabs ────────────────────────────────────── */
.tab-bar {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.tab-btn {
  background: transparent; border: none; cursor: pointer;
  padding: 9px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all 0.15s; border-radius: 0;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count {
  background: var(--accent-dim); color: var(--accent);
  font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 8px;
}

/* ── Dashboard header ────────────────────────── */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}
.dash-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.dash-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.btn-new {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 14px;
}

/* ── Projects grid ───────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ── Project card ────────────────────────────── */
.project-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: 16px;
  cursor: pointer;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-accent, var(--accent));
  box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 0 0 1px var(--card-accent, var(--accent));
}
.project-card-accent {
  height: 5px;
  background: var(--card-accent, var(--accent));
  width: 100%;
}
.project-card-body {
  padding: 24px 24px 20px;
}
.project-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}
.project-avatar {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.project-delete {
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s, color .15s, background .15s, border-color .15s;
}
.project-card:hover .project-delete { opacity: 1; }
.project-delete:hover {
  color: var(--red);
  background: var(--red-dim);
  border-color: var(--red);
}

.project-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-domain {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 18px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.project-stats {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 0;
  margin-bottom: 16px;
}
.pstat {
  flex: 1;
  text-align: center;
  padding: 10px 4px;
  position: relative;
}
.pstat-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}
.pstat-val {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.pstat-lbl {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 500;
}
.pstat-good { color: var(--green) !important; }
.pstat-ok   { color: var(--yellow) !important; }
.pstat-bad  { color: var(--red) !important; }

.project-footer {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
}
.project-open {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  transition: color .15s;
}
.project-card:hover .project-open {
  color: var(--card-accent, var(--accent));
}

/* ── Add project card ────────────────────────── */
.project-card-add {
  border: 2px dashed var(--border-light);
  background: transparent;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.project-card-add:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-3px);
  box-shadow: none;
}
.project-add-inner { text-align: center; }
.project-add-icon {
  font-size: 32px;
  color: var(--text-dim);
  line-height: 1;
  margin-bottom: 10px;
  transition: color .15s;
}
.project-card-add:hover .project-add-icon { color: var(--accent); }
.project-add-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color .15s;
}
.project-card-add:hover .project-add-label { color: var(--accent); }
.project-add-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ── Empty state (no projects) ───────────────── */
.projects-empty {
  text-align: center;
  padding: 80px 20px;
  max-width: 440px;
  margin: 0 auto;
}
.projects-empty .empty-glyph {
  font-size: 48px;
  color: var(--text-dim);
  margin-bottom: 20px;
}
.projects-empty h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.projects-empty p {
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Modal ───────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); padding: 6px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
}
.modal-close:hover { color: var(--text); background: var(--border); }
.modal-body { padding: 20px 24px; }
.modal-body .form-group { margin-bottom: 16px; }
.modal-body .form-group:last-child { margin-bottom: 0; }
.input-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 5px;
}
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
}

/* ── Domain group (dashboard) ────────────────── */
.domain-header {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.domain-header:hover { background: var(--bg-card-hover); }
.domain-toggle { font-size: 11px; color: var(--text-muted); width: 14px; }
.domain-body { border-top: 1px solid var(--border); }

/* ── Domain cards grid (domains.html) ─────────── */
.domains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.domain-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.domain-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.domain-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.domain-card-stats {
  display: flex;
  gap: 0;
}
.dstat {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  border-right: 1px solid var(--border);
}
.dstat:last-child { border-right: none; }
.dstat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.dstat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.domain-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* ── Diff display (inline) ───────────────────── */
.diff-old { background: var(--red-dim); color: var(--red); padding: 2px 4px; border-radius: 3px; text-decoration: line-through; font-size: 12px; }
.diff-new { background: var(--green-dim); color: var(--green); padding: 2px 4px; border-radius: 3px; font-size: 12px; }

/* ── Snapshot timeline (page_detail) ─────────── */
.snap-timeline-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
}
.snap-timeline-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  white-space: nowrap;
  font-weight: 600;
}
.snap-timeline {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.snap-timeline::-webkit-scrollbar { display: none; }
.snap-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.snap-chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--text);
}
.snap-chip-active {
  background: var(--accent-dim) !important;
  border-color: var(--accent) !important;
  color: var(--accent-hover) !important;
}
.snap-chip-score {
  font-size: 10px;
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1px 5px;
  color: var(--text-dim);
}
.snap-chip-active .snap-chip-score {
  background: rgba(99,102,241,.25);
  color: var(--accent-hover);
}

/* ── Compare pickers ─────────────────────────── */
.compare-pickers { padding: 20px 24px !important; }
.compare-pickers-inner {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}
.cmp-picker-col { flex: 1; }
.cmp-picker-label { display: block; margin-bottom: 8px; }
.cmp-arrow {
  font-size: 20px;
  color: var(--text-dim);
  padding-bottom: 8px;
  flex-shrink: 0;
}
.cmp-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .04em;
}
.cmp-badge-old { background: var(--red-dim);   color: var(--red);   }
.cmp-badge-new { background: var(--green-dim); color: var(--green); }

/* ── Compare scores row ──────────────────────── */
.cmp-scores {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--border);
}
.cmp-score-tile {
  flex: 1;
  text-align: center;
  padding: 16px 8px;
  border-right: 1px solid var(--border);
}
.cmp-score-tile:last-child { border-right: none; }
.cmp-score-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  margin-bottom: 10px;
  font-weight: 600;
}
.cmp-score-vals {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}
.cmp-score-old  { font-size: 18px; font-weight: 700; color: var(--text-muted); }
.cmp-score-new  { font-size: 18px; font-weight: 700; color: var(--text); }
.cmp-score-arrow { font-size: 14px; color: var(--text-dim); }
.cmp-score-arrow.up   { color: var(--green); }
.cmp-score-arrow.down { color: var(--red);   }
.cmp-score-delta {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}
.delta-up   { color: var(--green); }
.delta-down { color: var(--red);   }

/* ── Compare meta rows ───────────────────────── */
.cmp-meta-row {
  display: grid;
  grid-template-columns: 100px 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0;
}
.cmp-meta-row:last-child { border-bottom: none; }
.cmp-meta-row.cmp-meta-changed { background: rgba(234,179,8,.04); }
.cmp-meta-field {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-dim);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  border-right: 1px solid var(--border);
}
.cmp-meta-side {
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.cmp-side-old { border-right: 1px solid var(--border); background: rgba(239,68,68,.03); }
.cmp-side-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
  margin-top: 2px;
}
.cmp-meta-val {
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
  line-height: 1.5;
}
.cmp-highlight-new {
  background: var(--green-dim);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--green);
}

/* ── Compare content sections ────────────────── */
.cmp-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.cmp-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}
.cmp-section-added  { border-color: var(--green); }
.cmp-section-removed{ border-color: var(--red);   }
.cmp-section-changed{ border-color: var(--yellow); }
.cmp-section-added  .cmp-section-header { background: var(--green-dim); }
.cmp-section-removed.cmp-section-header { background: var(--red-dim);   }
.cmp-section-changed .cmp-section-header{ background: var(--yellow-dim);}
.cmp-change-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}
.badge-added   { background: var(--green-dim);  color: var(--green);  }
.badge-removed { background: var(--red-dim);    color: var(--red);    }
.badge-changed { background: var(--yellow-dim); color: var(--yellow); }
.cmp-section-body {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}
.cmp-body-added  { background: var(--green-dim);  color: var(--green);  }
.cmp-body-removed{ background: var(--red-dim);    color: var(--red);    }

/* ── Diff lines ──────────────────────────────── */
.cmp-diff-lines {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cmp-diff-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  padding: 4px 10px;
  border-radius: 4px;
  word-break: break-word;
}
.diff-line-added   { background: var(--green-dim); color: var(--green); }
.diff-line-removed { background: var(--red-dim);   color: var(--red);   }
.diff-sign {
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  width: 12px;
}

/* ── Link diff ───────────────────────────────── */
.cmp-link-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.cmp-link-anchor { font-weight: 600; }
.cmp-link-arrow  { color: var(--text-dim); }
.cmp-link-url    { font-family: 'SF Mono','Fira Code',monospace; font-size: 12px; word-break: break-all; }

/* ── Sitemap import UI ───────────────────────── */
.sitemap-src-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.sitemap-src-tab:hover { color: var(--text); }
.sitemap-src-tab.active {
  color: var(--accent-hover);
  border-bottom-color: var(--accent);
}

/* Dropzone */
.sitemap-dropzone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.sitemap-dropzone:hover, .sitemap-dropzone.dz-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.dz-icon { font-size: 32px; margin-bottom: 10px; }
.dz-label { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.dz-hint  { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* Summary bar */
.sitemap-summary {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.smap-sum-item {
  flex: 1;
  text-align: center;
  padding: 16px 8px;
  border-right: 1px solid var(--border);
}
.smap-sum-item:last-child { border-right: none; }
.smap-sum-val {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 3px;
}
.smap-sum-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  font-weight: 600;
}
.smap-sum-found    .smap-sum-val { color: var(--text); }
.smap-sum-new      .smap-sum-val { color: var(--green); }
.smap-sum-existing .smap-sum-val { color: var(--text-muted); }

/* URL list rows */
.url-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}
.url-list-row:last-child { border-bottom: none; }
.url-list-row:hover { background: var(--bg-card-hover); }
.url-list-row input[type=checkbox] { flex-shrink: 0; accent-color: var(--accent); }
.url-list-text {
  font-size: 12px;
  font-family: 'SF Mono','Fira Code',monospace;
  color: var(--text-muted);
  word-break: break-all;
}

/* ── Mobile hamburger menu ───────────────────── */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .mobile-menu-btn { display: flex; }
  .sidebar { display: none; }
  .sidebar.mobile-open {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 260px;
    height: 100vh;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
  }
  .main-content { margin-left: 0; }
}


/* ── Spinner keyframe ────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════
   PROFESSIONAL / INDUSTRIAL STYLE
   ═══════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   PROFESSIONAL THEME — "Linear / Attio / Stripe Dashboard"
   ═══════════════════════════════════════════════════════════
   Modern, contemporary pro tool. Not a terminal, not dated.
   - Inter variable font, normal-case labels
   - 6px radius everywhere (soft but sharp)
   - Subtle hairline borders + tiny ambient shadow
   - Graphite neutrals + restrained indigo accent
   - Tabular-nums on data, but no forced monospace shouting
   - Standard sidebar width, generous breathing room
   ─────────────────────────────────────────────────────────── */

/* D-T-11: Inter + JetBrains Mono are loaded once via the
   ``frontend/templates/_fonts.html`` partial included in
   ``base.html`` (in-app) and every standalone marketing page. The
   prior ``@import url(...)`` here declared a narrower 400-700 weight
   set than the marketing pages' 400-800, so /home and /pricing got
   real-Inter-Black at weight 800 while in-app blocks fell back to
   synthetic-bold. Removing the @import collapses the four
   font-loading mechanisms the audit flagged into one. */

[data-style="professional"] {
  /* Neutral graphite light palette */
  --bg:              #f7f8fa;
  --bg-card:         #ffffff;
  --bg-card-hover:   #f4f5f8;
  --bg-input:        #ffffff;
  --bg-stripe:       #fafbfc;
  --border:          #e4e6eb;
  --border-light:    #eef0f3;
  --border-strong:   #d1d5db;
  --text:            #111827;
  --text-muted:      #4b5563;
  --text-dim:        #6b7280;
  --accent:          #4f46e5;                     /* indigo 600 — Linear-ish */
  --accent-hover:    #4338ca;
  --accent-dim:      rgba(79,70,229,0.08);
  --green:           #059669;
  --green-dim:       rgba(5,150,105,0.10);
  --yellow:          #b45309;
  --yellow-dim:      rgba(180,83,9,0.10);
  --red:             #dc2626;
  --red-dim:         rgba(220,38,38,0.08);
  --orange:          #ea580c;
  --orange-dim:      rgba(234,88,12,0.10);
  --blue:            #2563eb;
  --blue-dim:        rgba(37,99,235,0.08);
  --purple:          #7c3aed;
  --radius:          6px;
  --radius-sm:       4px;
  --shadow:          0 1px 2px rgba(16,24,40,0.04), 0 1px 3px rgba(16,24,40,0.03);
  --sidebar-width:   232px;
  --topbar-height:   56px;
  --chart-grid:      rgba(17,24,39,0.06);
  --chart-text:      #6b7280;
}

[data-style="professional"][data-theme="dark"] {
  --bg:              #0b0d12;
  --bg-card:         #14171e;
  --bg-card-hover:   #1a1e27;
  --bg-input:        #14171e;
  --bg-stripe:       #12151b;
  --border:          #252a34;
  --border-light:    #1d2028;
  --border-strong:   #2f3542;
  --text:            #e8ebf2;
  --text-muted:      #9ca3af;
  --text-dim:        #6b7280;
  --accent:          #818cf8;                     /* indigo 400 */
  --accent-hover:    #a5b4fc;
  --accent-dim:      rgba(129,140,248,0.12);
  --green:           #34d399;
  --green-dim:       rgba(52,211,153,0.12);
  --yellow:          #fbbf24;
  --yellow-dim:      rgba(251,191,36,0.12);
  --red:             #f87171;
  --red-dim:         rgba(248,113,113,0.12);
  --orange:          #fb923c;
  --orange-dim:      rgba(251,146,60,0.12);
  --blue:            #60a5fa;
  --blue-dim:        rgba(96,165,250,0.12);
  --purple:          #a78bfa;
  --chart-grid:      rgba(255,255,255,0.06);
  --chart-text:      #9ca3af;
  --shadow:          0 1px 2px rgba(0,0,0,0.30);
}

/* ── Typography: Inter body, JetBrains Mono for code ─────── */
[data-style="professional"] body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.003em;
  font-feature-settings: "cv11", "ss01", "ss03";
}
[data-style="professional"] h1,
[data-style="professional"] h2,
[data-style="professional"] h3,
[data-style="professional"] h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}
[data-style="professional"] h1 { font-size: 22px; line-height: 1.3; }
[data-style="professional"] h2 { font-size: 17px; line-height: 1.35; }
[data-style="professional"] h3 { font-size: 14px; font-weight: 600; line-height: 1.4; }

/* Data-forward: stats use Inter with tabular-nums + tight tracking */
[data-style="professional"] .stat-value,
[data-style="professional"] .kpi .v,
[data-style="professional"] .v,
[data-style="professional"] .metric-value,
[data-style="professional"] td.num,
[data-style="professional"] .num,
[data-style="professional"] .kw-score {
  font-family: 'Inter', sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-weight: 600;
  letter-spacing: -0.02em;
}
[data-style="professional"] code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 0.92em;
  background: var(--bg-stripe);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 1px 5px;
}
[data-style="professional"] .stat-value { font-size: 28px; font-weight: 600; }

/* Tabular figures on every numeric cell without forcing monospace */
[data-style="professional"] td,
[data-style="professional"] th { font-variant-numeric: tabular-nums; }

/* ── Cards: 1px hairline border, 6px radius, subtle ambient ── */
[data-style="professional"] .card,
[data-style="professional"] .stat-card,
[data-style="professional"] .project-card,
[data-style="professional"] .cn-card,
[data-style="professional"] .cb-card,
[data-style="professional"] .sf-card,
[data-style="professional"] .ceiling-card,
[data-style="professional"] .panel,
[data-style="professional"] .kpi {
  border-radius: 6px !important;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--bg-card);
}

/* Card header — subtle weight difference, no shouting */
[data-style="professional"] .card-header,
[data-style="professional"] .cn-card h3,
[data-style="professional"] .cb-card h3,
[data-style="professional"] .sf-card h3,
[data-style="professional"] .ceiling-card h3 {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--text) !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
  padding: 14px 18px !important;
  border-bottom: 1px solid var(--border-light);
  margin: 0 !important;
  background: transparent !important;
}
[data-style="professional"] .card-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--text);
}
[data-style="professional"] .card-meta {
  font-size: 12px;
  color: var(--text-dim);
}
[data-style="professional"] .card-body { padding: 18px; }

/* ── Sidebar: standard width, soft active state ──────────── */
[data-style="professional"] .sidebar {
  border-right: 1px solid var(--border);
  background: var(--bg-card);
}
[data-style="professional"] .sidebar-logo {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border-light);
}
[data-style="professional"] .logo-icon { font-size: 18px; color: var(--accent); }
[data-style="professional"] .logo-text {
  font-size: 14px !important;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text);
}
[data-style="professional"] .logo-version {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  background: var(--bg-stripe);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-dim);
}

[data-style="professional"] .nav-quickfind-input {
  font-size: 13px;
  border-radius: 6px;
  border-color: var(--border);
  background: var(--bg-stripe);
}
[data-style="professional"] .nav-quickfind-kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  border-radius: 3px;
}

[data-style="professional"] .nav-links a {
  font-size: 13.5px;
  padding: 7px 10px;
  border-radius: 6px;
  font-weight: 500;
  color: var(--text-muted);
  margin: 1px 0;
}
[data-style="professional"] .nav-links a.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}
[data-style="professional"] .nav-links a:hover:not(.active) {
  background: var(--bg-stripe);
  color: var(--text);
}

[data-style="professional"] .nav-section-toggle,
[data-style="professional"] .nav-section-label {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: none;
}
[data-style="professional"] .nav-icon { font-size: 14px; opacity: 0.9; }

[data-style="professional"] .project-switcher-wrap > a {
  background: var(--bg-stripe);
  border-bottom: 1px solid var(--border-light);
  border-radius: 6px;
}

/* ── Topbar: clean, standard height ───────────────────────── */
[data-style="professional"] .topbar {
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
[data-style="professional"] .topbar-left {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 500;
  letter-spacing: -0.005em;
  text-transform: none;
}
[data-style="professional"] .topbar-date {
  font-size: 12.5px;
  color: var(--text-dim);
}

/* ── Buttons: 6px radius, normal case, weight 500 ─────────── */
[data-style="professional"] button:not(.nav-section-toggle):not(.mobile-menu-btn):not(.settings-tab-btn):not(.user-menu-trigger),
[data-style="professional"] .btn,
[data-style="professional"] .action-btn {
  border-radius: 6px !important;
  text-transform: none;
  letter-spacing: -0.005em;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 13px;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
[data-style="professional"] .btn-primary,
[data-style="professional"] .btn-submit,
[data-style="professional"] .action-btn.primary,
[data-style="professional"] .btn-new-ticket,
[data-style="professional"] .btn-reply {
  background: var(--accent) !important;
  color: #fff !important;
  border: 1px solid var(--accent) !important;
  box-shadow: 0 1px 2px rgba(79,70,229,0.15);
}
[data-style="professional"] .btn-primary:hover,
[data-style="professional"] .btn-submit:hover,
[data-style="professional"] .action-btn.primary:hover,
[data-style="professional"] .btn-new-ticket:hover,
[data-style="professional"] .btn-reply:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
}
[data-style="professional"] .btn-ghost,
[data-style="professional"] .btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border) !important;
  color: var(--text);
}
[data-style="professional"] .btn-ghost:hover,
[data-style="professional"] .btn-secondary:hover {
  background: var(--bg-stripe);
  border-color: var(--border-strong) !important;
}

/* ── Tables: light borders, normal-case headers ──────────── */
[data-style="professional"] table {
  border: 1px solid var(--border);
  border-radius: 6px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  overflow: hidden;
}
[data-style="professional"] th {
  background: var(--bg-stripe);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 14px;
  text-transform: none;
  letter-spacing: -0.005em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
[data-style="professional"] td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text);
}
[data-style="professional"] tbody tr:last-child td { border-bottom: none; }
[data-style="professional"] tbody tr:hover td { background: var(--bg-stripe); }

/* ── Form fields: 6px radius, soft focus ring ────────────── */
[data-style="professional"] input,
[data-style="professional"] select,
[data-style="professional"] textarea {
  border-radius: 6px !important;
  border: 1px solid var(--border);
  background: var(--bg-input);
  font-size: 13.5px;
  padding: 8px 12px;
  color: var(--text);
  transition: border-color 0.12s, box-shadow 0.12s;
}
[data-style="professional"] input:focus,
[data-style="professional"] select:focus,
[data-style="professional"] textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ── Badges, sev, tags: pill shape, soft fill, normal case ── */
[data-style="professional"] .badge,
[data-style="professional"] .sev,
[data-style="professional"] .tag,
[data-style="professional"] .platform-badge,
[data-style="professional"] .badge-status,
[data-style="professional"] .badge-priority,
[data-style="professional"] .cn-sev,
[data-style="professional"] .cn-status-pill,
[data-style="professional"] .cms-status-badge {
  border-radius: 4px !important;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px !important;
  font-weight: 500;
  text-transform: none;
  letter-spacing: -0.005em;
  padding: 2px 8px !important;
  border: 1px solid var(--border);
  background: var(--bg-stripe);
}

/* ── Project cards: flat tile, hover lift ────────────────── */
[data-style="professional"] .project-card {
  border-radius: 8px !important;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
[data-style="professional"] .project-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: 0 4px 12px rgba(16,24,40,0.06);
}
[data-style="professional"] .project-card-accent { height: 3px; }
[data-style="professional"] .project-card-body { padding: 16px 18px 14px; }
[data-style="professional"] .project-avatar { border-radius: 6px; }
[data-style="professional"] .project-stats { border-radius: 6px; background: var(--bg-stripe); }

/* ── Modals: soft shadow, 8px radius ─────────────────────── */
[data-style="professional"] .modal {
  border-radius: 10px !important;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(16,24,40,0.18), 0 1px 3px rgba(16,24,40,0.06) !important;
}

/* ── Toast, settings-tabs, misc ──────────────────────────── */
[data-style="professional"] .toast {
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 10px 30px rgba(16,24,40,0.12);
}
[data-style="professional"] .settings-tab-btn {
  font-size: 13.5px;
  text-transform: none;
  letter-spacing: -0.005em;
  font-weight: 500;
}
[data-style="professional"] .settings-tab-btn.active { color: var(--accent); }
[data-style="professional"] .settings-tab-count {
  font-family: 'Inter', sans-serif;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

/* ── Tab bar (generic) ───────────────────────────────────── */
[data-style="professional"] .tab-btn {
  padding: 8px 14px;
  font-size: 13.5px;
  text-transform: none;
  letter-spacing: -0.005em;
  font-weight: 500;
  border-radius: 6px;
}

/* ── MRR / highlight cards ───────────────────────────────── */
[data-style="professional"] .mrr-card .stat-value {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: var(--accent);
  color: var(--accent);
}
[data-style="professional"] .mrr-card {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ── Page header ─────────────────────────────────────────── */
[data-style="professional"] .page-header h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
[data-style="professional"] .page-header p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ── KPI blocks (domain-specific) ────────────────────────── */
[data-style="professional"] .cn-kpi .k,
[data-style="professional"] .cb-kpi .k,
[data-style="professional"] .sf-kpi .k,
[data-style="professional"] .ceiling-kpi .k,
[data-style="professional"] .kpi .k {
  font-size: 12px !important;
  letter-spacing: -0.005em;
  color: var(--text-muted) !important;
  font-weight: 500;
  text-transform: none;
}
[data-style="professional"] .cn-kpi .v,
[data-style="professional"] .cb-kpi .v,
[data-style="professional"] .sf-kpi .v,
[data-style="professional"] .ceiling-kpi .v {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ── User dropdown ───────────────────────────────────────── */
[data-style="professional"] .user-menu-trigger {
  border-radius: 6px;
  border: 1px solid transparent;
}
[data-style="professional"] .user-menu-trigger:hover { background: var(--bg-stripe); }
[data-style="professional"] .user-dropdown {
  border-radius: 8px !important;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(16,24,40,0.12), 0 2px 6px rgba(16,24,40,0.04);
}
[data-style="professional"] .user-dropdown-item {
  font-size: 13.5px;
  border-radius: 4px;
}
[data-style="professional"] .user-name { font-size: 13px; font-weight: 600; }
[data-style="professional"] .user-plan {
  font-size: 11px;
  text-transform: none;
  letter-spacing: -0.005em;
  color: var(--text-dim);
  font-weight: 500;
}

/* ── Style switcher + theme toggle (topbar) ──────────────── */
[data-style="professional"] #style-select,
[data-style="professional"] #theme-toggle,
[data-style="professional"] #tour-btn {
  border-radius: 6px !important;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  text-transform: none;
  letter-spacing: -0.005em;
  font-weight: 500;
}

/* ── Content spacing ─────────────────────────────────────── */
[data-style="professional"] .page-body { padding: 24px 32px; }
[data-style="professional"] .card.mb-16 { margin-bottom: 16px; }
[data-style="professional"] .card.mb-28 { margin-bottom: 24px; }

/* ── Defensive: prevent text-clipping from legacy !important rules ── */
[data-style="professional"] .card h3,
[data-style="professional"] .card h4,
[data-style="professional"] .stat-card h3,
[data-style="professional"] .stat-card h4,
[data-style="professional"] .page-header h1,
[data-style="professional"] .page-header p {
  overflow: visible;
  white-space: normal;
}

/* ── Accessibility: focus-visible ─────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
