/* ============================================================
   Cartograph — Bootstrap 5.3 brand layer
   Loads AFTER bootstrap.min.css. Overrides Bootstrap's CSS
   variables to the Cartograph palette/typography, then defines
   the bespoke components Bootstrap has no equivalent for
   (sidebar, KPI tiles, cluster cards, status pills, topical map).
   Bootstrap provides the reset, grid, and utility classes.
   ============================================================ */

:root {
  /* Brand → Bootstrap variable bridge */
  --bs-primary: #EA257D;
  --bs-primary-rgb: 234, 37, 125;
  --bs-link-color: #EA257D;
  --bs-link-color-rgb: 234, 37, 125;
  --bs-link-hover-color: #C71E69;
  --bs-body-color: #3A3842;
  --bs-body-color-rgb: 58, 56, 66;
  --bs-body-bg: #FAFAFB;
  --bs-emphasis-color: #0F0E14;
  --bs-secondary-color: #8C879A;
  --bs-border-color: #ECEAF0;
  --bs-border-radius: 14px;
  --bs-border-radius-sm: 10px;
  --bs-border-radius-lg: 18px;
  --bs-border-radius-pill: 999px;
  --bs-font-sans-serif: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-font-size: 14px;
  --bs-body-line-height: 1.55;
  --bs-emphasis-color-rgb: 15, 14, 20;
}

/* Bootstrap focus ring + selection tuned to brand */
:focus-visible { outline-color: #EA257D; }
::selection { background: rgba(234,37,125,0.16); }

/* Headings use the display family */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: #0F0E14;
}

/* Re-assert brand text-muted (Bootstrap's is a neutral gray) */
.text-muted { color: var(--muted) !important; }

/* ============================================================
   PixelChefs Agency Dashboard · Shared Brand System
   Used by every screen. Update tokens here, propagate everywhere.
   ============================================================ */

:root {
  /* Brand */
  --pink: #EA257D;
  --pink-soft: rgba(234, 37, 125, 0.12);
  --pink-faint: rgba(234, 37, 125, 0.06);
  --purple: #763397;
  --gradient: linear-gradient(135deg, #EA257D 0%, rgba(234,37,125,0.92) 50%, #763397 100%);
  --gradient-soft: linear-gradient(135deg, rgba(234,37,125,0.16) 0%, rgba(118,51,151,0.16) 100%);

  /* Dark surfaces */
  --ink: #0F0E14;
  --ink-2: #19181D;
  --ink-3: #232128;
  --line-dark: rgba(255,255,255,0.08);
  --line-dark-2: rgba(255,255,255,0.14);

  /* Light surfaces */
  --bg: #FAFAFB;
  --surface: #FFFFFF;
  --surface-2: #F6F5F8;
  --line: #ECEAF0;
  --line-strong: #DDD9E3;

  /* Text */
  --heading: #181818;
  --body: #575757;
  --muted: #8C879A;
  --lavender: #CDBFD6;

  /* Status */
  --green: #14A06B;
  --green-soft: rgba(20, 160, 107, 0.10);
  --teal: #0E9488;
  --teal-soft: rgba(14, 148, 136, 0.12);
  --red: #DC2841;
  --red-soft: rgba(220, 40, 65, 0.10);
  --amber: #D58A0E;
  --amber-soft: rgba(213, 138, 14, 0.12);
  --blue: #2563EB;
  --blue-soft: rgba(37, 99, 235, 0.10);

  /* Shape */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 14, 20, 0.04);
  --shadow: 0 4px 24px rgba(15, 14, 20, 0.06);
  --shadow-lg: 0 24px 60px rgba(15, 14, 20, 0.10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--heading);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.mono { font-family: "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; }

a { color: var(--heading); }

/* ---------- App layout (Bootstrap row/col handles structure) ---------- */
.app { min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--ink);
  color: var(--lavender);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line-dark);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gradient);
  display: grid;
  place-items: center;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 6px 18px rgba(234, 37, 125, 0.35);
  letter-spacing: -0.04em;
  flex-shrink: 0;
}
.brand-name {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  color: #fff;
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.brand-name span {
  color: var(--lavender);
  font-weight: 500;
  font-size: 11px;
  display: block;
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(205, 191, 214, 0.5);
  padding: 8px 12px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(205, 191, 214, 0.85);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s ease;
  cursor: pointer;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: #fff; }
.nav-item.active {
  background: rgba(234, 37, 125, 0.14);
  color: #fff;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  background: var(--gradient);
  border-radius: 0 3px 3px 0;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.nav-item.active svg { opacity: 1; }
.nav-item .badge {
  margin-left: auto;
  background: var(--pink);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gradient);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  flex-shrink: 0;
}
.sidebar-footer .who { line-height: 1.2; }
.sidebar-footer .who strong { color: #fff; font-size: 13px; font-weight: 600; display: block; }
.sidebar-footer .who span { color: rgba(205, 191, 214, 0.6); font-size: 11px; }

/* ---------- Topbar ---------- */
/* .main: Bootstrap col handles flex; we just need min-width fix */
.main { min-width: 0; }
.topbar {
  height: 64px;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.crumbs strong { color: var(--heading); font-weight: 600; font-family: "Plus Jakarta Sans", sans-serif; }
.crumbs .chev { opacity: 0.4; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--heading); }

.top-actions { display: flex; align-items: center; gap: 12px; }
.search {
  width: 320px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 14px 8px 38px;
  font-size: 13px;
  font-family: "DM Sans", sans-serif;
  color: var(--heading);
  transition: all .2s;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238C879A' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>");
  background-repeat: no-repeat;
  background-position: 14px center;
}
.search:focus { outline: none; border-color: var(--pink); background-color: #fff; box-shadow: 0 0 0 4px var(--pink-faint); }
.search::placeholder { color: var(--muted); }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--heading);
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.icon-btn:hover { background: #fff; border-color: var(--line-strong); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 7px; height: 7px;
  background: var(--pink);
  border-radius: 50%;
  border: 2px solid var(--surface-2);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: all .25s;
  border: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 6px 18px rgba(234, 37, 125, 0.28);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(234, 37, 125, 0.34); }
.btn-primary svg { width: 14px; height: 14px; }
.btn-ghost {
  background: var(--surface-2);
  color: var(--heading);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: #fff; border-color: var(--line-strong); }
.btn-dark {
  background: var(--ink);
  color: #fff;
}
.btn-dark:hover { background: var(--ink-3); }
.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-danger:hover { background: #c0233a; }
.btn-link {
  background: transparent;
  color: var(--pink);
  padding: 6px 8px;
}
.btn-link:hover { background: var(--pink-faint); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }

/* ---------- Page chrome ---------- */
.page { padding: 24px 32px 48px; }
.page-head { margin-bottom: 28px; }
.page-head .h-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--pink);
  font-weight: 600;
  margin-bottom: 8px;
  display: inline-block;
}
.page-head h1 { font-size: 32px; line-height: 1.1; font-weight: 800; }
.page-head h1 em { font-style: normal; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head .sub { color: var(--body); font-size: 14px; margin-top: 6px; max-width: 540px; }
/* .head-meta now uses Bootstrap d-flex utilities */

/* ---------- Pills, tabs, tags ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--body);
  font-weight: 500;
}
.pill .live-dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(20,160,107,0.6);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(20,160,107,0.6); }
  70% { box-shadow: 0 0 0 8px rgba(20,160,107,0); }
  100% { box-shadow: 0 0 0 0 rgba(20,160,107,0); }
}

.tabs {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px;
}
.tabs button {
  background: transparent;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  color: var(--body);
  cursor: pointer;
  font-weight: 500;
  transition: all .2s;
}
.tabs button:hover { color: var(--heading); }
.tabs button.active {
  background: var(--ink);
  color: #fff;
}

.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
}
.status .dot { width: 6px; height: 6px; border-radius: 50%; }
.status.healthy { background: var(--green-soft); color: var(--green); }
.status.healthy .dot { background: var(--green); box-shadow: 0 0 0 0 rgba(20,160,107,0.5); animation: pulse 2s ease-in-out infinite; }
.status.warn { background: var(--amber-soft); color: var(--amber); }
.status.warn .dot { background: var(--amber); }
.status.error { background: var(--red-soft); color: var(--red); }
.status.error .dot { background: var(--red); }
.status.info { background: var(--blue-soft); color: var(--blue); }
.status.info .dot { background: var(--blue); }
.status.muted { background: var(--surface-2); color: var(--muted); }
.status.muted .dot { background: var(--muted); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card.flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.card-title { font-size: 15px; font-weight: 700; font-family: "Plus Jakarta Sans", sans-serif; color: var(--heading); }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--heading);
  font-family: "Plus Jakarta Sans", sans-serif;
}
.field label .req { color: var(--pink); margin-left: 2px; }
.field .help { font-size: 11px; color: var(--muted); }
.input, .textarea, .select {
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--heading);
  width: 100%;
  transition: all .2s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 4px var(--pink-faint);
}
.input::placeholder { color: var(--muted); }
.textarea { min-height: 96px; resize: vertical; font-family: "DM Sans", sans-serif; }

.input.with-prefix { padding-left: 90px; }
.input-wrap { position: relative; }
.input-wrap .prefix {
  position: absolute;
  left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  pointer-events: none;
  background: var(--surface-2);
  padding: 4px 8px;
  border-radius: 6px;
}

.checkbox {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--heading);
}
.checkbox input { display: none; }
.checkbox .box {
  width: 18px; height: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  display: grid; place-items: center;
  background: var(--surface);
  transition: all .15s;
  flex-shrink: 0;
}
.checkbox input:checked + .box {
  background: var(--gradient);
  border-color: transparent;
}
.checkbox .box svg { width: 12px; height: 12px; color: #fff; opacity: 0; }
.checkbox input:checked + .box svg { opacity: 1; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  padding: 14px 24px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.table th:last-child { text-align: right; }
.table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--pink-faint); cursor: pointer; }

.client-cell { display: flex; align-items: center; gap: 12px; }
.client-logo {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 700;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 13px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.client-cell .name { color: var(--heading); font-weight: 600; line-height: 1.2; font-family: "Plus Jakarta Sans", sans-serif; }
.client-cell .url { color: var(--muted); font-size: 11px; font-family: "JetBrains Mono", monospace; }

.lead-num { font-family: "JetBrains Mono", monospace; font-weight: 600; color: var(--heading); font-size: 14px; }
.lead-mom {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 5px;
  margin-left: 6px;
}
.lead-mom.up { background: var(--green-soft); color: var(--green); }
.lead-mom.down { background: var(--red-soft); color: var(--red); }
.lead-mom.flat { background: var(--surface-2); color: var(--muted); }

.last-sync { color: var(--muted); font-size: 12px; font-family: "JetBrains Mono", monospace; }

.row-action {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  display: grid; place-items: center;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  margin-left: auto;
}
tr:hover .row-action { background: #fff; border-color: var(--line); color: var(--heading); }
.row-action svg { width: 14px; height: 14px; }

/* ---------- Animations ---------- */
.fade-in { animation: fadeUp .6s ease-out backwards; }
.fade-in.d1 { animation-delay: .1s; }
.fade-in.d2 { animation-delay: .2s; }
.fade-in.d3 { animation-delay: .3s; }
.fade-in.d4 { animation-delay: .4s; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Auth screen frame ---------- */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--ink);
  position: relative;
  overflow: hidden;
}
.auth-side {
  position: relative;
  background: var(--ink);
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.auth-side::before {
  content: "";
  position: absolute;
  top: -30%; right: -20%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(234,37,125,0.30) 0%, transparent 60%);
  animation: drift 14s ease-in-out infinite;
  z-index: 0;
}
.auth-side::after {
  content: "";
  position: absolute;
  bottom: -30%; left: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(118,51,151,0.30) 0%, transparent 60%);
  animation: drift 16s ease-in-out infinite reverse;
  z-index: 0;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, 30px); }
}
.auth-side > * { position: relative; z-index: 1; }
.auth-side .brand-name span { color: var(--lavender); }
.auth-form-side {
  background: var(--surface);
  display: grid;
  place-items: center;
  padding: 48px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
}
@media (max-width: 880px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}

/* ---------- Drawer ---------- */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 14, 20, 0.5);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 480px; max-width: 92vw;
  background: var(--surface);
  z-index: 51;
  box-shadow: -24px 0 60px rgba(15, 14, 20, 0.18);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-body { padding: 24px 28px; flex: 1; overflow-y: auto; }
.drawer-foot {
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--muted);
}
.empty .icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--gradient-soft);
  margin: 0 auto 16px;
  display: grid; place-items: center;
  color: var(--pink);
}
.empty .icon svg { width: 28px; height: 28px; }
.empty h3 { color: var(--heading); margin-bottom: 6px; font-size: 18px; }

/* ============================================================
   Modals — global overlay + dialog
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 14, 20, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  display: grid; place-items: center;
  padding: 24px;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 80px rgba(15, 14, 20, 0.32);
  border: 1px solid var(--line);
  transform: translateY(8px) scale(0.98);
  transition: transform .25s cubic-bezier(0.2, 0, 0.1, 1);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 80px);
  overflow: hidden;
}
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }
.modal.lg { max-width: 640px; }
.modal-head {
  padding: 22px 26px 14px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
}
.modal-head h3 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.modal-head p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}
.modal-body {
  padding: 6px 26px 18px;
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: var(--surface-2);
}
.modal-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-bottom: 12px;
}
.modal-icon.danger { background: var(--red-soft); color: var(--red); }
.modal-icon.warn   { background: var(--amber-soft); color: var(--amber); }
.modal-icon.brand  { background: var(--gradient-soft); color: var(--pink); }
.modal-icon.info   { background: var(--blue-soft); color: var(--blue); }
.modal-icon svg { width: 22px; height: 22px; }

/* Sync-progress modal specific */
.sync-progress {
  text-align: center;
  padding: 12px 0 24px;
}
.sync-progress .spin-large {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 3px solid var(--pink-faint);
  border-top-color: var(--pink);
  animation: spin 0.9s linear infinite;
  margin: 0 auto 18px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sync-progress .stage {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 600;
  color: var(--heading);
  font-size: 15px;
  margin-bottom: 4px;
}
.sync-progress .detail {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}
.sync-result-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--green-soft);
  border-radius: 10px;
  font-size: 13px;
}
.sync-result-row.fail { background: var(--red-soft); }
.sync-result-row .check {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.sync-result-row.fail .check { background: var(--red); }

/* ============================================================
   Toasts — bottom-right stacked
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(15, 14, 20, 0.32);
  border: 1px solid var(--line-dark);
  display: flex; align-items: center; gap: 12px;
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: transform .35s cubic-bezier(0.2, 0, 0.1, 1), opacity .25s;
  min-width: 280px;
}
.toast.show {
  transform: translateX(0);
  opacity: 1;
}
.toast .toast-ico {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
}
.toast.success .toast-ico { background: rgba(20,160,107,0.20); color: #4dd49b; }
.toast.error   .toast-ico { background: rgba(220,40,65,0.20); color: #ff6478; }
.toast.info    .toast-ico { background: rgba(37,99,235,0.20); color: #6fa1ff; }
.toast.brand   .toast-ico { background: rgba(234,37,125,0.20); color: #ff6ba8; }
.toast .toast-ico svg { width: 14px; height: 14px; }
.toast .toast-body { flex: 1; min-width: 0; line-height: 1.45; }
.toast .toast-body strong { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 700; display: block; color: #fff; font-size: 13px; }
.toast .toast-body span { color: var(--lavender); font-size: 12px; }
.toast .toast-close {
  background: transparent; border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}
.toast .toast-close:hover { color: #fff; }
.toast .toast-close svg { width: 12px; height: 12px; }

/* ============================================================
   Mini-bar (used in landing-page table delta cells)
   ============================================================ */
.mini-hbar {
  display: inline-block;
  height: 6px;
  border-radius: 999px;
  background: var(--gradient);
  vertical-align: middle;
  min-width: 4px;
}
.mini-hbar.muted { background: var(--line-strong); }

/* ============================================================
   Three-dot popover menu
   ============================================================ */
.popover {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(15, 14, 20, 0.16);
  min-width: 180px;
  padding: 6px;
  z-index: 60;
  display: none;
}
.popover.open { display: block; animation: popIn .15s ease-out; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } }
.popover-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--heading);
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
  transition: background .15s;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}
.popover-item:hover { background: var(--surface-2); }
.popover-item.danger { color: var(--red); }
.popover-item.danger:hover { background: var(--red-soft); }
.popover-item svg { width: 14px; height: 14px; opacity: 0.7; }
.popover-divider { height: 1px; background: var(--line); margin: 4px 0; }


/* ---------- Bootstrap migration responsive helpers ---------- */
.sidebar-col { flex: 0 0 260px; max-width: 260px; }
@media (max-width: 991.98px) {
  .sidebar-col { display: none !important; }
  .topbar { padding-inline: 20px; }
  .page { padding: 20px 20px 40px; }
}
@media (max-width: 575.98px) {
  .topbar { height: auto; min-height: 64px; padding-block: 12px; flex-wrap: wrap; }
  .top-actions { flex-wrap: wrap; justify-content: flex-start; }
  .page-head h1 { font-size: 28px; }
  .field-row { grid-template-columns: 1fr; }
}


/* ---------- Mobile sidebar / Bootstrap offcanvas migration ---------- */
.mobile-menu-btn { display: none; }
.mobile-sidebar-offcanvas { background: var(--ink); color: var(--lavender); width: 280px !important; }
.mobile-sidebar-offcanvas .offcanvas-body { padding: 0; }
.mobile-sidebar-offcanvas .sidebar { position: static; height: auto; min-height: 100vh; border-right: 0; }
.mobile-sidebar-offcanvas .btn-close { filter: invert(1) grayscale(100%); opacity: .75; }
@media (max-width: 991.98px) {
  .mobile-menu-btn { display: inline-grid; }
  .topbar .crumbs { min-width: 0; }
  .topbar .crumbs strong, .topbar .crumbs span, .topbar .crumbs a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}


/* Bootstrap grid overrides for migrated two-column helper blocks */
.field-row.row, .settings-grid.row, .form-layout.row { display: flex; }
.settings-grid.row, .form-layout.row { align-items: flex-start; }


/*Custom CSS*/
.modal {
    position: relative;
    max-height: inherit;
    overflow: auto;
    height: auto;
}
@media(max-width:991px){
    .card.flush.table-responsive{
            overflow-x: auto
        }
}
/* ============================================================
   CARTOGRAPH-SPECIFIC EXTENSIONS
   Cluster cards, topical map, link audit, findings, briefs.
   ============================================================ */

/* Hero — used on dashboard.html */
.hero {
  position: relative;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  margin-bottom: 24px;
}
.hero::before, .hero::after { content: ""; position: absolute; z-index: 0; }
.hero::before {
  top: -40%; right: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(234,37,125,0.32) 0%, transparent 60%);
  animation: drift 14s ease-in-out infinite;
}
.hero::after {
  bottom: -50%; left: 30%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(118,51,151,0.30) 0%, transparent 60%);
  animation: drift 16s ease-in-out infinite reverse;
}
.hero-inner { position: relative; z-index: 1; }
.hero-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.18em;
  color: var(--lavender);
  text-transform: uppercase; font-weight: 600;
  margin-bottom: 12px;
  display: inline-flex; align-items: center; gap: 8px;
}
.hero-eyebrow::before { content: ""; width: 16px; height: 2px; background: var(--gradient); border-radius: 2px; }
.hero h1 { font-size: 38px; font-weight: 800; color: #fff; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 8px; }
.hero h1 em { font-style: normal; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { color: var(--lavender); font-size: 14.5px; max-width: 620px; line-height: 1.65; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; margin-top: 28px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.08); }
.hero-stat .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: rgba(205,191,214,0.7); font-weight: 600; margin-bottom: 6px; }
.hero-stat .val { font-family: "Plus Jakarta Sans", sans-serif; font-size: 36px; font-weight: 800; color: #fff; line-height: 1; letter-spacing: -0.02em; }
.hero-stat .delta { font-family: "JetBrains Mono", monospace; font-size: 11px; color: #4dd49b; margin-left: 10px; font-weight: 600; }
.hero-stat .delta.down { color: #ee7e9b; }

/* KPI grid for in-page use */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.kpi-tile .lbl { font-size: 12px; color: var(--body); font-weight: 500; margin-bottom: 8px; }
.kpi-tile .val { font-family: "Plus Jakarta Sans", sans-serif; font-size: 28px; font-weight: 800; color: var(--heading); line-height: 1; letter-spacing: -0.02em; }
.kpi-tile .val.green { color: var(--green); }
.kpi-tile .val.amber { color: var(--amber); }
.kpi-tile .val.blue { color: var(--blue); }
.kpi-tile .val.red { color: var(--red); }
.kpi-tile .sub { color: var(--muted); font-size: 11px; font-family: "JetBrains Mono", monospace; margin-top: 6px; }

/* Sparkline trends */
.spark { display: inline-block; vertical-align: middle; }
.spark.up polyline { stroke: var(--green); }
.spark.down polyline { stroke: var(--red); }
.spark.flat polyline { stroke: var(--muted); }

/* Cluster cards — used on cluster-board.html */
.cluster {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.cluster:hover { border-color: var(--line-strong); }
.cluster.open { box-shadow: var(--shadow); border-color: var(--line-strong); }
.cl-head { padding: 16px 22px; cursor: pointer; display: flex; align-items: center; gap: 16px; }
.cl-head:hover { background: var(--surface-2); }
.cluster.open .cl-head:hover { background: transparent; }
.cl-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 500; white-space: nowrap; flex-shrink: 0;
}
.cl-status.published { background: var(--green-soft); color: var(--green); }
.cl-status.approved { background: var(--teal-soft); color: var(--teal); }
.cl-status.partial { background: var(--amber-soft); color: var(--amber); }
.cl-status.planned, .cl-status.in_progress { background: var(--blue-soft); color: var(--blue); }
.cl-status.missing { background: var(--red-soft); color: var(--red); }
.cl-status.rejected { background: rgba(220,40,65,0.10); color: var(--red); }
.cl-status svg { width: 11px; height: 11px; flex-shrink: 0; }
.cl-title { flex: 1; min-width: 0; }
.cl-title .name { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 700; color: var(--heading); font-size: 15px; }
.cl-title .meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin-top: 3px; flex-wrap: wrap; }
.cl-title .meta .sep { color: var(--line-strong); }
.cl-rank { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.cl-rank-val { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--body); }
.cl-rank-val .up { color: var(--green); font-weight: 600; }
.cl-rank-val .down { color: var(--red); font-weight: 600; }
.cl-chev { width: 18px; height: 18px; color: var(--muted); transition: transform .2s; flex-shrink: 0; }
.cluster.open .cl-chev { transform: rotate(180deg); }
.cl-body { display: none; padding: 4px 22px 22px; border-top: 1px solid var(--line); }
.cluster.open .cl-body { display: block; }
.cl-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 14px; }
.cl-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 500; }
.cl-pill.high { background: var(--red-soft); color: var(--red); }
.cl-pill.med { background: var(--amber-soft); color: var(--amber); }
.cl-pill.low { background: var(--surface-2); color: var(--body); border: 1px solid var(--line); }
.cl-pill.rank { background: var(--surface-2); color: var(--body); border: 1px solid var(--line); font-family: "JetBrains Mono", monospace; }
.cl-pill.type { background: var(--blue-soft); color: var(--blue); }
.cl-pill.override { background: transparent; color: var(--body); border: 1px solid var(--line); cursor: pointer; transition: all .15s; }
.cl-pill.override:hover { border-color: var(--pink); color: var(--pink); }
.cl-pill svg { width: 11px; height: 11px; }

/* Brief blocks */
.brief-block { margin-bottom: 18px; }
.brief-block h4 { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 600; font-size: 12px; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.04em; }
.brief-block .body { color: var(--heading); font-size: 14px; font-weight: 600; }
.brief-block .desc { color: var(--body); font-size: 13.5px; margin-top: 2px; }

.struct { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.struct .h1l { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 700; font-size: 14px; color: var(--heading); display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.struct .htag { font-family: "JetBrains Mono", monospace; font-size: 9.5px; padding: 2px 6px; border-radius: 4px; font-weight: 600; flex-shrink: 0; }
.struct .htag-h1 { background: var(--blue-soft); color: var(--blue); }
.struct .htag-h2 { background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.struct .h2l { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--body); padding: 4px 0; }
.struct .caption { color: var(--muted); font-size: 12px; margin-top: 10px; font-style: italic; }

.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--heading); }
.task-item .cb { width: 18px; height: 18px; border: 1.5px solid var(--line-strong); border-radius: 5px; flex-shrink: 0; }

/* Claude suggestion card */
.claude-card { background: var(--gradient-soft); border: 1px solid var(--pink-soft); border-radius: var(--radius-sm); padding: 14px 16px; }
.claude-card .hd { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.claude-card .hd-title { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 600; font-size: 12.5px; color: var(--purple); }
.claude-card .hd svg { width: 13px; height: 13px; color: var(--pink); }
.claude-card .text { font-size: 13.5px; color: var(--heading); }

.brief-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Topical map */
.map-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.map-svg { display: block; width: 100%; height: auto; max-height: 640px; }
.node-label { font-size: 12px; fill: var(--heading); font-weight: 500; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.node-rank { font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: 13px; }
.map-node { cursor: pointer; transition: opacity .15s; }
.map-node:hover circle, .map-node:focus circle { filter: brightness(0.94); stroke-width: 4; }
.map-node:hover .node-label, .map-node:focus .node-label { font-weight: 700; }
.map-node:focus { outline: none; }
.spoke { stroke: var(--line-strong); stroke-width: 1.4; }
.spoke.dashed { stroke-dasharray: 4 4; opacity: 0.55; }

.map-legend { display: flex; align-items: center; gap: 22px; margin-top: 18px; padding: 14px 18px; background: var(--surface-2); border-radius: var(--radius); flex-wrap: wrap; font-size: 13px; color: var(--body); }
.map-legend .lgdot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 6px; border: 2px solid; }
.map-legend .lgdot.pub { background: rgba(20,160,107,0.18); border-color: var(--green); }
.map-legend .lgdot.pip { background: rgba(213,138,14,0.18); border-color: var(--amber); }
.map-legend .lgdot.miss { background: rgba(220,40,65,0.18); border-color: var(--red); }
.map-legend .lgdot.plan { background: rgba(37,99,235,0.18); border-color: var(--blue); }

/* Link audit */
.help-card { background: var(--blue-soft); border: 1px solid rgba(37,99,235,0.25); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 16px; }
.help-card .title { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 700; color: var(--blue); font-size: 14px; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.help-card .title svg { width: 16px; height: 16px; }
.help-card ol { list-style: none; padding: 0; margin: 0; counter-reset: step; color: var(--blue); font-size: 13.5px; line-height: 1.9; }
.help-card ol li { counter-increment: step; }
.help-card ol li::before { content: counter(step) ". "; font-weight: 600; }
.help-card code { background: rgba(37,99,235,0.10); padding: 1px 6px; border-radius: 4px; font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--blue); }

.drop-zone { background: var(--surface); border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 38px 24px; text-align: center; transition: all .2s; cursor: pointer; }
.drop-zone:hover { border-color: var(--pink); background: var(--pink-faint); }
.drop-zone .ic { width: 36px; height: 36px; color: var(--muted); margin: 0 auto 12px; }
.drop-zone .ic svg { width: 100%; height: 100%; }
.drop-zone .text { color: var(--body); font-size: 13.5px; margin-bottom: 14px; }

.finding { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.finding .hd { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 700; color: var(--heading); font-size: 14.5px; }
.finding .hd svg { width: 18px; height: 18px; flex-shrink: 0; }
.finding.high .hd, .finding.high .hd svg { color: var(--red); }
.finding.med .hd, .finding.med .hd svg { color: var(--amber); }
.finding.info .hd, .finding.info .hd svg { color: var(--blue); }
.finding.ok .hd, .finding.ok .hd svg { color: var(--green); }
.finding .detail { font-size: 13.5px; color: var(--body); margin-bottom: 6px; }
.finding .fix { font-size: 13.5px; color: var(--heading); }
.finding .fix b { font-weight: 600; }
.finding.high .fix b { color: var(--red); }
.finding.med .fix b { color: var(--amber); }
.finding.info .fix b { color: var(--blue); }
.finding.ok .fix b { color: var(--green); }

/* Pipeline steps */
.pipe-legend { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.pipe-leg { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--body); }
.pipe-leg .lgd { width: 12px; height: 12px; border-radius: 3px; }
.pipe-leg.human .lgd { background: var(--surface-2); border: 1px solid var(--line-strong); }
.pipe-leg.dfs .lgd { background: var(--blue-soft); }
.pipe-leg.code .lgd { background: var(--green-soft); }
.pipe-leg.claude .lgd { background: var(--gradient-soft); }
.pipe-leg.crawl .lgd { background: var(--amber-soft); }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 12px; box-shadow: var(--shadow-sm); display: flex; gap: 18px; align-items: flex-start; }
.step:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.step-num { width: 32px; height: 32px; flex-shrink: 0; background: var(--surface-2); border-radius: 8px; display: grid; place-items: center; font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: 14px; color: var(--body); }
.step-body { flex: 1; min-width: 0; }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.step-head .ttl { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 700; color: var(--heading); font-size: 15px; }
.step-tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 500; }
.step-tag.human { background: var(--surface-2); color: var(--body); border: 1px solid var(--line-strong); }
.step-tag.dfs { background: var(--blue-soft); color: var(--blue); }
.step-tag.code { background: var(--green-soft); color: var(--green); }
.step-tag.claude { background: var(--gradient-soft); color: var(--purple); }
.step-tag.crawl { background: var(--amber-soft); color: var(--amber); }
.step .desc { color: var(--body); font-size: 13.5px; }

/* Saved exports — file row */
.export-row { display: flex; align-items: center; gap: 14px; padding: 16px 22px; border-bottom: 1px solid var(--line); transition: background .15s; cursor: pointer; }
.export-row:hover { background: var(--pink-faint); }
.export-row:last-child { border-bottom: none; }
.export-icon { width: 38px; height: 38px; border-radius: 9px; background: var(--gradient); display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.export-icon svg { width: 18px; height: 18px; }
.export-body { flex: 1; min-width: 0; }
.export-name { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 700; color: var(--heading); font-size: 14px; margin-bottom: 2px; }
.export-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.export-meta .mono { font-family: "JetBrains Mono", monospace; }

/* Notification list item */
.notif-row { display: flex; gap: 14px; padding: 16px 22px; border-bottom: 1px solid var(--line); transition: background .15s; }
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: var(--surface-2); }
.notif-row.unread { background: var(--pink-faint); }
.notif-row.unread:hover { background: rgba(234,37,125,0.10); }
.notif-row { align-items: flex-start; }
.notif-delete { margin-left: auto; align-self: center; flex-shrink: 0; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.notif-row:hover .notif-delete { opacity: 1; }
.notif-delete:hover { background: var(--red-soft); color: var(--red); }
@media (hover: none) { .notif-delete { opacity: 1; } }
.notif-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.notif-icon.info { background: var(--blue-soft); color: var(--blue); }
.notif-icon.success { background: var(--green-soft); color: var(--green); }
.notif-icon.warn { background: var(--amber-soft); color: var(--amber); }
.notif-icon.error { background: var(--red-soft); color: var(--red); }
.notif-icon svg { width: 16px; height: 16px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 600; font-size: 14px; color: var(--heading); margin-bottom: 3px; }
.notif-text { font-size: 13px; color: var(--body); margin-bottom: 4px; }
.notif-time { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--muted); }

/* Topbar notif dropdown */
.bell-wrap { position: relative; }
.bell-pop {
  position: absolute;
  top: 46px; right: 0;
  width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: none;
  overflow: hidden;
}
.bell-pop.open { display: block; }
.bell-pop-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.bell-pop-head h4 { font-size: 14px; font-weight: 700; font-family: "Plus Jakarta Sans", sans-serif; }
.bell-pop-body { max-height: 380px; overflow-y: auto; }
.bell-pop-foot { padding: 12px 18px; border-top: 1px solid var(--line); text-align: center; }
.bell-pop-foot a { color: var(--pink); font-size: 13px; font-weight: 500; }

/* Head-topic status dot legend */
.cg-dot-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cg-dot-legend > span { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.cg-dot-legend .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* Link audit — two upload zones side by side */
.cg-audit-uploads { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 4px; }
@media (max-width: 760px) { .cg-audit-uploads { grid-template-columns: 1fr; } }
.cg-audit-upload { display: flex; flex-direction: column; }
.cg-au-head { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 700; font-size: 14px; color: var(--heading); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cg-au-head svg { width: 16px; height: 16px; color: var(--muted); }
.cg-au-tag { font-family: "DM Sans", sans-serif; font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg); border: 1px solid var(--line); padding: 1px 7px; border-radius: 999px; }
.cg-au-sub { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 10px; min-height: 34px; }
.cg-au-sub b { color: var(--body); font-weight: 600; }
.drop-zone.cg-au-drop { padding: 26px 16px; }
.drop-zone.cg-au-drop .text { font-size: 13px; }
.drop-zone.drag { border-color: var(--pink); background: var(--pink-faint); }
.cg-au-status { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

/* Global search dropdown */
.cg-search-wrap { position: relative; }
.cg-search-pop {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 420px;
  max-width: 90vw;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 48px rgba(15,14,20,0.16);
  z-index: 1200;
  overflow: hidden;
  max-height: 460px;
  overflow-y: auto;
  padding: 6px;
}
.cg-search-pop.open { display: block; }
.cg-search-group {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); padding: 10px 12px 5px;
}
.cg-search-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 9px; text-decoration: none;
  transition: background .12s;
}
.cg-search-item:hover { background: var(--surface-2); }
.cg-search-avatar {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 11px; font-family: "Plus Jakarta Sans", sans-serif;
}
.cg-search-ic-lead {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted);
}
.cg-search-ic-lead svg { width: 15px; height: 15px; }
.cg-search-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cg-search-title { font-size: 13.5px; font-weight: 600; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-search-title mark { background: var(--pink-faint); color: var(--pink); padding: 0 1px; border-radius: 2px; }
.cg-search-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-search-ic { color: var(--muted-2, #B7B2C4); flex-shrink: 0; }
.cg-search-ic svg { width: 14px; height: 14px; }
.cg-search-empty { padding: 22px 14px; text-align: center; color: var(--muted); font-size: 13px; }

/* Save indicator */
.save-state {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  padding: 4px 10px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
}
.save-state.saving { color: var(--blue); }
.save-state.saved { color: var(--green); }
.save-state .pulse { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.save-state.saving .pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Empty states */
.empty-state { text-align: center; padding: 60px 24px; }
.empty-state .ic { width: 64px; height: 64px; margin: 0 auto 18px; background: var(--surface-2); border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.empty-state .ic svg { width: 28px; height: 28px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--heading); margin-bottom: 6px; }
.empty-state p { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; max-width: 360px; margin-left: auto; margin-right: auto; }

/* ============================================================
   QA FIXES — applied after first headless QA pass
   ============================================================ */

/* Default SVG size inside any button so unsized icons don't render full-size */
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-lg svg { width: 16px; height: 16px; }
.btn-sm svg { width: 12px; height: 12px; }
.btn-ghost svg, .btn-dark svg { width: 14px; height: 14px; }

/* Coverage bars used in clients table and head topic cards */
.bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.bar > div {
  height: 100%;
  background: var(--gradient);
  border-radius: 999px;
  transition: width .3s ease;
}

/* Settings — slug input prefix is "cartograph.app/" which is wider than https:// */
/* Generic with-prefix needs more padding; widen when needed */
.input.with-prefix { padding-left: 145px; }

/* Tabs that use .pill-count badges */
.tabs button .pill-count { font-family: "JetBrains Mono", monospace; }

/* Make the checkbox match the new sizing in notification preferences */
.field-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--pink); }
input[type="checkbox"] { accent-color: var(--pink); }

/* Live/mock provider chips in topbar */
.cg-provider-chips {
  display: flex; gap: 6px; align-items: center; margin-right: 4px;
  flex-wrap: nowrap;
}
.cg-pc {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line);
  font-family: 'DM Sans', sans-serif; font-weight: 500;
  font-size: 11px; color: var(--body);
  white-space: nowrap;
}
.cg-pc-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 2px rgba(140,135,160,0.18);
}
.cg-pc.live { color: var(--green); border-color: rgba(20,160,107,0.18); background: var(--green-soft); }
.cg-pc.live .cg-pc-dot { background: var(--green); box-shadow: 0 0 0 2px rgba(20,160,107,0.18); }
.cg-pc.mock { color: var(--amber); border-color: rgba(213,138,14,0.18); background: var(--amber-soft); }
.cg-pc.mock .cg-pc-dot { background: var(--amber); box-shadow: 0 0 0 2px rgba(213,138,14,0.18); }

@media (max-width: 1100px) {
  .cg-provider-chips { display: none; }
}

/* Entity chips (obligatory entities) in cluster briefs */
.chiprow {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
}
.chip-en {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue);
  font-family: 'DM Sans', sans-serif; font-weight: 500;
  font-size: 12px; line-height: 1.3;
  border: 1px solid rgba(37,99,235,0.18);
  white-space: nowrap;
}
