/* ==========================================================================
   IEA Operations — Project Manager workspace
   Visual draft only: static HTML/CSS/JS, sample data, no backend.
   Brand: Imperial East Africa (primary #1D4076, deep #022966, accent #A3CEF1,
   Roboto / Roboto Slab), taken from imperialeastafrica.tz theme variables.
   ========================================================================== */

@font-face {
  font-family: "Roboto";
  src: url("../fonts/roboto-latin-var.665db5e157d2.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto Slab";
  src: url("../fonts/roboto-slab-latin-var.fee1dc1edf94.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;

  /* brand */
  --brand-950: #011a42;
  --brand-900: #022966;
  --brand-800: #1d4076;
  --brand-700: #24508f;
  --brand-600: #2c62ad;
  --brand-200: #c9def5;
  --brand-100: #e4eefa;
  --brand-50:  #f2f7fd;
  --sky:       #a3cef1;

  /* surfaces & ink */
  --bg:        #f3f6fa;
  --surface:   #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f8;
  --ink-1:     #0f1c30;
  --ink-2:     #47546a;
  --ink-3:     #77839a;
  --line:      #e3e8f0;
  --line-2:    #d2dae6;
  --focus:     #2c62ad;

  /* chart chrome (dataviz method) */
  --grid:  #e8ecf2;
  --axis:  #c6cfdb;

  /* categorical series — validated on #ffffff (all checks pass) */
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --s1-wash: rgba(42, 120, 214, 0.10);
  --plan: #8a94a6;

  /* status — reserved, always shipped with an icon + label */
  --good: #0ca30c;   --good-ink: #006300;   --good-bg: #e8f6e8;
  --warn: #fab219;   --warn-ink: #7a5200;   --warn-bg: #fff4d9;
  --serious: #ec835a; --serious-ink: #9c3d16; --serious-bg: #fdeee6;
  --crit: #d03b3b;   --crit-ink: #9a2a1f;   --crit-bg: #fdeceb;
  --info-ink: #1c5cab; --info-bg: #e7f0fc;
  --neutral-ink: #4a5568; --neutral-bg: #eef1f5;

  /* Shared meaning with the Django app (iea-system/static/css/custom.css):
     brass = "this is waiting on the MD" and nothing else;
     flag  = close deadline (inside 3 days) or a problem. */
  --md: #8a6508; --md-bg: #fbf4e1; --md-border: #f1e0b0;
  --flag: #9a2a1f;

  /* pipeline phases — 4-step ordinal ramp (Intake, Pricing, Review, Submission) */
  --ph-1: #86b6ef; --ph-2: #3987e5; --ph-3: #1c5cab; --ph-4: #0d366b;

  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow-sm: 0 1px 2px rgba(15, 28, 48, 0.04);
  --shadow: 0 1px 2px rgba(15, 28, 48, 0.04), 0 4px 16px rgba(15, 28, 48, 0.05);
  --shadow-lg: 0 18px 50px rgba(2, 41, 102, 0.18);

  --sidebar-w: 252px;
  --rail-w: 330px;
  --topbar-h: 68px;

  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Roboto Slab", "Roboto", Georgia, serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --brand-100: #1b2d4d;
  --brand-50:  #162540;
  --brand-200: #2a4570;

  --bg:        #0a1222;
  --surface:   #121d31;
  --surface-2: #17243b;
  --surface-3: #1d2c46;
  --ink-1:     #eef2f8;
  --ink-2:     #b7c2d4;
  --ink-3:     #8390a6;
  --line:      #22314d;
  --line-2:    #2d3e5e;
  --focus:     #7fb2ef;

  --grid:  #22314d;
  --axis:  #33466a;

  /* dark steps of the same hues — validated on #121d31 */
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --s1-wash: rgba(57, 135, 229, 0.14);
  --plan: #8390a6;

  --good-ink: #4fd14f;  --good-bg: rgba(12, 163, 12, 0.16);
  --warn-ink: #ffc94d;  --warn-bg: rgba(250, 178, 25, 0.14);
  --serious-ink: #f3a07e; --serious-bg: rgba(236, 131, 90, 0.15);
  --crit-ink: #f07a7a;  --crit-bg: rgba(208, 59, 59, 0.18);
  --info-ink: #8dbcf3;  --info-bg: rgba(57, 135, 229, 0.16);
  --neutral-ink: #b7c2d4; --neutral-bg: rgba(183, 194, 212, 0.10);
  --md: #e3b448; --md-bg: rgba(227, 180, 72, 0.13); --md-border: rgba(227, 180, 72, 0.35);
  --flag: #f0897b;
  --ph-1: #184f95; --ph-2: #2a78d6; --ph-3: #5598e7; --ph-4: #9ec5f4;

  --shadow-sm: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--ink-3); }
.ink-2 { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.icon svg { width: 100%; height: 100%; display: block; }
[data-icon] { display: inline-flex; }

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 14px 14px;
  z-index: 40;
}
.brand {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 6px 18px;
}
.brand img { height: 34px; width: auto; }
.brand .logo-dark { display: none; }
:root[data-theme="dark"] .brand .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }
.brand-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand-800); background: var(--brand-100);
  padding: 3px 7px; border-radius: 6px;
}
:root[data-theme="dark"] .brand-tag { color: var(--sky); }

.nav { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
.nav-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3); padding: 14px 10px 6px;
}
.nav a {
  display: flex; align-items: center; gap: 12px;
  height: 40px; padding: 0 10px; margin: 1px 0;
  border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a .icon { width: 19px; height: 19px; color: var(--ink-3); transition: color .15s; }
.nav a:hover { background: var(--brand-50); color: var(--ink-1); }
.nav a:hover .icon { color: var(--brand-700); }
.nav a.active {
  background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
  color: #fff;
  box-shadow: 0 6px 16px rgba(29, 64, 118, 0.28);
}
.nav a.active .icon { color: #fff; }
.nav .count {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px;
  border-radius: 10px; font-size: 11.5px; font-weight: 700;
  display: inline-grid; place-items: center;
  background: var(--surface-3); color: var(--ink-2);
}
.nav a.active .count { background: rgba(255, 255, 255, .2); color: #fff; }
.nav .pill-new {
  margin-left: auto; font-size: 10.5px; font-weight: 700;
  color: var(--brand-700); background: var(--brand-100);
  padding: 2px 8px; border-radius: 10px;
}
:root[data-theme="dark"] .nav .pill-new { color: var(--sky); }

/* a group with sub-pages ("Tender": Tender progress, Tender registration) */
.nav-parent {
  display: flex; align-items: center; gap: 12px; width: 100%;
  height: 40px; padding: 0 10px; margin: 1px 0; border: 0; background: none; cursor: pointer;
  border-radius: var(--radius-sm); font: inherit; font-weight: 500; color: var(--ink-2); text-align: left;
  transition: background .15s, color .15s;
}
.nav-parent > .icon { width: 19px; height: 19px; color: var(--ink-3); transition: color .15s; }
.nav-parent:hover { background: var(--brand-50); color: var(--ink-1); }
.nav-parent:hover > .icon { color: var(--brand-700); }
.nav-group:has(a.active) > .nav-parent { color: var(--ink-1); font-weight: 600; }
.nav-group:has(a.active) > .nav-parent > .icon { color: var(--brand-700); }
:root[data-theme="dark"] .nav-group:has(a.active) > .nav-parent > .icon { color: var(--sky); }
.nav-chev { margin-left: auto; display: inline-grid; place-items: center; color: var(--ink-3); transition: transform .2s; }
.nav-chev .icon { width: 16px; height: 16px; }
.nav-group:not(.open) .nav-chev { transform: rotate(-90deg); }
.nav-sub { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .22s ease, visibility .22s; }
.nav-group.open .nav-sub { grid-template-rows: 1fr; visibility: visible; }
.nav-sub > div { overflow: hidden; min-height: 0; position: relative; }
.nav-sub > div::before { content: ""; position: absolute; left: 19px; top: 2px; bottom: 2px; width: 1.5px; border-radius: 1px; background: var(--line); }
.nav .nav-sub a { height: 36px; padding-left: 41px; position: relative; font-size: 13.5px; }
.nav .nav-sub a::before {
  content: ""; position: absolute; left: 15.5px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px;
  border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line-2); transition: border-color .15s;
}
.nav .nav-sub a:hover::before { border-color: var(--brand-600); }
.nav .nav-sub a.active::before { background: #fff; border-color: #fff; }

.side-foot { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.org-card, .user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2);
}
.org-card img { width: 34px; height: 34px; }
.org-card b, .user-card b { display: block; font-size: 13px; font-weight: 600; }
.org-card span, .user-card span { font-size: 11.5px; color: var(--ink-3); }
.user-card { background: var(--surface); }
.user-card .presence { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--good-ink); }
.user-card .presence::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.side-copy { font-size: 11px; color: var(--ink-3); padding: 2px 4px 0; }

/* ---------- Topbar ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
.search {
  flex: 1; max-width: 560px; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 12px 0 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink-3);
  cursor: text; text-align: left;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s;
}
.search:hover { border-color: var(--line-2); }
.search span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kbd {
  font-size: 11px; font-weight: 600; color: var(--ink-3);
  border: 1px solid var(--line); border-bottom-width: 2px;
  padding: 1px 6px; border-radius: 6px; background: var(--surface-2);
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sample-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--warn-ink);
  background: var(--warn-bg); padding: 5px 10px; border-radius: 20px;
  white-space: nowrap;
}
.sample-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.fx-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 12.5px; color: var(--ink-2); white-space: nowrap;
}
.fx-chip b { color: var(--ink-1); font-weight: 600; }

.icon-btn {
  position: relative;
  width: 40px; height: 40px; border-radius: 11px;
  display: inline-grid; place-items: center;
  border: 1px solid transparent; background: transparent; cursor: pointer;
  color: var(--ink-2);
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); }
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn .dot-count {
  position: absolute; top: 3px; right: 2px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--brand-800); color: #fff;
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--bg);
}
:root[data-theme="dark"] .icon-btn .dot-count { background: var(--s1); }
.icon-btn .dot-count:empty, .nav .count:empty { display: none; } /* e.g. no unread mail */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled:not(.btn-ai) { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:disabled:not(.btn-ai):not(.btn-primary):hover { border-color: var(--line); background: var(--surface); }
.btn .icon { width: 18px; height: 18px; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px rgba(29, 64, 118, 0.25);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-900), var(--brand-700)); border-color: transparent; }
.btn-white { background: #fff; color: var(--brand-900); border-color: transparent; }
.btn-white:hover { background: #eef4fc; }
.btn-ghost-light {
  background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .25);
}
.btn-ghost-light:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.link {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex: none;
  font-size: 12.5px; font-weight: 600; color: var(--brand-700);
  background: none; border: 0; padding: 0; cursor: pointer;
}
:root[data-theme="dark"] .link { color: var(--sky); }
.link .icon { width: 15px; height: 15px; transition: transform .15s; }
.link:hover .icon { transform: translateX(2px); }

/* ---------- Layout ---------- */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-w);
  gap: 20px;
  padding: 22px 24px 40px;
  align-items: start;
}
.content { display: grid; gap: 20px; min-width: 0; }
.content > * { min-width: 0; } /* a wide child (board, table) scrolls inside itself instead of widening the page */
.rail { display: grid; gap: 20px; min-width: 0; align-content: start; }
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-3-wide { grid-template-columns: minmax(0, .9fr) minmax(0, 1.35fr) minmax(0, 1fr); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px;
}
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.card-head .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.card-tools { display: flex; align-items: center; gap: 8px; }
.card-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; justify-content: center; }
.table-toggle {
  height: 28px; padding: 0 9px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: 11.5px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.table-toggle .icon { width: 14px; height: 14px; }
.table-toggle[aria-pressed="true"] { background: var(--brand-100); color: var(--brand-800); border-color: var(--brand-200); }
:root[data-theme="dark"] .table-toggle[aria-pressed="true"] { color: var(--sky); }

/* ---------- Page header (progress page) ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { display: flex; align-items: center; gap: 12px; }
.page-title .t-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-100); color: var(--brand-800);
}
:root[data-theme="dark"] .page-title .t-icon { color: var(--sky); }
.page-title h1 { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.page-title p { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.head-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.select {
  height: 40px; padding: 0 36px 0 12px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-1); font: inherit; font-weight: 500;
  appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px;
  background-size: 5px 5px; background-repeat: no-repeat;
  max-width: 100%;
}
.chip-box {
  height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink-2);
  font-weight: 500; white-space: nowrap;
}

/* ---------- Next submission (countdown, readiness, gates) ----------
   These lived in the navy hero card until 3 Nov 2026. The dashboard's
   top is now a page head plus a stat-card row: see "Dashboard top" at the end. */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.countdown div {
  background: var(--surface-3); border-radius: 10px; padding: 8px 4px 6px; text-align: center;
}
.countdown b { display: block; font-size: 22px; font-weight: 700; line-height: 1; color: var(--brand-900); font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .countdown b { color: var(--ink-1); }
.countdown span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.next-title { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.next-meta { font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 3px; }
.readiness { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.gates { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 12px; }
.gates li { display: flex; align-items: center; gap: 7px; color: var(--ink-2); }
.gates li .icon { width: 15px; height: 15px; }
.gates li.done .icon { color: var(--good); }
.gates li.todo .icon { color: var(--ink-3); }
.gates li.block .icon { color: var(--crit); }
.gates li em { font-style: normal; color: var(--ink-3); margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------- Reference chip (R18: copyable in one click) ---------- */
.ref {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  color: var(--brand-800); background: var(--brand-50);
  border: 1px solid var(--brand-100);
  padding: 1px 4px 1px 7px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
:root[data-theme="dark"] .ref { color: var(--sky); }
.ref .icon { width: 13px; height: 13px; opacity: .55; }
.ref:hover .icon { opacity: 1; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 14px 13px; display: grid; grid-template-columns: auto 1fr; gap: 6px 10px;
  align-items: center; min-width: 0;
  transition: transform .15s, box-shadow .15s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15, 28, 48, .07); }
.kpi-icon {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
}
.kpi-icon .icon { width: 19px; height: 19px; }
.kpi-value, .kpi-delta { grid-column: 1 / -1; }
.kpi-value { margin-top: 4px; }
.kpi-label { font-size: 12px; color: var(--ink-3); font-weight: 500; line-height: 1.3; }
.kpi { container-type: inline-size; }
.kpi-value { font-size: clamp(19px, 15cqi, 25px); font-weight: 700; letter-spacing: -.01em; line-height: 1.1; overflow-wrap: anywhere; }
.kpi-value .cur, .mini-stats .cur { font-size: .58em; font-weight: 600; color: var(--ink-3); margin-right: 3px; letter-spacing: .02em; }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.kpi-delta { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.kpi-delta .up, .kpi-delta .down { font-weight: 700; display: inline-flex; align-items: center; gap: 2px; }
.delta-good { color: var(--good-ink); }
.delta-bad { color: var(--crit-ink); }
.tone-blue  { background: var(--info-bg); color: var(--info-ink); }
.tone-green { background: var(--good-bg); color: var(--good-ink); }
.tone-amber { background: var(--warn-bg); color: var(--warn-ink); }
.tone-red   { background: var(--crit-bg); color: var(--crit-ink); }
.tone-navy  { background: var(--brand-100); color: var(--brand-800); }
:root[data-theme="dark"] .tone-navy { color: var(--sky); }
.tone-orange { background: var(--serious-bg); color: var(--serious-ink); }
.tone-md { background: var(--md-bg); color: var(--md); }

/* ---------- Status chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px 0 7px; border-radius: 12px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.chip .icon { width: 13px; height: 13px; }
.chip-good { background: var(--good-bg); color: var(--good-ink); }
.chip-warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip-serious { background: var(--serious-bg); color: var(--serious-ink); }
.chip-crit { background: var(--crit-bg); color: var(--crit-ink); }
.chip-info { background: var(--info-bg); color: var(--info-ink); }
.chip-neutral { background: var(--neutral-bg); color: var(--neutral-ink); }
.chip-navy { background: var(--brand-800); color: #fff; }
.chip-md { background: var(--md-bg); color: var(--md); box-shadow: inset 0 0 0 1px var(--md-border); }
.md-text { color: var(--md); font-weight: 600; }
.md-panel { border-left: 4px solid var(--md) !important; }
.prio { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.prio-high { background: var(--crit-bg); color: var(--crit-ink); }
.prio-medium { background: var(--warn-bg); color: var(--warn-ink); }
.prio-low { background: var(--good-bg); color: var(--good-ink); }
/* P1–P4 since 4 Nov 2026 (as on the MD Tasks page): urgent is the strongest, normal the quietest */
.prio-urgent { background: var(--crit); color: #fff; }
.prio-normal { background: var(--neutral-bg); color: var(--neutral-ink); }

/* ---------- Generic rows & lists ---------- */
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list > li { padding: 11px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.list > li:first-child { border-top: 0; padding-top: 2px; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.list .meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.list .right { text-align: right; font-size: 11.5px; color: var(--ink-3); flex: 0 1 auto; min-width: 0; max-width: 46%; overflow-wrap: anywhere; }
.list .title, .list .meta { overflow-wrap: anywhere; }
.list .right b { display: block; color: var(--ink-1); font-size: 12px; font-weight: 600; }
.list .right.stack { display: grid; gap: 4px; justify-items: end; }
.badge-icon {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
}
.badge-icon .icon { width: 17px; height: 17px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  color: #fff; background: linear-gradient(135deg, var(--brand-700), var(--s1));
}
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }

/* thin progress (meter) — fill = accent, track = lighter step of same ramp */
.meter { height: 6px; border-radius: 6px; background: var(--brand-100); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 6px; background: var(--s1); }
.meter.warn > i { background: var(--warn); }
.meter.crit > i { background: var(--crit); }
.meter.good > i { background: var(--good); }

/* ---------- Tabs / segmented ---------- */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: 10px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; height: 28px; padding: 0 10px; border-radius: 8px;
  font-size: 12px; font-weight: 600; color: var(--ink-3); cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink-1); box-shadow: 0 1px 3px rgba(15, 28, 48, .1); }

/* ---------- Tender pipeline ---------- */
.pipeline {
  display: grid; grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px; margin-bottom: 16px;
}
.stage {
  position: relative; text-align: left; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 12px; padding: 10px 10px 9px;
  display: grid; gap: 3px; min-width: 0;
  transition: border-color .15s, background .15s, transform .15s;
}
.stage:hover { border-color: var(--line-2); transform: translateY(-1px); }
.stage[aria-pressed="true"] { border-color: var(--s1); background: var(--info-bg); box-shadow: inset 0 0 0 1px var(--s1); }
.stage .st-n { font-size: 22px; font-weight: 700; line-height: 1; }
.stage .st-n.zero { color: var(--ink-3); font-weight: 500; }
.stage .st-l { font-size: 11.5px; font-weight: 600; color: var(--ink-2); line-height: 1.25; }
.stage .st-who { font-size: 10.5px; color: var(--ink-3); display: flex; align-items: center; gap: 4px; }
.stage .st-who .icon { width: 12px; height: 12px; }
.stage .st-bar { height: 4px; border-radius: 4px; margin-top: 5px; background: var(--brand-100); overflow: hidden; }
.stage .st-bar i { display: block; height: 100%; border-radius: 4px; }
.stage.gate::after {
  content: "MD"; position: absolute; top: 8px; right: 8px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .04em;
  color: var(--md); background: var(--md-bg); border: 1px solid var(--md-border); padding: 0 4px; border-radius: 5px;
}
.pipe-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11.5px; color: var(--ink-3); margin: -6px 0 14px; }
.pipe-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pipe-legend .md-tag { font-size: 9.5px; font-weight: 800; color: var(--md); background: var(--md-bg); border: 1px solid var(--md-border); padding: 0 4px; border-radius: 5px; }

/* ---------- Data tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: var(--surface-2);
}
table.data th:first-child { border-radius: 8px 0 0 8px; }
table.data th:last-child { border-radius: 0 8px 8px 0; }
table.data td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.r, table.data th.r { text-align: right; }
table.data .num { font-variant-numeric: tabular-nums; }
.t-title { font-weight: 600; font-size: 13px; line-height: 1.3; }
.t-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cat-tile {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100);
}
:root[data-theme="dark"] .cat-tile { color: var(--sky); }
.cat-tile .icon { width: 20px; height: 20px; }
.cell-flex { display: flex; align-items: center; gap: 12px; min-width: 0; }
.priced-cell { min-width: 120px; }
.priced-cell .pc-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.priced-cell .pc-top b { font-weight: 600; }
.due { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.due small { display: block; font-weight: 500; font-size: 11.5px; color: var(--ink-3); }
.due.hot { color: var(--flag); }
.due.soon { color: var(--warn-ink); }
.empty { padding: 26px; text-align: center; color: var(--ink-3); font-size: 13px; }
.att { display: inline-flex; gap: 3px; }
.att i {
  width: 20px; height: 20px; border-radius: 5px; font-style: normal;
  font-size: 10px; font-weight: 800; display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--ink-3); background: var(--surface-2);
}
.att i.on { background: var(--good-bg); color: var(--good-ink); border-color: transparent; }
.row-btn { border: 0; background: none; color: var(--brand-700); font-weight: 600; font-size: 12px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.row-btn:hover { background: var(--brand-50); }
:root[data-theme="dark"] .row-btn { color: var(--sky); }

/* ---------- Quick actions ---------- */
.quick { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.qa {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); cursor: pointer; text-align: left;
  font-size: 12.5px; font-weight: 600; color: var(--ink-1); line-height: 1.25;
  transition: border-color .15s, background .15s, transform .15s;
}
.qa:hover { border-color: var(--brand-200); background: var(--brand-50); transform: translateY(-2px); }
.qa .badge-icon { width: 34px; height: 34px; }
.qa small { display: block; font-weight: 500; color: var(--ink-3); font-size: 11px; margin-top: 2px; }

/* ---------- Alerts ---------- */
.alert-row { display: flex; gap: 11px; align-items: flex-start; }
.alert-row .badge-icon { width: 30px; height: 30px; border-radius: 9px; }
.rule {
  font-size: 10px; font-weight: 800; letter-spacing: .03em; padding: 1px 5px; border-radius: 4px;
  background: var(--surface-3); color: var(--ink-2); margin-left: 4px; vertical-align: 1px;
}
.smart-alert {
  display: flex; gap: 11px; padding: 11px 12px; border-radius: 11px; border: 1px solid transparent;
}
.smart-alert + .smart-alert { margin-top: 8px; }
.smart-alert b { font-size: 13px; display: block; }
.smart-alert span { font-size: 12px; color: var(--ink-2); }
.smart-alert.crit { background: var(--crit-bg); }
.smart-alert.crit b, .smart-alert.crit .icon { color: var(--crit-ink); }
.smart-alert.warn { background: var(--warn-bg); }
.smart-alert.warn b, .smart-alert.warn .icon { color: var(--warn-ink); }
.smart-alert.md { background: var(--md-bg); box-shadow: inset 0 0 0 1px var(--md-border); }
.smart-alert.md b, .smart-alert.md .icon { color: var(--md); }
.smart-alert.info { background: var(--info-bg); }
.smart-alert.info b, .smart-alert.info .icon { color: var(--info-ink); }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h3 { font-size: 15px; font-weight: 600; }
.cal-nav { display: flex; align-items: center; gap: 2px; font-weight: 600; font-size: 13px; }
.cal-nav button { width: 28px; height: 28px; border-radius: 8px; border: 0; background: none; cursor: pointer; color: var(--ink-2); display: grid; place-items: center; }
.cal-nav button:hover { background: var(--surface-3); }
.cal-nav .icon { width: 16px; height: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-grid .dow { font-size: 10.5px; font-weight: 700; color: var(--ink-3); letter-spacing: .05em; padding: 4px 0 6px; }
.cal-day {
  position: relative; height: 36px; border: 0; background: none; border-radius: 10px; cursor: pointer;
  font-size: 12.5px; color: var(--ink-1); font-variant-numeric: tabular-nums;
}
.cal-day:hover { background: var(--surface-3); }
.cal-day.out { color: var(--ink-3); opacity: .55; }
.cal-day.today { background: var(--brand-800); color: #fff; font-weight: 700; box-shadow: 0 4px 12px rgba(29, 64, 118, .35); }
.cal-day.sel:not(.today) { box-shadow: inset 0 0 0 1.5px var(--s1); }
.cal-dots { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; justify-content: center; gap: 2px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; }
.cal-day.today .cal-dots i { box-shadow: 0 0 0 1px #fff; }
.ev-sub { background: var(--crit); }
.ev-clar { background: var(--warn); }
.ev-open { background: var(--s1); }
.ev-task { background: var(--s3); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--ink-3); margin-top: 10px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 7px; height: 7px; border-radius: 50%; }
.cal-agenda { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.cal-agenda .ag { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; }
.cal-agenda .ag i { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; }
.cal-agenda .ag b { font-weight: 600; }
.cal-agenda .ag span { display: block; color: var(--ink-3); font-size: 11.5px; }

/* ---------- Tasks ---------- */
.task { display: flex; gap: 11px; align-items: flex-start; }
.task input { appearance: none; width: 18px; height: 18px; border: 1.5px solid var(--line-2); border-radius: 5px; margin: 1px 0 0; cursor: pointer; flex: none; display: grid; place-items: center; background: var(--surface); }
.task input:checked { background: var(--good); border-color: var(--good); }
.task input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.task.done .title { text-decoration: line-through; color: var(--ink-3); }

/* ---------- Notifications ---------- */
.note-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.note-icon .icon { width: 14px; height: 14px; }

/* ---------- Assistant ---------- */
.assistant { border: 1.5px solid var(--brand-200); padding: 0; overflow: hidden; }
:root[data-theme="dark"] .assistant { border-color: var(--line-2); }
.as-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.as-logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--brand-800), var(--s1)); display: grid; place-items: center; color: #fff; }
.as-logo .icon { width: 17px; height: 17px; }
.as-head b { font-size: 14px; }
.beta { font-size: 10.5px; font-weight: 700; color: var(--brand-700); background: var(--brand-100); padding: 2px 7px; border-radius: 8px; }
:root[data-theme="dark"] .beta { color: var(--sky); }
.as-body { padding: 14px 16px; display: grid; gap: 10px; max-height: 340px; overflow-y: auto; }
.bubble { font-size: 13px; line-height: 1.45; padding: 10px 12px; border-radius: 12px; max-width: 92%; }
.bubble.bot { background: var(--surface-3); border-top-left-radius: 4px; }
.bubble.me { background: var(--brand-800); color: #fff; margin-left: auto; border-top-right-radius: 4px; }
.bubble ul { margin: 6px 0 0; padding-left: 18px; }
.bubble .ref { margin: 0 1px; }
.as-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.as-chips button {
  border: 1px solid var(--brand-200); background: var(--brand-50); color: var(--brand-800);
  font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 9px; cursor: pointer;
}
:root[data-theme="dark"] .as-chips button { color: var(--sky); border-color: var(--line-2); }
.as-chips button:hover { background: var(--brand-100); }
.as-input { display: flex; gap: 8px; padding: 12px 16px 14px; border-top: 1px solid var(--line); }
.as-input input {
  flex: 1; height: 40px; border: 1px solid var(--line); border-radius: 11px; padding: 0 12px;
  background: var(--surface-2); color: var(--ink-1); font: inherit; min-width: 0;
}
.as-input button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--brand-800); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
:root[data-theme="dark"] .as-input button { background: var(--s1); }
.as-note { font-size: 11px; color: var(--ink-3); padding: 0 16px 12px; margin-top: -6px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- Floating action button ---------- */
.fab {
  position: fixed; right: 24px; bottom: 22px; z-index: 50;
  display: inline-flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 20px 0 16px; border-radius: 16px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--brand-900), var(--brand-600)); color: #fff;
  font-weight: 600; font-size: 14px;
  box-shadow: 0 12px 30px rgba(2, 41, 102, .35);
  transition: transform .15s;
}
.fab:hover { transform: translateY(-2px); }
.fab .icon { width: 20px; height: 20px; }
.fab kbd { font: inherit; font-size: 11px; background: rgba(255, 255, 255, .16); padding: 2px 6px; border-radius: 6px; }

/* ---------- Overlays: drawer, modal, popover, toast ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 80; background: rgba(1, 16, 40, .45);
  backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: min(560px, 100vw); background: var(--surface);
  box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.drawer-head p { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 26px; display: grid; gap: 18px; align-content: start; }

.modal {
  position: fixed; left: 50%; top: 12vh; z-index: 90;
  width: min(640px, calc(100vw - 32px));
  transform: translate(-50%, -8px) scale(.98); opacity: 0; pointer-events: none;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  transition: opacity .18s, transform .18s; overflow: hidden;
  border: 1px solid var(--line);
}
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, 0) scale(1); }
.cmd-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cmd-input input { flex: 1; border: 0; outline: 0; background: none; font: inherit; font-size: 16px; color: var(--ink-1); }
.cmd-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.cmd-group { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 10px 10px 6px; }
.cmd-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 10px; border-radius: 10px; border: 0; background: none; cursor: pointer; text-align: left;
}
.cmd-item[aria-selected="true"], .cmd-item:hover { background: var(--brand-50); }
.cmd-item .t-title { font-size: 13px; }
.cmd-item mark { background: rgba(250, 178, 25, .35); color: inherit; border-radius: 3px; padding: 0 1px; }
.cmd-foot { display: flex; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); background: var(--surface-2); }

.popover {
  position: fixed; z-index: 85; width: 380px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 14px 16px;
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .15s, transform .15s;
}
.popover.open { opacity: 1; transform: none; pointer-events: auto; }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120; display: grid; gap: 8px; justify-items: center; }
.toast {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--ink-1); color: var(--surface); padding: 10px 16px; border-radius: 12px;
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toast-in .2s ease;
}
.toast .icon { width: 16px; height: 16px; color: #4fd14f; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Upload flow ---------- */
.dropzone {
  display: grid; place-items: center; gap: 8px; text-align: center;
  border: 2px dashed var(--line-2); border-radius: 14px; padding: 28px 18px;
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--s1); background: var(--info-bg); }
.dropzone .badge-icon { width: 46px; height: 46px; border-radius: 14px; }
.dropzone .badge-icon .icon { width: 24px; height: 24px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; color: var(--ink-3); }
.steps li .st-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; }
.steps li .st-dot .icon { width: 13px; height: 13px; }
.steps li.run { color: var(--ink-1); }
.steps li.run .st-dot { border-color: var(--s1); border-top-color: transparent; animation: spin .8s linear infinite; }
.steps li.ok { color: var(--ink-1); }
.steps li.ok .st-dot { border-color: var(--good); background: var(--good); color: #fff; }
.steps li small { display: block; color: var(--ink-3); font-size: 11.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Costing calculator ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field input, .field select {
  height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 11px;
  background: var(--surface-2); color: var(--ink-1); font: inherit; font-variant-numeric: tabular-nums; min-width: 0; width: 100%;
}
.field input:focus, .field select:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.field .hint { font-size: 11px; color: var(--ink-3); }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; height: 40px; }
.toggle input { appearance: none; width: 38px; height: 22px; border-radius: 11px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked { background: var(--s1); }
.toggle input:checked::after { transform: translateX(16px); }
.rates { display: flex; flex-wrap: wrap; gap: 6px; }
.rates span { font-size: 11.5px; padding: 4px 8px; border-radius: 8px; background: var(--surface-3); color: var(--ink-2); }
.rates b { color: var(--ink-1); font-weight: 600; }
.result-hero {
  border-radius: 14px; padding: 16px 18px;
  background: linear-gradient(120deg, var(--brand-900), var(--brand-700)); color: #fff;
  display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: end;
}
.result-hero .lbl { font-size: 12px; color: rgba(255,255,255,.75); }
.result-hero .val { font-size: 34px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.result-hero .side { text-align: right; font-size: 12px; color: rgba(255,255,255,.75); }
.result-hero .side b { display: block; font-size: 16px; color: #fff; }
.breakdown { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.breakdown td { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.breakdown td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.breakdown tr.sum td { border-bottom: 0; border-top: 1px solid var(--line-2); font-weight: 700; font-size: 13.5px; padding-top: 9px; }
.breakdown tr.excluded td { color: var(--ink-3); font-style: italic; }
.breakdown tr.excluded td:last-child { font-weight: 500; text-decoration: line-through; }
.whatif { border: 1px dashed var(--line-2); border-radius: 12px; padding: 12px 14px; }
.whatif summary { cursor: pointer; font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.whatif summary::-webkit-details-marker { display: none; }
.whatif[open] summary { margin-bottom: 12px; }
.slider-row { display: grid; grid-template-columns: 120px 1fr 52px; gap: 10px; align-items: center; font-size: 12.5px; }
.slider-row + .slider-row { margin-top: 8px; }
.slider-row input { width: 100%; accent-color: var(--s1); }
.slider-row output { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.note { font-size: 11.5px; color: var(--ink-3); line-height: 1.45; }
.note b { color: var(--ink-2); }

/* ---------- Progress page specifics ---------- */
.tender-strip {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center;
}
.ts-title { font-size: 18px; font-weight: 700; line-height: 1.25; }
.ts-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); align-items: center; }
.ts-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.ts-meta .icon { width: 15px; height: 15px; }
.phase {
  display: flex; align-items: flex-start; gap: 0; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line);
  overflow-x: auto;
}
.ph { flex: 1; min-width: 78px; display: grid; justify-items: center; gap: 6px; text-align: center; position: relative; }
.ph::before { content: ""; position: absolute; top: 18px; left: calc(-50% + 22px); right: calc(50% + 22px); height: 2px; background: var(--line-2); }
.ph:first-child::before { display: none; }
.ph.done::before, .ph.now::before { background: var(--s1); }
.ph .ph-dot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); background: var(--surface); color: var(--ink-3); position: relative; z-index: 1; }
.ph .ph-dot .icon { width: 17px; height: 17px; }
.ph.done .ph-dot { background: var(--good-bg); border-color: var(--good); color: var(--good-ink); }
.ph.now .ph-dot { background: var(--s1); border-color: var(--s1); color: #fff; box-shadow: 0 0 0 5px var(--info-bg); }
.ph.block .ph-dot { border-color: var(--crit); color: var(--crit-ink); background: var(--crit-bg); }
.ph b { font-size: 12px; font-weight: 600; }
.ph span { font-size: 11px; color: var(--ink-3); }
.ph.md b::after { content: " · MD"; color: var(--md); font-weight: 800; font-size: 10px; }

.mini-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.mini-stats div { background: var(--surface-2); border-radius: 11px; padding: 10px 12px; }
.mini-stats span { font-size: 11px; color: var(--ink-3); display: block; line-height: 1.25; }
.mini-stats span.cur { display: inline; font-size: .6em; }
.mini-stats b { font-size: 20px; font-weight: 700; display: block; margin-top: 4px; }
.mini-stats small { font-size: 11px; color: var(--ink-3); }

.doc-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.doc-tile {
  aspect-ratio: 3 / 4; max-height: 168px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
  display: grid; align-content: space-between; padding: 8px; position: relative; overflow: hidden; min-width: 0;
}
.doc-tile .lines { display: grid; gap: 4px; margin-top: 4px; }
.doc-tile .lines i { height: 3px; border-radius: 2px; background: var(--line-2); }
.doc-tile > div { min-width: 0; }
.doc-tile .kind { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; padding: 2px 5px; border-radius: 4px; justify-self: start; }
.doc-tile .fname { font-size: 10px; color: var(--ink-2); line-height: 1.2; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc-tile.more { place-content: center; text-align: center; background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-800); }
:root[data-theme="dark"] .doc-tile.more { color: var(--sky); }
.doc-tile.more b { font-size: 20px; }
.doc-tile.more span { font-size: 11px; }
.k-quote { background: var(--info-bg); color: var(--info-ink); }
.k-data { background: var(--good-bg); color: var(--good-ink); }
.k-broch { background: var(--serious-bg); color: var(--serious-ink); }
.k-maf { background: var(--brand-100); color: var(--brand-800); }

.issue-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.issue-stats div { text-align: left; }
.issue-stats span { font-size: 11px; color: var(--ink-3); display: block; }
.issue-stats b { font-size: 20px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.issue-stats b .icon { width: 17px; height: 17px; }

.empty-state { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 40px 20px; }
.empty-state .badge-icon { width: 56px; height: 56px; border-radius: 16px; }
.empty-state .badge-icon .icon { width: 28px; height: 28px; }
.empty-state h3 { font-size: 17px; }
.empty-state p { color: var(--ink-3); max-width: 460px; }

/* ---------- Responsive ----------
   Shell (sidebar, rail, top bar) follows the window width.
   Everything inside the main column follows the column’s own width
   (container queries), so a 1366 px laptop with the sidebar open gets the
   same safe layout as a narrow window. */

/* shell */
@media (max-width: 1760px) { :root { --rail-w: 300px; } }
@media (max-width: 1599px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .rail { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 1500px) { .fx-chip { display: none; } }
@media (max-height: 820px) and (min-width: 981px) { .org-card, .side-copy { display: none; } .side-foot { gap: 6px; padding-top: 8px; } .nav a, .nav-parent { height: 37px; } .nav .nav-sub a { height: 34px; } }
@media (max-width: 1280px) { .sample-pill .long { display: none; } }
@media (max-width: 1180px) { .top-actions .btn-label { display: none; } .top-actions .btn-primary { padding: 0 12px; } }
@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; z-index: 90; } /* above the scrim (80), so its links can be tapped */
  .menu-btn { display: inline-grid; }
}
@media (max-width: 760px) {
  .rail { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 16px 14px 90px; gap: 16px; }
  .content, .rail { gap: 16px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .hide-sm { display: none !important; }
  .search { flex: 0 0 42px; width: 42px; padding: 0; justify-content: center; }
  .search > span:not(.icon) { display: none; }
  .top-actions { gap: 4px; }
  .form-grid { grid-template-columns: 1fr; }
  .fab > span:not(.icon) { display: none; }
  .fab { padding: 0 15px; }
}

/* main column */
.content { container: main / inline-size; }
@container main (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-3-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3-wide > .span-wide { grid-column: 1 / -1; order: -1; }
}
@container main (max-width: 1040px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 > :nth-child(3):last-child { grid-column: 1 / -1; }
  .pipeline { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@container main (max-width: 760px) {
  .tender-strip { grid-template-columns: minmax(0, 1fr); }
  .tender-strip > div:last-child { justify-content: flex-start !important; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@container main (max-width: 620px) {
  .grid-3, .grid-3-wide { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline { grid-template-columns: repeat(10, 104px); overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
  .stage { scroll-snap-align: start; }
  .page-head .head-controls { width: 100%; }
  .page-head .select { flex: 1; min-width: 0; }
}

/* inside cards: every card sizes its own contents */
.card { container-type: inline-size; }
@container (max-width: 340px) {
  .ring-row { flex-direction: column; align-items: stretch !important; }
  .ring-row > :first-child { align-self: center; }
  .mini-stats b { font-size: 16px; }
}
/* in narrow cards the right-hand column of a list row drops under the text */
@container (max-width: 420px) {
  .list > li { flex-wrap: wrap; row-gap: 6px; }
  .list > li > .grow { flex: 1 1 0; }
  .list > li > .right { flex: 1 0 100%; max-width: none; text-align: left; padding-left: 44px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .list > li > .right:only-child, .list > li:not(:has(> .badge-icon, > .avatar, > .note-icon)) > .right { padding-left: 0; }
  .list > li > .right b { display: inline; }
  .list > li > .right.stack { display: flex; justify-items: normal; }
}
@container (max-width: 260px) {
  .hb-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label label" "track val"; row-gap: 3px; }
  .hb-label { grid-area: label; }
  .hb-track { grid-area: track; } .hb-val { grid-area: val; }
}
@container (max-width: 420px) {
  .issue-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .mini-stats > div { padding: 9px 10px; }
  .mini-stats b { font-size: 17px; }
}
@container (max-width: 560px) {
  .doc-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .doc-tiles > :nth-child(n+3):not(.more) { display: none; }
  div.phase .ph { min-width: 66px; }  /* phones: scroll the stepper rather than crush it */
  div.phase { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-bottom: 4px; }
}
@container (max-width: 900px) {
  .phase .ph { min-width: 0; }
  .phase .ph .ph-dot { width: 32px; height: 32px; }
  .phase .ph::before { top: 15px; left: calc(-50% + 19px); right: calc(50% + 19px); }
  .phase .ph b { font-size: 11px; line-height: 1.25; }
  .phase .ph span { font-size: 10px; line-height: 1.25; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .sidebar, .topbar, .fab, .rail .assistant { display: none !important; }
  .app { grid-template-columns: 1fr; }
  .page { grid-template-columns: 1fr; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
}

/* ==========================================================================
   Charts (pm-charts.js)
   ========================================================================== */
.c-s1 { --c: var(--s1); } .c-s2 { --c: var(--s2); } .c-s3 { --c: var(--s3); }
.c-s4 { --c: var(--s4); } .c-s5 { --c: var(--s5); } .c-plan { --c: var(--plan); }
.c-ph1 { --c: var(--ph-1); } .c-ph2 { --c: var(--ph-2); } .c-ph3 { --c: var(--ph-3); } .c-ph4 { --c: var(--ph-4); }
.c-good { --c: var(--good); } .c-warn { --c: var(--warn); } .c-serious { --c: var(--serious); } .c-crit { --c: var(--crit); }
.c-muted { --c: var(--line-2); }

.chart { width: 100%; min-height: 40px; }
.viz { display: block; overflow: visible; }
.viz:focus { outline: none; }
.viz:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 6px; }
.viz text { font-family: var(--font); font-size: 11px; fill: var(--ink-3); }
.viz .tick { font-variant-numeric: tabular-nums; }
.viz .grid { stroke: var(--grid); stroke-width: 1; }
.viz .axis { stroke: var(--axis); stroke-width: 1; }
.viz .ln { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz .ln.dashed { stroke-dasharray: 6 5; }
.viz .ln.dotted { stroke-dasharray: 1 5; stroke-width: 2.5; }
.viz .ar { fill: var(--c); fill-opacity: .1; stroke: none; }
.viz .dot { fill: var(--c); stroke: var(--surface); stroke-width: 2; }
.viz .end-label { font-size: 11.5px; font-weight: 600; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.viz .crosshair { stroke: var(--ink-3); stroke-width: 1; opacity: .55; }
.viz .marker-line { stroke: var(--line-2); stroke-width: 1; }
.viz .marker-text { font-size: 10.5px; font-weight: 600; }

.viz-tip {
  position: fixed; z-index: 200; pointer-events: none;
  min-width: 140px; max-width: 280px;
  background: var(--surface); color: var(--ink-1);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 28, 48, .16);
  padding: 9px 11px; font-size: 12px;
  opacity: 0; transform: translateY(3px); transition: opacity .1s, transform .1s;
}
.viz-tip.show { opacity: 1; transform: none; }
.vt-title { font-size: 11.5px; color: var(--ink-3); margin-bottom: 5px; font-weight: 600; }
.vt-row { display: flex; align-items: center; gap: 7px; line-height: 1.6; }
.vt-row b { font-weight: 700; font-variant-numeric: tabular-nums; }
.vt-row span { color: var(--ink-3); }
.vt-key { width: 12px; height: 0; border-top: 2.5px solid var(--c); border-radius: 2px; flex: none; }
.vt-key.dash { border-top-style: dashed; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.legend .lk { width: 16px; height: 0; border-top: 2px solid var(--c); flex: none; border-radius: 2px; }
.legend .lk.dashed { border-top-style: dashed; }
.legend .lk.dotted { border-top-style: dotted; border-top-width: 2.5px; }

.viz-table { margin-top: 2px; }
.viz-table table.data td, .viz-table table.data th { padding: 7px 8px; }

/* ring meter */
.ring { position: relative; flex: none; }
.ring svg { display: block; }
.ring-track { stroke: var(--brand-100); }
.ring-fill { stroke: var(--c); transition: stroke-dasharray .6s ease; }
.ring-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-c b { font-weight: 700; line-height: 1; letter-spacing: -.01em; }
.ring-c span { font-size: 11px; color: var(--ink-3); margin-top: 3px; }

/* ranked bars */
.hb { display: grid; gap: 4px; }
.hb-row { display: grid; grid-template-columns: minmax(96px, 42%) 1fr auto; align-items: center; gap: 10px; padding: 5px 4px; border-radius: 8px; cursor: default; }
.hb-row:hover, .hb-row:focus-visible { background: var(--surface-2); }
.hb-label { font-size: 12.5px; color: var(--ink-2); line-height: 1.25; overflow-wrap: anywhere; }
.hb-track { height: 12px; display: flex; align-items: center; }
.hb-track i { display: block; height: 12px; background: var(--c); border-radius: 0 4px 4px 0; min-width: 0; transition: width .5s ease; }
.hb-val { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }

/* tall segmented bar */
.seg-bar { display: flex; gap: 2px; height: 28px; margin-bottom: 10px; }
.seg-part {
  background: var(--c); border-radius: 4px; min-width: 3px;
  display: flex; align-items: center; padding-left: 7px; overflow: hidden; cursor: default;
  color: #fff; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  transition: filter .12s;
}
.seg-part:hover, .seg-part:focus-visible { filter: brightness(1.08); outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--c); }
.seg-part.c-s3, .seg-part.c-s4, .seg-part.c-s5, .seg-part.c-warn, .seg-part.c-serious { color: #0b0b0b; }
.seg-part.c-muted { color: var(--ink-1); }
.seg-part.no-label span { visibility: hidden; }

/* horizontal waterfall */
.wf { display: grid; gap: 2px; }
.wf-row { display: grid; grid-template-columns: minmax(108px, 32%) 1fr 78px; align-items: center; gap: 10px; padding: 4px 4px; border-radius: 7px; }
.wf-row:hover, .wf-row:focus-visible { background: var(--surface-2); outline: none; }
.wf-label { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-track { position: relative; height: 12px; background: linear-gradient(var(--grid), var(--grid)) left center / 100% 1px no-repeat; }
.wf-track i { position: absolute; top: 0; height: 12px; background: var(--c); border-radius: 0 4px 4px 0; }
.wf-val { font-size: 12px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.wf-row.zero .wf-label, .wf-row.zero .wf-val { color: var(--ink-3); font-weight: 400; }
.wf-row.total { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); border-radius: 0; }
.wf-row.total .wf-label, .wf-row.total .wf-val { color: var(--ink-1); font-weight: 700; }
.wf-row.total .wf-track i { border-radius: 0 4px 4px 0; }

/* ==========================================================================
   Tables that reflow into stacked rows when their card is narrow
   ========================================================================== */
table.data.sheet-table th, table.data.sheet-table td { padding-left: 8px; padding-right: 8px; }
@container (max-width: 1180px) { table.data.sheet-table .c-rate { display: none; } }
@container (max-width: 1000px) {
  table.data.sheet-table { min-width: 0 !important; }
  table.data.sheet-table thead { display: none; }
  table.data.sheet-table, table.data.sheet-table tbody { display: block; }
  table.data.sheet-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); grid-template-areas: "item item" "st act" "sup quote" "ev total"; gap: 10px 16px; padding: 14px 2px; border-bottom: 1px solid var(--line); }
  table.data.sheet-table td { display: block; padding: 0; border: 0; min-width: 0; }
  table.data.sheet-table .c-item { grid-area: item; } table.data.sheet-table .c-st { grid-area: st; } table.data.sheet-table .c-act { grid-area: act; text-align: right; }
  table.data.sheet-table .c-sup { grid-area: sup; } table.data.sheet-table .c-quote { grid-area: quote; text-align: right; }
  table.data.sheet-table .c-ev { grid-area: ev; } table.data.sheet-table .c-total { grid-area: total; text-align: right; }
  table.data.sheet-table .c-quote .t-sub { justify-content: flex-end; }
}
@container (max-width: 860px) {
  table.data#tender-table { min-width: 0 !important; }
  table.data#tender-table thead { display: none; }
  table.data#tender-table, table.data#tender-table tbody { display: block; }
  table.data#tender-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); grid-template-areas: "title act" "status due" "priced value"; gap: 10px 16px; padding: 14px 2px; border-bottom: 1px solid var(--line); }
  table.data#tender-table td { display: block; padding: 0; border: 0; min-width: 0; }
  table.data#tender-table .c-title { grid-area: title; } table.data#tender-table .c-act { grid-area: act; align-self: start; }
  table.data#tender-table .c-status { grid-area: status; } table.data#tender-table .c-due { grid-area: due; text-align: right; }
  table.data#tender-table .c-priced { grid-area: priced; min-width: 0; max-width: 240px; } table.data#tender-table .c-value { grid-area: value; text-align: right; }
  table.data#tender-table .c-status::before { display: none; }
}
@container (max-width: 1000px) { table.data.sheet-table td[data-label]::before { content: attr(data-label); display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; } }
@container (max-width: 860px) { table.data#tender-table td[data-label]::before { content: attr(data-label); display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; } }
table.data.sheet-table tbody tr:hover td, table.data#tender-table tbody tr:hover td { background: transparent; }
table.data td.empty { display: block; text-align: center; }

/* ==========================================================================
   Theme switch (sidebar)
   ========================================================================== */
.theme-switch {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--ink-2);
}
.theme-switch:hover { background: var(--brand-50); }
.theme-switch .icon { width: 18px; height: 18px; color: var(--ink-3); }
.theme-switch input { margin-left: auto; appearance: none; width: 36px; height: 20px; border-radius: 10px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; flex: none; }
.theme-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.theme-switch input:checked { background: var(--s1); }
.theme-switch input:checked::after { transform: translateX(16px); }

/* ==========================================================================
   Tenders page (pm-tenders.html)
   ========================================================================== */
.page.page-full { grid-template-columns: minmax(0, 1fr); }
.view-toggle button { display: inline-flex; align-items: center; gap: 6px; height: 32px; }
.view-toggle .icon { width: 15px; height: 15px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 14.5px; border-radius: 13px; }

.filterbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; }
.fb-search, .fb-sel {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--ink-3);
}
.fb-search { flex: 1 1 260px; min-width: 0; }
.fb-search input, .fb-sel select { border: 0; outline: 0; background: none; font: inherit; color: var(--ink-1); min-width: 0; }
.fb-search input { flex: 1; }
.fb-sel select { cursor: pointer; padding-right: 2px; font-weight: 500; }
.fb-sel select option { color: #0f1c30; }
.fb-search:focus-within, .fb-sel:focus-within { border-color: var(--s1); box-shadow: 0 0 0 3px var(--info-bg); }
.fb-sel.slim { height: 36px; background: var(--surface); }
.results-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: -6px; }
.results { font-size: 14px; color: var(--ink-2); }
.results b { color: var(--ink-1); }
.results-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.demo-switch { border: 1px dashed var(--line-2); padding: 6px 10px; font-size: 12.5px; }
.demo-switch::after { content: "demo"; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--warn-ink); background: var(--warn-bg); padding: 1px 5px; border-radius: 5px; order: 3; }
.demo-switch input { order: 2; margin-left: 4px; }

/* cards, inspired by the job-card layout in page 3 */
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 318px), 1fr)); gap: 18px; }
.tcard {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px;
  box-shadow: var(--shadow); min-width: 0;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.tcard:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(15, 28, 48, .09); border-color: var(--line-2); }
.tc-head { display: flex; gap: 12px; align-items: flex-start; }
.tc-logo {
  position: relative; width: 48px; height: 48px; border-radius: 14px; flex: none;
  display: grid; place-items: center; color: #fff; overflow: hidden;
  background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
}
.tc-logo b { font-size: 12.5px; font-weight: 800; letter-spacing: .02em; line-height: 1; }
.tc-logo b.sm { font-size: 10px; letter-spacing: 0; }
.tc-logo i { position: absolute; right: 3px; bottom: 3px; width: 16px; height: 16px; border-radius: 5px; display: grid; place-items: center; background: rgba(255,255,255,.22); font-style: normal; }
.tc-logo i .icon { width: 11px; height: 11px; }
.tc-logo.ph-1 { background: linear-gradient(135deg, #3d7fd4, #79aee9); }
.tc-logo.ph-2 { background: linear-gradient(135deg, #1d5fae, #3987e5); }
.tc-logo.ph-3 { background: linear-gradient(135deg, #123f7c, #1c5cab); }
.tc-logo.ph-4 { background: linear-gradient(135deg, #022966, #1d4076); }
.tc-logo.ph-5 { background: linear-gradient(135deg, #47546a, #77839a); }
.tc-logo.cover { background: #fff; border: 1px solid var(--line); width: 44px; height: 56px; border-radius: 8px; }
.tc-logo.cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.tc-id { flex: 1; min-width: 0; }
.tc-id h3 { font-size: 15px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc-id span { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-pin { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.tc-pin .icon { width: 16px; height: 16px; }
.tc-pin:hover { color: var(--brand-700); border-color: var(--line-2); }
.tc-pin[aria-pressed="true"] { color: #fff; background: var(--brand-800); border-color: var(--brand-800); }
.tc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 8px; font-size: 11.5px; font-weight: 500; color: var(--ink-2); background: var(--surface-3); white-space: nowrap; }
.tag .icon { width: 12px; height: 12px; }
.tag.hot { color: var(--flag); background: var(--crit-bg); font-weight: 700; }
.tc-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.tc-facts li { display: flex; gap: 9px; align-items: flex-start; }
.tc-facts .icon { width: 16px; height: 16px; color: var(--ink-3); margin-top: 1px; }
.tc-facts b { color: var(--ink-1); font-weight: 600; }
.tc-facts .left { font-weight: 700; color: var(--ink-1); }
.tc-facts .left.hot { color: var(--flag); }
.tc-facts .left.soon { color: var(--warn-ink); }
.tc-track { display: grid; gap: 7px; padding: 9px 11px 10px; background: var(--surface-2); border-radius: 10px; }
.tt-top { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 10px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.tt-top b { color: var(--ink-1); font-weight: 600; }
.tt-score { cursor: help; white-space: nowrap; }
.tt-score b { font-size: 13px; }
.tt-bar { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.tt-bar li { height: 5px; border-radius: 3px; background: var(--line); }
.tt-bar li.done { background: var(--good); }
.tt-bar li.on { background: var(--s1); }
.tt-bar li.on.md { background: var(--md); }
.tc-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.tc-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; margin-top: auto; }
.tc-actions .btn { height: 40px; }
.tc-ghost { background: var(--surface-3); border-color: transparent; }

/* the urgent ones (closing within 3 days) get the filled treatment, like the highlighted cards in page 3 */
.tcard.featured {
  background: radial-gradient(420px 180px at 100% 0%, rgba(163,206,241,.28), transparent 60%), linear-gradient(140deg, #022966, #1d4076 60%, #2c62ad);
  border-color: transparent; color: #fff; box-shadow: 0 16px 36px rgba(2, 41, 102, .3);
}
.tcard.featured .tc-id span, .tcard.featured .tc-facts, .tcard.featured .tc-foot, .tcard.featured .tc-facts .icon { color: rgba(255,255,255,.78); }
.tcard.featured .tc-facts b, .tcard.featured .tc-facts .left { color: #fff; }
.tcard.featured .tc-facts .left.hot { color: #ffd2cc; }
.tcard.featured .tag, .tcard.featured .chip { background: rgba(255,255,255,.14); color: #fff; box-shadow: none; }
.tcard.featured .tc-track { background: rgba(255,255,255,.1); }
.tcard.featured .tt-top, .tcard.featured .tt-top .md-text { color: rgba(255,255,255,.78); }
.tcard.featured .tt-top b { color: #fff; }
.tcard.featured .tt-bar li { background: rgba(255,255,255,.22); }
.tcard.featured .tt-bar li.done { background: #8fe0a0; }
.tcard.featured .tt-bar li.on { background: #fff; }
.tcard.featured .tt-bar li.on.md { background: #f1d68a; }
.tcard.featured .tc-pin { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.tcard.featured .tc-ghost { background: rgba(255,255,255,.14); color: #fff; }
.tcard.featured .tc-main { background: #fff; color: var(--brand-900); box-shadow: none; }
.tcard.featured .ref { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }
.tcard.fresh, .bcard.fresh { animation: fresh 1.6s ease 2; box-shadow: 0 0 0 3px var(--s1), var(--shadow); }
@keyframes fresh { 50% { box-shadow: 0 0 0 7px var(--info-bg), var(--shadow); } }

/* board: one column per phase */
.board { display: grid; grid-template-columns: repeat(5, minmax(212px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.b-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 10px; min-width: 0; }
.b-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 10px; }
.b-head b { font-size: 13.5px; }
.b-add { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); }
.b-add .icon { width: 14px; height: 14px; }
a.b-add:hover { color: var(--brand-700); border-color: var(--brand-200); }
.b-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 7px; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; color: #fff; }
.b-count.ph-1 { background: var(--ph-1); color: #0b2447; } .b-count.ph-2 { background: var(--ph-2); }
.b-count.ph-3 { background: var(--ph-3); } .b-count.ph-4 { background: var(--ph-4); } .b-count.ph-5 { background: var(--ink-3); }
:root[data-theme="dark"] .b-count.ph-1 { color: #fff; } :root[data-theme="dark"] .b-count.ph-3, :root[data-theme="dark"] .b-count.ph-4 { color: #0b2447; }
.b-list { display: grid; gap: 10px; }
.b-empty { font-size: 12px; color: var(--ink-3); text-align: center; padding: 18px 0; border: 1.5px dashed var(--line-2); border-radius: 12px; }
.bcard { display: grid; gap: 10px; padding: 12px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s; min-width: 0; }
.bcard:hover { border-color: var(--brand-200); transform: translateY(-2px); }
.bc-top { display: flex; gap: 6px; flex-wrap: wrap; }
.bc-main { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.bc-main .tc-logo { width: 36px; height: 36px; border-radius: 10px; }
.bc-main .tc-logo.cover { width: 34px; height: 44px; }
.bc-main .tc-logo b { font-size: 10px; }
.bc-main .tc-logo i { display: none; }
.bc-main > span:last-child { min-width: 0; }
.bc-main b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; font-weight: 600; line-height: 1.3; }
.bc-main small { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.bc-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--ink-3); padding-top: 9px; border-top: 1px dashed var(--line); }
.bc-foot span { display: inline-flex; align-items: center; gap: 5px; }
.bc-foot .icon { width: 13px; height: 13px; }

/* first run */
.first-run { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 40px 24px 34px; }
.fr-art svg { width: 220px; height: auto; }
.first-run h2 { font-family: var(--font-display); font-size: 26px; }
.first-run > p { max-width: 520px; color: var(--ink-2); font-size: 14.5px; }
.first-run .btn-lg { margin-top: 6px; }
.fr-steps { list-style: none; margin: 20px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; width: min(760px, 100%); }
.fr-steps li { display: grid; justify-items: center; gap: 4px; font-size: 13px; }
.fr-steps li span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--info-bg); color: var(--info-ink); margin-bottom: 4px; }
.fr-steps li span.md { background: var(--md-bg); color: var(--md); box-shadow: inset 0 0 0 1px var(--md-border); }
.fr-steps small { color: var(--ink-3); font-size: 11.5px; }
@container main (max-width: 620px) { .fr-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ==========================================================================
   Register a tender (pm-tender-register.html)
   ========================================================================== */
.crumbs { display: flex; gap: 6px; font-size: 12.5px; color: var(--ink-3); margin-bottom: 2px; }
.crumbs a { color: var(--brand-700); font-weight: 600; }
:root[data-theme="dark"] .crumbs a { color: var(--sky); }
.reg-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.reg-steps li { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-3); }
.reg-steps li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--surface-3); }
.reg-steps li span .icon { width: 13px; height: 13px; }
.reg-steps li.on { color: var(--ink-1); border-color: var(--s1); }
.reg-steps li.on span { background: var(--s1); color: #fff; }
.reg-steps li.done { color: var(--good-ink); }
.reg-steps li.done span { background: var(--good); color: #fff; }

.reg-grid { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
.reg-doc { display: grid; gap: 16px; position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); overflow-y: auto; scrollbar-width: thin; padding-bottom: 2px; }
@container main (max-width: 980px) {
  .reg-grid { grid-template-columns: minmax(0, 1fr); }
  .reg-doc { position: static; max-height: none; overflow: visible; }
}
.ref-pill { display: inline-flex; align-items: center; gap: 4px; font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; font-weight: 700; padding: 4px 8px; border-radius: 8px; background: var(--brand-50); color: var(--brand-800); border: 1px solid var(--brand-100); white-space: nowrap; }
:root[data-theme="dark"] .ref-pill { color: var(--sky); }
.ref-pill .icon { width: 13px; height: 13px; }

.dropzone.big { padding: 34px 18px 26px; gap: 6px; border-radius: 16px; }
.dropzone.big b { font-size: 15px; }
.dropzone.big u { color: var(--brand-700); text-decoration-thickness: 1px; }
:root[data-theme="dark"] .dropzone.big u { color: var(--sky); }
.dropzone .dz-art svg { width: 120px; height: auto; transition: transform .2s; }
.dropzone:hover .dz-art svg, .dropzone.over .dz-art svg { transform: translateY(-3px); }
.dropzone.busy { opacity: .6; pointer-events: none; }
.try-sample { margin-top: 10px; }
.try-sample .icon { width: 15px; height: 15px; }

.doc-view { display: grid; gap: 12px; }
.paper-stage { display: grid; gap: 8px; background: var(--surface-3); border-radius: 14px; padding: 14px 14px 8px; }
.paper { position: relative; display: grid; place-items: center; min-height: 160px; min-width: 0; cursor: zoom-in; }
.paper-stage, .doc-view > * { min-width: 0; }
.paper canvas { display: block; max-width: 100%; height: auto; background: #fff; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 28px rgba(15,28,48,.16); }
.paper-busy { position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--s1); border-top-color: transparent; animation: spin .8s linear infinite; }
.page-nav { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.page-nav .icon-btn { width: 32px; height: 32px; }
.page-nav .icon-btn:disabled { opacity: .35; cursor: default; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.thumbs button { flex: none; display: grid; gap: 3px; justify-items: center; padding: 3px; border: 1.5px solid transparent; border-radius: 8px; background: none; cursor: pointer; }
.thumbs button[aria-current="true"] { border-color: var(--s1); background: var(--info-bg); }
.thumbs canvas, .thumbs .th-img { width: 46px; height: 62px; display: block; border-radius: 3px; background: #fff; box-shadow: 0 1px 3px rgba(15,28,48,.18); }
.thumbs canvas { height: auto; }
.thumbs .th-img { background: linear-gradient(90deg, var(--surface-3), var(--line), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.thumbs small { font-size: 10.5px; color: var(--ink-3); font-weight: 600; }
.th-more { flex: none; align-self: center; font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 0 8px; }
.doc-meta { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.doc-meta > div { flex: 1; min-width: 0; }
.doc-meta b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta small { font-size: 11.5px; color: var(--ink-3); }
.doc-ic { width: 36px; height: 44px; flex: none; border-radius: 6px; background: var(--crit-bg); color: var(--crit-ink); font-size: 10px; font-weight: 800; display: grid; place-items: end center; padding-bottom: 6px; position: relative; }
.doc-ic::before { content: ""; position: absolute; top: 0; right: 0; width: 10px; height: 10px; background: linear-gradient(225deg, var(--surface) 50%, rgba(0,0,0,.08) 50%); border-bottom-left-radius: 3px; }

.ai-card { border: 1.5px solid var(--brand-200); background: radial-gradient(380px 160px at 100% 0%, var(--info-bg), transparent 70%), var(--surface); display: grid; gap: 12px; }
:root[data-theme="dark"] .ai-card { border-color: var(--line-2); }
.ai-head { display: flex; align-items: center; gap: 10px; }
.ai-head > div { flex: 1; min-width: 0; }
.ai-head b { display: block; font-size: 14.5px; }
.ai-head small { font-size: 12px; color: var(--ink-3); }
.ai-head .as-logo .icon { width: 17px; height: 17px; }
.ai-text { font-size: 13px; color: var(--ink-2); }
.btn-ai {
  height: 46px; border: 0; color: #fff; font-size: 14px; border-radius: 13px; position: relative; overflow: hidden;
  background: linear-gradient(110deg, #022966, #1d4076 35%, #2a78d6 70%, #5598e7);
  box-shadow: 0 8px 22px rgba(42, 120, 214, .32);
}
.btn-ai:hover { background: linear-gradient(110deg, #011a42, #1d4076 35%, #2a78d6 70%, #5598e7); }
.btn-ai:disabled { background: var(--surface-3); color: var(--ink-3); box-shadow: none; cursor: not-allowed; }
.btn-ai.running::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); animation: sweep 1.3s linear infinite; }
.btn-ai.running:disabled { background: linear-gradient(110deg, #022966, #1d4076 35%, #2a78d6 70%, #5598e7); color: #fff; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.ai-progress { display: grid; gap: 12px; }
.ai-bar { height: 6px; border-radius: 6px; background: var(--brand-100); overflow: hidden; }
.ai-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--s1), var(--sky)); transition: width .3s; }
.ai-progress .steps li.fail .st-dot { border-color: var(--crit); background: var(--crit); color: #fff; }
.ai-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ai-sum div { background: var(--surface-2); border-radius: 11px; padding: 10px; text-align: center; }
.ai-sum b { display: block; font-size: 22px; line-height: 1.1; }
.ai-sum b.needs { color: var(--flag); }
.ai-sum span { font-size: 11px; color: var(--ink-3); }

/* the form */
.reg-form { display: grid; gap: 16px; min-width: 0; }
.draft-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: var(--info-bg); color: var(--info-ink); font-size: 13px; }
.draft-banner .icon { width: 17px; height: 17px; }
.draft-banner span { flex: 1; min-width: 200px; }
.f-sec { display: grid; gap: 16px; }
.f-sec-head { display: flex; align-items: flex-start; gap: 12px; }
.f-sec-head > div { flex: 1; min-width: 0; }
.f-sec-head h2 { font-size: 16px; font-weight: 600; }
.f-sec-head p { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.f-num { width: 30px; height: 30px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--brand-100); color: var(--brand-800); }
:root[data-theme="dark"] .f-num { color: var(--sky); }
.f-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.f-grid .span-2 { grid-column: 1 / -1; }
@container (max-width: 560px) { .f-grid { grid-template-columns: minmax(0, 1fr); } }
.f { display: grid; gap: 6px; align-content: start; min-width: 0; border-radius: 12px; transition: background .4s, box-shadow .4s; }
.f-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; flex-wrap: wrap; }
.f-top label, .f-top .lbl { font-size: 13px; font-weight: 600; color: var(--ink-1); }
.req { color: var(--flag); font-style: normal; margin-left: 2px; }
.f input[type="text"], .f input[type="datetime-local"], .f textarea, .f select.select, .req-main textarea {
  width: 100%; min-width: 0; border: 1px solid var(--line-2); border-radius: 11px; padding: 10px 12px;
  background: var(--surface); color: var(--ink-1); font: inherit; font-size: 14px; line-height: 1.4;
  transition: border-color .15s, box-shadow .15s, background .3s;
}
.f input[type="text"], .f input[type="datetime-local"], .f select.select { height: 44px; }
.f select.select { padding-right: 36px; }
.f textarea, .req-main textarea { resize: vertical; min-height: 44px; }
.f input:focus, .f textarea:focus, .f select:focus, .req-main textarea:focus { outline: 0; border-color: var(--s1); box-shadow: 0 0 0 3px var(--info-bg); }
.f-help { font-size: 11.5px; color: var(--ink-3); }
.f-help.warn { color: var(--warn-ink); font-weight: 600; }
.f-help.err { color: var(--flag); font-weight: 600; }
.f-quote { font-size: 11.5px; color: var(--ink-3); font-style: italic; line-height: 1.45; padding-left: 10px; border-left: 2px solid var(--sky); overflow-wrap: anywhere; }
.f-quote .link { font-style: normal; font-size: 11.5px; }
.f-quote.warn { border-left-color: var(--warn); color: var(--warn-ink); font-style: normal; }
.f.ai-filled input, .f.ai-filled textarea, .f.ai-filled select { background: color-mix(in srgb, var(--info-bg) 70%, var(--surface)); border-color: color-mix(in srgb, var(--s1) 45%, var(--line-2)); }
.f.ai-low input, .f.ai-low textarea, .f.ai-low select { background: color-mix(in srgb, var(--warn-bg) 70%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 55%, var(--line-2)); }
.f.flash, .f-sec.flash { animation: flash 1s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(42,120,214,0); } 30% { box-shadow: 0 0 0 6px var(--info-bg); } 100% { box-shadow: 0 0 0 0 rgba(42,120,214,0); } }
.f-src:empty { display: none; }
.src-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 11px; font-weight: 700; border: 0; cursor: default; white-space: nowrap; font-family: inherit; }
.src-chip .icon { width: 12px; height: 12px; }
button.src-chip { cursor: pointer; }
.src-chip.ai { background: var(--info-bg); color: var(--info-ink); }
.src-chip.low { background: var(--warn-bg); color: var(--warn-ink); }
.src-chip.missing { background: var(--neutral-bg); color: var(--neutral-ink); }
.src-chip.edited { background: var(--brand-100); color: var(--brand-800); }
:root[data-theme="dark"] .src-chip.edited { color: var(--sky); }
.src-chip.suggest { background: var(--surface); color: var(--info-ink); box-shadow: inset 0 0 0 1.5px var(--s1); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
button.src-chip.ai:hover, button.src-chip.low:hover { filter: brightness(.96); text-decoration: underline; }
.f.has-err input { border-color: var(--flag); }

/* commitment letter: generate, sign, upload */
.lf { list-style: none; margin: 0; padding: 0; display: grid; }
.lf-step { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; position: relative; padding-bottom: 22px; }
.lf-step:last-child { padding-bottom: 0; }
.lf-step:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 36px; bottom: 6px; width: 2px; border-radius: 1px; background: var(--line); }
.lf-step.done:not(:last-child)::before { background: var(--good); }
.lf-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--surface-3); color: var(--ink-2); }
.lf-dot .icon { width: 15px; height: 15px; }
.lf-step.done .lf-dot { background: var(--good); color: #fff; }
.lf-body { display: grid; gap: 10px; min-width: 0; }
.lf-head { display: grid; gap: 1px; padding-top: 5px; }
.lf-head b { font-size: 14px; font-weight: 600; }
.lf-head small { font-size: 12px; color: var(--ink-3); }
.lf-alert { align-items: center; flex-wrap: wrap; }
.lf-alert > div { flex: 1 1 220px; min-width: 0; }
.lf-alert .btn { flex: none; }

.gen-card { display: flex; gap: 18px; align-items: center; padding: 14px 18px 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(135deg, var(--brand-50), var(--surface) 72%); }
.gen-card.locked { background: var(--surface-2); border-style: dashed; border-color: var(--line-2); }
.gc-paper { width: 64px; height: auto; flex: none; transform: rotate(-3deg); filter: drop-shadow(0 6px 12px rgba(15, 28, 48, .14)); }
.gen-card.locked .gc-paper { opacity: .55; filter: grayscale(.7); }
.gc-text { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.gc-text b { font-size: 13.5px; }
.gc-text > span { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.gc-text .btn { margin-top: 6px; }

.file-tile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px 12px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.file-tile.stale .dt-thumb, .file-tile.stale .dt-info b { opacity: .6; }
.file-tile.flat { margin-top: 16px; background: var(--surface-2); }
.dt-thumb { width: 54px; height: 70px; padding: 0; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 12px rgba(15, 28, 48, .1); color: #7a8597; font: inherit; }
span.dt-thumb { cursor: default; }
button.dt-thumb:hover { box-shadow: 0 0 0 2px var(--s1), 0 6px 16px rgba(15, 28, 48, .16); }
.dt-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.dt-thumb .icon { width: 24px; height: 24px; }
.dt-info { display: grid; gap: 2px; min-width: 0; }
.dt-info b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-info > span { font-size: 11.5px; color: var(--ink-3); }
.dt-state { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; margin-top: 2px; }
.dt-state .icon { width: 13px; height: 13px; }
.dt-state.good { color: var(--good-ink); }
.dt-state.warn { color: var(--warn-ink); }
.dt-state.crit { color: var(--crit-ink); }
.dt-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.dt-x { width: 32px; height: 32px; }

.mini-drop { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1.5px dashed var(--line-2); border-radius: 14px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.mini-drop:hover, .mini-drop.over { border-color: var(--s1); background: var(--info-bg); }
.mini-drop:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mini-drop > .icon { width: 38px; height: 38px; padding: 9px; border-radius: 11px; background: var(--brand-100); color: var(--brand-800); flex: none; }
.mini-drop > span { display: grid; gap: 2px; min-width: 0; }
.mini-drop b { font-size: 13.5px; }
.mini-drop small { font-size: 12px; color: var(--ink-3); }
.mini-drop u { color: var(--brand-700); text-decoration-thickness: 1px; }
.mini-drop.locked { cursor: not-allowed; background: var(--surface-2); }
.mini-drop.locked:hover { border-color: var(--line-2); background: var(--surface-2); }
.mini-drop.locked > .icon { background: var(--surface-3); color: var(--ink-3); }
.mini-drop.locked b { color: var(--ink-2); }
:root[data-theme="dark"] .mini-drop > .icon, :root[data-theme="dark"] .mini-drop u { color: var(--sky); }
:root[data-theme="dark"] .mini-drop.locked > .icon { color: var(--ink-3); }
@container (max-width: 560px) {
  .file-tile { grid-template-columns: auto minmax(0, 1fr); }
  .dt-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .gen-card { flex-direction: column; align-items: flex-start; }
}

/* sticky action bar */
.reg-bar {
  position: sticky; bottom: 12px; z-index: 20; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 14px 12px 18px; border-radius: 16px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
  box-shadow: 0 12px 34px rgba(15, 28, 48, .14);
}
.rb-progress { flex: 1 1 260px; min-width: 0; display: grid; gap: 7px; }
.rb-top { font-size: 12.5px; color: var(--ink-2); }
.rb-top b { color: var(--ink-1); }
.rb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.confirm-list { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 9px 14px; margin: 0; font-size: 13px; }
.confirm-list dt { color: var(--ink-3); font-weight: 600; }
.confirm-list dd { margin: 0; overflow-wrap: anywhere; }
#reg-confirm { top: 8vh; max-height: 84vh; overflow-y: auto; }

/* full-size page viewer */
.modal.page-modal { width: min(920px, calc(100vw - 32px)); top: 3vh; max-height: 94vh; display: flex; flex-direction: column; }
.pz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line); }
.pz-head b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pz-nav { display: flex; gap: 4px; flex: none; }
.pz-body { overflow: auto; padding: 18px; background: var(--surface-3); display: grid; justify-items: center; }
.pz-body canvas { max-width: 100%; height: auto; background: #fff; box-shadow: 0 10px 30px rgba(15,28,48,.2); border-radius: 3px; }
.page-nav .pg-zoom { margin-left: 4px; }
.dv-title { display: grid; min-width: 0; }
.dv-title small { font-size: 11.5px; color: var(--ink-3); }
.doc-viewer .pz-nav { align-items: center; gap: 8px; }
.dv-note { display: flex; gap: 8px; align-items: center; margin: 0; padding: 9px 18px; font-size: 12.5px; background: var(--info-bg); color: var(--info-ink); }
.dv-note .icon { width: 15px; height: 15px; flex: none; }
.dv-body { gap: 16px; }
.dv-body img { max-width: 100%; height: auto; background: #fff; box-shadow: 0 10px 30px rgba(15,28,48,.2); border-radius: 3px; }
.reg-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; }
.reg-cover { margin: 0; display: grid; gap: 6px; justify-items: center; }
.reg-cover img { width: 150px; border-radius: 4px; box-shadow: 0 8px 22px rgba(15, 28, 48, .16); background: #fff; }
.reg-cover figcaption { font-size: 11px; color: var(--ink-3); max-width: 150px; text-align: center; overflow-wrap: anywhere; }
@container (max-width: 520px) { .reg-summary { grid-template-columns: minmax(0, 1fr); } }

/* compact document panel: page strip beside the preview */
.doc-card .card-head { margin-bottom: 12px; }
.doc-title { min-width: 0; }
.doc-title .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-view { grid-template-columns: minmax(0, 1fr) 60px; align-items: start; gap: 10px; }
.doc-view .thumbs { flex-direction: column; overflow-x: hidden; overflow-y: auto; padding: 0 2px 0 0; gap: 6px; }
.doc-view .paper-stage { padding: 12px 12px 6px; }
.ai-card { gap: 10px; }
.ai-how summary { font-size: 12px; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.ai-how[open] summary { margin-bottom: 6px; }
@container (max-width: 340px) { .doc-view { grid-template-columns: minmax(0, 1fr); } .doc-view .thumbs { flex-direction: row; overflow-x: auto; max-height: none !important; } }

/* ---------- PM dashboard (pm-dashboard.html) ----------
   Replanned 3 Nov 2026 at the user's request ("reduce unwanted data and white
   space"), as a daily working screen: a plain page head, an overview band (six
   figures in one panel, bid value this year, outcomes this year), the next
   submission as one slim strip, and every tender with its next step or blocker.
   Classes are pd-; the page head keeps its dh- classes. */
.page > .dh-head, .page > .pd-ov { grid-column: 1 / -1; min-width: 0; }
.dh-head { align-items: center; }
.dh-head .page-title { flex: 1 1 380px; min-width: 0; }
.dh-head .page-title > div { min-width: 0; }
.dh-head .page-title p { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; max-width: 780px; }
.dh-head .page-title p b { color: var(--ink-1); font-weight: 600; }
.dh-when { box-shadow: var(--shadow); font-size: 13px; font-variant-numeric: tabular-nums; }
.dh-when .icon { width: 16px; height: 16px; color: var(--brand-700); }
:root[data-theme="dark"] .dh-when .icon { color: var(--sky); }
.dh-sep { width: 1px; height: 16px; background: var(--line); margin: 0 2px; }
@media (max-width: 760px) { .dh-head .head-controls { width: 100%; } .dh-when { display: none; } }

/* Overview band: spans content and rail; its own width sets the columns. */
.pd-ov { container: pdov / inline-size; }
.pd-ov-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@container pdov (min-width: 760px) {
  .pd-ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-ov-grid > .pd-kp-panel { grid-column: 1 / -1; }
}
@container pdov (min-width: 1180px) {
  .pd-ov-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, .82fr); }
  .pd-ov-grid > .pd-kp-panel { grid-column: auto; }
}

/* Key figures: one panel, cells split by hairlines (a 1px gap over the line colour). */
.pd-kp-panel {
  padding: 0; overflow: hidden; display: grid; gap: 1px; background: var(--line);
  grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr;
}
@container pdov (min-width: 760px) and (max-width: 1179px) { .pd-kp-panel { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@container pdov (max-width: 520px) { .pd-kp-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pd-kp {
  display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; padding: 12px 16px;
  background: var(--surface); color: var(--ink-1); border: 0; font: inherit; text-align: left; text-decoration: none;
  cursor: pointer; transition: background .15s;
}
.pd-kp:hover { background: var(--surface-2); }
.pd-kp:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; }
.pd-kp-label { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.pd-kp-label .icon { width: 14px; height: 14px; flex: none; color: var(--ink-3); }
.pd-kp-value { display: flex; align-items: baseline; gap: 5px; font-size: 24px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; white-space: nowrap; }
.pd-kp-value small { font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--ink-3); }
.pd-kp-note {
  font-size: 12px; color: var(--ink-3); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pd-kp-note b { font-weight: 600; color: var(--ink-2); }
.pd-kp-note b.flag { color: var(--flag); }
.pd-kp-note .rule { margin-left: 2px; }
/* brass: the one figure that waits on the MD */
.pd-kp.md { box-shadow: inset 3px 0 0 var(--md); }
.pd-kp.md .pd-kp-label, .pd-kp.md .pd-kp-label .icon { color: var(--md); }

/* Chart cards in the band */
.pd-chart { display: flex; flex-direction: column; min-width: 0; padding: 16px 18px; }
.pd-chart-head { display: flex; align-items: flex-start; gap: 12px; }
.pd-chart-head > :first-child { flex: 1; min-width: 0; }
.pd-chart-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.pd-chart-head .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.pd-figure { text-align: right; line-height: 1.2; }
.pd-figure b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.pd-figure b .cur { font-size: .58em; font-weight: 600; color: var(--ink-3); margin-right: 3px; letter-spacing: .02em; }
.pd-figure span { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.pd-legend-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.pd-chart > .chart { margin-top: auto; }

/* Outcomes donut */
.pd-oc { flex: 1; display: flex; align-items: center; gap: 18px; margin-top: 12px; min-width: 0; }
.pd-oc-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: grid; gap: 9px; }
.pd-oc-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.pd-oc-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.pd-oc-legend b { font-size: 15px; font-weight: 700; color: var(--ink-1); font-variant-numeric: tabular-nums; }
.pd-oc-legend .pd-oc-note { display: block; font-size: 11px; color: var(--ink-3); }
.pd-donut { position: relative; flex: none; }
.pd-seg { stroke: var(--c); cursor: pointer; transition: opacity .15s; }
.pd-donut svg:hover .pd-seg:not(:hover) { opacity: .55; }
.pd-seg:focus-visible { outline: none; stroke-width: 19; }
.pd-donut-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.pd-donut-c b { font-size: 22px; font-weight: 700; line-height: 1; letter-spacing: -.01em; }
.pd-donut-c span { font-size: 11px; color: var(--ink-3); margin-top: 3px; }

/* Next submission: one slim strip. What and when | countdown | readiness and gates. */
.pd-next { display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1.4fr); gap: 14px 24px; align-items: center; padding: 14px 18px; }
.pd-next-main { min-width: 0; display: grid; gap: 4px; }
.pd-next-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.pd-next-eyebrow > .icon { width: 15px; height: 15px; color: var(--s1); }
.pd-next-eyebrow .chip { text-transform: none; letter-spacing: 0; }
.pd-next-title { font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--ink-1); text-decoration: none; }
.pd-next-title:hover { text-decoration: underline; }
.pd-next-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12px; color: var(--ink-3); }
.pd-next-meta b { color: var(--ink-2); font-weight: 600; }
.pd-countdown { gap: 6px; }
.pd-countdown div { min-width: 50px; padding: 7px 6px 5px; }
.pd-countdown b { font-size: 19px; }
.pd-countdown span { font-size: 9.5px; }
.pd-ready { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pd-gates { flex: 1; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 14px; font-size: 11.5px; }
.pd-gates li { min-width: 0; }
.pd-gates li > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-gates li em { margin-left: 4px; flex: none; }
@container main (max-width: 1100px) {
  .pd-next { grid-template-columns: minmax(0, 1fr) auto; }
  .pd-ready { grid-column: 1 / -1; }
  .pd-gates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container main (max-width: 560px) {
  .pd-next { grid-template-columns: minmax(0, 1fr); }
  .pd-gates { grid-template-columns: minmax(0, 1fr); }
}

/* My tenders: filters with counts, then one row per tender */
.pd-tenders-head { flex-wrap: wrap; align-items: flex-end; }
.pd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.pd-chips button {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: inherit; font-size: 12.5px; color: var(--ink-2);
}
.pd-chips button span { font-weight: 700; color: var(--ink-1); font-variant-numeric: tabular-nums; }
.pd-chips button:hover { border-color: var(--line-2); }
.pd-chips button[aria-pressed="true"] { background: var(--brand-800); border-color: var(--brand-800); color: #fff; }
.pd-chips button[aria-pressed="true"] span { color: #fff; }
:root[data-theme="dark"] .pd-chips button[aria-pressed="true"] { background: var(--s1); border-color: var(--s1); }
.pd-chips button.md span { color: var(--md); }
.pd-chips button.md[aria-pressed="true"] { background: var(--md-bg); border-color: var(--md-border); color: var(--md); }
.pd-chips button.md[aria-pressed="true"] span { color: var(--md); }
.pd-t { display: block; min-width: 0; color: inherit; text-decoration: none; }
.pd-t:hover .t-title { text-decoration: underline; }
.pd-nx { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-1); }
.pd-nx .icon { width: 15px; height: 15px; flex: none; color: var(--ink-3); }
.pd-nx.muted { color: var(--ink-3); }
.pd-nx.md, .pd-nx.md .icon { color: var(--md); font-weight: 600; }
.pd-nx.flag, .pd-nx.flag .icon { color: var(--flag); font-weight: 600; }
.pd-nx.warn, .pd-nx.warn .icon { color: var(--warn-ink); font-weight: 600; }
.pd-sv { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.pd-sv .icon { width: 13px; height: 13px; }
.pd-sv.warn { color: var(--warn-ink); } .pd-sv.crit { color: var(--flag); } .pd-sv.md { color: var(--md); } .pd-sv.info { color: var(--info-ink); }
.pd-sv:hover { text-decoration: underline; }
.pd-with-md {
  display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: 7px; white-space: nowrap;
  background: var(--md-bg); color: var(--md); box-shadow: inset 0 0 0 1px var(--md-border); font-size: 11.5px; font-weight: 600;
}
.pd-wait { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
@container (max-width: 860px) {
  table.data#tender-table.pd-table tr { grid-template-areas: "title act" "next next" "status due" "priced priced"; }
  table.data#tender-table.pd-table .c-next { grid-area: next; }
  table.data#tender-table.pd-table .c-next::before { display: none; }
}

/* ---------- Tender cards: one look, two different buttons ----------
   3 Nov 2026, at the user's request: every card is the same colour (the navy
   .featured card is no longer used) and the tag row is gone. "Details" opens the
   tender; the second control is the tender's next step. When that step is not
   the PM's, it is a label instead of a button. */
.tc-actions.tc2-single { grid-template-columns: 1fr; }
.tc-ghost .icon { width: 16px; height: 16px; }
.tc2-wait {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 12px;
  border-radius: 9px; border: 1px dashed var(--line-2); background: var(--surface-2);
  font-size: 12.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; cursor: help;
}
.tc2-wait .icon { width: 16px; height: 16px; }
/* brass: waiting on the MD, and only that */
.tc2-wait.md { color: var(--md); background: var(--md-bg); border-color: var(--md-border); }
/* where a card's next-step button lands on the tender page */
.go-focus { scroll-margin-top: 88px; animation: fresh 1.6s ease 2; box-shadow: 0 0 0 3px var(--s1), var(--shadow); }

/* ---------- Tender progress: a timeline you walk, one step at a time ----------
   3 Nov 2026, at the user's request. The steps are tabs (click, arrow keys, or
   Back / Next); the panel under them shows only the chosen step. The RFQ step
   (download the goods, AI OEM suggestions, manual OEMs, one email sent to each)
   follows registration, as in iea-system/CLAUDE.md section 5, steps 9-12. */
.tp-panel { display: grid; gap: 20px; min-width: 0; }
.tp-panel > * { min-width: 0; }
.tp-panel:focus { outline: none; }
.icon.flip svg { transform: scaleX(-1); }

/* steps as tabs, reusing the .ph stepper look */
button.tp-step {
  font: inherit; color: inherit; background: none; border: 0; cursor: pointer;
  padding: 8px 2px 10px; border-radius: 12px; transition: background .15s;
}
button.tp-step::before { top: 27px; }
button.tp-step:hover { background: var(--surface-2); }
button.tp-step:focus-visible { outline: 2px solid var(--s1); outline-offset: -2px; }
button.tp-step[aria-selected="true"] { background: var(--info-bg); }
button.tp-step[aria-selected="true"] b { color: var(--brand-800); }
:root[data-theme="dark"] button.tp-step[aria-selected="true"] b { color: var(--sky); }
button.tp-step[aria-selected="true"] .ph-dot { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--s1); }
button.tp-step.future { opacity: .78; }
button.tp-step.future:hover, button.tp-step.future[aria-selected="true"] { opacity: 1; }
.tp-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.tp-nav .btn .icon { width: 16px; height: 16px; }
.tp-where { font-size: 12.5px; color: var(--ink-3); text-align: center; }
.tp-where b { color: var(--ink-1); }
.tp-nav-foot { margin-top: 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tp-panel .kpis.tp-k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@container main (max-width: 1180px) { .tp-panel .kpis.tp-k5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container main (max-width: 620px) { .tp-panel .kpis.tp-k5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tp-where { display: none; } }

/* RFQ 1: goods to quote */
.tp-row { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-bottom: 14px; }
.tp-field { display: grid; gap: 6px; min-width: 0; }
.tp-lbl { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tp-pick { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 14px; background: var(--surface-2); }
.tp-pick label { display: grid; grid-template-columns: auto 34px minmax(0, 1fr); gap: 10px; align-items: start; padding: 7px 8px; border-radius: 8px; font-size: 12.5px; cursor: pointer; }
.tp-pick label:hover { background: var(--surface); }
.tp-pick input { margin: 2px 0 0; accent-color: var(--s1); }
.tp-pick .num { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tp-goods { list-style: none; margin: 0 0 10px; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tp-goods li { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 9px 12px; font-size: 12.5px; }
.tp-goods li + li { border-top: 1px solid var(--line); }
.tp-goods .g-n { color: var(--ink-3); }
.tp-goods .g-d { color: var(--ink-1); overflow-wrap: anywhere; }
.tp-goods .g-q { color: var(--ink-2); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* RFQ 2: OEMs */
.tp-sample { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--info-bg); color: var(--ink-2); font-size: 12px; line-height: 1.45; }
.tp-sample .icon { width: 16px; height: 16px; color: var(--info-ink); flex: none; margin-top: 1px; }
.tp-sample b { color: var(--info-ink); }
.tp-add { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 14px; background: var(--surface-2); }
.tp-add-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px 12px; }
.tp-in { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tp-in b { color: var(--crit-ink); }
.tp-in input, .tp-input {
  height: 38px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 11px; min-width: 0; width: 100%;
  background: var(--surface); color: var(--ink-1); font: inherit; font-weight: 400; font-size: 13px;
}
.tp-in input:focus, .tp-input:focus { outline: 0; border-color: var(--s1); box-shadow: 0 0 0 3px var(--info-bg); }
.tp-err { min-height: 18px; margin: 8px 0 0; font-size: 12px; color: var(--crit-ink); }
.tp-err:empty { min-height: 0; margin: 0; }
.tp-add-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.tp-oems { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 272px), 1fr)); gap: 14px; }
.tp-oems > .empty { grid-column: 1 / -1; }
.tp-oem {
  display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow);
}
.tp-oem.accepted { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); box-shadow: inset 3px 0 0 var(--good), var(--shadow); }
.tp-oem.rejected { opacity: .62; }
.tp-oem.rejected:hover, .tp-oem.rejected:focus-within { opacity: 1; }
.tp-oem.sent { background: var(--surface-2); }
.tp-oem header { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.tp-oem-logo { width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand-800), var(--brand-600)); }
.tp-oem-id { flex: 1; min-width: 0; }
.tp-oem-id b { display: block; font-size: 13.5px; line-height: 1.3; overflow-wrap: anywhere; }
.tp-oem-id span { font-size: 12px; color: var(--ink-3); }
.tp-oem header .chip { flex: none; }
.tp-oem-fields { display: grid; gap: 6px; }
.tp-oem-fields label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tp-oem-fields label > .icon { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.tp-oem-fields input {
  flex: 1; min-width: 0; height: 32px; padding: 0 9px; border-radius: 8px; border: 1px solid transparent;
  background: var(--surface-2); color: var(--ink-1); font: inherit; font-size: 12.5px;
}
.tp-oem-fields input:hover { border-color: var(--line-2); }
.tp-oem-fields input:focus { outline: 0; border-color: var(--s1); box-shadow: 0 0 0 3px var(--info-bg); background: var(--surface); }
.tp-oem-fields input[readonly] { background: none; border-color: transparent; box-shadow: none; padding-left: 0; }
.tp-oem-fields input::placeholder { color: var(--ink-3); font-style: italic; }
.tp-oem-site { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.tp-oem-site .icon { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.tp-oem-why { margin: 0; font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.tp-oem-why b { color: var(--ink-1); font-weight: 600; }
.tp-oem-src { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--ink-3); }
.tp-oem-src span { display: inline-flex; align-items: center; gap: 4px; overflow-wrap: anywhere; }
.tp-oem-src .icon { width: 12px; height: 12px; }
.tp-oem-cover { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 12px; color: var(--ink-2); }
.tp-oem-cover .icon { width: 15px; height: 15px; color: var(--ink-3); }
.tp-oem footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.tp-oem footer .btn { flex: 1; }
.tp-oem-acts { display: inline-flex; gap: 12px; }
.tp-skel { min-height: 236px; gap: 12px; }
.tp-skel i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: tp-shimmer 1.1s linear infinite; }
.tp-skel i:first-child { height: 38px; width: 60%; border-radius: 11px; }
.tp-skel i:nth-child(3) { width: 80%; }
.tp-skel i:last-child { margin-top: auto; height: 32px; }
@keyframes tp-shimmer { to { background-position: -200% 0; } }
.tp-busy .icon { animation: spin 1s linear infinite; }

/* RFQ 3: the email */
.tp-mail { display: grid; gap: 10px; }
.tp-mail-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; align-items: center; }
.tp-mail-row .tp-date { max-width: 200px; }
.tp-to { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.tp-rcpt { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--brand-100); color: var(--brand-800); font-size: 12px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root[data-theme="dark"] .tp-rcpt { color: var(--sky); }
.tp-rcpt.bad { background: var(--crit-bg); color: var(--crit-ink); }
.tp-rcpt.locked { background: var(--surface-3); color: var(--ink-2); }
.tp-rcpt .icon { width: 13px; height: 13px; }
.tp-hint { font-size: 11.5px; color: var(--ink-3); }
.tp-mail-body textarea { height: auto; min-height: 220px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.tp-mail-body .note { margin-top: 6px; }
.tp-mail-body code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 11px; padding: 1px 5px; border-radius: 5px; background: var(--surface-3); color: var(--ink-2); }
.tp-att { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.tp-att label { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.tp-att input { accent-color: var(--s1); margin: 0; }
.tp-att .icon { width: 14px; height: 14px; color: var(--ink-3); }
.tp-preview { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.tp-preview summary { cursor: pointer; padding: 10px 12px; font-size: 12.5px; font-weight: 600; color: var(--brand-700); }
:root[data-theme="dark"] .tp-preview summary { color: var(--sky); }
.tp-preview-body { padding: 0 14px 14px; font-size: 13px; }
.tp-preview-body pre { margin: 8px 0 0; white-space: pre-wrap; font: inherit; color: var(--ink-2); line-height: 1.55; }
.tp-send { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.tp-send .note { flex: 1 1 320px; margin: 0; }
.tp-send-btn { height: 44px; padding: 0 20px; }
@container main (max-width: 620px) {
  .tp-mail-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .tp-send-btn { width: 100%; }
}
.tp-panel .card-head .card-tools { flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Site visits (assets/js/pm-sitevisit.js) ----------
   3 Nov 2026, at the user's request: marked at registration (yes / no / not
   stated yet, mandatory or optional, date and place), then planned, funded and
   reported on the tender page's Site visit step, with reminders until done. */
.sv-q { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 8px; }
.sv-q + .sv-q, .sv-q + .f-grid, .sv-q + .sv-row2 { margin-top: 14px; }
.sv-q legend { font-size: 13px; font-weight: 600; color: var(--ink-1); padding: 0; margin-bottom: 8px; }
.sv-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sv-opts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sv-opt { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.sv-opt:hover { border-color: var(--s1); }
.sv-opt input { margin: 2px 0 0; accent-color: var(--s1); flex: none; }
.sv-opt b { display: block; font-size: 13px; font-weight: 600; }
.sv-opt small { display: block; font-size: 11.5px; color: var(--ink-3); line-height: 1.35; margin-top: 2px; }
.sv-opt:has(input:checked) { border-color: var(--s1); background: var(--info-bg); box-shadow: 0 0 0 1px var(--s1); }
.sv-opt:has(input:focus-visible) { outline: 2px solid var(--s1); outline-offset: 2px; }
.sv-opt:has(input:disabled) { cursor: default; opacity: .8; }
.sv-opt:has(input:disabled):hover { border-color: var(--line-2); }
@container (max-width: 560px) { .sv-opts, .sv-opts-2 { grid-template-columns: minmax(0, 1fr); } }
.sv-next { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.sv-next .icon { width: 16px; height: 16px; color: var(--s1); flex: none; margin-top: 1px; }
.sv-next b { color: var(--ink-1); }

/* the timeline step: amber while something is owed, brass while it waits on the MD */
.ph.todo .ph-dot { border-color: var(--warn); color: var(--warn-ink); background: var(--warn-bg); }
.ph.mdw .ph-dot { border-color: var(--md); color: var(--md); background: var(--md-bg); }
.ph.skip .ph-dot { background: var(--surface-2); border-color: var(--line-2); color: var(--ink-3); }

/* the step's panel */
.sv-edit { display: grid; gap: 0; }
.sv-edit .smart-alert { margin-bottom: 14px; }
.sv-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.sv-plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
.sv-plan-grid .sv-span2 { grid-column: span 3; }
.sv-plan-grid .tp-in span { line-height: 1.3; }
@container (max-width: 760px) { .sv-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sv-plan-grid .sv-span2 { grid-column: 1 / -1; } }
@container (max-width: 480px) { .sv-row2, .sv-plan-grid { grid-template-columns: minmax(0, 1fr); } }
.tp-in input:disabled, .tp-input:disabled { background: var(--surface-2); color: var(--ink-2); }
.sv-other { display: grid; gap: 8px; margin-top: 16px; }
.sv-other-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 8px; align-items: center; }
.sv-other-row .icon-btn { width: 34px; height: 34px; }
.sv-other .link { justify-self: start; }
@container (max-width: 480px) { .sv-other-row { grid-template-columns: minmax(0, 1fr) 110px auto; } }
.sv-costs { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13px; }
.sv-costs td { padding: 9px 0; border-top: 1px solid var(--line); vertical-align: top; }
.sv-costs td small { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.sv-costs td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; padding-left: 12px; }
.sv-costs tfoot td { border-top: 2px solid var(--ink-1); font-weight: 700; font-size: 14px; }

.sv-ask { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 14px; border-radius: 12px; background: var(--surface-2); margin-bottom: 10px; }
.sv-ask b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.sv-ask span { font-size: 12px; color: var(--ink-3); }
.sv-ask .btn { height: 44px; }
#sv-funds .smart-alert { margin-bottom: 12px; }
.sv-fund-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.sv-fund-head b { display: block; font-size: 15px; }
.sv-fund-head span { font-size: 12.5px; color: var(--ink-3); }
.sv-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sv-track li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.sv-track li > span { grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-3); }
.sv-track li > span .icon { width: 15px; height: 15px; }
.sv-track b { font-size: 12.5px; font-weight: 600; }
.sv-track small { font-size: 11.5px; color: var(--ink-3); }
.sv-track li.done > span { background: var(--good-bg); color: var(--good-ink); }
.sv-track li.now { border-color: var(--warn); }
.sv-track li.now > span { background: var(--warn-bg); color: var(--warn-ink); }
.sv-track li.now.md { border-color: var(--md-border); background: var(--md-bg); }
.sv-track li.now.md > span { background: var(--surface); color: var(--md); }
.sv-track li.now.md small { color: var(--md); font-weight: 600; }
@container (max-width: 560px) { .sv-track { grid-template-columns: minmax(0, 1fr); } }
.sv-demo { margin: 12px 0 0; font-size: 12px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.sv-demo-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--warn-ink); background: var(--warn-bg); padding: 1px 6px; border-radius: 5px; }

.sv-locked { padding: 24px 16px; }
.sv-report { display: grid; gap: 14px; }
.sv-report .smart-alert { margin-bottom: 0; }
.sv-report .tp-in b, .sv-file .tp-lbl b { color: var(--crit-ink); }
.sv-report textarea { height: auto; min-height: 120px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.sv-files { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
@container (max-width: 480px) { .sv-files { grid-template-columns: minmax(0, 1fr); } }
.sv-file { position: relative; display: grid; gap: 6px; cursor: pointer; min-width: 0; }
.sv-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sv-file-box { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1.5px dashed var(--line-2); border-radius: 11px; background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.sv-file-box .icon { width: 16px; height: 16px; color: var(--s1); flex: none; }
.sv-file:hover .sv-file-box { border-color: var(--s1); }
.sv-file:focus-within .sv-file-box { border-color: var(--s1); box-shadow: 0 0 0 3px var(--info-bg); }
.sv-submit { display: flex; justify-content: flex-end; }
.sv-submit .btn { height: 44px; }
.sv-findings { white-space: pre-wrap; line-height: 1.5; }
.sv-filechip { display: inline-flex; align-items: center; gap: 6px; margin: 0 6px 6px 0; padding: 4px 10px; border-radius: 8px; background: var(--surface-3); font-size: 12px; color: var(--ink-1); }
.sv-filechip .icon { width: 14px; height: 14px; color: var(--ink-3); }
.sv-filechip small { color: var(--ink-3); }

/* ---------- Estimate sheet: the tender page's Costing step (assets/js/pm-estimate.js) ----------
   4 Nov 2026, at the user's request: the step is only the estimate sheet (a template to fill in
   Excel, or the figures typed here) and the bid price per lot sent to the MD. Later the same day
   the Rates card went (exchange rates come from the feed, the other rates are the MD's) and rows
   gained a remove ×, with removed tender items listed under the table to restore. */
.es-banner { margin-bottom: 16px; }
#es-sheet .card-head .card-tools { flex-wrap: wrap; justify-content: flex-end; }
.es-report { margin-bottom: 12px; align-items: flex-start; }
.es-report .grow { min-width: 0; }
.es-report .es-line { display: block; margin-top: 2px; }
.es-skip { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--ink-2); display: grid; gap: 2px; }
.es-x { width: 30px; height: 30px; flex: none; margin: -4px -4px 0 auto; }
.es-x .icon { width: 16px; height: 16px; }
.es-bar { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.es-hint { flex: 1 1 260px; margin: 0; font-size: 12px; color: var(--ink-3); }

.es-table { min-width: 900px; table-layout: fixed; }
.es-table th { white-space: nowrap; }
.es-table td { padding: 6px 5px; }
.es-table th:first-child, .es-table td:first-child { padding-left: 10px; }
.es-c-sup { width: 15%; } .es-c-src { width: 100px; } .es-c-cur { width: 80px; } .es-c-price { width: 108px; }
.es-c-risk { width: 64px; } .es-c-hrs { width: 70px; } .es-c-total { width: 140px; } .es-c-how { width: 88px; }
.es-ro .es-c-how { width: 50px; }
.es-acts { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.es-acts .es-del { color: var(--ink-3); }
.es-acts .es-del:hover { color: var(--crit-ink); background: var(--crit-bg); border-color: transparent; }
.es-total b, .es-total small { display: block; }
.es-total small { font-size: 11px; color: var(--ink-3); font-weight: 400; margin-top: 1px; }
.es-table .es-c-item .t-title { font-weight: 500; overflow-wrap: anywhere; }
.es-in {
  height: 32px; width: 100%; min-width: 0; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--surface); color: var(--ink-1); font: inherit; font-size: 12.5px;
}
select.es-in { padding: 0 4px 0 7px; }
.es-in.num { text-align: right; font-variant-numeric: tabular-nums; }
.es-in:focus { outline: 0; border-color: var(--s1); box-shadow: 0 0 0 3px var(--info-bg); }
.es-in[aria-invalid="true"] { border-color: var(--crit-ink); background: var(--crit-bg); }
.es-in::placeholder { color: var(--ink-3); opacity: .75; }
.es-row.todo td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.es-lot td { background: var(--surface-2); font-size: 12.5px; padding-top: 9px; padding-bottom: 9px; }
.es-lot td.r { font-weight: 700; }
.es-table tfoot td { padding: 12px 5px; border-top: 2px solid var(--ink-1); font-weight: 700; font-size: 13.5px; }
.es-table tfoot td:first-child { padding-left: 10px; }
.es-new { display: grid; gap: 6px; }
.es-new-row { display: grid; grid-template-columns: 86px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.es-del { width: 32px; height: 32px; }
.es-del .icon { width: 15px; height: 15px; }
.es-ro td { padding-top: 9px; padding-bottom: 9px; }
.es-ro .es-txt { font-size: 12.5px; }
.es-how td { background: var(--surface-2); padding: 10px 14px 12px !important; }
.es-chain { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 22px; font-size: 12px; }
.es-chain > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.es-chain small { display: block; font-size: 11px; color: var(--ink-3); }
.es-chain b { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.es-chain .sum { border-bottom: 0; }
.es-chain .sum b { font-weight: 800; }

/* where the exchange rates come from (no Rates card: they come from the feed) */
.es-fx { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 10px; font-size: 12px; color: var(--ink-2); }
.es-fx > .icon { width: 15px; height: 15px; color: var(--ink-3); margin-top: 1px; }
.es-fx b { color: var(--ink-1); font-weight: 600; }

/* tender items removed from the estimate: listed under the table, restorable */
.es-removed { margin-top: 14px; border: 1px dashed var(--line-2); border-radius: 12px; padding: 10px 14px; }
.es-removed summary { cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; list-style: none; }
.es-removed summary::-webkit-details-marker { display: none; }
.es-removed summary .icon { width: 16px; height: 16px; color: var(--ink-3); }
.es-removed summary .num { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--surface-3); display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; }
.es-removed summary small { color: var(--ink-3); font-size: 12px; }
.es-removed ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 0; }
.es-removed li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.es-rm-no { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.es-rm-d { font-size: 13px; color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--line-2); min-width: 0; overflow-wrap: anywhere; }
.es-rm-d small { display: block; font-size: 11.5px; color: var(--ink-3); text-decoration: none; }

/* the bid price that goes to the MD */
.es-foot { margin-top: 20px; }

.es-lots { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.es-lots li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.es-lot-tag { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); font-weight: 800; font-size: 12px; }
.es-lot-meta b { display: block; font-size: 13px; }
.es-lot-meta small { font-size: 11.5px; color: var(--ink-3); }
.es-lot-meta em { font-style: normal; color: var(--warn-ink); font-weight: 600; }
.es-lot-val { font-weight: 700; font-size: 14px; white-space: nowrap; }
.es-sum td:nth-child(2) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.es-sum tr.sum td:nth-child(2) { font-weight: 700; }
.es-sum td.es-cp { width: 1%; padding-left: 8px; text-align: right; font-weight: 400; }
.es-sum td.es-cp .es-copy { margin-left: 0; }
.es-sum tr.sum td { font-size: 16px; }
.es-copy { margin-left: 6px; display: inline-flex; align-items: center; gap: 4px; }
.es-copy .icon { width: 13px; height: 13px; }
.es-delta { margin: 10px 0 0; }
.es-send { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.es-send .tp-in small { font-weight: 500; color: var(--ink-3); }
.es-note { height: auto; min-height: 64px; padding: 8px 11px; line-height: 1.45; resize: vertical; }
.es-go { height: 44px; justify-content: center; }
.es-why { margin: 0; font-size: 12px; color: var(--ink-3); }
.es-state { margin-top: 16px; }
#es-send .sv-demo { margin-top: 10px; }
@container (max-width: 420px) {
  .es-lots li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .es-copy { grid-column: 2 / -1; justify-self: start; margin-left: 0; }
}
.es-table .row-btn:disabled { color: var(--ink-3); opacity: .45; cursor: default; background: none; }

/* =============================================================================
   Sidebar: one look with the MD pages, and the same collapse (4 Nov 2026, at
   the user's request: "why is the sidebar from pm and md different ... the pm
   sidebar does not collapse"). Sizes, the subtitle, the solid active item, the
   sub-item style and the footer cards follow md.css; pm-app.js runs the
   collapse (toggle by the logo, "[" key, labels on hover, Tender as a flyout,
   choice kept in localStorage iea.pm.sidebar). Desktop only.
   ========================================================================== */
.app { transition: grid-template-columns .2s ease; }
.sidebar { padding: 20px 14px 16px; overflow-x: hidden; }
.brand { gap: 8px; padding: 2px 8px 6px; }
.brand a { display: flex; align-items: center; min-width: 0; }
.brand img { height: 38px; }
.brand .brand-mark { display: none; }
.brand-sub {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); padding: 0 10px; margin: -2px 0 12px; white-space: nowrap;
}
.side-toggle {
  width: 34px; height: 34px; flex: none; padding: 0; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-3);
}
.side-toggle .icon { width: 18px; height: 18px; }
.side-toggle:hover { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-800); }
:root[data-theme="dark"] .side-toggle:hover { color: var(--sky); }
/* items: the MD sizes and the solid navy active item */
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; padding: 12px 12px 6px; }
.nav a, .nav-parent { height: 38px; padding: 0 12px; font-size: 14px; }
.nav a.active { background: var(--brand-800); box-shadow: 0 6px 16px rgba(29, 64, 118, .28); }
/* a group's pages: a hairline and small dots, as on the MD sidebar */
.nav-sub > div { margin: 2px 0 4px 21px; padding-left: 10px; border-left: 1px solid var(--line); }
.nav-sub > div::before { display: none; }
.nav .nav-sub a { height: 34px; padding-left: 10px; gap: 10px; font-size: 13px; }
.nav .nav-sub a::before { position: static; flex: none; width: 6px; height: 6px; margin: 0; border: 0; background: var(--line-2); }
.nav .nav-sub a.active::before { background: #fff; }
/* footer cards, as on the MD sidebar */
.side-foot { border-top: 0; padding-top: 10px; }
.org-card, .user-card { padding: 10px 12px; border-radius: 12px; background: var(--surface); }
/* The menu button opens the slide-in sidebar on phones only (a later .icon-btn rule was showing it on desktop). */
@media (min-width: 981px) { .icon-btn.menu-btn { display: none; } }
@media (max-width: 980px) { .side-toggle { display: none; } }

/* label beside an icon (collapsed) and the Tender flyout */
.side-tip {
  position: fixed; z-index: 96; pointer-events: none; max-width: 260px;
  display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; border-radius: 9px;
  background: var(--brand-950); color: #fff; font-size: 12.5px; box-shadow: var(--shadow-lg);
}
.side-tip[hidden] { display: none; }
.side-tip::before {
  content: ""; position: absolute; left: -5px; top: 50%; margin-top: -5px;
  border: 5px solid transparent; border-left: 0; border-right-color: var(--brand-950);
}
.side-tip-main { display: flex; align-items: center; gap: 8px; }
.side-tip b { font-weight: 600; white-space: nowrap; }
.side-tip .count {
  min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, .16); color: #fff;
}
.side-fly {
  position: fixed; z-index: 96; min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.side-fly-head { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px 6px; }
.side-fly-nav { flex: none; margin: 0; padding: 0; overflow: visible; }
.side-fly-nav a { height: 36px; padding: 0 10px; gap: 10px; font-size: 13.5px; }
.side-fly-nav a::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); flex: none; }
.side-fly-nav a.active::before { background: #fff; }

@media (min-width: 981px) {
  html.side-collapsed { --sidebar-w: 76px; }
  .side-collapsed .sidebar { padding: 16px 12px 14px; }
  .side-collapsed .brand { flex-direction: column; gap: 10px; padding: 0 0 12px; }
  .side-collapsed .brand .brand-mark { display: block; width: 34px; height: 34px; object-fit: contain; }
  :root[data-theme="dark"].side-collapsed .brand .brand-mark { filter: brightness(0) invert(1); }
  .side-collapsed .brand .logo-light,
  .side-collapsed .brand .logo-dark,
  .side-collapsed .brand-sub,
  .side-collapsed .sidebar .nav-chev,
  .side-collapsed .sidebar .nav-sub,
  .side-collapsed .sidebar .nav .pill-new,
  .side-collapsed .org-card,
  .side-collapsed .side-copy,
  .side-collapsed .user-card > div,
  .side-collapsed .user-card .presence,
  .side-collapsed .theme-switch > :not(input) { display: none !important; }
  .side-collapsed .sidebar .nav { margin: 0; padding: 0; scrollbar-width: none; }
  /* the text shrinks to nothing but stays the link's accessible name; the tip shows it */
  .side-collapsed .sidebar .nav a,
  .side-collapsed .sidebar .nav-parent { position: relative; justify-content: center; gap: 0; padding: 0; font-size: 0; }
  .side-collapsed .sidebar .nav .count {
    position: absolute; top: 1px; right: 2px; margin: 0; min-width: 17px; height: 17px; padding: 0 4px;
    font-size: 10px; box-shadow: 0 0 0 2px var(--surface);
  }
  .side-collapsed .sidebar .nav a.active .count { background: #fff; color: var(--brand-800); }
  .side-collapsed .sidebar .nav-group:has(a.active) > .nav-parent,
  .side-collapsed .sidebar .nav-parent[aria-expanded="true"] { background: var(--brand-50); color: var(--brand-800); }
  .side-collapsed .sidebar .nav-label { height: 1px; margin: 10px 8px; padding: 0; overflow: hidden; font-size: 0; background: var(--line); }
  .side-collapsed .side-foot { justify-items: center; padding-top: 8px; }
  .side-collapsed .theme-switch { padding: 6px 0; justify-content: center; }
  .side-collapsed .theme-switch input { margin: 0; }
  .side-collapsed .user-card { padding: 4px 0; border: 0; background: none; justify-content: center; }
}

/* A sidebar group with a count (Approvals): keep the count beside the arrow (pm-approvals.js sets it). */
.nav-parent .count + .nav-chev { margin-left: 6px; }

/* Estimate sheet: changing an estimate the MD saw (pm-estimate.js, the user 2026-11-04 evening).
   The banner lists what changed against the sent or approved figures; the MD then approves again. */
.es-rev { align-items: flex-start; }
.es-rev .grow { min-width: 0; flex: 1; }
.es-rev > .btn { flex: none; margin-left: auto; }
.es-chg { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); display: grid; gap: 2px; }
.es-chg li { overflow-wrap: anywhere; }
.es-state .es-chg { margin-top: 8px; }
.es-was { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
.es-was b { color: var(--ink); }
@media (max-width: 640px) {
  .es-rev { flex-wrap: wrap; }
  .es-rev .grow { flex: 1 1 calc(100% - 40px); }  /* the text keeps the row; the button drops below it */
  .es-rev > .btn { margin-left: 29px; }
}
/* The estimate table scrolls inside its box on narrow screens. Its hidden header label (.sr-only,
   position: absolute) must be positioned inside that box too, or it escapes the scroll and widens the page. */
#es-sheet .table-wrap { position: relative; }
