/* Tender Desk — dense, data-first UI for a bid team.
   Layout: fixed dark sidebar + scrolling content column. */

:root {
  --bg:        #f4f6f8;
  --panel:     #ffffff;
  --ink:       #16191d;
  --ink-soft:  #414852;
  --muted:     #6b7280;
  --line:      #e2e6eb;
  --line-soft: #eef1f4;

  --brand:      #1d4ed8;
  --brand-dark: #1e3a8a;
  --brand-soft: #eaf0ff;

  --good: #15803d;  --good-soft: #e7f6ec;
  --warn: #b45309;  --warn-soft: #fdf3e3;
  --bad:  #b91c1c;  --bad-soft:  #fdecec;
  --info: #0369a1;  --info-soft: #e6f4fb;

  --sidebar:      #151b26;
  --sidebar-ink:  #aab4c4;
  --sidebar-hi:   #ffffff;

  --radius: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------------------------------------------------------- layout */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px; letter-spacing: .5px;
}
.brand-text { color: var(--sidebar-hi); font-weight: 600; font-size: 15px; }

.nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 6px;
  color: var(--sidebar-ink); font-size: 13.5px;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: var(--sidebar-hi); text-decoration: none; }
.nav-link.is-active { background: var(--brand); color: #fff; font-weight: 500; }
.nav-ico { width: 16px; text-align: center; opacity: .85; }

.sidebar-foot { margin-top: auto; padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.07); }
.muted-sm { font-size: 11.5px; color: #6f7a8b; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 16px 26px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
}
.topbar h1 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.subhead { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.content { padding: 22px 26px 60px; }

/* ---------------------------------------------------------- panels */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.panel-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.panel-head .hint { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.panel-body { padding: 16px; }
.panel-body.tight { padding: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; }

/* ---------------------------------------------------------- stat cards */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat .label { color: var(--ink-soft); font-size: 11.5px; font-weight: 650;
               text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 23px; font-weight: 660; margin: 5px 0 3px; letter-spacing: -.02em; }
.stat .sub   { color: var(--muted); font-size: 12.5px; }
.stat.primary { border-left-color: var(--brand); }
.stat.good    { border-left-color: var(--good); }
.stat.warn    { border-left-color: var(--warn); }
.stat.muted   { border-left-color: var(--line); }

/* ---------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.2px; }
thead th {
  text-align: left; padding: 9px 12px;
  background: #fafbfc; border-bottom: 1px solid var(--line);
  color: var(--ink-soft); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:hover { background: #fbfcfd; }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; }

.t-title { font-weight: 550; color: var(--ink); display: block; margin-bottom: 2px; }
.t-title:hover { color: var(--brand); }
.t-meta { color: var(--muted); font-size: 12px; }

.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink-soft); margin-bottom: 5px; font-size: 15px; }

/* ---------------------------------------------------------- badges */

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 11px;
  font-size: 11.5px; font-weight: 550; white-space: nowrap;
  background: var(--line-soft); color: var(--ink-soft);
}
.badge.kind { background: var(--info-soft); color: var(--info); }

.verdict-qualified    { background: var(--good-soft); color: var(--good); }
.verdict-gap          { background: var(--warn-soft); color: var(--warn); }
.verdict-not_eligible { background: var(--bad-soft);  color: var(--bad); }
.verdict-unknown      { background: var(--line-soft); color: var(--muted); }

.cov-have           { background: var(--good-soft); color: var(--good); }
.cov-partial        { background: var(--warn-soft); color: var(--warn); }
.cov-missing        { background: var(--bad-soft);  color: var(--bad); }
.cov-planned        { background: var(--info-soft); color: var(--info); }
.cov-not_applicable { background: var(--line-soft); color: var(--muted); }

.pursuit-new       { background: var(--line-soft); color: var(--ink-soft); }
.pursuit-reviewing { background: var(--info-soft); color: var(--info); }
.pursuit-bidding   { background: var(--brand-soft); color: var(--brand); }
.pursuit-submitted { background: var(--brand-soft); color: var(--brand-dark); }
.pursuit-won       { background: var(--good-soft); color: var(--good); }
.pursuit-lost,
.pursuit-dropped   { background: var(--bad-soft); color: var(--bad); }

.due-urgent { color: var(--bad);  font-weight: 600; }
.due-soon   { color: var(--warn); font-weight: 550; }
.due-ok     { color: var(--ink-soft); }
.due-closed { color: var(--muted); text-decoration: line-through; }
.due-muted  { color: var(--muted); }

/* ---------------------------------------------------------- forms */

label { display: block; font-size: 12px; color: var(--ink-soft); font-weight: 550; margin-bottom: 4px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], input[type=tel], select, textarea {
  width: 100%; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 6px;
  font: inherit; font-size: 13px; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}
textarea { resize: vertical; min-height: 62px; }

.field { margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.check { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.check input { width: auto; }

.btn {
  display: inline-block; padding: 7px 13px;
  border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--ink); font: inherit; font-size: 13px; font-weight: 550;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f7f8fa; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { color: var(--bad); border-color: #f0d2d2; background: #fff; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.star {
  background: none; border: none; cursor: pointer;
  font-size: 16px; line-height: 1; color: #c8cdd4; padding: 2px;
}
.star.is-on { color: #eab308; }

/* filter bar */
.filters {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 18px;
}
.filters .form-grid { gap: 10px; }
.filter-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft);
}

/* Compact variant: twelve controls without a bar that dwarfs the table.
   Narrower columns, smaller type, tighter padding — nothing is removed. */
.filters.compact { padding: 9px 11px; margin-bottom: 12px; }
.filters.compact .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px 8px;
}
.filters.compact label { font-size: 10.5px; margin-bottom: 2px; letter-spacing: .01em; }
.filters.compact input[type=text],
.filters.compact select { padding: 3px 6px; font-size: 12px; border-radius: 5px; }
/* Search earns two columns; the rupee boxes need barely one. */
.filters.compact .wide   { grid-column: span 2; }
.filters.compact .narrow { max-width: 118px; }
.filters.compact .check-cell { padding-bottom: 3px; }
.filters.compact .check { font-size: 12px; gap: 5px; }
.filters.compact + .filter-foot { margin-top: 0; padding-top: 0; border-top: none; margin-bottom: 14px; }
@media (max-width: 720px) { .filters.compact .wide { grid-column: span 1; } }

/* saved views */
.views { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.views-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.view-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 9px; font-size: 12px;
}
.view-chip.is-default { border-color: var(--brand); background: var(--brand-soft); }
.view-chip a { font-weight: 550; }
.view-chip form { display: inline; }
.view-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-dark); }
.view-act {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 10.5px; color: var(--muted);
}
.view-act:hover { color: var(--ink); text-decoration: underline; }
.view-del { font-size: 14px; line-height: 1; }
.view-del:hover { color: var(--bad); text-decoration: none; }

/* pinned filters — a dashboard click landing here, shown so the list never
   looks mysteriously short with no visible reason why */
.pins {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding-bottom: 9px; margin-bottom: 9px; border-bottom: 1px solid var(--line-soft);
}
.pins-label {
  font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.pin {
  display: inline-flex; align-items: center; gap: 6px; max-width: 340px;
  background: var(--brand-soft); border: 1px solid var(--brand);
  border-radius: 999px; padding: 2px 4px 2px 9px; font-size: 12px;
}
.pin-key { color: var(--brand-dark); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.pin-val {
  font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pin-x {
  flex: none; width: 16px; height: 16px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; color: var(--brand-dark);
}
.pin-x:hover { background: var(--brand); color: #fff; text-decoration: none; }

/* ---------------------------------------------------------- misc */

.flash { padding: 10px 13px; border-radius: 6px; font-size: 13px; margin-bottom: 14px; }
.flash-ok    { background: var(--good-soft); color: var(--good); border: 1px solid #cbe8d5; }
.flash-error { background: var(--bad-soft);  color: var(--bad);  border: 1px solid #f3d4d4; }
.flash-warn  { background: var(--warn-soft); color: var(--warn); border: 1px solid #f2e0c2; }
.flash-info  { background: var(--info-soft); color: var(--info); border: 1px solid #cfe7f5; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; font-size: 13px; }
.bar-row .bar-label { width: 128px; flex: 0 0 128px; color: var(--ink-soft); }
.bar-track { flex: 1; height: 7px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 4px; }
.bar-row .bar-val { width: 46px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.split { display: flex; gap: 3px; border-radius: 6px; overflow: hidden; margin-bottom: 12px; }
.split-seg { padding: 8px 10px; font-size: 12.5px; text-align: center; flex: 1; }
.split-seg .n { display: block; font-size: 17px; font-weight: 650; }

.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); }
.pager-links { display: flex; gap: 8px; }

.kv { display: grid; grid-template-columns: 168px 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { background: var(--brand-soft); color: var(--brand-dark); padding: 2px 8px; border-radius: 4px; font-size: 12px; }

.detail-cols { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .detail-cols { grid-template-columns: 1fr; } }

.req-row.is-missing { background: #fffafa; }
.req-note { color: var(--muted); font-size: 12px; margin-top: 3px; }
.req-raw  { color: var(--ink-soft); font-size: 12px; margin-top: 4px; font-style: italic; }

.doc-child td:first-child { padding-left: 32px; }
.doc-child td:first-child::before { content: "↳ "; color: var(--muted); }

.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { width: auto; min-width: 96px; }

.htmx-request .spinner { display: inline-block; }
.spinner { display: none; font-size: 12px; color: var(--muted); }

.section-note { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }

/* ---------------------------------------------------------- read view */

.mini-head {
  font-size: 13.5px; font-weight: 700; color: var(--ink);
  margin: 20px 0 8px; letter-spacing: -.005em;
}
.mini-head:first-child { margin-top: 0; }

.tick-list { margin: 0 0 14px; padding-left: 0; list-style: none; }
.tick-list li { position: relative; padding-left: 20px; margin-bottom: 5px; }
.tick-list li::before { content: "▸"; position: absolute; left: 4px; color: var(--brand); }

.req-group + .req-group { border-top: 8px solid var(--bg); }
.req-group-head {
  padding: 12px 16px 10px;
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
}
.req-group-head h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.req-group-head .hint { color: var(--muted); font-size: 12.5px; }

.badge-must { background: var(--bad-soft); color: var(--bad); margin-left: 6px; }

/* ---------------------------------------------------------- detail page polish */

/* Stat cards hold short values only. A long value used to stretch one card and
   break the row's alignment, so the value is clamped and the detail moves to .sub. */
.stats-4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: stretch; }
.stats-4 .stat { display: flex; flex-direction: column; min-height: 118px; }
.stats-4 .stat .value {
  font-size: 22px; line-height: 1.25;
  overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.stats-4 .stat .value.val-sm { font-size: 16px; font-weight: 600; }
.stats-4 .stat .sub {
  margin-top: auto; padding-top: 6px;
  font-size: 12px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.est-tag {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--warn); background: var(--warn-soft);
  padding: 2px 5px; border-radius: 4px; margin-left: 6px; vertical-align: middle;
}

/* Body prose: a comfortable measure beats full-width lines of running text. */
.prose { margin: 0 0 14px; max-width: 68ch; color: var(--ink-soft); line-height: 1.6; }
.prose.lede { color: var(--ink); }

.warn-list li::before { content: "!"; color: var(--warn); font-weight: 700; }

/* Requirement rows: the quoted tender wording is supporting detail, not the headline. */
.req-raw { max-width: 78ch; }
.req-row td:first-child { max-width: 620px; }

/* Facts panel: label column narrow, values allowed to wrap. Rows that carry no
   information are dropped server-side rather than rendered as an em dash. */
.kv.facts { grid-template-columns: 104px 1fr; gap: 9px 14px; font-size: 13px; }
.kv.facts dt { color: var(--muted); font-weight: 500; }
.kv.facts dd { overflow-wrap: anywhere; }

/* Marks a value derived from the EMD rather than published by the portal. */
.est-dot {
  display: inline-block; margin-left: 5px; padding: 1px 4px;
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--warn); background: var(--warn-soft); border-radius: 3px;
  vertical-align: middle;
}

/* Eligibility check: whether we clear each qualifying threshold. */
.check-met     { background: var(--good-soft); color: var(--good); }
.check-short   { background: var(--bad-soft);  color: var(--bad); }
.check-unknown { background: var(--line-soft); color: var(--muted); }

/* Contacts and submission detail. */
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.contact-list li:last-child { border-bottom: none; }
.contact-list strong { display: block; font-size: 13.5px; }
.c-role { color: var(--muted); font-size: 12.5px; }

.kv.facts.two-col { grid-template-columns: 150px 1fr; margin-bottom: 4px; }

.step-list { margin: 0 0 14px; padding-left: 20px; }
.step-list li { margin-bottom: 6px; }

/* Source badge folded into the tender cell, below the descriptive meta. */
.t-source { margin-top: 6px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

/* Tender ID doubles as the link to the source portal. */
.portal-link { color: var(--brand); text-decoration: none; }
.portal-link:hover { text-decoration: underline; }

/* ---------------------------------------------------------- sign in */

/* A full-bleed panel rather than a card floating in grey: at this size a small
   white box on a near-white page reads as an unfinished page, not a form. */
.auth-body {
  display: grid; grid-template-columns: 1fr; min-height: 100vh; margin: 0;
  background: var(--sidebar);
}
@media (min-width: 900px) { .auth-body { grid-template-columns: 1.1fr 1fr; } }

.auth-aside {
  display: none; padding: 48px 52px; color: #aab4c4;
  flex-direction: column; justify-content: center;
}
@media (min-width: 900px) { .auth-aside { display: flex; } }
.auth-aside h2 {
  color: #fff; font-size: 26px; font-weight: 640; letter-spacing: -.02em;
  margin: 0 0 14px; line-height: 1.25;
}
.auth-aside p { font-size: 14px; line-height: 1.6; margin: 0 0 22px; max-width: 42ch; }
.auth-points { list-style: none; padding: 0; margin: 0; }
.auth-points li {
  position: relative; padding-left: 24px; margin-bottom: 11px;
  font-size: 13.5px; line-height: 1.5;
}
.auth-points li::before {
  content: "¹3 "; position: absolute; left: 0; top: -1px;
  color: #60a5fa; font-weight: 700;
}
.auth-points strong { color: #e8eaee; font-weight: 600; }

.auth-main {
  background: var(--panel);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
}
.auth-card { width: 100%; max-width: 380px; }

.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; }
/* The sidebar's brand text is white; on this panel it has to be ink or it
   vanishes into the background. */
.auth-brand .brand-text { color: var(--ink); font-size: 16px; }

.auth-card h1 { font-size: 24px; font-weight: 650; margin: 0 0 8px; letter-spacing: -.02em; }
.auth-note { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0 0 26px; }

.auth-form .field { margin-bottom: 16px; }
.auth-form label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.auth-form input {
  padding: 11px 13px; font-size: 14px; border-radius: 7px; border: 1px solid var(--line);
  background: #fcfcfd;
}
.auth-form input:focus { background: #fff; }
.auth-form .btn { padding: 11px 16px; font-size: 14px; margin-top: 6px; border-radius: 7px; }
.auth-foot {
  color: var(--muted); font-size: 12.5px; line-height: 1.55;
  margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line-soft);
}
.auth-form .flash { margin-bottom: 18px; }
.btn-block { display: block; width: 100%; text-align: center; }

/* who is signed in */
.who { margin-bottom: 8px; }
.who-name { font-size: 13px; font-weight: 600; color: #e8eaee; }
.who-role { font-size: 11px; color: #8a93a3; }
.who-out {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 12px; color: #8a93a3; text-decoration: underline;
}
.who-out:hover { color: #e8eaee; }

/* ---------------------------------------------------------- team */

.perm-cell { min-width: 300px; }
.perm-form { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.perm-ticks {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
  gap: 3px 12px; width: 100%;
}
.wide-ticks { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 16px; }
.perm-ticks .check { font-size: 12px; }
.row-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.row-off { opacity: .55; }

/* ---------------------------------------------------------- uploads */

input[type=file] {
  width: 100%; padding: 6px 9px; font-size: 12.5px;
  border: 1px dashed var(--line); border-radius: 6px; background: #fcfcfd;
}
input[type=file]:hover { border-color: var(--brand); background: var(--brand-soft); }

.upload-zone { border-top: 1px solid var(--line-soft); background: #fcfcfd; }
.upload-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 14px; flex-wrap: wrap;
}
.file-link { font-size: 12.5px; font-weight: 550; word-break: break-word; }

/* A secondary form that should not compete with the primary one above it. */
.subtle-form { border-top: 1px solid var(--line-soft); }
.subtle-form > summary {
  cursor: pointer; font-size: 13px; font-weight: 550; color: var(--ink-soft);
  list-style: none; padding: 2px 0;
}
.subtle-form > summary::before { content: "▸ "; color: var(--muted); }
.subtle-form[open] > summary::before { content: "▾ "; }
.subtle-form > summary:hover { color: var(--brand); }

/* ---------------------------------------------------------- gap rows */

/* Keeps the numbers readable: forms live behind a toggle instead of stacking
   three controls into every row. */
.gap-table td { vertical-align: top; }
.gap-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 5px; }

.row-tools > summary {
  cursor: pointer; list-style: none; display: inline-block;
}
.row-tools > summary::-webkit-details-marker { display: none; }
.row-tools[open] > summary { background: var(--brand-soft); border-color: var(--brand); }
.row-tools-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 9px; padding: 10px;
  border: 1px solid var(--line); border-radius: 6px; background: #fcfcfd;
}
@media (max-width: 900px) { .row-tools-body { grid-template-columns: 1fr; } }
.row-tools-body input, .row-tools-body select { width: 100%; font-size: 12px; padding: 4px 7px; }
.row-plan { border-left: 1px solid var(--line-soft); padding-left: 12px; }
@media (max-width: 900px) { .row-plan { border-left: none; padding-left: 0; } }
.tiny-label {
  display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin-bottom: 4px;
}
.mt-6 { margin-top: 6px; }

/* Google sign-in. Follows Google's identity guidance: white surface, their
   wordmark colours in the glyph, same height as the primary action. */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 16px;
  border: 1px solid var(--line); border-radius: 7px; background: #fff;
  color: var(--ink); font-size: 14px; font-weight: 550;
}
.btn-google:hover { background: #f7f8fa; border-color: #d4dae1; text-decoration: none; }
.btn-google svg { flex: 0 0 18px; }

.auth-or {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--muted); font-size: 12px;
}
.auth-or::before, .auth-or::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

/* ---------------------------------------------------------- breakdowns */

/* Four "where is the money" tables side by side. Two columns on a laptop,
   one on anything narrow — three would squeeze the value column into wrapping. */
.breakdown-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1px; background: var(--line-soft);
  border-top: 1px solid var(--line-soft);
}
.bd-card { background: var(--panel); padding: 14px 16px 16px; }
.bd-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.bd-head h3 { margin: 0; font-size: 13.5px; font-weight: 700; }
.bd-hint { color: var(--muted); font-size: 11.5px; }

/* Totals for the whole dimension, not just what fits on screen — the list below
   scrolls, so without this the eye has nothing to size the tail against. */
.bd-sum { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.bd-sum strong { color: var(--ink-soft); font-weight: 600; }

.bd-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bd-search {
  flex: 1; min-width: 0; font: inherit; font-size: 12px;
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--ink);
}
.bd-search:focus { outline: none; border-color: var(--brand); background: var(--panel); }
.bd-tally { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Every row is rendered, so the card has to be bounded — four uncapped lists
   would push "Where the money is" to several screens of scrolling. Deep enough
   to read thirty-odd rows at a glance, which is where a ranked list stops being
   a top-ten and starts being a picture of the whole market.

   The gutter is reserved whether or not the list overflows, so the column
   headings stay lined up with the numbers under them. */
.bd-scroll {
  max-height: 1020px;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-gutter: stable; overscroll-behavior: contain;
}
.bd-scroll::-webkit-scrollbar { width: 8px; }
.bd-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.bd-nohit { color: var(--muted); font-size: 12px; padding: 14px 0; text-align: center; }

.bd-cols, .bd-row {
  display: grid; grid-template-columns: 1fr 52px 92px; gap: 8px; align-items: center;
}
.bd-cols {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding-bottom: 5px; border-bottom: 1px solid var(--line-soft);
  /* Matches the scrollbar gutter below, so the headings sit over their column. */
  padding-right: 8px;
}
.bd-cols span:not(:first-child) { text-align: right; }

.bd-row {
  position: relative;
  padding: 5px 0 6px; border-bottom: 1px solid var(--line-soft);
}
.bd-row:last-of-type { border-bottom: none; }

/* Each row is a link into the tenders list, filtered to exactly what the row
   counts. */
a.bd-row { color: inherit; text-decoration: none; border-radius: 4px; cursor: pointer; }
a.bd-row:hover { background: var(--brand-soft); text-decoration: none; }
a.bd-row:hover .bd-name { color: var(--brand-dark); }
a.bd-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* `hidden` alone loses to the grid display above it. */
.bd-row[hidden] { display: none; }

.bd-name {
  font-size: 12.5px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bd-count, .bd-value {
  text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.bd-count { font-size: 12px; color: var(--muted); }
.bd-value { font-size: 12.5px; font-weight: 600; color: var(--ink); }
/* The value bar sits on the row's own bottom edge rather than on a second grid
   line of its own. Out of flow it costs no height, so a card fits half again as
   many rows — and the bar still reads as a comparison because every row's
   baseline is the same. */
.bd-track {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; border-radius: 0; overflow: hidden;
}
.bd-fill { display: block; height: 100%; background: var(--brand); border-radius: 0 2px 2px 0; }
a.bd-row:hover .bd-fill { background: var(--brand-dark); }

.bd-empty { color: var(--muted); font-size: 12.5px; padding: 18px 0; text-align: center; }

/* ---------------------------------------------------------- our company */

/* Technologies and projects, side by side. One column below a laptop —
   two 340px panes would put the project fields into wrapping. */
.pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1080px) { .pair-grid { grid-template-columns: 1fr; } }
.pair-grid .panel { margin-bottom: 0; }

.pane-foot { border-top: 1px solid var(--line-soft); background: #fcfcfd; }
.pane-foot-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 8px;
}
.pane-foot textarea { font-size: 13px; }
.pane-foot > details > summary { list-style: none; display: inline-block; cursor: pointer; }
.pane-foot > details > summary::-webkit-details-marker { display: none; }

/* Technologies as removable chips: the list is long and flat, so a table of
   one-word rows wasted most of the pane. */
.chips-lg { gap: 6px; }
.chip-del {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 5px 3px 9px; font-size: 12.5px;
}
.chip-del form { display: inline-flex; }
.chip-del button {
  background: none; border: none; cursor: pointer; padding: 0 2px;
  font: inherit; font-size: 14px; line-height: 1; color: var(--brand-dark); opacity: .45;
}
.chip-del button:hover { opacity: 1; color: var(--bad); }

/* Projects read as cards, not table rows — the description is the part that
   actually matters for a similar-work claim, and a cell would clip it. */
.proj-list { display: flex; flex-direction: column; }
.proj { position: relative; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.proj:last-child { border-bottom: none; }
.proj-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.proj-top strong { font-size: 13.5px; }
.proj-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.proj-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  color: var(--muted); font-size: 12px; margin: 4px 0 6px;
}
.proj-desc { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 7px; line-height: 1.45; }
.proj-del { position: absolute; top: 10px; right: 10px; }
.proj-del button {
  background: none; border: none; cursor: pointer; color: #c8cdd4;
  font-size: 16px; line-height: 1; padding: 2px;
}
.proj-del button:hover { color: var(--bad); }

/* One tile per document a bid always wants, replacing a seven-field form. */
.quick-docs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px;
}
.quick-doc {
  border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; background: #fff;
}
.quick-doc.is-held { border-color: #cbe8d5; background: var(--good-soft); }
.qd-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.qd-name { font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.qd-drop, .qd-replace { display: block; cursor: pointer; }
.qd-drop input, .qd-replace input { display: none; }
.qd-drop span, .qd-replace span {
  display: block; text-align: center; padding: 6px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 550;
}
.qd-drop span { border: 1px dashed var(--line); color: var(--brand); }
.qd-drop:hover span { border-color: var(--brand); background: var(--brand-soft); }
.qd-replace span { color: var(--muted); font-size: 11.5px; padding: 4px; }
.qd-replace:hover span { color: var(--ink); }
.quick-doc .file-link { display: block; margin-bottom: 4px; }

.year-upload { display: flex; align-items: center; gap: 6px; }
.year-upload input[type=file] { width: 150px; padding: 3px 6px; font-size: 11px; }

/* A whole panel folded away — the profile is set once and then never touched. */
.subtle-panel > summary {
  cursor: pointer; list-style: none;
}
.subtle-panel > summary::-webkit-details-marker { display: none; }
.subtle-panel > summary h2::before { content: "▸ "; color: var(--muted); font-weight: 400; }
.subtle-panel[open] > summary h2::before { content: "▾ "; }
.subtle-panel > summary:hover h2 { color: var(--brand); }

/* Every row listed, so the card scrolls rather than truncating. Roughly ten
   rows visible — enough to see the shape without the page becoming a wall. */
.bd-scroll { max-height: 320px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.bd-sum {
  font-size: 12px; color: var(--muted); padding-bottom: 8px;
}
.bd-sum strong { color: var(--ink); font-weight: 600; }
a.bd-row { color: inherit; text-decoration: none; }
a.bd-row:hover { background: var(--brand-soft); text-decoration: none; }
a.bd-row:hover .bd-name { color: var(--brand-dark); }

/* Filter box for a breakdown card, so one name among several hundred is
   reachable without scrolling. */
.bd-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bd-search { flex: 1; padding: 4px 8px; font-size: 12px; border-radius: 5px; }
.bd-tally { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.bd-nohit { color: var(--muted); font-size: 12.5px; padding: 14px 0; text-align: center; }
