: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;

  /* Aliases for IT-UI spec (Pass 1, Apr 2026) */
  --surface-alt:  #161920;   /* == --surface-2 */
  --text-muted:   #8b92a0;   /* cooler than --muted, spec tone */
}

* { 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.WIRED         { background: rgba(59,130,246,.12); color: #93c5fd; border-color: rgba(59,130,246,.3); }
.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); }
.badge.feed-kind-pipeline { background: rgba(59,130,246,.12); color: #93c5fd; border-color: rgba(59,130,246,.3); }
.badge.feed-kind-ai_hook  { background: rgba(168,85,247,.14); color: #c4b5fd; border-color: rgba(168,85,247,.35); }
.badge.feed-outcome-ok    { background: rgba(16,185,129,.14); color: #34d399; border-color: rgba(16,185,129,.35); }
.badge.feed-outcome-error { background: rgba(239,68,68,.14); color: #f87171; border-color: rgba(239,68,68,.35); }
.feed-footnote { font-size: .78rem; margin: -.25rem 0 .75rem 0; }

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;
  transition: border-color .15s, background .15s;
}
.file-drop input { display: block; margin: .5rem auto; color: var(--text); }
.file-drop .file-count { margin-top: .4rem; font-size: .85rem; }
.file-drop.drag-over {
  border: 2px dashed #d4af37;
  background: rgba(212, 175, 55, 0.08);
}

/* Design Review drop zone: click-anywhere, hidden native input. */
.file-drop-clickable {
  cursor: pointer; user-select: none;
  padding: 2rem 1.25rem;
}
.file-drop-clickable:hover {
  border-color: var(--gold);
  background: rgba(201, 169, 97, 0.05);
}
.file-drop-clickable:focus-visible {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.25);
}
.file-drop-clickable .file-drop-title {
  font-weight: 700; color: var(--text-strong);
  font-size: 1rem; margin-bottom: .25rem;
}
/* Hide the native <input type="file"> inside the clickable drop zone.
   Kept focusable-hidden so screen readers can still reach it. */
.file-drop-clickable .file-drop-input-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); border: 0;
}
.file-drop-error {
  color: var(--red); font-size: .82rem; margin-top: .4rem; min-height: 1rem;
}

/* ── 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(2, minmax(0, 1fr));
  gap: 1rem;
}
.briefing-grid > .briefing-section { grid-column: span 2; }
.briefing-grid > .briefing-section--empty { grid-column: span 1; }
@media (max-width: 640px) {
  .briefing-grid { grid-template-columns: 1fr; }
  .briefing-grid > .briefing-section,
  .briefing-grid > .briefing-section--empty { grid-column: span 1; }
}
.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); }

tr.row-warn    { background: rgba(245,158,11,.08); }
tr.row-danger  { background: rgba(239,68,68,.10); }
tr.row-recommended { background: rgba(16,185,129,.14); }
tr.row-recommended td { font-weight: 600; }

.compare-zones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1rem 0; }
.compare-drop { display: flex; flex-direction: column; gap: .5rem; padding: 1rem; }
.compare-slot-title { font-weight: 600; color: var(--text, #e5e7eb); }
.callout-success {
  background: rgba(16,185,129,.12);
  border: 1px solid rgba(16,185,129,.35);
  color: #34d399;
  padding: .75rem 1rem;
  border-radius: 6px;
  margin: 1rem 0;
}
.callout-success strong { display: block; margin-bottom: .25rem; font-size: 1.05rem; }
tr.row-warn td, tr.row-danger td { border-top-color: rgba(255,255,255,.06); }

.filter-bar { display: flex; gap: 1rem; margin: .5rem 0 1rem; flex-wrap: wrap; align-items: center; }
.filter-bar label { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .85rem; }
.filter-select {
  background: var(--surface-2); color: var(--text, #e5e7eb);
  border: 1px solid var(--border); border-radius: 6px;
  padding: .35rem .55rem; font-size: .85rem;
}

.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; }

/* ── Typology project badges ───────────────────────── */
.type-badge {
  margin-left: .5rem;
  font-weight: 700;
  min-width: 1.25rem;
  text-align: center;
  padding: 0 .45rem;
}
.type-badge-A { background: rgba(16,185,129,.14); color: #34d399; border-color: rgba(16,185,129,.4); }
.type-badge-B { background: rgba(245,158,11,.14); color: #fbbf24; border-color: rgba(245,158,11,.4); }
.type-badge-C { background: rgba(59,130,246,.14); color: #60a5fa; border-color: rgba(59,130,246,.4); }
.badge.BLUE   { background: rgba(59,130,246,.14); color: #60a5fa; border-color: rgba(59,130,246,.35); }

/* Recommendation block (comparison view) */
.recommendation-block { border-left: 3px solid var(--gold); }
.recommendation-block .director-form textarea,
.recommendation-block .director-area textarea {
  width: 100%;
  min-height: 3.5rem;
}
.recommendation-block .director-readonly {
  margin-top: .5rem;
  padding: .75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.override-link { color: var(--gold); text-decoration: underline; }
.modal.modal-wide { max-width: 560px; }
.field-hint { margin-top: .15rem; font-size: .75rem; }
.badge.badge-good    { background: rgba(16,185,129,.14); color: #34d399; border-color: rgba(16,185,129,.35); }
.badge.badge-warn    { background: rgba(245,158,11,.14); color: #fbbf24; border-color: rgba(245,158,11,.35); }
.badge.badge-bad     { background: rgba(239,68,68,.14); color: #f87171; border-color: rgba(239,68,68,.35); }
.badge.badge-neutral { background: var(--surface-3); color: var(--muted); border-color: var(--border); }

/* Typology project modal */
.structural-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem;
  margin-top: .5rem;
}
.structural-block label.modal-field-checkbox {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .25rem 0;
}
.callout-warn {
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.35);
  color: #fbbf24;
  padding: .5rem .75rem;
  border-radius: var(--radius);
  margin: .5rem 0;
}
.callout-success {
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.35);
  color: #34d399;
  padding: .5rem .75rem;
  border-radius: var(--radius);
}

/* ══════════════════════════════════════════════════════
   IT-UI Pass 1 — Dashboard polish (Apr 2026, pre-EDI-5-May)
   All additions below. Scoped so they do not collide with
   existing .pill/.donut/.dropzone usages above.
   ══════════════════════════════════════════════════════ */

/* TASK 6 — card depth + ring shadow */
.card,
.kpi-card,
.project-card {
  box-shadow: 0 4px 14px rgba(0,0,0,0.28),
              0 0 0 1px rgba(42,45,53,0.6);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color .15s;
}
.card:hover,
.kpi-card:hover,
.project-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.38),
              0 0 0 1px rgba(201,169,97,0.22);
}
/* Keep the gold ring for RAG project cards on hover (preserves legacy cue) */
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.48),
              0 0 0 1px var(--gold-3);
}

/* TASK 1 — zero-noise empty collapse.
   For a card or section that evaluates to 0 items, apply .card--empty
   to reduce its footprint to a single muted line. */
.card--empty {
  padding: .55rem 1rem;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: none;
  font-size: .82rem;
  font-weight: 500;
  margin-bottom: .55rem;
  min-height: 0;
}
.card--empty:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}
/* When a briefing section has zero items, collapse to a thin reassurance strip
   (single-line ~44px, one column, flat surface, no card-style padding/shadow). */
.briefing-section--empty {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-top-width: 1px;
  border-radius: 8px;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.briefing-section--empty .bs-head {
  margin: 0;
  width: 100%;
  justify-content: flex-start;
}
.briefing-section--empty .bs-head h4 {
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0;
}
.briefing-section--empty .bs-icon { font-size: .95rem; opacity: .55; }
.briefing-section--empty .bs-count { display: none; }
.briefing-section--empty .bs-empty { display: none; }

/* TASK 3 — Status pills.
   Scoped via [class*="pill--"] so the existing .summary-strip .pill KPI
   styling is NOT disturbed (summary-strip pills use .kpi-* modifiers). */
.pill[class*="pill--"] {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  text-transform: uppercase;
  line-height: 1.5;
}
.pill--open     { background: rgba(201,169,97,0.12); color: #d4b876; }
.pill--overdue  { background: rgba(239,68,68,0.12);  color: #f87171; }
.pill--closed   { background: rgba(139,146,160,0.12); color: var(--text-muted); }
.pill--approved { background: rgba(13,148,136,0.14); color: #2dd4bf; }
.pill--rejected { background: rgba(239,68,68,0.14);  color: #f87171; }
.pill--pending  { background: rgba(245,158,11,0.14); color: #fbbf24; }
.pill--neutral  { background: var(--surface-3);      color: var(--text-muted); }

/* TASK 4 — Subtle breathing for overdue only. Opacity oscillates 1 ↔ 0.78. */
@keyframes breathe {
  0%, 100% { opacity: 1;    }
  50%      { opacity: 0.78; }
}
.pill--overdue { animation: breathe 2.5s ease-in-out infinite; }

/* TASK 2 — Days Open heatmap cell shading */
td.days-heat--warn { background: rgba(245,158,11,0.12); }
td.days-heat--crit { background: rgba(239,68,68,0.12); }

/* TASK 5 — AI insight panel */
.ai-insight {
  border-left: 3px solid var(--gold);
  background: linear-gradient(
    90deg,
    rgba(201,169,97,0.06) 0%,
    rgba(26,29,35,0) 40%
  );
  padding: 14px 18px;
  border-radius: 6px;
  margin: 12px 0;
}
.ai-insight__label {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 6px;
  font-weight: 700;
  text-transform: uppercase;
}
.ai-insight__body { color: var(--text); font-size: .92rem; line-height: 1.55; }
.ai-insight__body strong.critical { color: var(--red); }

/* TASK 9 — Modal form grid layout */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.form-grid .modal-field { margin: 0; }
.form-grid .field--full { grid-column: 1 / -1; }
.field--locked input,
.field--locked select,
.field--locked textarea,
input.field--locked,
select.field--locked,
textarea.field--locked {
  opacity: 0.7;
  cursor: not-allowed;
  background: var(--surface-alt);
}
.field--locked input:focus,
.field--locked select:focus,
.field--locked textarea:focus,
input.field--locked:focus,
select.field--locked:focus,
textarea.field--locked:focus {
  border-color: var(--border);
  box-shadow: none;
}
.field--locked .field-lock {
  display: inline-block;
  margin-left: .3rem;
  opacity: .75;
  font-size: .75rem;
}
@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field--full { grid-column: 1; }
}

/* TASK 8 — Enhanced dropzone visual spec (also supports legacy .drag /
   .drag-over classes so existing JS does not need changes).
   The base .dropzone rule was defined earlier; these additions layer
   on the IT-UI spec look and the __icon/__label/__hint structure. */
.dropzone {
  border-radius: 10px;
  padding: 28px;
  color: var(--text-muted);
}
.dropzone.is-dragover,
.dropzone.drag,
.dropzone.drag-over {
  border-color: var(--gold);
  background: rgba(201,169,97,0.05);
  color: var(--text);
  transform: none;
}
.dropzone__icon {
  font-size: 1.9rem;
  color: var(--gold);
  opacity: .8;
  margin-bottom: .45rem;
  line-height: 1;
}
.dropzone__label {
  font-size: .96rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: .35rem;
}
.dropzone__hint {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: .02em;
}
.dropzone__link {
  color: var(--gold);
  text-decoration: underline;
  cursor: pointer;
}
/* Apply the same visual treatment to the existing .file-drop-clickable
   (Design Review / Compare) without rewriting its DOM. */
.file-drop-clickable.drag-over {
  border-color: var(--gold);
  background: rgba(201,169,97,0.05);
  color: var(--text);
}

/* TASK 10 — Budget donut (namespaced .budget-donut to avoid collision
   with the existing SVG-based .donut used in project cards). */
.budget-donut {
  --size: 160px;
  width: var(--size); height: var(--size);
  border-radius: 50%;
  background: conic-gradient(
    var(--gold) calc(var(--pct) * 1%),
    var(--border) 0
  );
  display: grid; place-items: center;
  position: relative;
  flex-shrink: 0;
}
.budget-donut::before {
  content: '';
  position: absolute; inset: 14px;
  border-radius: 50%;
  background: var(--surface);
}
.budget-donut__center { position: relative; text-align: center; }
.budget-donut__pct   { font-size: 28px; font-weight: 700; color: var(--gold); letter-spacing: -.02em; }
.budget-donut__label { font-size: 11px; color: var(--text-muted);
                       letter-spacing: 0.08em; margin-top: 2px; text-transform: uppercase; }
.budget-donut-wrap {
  display: flex; align-items: center; gap: 1.5rem;
  margin: .25rem 0 1.25rem;
  flex-wrap: wrap;
}
.budget-donut-meta {
  display: flex; flex-direction: column; gap: .25rem;
  font-size: .85rem; color: var(--text-muted);
}
.budget-donut-meta strong {
  display: block; color: var(--text-strong);
  font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em;
}
.budget-donut.is-over {
  background: conic-gradient(
    var(--red) calc(var(--pct) * 1%),
    var(--border) 0
  );
}
.budget-donut.is-over .budget-donut__pct { color: #f87171; }
.budget-donut.is-warn {
  background: conic-gradient(
    var(--amber) calc(var(--pct) * 1%),
    var(--border) 0
  );
}
.budget-donut.is-warn .budget-donut__pct { color: #fbbf24; }

/* TASK 7 — Toast notifications */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: .55rem;
  pointer-events: none;
  max-width: 420px;
}
.toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 420px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-muted);
  border-radius: 10px;
  padding: .7rem 1rem;
  font-size: .88rem;
  line-height: 1.4;
  box-shadow: 0 10px 28px rgba(0,0,0,.5);
  cursor: pointer;
  animation: toast-in .18s ease-out;
}
.toast.is-leaving { animation: toast-out .15s ease-in forwards; }
.toast--success { border-left-color: var(--emerald-2); }
.toast--error   { border-left-color: var(--red); }
.toast--warning { border-left-color: var(--amber); }
.toast--info    { border-left-color: var(--gold); }
@keyframes toast-in {
  from { transform: translateX(32px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toast-out {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(32px); opacity: 0; }
}

/* ══════════════════════════════════════════════════════
   IT-UI Pass 1.5 — targeted browser-walk fixes
   ══════════════════════════════════════════════════════ */

/* FIX 2 — Mobile KPI grid (portfolio summary strip) */
@media (max-width: 640px) {
  .kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .kpi-grid .kpi-card,
  .kpi-grid .pill {
    min-height: 92px;
  }
}

/* FIX 3 — Cost dashboard mobile (donut + headline side-by-side, KPI 2-col) */
@media (max-width: 768px) {
  .cost-monitor-head {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    align-items: center;
  }
  .cost-monitor-head .budget-donut { --size: 120px; }
  .cost-monitor-head .headline { font-size: 18px; }
  .cost-monitor-head .budget-donut-meta strong { font-size: 18px; }
  .cost-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 14px;
  }
}
.cost-breakdown-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cost-breakdown-wrap table { min-width: 720px; }

/* FIX 4 — Register tables horizontal scroll on mobile */
.register-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}
.register-table-wrap table { min-width: 880px; }
@media (max-width: 768px) {
  .register-table-wrap {
    -webkit-mask-image: linear-gradient(to right, black 95%, transparent);
            mask-image: linear-gradient(to right, black 95%, transparent);
  }
}

/* FIX 5 — Mobile dropzone collapses to single row */
@media (max-width: 640px) {
  .dropzone {
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
  }
  .dropzone__icon { font-size: 20px; margin-bottom: 0; }
  .dropzone__label { font-size: 13px; margin-bottom: 0; }
  .dropzone__hint { display: none; }
}

/* ──────────────────────────────────────────────────────────────────────
   A01 Bid-Brief prefill — New Project modal dropzone, AI chips, side panel
   ────────────────────────────────────────────────────────────────────── */
.brief-dropzone {
  border: 2px dashed #c9c9d4;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: #fafbff;
  transition: background 120ms, border-color 120ms;
}
.brief-dropzone.brief-dz-active {
  border-color: #5b6cf6;
  background: #f1f3ff;
}
.brief-dz-heading {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
}
.brief-dz-caption {
  font-size: 12px;
  margin-bottom: 8px;
  line-height: 1.35;
}
.brief-dz-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.brief-dz-status {
  margin-top: 6px;
  font-size: 12px;
  min-height: 1em;
}
.brief-dz-error {
  margin-top: 4px;
  font-size: 12px;
  min-height: 0;
}
.brief-dz-error:empty { display: none; }

/* AI chip — small pill that appears next to a field label when A01 populated it */
.ai-chip-slot {
  display: inline-block;
  margin-left: 6px;
}
.ai-chip {
  display: inline-block;
  background: rgba(201,169,97,.12);
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 1px solid rgba(201,169,97,.3);
  cursor: help;
}

/* Amber highlight on prefilled inputs — 3s fade-out */
.brief-prefilled {
  animation: briefPrefillFlash 3s ease-out;
  border-left: 3px solid var(--amber) !important;
}
@keyframes briefPrefillFlash {
  0%   { background: rgba(245,158,11,.22); }
  60%  { background: rgba(245,158,11,.08); }
  100% { background: inherit; }
}

/* Client suggestion chip under the Client field */
.brief-client-suggestion {
  font-size: 12px;
  margin: -6px 0 8px 0;
  padding: 6px 8px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: 4px;
  color: var(--text);
}
.link-button {
  background: none;
  border: none;
  color: #3b4cc9;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

/* Side panel — all brief-extracted fields that don't map to modal inputs */
.brief-sidepanel {
  margin-top: 14px;
  border: 1px solid #e0e1ec;
  border-radius: 8px;
  background: #fafbff;
}
.brief-sp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
}
.brief-sp-title {
  font-size: 12px;
  font-weight: 600;
  color: #444;
}
.brief-sp-body {
  padding: 0 12px 12px 12px;
  border-top: 1px solid #e0e1ec;
}
.brief-sp-row {
  margin-top: 10px;
  font-size: 12px;
}
.brief-sp-row-label {
  font-weight: 600;
  margin-bottom: 2px;
}
.brief-sp-row-value {
  white-space: pre-wrap;
  word-break: break-word;
}
.brief-sp-list {
  margin: 4px 0 0 18px;
  padding: 0;
}
.brief-sp-list li { margin-bottom: 2px; }
.brief-sp-conf { font-weight: 400; }

.hidden { display: none !important; }

/* ──────────────────────────────────────────────────────────────────────
   A55 AI insights — Daily Briefing cards (Critical Risks / Urgent Items)
   ────────────────────────────────────────────────────────────────────── */
.briefing-ai-meta {
  font-size: 11px;
  margin-right: 8px;
  align-self: center;
}
.briefing-ai-notice {
  margin-top: 8px;
  padding: 8px 12px;
  font-size: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  background: var(--glass);
  color: var(--text);
}
.briefing-ai-notice.warn {
  border-left-color: var(--amber);
}
.briefing-ai-notice.error {
  border-left-color: var(--red);
  color: var(--red);
}
.briefing-ai-card {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  background: var(--glass);
  color: var(--text);
  margin-bottom: 4px;
}
.briefing-ai-risks  { border-left-color: var(--red); }
.briefing-ai-urgent { border-left-color: var(--amber); }
/* A41 Cost Forecast variants — reuse the same card shell. */
.briefing-ai-forecast-green        { border-left-color: var(--green); }
.briefing-ai-forecast-amber        { border-left-color: var(--amber); }
.briefing-ai-forecast-red          { border-left-color: var(--red); }
.briefing-ai-forecast-insufficient { border-left-color: var(--gold); }
.briefing-ai-forecast-loading      { border-left-color: var(--border-strong); }
.cost-forecast-head { justify-content: flex-start; }
.cost-forecast-head .briefing-ai-title { flex: 1; }
.cost-forecast-refresh {
  font-size: 11px;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.cost-forecast-refresh:hover { text-decoration: underline; }
.cost-forecast-headline {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-strong);
  margin: 2px 0 6px;
}
.cost-forecast-meta {
  margin-top: 6px;
  font-size: 11px;
}
.cost-forecast-retry {
  color: var(--gold);
  text-decoration: underline;
  margin-left: 4px;
}
.briefing-ai-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.briefing-ai-chip {
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: help;
}
.briefing-ai-title { font-size: 12px; font-weight: 600; color: var(--text-strong); }
.briefing-ai-body  { font-size: .92rem; line-height: 1.55; color: var(--text); }

/* ──────────────────────────────────────────────────────────────────────
   A17 AI Nudge — per-row button + modal
   ────────────────────────────────────────────────────────────────────── */
.btn--ai-nudge {
  display: inline-block;
  padding: 3px 9px;
  background: rgba(201,169,97,.1);
  color: var(--gold);
  border: 1px solid rgba(201,169,97,.35);
  border-radius: 6px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: background .12s, border-color .12s, color .12s;
}
.btn--ai-nudge:hover {
  background: rgba(201,169,97,.2);
  border-color: var(--gold);
  color: var(--gold-2);
}

.nudge-modal-body { display: flex; flex-direction: column; gap: .85rem; }
.nudge-chips-row  { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.nudge-chips-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
  min-width: 1.8rem;
}
.nudge-chips-slot { display: inline-flex; gap: .35rem; flex-wrap: wrap; }
.nudge-chip { cursor: default; }
.nudge-resolution-card { margin: 0; }
.nudge-field { display: flex; flex-direction: column; gap: .3rem; }
.nudge-field > span {
  font-size: .68rem; color: var(--muted);
  font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.nudge-subject, .nudge-body {
  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;
}
.nudge-subject:focus, .nudge-body:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,97,.18);
}
.nudge-body { resize: vertical; min-height: 10rem; line-height: 1.5; }
.nudge-error:empty { display: none; }
.nudge-error { color: var(--red); font-size: .82rem; min-height: 1rem; }
.nudge-actions { align-items: center; }
.nudge-meta { font-size: .72rem; text-align: right; margin-top: -.25rem; }

/* ── A56 Similarity Search ─────────────────────────────── */
.similarity-link {
  font-size: .85rem;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px dashed rgba(201,169,97,.45);
  align-self: flex-start;
  padding: .15rem 0;
  cursor: pointer;
}
.similarity-link:hover { border-bottom-color: var(--gold); }
.similarity-link.is-loading { opacity: .6; pointer-events: none; }
.similarity-banner {
  font-size: .78rem;
  color: var(--amber, #c9a961);
  background: rgba(201, 169, 97, .12);
  border: 1px solid rgba(201, 169, 97, .28);
  border-radius: 4px;
  padding: .35rem .6rem;
  min-height: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.similarity-banner:empty { display: none; }
.similarity-panel {
  display: flex; flex-direction: column; gap: .5rem;
  padding: .5rem .6rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  background: rgba(255,255,255,.02);
  min-height: 2.5rem;
}
.similarity-empty { font-size: .82rem; }
.similarity-tag { font-size: .72rem; color: var(--gold); text-align: right; }
.similarity-row {
  display: flex; flex-direction: column; gap: .2rem;
  padding: .4rem .5rem;
  border-left: 2px solid rgba(201,169,97,.35);
  background: rgba(255,255,255,.015);
}
.similarity-row-head {
  display: flex; align-items: center; gap: .6rem;
  flex-wrap: wrap;
}
.similarity-row-title {
  font-weight: 600; color: var(--text);
  text-decoration: none; flex: 1; min-width: 0;
}
.similarity-row-title:hover { text-decoration: underline; }
.similarity-pill {
  font-size: .7rem; padding: .1rem .5rem;
  border-radius: 999px;
  background: rgba(201,169,97,.12);
  color: var(--gold);
}
.similarity-score {
  font-size: .75rem; color: var(--muted, #8a8a8a);
  font-variant-numeric: tabular-nums;
}
.similarity-row-snippet { font-size: .8rem; color: var(--text); opacity: .85; }
.similarity-row-rationale { font-size: .75rem; font-style: italic; }

