/*
 * CIS admin UI stylesheet — hand-authored reproduction of the Verona Shelters CPQ
 * look (docs/ui-guidelines.md; reference pages in design/). No build step, no CDN:
 * tokens + component classes mirror the reference class names so server-rendered
 * markup reads like it. Self-hosted Mona Sans (OFL-1.1); CSP stays font-src 'self'.
 */

/* --- Self-hosted Mona Sans (variable) ------------------------------------- */
@font-face {
  font-family: "Mona Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(/static/fonts/mona-sans-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Mona Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(/static/fonts/mona-sans-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Brand */
  --vs-blue:        #0a2367;
  --vs-blue-light:  #1760c4;
  --vs-cta:         #885d39;
  --vs-gold:        #c79761;
  --vs-green:       #16a34a;
  --vs-cool:        #edf1f4;
  --vs-dark:        #262324;
  --vs-white:       #ffffff;

  /* Semantic */
  --background: var(--vs-cool);
  --surface:    var(--vs-white);
  --foreground: var(--vs-dark);
  --muted:      #7a8599;
  --border:       #d8dde6;
  --border-light: #e8ecf2;

  /* Radius */
  --radius:     4px;
  --radius-md:  6px;
  --radius-lg:  0.5rem;
  --radius-xl:  0.75rem;

  --sidebar-width: 260px;

  --font-sans: "Mona Sans Variable", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--foreground);
  background: var(--background);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--vs-blue-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Login (split screen) ------------------------------------------------- */
.login-shell { min-height: 100vh; display: flex; background: var(--vs-blue); }
.login-brand {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  width: 50%;
}
.login-brand .brand-row { display: flex; align-items: center; gap: 0.75rem; }
.login-brand img { width: 40px; height: 40px; }
.login-brand .brand-name { color: #fff; font-weight: 600; font-size: 1.125rem; letter-spacing: 0.02em; }
.login-brand .brand-tag { color: var(--vs-gold); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; margin-left: 0.5rem; }
.login-brand h1 { font-size: 2.25rem; font-weight: 300; color: #fff; line-height: 1.15; margin: 0 0 1rem; }
.login-brand h1 .accent { font-weight: 600; color: var(--vs-gold); }
.login-brand p.lede { color: rgba(255,255,255,0.5); font-size: 0.875rem; max-width: 28rem; line-height: 1.6; }
.login-brand p.copyright { color: rgba(255,255,255,0.2); font-size: 0.75rem; }

.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  background: var(--vs-cool);
}
.login-form-panel .inner { width: 100%; max-width: 24rem; }
.login-form-panel h2 { font-size: 1.25rem; font-weight: 600; color: var(--vs-dark); margin: 0 0 0.25rem; }
.login-form-panel p.sub { font-size: 0.875rem; color: var(--muted); margin: 0 0 2rem; }
.login-error {
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  border-radius: var(--radius-lg); padding: 0.625rem 0.875rem; font-size: 0.8125rem; margin-bottom: 1.25rem;
}

/* Inline page banners (CIS-57): a warn (amber) and a danger (red) notice above a list. */
.banner {
  border-radius: var(--radius-lg); padding: 0.625rem 0.875rem; font-size: 0.8125rem; margin-bottom: 1rem;
}
.banner-warn { background: #fef3c7; border: 1px solid #fde68a; color: #92400e; }
.banner-danger { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }

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

/* --- Buttons -------------------------------------------------------------- */
.btn {
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.15s;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--vs-cta); color: #fff; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-secondary { background: var(--vs-blue); color: #fff; }
.btn-secondary:hover { filter: brightness(1.1); }
.btn-outline { background: transparent; color: var(--vs-blue); border-color: var(--border); }
.btn-outline:hover { background: #fff; border-color: var(--vs-blue-light); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--vs-dark); }
.btn.w-full { width: 100%; }
.btn.py-lg { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.btn svg { width: 1rem; height: 1rem; }

/* --- Inputs --------------------------------------------------------------- */
.input, select.input {
  border: 1px solid var(--border);
  background: var(--surface);
  width: 100%;
  border-radius: var(--radius-lg);
  height: 2.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--foreground);
}
.input:focus, select.input:focus {
  outline: none;
  border-color: var(--vs-blue-light);
  box-shadow: 0 0 0 3px rgba(23,96,196,0.12);
}
label.field-label { display: block; font-size: 0.75rem; font-weight: 500; color: var(--vs-dark); margin-bottom: 0.375rem; }

/* --- Cards ---------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: 0 1px 2px #0000000a;
  padding: 1.25rem;
}

/* --- App shell (sidebar + main) ------------------------------------------- */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--vs-blue);
  display: flex;
  flex-direction: column;
  z-index: 40;
}
.sidebar .sidebar-top { display: flex; align-items: center; gap: 0.75rem; padding: 1.25rem 1.25rem 1rem; }
.sidebar .sidebar-top img { width: 32px; height: 32px; }
.sidebar .sidebar-top .name { color: #fff; font-weight: 600; font-size: 1rem; }
.sidebar .sidebar-top .tag { color: var(--vs-gold); font-size: 0.625rem; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; }
.sidebar nav { flex: 1; padding: 0.5rem 0.75rem; display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar .nav-section { color: rgba(255,255,255,0.4); font-size: 0.625rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.75rem 0.75rem 0.25rem; }
.sidebar nav a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0.75rem; border-radius: var(--radius);
  font-size: 0.875rem; color: rgba(255,255,255,0.6);
}
.sidebar nav a:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.1); text-decoration: none; }
.sidebar nav a.active { background: rgba(255,255,255,0.15); color: #fff; font-weight: 500; }
.sidebar .sidebar-bottom { padding: 1rem 0.75rem; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar .sidebar-bottom .user { color: rgba(255,255,255,0.7); font-size: 0.75rem; padding: 0 0.75rem 0.5rem; word-break: break-all; }

.main { margin-left: var(--sidebar-width); padding: 2rem; }
.main .page-header { margin-bottom: 1.5rem; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.main h1 { font-size: 1.25rem; font-weight: 700; color: var(--vs-dark); letter-spacing: -0.01em; margin: 0; }
.main .page-header p.sub { color: var(--muted); font-size: 0.875rem; margin: 0.25rem 0 0; }

/* --- Help icon + plain-language modal (CIS-48; UI-standard, no JS, native <details>) --------- */
/* The summary is the `?` icon; opening the <details> reveals a fixed centered modal over a dimmed
   backdrop. No JS: clicking the `?` again closes it (the open summary sits above the backdrop). */
.help { position: relative; flex: none; }
.help > summary.help-icon {
  list-style: none; cursor: pointer; user-select: none;
  width: 1.875rem; height: 1.875rem;
  border-radius: 9999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--vs-blue); font-weight: 700; font-size: 1rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.help > summary.help-icon::-webkit-details-marker { display: none; }
.help > summary.help-icon::marker { content: ""; }
.help > summary.help-icon:hover { background: var(--vs-blue); color: #fff; border-color: var(--vs-blue); }
.help[open] > summary.help-icon { background: var(--vs-blue); color: #fff; border-color: var(--vs-blue); position: relative; z-index: 60; }
.help .help-backdrop { display: none; }
.help[open] .help-backdrop { display: block; position: fixed; inset: 0; background: rgba(10,35,103,0.35); z-index: 50; }
.help .help-modal { display: none; }
.help[open] .help-modal {
  display: block; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 55; width: min(34rem, calc(100vw - 2rem)); max-height: 80vh; overflow-y: auto;
  background: var(--surface); border-radius: var(--radius-xl);
  box-shadow: 0 12px 48px rgba(10,35,103,0.28); padding: 1.5rem 1.75rem; text-align: left;
}
.help-modal-title { font-size: 1.0625rem; font-weight: 700; color: var(--vs-dark); margin: 0 0 0.5rem; }
.help-modal h3 { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 1.1rem 0 0.35rem; font-weight: 600; }
.help-modal p { font-size: 0.875rem; color: var(--vs-dark); margin: 0 0 0.5rem; line-height: 1.55; }
.help-modal ul { margin: 0; padding-left: 1.1rem; }
.help-modal li { font-size: 0.875rem; color: var(--vs-dark); margin-bottom: 0.35rem; line-height: 1.5; }
.help-close-hint { color: var(--muted) !important; font-size: 0.8125rem !important; margin: 1.1rem 0 0 !important; }

/* --- KPI tiles + structural grids (CIS-48 follow-up) ----------------------- */
/* These were previously expressed as inline `style="display:grid;…"` on the elements, but the
   strict CSP (style-src 'self', no 'unsafe-inline') drops inline style attributes in the browser,
   so the KPI cards stacked and the stat numbers/labels were unstyled. Defining them as real classes
   (served from this stylesheet, not inline) makes them apply. Broader inline-style→class cleanup of
   the rest of the admin UI is tracked in docs/BACKLOG.md [CIS-48R]. */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-num { font-size: 1.5rem; font-weight: 700; color: var(--vs-dark); line-height: 1.1; letter-spacing: -0.01em; }
.stat-label { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }
.detail-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }

/* --- Badge ---------------------------------------------------------------- */
.badge {
  text-transform: uppercase; letter-spacing: 0.025em; border-radius: 9999px;
  padding: 0.25rem 0.625rem; font-size: 0.6875rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 0.25rem;
}
.badge.info { background: #dbeafe; color: #1e40af; }
.badge.success { background: #dcfce7; color: #166534; }
.badge.neutral { background: #f1f5f9; color: #475569; }

.badge.danger { background: #fee2e2; color: #991b1b; }
.badge.warning { background: #fef3c7; color: #92400e; }

/* --- Tables --------------------------------------------------------------- */
.vs-table { border-collapse: collapse; width: 100%; }
.vs-table th {
  text-align: left; text-transform: uppercase; font-size: 0.625rem; letter-spacing: 0.08em;
  color: var(--muted); background: linear-gradient(var(--vs-cool), #fff);
  border-bottom: 1px solid var(--border); padding: 0.75rem 1rem; font-weight: 600;
}
.vs-table td { font-size: 0.875rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.vs-table tbody tr:last-child td { border-bottom: none; }
.mono { font-family: var(--font-mono); font-size: 0.8125rem; }

.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; border-radius: var(--radius); }

/* --- Dashboard filter panel (CIS-44) -------------------------------------- */
/* Compact, ~⅓-smaller controls so the many filters don't dominate the screen,
   scoped to .filter-panel so other admin pages keep the default control size. */
.filter-panel .filter-bar { display: flex; gap: 0.4rem 0.5rem; align-items: flex-end; flex-wrap: wrap; }
.filter-panel .field-label { font-size: 0.625rem; margin-bottom: 0.15rem; }
.filter-panel .input,
.filter-panel select.input { height: 1.6rem; padding: 0.15rem 0.4rem; font-size: 0.75rem; border-radius: var(--radius); }
/* Apply/Reset always sit on their own row, pushed to the right. */
.filter-panel .filter-actions { flex-basis: 100%; display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }

/* "Advanced" drawer for ops/security filters (Status / Flagged content / Personal data), CIS-52.
   Native <details> (zero JS, CSP-safe) — same pattern as the help modal; spans its own row. */
.filter-panel .filter-advanced { flex-basis: 100%; margin-top: 0.1rem; }
.filter-panel .filter-advanced > summary {
  cursor: pointer; width: max-content; padding: 0.1rem 0; list-style: none;
  font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted);
}
.filter-panel .filter-advanced > summary::-webkit-details-marker { display: none; }
.filter-panel .filter-advanced > summary::marker { content: ""; }
.filter-panel .filter-advanced > summary::before { content: "\25B8  "; }
.filter-panel .filter-advanced[open] > summary::before { content: "\25BE  "; }
.filter-panel .filter-advanced-body { display: flex; gap: 0.4rem 0.75rem; align-items: flex-end; flex-wrap: wrap; margin-top: 0.4rem; }
.filter-panel .filter-advanced .adv-check { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.15rem; }

/* --- Dashboard chart grid (CIS-45) ---------------------------------------- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.chart-card h3 { margin: 0 0 0.625rem; font-size: 0.8125rem; font-weight: 600; color: var(--vs-dark); }
/* Chart.js needs a sized, positioned parent (responsive + maintainAspectRatio:false). */
.chart-box { position: relative; height: 240px; }

/* --- Dashboard digest-parity sections (CIS-46) ---------------------------- */
.dash-section-h { margin: 0 0 0.625rem; font-size: 0.9375rem; font-weight: 600; color: var(--vs-dark); }
.dash-2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }

/* --- Dashboard | Map tabs (CIS-47) ---------------------------------------- */
/* Server-side tabs: each is a plain link to its route (filters ride along in the query). */
.tab-bar { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.tab-bar .tab { padding: 0.5rem 0.95rem; font-size: 0.875rem; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab-bar .tab:hover { color: var(--vs-dark); text-decoration: none; }
.tab-bar .tab.active { color: var(--vs-blue); border-bottom-color: var(--vs-cta); }

/* --- Map tab (CIS-48): vendored Leaflet country map + marker side-panel ------ */
.map-card { padding: 0.75rem; }
/* The shell is the stacking context for the map + its overlay panel: `position:relative; z-index:0`
   confines Leaflet's internal pane/popup z-indexes (up to ~700) AND the panel below it, so the
   sidebar (z 40) and the help modal (z 50+) always paint above the whole map. */
.map-shell { position: relative; z-index: 0; }
.map-box { position: relative; z-index: 0; height: min(70vh, 640px); min-height: 24rem; width: 100%; border-radius: var(--radius-lg); background: var(--vs-cool); }
.map-caption { margin: 0.6rem 0.25rem 0.1rem; }

/* Marker side-panel: overlays the right edge of the map (doesn't resize it). JS toggles `hidden`. */
.map-panel {
  position: absolute; top: 0.5rem; right: 0.5rem; bottom: 0.5rem; z-index: 1000;
  width: min(22rem, calc(100% - 1rem));
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: 0 8px 28px rgba(10,35,103,0.18);
}
.map-panel[hidden] { display: none; }
.map-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.75rem 0.875rem 0.5rem; border-bottom: 1px solid var(--border-light); }
.map-panel-title { margin: 0; font-size: 0.9375rem; font-weight: 700; color: var(--vs-dark); }
.map-panel-close { border: none; background: transparent; cursor: pointer; font-size: 1.25rem; line-height: 1; color: var(--muted); padding: 0 0.25rem; }
.map-panel-close:hover { color: var(--vs-dark); }
.map-panel-meta { margin: 0; padding: 0.4rem 0.875rem; font-size: 0.75rem; color: var(--muted); border-bottom: 1px solid var(--border-light); }
.map-panel-list { overflow-y: auto; padding: 0.25rem 0.5rem 0.5rem; }
.map-panel-empty { color: var(--muted); font-size: 0.8125rem; padding: 0.5rem 0.375rem; margin: 0; }
.map-signal { padding: 0.5rem 0.375rem; border-bottom: 1px solid var(--border-light); }
.map-signal:last-child { border-bottom: none; }
.map-signal-headline { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--vs-blue-light); line-height: 1.35; }
.map-signal-meta { margin-top: 0.2rem; font-size: 0.6875rem; color: var(--muted); font-family: var(--font-mono); }
@media (max-width: 640px) { .map-panel { width: calc(100% - 1rem); } }

@media (max-width: 800px) { .hide-sm { display: none; } }

/* --- Forms ---------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; }
.form-grid .form-full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* --- Key/value + payload (job detail) ------------------------------------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin: 0 0 1rem; }
.kv dt { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.kv dd { margin: 0; font-size: 0.875rem; }
.payload {
  background: var(--vs-dark); color: #e6edf3; border-radius: var(--radius-lg);
  padding: 0.875rem 1rem; font-family: var(--font-mono); font-size: 0.75rem;
  overflow-x: auto; white-space: pre-wrap; word-break: break-word; margin: 0.25rem 0 0;
}

/* --- Public intake form --------------------------------------------------- */
.intake-shell { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 2.5rem 1rem; }
.intake-card { width: 100%; max-width: 32rem; }
.intake-card h1 { font-size: 1.375rem; font-weight: 700; color: var(--vs-dark); margin: 0.25rem 0 0.25rem; }
.intake-card .sub { color: var(--muted); font-size: 0.875rem; margin: 0 0 1.25rem; }
.intake-card .field-label { margin-top: 0.875rem; }
.intake-brand { color: var(--vs-blue); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.12em; }
.intake-textarea { height: auto; min-height: 8rem; resize: vertical; line-height: 1.5; }
.intake-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 1.5rem; }

/* --- One-click feedback (confirm + saved) -------------------------------- */
.feedback-headline { font-weight: 600; color: var(--vs-blue); font-size: 1.0625rem; line-height: 1.4; margin: 0 0 0.75rem; }
.feedback-alt-label { margin: 1.25rem 0 0.5rem !important; }
.feedback-alts { display: flex; gap: 0.5rem; }
.feedback-alts .btn { flex: 1; }
.feedback-alts-center { justify-content: center; }
/* Save = the primary action, separated from the verdict switches by a divider. */
.feedback-save { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); margin-bottom: 0; }
.feedback-close { margin: 1.5rem 0 0 !important; font-size: 0.8125rem; }

/* --- Standalone error page ------------------------------------------------ */
.error-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.error-shell .card { max-width: 28rem; text-align: center; }
.error-shell h1 { font-size: 1.125rem; font-weight: 600; margin: 0 0 0.5rem; }
.error-shell p { color: var(--muted); font-size: 0.875rem; margin: 0 0 1.25rem; }

/* === Signal detail (CIS-53): 2/3 + 1/3 hero + collapsible technical drawer =============== */
.sig-hero { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; align-items: start; }
@media (max-width: 860px) { .sig-hero { grid-template-columns: 1fr; } }
.sig-main { min-width: 0; }
.sig-rail { display: flex; flex-direction: column; gap: 1rem; }

.sig-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.pill { display: inline-flex; align-items: center; padding: 0.18rem 0.6rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; background: var(--vs-cool); color: var(--vs-blue); border: 1px solid var(--border); }
.pill.status { background: #eef1f6; color: var(--vs-dark); }
.pill.warn { background: #fde7e1; color: #a23a1a; border-color: #f3c9bd; }
.pill.muted { background: transparent; color: var(--muted); }
.pill.prio-today { background: var(--vs-cta); color: #fff; border-color: var(--vs-cta); }
.pill.prio-week { background: #fbf0dd; color: #8a6322; border-color: #ecd9b3; }
.pill.prio-fyi { background: #e9eef5; color: #3a4a66; border-color: #d6deeb; }

/* Hero KPI tiles — tighter than the dashboard's; reuse .stat-num/.stat-label. */
.sig-tiles { grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.sig-tiles .stat { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 0.7rem 0.85rem; }
.sig-tiles .stat-num { font-size: 1.35rem; }
.sig-tiles .stat-num.sig-threat { font-size: 0.95rem; line-height: 1.3; }
.sig-tiles .stat-num.score-high { color: var(--vs-cta); }
.sig-tiles .stat-num.score-mid { color: var(--vs-gold); }
.sig-tiles .stat-num.score-low { color: var(--muted); }

.sig-block { margin-bottom: 1rem; }
.sig-section { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 0.5rem; font-weight: 600; }
.sig-summary { margin: 0; font-size: 1rem; line-height: 1.55; }
/* Original intake message — the dealer's verbatim words, shown as a readable quote (not the
   technical mono <pre> in the drawer). pre-wrap preserves line breaks; eta escapes the text. */
.sig-message { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; color: var(--vs-dark); border-left: 3px solid var(--vs-gold); padding-left: 0.85rem; }

.sig-decision .sig-current { margin: 0 0 0.6rem; font-size: 0.85rem; }
.sig-decision-btns { display: flex; flex-direction: column; gap: 0.45rem; }
.sig-decision-btns form { margin: 0; }
.sig-decision-btns .btn { width: 100%; }
.sig-decision-btns .btn.is-current { outline: 2px solid var(--vs-blue); outline-offset: 1px; }
.sig-facts .kv { margin: 0; }

/* Pipedrive card (CIS-54): sync-state pills + the two-step "Send to Pipedrive" confirm. */
.sig-pipedrive .pill { margin: 0; }
.pill.pd-in { background: #e6f4ea; color: var(--vs-green); border-color: #bfe3c9; }
.pill.pd-queued { background: #fbf0dd; color: #8a6322; border-color: #ecd9b3; }
.pill.pd-out { background: #eef1f6; color: var(--vs-dark); }
/* Native <details>, zero-JS / CSP-safe: the summary is the primary action; expanding reveals the
   live-CRM warning + the CSRF-guarded confirm POST. Re-clicking the summary collapses (cancels). */
.confirm-send { margin-top: 0.6rem; }
.confirm-send > summary { display: inline-flex; align-items: center; justify-content: center; width: 100%; cursor: pointer; list-style: none; background: var(--vs-cta); color: #fff; border-radius: var(--radius); padding: 0.4rem 0.8rem; font-size: 0.8rem; font-weight: 500; }
.confirm-send > summary::-webkit-details-marker { display: none; }
.confirm-send > summary::marker { content: ""; }
.confirm-send[open] > summary { background: var(--muted); }
.confirm-send-body { margin-top: 0.5rem; padding: 0.65rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--vs-cool); }
.confirm-send-body .btn { width: 100%; }

/* Technical drawer — native <details>, zero JS, CSP-safe (same pattern as the help modal). */
.tech-drawer { border-top: 1px solid var(--border); padding-top: 0.75rem; margin-top: 0.5rem; }
.tech-drawer > summary { cursor: pointer; list-style: none; width: max-content; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 0.2rem 0; }
.tech-drawer > summary::-webkit-details-marker { display: none; }
.tech-drawer > summary::marker { content: ""; }
.tech-drawer > summary::before { content: "\25b8  "; }
.tech-drawer[open] > summary::before { content: "\25be  "; }
.tech-drawer-body { margin-top: 1rem; }
