/* CaptureBridge Pipeline - base styles (F0; work packages add web/static/css/<blueprint>.css if needed).
   Palette: Flag Blue #002868 (primary, nav), Flag Red #BF0A30 (sparing accents / CTA),
   Capitol Stone #F4F0E8 (panels), white background, black text. */
:root {
  --flag-blue: #002868;
  --flag-blue-dark: #001a45;
  --flag-blue-light: #e6ebf3;
  --flag-red: #BF0A30;
  --flag-red-dark: #990826;
  --stone: #F4F0E8;
  --stone-dark: #e4ddd0;
  --ink: #000000;
  --ink-soft: #3d4350;
  --muted: #5f6673;
  --line: #d4d7dd;
  --line-soft: #e8eaee;
  --bg: #ffffff;
  --ok: #1d6b38;
  --ok-bg: #e5f2e9;
  --warn: #8a5a00;
  --warn-bg: #fdf3dc;
  --err: #BF0A30;
  --err-bg: #fbe7eb;
  --radius: 4px;
  --nav-w: 210px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: Consolas, "Cascadia Mono", "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.4; }
a { color: var(--flag-blue); }
a:hover { color: var(--flag-red); }
h1, h2, h3, h4 { color: var(--ink); margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.45rem; font-weight: 600; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .6rem; }
code, .mono { font-family: var(--mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--flag-blue); color: #fff; padding: .4rem .8rem; z-index: 50; }
.skip-link:focus { left: .5rem; }
:focus-visible { outline: 2px solid var(--flag-red); outline-offset: 1px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 64px;
  padding: 0 1rem; background: #fff; border-bottom: 3px solid var(--flag-blue); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; }
.brand img { display: block; height: 56px; width: auto; }   /* Opportunity Manager logo (Michael, 10/30/2026) */
.brand-sub { font-weight: 600; color: var(--flag-red); letter-spacing: .04em; text-transform: uppercase; font-size: .8rem;
  border-left: 1px solid var(--line); padding-left: .5rem; }
/* The header's right side keeps one line: Company and Working as stay side by side (Michael, 10/28/2026); the logo
   gives way first (its PIPELINE tag hides on narrower windows). */
.topbar-right { display: flex; align-items: center; gap: .5rem; flex-wrap: nowrap; flex: none; }
.header-switches { display: flex; align-items: center; gap: .75rem; flex-wrap: nowrap; }
.user-switch { display: flex; align-items: center; gap: .35rem; margin: 0; white-space: nowrap; }
.user-switch label { font-size: .8rem; color: var(--muted); }
.user-switch select { min-width: 0; }
.js .js-hide { display: none; }
/* The menu button (10/26/2026): hides or shows the left menu; only with JavaScript, which remembers the choice. */
.nav-toggle { display: none; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; flex: none;
  margin-right: .25rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--flag-blue);
  font-size: 1.2rem; line-height: 1; cursor: pointer; }
.nav-toggle:hover { background: var(--flag-blue); color: #fff; }
.js .nav-toggle { display: inline-flex; }
.topbar > .brand { margin-right: auto; min-width: 0; overflow: hidden; }
@media (max-width: 1100px) { .brand-sub { display: none; } }
.nav-hidden .sidenav { display: none; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: calc(100vh - 64px); }
.sidenav { width: var(--nav-w); flex: 0 0 var(--nav-w); background: var(--flag-blue); color: #fff; padding: .75rem 0 2rem;
  position: sticky; top: 64px; align-self: flex-start; height: calc(100vh - 64px); overflow-y: auto; }
.nav-section { margin-bottom: .6rem; }
.nav-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #b9c4d8; padding: .35rem 1rem .2rem; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav a { display: block; color: #fff; text-decoration: none; padding: .32rem 1rem .32rem calc(1rem - 3px);
  border-left: 3px solid transparent; font-size: .93rem; }
.sidenav a:hover { background: var(--flag-blue-dark); color: #fff; }
.sidenav a.active { background: var(--flag-blue-dark); border-left-color: var(--flag-red); font-weight: 600; }
.sidenav a.unavailable { color: #8193b3; cursor: default; }
.sidenav a.unavailable:hover { background: transparent; }
/* capture round (5.1): the five places, then "More" (a <details>, open when the page is inside it) */
.nav-primary { margin-bottom: .5rem !important; }
.nav-primary a { font-size: 1rem; font-weight: 600; padding-top: .45rem; padding-bottom: .45rem; }
.nav-more { border-top: 1px solid rgba(255, 255, 255, .18); padding-top: .35rem; }
.nav-more > summary { cursor: pointer; list-style: none; color: #dfe5ef; font-size: .85rem; font-weight: 600;
  padding: .35rem 1rem; text-transform: uppercase; letter-spacing: .06em; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary::after { content: " \25B8"; }
.nav-more[open] > summary::after { content: " \25BE"; }
.nav-more > summary:hover { background: var(--flag-blue-dark); }
.nav-more > summary:focus-visible { outline-offset: -2px; }
.account-switch select { min-width: 90px; }
.main { flex: 1; min-width: 0; padding: 1rem 1.25rem 3rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-bottom: .85rem; border-bottom: 1px solid var(--line-soft); padding-bottom: .5rem; }
.page-head h1 { margin: 0; }
.page-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

/* ---------- flash ---------- */
.flashes { margin-bottom: .75rem; display: grid; gap: .35rem; }
.flash { padding: .5rem .75rem; border-radius: var(--radius); border-left: 4px solid var(--flag-blue); background: var(--flag-blue-light); }
.flash-success { border-left-color: var(--ok); background: var(--ok-bg); }
.flash-warning { border-left-color: var(--warn); background: var(--warn-bg); }
.flash-error { border-left-color: var(--err); background: var(--err-bg); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .3rem; padding: .38rem .8rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; color: var(--ink); font: inherit; font-size: .93rem; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--flag-blue); color: var(--flag-blue); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--flag-blue); border-color: var(--flag-blue); color: #fff; }
.btn-primary:hover { background: var(--flag-blue-dark); border-color: var(--flag-blue-dark); color: #fff; }
.btn-cta { background: var(--flag-red); border-color: var(--flag-red); color: #fff; font-weight: 600; }
.btn-cta:hover { background: var(--flag-red-dark); border-color: var(--flag-red-dark); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--flag-blue); }
.btn-ghost:hover { background: var(--flag-blue-light); border-color: transparent; }
.btn-danger { color: var(--flag-red); border-color: #e6b3be; }
.btn-danger:hover { background: var(--err-bg); color: var(--flag-red-dark); border-color: var(--flag-red); }
.btn-sm { padding: .2rem .5rem; font-size: .82rem; }
.btn-link { background: none; border: 0; padding: 0; color: var(--flag-blue); text-decoration: underline; cursor: pointer; font: inherit; }
.inline-form { display: inline; margin: 0; }

/* ---------- cards / panels ---------- */
.card { background: var(--stone); border: 1px solid var(--stone-dark); border-radius: var(--radius); margin-bottom: 1rem; }
.card-title { font-size: 1rem; margin: 0; padding: .55rem .85rem; border-bottom: 1px solid var(--stone-dark);
  display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.card-body { padding: .75rem .85rem; }
.card-body > :last-child { margin-bottom: 0; }
.card .table { background: #fff; }
.card-error { border-left: 4px solid var(--flag-red); }
.error-code { font-weight: 700; color: var(--flag-red); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }

/* ---------- tiles ---------- */
.tiles { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.tile { display: flex; flex-direction: column; justify-content: center; min-width: 130px; padding: .6rem .85rem;
  background: var(--stone); border: 1px solid var(--stone-dark); border-top: 3px solid var(--flag-blue);
  border-radius: var(--radius); color: var(--ink); text-decoration: none; }
a.tile:hover { border-top-color: var(--flag-red); color: var(--ink); }
.tile.active { background: var(--flag-blue-light); border-color: var(--flag-blue); }
.tile-accent { border-top-color: var(--flag-red); }
.tile-value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; color: var(--flag-blue); }
.tile-value-sm { font-size: 1rem; }
.tile-accent .tile-value { color: var(--flag-red); }
.tile-label { font-size: .8rem; color: var(--ink-soft); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .75rem; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; }
.table-wrap .table { border: 0; }
.table th, .table td { padding: .4rem .55rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.table thead th { background: var(--flag-blue); color: #fff; font-weight: 600; font-size: .82rem; white-space: nowrap;
  position: sticky; top: 0; z-index: 1; }
.table thead th a { color: #fff; text-decoration: none; }
.table thead th a:hover { text-decoration: underline; }
.table thead th.sorted { background: var(--flag-blue-dark); }
.sort-ind { font-size: .7em; }
.table tbody tr:nth-child(even) { background: #fafbfc; }
.table tbody tr:hover { background: var(--flag-blue-light); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.nowrap, .table th.nowrap { white-space: nowrap; }
.table td.check, .table th.check { width: 28px; text-align: center; }
.table-compact th, .table-compact td { padding: .22rem .45rem; font-size: .85rem; }
.table tfoot td { font-weight: 600; border-top: 2px solid var(--line); background: var(--stone); }
.table .title-cell { min-width: 260px; }
.table .sub { display: block; color: var(--muted); font-size: .8rem; }
.overdue { color: var(--flag-red); font-weight: 600; }
.soon { color: var(--warn); font-weight: 600; }

/* ---------- toolbar / forms ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; padding: .55rem .7rem; margin-bottom: .75rem;
  background: var(--stone); border: 1px solid var(--stone-dark); border-radius: var(--radius); }
.toolbar .field { display: flex; flex-direction: column; gap: .15rem; }
.toolbar label, .form-row label, .field > label { font-size: .78rem; color: var(--ink-soft); font-weight: 600; }
.toolbar .spacer { flex: 1; }
.form-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: .65rem; }
.form-row > .field, .form-row > div { display: flex; flex-direction: column; gap: .2rem; min-width: 160px; flex: 1; }
.form-row > .field.wide { flex: 3; }
.form-row > .field.narrow { flex: 0 0 120px; min-width: 100px; }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=date], input[type=search],
input[type=password], input[type=file], select, textarea {
  font: inherit; font-size: .93rem; color: var(--ink); background: #fff; border: 1px solid #b9bec7; border-radius: var(--radius);
  padding: .32rem .45rem; min-height: 30px; max-width: 100%; }
textarea { min-height: 70px; width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--flag-blue); outline: none; box-shadow: 0 0 0 2px var(--flag-blue-light); }
input[type=range] { accent-color: var(--flag-blue); }
input[type=checkbox], input[type=radio] { accent-color: var(--flag-blue); }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .2rem .8rem; }
.checkbox-grid label { font-weight: 400; font-size: .88rem; color: var(--ink); display: flex; gap: .35rem; align-items: flex-start; }
.form-actions { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; }
.help { font-size: .8rem; color: var(--muted); }
.required::after { content: " *"; color: var(--flag-red); }

/* ---------- chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: .25rem; padding: .16rem .55rem; border-radius: 999px;
  background: var(--stone); border: 1px solid var(--stone-dark); color: var(--ink); font-size: .8rem; text-decoration: none; white-space: nowrap; }
a.chip:hover { border-color: var(--flag-blue); color: var(--flag-blue); }
.chip-alert { background: var(--err-bg); border-color: #efb8c4; color: var(--flag-red); font-weight: 600; }
.chip-attn { background: var(--flag-blue); border-color: var(--flag-blue); color: #fff; }
a.chip-attn:hover { color: #fff; background: var(--flag-blue-dark); }
.chip-ok { background: var(--ok-bg); border-color: #b9dcc4; color: var(--ok); }
.chip-warn { background: var(--warn-bg); border-color: #edd59a; color: var(--warn); }
.badge { display: inline-block; padding: .1rem .45rem; border-radius: var(--radius); font-size: .76rem; font-weight: 600;
  white-space: nowrap; border: 1px solid transparent; background: var(--line-soft); color: var(--ink); }
.badge.stage-unassigned { background: #eef0f3; border-color: #cfd4dc; color: #3d4350; }
.badge.stage-interest { background: #e6ebf3; border-color: #b3c0d6; color: var(--flag-blue); }
.badge.stage-pursue { background: #d6e0f0; border-color: #9fb2d3; color: var(--flag-blue); }
.badge.stage-bid { background: #c2d1ea; border-color: #8aa2cb; color: var(--flag-blue-dark); }
.badge.stage-active-draft { background: #fdf3dc; border-color: #edd59a; color: #6b4600; }
.badge.stage-active { background: var(--flag-blue); border-color: var(--flag-blue); color: #fff; }
.badge.stage-awaiting-award { background: var(--stone); border-color: #cbbfa6; color: #4d3f22; }
.badge.stage-won { background: var(--ok-bg); border-color: #9fd0ae; color: var(--ok); }
.badge.stage-lost { background: #f1f1f1; border-color: #c8c8c8; color: #555; }
.badge.stage-rejected { background: var(--err-bg); border-color: #efb8c4; color: var(--flag-red); }
.badge-source { background: #fff; border-color: var(--line); color: var(--ink-soft); font-weight: 500; }
.badge-locked { background: var(--warn-bg); border-color: #edd59a; color: var(--warn); }
/* Team status chips (capture round 4.1): the TTS sheet's Status fills, with a border and text dark enough to read. */
.status-chip { font-weight: 600; }
.status-new { background: #eef0f3; border-color: #cfd4dc; color: #3d4350; }
.status-watch { background: #fff2cc; border-color: #e6cf7a; color: #5c4a00; }
.status-gap-watch { background: #f2f2f2; border-color: #c9c9c9; color: #3d3d3d; }
.status-on-hold { background: #ededed; border-color: #bdbdbd; color: #3d3d3d; }
.status-rfi-in-progress { background: #eaf2fb; border-color: #b5cfe9; color: #0f3d68; }
.status-rfi-submitted { background: #ddebf7; border-color: #9dc0e2; color: #0f3d68; }
.status-response-in-progress { background: #fce4d6; border-color: #eeb08a; color: #6b3210; }
.status-capture { background: #e2efda; border-color: #a8cf92; color: #24501a; }
.status-proposal { background: #d9e1f2; border-color: #9fb0d9; color: var(--flag-blue-dark); }
.status-submitted { background: #e4dfec; border-color: #b5a8cb; color: #3e2b5e; }
.status-won { background: var(--ok-bg); border-color: #9fd0ae; color: var(--ok); }
.status-lost { background: #f1f1f1; border-color: #c8c8c8; color: #555; }
.status-passed { background: var(--err-bg); border-color: #efb8c4; color: var(--flag-red); }
.notice-account { border-left: 4px solid var(--flag-blue); background: var(--flag-blue-light); padding: .5rem .75rem;
  border-radius: var(--radius); margin-bottom: .75rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.copy-source { width: 100%; min-height: 160px; font-family: var(--mono); font-size: .85rem; }
.js .copy-source[data-copy-hidden] { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
/* Shipley round (schema 14, SHIPLEY_ROUND 6.4, 12.7): gate state chips (_macros.gate_chip) and flag ratings
   (_macros.flag_rating, _macros.flag_badge). Passed green; Moved anyway and Waiting amber; late Waiting and No bid
   red; Next muted. Fail red, Watch amber, Pending grey; the "Zero-out risk" badge red. */
.chip-gate-passed { background: var(--ok-bg); border-color: #b9dcc4; color: var(--ok); font-weight: 600; }
.chip-gate-override, .chip-gate-waiting { background: var(--warn-bg); border-color: #edd59a; color: var(--warn);
  font-weight: 600; }
.chip-gate-late, .chip-gate-no_bid { background: var(--err-bg); border-color: #efb8c4; color: var(--flag-red);
  font-weight: 600; }
.chip-gate-next { background: #fff; border-color: var(--line); color: var(--muted); }
.chip-flag-fail { background: var(--err-bg); border-color: #efb8c4; color: var(--flag-red); font-weight: 600; }
.chip-flag-watch { background: var(--warn-bg); border-color: #edd59a; color: var(--warn); font-weight: 600; }
.chip-flag-pending { background: #eef0f3; border-color: #cfd4dc; color: #3d4350; font-weight: 600; }
.chip-zero-out { background: var(--err-bg); border-color: #efb8c4; color: var(--flag-red); font-weight: 600;
  font-size: .72rem; padding: .08rem .45rem; }
/* The pursuit page's foundation parts (13.1): a gated press without the Gates card, On the sheet's Capture hint,
   the Next step card's schedule line, the read-only OCI level. */
.gate-notice { border-left: 4px solid var(--warn); }
.gate-notice .gate-line { font-weight: 600; margin: 0 0 .5rem; }
.move-anyway-form { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: flex-end; }
.move-anyway-form textarea { flex: 1 1 22rem; min-height: 2.6rem; }
.capture-hint { color: var(--warn); font-weight: 600; }
.next-schedule { margin: .6rem 0 0; font-size: .88rem; }
.oci-level { margin: .2rem 0 .5rem; }
/* The account page (13.4): its sections and their summaries. */
.account-section .summary-line { margin: 0 0 .5rem; }
.account-section .section-links { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; }
.history-table .is-current td { font-weight: 600; }
/* "Also in {short}: {code}" above the pursuit header (schema 16, docs/QORAL_ROUND.md decision 16). */
.record-also-in { color: var(--muted); font-size: .85rem; margin: 0 0 .5rem; }

/* ---------- misc ---------- */
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.empty { padding: 1.25rem; text-align: center; color: var(--muted); background: #fafbfc; border: 1px dashed var(--line); border-radius: var(--radius); }
.pager { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; margin: .5rem 0 1rem; font-size: .88rem; }
.pager-info { color: var(--muted); margin-right: .5rem; }
.pager-link, .pager-current, .pager-gap { padding: .15rem .5rem; border-radius: var(--radius); border: 1px solid var(--line); text-decoration: none; }
.pager-current { background: var(--flag-blue); border-color: var(--flag-blue); color: #fff; font-weight: 600; }
.pager-gap { border-color: transparent; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .9rem; margin: 0; }
.kv dt { color: var(--ink-soft); font-weight: 600; font-size: .85rem; }
.kv dd { margin: 0; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: .35rem 0; border-bottom: 1px solid var(--stone-dark); font-size: .88rem; }
.history .ts { color: var(--muted); font-size: .8rem; margin-right: .4rem; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li { display: flex; align-items: center; gap: .45rem; padding: .25rem 0; }
.task-list li.done .task-title { text-decoration: line-through; color: var(--muted); }
.status-running { color: var(--flag-blue); font-weight: 600; }
.status-success { color: var(--ok); font-weight: 600; }
.status-error, .status-auth_error, .status-quota_exhausted { color: var(--flag-red); font-weight: 600; }
.status-partial, .status-quota_deferred, .status-skipped_locked { color: var(--warn); font-weight: 600; }
.svg-chart { max-width: 100%; height: auto; display: block; }
.footer-note { margin-top: 2rem; color: var(--muted); font-size: .8rem; }

@media (max-width: 960px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidenav { position: static; width: 100%; height: auto; flex: none; display: flex; flex-wrap: wrap; padding: .25rem 0; }
  .nav-section { margin: 0; }
  .nav-title { display: none; }
  .sidenav ul { display: flex; flex-wrap: wrap; }
  .sidenav a { padding: .35rem .6rem; border-left: 0; border-bottom: 3px solid transparent; }
  .sidenav a.active { border-bottom-color: var(--flag-red); }
  .nav-primary { width: 100%; margin-bottom: 0 !important; }
  .nav-more { width: 100%; border-top: 0; padding-top: 0; }
  .nav-more[open] { display: flex; flex-wrap: wrap; }
  .nav-more > summary { width: 100%; padding: .3rem .6rem; }
  .topbar { height: auto; padding: .4rem .75rem; flex-wrap: wrap; position: static; }
  .topbar-right { flex-wrap: wrap; }      /* a phone: the chips may wrap, Company and Working as stay together */
  .main { padding: .75rem; }
}
@media print {
  .sidenav, .topbar, .page-actions, .toolbar, .pager, form button { display: none !important; }
  .main { padding: 0; }
  .card { background: #fff; }
}
