:root {
  --bg: #121417;
  --bg-2: #0d0f12;
  --surface: #1a1d23;
  --surface-2: #161920;
  --surface-3: #21252d;
  --border: #2a2d35;
  --border-strong: #353945;
  --text: #e2e8f0;
  --text-strong: #f5f7fa;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --footer: #4a5568;

  --gold: #c9a961;
  --gold-2: #d8be7c;
  --gold-3: #a8873d;
  --emerald: #0d9488;
  --emerald-2: #14b8a6;

  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;

  --navy: #c9a961;          /* legacy alias → maps to gold for any leftover refs */
  --navy-2: #1f242c;
  --navy-3: #262b35;
  --card: var(--surface);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 4px 14px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.35);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.55), 0 8px 20px rgba(0,0,0,.4);
  --glass: rgba(26, 29, 35, .72);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 700px at 80% -10%, #1b2030 0%, var(--bg) 55%) fixed,
              var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); min-height: 1.2em; margin-top: .5rem; font-size: .9rem; }

::selection { background: rgba(201,169,97,.3); color: var(--text-strong); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ── Login ────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(800px 500px at 20% 10%, rgba(13,148,136,.18) 0%, transparent 60%),
    radial-gradient(900px 600px at 80% 90%, rgba(201,169,97,.14) 0%, transparent 65%),
    var(--bg);
  padding: 1rem;
}
.login-card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
          backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border);
  padding: 2.75rem 2.25rem; border-radius: 16px;
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: fadeUp .4s ease-out;
}
.login-card h1 { margin: .9rem 0 .25rem; font-size: 1.4rem; color: var(--text-strong); font-weight: 700; letter-spacing: -.01em; }
.login-card .muted { font-size: .85rem; }
.login-card input {
  width: 100%; padding: .85rem 1rem; margin: 1.25rem 0 .5rem;
  border: 1px solid var(--border); border-radius: 10px; font-size: 1rem;
  background: var(--surface-2); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,97,.18);
}
.login-card button {
  width: 100%; padding: .85rem;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-3) 100%);
  color: #1a1410; border: 0; border-radius: 10px;
  font-size: 1rem; cursor: pointer; font-weight: 700;
  letter-spacing: .02em; margin-top: .5rem;
  transition: transform .12s, box-shadow .15s, filter .15s;
  box-shadow: 0 6px 18px rgba(201,169,97,.25);
}
.login-card button:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 10px 24px rgba(201,169,97,.35); }
.login-card button:active { transform: translateY(0); }
.brand-mark {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-3));
  color: #1a1410; font-weight: 800; font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
  box-shadow: 0 8px 22px rgba(201,169,97,.3), inset 0 1px 0 rgba(255,255,255,.2);
}

/* ── App shell ───────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; flex-shrink: 0;
  background: linear-gradient(180deg, #0a0c10 0%, #0e1116 50%, #0c0f14 100%);
  color: var(--text);
  display: flex; flex-direction: column; padding: 1.25rem 0;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--border);
}
.sidebar-brand {
  display: flex; gap: .85rem; align-items: center;
  padding: .25rem 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(201,169,97,.18);
  background: linear-gradient(135deg, rgba(201,169,97,.1) 0%, transparent 70%);
}
.brand-title { font-weight: 800; font-size: 1.05rem; color: var(--text-strong); letter-spacing: -.01em; }
.brand-sub { font-size: .68rem; color: var(--gold); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }

#nav { flex: 1; display: flex; flex-direction: column; padding: 1.25rem .75rem; gap: .2rem; }
#nav a {
  text-decoration: none; color: var(--muted);
  padding: .75rem .95rem; border-radius: 10px;
  font-size: .92rem; font-weight: 600;
  transition: background .18s ease, color .18s ease, transform .12s ease;
  position: relative;
}
#nav a:hover { background: var(--surface-2); color: var(--text-strong); }
#nav a.active {
  background: linear-gradient(90deg, rgba(201,169,97,.18) 0%, rgba(201,169,97,.04) 100%);
  color: var(--gold-2);
  box-shadow: inset 3px 0 0 var(--gold);
  padding-left: calc(.95rem + 3px);
}
#nav a.active::after {
  content: ""; position: absolute; right: .9rem; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 10px rgba(201,169,97,.7);
}
.logout {
  margin: .75rem 1rem 0; padding: .7rem;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); border-radius: 10px; cursor: pointer;
  font-weight: 600; font-size: .85rem;
  transition: all .15s;
}
.logout:hover { background: var(--surface-2); color: var(--text-strong); border-color: var(--gold-3); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 68px; padding: 0 2rem;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
          backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 10;
}
.topbar h2 { margin: 0; font-size: 1.35rem; color: var(--text-strong); font-weight: 700; letter-spacing: -.01em; }
.topbar-spacer { flex: 1; }

.project-picker {
  display: flex; align-items: center; gap: .55rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: .25rem .6rem .25rem .85rem;
  transition: border-color .15s, box-shadow .15s;
}
.project-picker:hover { border-color: var(--gold-3); }
.project-picker span {
  font-size: .66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
}
.project-picker select {
  border: 0; background: transparent; padding: .45rem .25rem;
  font-weight: 700; font-size: .9rem; color: var(--text-strong);
  min-width: 220px; cursor: pointer; outline: none;
}
.project-picker select option { background: var(--surface-2); color: var(--text); font-weight: 600; }

.project-card {
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 38px rgba(0,0,0,.55), 0 0 0 1px var(--gold-3);
}
.detail-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; flex-wrap: wrap;
}
.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem; margin-top: 1rem;
}
.section-title {
  margin: 2rem 0 1rem; color: var(--gold);
  font-size: 1rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em;
}
.empty { color: var(--muted); font-size: .88rem; padding: .5rem 0; }
#menu-toggle {
  display: none; background: transparent; border: 0;
  font-size: 1.4rem; cursor: pointer; color: var(--text);
}
.view {
  padding: 2rem 2.25rem; flex: 1;
  animation: fadeIn .25s ease-out;
}
.app-footer {
  padding: 1.1rem 2rem; border-top: 1px solid var(--border);
  color: var(--footer); font-size: .76rem;
  text-align: center; background: var(--bg-2);
  letter-spacing: .02em;
}

/* ── Cards + tables ─────────────────────────────────── */
.card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
          backdrop-filter: blur(10px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.55rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  transition: border-color .15s;
}
.card:hover { border-color: var(--border-strong); }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.project-card { border-left: 4px solid var(--green); padding: 1.4rem 1.55rem 1.2rem; }
.project-card.rag-AMBER { border-left-color: var(--amber); }
.project-card.rag-RED   { border-left-color: var(--red); }
.project-card h3 { margin: 0 0 .25rem; color: var(--text-strong); }
.project-card .meta { font-size: .85rem; color: var(--muted); margin-bottom: .75rem; }

.badge {
  display: inline-block; padding: .2rem .65rem; border-radius: 999px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  border: 1px solid transparent;
}
.badge.GREEN { background: rgba(16,185,129,.14); color: #34d399; border-color: rgba(16,185,129,.35); }
.badge.AMBER { background: rgba(245,158,11,.14); color: #fbbf24; border-color: rgba(245,158,11,.35); }
.badge.RED   { background: rgba(239,68,68,.14); color: #f87171; border-color: rgba(239,68,68,.35); }
.badge.ACTIVE        { background: rgba(16,185,129,.14); color: #34d399; border-color: rgba(16,185,129,.4);
  animation: badge-glow 2.4s ease-in-out infinite; }
.badge.PLANNED       { background: var(--surface-3); color: var(--muted); border-color: var(--border); }
.badge.IN_DEVELOPMENT{ background: rgba(245,158,11,.14); color: #fbbf24; border-color: rgba(245,158,11,.35); }
.badge.UNAVAILABLE   { background: rgba(239,68,68,.14); color: #f87171; border-color: rgba(239,68,68,.35); }

table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
th, td {
  padding: .85rem 1.1rem; text-align: left;
  border-bottom: 1px solid var(--border); font-size: .88rem;
  color: var(--text);
}
th {
  background: var(--bg-2); color: var(--gold);
  font-weight: 700; text-transform: uppercase;
  font-size: .7rem; letter-spacing: .08em;
  border-bottom: 1px solid var(--border-strong);
}
tbody tr:nth-child(even) td { background: var(--surface-2); }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: rgba(201,169,97,.06); }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

.btn {
  display: inline-block; padding: .6rem 1.2rem;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-3) 100%);
  color: #1a1410; border: 0; border-radius: 10px;
  cursor: pointer; font-weight: 700; font-size: .88rem;
  letter-spacing: .01em;
  transition: transform .12s, box-shadow .15s, filter .15s;
  box-shadow: 0 4px 14px rgba(201,169,97,.2);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 8px 20px rgba(201,169,97,.3); }
.btn:active { transform: translateY(0); }
.btn.secondary {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); box-shadow: none;
}
.btn.secondary:hover { background: var(--surface-3); border-color: var(--gold-3); color: var(--text-strong); filter: none; }
.btn:disabled { opacity: .55; cursor: wait; transform: none; box-shadow: none; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; color: var(--text-strong); }

.briefing {
  background: var(--surface); padding: 1.5rem;
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.briefing pre {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85rem; margin: 0; color: var(--text);
}

.toolbar { display: flex; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }
.summary-strip { display: flex; gap: .85rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.summary-strip .pill {
  position: relative;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  padding: 1rem 1.3rem; border-radius: 14px;
  box-shadow: var(--shadow);
  font-size: .82rem; color: var(--muted);
  min-width: 150px;
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
.summary-strip .pill::before {
  content: ""; position: absolute; inset: 0; border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.04) 0%, transparent 50%);
  pointer-events: none;
}
.summary-strip .pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,.55);
  border-color: var(--border-strong);
}
.summary-strip .pill strong {
  display: block; font-size: 1.85rem; font-weight: 800;
  color: var(--text-strong); letter-spacing: -.02em;
  margin-bottom: .15rem;
}
.summary-strip .pill.kpi-good {
  background: linear-gradient(135deg, rgba(16,185,129,.14) 0%, var(--surface-2) 70%);
  border-color: rgba(16,185,129,.35);
}
.summary-strip .pill.kpi-good strong { color: #34d399; }
.summary-strip .pill.kpi-warn {
  background: linear-gradient(135deg, rgba(245,158,11,.14) 0%, var(--surface-2) 70%);
  border-color: rgba(245,158,11,.35);
}
.summary-strip .pill.kpi-warn strong { color: #fbbf24; }
.summary-strip .pill.kpi-bad {
  background: linear-gradient(135deg, rgba(239,68,68,.14) 0%, var(--surface-2) 70%);
  border-color: rgba(239,68,68,.35);
}
.summary-strip .pill.kpi-bad strong { color: #f87171; }
.summary-strip .pill.kpi-neutral {
  background: linear-gradient(135deg, rgba(201,169,97,.08) 0%, var(--surface-2) 70%);
}
.summary-strip .pill .pill-breakdown {
  display: block; margin-top: .45rem; font-size: .68rem;
  color: var(--muted-2); font-weight: 600; line-height: 1.4;
  max-width: 220px; word-break: break-word;
}

.findings-list { margin: 0; padding-left: 1.2rem; }
.findings-list li { margin-bottom: .45rem; font-size: .9rem; color: var(--text); }

.file-drop {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 1.5rem; text-align: center;
  background: var(--surface-2); margin-bottom: 1rem;
}
.file-drop input { display: block; margin: .5rem auto; color: var(--text); }

/* ── RAG legend ─────────────────────────────────────── */
.rag-legend {
  display: flex; gap: 1.5rem; flex-wrap: wrap; margin: -.25rem 0 1.25rem;
  padding: .75rem 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; font-size: .8rem; color: var(--muted);
}
.rag-legend-item { display: inline-flex; align-items: center; gap: .5rem; }
.rag-dot {
  display: inline-block; width: .7rem; height: .7rem; border-radius: 50%;
  flex-shrink: 0; box-shadow: 0 0 8px currentColor;
}
.rag-dot.GREEN { background: var(--green); color: var(--green); }
.rag-dot.AMBER { background: var(--amber); color: var(--amber); }
.rag-dot.RED   { background: var(--red);   color: var(--red); }

/* ── Section title bar ──────────────────────────────── */
.section-title-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin: 2rem 0 1rem; gap: 1rem; flex-wrap: wrap;
}
.section-title-bar .section-title { margin: 0; }
.section-title-bar .summary-strip { margin: 0; }

/* ── Modal ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(8,10,14,.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 1rem;
  animation: fadeIn .15s ease-out;
}
.modal {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
          backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 1.75rem 1.85rem;
  box-shadow: var(--shadow-lg);
  max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto;
  animation: fadeUp .25s ease-out;
}
.modal-title { margin: 0 0 1rem; color: var(--text-strong); font-size: 1.15rem; font-weight: 700; }
.modal-form { display: flex; flex-direction: column; gap: .9rem; }
.modal-field { display: flex; flex-direction: column; gap: .3rem; }
.modal-field span {
  font-size: .68rem; color: var(--muted);
  font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.modal-field input, .modal-field select, .modal-field textarea {
  padding: .65rem .8rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--text);
  font-size: .9rem; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.modal-field input:focus, .modal-field select:focus, .modal-field textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,97,.18);
}
.modal-field textarea { resize: vertical; }
.modal-error { color: var(--red); font-size: .85rem; min-height: 1rem; }
.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: .5rem; }

/* ── Toolbar actions ────────────────────────────────── */
.toolbar-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* ── Dropzone ───────────────────────────────────────── */
.upload-card { border: 1px dashed var(--border); }
.upload-card h4 { margin: 0 0 .25rem; color: var(--text-strong); }
.upload-card p { margin: 0 0 .8rem; font-size: .85rem; color: var(--muted); }
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 2rem 1rem; text-align: center; cursor: pointer;
  background: var(--surface-2);
  transition: background .15s, border-color .15s, transform .12s;
}
.dropzone:hover, .dropzone.drag {
  background: rgba(201,169,97,.06); border-color: var(--gold);
  transform: scale(1.005);
}
.dropzone-hint { color: var(--muted); font-weight: 600; letter-spacing: .03em; }
.upload-result { margin-top: .9rem; }
.upload-summary {
  padding: .65rem .95rem; border-radius: 10px; font-size: .88rem; font-weight: 600;
  margin-bottom: .5rem; border: 1px solid transparent;
}
.upload-summary.ok  { background: rgba(16,185,129,.12); color: #34d399; border-color: rgba(16,185,129,.3); }
.upload-summary.err { background: rgba(239,68,68,.12); color: #f87171; border-color: rgba(239,68,68,.3); }
.upload-result .findings-list li.err { color: #f87171; }

/* ── Progress overlay ───────────────────────────────── */
.progress-overlay {
  position: fixed; inset: 0;
  background: rgba(8,10,14,.7);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; z-index: 200;
  animation: fadeIn .15s ease-out;
}
.progress-overlay.hidden { display: none; }
.progress-box {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 2rem;
  box-shadow: var(--shadow-lg);
  min-width: 280px; max-width: 400px;
}
.progress-label { color: var(--text-strong); font-weight: 600; margin-bottom: .85rem; font-size: .9rem; }
.progress-bar {
  height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; position: relative;
}
.progress-bar-fill {
  position: absolute; top: 0; left: -40%; width: 40%; height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--emerald-2));
  animation: progress-slide 1.2s linear infinite;
  box-shadow: 0 0 12px rgba(201,169,97,.4);
}
@keyframes progress-slide {
  0% { left: -40%; }
  100% { left: 100%; }
}

/* ── Review head row ────────────────────────────────── */
.review-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; margin-bottom: .25rem;
}
.review-head h3 { margin: 0; color: var(--text-strong); }

/* Typography improvements */
.card h3 { font-size: 1.15rem; font-weight: 700; color: var(--text-strong); }
.card h4 { font-size: .95rem; font-weight: 700; color: var(--text-strong); margin: 0 0 .85rem; }

/* Project card extras */
.project-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-bottom: .35rem;
}
.project-card-head h3 { margin: 0; }
.stage-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(201,169,97,.12); color: var(--gold);
  flex-shrink: 0; border: 1px solid rgba(201,169,97,.25);
}
.stage-icon svg { width: 18px; height: 18px; }
.project-progress { display: flex; align-items: center; gap: .85rem; margin-top: .9rem; }
.donut { flex-shrink: 0; }
.donut text { fill: var(--text-strong) !important; }
.donut circle:first-of-type { stroke: var(--surface-3) !important; }
.progress-meta { font-size: .78rem; color: var(--muted); flex: 1; }
.progress-meta strong { display: block; color: var(--text-strong); font-size: 1.05rem; font-weight: 800; }

/* Agent department chart */
.dept-chart { padding: 1.4rem 1.55rem; }
.dept-row { display: flex; align-items: center; gap: .85rem; margin-bottom: .65rem; font-size: .85rem; }
.dept-row .dept-name { width: 140px; color: var(--muted); font-weight: 600; }
.dept-row .dept-bar-track {
  flex: 1; height: 14px; background: var(--surface-3);
  border-radius: 999px; overflow: hidden;
  border: 1px solid var(--border);
}
.dept-row .dept-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-3), var(--gold));
  box-shadow: 0 0 12px rgba(201,169,97,.35);
}
.dept-row .dept-count { width: 32px; text-align: right; font-weight: 800; color: var(--text-strong); }

@keyframes badge-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .35); }
  50%      { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* Empty state */
.empty-state {
  text-align: center; padding: 3rem 1.5rem;
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: 14px; box-shadow: var(--shadow);
}
.empty-state .empty-icon { font-size: 2.75rem; margin-bottom: .65rem; opacity: .55; }
.empty-state h4 { margin: .25rem 0 .35rem; color: var(--text-strong); font-size: 1.1rem; }
.empty-state p { color: var(--muted); margin: 0 0 1rem; font-size: .9rem; }

/* Briefing structured */
.briefing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem;
}
.briefing-section {
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem 1.35rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--gold);
}
.briefing-section.urgent       { border-top-color: var(--red); }
.briefing-section.approvals    { border-top-color: var(--amber); }
.briefing-section.schedule     { border-top-color: var(--amber); }
.briefing-section.budget       { border-top-color: var(--amber); }
.briefing-section.risks        { border-top-color: var(--red); }
.briefing-section.deliverables { border-top-color: var(--red); }
.briefing-section.milestones   { border-top-color: var(--amber); }
.briefing-section.actions      { border-top-color: var(--emerald); }
.briefing-section .bs-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: .85rem;
}
.briefing-section .bs-head h4 { margin: 0; display: flex; align-items: center; gap: .55rem; color: var(--text-strong); }
.briefing-section .bs-icon { font-size: 1.2rem; }
.briefing-section .bs-count {
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: .15rem .65rem; font-weight: 700; font-size: .72rem;
}
.briefing-section.urgent .bs-count,
.briefing-section.risks .bs-count,
.briefing-section.deliverables .bs-count {
  background: rgba(239,68,68,.15); color: #f87171; border-color: rgba(239,68,68,.35);
}
.briefing-section.approvals .bs-count,
.briefing-section.schedule .bs-count,
.briefing-section.budget .bs-count,
.briefing-section.milestones .bs-count {
  background: rgba(245,158,11,.15); color: #fbbf24; border-color: rgba(245,158,11,.35);
}
.briefing-section ul { margin: 0; padding-left: 1.1rem; }
.briefing-section li { font-size: .85rem; margin-bottom: .5rem; line-height: 1.5; color: var(--text); }
.briefing-section .bs-empty { font-size: .85rem; color: var(--muted); padding: .5rem 0; font-style: italic; }

.briefing-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .85rem; margin-bottom: 1.5rem;
}
.briefing-summary .bs-pill {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  padding: .9rem 1.1rem; border-radius: 12px;
  border: 1px solid var(--border); border-left: 3px solid var(--gold);
  box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .15s;
}
.briefing-summary .bs-pill:hover { transform: translateY(-2px); }
.briefing-summary .bs-pill .label {
  font-size: .66rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em; font-weight: 700;
}
.briefing-summary .bs-pill .value {
  font-size: 1.55rem; font-weight: 800; color: var(--text-strong);
  margin-top: .2rem; letter-spacing: -.02em;
}
.briefing-summary .bs-pill.bad  { border-left-color: var(--red); }
.briefing-summary .bs-pill.bad  .value { color: #f87171; }
.briefing-summary .bs-pill.warn { border-left-color: var(--amber); }
.briefing-summary .bs-pill.warn .value { color: #fbbf24; }

/* ── Project badges ─────────────────────────────────── */
.project-badge {
  display: inline-block; padding: .2rem .65rem;
  border: 1.5px solid; border-radius: 999px;
  font-size: .68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; white-space: nowrap; vertical-align: middle;
}
.cost-name { margin-left: .55rem; font-weight: 600; color: var(--text-strong); vertical-align: middle; }

/* Topbar project tint */
.topbar.project-selected {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--proj-bg, var(--gold)) 15%, var(--glass)) 0%,
    var(--glass) 60%);
  border-bottom: 2px solid color-mix(in srgb, var(--proj-border, var(--gold-3)) 60%, var(--border));
}
.topbar-project-tag {
  display: inline-block; padding: .3rem .75rem; border-radius: 999px;
  border: 1.5px solid; font-size: .7rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em;
  margin-left: .5rem;
  filter: brightness(1.05);
}

/* Briefing list project badge spacing */
.briefing-section li .project-badge { margin-right: .4rem; }

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

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -280px; transition: left .25s ease; z-index: 20; }
  .sidebar.open { left: 0; }
  #menu-toggle { display: block; }
  .view { padding: 1rem; }
  .topbar { padding: 0 1rem; }
}

/* ── Pipeline-v2 Design Review ────────────────────────── */
.v2-decision { padding: 1.25rem 1.5rem; border-radius: var(--radius); margin-bottom: 1rem;
  border: 1px solid var(--border); }
.v2-decision-label { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  opacity: .8; }
.v2-decision-value { font-size: 1.6rem; font-weight: 800; margin-top: .25rem; }
.v2-decision-rationale { margin-top: .5rem; font-size: .9rem; opacity: .85; }
.v2-decision-good { background: rgba(16,185,129,.12); color: #34d399; border-color: rgba(16,185,129,.4); }
.v2-decision-warn { background: rgba(245,158,11,.12); color: #fbbf24; border-color: rgba(245,158,11,.4); }
.v2-decision-bad  { background: rgba(239,68,68,.14); color: #f87171; border-color: rgba(239,68,68,.45); }

.v2-meta-row { display:flex; align-items:center; justify-content:space-between; gap:1rem;
  margin-bottom: 1rem; flex-wrap: wrap; }
.v2-meta { margin-top: .5rem; font-size: .85rem; }
.v2-row-total td { font-weight: 700; background: rgba(255,255,255,.04); }
.v2-notes { font-size: .8rem; opacity: .8; max-width: 28ch; }
.v2-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }

.badge.badge-good { background: rgba(16,185,129,.14); color: #34d399; border-color: rgba(16,185,129,.4); }
.badge.badge-warn { background: rgba(245,158,11,.14); color: #fbbf24; border-color: rgba(245,158,11,.4); }
.badge.badge-bad  { background: rgba(239,68,68,.14); color: #f87171; border-color: rgba(239,68,68,.45); }
.badge.badge-neutral { background: var(--surface-3); color: var(--muted); border-color: var(--border); }

.v2-conditions { display: flex; flex-direction: column; gap: 1rem; }
.v2-cond-group h5 { margin: 0 0 .5rem 0; }
.v2-cond-list { list-style: none; padding: 0; margin: 0; border-left: 3px solid var(--border); }
.v2-cond-list li { padding: .55rem .75rem; border-bottom: 1px solid var(--border); }
.v2-cond-list li:last-child { border-bottom: none; }
.v2-cond-critical { border-left-color: #f87171; }
.v2-cond-process  { border-left-color: #fbbf24; }
.v2-cond-obs      { border-left-color: #94a3b8; }
.v2-cond-action { font-size: .75rem; margin-top: .15rem; }
