/* ============================================================
   Xcerebro Clark County — Stylesheet
   Inspired by the ApexREI dashboard reference but tuned for
   pure intel use (no CRM bloat).

   Color tokens
     --navy-950 deep sidebar    --blue-500 accent action
     --slate-50 page bg          --emerald-500 good
     --slate-200 borders         --rose-500 distress
     --slate-700 text muted      --amber-500 warn
     --slate-900 text base       --violet-500 estate/probate
============================================================ */
:root {
  --navy-950: #0a1628;
  --navy-900: #0f1d33;
  --navy-800: #142747;
  --navy-700: #1c3157;

  --blue-50:  #eff6ff;
  --blue-100: #dbeafe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;

  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --emerald-50:  #ecfdf5;
  --emerald-500: #10b981;
  --emerald-600: #059669;

  --rose-50:  #fff1f2;
  --rose-500: #f43f5e;
  --rose-600: #e11d48;

  --amber-50:  #fffbeb;
  --amber-500: #f59e0b;
  --amber-600: #d97706;

  --violet-50:  #f5f3ff;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;

  --indigo-500: #6366f1;
  --cyan-500:   #06b6d4;

  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 12px rgba(15,23,42,0.06), 0 1px 3px rgba(15,23,42,0.04);
  --shadow-lg: 0 10px 40px rgba(15,23,42,0.10);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--slate-900);
  background: var(--slate-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ============== APP SHELL ============== */
#app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* ============== SIDEBAR ============== */
.sidebar {
  background: var(--navy-950);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px;
  gap: 20px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 16px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--blue-500), #60a5fa);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: white;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { line-height: 1.15; }
.brand-name { font-weight: 800; color: white; font-size: 16px; letter-spacing: -0.01em; }
.brand-county { font-size: 11px; color: var(--blue-500); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-link svg { width: 18px; height: 18px; }
.nav-link:hover {
  background: rgba(255,255,255,0.04);
  color: white;
}
.nav-link.active {
  background: var(--blue-500);
  color: white;
}

.sidebar-footer { margin-top: auto; }
.footer-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.05);
}
.footer-icon { font-size: 22px; }
.footer-title { font-weight: 700; color: white; font-size: 13px; }
.footer-sub { font-size: 11px; color: var(--slate-400); }

/* ============== MAIN ============== */
.main { padding: 0; min-width: 0; }

/* TOP BAR */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 32px;
  background: white;
  border-bottom: 1px solid var(--slate-200);
  position: sticky; top: 0; z-index: 30;
}
.topbar-menu {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--slate-200);
  background: white; border-radius: 8px;
  color: var(--slate-700);
}
.topbar-menu svg { width: 18px; height: 18px; }

.topbar-title { flex: 1; }
.topbar-title h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--slate-900); }
.topbar-title p { margin: 2px 0 0 0; font-size: 13px; color: var(--slate-500); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; background: var(--slate-100); border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--slate-700);
}
.topbar-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--slate-400); }
.topbar-pill .dot.live { background: var(--emerald-500); box-shadow: 0 0 0 4px rgba(16,185,129,0.2); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(16,185,129,0); } }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blue-500); color: white;
  border: none; padding: 8px 16px;
  border-radius: 8px; font-weight: 600; font-size: 13px;
  box-shadow: 0 1px 2px rgba(59,130,246,0.3);
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--blue-600); }

.btn-ghost {
  background: transparent; border: 1px solid var(--slate-200);
  color: var(--slate-700); padding: 8px 14px;
  border-radius: 8px; font-weight: 500; font-size: 13px;
}
.btn-ghost:hover { background: var(--slate-50); }

/* ============== VIEWS ============== */
.view { display: none; padding: 24px 32px; }
.view.active { display: block; }

/* ============== KPI STRIP ============== */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-card {
  background: white; border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex; gap: 12px; align-items: flex-start;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.kpi-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; font-size: 18px;
  flex-shrink: 0;
}
.kpi-icon svg { width: 20px; height: 20px; }
.kpi-icon-blue    { background: var(--blue-50);    color: var(--blue-600); }
.kpi-icon-red     { background: var(--rose-50);    color: var(--rose-600); }
.kpi-icon-violet  { background: var(--violet-50);  color: var(--violet-600); }
.kpi-icon-amber   { background: var(--amber-50);   color: var(--amber-600); }
.kpi-icon-indigo  { background: var(--violet-50);  color: var(--indigo-500); }
.kpi-icon-emerald { background: var(--emerald-50); color: var(--emerald-600); }
.kpi-icon-rose    { background: var(--rose-50);    color: var(--rose-600); }
.kpi-icon-cyan    { background: #ecfeff;           color: var(--cyan-500); }

.kpi-body { min-width: 0; flex: 1; }
.kpi-label { font-size: 11px; color: var(--slate-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-value { font-size: 22px; font-weight: 800; color: var(--slate-900); margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-tag { font-size: 10px; color: var(--slate-400); margin-top: 2px; font-weight: 500; }

/* ============== GRID ============== */
.grid-3col {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 1fr;
  gap: 16px;
  align-items: start;
}
.col-left, .col-mid, .col-right { display: flex; flex-direction: column; gap: 16px; }

/* ============== CARD ============== */
.card {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate-100);
}
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--slate-900); }
.card-sub { font-size: 12px; color: var(--slate-500); margin-top: 2px; }
.card-action {
  background: transparent; border: none; color: var(--blue-500);
  font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 6px;
}
.card-action:hover { background: var(--blue-50); }

/* ============== TIER FUNNEL ============== */
.tier-funnel {
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 20px;
  gap: 8px;
}
.tier-cell {
  text-align: center;
  padding: 16px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s;
}
.tier-cell:hover { transform: translateY(-2px); }
.tier-cell-emoji { font-size: 22px; }
.tier-cell-label { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-top: 4px; }
.tier-cell-count { font-size: 24px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tier-cell-eq { font-size: 11px; color: var(--slate-500); margin-top: 2px; }

.tier-cell.hot    { background: linear-gradient(135deg, var(--rose-50), white); border: 1px solid #fecdd3; color: var(--rose-600); }
.tier-cell.strong { background: linear-gradient(135deg, var(--violet-50), white); border: 1px solid #ddd6fe; color: var(--violet-600); }
.tier-cell.likely { background: linear-gradient(135deg, var(--amber-50), white); border: 1px solid #fde68a; color: var(--amber-600); }
.tier-cell.watch  { background: linear-gradient(135deg, var(--slate-100), white); border: 1px solid var(--slate-200); color: var(--slate-600); }
.tier-cell .tier-cell-count { color: inherit; }

.tier-totalbar {
  margin: 0 20px 20px 20px;
  padding: 12px 16px;
  background: var(--blue-50);
  border-radius: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.tier-total-label { font-size: 12px; font-weight: 600; color: var(--blue-700); }
.tier-total-val { font-size: 18px; font-weight: 800; color: var(--blue-700); font-variant-numeric: tabular-nums; }

/* ============== DEAL ANALYSIS ============== */
.deal-empty {
  text-align: center;
  padding: 30px 20px;
  color: var(--slate-500);
}
.deal-empty-icon { font-size: 28px; margin-bottom: 8px; }

.deal-body { padding: 20px; }
.deal-prop {
  display: grid; grid-template-columns: 60px 1fr; gap: 14px;
  margin-bottom: 16px;
}
.deal-thumb {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--slate-100), var(--blue-50));
  border-radius: 10px;
  display: grid; place-items: center; font-size: 28px;
}
.deal-addr { font-weight: 700; font-size: 14px; color: var(--slate-900); }
.deal-city { font-size: 12px; color: var(--slate-500); margin-top: 2px; }
.deal-tier-pill {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.deal-tier-pill.HOT    { background: var(--rose-50);    color: var(--rose-600); }
.deal-tier-pill.STRONG { background: var(--violet-50);  color: var(--violet-600); }
.deal-tier-pill.LIKELY { background: var(--amber-50);   color: var(--amber-600); }
.deal-tier-pill.WATCH  { background: var(--slate-100);  color: var(--slate-600); }

.deal-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 16px;
}
.deal-stat {
  background: var(--slate-50);
  border-radius: 8px; padding: 10px;
}
.deal-stat-label { font-size: 10px; color: var(--slate-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.deal-stat-val { font-size: 14px; font-weight: 700; color: var(--slate-900); margin-top: 3px; font-variant-numeric: tabular-nums; }
.deal-stat-val.accent { color: var(--blue-600); }
.deal-stat-val.accent-good { color: var(--emerald-600); }

.deal-flags {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.flag-chip {
  font-size: 11px; padding: 3px 8px;
  border-radius: 999px;
  background: var(--slate-100); color: var(--slate-700);
  font-weight: 500;
}
.flag-chip.heavy { background: var(--rose-50); color: var(--rose-600); font-weight: 600; }
.flag-chip.life  { background: var(--violet-50); color: var(--violet-600); font-weight: 600; }
.flag-chip.equity{ background: var(--emerald-50); color: var(--emerald-600); font-weight: 600; }

.deal-ai {
  background: linear-gradient(135deg, var(--blue-50), white);
  border: 1px solid var(--blue-100);
  border-radius: 10px;
  padding: 14px; margin-bottom: 14px;
}
.ai-pill {
  font-size: 11px; font-weight: 700; color: var(--blue-700);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.ai-pill em { font-style: normal; background: var(--blue-500); color: white; padding: 1px 6px; border-radius: 999px; font-size: 9px; margin-left: 4px; }
.deal-ai-body { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--slate-700); white-space: pre-wrap; }

.deal-actions { display: flex; gap: 8px; }

/* ============== MAP ============== */
.map-card .card-head { border-bottom: none; }
.map-canvas {
  height: 480px; border-radius: 0 0 var(--radius-md) var(--radius-md);
  z-index: 1;
}
.map-legend {
  display: flex; gap: 16px;
  padding: 12px 20px;
  background: var(--slate-50);
  border-top: 1px solid var(--slate-200);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.legend-item { font-size: 12px; color: var(--slate-700); display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-hot { background: var(--rose-500); }
.dot-strong { background: var(--violet-500); }
.dot-likely { background: var(--amber-500); }

/* ============== FULL MAP VIEW ============== */
.map-canvas-full {
  height: 750px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  z-index: 1;
}
@media (max-width: 900px) {
  .map-canvas-full { height: 500px; }
}

/* ============== ACTIVITY ============== */
.activity-stream {
  display: flex; flex-direction: column;
  max-height: 600px; overflow-y: auto;
}
.activity-item {
  display: flex; gap: 12px; padding: 12px 20px;
  border-bottom: 1px solid var(--slate-100);
  cursor: pointer;
  transition: background 0.15s;
}
.activity-item:hover { background: var(--slate-50); }
.activity-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--slate-100); display: grid; place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}
.activity-body { flex: 1; min-width: 0; }
.activity-name { font-weight: 600; font-size: 13px; color: var(--slate-900); }
.activity-loc  { font-size: 12px; color: var(--slate-500); }
.activity-tag {
  display: inline-block; margin-top: 4px;
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.activity-tag.HOT    { background: var(--rose-50);    color: var(--rose-600); }
.activity-tag.STRONG { background: var(--violet-50);  color: var(--violet-600); }
.activity-tag.LIKELY { background: var(--amber-50);   color: var(--amber-600); }
.activity-tag.WATCH  { background: var(--slate-100);  color: var(--slate-600); }
.activity-meta { text-align: right; font-size: 11px; color: var(--slate-400); }

/* ============== LEADS TABLE ============== */
.leads-toolbar {
  background: white; border: 1px solid var(--slate-200); border-radius: var(--radius-md);
  padding: 16px 20px; margin-bottom: 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.toolbar-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.toolbar-row.chips { gap: 6px; }

.search-wrap { flex: 1; min-width: 240px; }
.search-wrap input {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--slate-200); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: var(--slate-50);
}
.search-wrap input:focus { outline: 2px solid var(--blue-500); border-color: transparent; background: white; }

.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 11px; font-weight: 600; color: var(--slate-500); text-transform: uppercase; letter-spacing: 0.04em; }
.filter-group select {
  padding: 7px 10px; border: 1px solid var(--slate-200); border-radius: 8px;
  background: white; font-size: 13px; font-family: inherit;
}

.flag-chip-toggle {
  font-size: 11px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--slate-200); background: white; color: var(--slate-700);
  cursor: pointer; transition: all 0.15s; font-weight: 500;
}
.flag-chip-toggle:hover { border-color: var(--blue-500); color: var(--blue-600); }
.flag-chip-toggle.on {
  background: var(--blue-500); color: white; border-color: var(--blue-500);
}

.leads-table-wrap {
  background: white; border: 1px solid var(--slate-200); border-radius: var(--radius-md);
  overflow: hidden;
}
.leads-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.leads-table th {
  text-align: left; padding: 12px 16px;
  background: var(--slate-50); color: var(--slate-500);
  font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--slate-200);
}
.leads-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: top;
}
.leads-table tr:hover td { background: var(--slate-50); }

.leads-paging {
  display: flex; justify-content: center; align-items: center;
  gap: 14px; padding: 14px;
  border-top: 1px solid var(--slate-100);
}

/* ============== MANUAL SOURCES ============== */
.sources-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px; padding: 20px;
}
.source-card {
  background: var(--slate-50);
  border: 1px solid var(--slate-200); border-radius: var(--radius-md);
  padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.source-card h4 { margin: 0; font-size: 14px; font-weight: 700; }
.source-card p { margin: 0; font-size: 12px; color: var(--slate-600); line-height: 1.5; }
.source-meta { font-size: 11px; color: var(--slate-500); }
.source-meta .ok { color: var(--emerald-600); font-weight: 600; }
.source-meta .stale { color: var(--amber-600); font-weight: 600; }
.source-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ============== EXPORTS ============== */
.exports-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px; padding: 20px;
}
.export-card {
  background: var(--slate-50);
  border: 1px solid var(--slate-200); border-radius: var(--radius-md);
  padding: 16px;
}
.export-icon { font-size: 28px; margin-bottom: 8px; }
.export-card h4 { margin: 0 0 6px 0; font-size: 14px; font-weight: 700; }
.export-card p { margin: 0 0 12px 0; font-size: 12px; color: var(--slate-600); line-height: 1.5; }
.export-actions { display: flex; gap: 8px; align-items: center; }
.export-actions select {
  flex: 1; padding: 7px 10px; border: 1px solid var(--slate-200); border-radius: 8px;
  background: white; font-size: 12px; font-family: inherit;
}

/* ============== DOCS ============== */
.docs-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px; padding: 20px;
}
.docs-grid h4 { margin: 0 0 6px 0; font-size: 13px; font-weight: 700; color: var(--blue-600); text-transform: uppercase; letter-spacing: 0.04em; }
.docs-grid p { margin: 0; font-size: 13px; color: var(--slate-700); line-height: 1.6; }

/* ============== MODAL ============== */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.5);
  display: grid; place-items: center;
  z-index: 100;
}
.modal-back[hidden] { display: none !important; }
.modal {
  width: 480px; max-width: 90vw;
  background: white; border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.slide-over {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 800px; max-width: 100vw;
  background: white;
  box-shadow: -10px 0 40px rgba(15,23,42,0.15);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.lm-section {
  padding: 20px;
  border-bottom: 1px solid var(--slate-100);
}
.lm-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--slate-900);
}
.lm-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.lm-table th {
  text-align: left; padding: 8px 12px;
  background: var(--slate-50); color: var(--slate-500);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--slate-200);
}
.lm-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: top;
}
.lm-empty {
  color: var(--slate-500); font-size: 12px; font-style: italic;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate-100);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close {
  background: transparent; border: none; font-size: 22px;
  color: var(--slate-400); cursor: pointer; line-height: 1;
}
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.modal-sub { margin: 0; font-size: 13px; color: var(--slate-600); line-height: 1.5; }
.modal-link { color: var(--blue-600); font-weight: 600; font-size: 12px; }
.modal-link:hover { text-decoration: underline; }
.modal-body input[type="file"] {
  font-size: 12px; padding: 10px; background: var(--slate-50);
  border: 1px dashed var(--slate-300); border-radius: 8px; cursor: pointer;
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal-result {
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
}
.modal-result.ok    { background: var(--emerald-50); color: var(--emerald-600); }
.modal-result.err   { background: var(--rose-50); color: var(--rose-600); }

/* ============== RESPONSIVE ============== */
@media (max-width: 1280px) {
  .kpi-strip { grid-template-columns: repeat(4, 1fr); }
  .grid-3col { grid-template-columns: 1fr 1fr; }
  .col-right { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .grid-3col { grid-template-columns: 1fr; }
}
/* ============== AUDIT / CRON STATUS ============== */
.audit-table-wrap { overflow-x: auto; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.audit-table th {
  text-align: left; padding: 12px 16px;
  background: var(--slate-50); color: var(--slate-500);
  font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--slate-200);
}
.audit-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--slate-100);
}
.status-pill {
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.status-success { background: var(--emerald-50); color: var(--emerald-600); }
.status-running { background: var(--amber-50); color: var(--amber-600); }
.status-error { background: var(--rose-50); color: var(--rose-600); }

.checkpoint-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px; padding: 20px;
}
.checkpoint-card {
  background: var(--slate-50); border: 1px solid var(--slate-200);
  border-radius: var(--radius-md); padding: 16px;
}
.checkpoint-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px;
}
.checkpoint-head h4 { margin: 0; font-size: 14px; font-weight: 700; color: var(--slate-900); }
.checkpoint-date { font-size: 11px; color: var(--slate-500); }
.checkpoint-state {
  margin: 0; font-family: var(--font-mono); font-size: 12px;
  background: white; border: 1px solid var(--slate-200);
  border-radius: 6px; padding: 10px; overflow: auto; max-height: 200px;
}

.badge-outline {
  padding: 2px 6px; border: 1px solid var(--slate-300); border-radius: 4px;
  font-size: 11px; color: var(--slate-600); font-weight: 500;
}
.text-sub { color: var(--slate-500); font-size: 12px; }
.loading, .empty, .error { padding: 40px; text-align: center; color: var(--slate-500); }
.error { color: var(--rose-600); font-weight: 600; }
