/* Tenders — only what the design system has no class for. Loaded globally from
   base.html so it survives the hx-boost body swap. Everything is .tnd-* scoped. */

.tnd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.tnd-head__meta { color: var(--text-subtle, #667085); font-size: .875rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.tnd-countdown { text-align: right; line-height: 1.2; }
.tnd-countdown__n { font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tnd-countdown__l { font-size: .75rem; color: var(--text-subtle, #667085); }
.tnd-countdown--hot .tnd-countdown__n { color: var(--err, #b42318); }

.tnd-tabs { margin: 0 0 1rem; overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
.tnd-tabs .segmented__item { white-space: nowrap; }

/* Role cards on the wizard */
.tnd-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.tnd-role { display: block; padding: 1.5rem; border: 1px solid var(--border, #e4e7ec); border-radius: var(--radius);
  background: var(--surface, #fff); color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.tnd-role:hover { border-color: var(--brand, #6941c6); box-shadow: 0 2px 10px rgba(16, 24, 40, .06); color: inherit; }
.tnd-role h2 { font-size: 1.1rem; margin: .5rem 0 .25rem; }
.tnd-role ul { margin: .75rem 0 0; padding-left: 1.1rem; color: var(--text-subtle, #667085); font-size: .875rem; }
.tnd-role__tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--brand, #6941c6); font-weight: 600; }
.tnd-role.is-disabled { opacity: .5; pointer-events: none; }

/* Lists */
.tnd-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; padding: .85rem 1rem;
  border-bottom: 1px solid var(--border, #e4e7ec); color: inherit; text-decoration: none; }
.tnd-row:last-child { border-bottom: 0; }
a.tnd-row:hover { background: var(--surface-hover, rgba(127, 127, 127, .06)); color: inherit; }
.tnd-row__title { font-weight: 600; }
.tnd-row__sub { font-size: .8rem; color: var(--text-subtle, #667085); }
.tnd-row__side { text-align: right; font-size: .8rem; color: var(--text-subtle, #667085); }
.tnd-due--hot { color: var(--err, #b42318); font-weight: 600; }
.tnd-due--soon { color: var(--warn, #b45309); }

/* Timeline of key dates */
.tnd-timeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; }
.tnd-date { padding: .6rem .75rem; border: 1px solid var(--border, #e4e7ec); border-radius: var(--radius); }
.tnd-date__l { font-size: .75rem; color: var(--text-subtle, #667085); text-transform: none; letter-spacing: .01em; }
.tnd-date__v { font-weight: 600; font-size: .9rem; }
.tnd-date.is-past { opacity: .55; }
.tnd-date.is-next { border-color: var(--brand, #6941c6); box-shadow: inset 3px 0 0 var(--brand, #6941c6); }

/* Two-pane "inputs | output" layout used by every draft screen */
.tnd-split { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .tnd-split { grid-template-columns: 1fr; } }

.tnd-docs { list-style: none; padding: 0; margin: 0; }
.tnd-doc { display: flex; justify-content: space-between; gap: .75rem; align-items: center; padding: .55rem 0;
  border-bottom: 1px solid var(--border, #e4e7ec); }
.tnd-doc:last-child { border-bottom: 0; }
.tnd-doc__name { font-weight: 500; overflow-wrap: anywhere; }
.tnd-doc__meta { font-size: .75rem; color: var(--text-subtle, #667085); }
.tnd-doc__actions { display: flex; gap: .25rem; flex-shrink: 0; }

.tnd-pick { max-height: 220px; overflow: auto; border: 1px solid var(--border, #e4e7ec); border-radius: var(--radius-sm); padding: .4rem .6rem; }
.tnd-pick label { display: flex; gap: .4rem; font-size: .85rem; padding: .15rem 0; align-items: flex-start; }

/* Job strip */
.tnd-job { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; border-radius: var(--radius);
  border: 1px solid var(--border, #e4e7ec); margin-bottom: .5rem; font-size: .875rem; }
.tnd-job--done { border-color: rgba(3, 152, 85, .35); background: rgba(3, 152, 85, .05); }
.tnd-job--failed { border-color: rgba(180, 35, 24, .35); background: rgba(180, 35, 24, .05); }
.tnd-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border, #e4e7ec);
  border-top-color: var(--brand, #6941c6); animation: tnd-spin .8s linear infinite; flex-shrink: 0; }
@keyframes tnd-spin { to { transform: rotate(360deg); } }

/* Query cards (pre-bid) */
.tnd-q { border: 1px solid var(--border, #e4e7ec); border-radius: var(--radius); padding: .75rem .9rem; margin-bottom: .6rem;
  background: var(--surface, #fff); }
.tnd-q__head { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; font-size: .78rem; margin-bottom: .35rem; }
.tnd-q__num { font-weight: 700; color: var(--text-subtle, #667085); }
.tnd-q__question { font-weight: 500; white-space: pre-wrap; }
.tnd-q__existing { font-size: .8rem; color: var(--text-subtle, #667085); border-left: 3px solid var(--border, #e4e7ec);
  padding-left: .5rem; margin: .35rem 0; white-space: pre-wrap; }
.tnd-q textarea { font-size: .875rem; }
.tnd-q.is-dup { opacity: .7; }
.tnd-q.is-final { border-color: rgba(3, 152, 85, .45); }
.tnd-q.is-saved { animation: tnd-flash 1.2s ease-out; }
@keyframes tnd-flash { from { box-shadow: 0 0 0 3px rgba(105, 65, 198, .25); } to { box-shadow: none; } }

/* Evaluation grid + compliance matrix */
.tnd-grid { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tnd-grid th, .tnd-grid td { border-bottom: 1px solid var(--border, #e4e7ec); padding: .5rem .6rem; vertical-align: top; }
.tnd-grid thead th { position: sticky; top: 0; background: var(--surface, #fff); z-index: 1; font-size: .75rem;
  text-transform: none; letter-spacing: .01em; color: var(--text-subtle, #667085); }
.tnd-grid__crit { min-width: 260px; }
.tnd-grid__cell { min-width: 150px; }
.tnd-grid-wrap { overflow: auto; max-height: 70vh; }
.tnd-cell select { font-size: .8rem; padding: .15rem .4rem; }
.tnd-cell__ev { font-size: .75rem; color: var(--text-subtle, #667085); margin-top: .25rem; }
.tnd-cell__ev summary { cursor: pointer; }
.tnd-changed { font-size: .75rem; color: var(--warn, #b45309); margin-top: .25rem; white-space: pre-wrap; }

/* Key facts */
.tnd-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .1rem 1.25rem; }
.tnd-fact { padding: .45rem 0; border-bottom: 1px dashed var(--border, #e4e7ec); }
.tnd-fact__l { font-size: .75rem; color: var(--text-subtle, #667085); text-transform: none; letter-spacing: .01em; }
.tnd-fact__v { font-size: .875rem; }
.tnd-gng { border-radius: var(--radius); padding: 1rem 1.1rem; border: 1px solid var(--border, #e4e7ec); }
.tnd-gng--go { border-color: rgba(3, 152, 85, .45); background: rgba(3, 152, 85, .05); }
.tnd-gng--no_go { border-color: rgba(180, 35, 24, .45); background: rgba(180, 35, 24, .05); }
.tnd-gng--go_with_conditions { border-color: rgba(181, 71, 8, .45); background: rgba(181, 71, 8, .05); }
.tnd-gng__verdict { font-size: 1.1rem; font-weight: 700; }

.tnd-stream { max-height: 70vh; overflow: auto; }
.tnd-preview { white-space: pre-wrap; font-size: .82rem; max-height: 70vh; overflow: auto; background: var(--surface-muted, rgba(127, 127, 127, .05));
  border-radius: var(--radius-sm); padding: 1rem; }
.tnd-hint { font-size: .8rem; color: var(--text-subtle, #667085); }
.tnd-warn { border-left: 3px solid var(--warn, #b45309); padding: .5rem .75rem; background: rgba(181, 71, 8, .06); border-radius: var(--radius-sm); font-size: .875rem; }

/* ---- Tracker (Overview / Issuing / Bid Desk) ------------------------------ */
.tnd-head__meta svg { width: 13px; height: 13px; vertical-align: -2px; }
.tnd-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 767.98px) { .tnd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tnd-kpi { display: block; text-decoration: none; color: inherit; }
.tnd-kpi:hover { border-color: var(--brand); color: inherit; }
.tnd-kpi--hot .kpi__value { color: var(--danger, #c0362c); }
.tnd-cell-title { font-weight: 600; line-height: 1.3; }
.tnd-cell-sub { font-size: .78rem; color: var(--text-subtle, #667085); margin-top: .1rem; }
.tnd-due { font-weight: 600; font-size: .86rem; }
.tnd-due--hot { color: var(--danger, #c0362c); }
.tnd-progress { display: flex; align-items: center; gap: .45rem; min-width: 110px; }
.tnd-progress__bar { flex: 1; height: 6px; border-radius: 999px; background: var(--bg-elev-2, #eef0f3); overflow: hidden; }
.tnd-progress__bar > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.tnd-progress__n { font: 600 .74rem/1 var(--font-mono, monospace); color: var(--text-muted, #475467); }

/* ---- People & access ------------------------------------------------------ */
.tnd-people { list-style: none; margin: 0; padding: 0; }
.tnd-person { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--border, #e4e7ec); }
.tnd-person:last-child { border-bottom: 0; }
.tnd-person__av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--brand-50); color: var(--brand); font-weight: 600; font-size: .8rem; }
.tnd-person__who { flex: 1; min-width: 0; }
.tnd-person__who small { display: block; color: var(--text-subtle, #667085); }
.tnd-vis { display: grid; gap: .5rem; }
.tnd-vis label { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem .75rem; border: 1px solid var(--border, #e4e7ec);
  border-radius: var(--radius); cursor: pointer; }
.tnd-vis label:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.tnd-vis small { display: block; color: var(--text-subtle, #667085); }
