/* PAM — Civic Clarity design system
   Direction: white/blue/flat — institutional clarity
   Updated: 2026-04-28 */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Skip-to-content link (accessibility) */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    padding: 8px 16px;
    background: var(--coral);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    z-index: 9999;
}
.skip-link:focus { left: 8px; }

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

:root {
  /* ── Backgrounds ── */
  --bg:        #FFFFFF;
  --surface:   #FFFFFF;
  --surface-2: #F4F6F9;
  --surface-3: #EDF0F5;

  /* ── Sidebar (light) ── */
  --sidebar:             #F4F6F9;   /* legacy alias → sidebar-bg */
  --sidebar-bg:          #F4F6F9;
  --sidebar-border:      #DDE3ED;
  --sidebar-text:        #6B7280;
  --sidebar-text-active: #0056B3;
  --sidebar-w:           228px;
  --sidebar-hover:       #FFFFFF;
  --sidebar-active:      #FFFFFF;

  /* ── Borders ── */
  --border:        #DDE3ED;
  --border-light:  #E8EDF5;
  --border-strong: #B8C4D4;

  /* ── Text ── */
  --text:       #0B1628;
  --text-1:     #0B1628;
  --text-2:     #374151;
  --text-3:     #6B7280;
  --text-mid:   #374151;
  --text-muted: #6B7280;

  /* ── Primary accent — Blue ── */
  --accent:        #0056B3;
  --accent-soft:   #EEF4FF;
  --accent-border: #C0D4F0;

  /* ── Legacy coral aliases → remapped to accent blue ── */
  --coral:        #0056B3;
  --coral-bg:     #EEF4FF;
  --coral-border: #C0D4F0;
  --white:        #FFFFFF;

  /* ── Legacy indigo aliases → remapped to accent blue ── */
  --indigo:      #0056B3;
  --indigo-text: #004494;
  --indigo-bg:   #EEF4FF;

  /* ── Gap states ── */
  --urgent:        #CC2200;
  --urgent-soft:   #FFF0EE;
  --urgent-border: #FFD0C8;

  --missing:        #D97706;
  --missing-soft:   rgba(217,119,6,0.08);
  --missing-border: rgba(217,119,6,0.25);

  --stale:        #92400E;
  --stale-soft:   rgba(146,64,14,0.07);
  --stale-border: rgba(146,64,14,0.22);

  --complete:        #22c55e;
  --complete-soft:   rgba(34,197,94,0.08);
  --complete-border: rgba(34,197,94,0.25);

  /* ── Semantic status (retain for templates using old names) ── */
  --mint:        #22c55e;
  --mint-bg:     rgba(34,197,94,0.08);
  --mint-border: rgba(34,197,94,0.25);
  --amber:       #D97706;
  --amber-bg:    rgba(217,119,6,0.08);
  --amber-border: rgba(217,119,6,0.25);

  /* ── Type ── */
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* ── Radii — flat system ── */
  --radius:      4px;
  --radius-sm:   3px;
  --radius-md:   4px;
  --radius-lg:   4px;
  --radius-pill: 999px;

  /* ── No shadows in flat design ── */
  --shadow:       none;
  --shadow-hover: none;

  /* ── Motion ── */
  --ease-pop: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-std: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-mid:  280ms;

  /* ── Layout ── */
  --topbar-height: 52px;

  /* ── Surface aliases for templates ── */
  --surface-0: #F9FAFB;
  --surface-1: #FFFFFF;
}

html, body { height: 100%; font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.app { display: flex; height: 100vh; overflow: hidden; }

/* ─── SIDEBAR ─── */
.sidebar { width: var(--sidebar-w); background: var(--sidebar-bg); border-right: 1px solid var(--sidebar-border); display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; }

.sidebar-logo { padding: 20px 24px 16px; border-bottom: 1px solid var(--sidebar-border); }
.logo-mark { display: none; }
.logo-text { font-family: var(--font-body); font-weight: 800; font-size: 1.75rem; color: var(--accent); letter-spacing: -0.5px; line-height: 1; }
.logo-sub { font-family: var(--font-mono); font-size: 0.55rem; color: var(--text-muted); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 3px; }

.sidebar-nav { padding: 8px 0; flex: 1; }
.nav-label { font-family: var(--font-mono); font-size: 0.55rem; font-weight: 400; color: var(--text-muted); letter-spacing: 0.16em; text-transform: uppercase; padding: 12px 24px 6px; }

.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 24px; border-radius: 0; border-right: 2px solid transparent; color: var(--sidebar-text); text-decoration: none; transition: all var(--dur-fast); font-weight: 400; font-size: 0.875rem; margin-bottom: 0; user-select: none; min-height: 36px; }
.nav-sublabel { font-size: 0.68rem; font-weight: 400; opacity: 0.75; display: block; margin-top: 1px; }
.nav-item:hover { background: #fff; color: var(--text); text-decoration: none; }
.nav-item.active { background: #fff; color: var(--accent); border-right-color: var(--accent); font-weight: 600; }
.nav-item.active .nav-icon svg { color: var(--accent); }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; opacity: 0.7; }
.nav-item.active .nav-icon { opacity: 1; }

/* Nav badges — Civic Clarity: bordered pills, not filled chips */
.nav-badge { margin-left: auto; font-family: var(--font-mono); font-size: 0.55rem; font-weight: 700; padding: 1px 6px; border-radius: 3px; letter-spacing: 0.04em; background: var(--urgent-soft); color: var(--urgent); border: 1px solid var(--urgent-border); } /* #CC2200 on #FFF0EE: 4.99:1 — audit 2026-04-28 */
.nav-badge.amber { background: var(--missing-soft); color: #92400E; border-color: var(--missing-border); }                                       /* #92400E on missing-soft: 6.51:1 — audit 2026-04-28: --missing (#D97706) was 2.92:1 FAIL */
.nav-badge.indigo { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }                                  /* #0056B3 on #EEF4FF: 6.38:1 — audit 2026-04-28 */

.sidebar-divider { height: 1px; background: var(--sidebar-border); margin: 6px 0; }

.sidebar-user { padding: 12px 24px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--sidebar-border); margin-top: auto; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent-border); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: var(--accent); flex-shrink: 0; }
.user-name { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.user-sub { font-size: 0.68rem; color: var(--text-muted); }

/* ─── MAIN ─── */
.main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.main::-webkit-scrollbar { width: 6px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── TOPBAR ─── */
.topbar { padding: 24px 32px 0; display: flex; align-items: flex-start; justify-content: space-between; flex-shrink: 0; }

@media (max-width: 599px) {
  .topbar { padding: 12px 16px 0 68px; }
}
.topbar-greeting { font-family: var(--font-body); font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; line-height: 1.1; }
.topbar-date { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* ─── CONTENT SECTIONS ─── */
.section { padding: 0 32px 28px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-family: var(--font-body); font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; display: flex; align-items: center; gap: 8px; }
.section-count { background: var(--coral-bg); color: #9f1b0c; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
/* #9f1b0c: 7.19:1 on coral-bg #FFF0EE — audit 2026-04-23 */
.section-count.amber { background: var(--amber-bg); color: #92400E; } /* #92400E: 6.84:1 on amber-bg PASS */
.section-link { font-size: 13px; color: var(--text-3); font-weight: 500; cursor: pointer; transition: color 0.15s; text-decoration: none; }
.section-link:hover { color: var(--coral); }

.content-pad { padding: 20px 32px 28px; }

@media (max-width: 599px) {
  .content-pad { padding: 16px 16px 20px; }
}

h1 { font-family: var(--font-body); font-size: 22px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 6px; }
h2 { font-family: var(--font-body); font-size: 16px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); margin: 24px 0 12px; }
h3 { font-family: var(--font-body); font-size: 15px; font-weight: 600; margin-bottom: 8px; }

.page-desc { color: var(--text-3); font-size: 13px; margin-bottom: 20px; }

a { color: var(--coral); text-decoration: none; }
a:hover { text-decoration: underline; }

.back-link { display: inline-block; margin-bottom: 16px; color: var(--text-3); font-size: 13px; }
.back-link:hover { color: var(--text); }

.muted { color: var(--text-3); }

/* ─── SCORE STRIP ─── */
.score-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; padding: 20px 32px; flex-shrink: 0; }

.stat-card { background: var(--white); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); border: 1px solid var(--border); display: flex; flex-direction: column; justify-content: space-between; animation: fadeUp 0.4s ease both; text-decoration: none; color: var(--text); transition: all 0.15s; }

@media (max-width: 599px) {
  .stat-card { padding: 14px 16px; }
}
.stat-card:hover { border-color: var(--border-strong); text-decoration: none; }
.stat-card:nth-child(2) { animation-delay: 0.06s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4) { animation-delay: 0.18s; }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-num { font-family: var(--font-body); font-size: 40px; font-weight: 700; letter-spacing: -2px; line-height: 1; }
.stat-num.red { color: var(--coral); }                                          /* #0056B3 on white: 7.04:1 — audit 2026-04-28 */
.stat-num.amber { color: #b45309; }                                              /* #b45309 on white: 5.02:1 — audit 2026-04-28 (was 3.06 — bumped) */
.stat-num.mint { color: #166534; }                                               /* #166534 on white: 7.13:1 — audit 2026-04-28: var(--mint) #22c55e was 2.28:1 FAIL even for large */
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.stat-icon.red { background: var(--coral-bg); }
.stat-icon.amber { background: var(--amber-bg); }
.stat-icon.mint { background: var(--mint-bg); }
.stat-label { font-size: 13px; font-weight: 600; color: var(--text-2); margin-top: 10px; }
.stat-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* Active stat cards */
.stat-card.stat-active { border-color: var(--coral); }
.stat-card.stat-urgent { border-color: var(--coral); }
.stat-card.stat-warning { border-color: var(--amber); }

/* ─── GAP CARDS — flat left-accent rows ─── */
.gap-list { display: flex; flex-direction: column; gap: 4px; }

.gap-card { background: #fff; border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius-md); padding: 11px 14px; display: flex; align-items: flex-start; gap: 10px; transition: background var(--dur-fast); }

@media (max-width: 599px) {
  .gap-card { padding: 10px 12px; }
  .gap-meta { margin-left: 0; }
  .priority-badge { text-align: center; }
}
.gap-card:hover { background: var(--surface-2); }
.gap-card.critical { border-left-color: var(--urgent); }
.gap-card.high { border-left-color: var(--missing); }
.gap-card.medium { border-left-color: var(--stale); }

/* Gap state left-border aliases */
.gap-card-urgent  { border-left-color: var(--urgent) !important; }
.gap-card-missing { border-left-color: var(--missing) !important; }
.gap-card-stale   { border-left-color: var(--stale) !important; }
.gap-card-complete { border-left-color: var(--complete) !important; }

.gap-entity-icon { display: none; }
.gap-body { flex: 1; min-width: 0; }
.gap-entity-name { font-family: var(--font-mono); font-size: 0.58rem; color: var(--text-muted); letter-spacing: 0.03em; margin-bottom: 3px; }
.gap-title { font-size: 0.875rem; font-weight: 500; color: var(--text); line-height: 1.35; }
.gap-why { font-family: var(--font-mono); font-size: 0.58rem; color: var(--text-muted); letter-spacing: 0.03em; margin-top: 3px; line-height: 1.5; }

.gap-meta { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; padding-top: 1px; }
.priority-badge { font-family: var(--font-mono); font-size: 0.58rem; font-weight: 700; padding: 2px 7px; border-radius: var(--radius-sm); text-transform: uppercase; letter-spacing: 0.1em; }
.priority-badge.critical { background: var(--urgent-soft); color: var(--urgent); border: 1px solid var(--urgent-border); }     /* #CC2200 on #FFF0EE: 4.99:1 — audit 2026-04-28 */
.priority-badge.high { background: var(--missing-soft); color: #92400E; border: 1px solid var(--missing-border); }              /* #92400E on missing-soft: 6.51:1 — audit 2026-04-28: --missing (#D97706) was 2.92:1 FAIL */
.priority-badge.medium { background: var(--stale-soft); color: var(--stale); border: 1px solid var(--stale-border); }           /* #92400E on stale-soft: 6.38:1 — audit 2026-04-28 */

/* Gap state badge classes used in templates */
.gap-badge-urgent   { background: var(--urgent-soft);  color: var(--urgent);  border: 1px solid var(--urgent-border); }         /* #CC2200 on #FFF0EE: 4.99:1 — audit 2026-04-28 */
.gap-badge-missing  { background: var(--missing-soft); color: #92400E; border: 1px solid var(--missing-border); }               /* #92400E on missing-soft: 6.51:1 — audit 2026-04-28: --missing (#D97706) was 2.92:1 FAIL */
.gap-badge-stale    { background: var(--stale-soft);   color: var(--stale);   border: 1px solid var(--stale-border); }          /* #92400E on stale-soft: 6.38:1 — audit 2026-04-28 */
.gap-badge-complete { background: var(--complete-soft); color: #166534; border: 1px solid var(--complete-border); }             /* #166534 on complete-soft: 6.64:1 — audit 2026-04-28: --complete (#22c55e) was 2.12:1 FAIL */

/* Gap status colors */
.gap-urgent  { color: var(--urgent);  font-weight: 600; }                        /* #CC2200 on white: 5.53:1 — audit 2026-04-28 */
.gap-missing { color: #92400E; font-weight: 600; }                               /* #92400E on white: 7.09:1 — audit 2026-04-28: --missing (#D97706) was 3.19:1 large-only */
.gap-stale   { color: var(--stale);   font-weight: 600; }                        /* #92400E on white: 7.09:1 — audit 2026-04-28 */
.gap-complete { color: #166534; font-weight: 600; }                              /* #166534 on white: 7.13:1 — audit 2026-04-28: --complete (#22c55e) was 2.28:1 FAIL */
.gap-status { white-space: nowrap; width: 80px; }

.gap-group { margin-bottom: 20px; }
.gap-group table { margin-bottom: 0; }

/* ─── ENTITY GRID ─── */
.entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.entity-card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); padding: 16px; box-shadow: var(--shadow); transition: all 0.15s; cursor: pointer; text-decoration: none; color: var(--text); display: block; }
.entity-card:hover { border-color: var(--border-strong); text-decoration: none; }

/* ─── TABLES ─── */
table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); padding: 8px 12px; border-bottom: 1px solid var(--border); }
td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:hover td { background: rgba(0,0,0,0.02); }
.truncate { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── FILTERS ─── */
.filters { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-pill { padding: 4px 14px; border-radius: 20px; font-size: 13px; color: var(--text-3); background: var(--white); border: 1px solid var(--border); text-decoration: none; transition: all 0.15s; }
.filter-pill:hover { border-color: var(--coral); color: var(--text); text-decoration: none; }
.filter-pill.active { background: var(--text); color: white; border-color: var(--text); }

/* ─── BUTTONS ─── */
.btn-primary { display: flex; align-items: center; gap: 6px; padding: 9px 18px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius-md); font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer; transition: background var(--dur-fast); text-decoration: none; }
.btn-primary:hover { background: #004494; }

.btn { background: var(--accent); color: #fff; border: none; border-radius: var(--radius-md); padding: 8px 18px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background var(--dur-fast); font-family: var(--font-body); text-decoration: none; display: inline-block; }
.btn:hover { background: #004494; text-decoration: none; }

.btn-ghost { padding: 8px 12px; background: transparent; color: var(--text-3); border: 1px solid var(--border); border-radius: var(--radius-md); font-family: var(--font-body); font-size: 12px; font-weight: 500; cursor: pointer; transition: border-color var(--dur-fast); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text-2); }

.btn-action { background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 18px; font-size: 13px; cursor: pointer; transition: border-color var(--dur-fast); font-family: var(--font-body); }
.btn-action:hover { border-color: var(--accent); color: var(--accent); }
.btn-action[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-approve { background: var(--mint-bg); color: var(--mint); border: 1px solid var(--mint-border); }
.btn-approve:hover { background: rgba(16,185,129,0.2); }
.btn-reject { background: var(--coral-bg); color: var(--coral); border: 1px solid var(--coral-border); }
.btn-reject:hover { background: rgba(255,75,51,0.15); }
.btn-edit { background: var(--indigo-bg); color: var(--indigo-text); border: 1px solid rgba(99,102,241,0.2); }
.btn-edit:hover { background: rgba(99,102,241,0.15); }
.btn-cancel { background: var(--bg); color: var(--text-3); border: 1px solid var(--border); }
.btn-cancel:hover { border-color: var(--text-3); }
.btn-danger { background: var(--coral); color: #fff; border: none; border-radius: var(--radius-sm); padding: 7px 16px; font-size: 13px; cursor: pointer; transition: background 0.15s; }
.btn-danger:hover { background: #dc2626; }

/* ─── META GRID ─── */
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 24px; box-shadow: var(--shadow); }
.meta-full { grid-column: 1 / -1; }
.meta-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 2px; }

code { background: var(--bg); padding: 2px 6px; border-radius: 3px; font-size: 13px; }

/* ─── TRIAGE CARDS ─── */
.triage-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px; transition: all 0.15s; box-shadow: var(--shadow); }
.triage-card:hover { box-shadow: var(--shadow-hover); }

.triage-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.triage-title { display: flex; align-items: center; gap: 8px; flex: 1; }
.triage-id { font-size: 12px; color: var(--text-3); font-family: monospace; }
.triage-status { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.triage-needs_review { color: var(--amber); border-color: var(--amber); }
.triage-approved { color: var(--mint); border-color: var(--mint); }
.triage-edited { color: var(--indigo-text); border-color: var(--indigo); }
.triage-rejected { color: var(--text-3); border-color: var(--border); }

.triage-confidence { display: flex; align-items: center; gap: 8px; }
.conf-text { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.conf-bar { width: 80px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.conf-fill { height: 100%; background: var(--coral); border-radius: 3px; transition: width 0.3s; }
.conf-label { font-size: 13px; font-weight: 600; min-width: 36px; text-align: right; }

.triage-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 13px; margin-bottom: 12px; }
.triage-meta .meta-full { grid-column: 1 / -1; }
.triage-meta .meta-label { margin-right: 6px; }

.triage-actions { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.triage-actions .muted { font-size: 13px; }

.inline-form { display: inline; }

/* ─── ENTITY TAGS ─── */
.entity-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.entity-tag { display: inline-flex; flex-direction: column; padding: 4px 10px; border-radius: 8px; font-size: 12px; border: 1px solid var(--border); color: var(--text-3); background: transparent; cursor: default; transition: all 0.15s; font-family: inherit; line-height: 1.3; }
.entity-tag.active { background: var(--coral-bg); border-color: var(--coral); color: var(--coral); }

.tag-categories { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 3px; }
.tag-categories .cat-tag { font-size: 11px; padding: 0 5px; }

.cat-tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; border: 1px solid; font-family: inherit; }
/* Cat-tag text colors: all darkened for WCAG AA (≥4.5:1 on white/near-white surfaces).
   Audit 2026-04-23: original light values failed 4.5:1 at 11px. Borders retain original hue. */
.cat-financial   { color: #1d4ed8; border-color: #3b82f6; background: rgba(59, 130, 246, 0.08); }
.cat-banking     { color: #1d4ed8; border-color: #3b82f6; background: rgba(59, 130, 246, 0.08); }
.cat-credit      { color: #3730a3; border-color: #6366f1; background: rgba(99, 102, 241, 0.08); }
.cat-investment  { color: #3730a3; border-color: #6366f1; background: rgba(99, 102, 241, 0.08); }
.cat-insurance   { color: #9d174d; border-color: #ec4899; background: rgba(236, 72, 153, 0.08); }
.cat-health      { color: #166534; border-color: #22c55e; background: rgba(34, 197, 94, 0.08); }
.cat-medical     { color: #166534; border-color: #22c55e; background: rgba(34, 197, 94, 0.08); }
.cat-tax         { color: #3730a3; border-color: #6366f1; background: rgba(99, 102, 241, 0.08); }
.cat-government  { color: #92400e; border-color: #f59e0b; background: rgba(245, 158, 11, 0.08); }
.cat-identity    { color: #9f1239; border-color: #f43f5e; background: rgba(244, 63, 94, 0.08); }
.cat-property    { color: #6d28d9; border-color: #a78bfa; background: rgba(167, 139, 250, 0.08); }
.cat-real-estate { color: #6d28d9; border-color: #a78bfa; background: rgba(167, 139, 250, 0.08); }
.cat-vehicle     { color: #0e7490; border-color: #06b6d4; background: rgba(6, 182, 212, 0.08); }
.cat-registration { color: #0e7490; border-color: #06b6d4; background: rgba(6, 182, 212, 0.08); }
.cat-business    { color: #3d7200; border-color: #84cc16; background: rgba(132, 204, 22, 0.08); }
.cat-legal       { color: #7e22ce; border-color: #d946ef; background: rgba(217, 70, 239, 0.08); }
.cat-education   { color: #0f766e; border-color: #14b8a6; background: rgba(20, 184, 166, 0.08); }
.cat-utility     { color: #334155; border-color: #64748b; background: rgba(100, 116, 139, 0.08); }

/* Tag picker in edit form */
.entity-tag-picker { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.entity-tag-picker .entity-tag { cursor: pointer; }
.entity-tag-picker .entity-tag:hover { border-color: var(--coral); color: var(--text); }

/* ─── EDIT FORM ─── */
.edit-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.edit-grid label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 3px; }
.edit-grid input, .edit-grid select { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 13px; font-family: 'DM Sans', sans-serif; }
.edit-grid input:focus, .edit-grid select:focus { border-color: var(--coral); outline: 2px solid var(--coral); outline-offset: 2px; }
.edit-actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 4px; }
.edit-entities-col { grid-column: 1 / -1; }

/* ─── BULK ACTIONS ─── */
.bulk-actions { display: flex; gap: 16px; margin-bottom: 20px; padding: 12px 16px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); flex-wrap: wrap; box-shadow: var(--shadow); }

@media (max-width: 599px) {
  .bulk-actions { padding: 10px 12px; gap: 8px; }
  .bulk-form { flex-direction: column; width: 100%; }
  .bulk-form select { width: 100%; }
}
.bulk-form { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.bulk-form label { color: var(--text-3); white-space: nowrap; }
.bulk-form select { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 8px; font-size: 12px; }
.checkbox-label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.checkbox-label input[type="checkbox"] { accent-color: var(--coral); }

/* ─── ACTION PANEL ─── */
.action-panel { margin-bottom: 28px; }
.action-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.action-group { display: flex; align-items: center; gap: 8px; }

/* ─── HTMX INDICATORS ─── */
.htmx-indicator { display: none; font-size: 12px; color: var(--text-3); }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }

.action-result { display: inline-block; padding: 6px 14px; border-radius: var(--radius); font-size: 13px; margin-top: 4px; }
.result-success { color: var(--mint); background: var(--mint-bg); border: 1px solid var(--mint-border); }
.result-info { color: var(--text-3); background: var(--white); border: 1px solid var(--border); }
.result-error { color: var(--coral); background: var(--coral-bg); border: 1px solid var(--coral-border); }

/* ─── RELATED ENTITIES ─── */
.related-grid { display: flex; flex-direction: column; gap: 8px; }
.related-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); transition: all 0.15s; box-shadow: var(--shadow); }
.related-item:hover { border-color: var(--coral); }
.related-item a { color: var(--text); text-decoration: none; font-weight: 500; }
.related-item a:hover { color: var(--coral); }

/* ─── TWO COLUMN ─── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

@media (max-width: 599px) {
  .two-col { grid-template-columns: 1fr; gap: 16px; }
}

/* ─── STATUS BADGES ─── */
.status-active { color: #057a55; } /* #057a55: 5.36:1 on white — audit 2026-04-23 */
.status-pending { color: #92400E; } /* #92400E: 7.09:1 on white — audit 2026-04-28: var(--amber) #D97706 was 3.19:1 (large-text only) */
.status-revoked, .status-expired, .status-closed, .status-sold, .status-dissolved { color: var(--text-3); } /* #6B7280: 4.83:1 on white — audit 2026-04-28 */

/* ─── FOCUS STATES ─── */
:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--coral); outline: 2px solid var(--coral); outline-offset: 2px; }

/* ─── HIDDEN ─── */
.hidden { display: none; }

/* ─── DELETE FORM ─── */
.delete-form { margin-top: 2rem; }

/* ─── SHARE VIEW ─── */
.share-body { background: var(--bg); }
.share-body .share-container { max-width: 600px; margin: 0 auto; padding: 48px 16px; }
.share-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.share-logo { font-family: var(--font-body); font-size: 14px; font-weight: 700; letter-spacing: 0.08em; color: var(--coral); margin-bottom: 20px; }
.share-badge { display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px 8px; margin-bottom: 12px; }
.share-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ─── SCORE RING ─── */
.score-card { background: var(--white); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); border: 1px solid var(--border); animation: fadeUp 0.4s ease both; }
.score-main { display: flex; align-items: center; gap: 18px; }
.score-ring-wrap { position: relative; flex-shrink: 0; }
.score-ring { width: 78px; height: 78px; transform: rotate(-90deg); }
.score-ring-bg { fill: none; stroke: #F0F2FA; stroke-width: 6; }
.score-ring-fill { fill: none; stroke: var(--ring-color, var(--accent)); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 220; stroke-dashoffset: 220; transition: stroke-dashoffset 1.6s cubic-bezier(0.4,0,0.2,1); }
.score-num-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-num { font-family: var(--font-body); font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -1px; line-height: 1; }
.score-denom { font-family: var(--font-mono); font-size: 0.55rem; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.score-info .score-label { font-family: var(--font-body); font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; }
.score-info .score-desc { font-size: 12px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }
.score-trend { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: #057a55; margin-top: 8px; }
/* #057a55: 5.36:1 on white — audit 2026-04-23: var(--mint) #10B981 was 2.54:1 FAIL */

/* ─── VELOCITY & SLIPPAGE ─── */
.vs-section { padding: 0 32px 28px; }
.vs-card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; animation: fadeUp 0.4s ease both; animation-delay: 0.2s; }
.vs-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.vs-title { font-family: var(--font-body); font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; display: flex; align-items: center; gap: 8px; }
.vs-range-pills { display: flex; gap: 4px; }
.vs-pill { font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border); background: transparent; color: var(--text-3); cursor: pointer; transition: all 0.15s; font-family: 'DM Sans', sans-serif; }
.vs-pill:hover { color: var(--text-2); border-color: var(--text-3); }
.vs-pill.active { background: var(--text); color: white; border-color: var(--text); }
.vs-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-bottom: 1px solid var(--border); }
.vs-stat { padding: 16px 22px; border-right: 1px solid var(--border); }
.vs-stat:last-child { border-right: none; }
.vs-stat-label { font-size: 11px; font-weight: 500; color: var(--text-3); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.vs-stat-val { font-family: var(--font-body); font-size: 24px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.vs-stat-val.mint { color: #166534; }                                            /* #166534 on white: 7.13:1 — audit 2026-04-28: var(--mint) #22c55e was 2.28:1 FAIL even large */
.vs-stat-val.coral { color: var(--coral); }                                      /* #0056B3 on white: 7.04:1 — audit 2026-04-28 */
.vs-stat-val.amber { color: #b45309; }                                           /* #b45309 on white: 5.02:1 — audit 2026-04-28 */
.vs-stat-val.indigo { color: var(--indigo); }                                    /* #0056B3 on white: 7.04:1 — audit 2026-04-28 */
.vs-stat-sub { font-size: 11px; color: var(--text-3); margin-top: 4px; display: flex; align-items: center; gap: 4px; } /* #6B7280 on white: 4.83:1 — audit 2026-04-28 */
.vs-stat-sub .up { color: #166534; font-weight: 600; }                           /* #166534 on white: 7.13:1 — audit 2026-04-28: var(--mint) was 2.28:1 FAIL */
.vs-stat-sub .down { color: var(--coral); font-weight: 600; }                    /* #0056B3 on white: 7.04:1 — audit 2026-04-28 */
.vs-chart-wrap { padding: 20px 22px 16px; position: relative; }
.vs-chart { width: 100%; height: 180px; }
.vs-legend { display: flex; align-items: center; gap: 20px; padding: 0 22px 16px; }
.vs-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; color: var(--text-2); }
.vs-legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.vs-legend-dot.vel { background: var(--mint); }
.vs-legend-dot.slip { background: var(--coral); }
.vs-legend-dot.net { background: var(--indigo); }
.vs-legend-dot.added { background: var(--amber); }

/* ─── TIMELINE ─── */
.timeline-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.timeline-strip::-webkit-scrollbar { height: 4px; }
.timeline-strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.timeline-item { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); padding: 16px 18px; min-width: 195px; flex-shrink: 0; box-shadow: var(--shadow); transition: all 0.15s; }
.timeline-item:hover { border-color: var(--border-strong); }
.timeline-item.today { background: var(--coral); border-color: var(--coral); }                  /* white on #0056B3: 7.04:1 — audit 2026-04-28 */
.timeline-item.soon { background: #b45309; border-color: #b45309; }                              /* white on #b45309: 5.02:1 — audit 2026-04-28: var(--amber) #D97706 was 3.19:1 FAIL for body text */
.timeline-date { font-family: var(--font-body); font-size: 12px; font-weight: 700; color: var(--text-3); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.timeline-item.today .timeline-date, .timeline-item.soon .timeline-date { color: rgba(255,255,255,0.75); }
.today-chip { font-size: 11px; font-weight: 700; background: rgba(255,255,255,0.25); color: white; padding: 2px 7px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.timeline-event { margin-bottom: 7px; }
.timeline-event-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.timeline-item.today .timeline-event-title, .timeline-item.soon .timeline-event-title { color: white; }
.timeline-event-entity { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.timeline-item.today .timeline-event-entity, .timeline-item.soon .timeline-event-entity { color: rgba(255,255,255,0.65); }
.t-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: rgba(255,75,51,0.3); margin-right: 5px; vertical-align: middle; position: relative; top: -1px; }
.timeline-item.today .t-dot, .timeline-item.soon .t-dot { background: rgba(255,255,255,0.4); }

/* ─── MODAL ─── */
.modal-overlay { position: fixed; inset: 0; background: rgba(11,22,40,0.55); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); width: 520px; max-width: 90vw; box-shadow: 0 8px 32px rgba(0,0,0,0.12); transform: translateY(20px); transition: transform 0.2s; overflow: hidden; }
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { padding: 22px 26px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; }
.modal-entity-label { font-size: 12px; font-weight: 500; color: var(--text-3); margin-bottom: 3px; }
.modal-title { font-family: var(--font-body); font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.modal-close { width: 30px; height: 30px; border-radius: 8px; background: var(--bg); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--text-3); transition: all 0.15s; }
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 22px 26px; }
.why-box { background: var(--coral-bg); border: 1px solid var(--coral-border); border-radius: 10px; padding: 12px 15px; margin-bottom: 18px; font-size: 13px; color: #7B1D00; line-height: 1.5; display: flex; gap: 10px; align-items: flex-start; }
.why-box .why-icon { flex-shrink: 0; margin-top: 1px; }
.dropzone { border: 2px dashed var(--border); border-radius: 12px; padding: 36px 24px; text-align: center; cursor: pointer; transition: all 0.2s; background: var(--bg); position: relative; }
.dropzone:hover, .dropzone.drag-over { border-color: var(--coral); background: var(--coral-bg); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dz-icon { font-size: 38px; margin-bottom: 10px; }
.dz-title { font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.dz-sub { font-size: 12px; color: var(--text-3); }
.modal-footer { padding: 14px 26px 22px; display: flex; justify-content: flex-end; gap: 10px; }

/* ─── TOTEM SECTION ─── */
.totem-section { margin: 0 32px 40px; background: linear-gradient(135deg, #0B1628 0%, #16103A 55%, #0B1628 100%); border-radius: 20px; padding: 32px 36px; position: relative; overflow: hidden; border: 1px solid rgba(99,102,241,0.2); }

/* ─── TOAST SYSTEM ─── */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    background: var(--text);
    color: white;
    font-size: 13px;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: toastIn 300ms ease-out;
    max-width: 360px;
}
.toast-exit {
    animation: toastOut 300ms ease-in forwards;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(12px); }
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── HAMBURGER BUTTON ─── */
.sidebar-hamburger {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 12px;
  position: relative;
  z-index: 1001;
  flex-shrink: 0;
}
.hamburger-icon {
  width: 20px;
  height: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}
.hamburger-line {
  width: 20px;
  height: 2px;
  background: white;
  border-radius: 1px;
  transition: all 0.2s ease;
}
.sidebar-hamburger.open .hamburger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.sidebar-hamburger.open .hamburger-line:nth-child(2) {
  opacity: 0;
}
.sidebar-hamburger.open .hamburger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ─── DRAWER OVERLAY ─── */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 22, 40, 0.4);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.drawer-overlay.open {
  display: block;
  opacity: 1;
}

/* ─── PUSH NOTIFICATION NUDGE ─── */
.push-nudge {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 20px;
  animation: fadeUp 0.3s ease-out;
}

.push-nudge-icon {
  width: 36px;
  height: 36px;
  background: rgba(99, 102, 241, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.push-nudge-content {
  flex: 1;
}

.push-nudge-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 3px 0;
  font-family: 'DM Sans', sans-serif;
}

.push-nudge-description {
  font-size: 12px;
  color: var(--text-3);
  margin: 0 0 10px 0;
  line-height: 1.5;
}

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

.push-nudge-btn-primary,
.push-nudge-btn-secondary {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.push-nudge-btn-primary {
  background: var(--coral);
  color: white;
}

.push-nudge-btn-primary:hover {
  background: #E03E28;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 75, 51, 0.3);
}

.push-nudge-btn-secondary {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-3);
}

.push-nudge-btn-secondary:hover {
  border-color: var(--text-3);
  color: var(--text-2);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .app { flex-direction: column; height: 100vh; overflow: hidden; }

  /* Tablet: horizontal sidebar */
  .sidebar { width: 100%; flex-direction: row; padding: 12px 16px; gap: 8px; overflow-x: auto; overflow-y: hidden; }
  .sidebar-logo { padding: 0; }
  .logo-sub { display: none; }
  .sidebar-nav { display: flex; gap: 4px; padding: 0; flex: 0; }
  .nav-label { display: none; }
  .nav-item { white-space: nowrap; margin-bottom: 0; padding: 8px 12px; font-size: 13px; min-height: 44px; display: flex; align-items: center; }
  /* Hide secondary descriptions in the row layout — saves the ~140px that
     was pushing Verify/Email signals off the right edge on tablet (768px). */
  .nav-item .nav-sublabel { display: none; }
  .sidebar-divider { display: none; }
  .sidebar-user { display: none; }
  .sidebar-hamburger { display: none; }

  .main { overflow-y: visible; }
  .content-pad { padding: 16px; }
  .section { padding: 0 16px 20px; }
  .score-strip { padding: 12px 16px; grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: 1fr; }
  .topbar { padding: 16px 16px 0; position: relative; }
  .vs-section { padding: 0 16px 20px; }
  .vs-stats { grid-template-columns: 1fr 1fr; }
  .vs-stat { border-bottom: 1px solid var(--border); }
  .entity-grid { grid-template-columns: 1fr 1fr; }
  .gap-card { flex-direction: column; align-items: flex-start; }
  .gap-meta { margin-left: 0; margin-top: 8px; }
  .urgency-bar { padding: 10px 16px; flex-wrap: wrap; }

  /* Modal responsive */
  .modal { width: 100%; max-width: 100vw; border-radius: 16px 16px 0 0; margin-top: auto; }
  .modal-overlay { align-items: flex-end; }
  .modal-header { padding: 18px 20px 14px; }
  .modal-body { padding: 18px 20px; }
  .modal-footer { padding: 12px 20px 20px; }
  .dropzone { padding: 28px 16px; }
}

/* ─── MOBILE DRAWER (< 600px) ─── */
@media (max-width: 600px) {
  .app { position: relative; }

  /* Hamburger visible, sidebar hidden */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-w);
    flex-direction: column;
    padding: 20px 0;
    overflow-y: auto;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    gap: 0;
  }
  .sidebar.open {
    transform: translateX(0);
  }

  /* Show hamburger */
  .sidebar-hamburger {
    display: flex;
    position: absolute;
    top: 12px;
    left: 12px;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border-radius: var(--radius-md);
  }

  /* Mobile-friendly sidebar content */
  .sidebar-logo {
    padding: 40px 24px 24px;
    flex-direction: column;
  }
  .logo-mark {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  .logo-text {
    font-size: 16px;
  }
  .logo-sub {
    display: block;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
  }
  .nav-label {
    display: block;
    padding: 12px 24px 6px;
    font-size: 11px;
  }
  .nav-item {
    white-space: normal;
    padding: 10px 24px;
    font-size: 14px;
    min-height: 44px;
    width: 100%;
  }
  .sidebar-divider {
    display: block;
  }
  .sidebar-user {
    display: flex;
    margin-top: auto;
  }

  /* Main area adjustments */
  .main {
    overflow-y: auto;
    height: 100vh;
    flex: 1;
  }
  .topbar {
    padding: 12px 16px 0;
  }
}

/* ─── Score breakdown panel (dashboard, HTMX fragment) ─── */
.score-breakdown {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    margin-top: 12px;
    text-align: left;
    animation: fadeIn 200ms ease-out;
}
.sb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.sb-title { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.sb-close { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 18px; line-height: 1; padding: 0; }
.sb-close:hover { color: var(--text); }
.sb-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.sb-row:last-of-type { border-bottom: none; }
.sb-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}
.sb-tag.urgent { background: var(--urgent-soft); color: var(--urgent); }                /* #CC2200 on #FFF0EE: 4.99:1 — audit 2026-04-28: was --coral on rgba red-tint, broke semantically post-rebrand */
.sb-tag.missing { background: rgba(245,158,11,0.1); color: #92400E; }                    /* #92400E on amber-tint(0.1): 6.56:1 — audit 2026-04-28: var(--amber) #D97706 was 2.95:1 FAIL */
.sb-tag.stale { background: rgba(99,102,241,0.1); color: var(--indigo-text); }           /* #004494 on indigo-tint(0.1): 8.23:1 — audit 2026-04-28 */
.sb-desc { flex: 1; color: var(--text-2); }
.sb-link { color: #057a55; font-size: 12px; text-decoration: none; flex-shrink: 0; }
/* #057a55: 5.36:1 on white — audit 2026-04-23: var(--mint) was 2.54:1 FAIL */
.sb-link:hover { text-decoration: underline; }
.sb-more { text-align: center; margin-top: 8px; font-size: 12px; }
.sb-more a { color: var(--indigo-text); text-decoration: none; }
.sb-more a:hover { text-decoration: underline; }
.sb-empty { font-size: 13px; color: var(--text-3); text-align: center; padding: 8px 0; }

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