/* =====================================================================
   Automated Sourcing Link — interface stylesheet
   Palette: navy #0f2740, gold #b99a57, cream #f7f4ee, ink #1e1c19
   No external fonts, no CDN: everything loads from this domain, which
   keeps the Content-Security-Policy strict.
   ===================================================================== */

:root {
  --navy: #0f2740;
  --navy-soft: #1b3a5c;
  --gold: #b99a57;
  --gold-pale: #efe6d2;
  --cream: #f7f4ee;
  --paper: #fffdf9;
  --ink: #1e1c19;
  --muted: #7d7568;
  --line: #ddd5c8;
  --line-soft: #ece5da;
  --green: #2f6b4f;
  --green-pale: #e7f0ea;
  --amber: #8a5a12;
  --amber-pale: #fbf0dc;
  --red: #8c2f2a;
  --red-pale: #f9e7e5;
  --radius: 4px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", "Iowan Old Style", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--gold); }

.skip {
  position: absolute; left: -999px; top: 0; background: var(--navy);
  color: #fff; padding: 10px 16px; z-index: 50;
}
.skip:focus { left: 8px; top: 8px; }

/* ------------------------------------------------------------- top bar */

.topbar {
  background: var(--navy);
  color: var(--cream);
  border-bottom: 3px solid var(--gold);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
}

.brand { text-decoration: none; color: var(--cream); display: block; }
.brand:hover .brand-name { color: var(--gold); }
.brand-name {
  display: block; font: 400 20px/1.2 var(--serif); letter-spacing: .01em;
}
.brand-tag {
  display: block; font-size: 10.5px; color: #c9b47e; margin-top: 3px;
  letter-spacing: .03em; max-width: 330px;
}

.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a {
  color: #dfd8cb; text-decoration: none; font-size: 13.5px;
  padding: 7px 11px; border-radius: var(--radius);
}
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.on { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 -2px 0 var(--gold); }

.who {
  display: flex; align-items: center; gap: 10px; padding-left: 18px;
  border-left: 1px solid rgba(255,255,255,.18); font-size: 12.5px;
}
.who-name { font-weight: 600; }
.who-meta { color: #b8b0a2; }
.linkish {
  background: none; border: 0; color: #c9b47e; cursor: pointer;
  font: inherit; padding: 0; text-decoration: underline;
}
.linkish:hover { color: #fff; }
form.inline { display: inline; margin: 0; }

/* --------------------------------------------------------------- shell */

.shell { max-width: 1240px; margin: 0 auto; padding: 26px 24px 60px; }
.shell-bare { max-width: 420px; padding-top: 8vh; }

.foot {
  max-width: 1240px; margin: 0 auto; padding: 0 24px 34px;
  font-size: 11.5px; color: var(--muted);
}
.foot .dot { margin: 0 7px; }

/* --------------------------------------------------------------- heads */

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
h1 { font: 400 27px/1.25 var(--serif); margin: 0; letter-spacing: -.01em; }
h2 { font: 400 19px/1.3 var(--serif); margin: 0 0 12px; }
h3 { font: 600 13px/1.4 var(--sans); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.lede { color: var(--muted); margin: 6px 0 0; font-size: 14px; max-width: 62ch; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }
.ref { font-family: var(--mono); font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }

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

.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin-bottom: 18px;
}
.card-tight { padding: 16px 18px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.card-head h2 { margin: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }

@media (max-width: 980px) {
  .split, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------- stats */

.stat {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
}
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat-value { font: 400 26px/1.2 var(--serif); margin-top: 6px; }
.stat-value small { font-size: 13px; color: var(--muted); }

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

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font: 600 11px/1.4 var(--sans); text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); background: #faf7f1;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fdfbf7; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tfoot td { background: #faf7f1; font-weight: 600; border-top: 2px solid var(--line); }
table.data td.strong { font-weight: 600; }
table.data caption {
  text-align: left; padding: 12px; font-size: 12px; color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
}

.empty { padding: 34px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }
.empty strong { display: block; color: var(--ink); font: 400 17px var(--serif); margin-bottom: 6px; }

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

.badge {
  display: inline-block; font: 600 10.5px/1 var(--sans); letter-spacing: .05em;
  text-transform: uppercase; padding: 5px 8px; border-radius: 2px;
  background: #eee9e0; color: #5f574b; white-space: nowrap;
}
.badge-open { background: var(--green-pale); color: var(--green); }
.badge-draft { background: #eee9e0; color: #6b6355; }
.badge-closed { background: var(--amber-pale); color: var(--amber); }
.badge-awarded { background: var(--navy); color: #f3eee3; }
.badge-cancelled { background: var(--red-pale); color: var(--red); }
.badge-issued { background: var(--amber-pale); color: var(--amber); }
.badge-ack { background: var(--green-pale); color: var(--green); }
.badge-gold { background: var(--gold-pale); color: #6d5321; }

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

.field { margin-bottom: 16px; }
.field > label, .label {
  display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: #5f574b; margin-bottom: 6px;
}
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.req { color: var(--red); }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; color: var(--ink);
  font: 14px/1.5 var(--sans);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold);
}
input[readonly] { background: #f4f1ea; color: var(--muted); }
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; background-image: none; }

.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > .field { flex: 1 1 180px; margin-bottom: 0; }

.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; }
.check input { margin-top: 3px; }

.btn {
  display: inline-block; background: var(--navy); color: #f6f1e7; border: 1px solid var(--navy);
  padding: 10px 18px; border-radius: var(--radius); font: 600 13.5px/1.4 var(--sans);
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--navy-soft); color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { background: #f2ede4; color: var(--navy); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #23180a; }
.btn-gold:hover { background: #a78a4a; color: #1b1206; }
.btn-danger { background: transparent; border-color: #d8b3ae; color: var(--red); }
.btn-danger:hover { background: var(--red-pale); color: var(--red); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------- flashes */

.flashes { margin-bottom: 18px; }
.flash {
  border-left: 3px solid var(--navy); background: var(--paper);
  border: 1px solid var(--line); border-left-width: 3px;
  padding: 11px 14px; border-radius: 2px; font-size: 13.5px; margin-bottom: 8px;
}
.flash-success { border-left-color: var(--green); background: var(--green-pale); }
.flash-error { border-left-color: var(--red); background: var(--red-pale); }
.flash-info { border-left-color: var(--gold); background: var(--amber-pale); }

/* ----------------------------------------------------------- meta list */

dl.meta { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; font-size: 13.5px; }
dl.meta dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
dl.meta dd { margin: 0; }

.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--gold);
  background: #fdfaf3; padding: 14px 16px; font-size: 13.5px; margin-bottom: 16px;
}
.callout strong { display: block; margin-bottom: 4px; }
.callout-warn { border-left-color: var(--amber); background: var(--amber-pale); }
.callout-ok { border-left-color: var(--green); background: var(--green-pale); }

/* ---------------------------------------------------------- login page */

.login-card {
  background: var(--paper); border: 1px solid var(--line);
  border-top: 3px solid var(--gold); border-radius: var(--radius);
  padding: 30px 28px;
}
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .lede { margin-bottom: 22px; }
.login-mark { text-align: center; margin-bottom: 22px; }
.login-mark .brand-name { color: var(--navy); font-size: 22px; }
.login-mark .brand-tag { color: var(--muted); max-width: none; }
.login-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 16px; }

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

.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 13px; }
.pager a, .pager span { padding: 5px 10px; border: 1px solid var(--line); border-radius: 2px; text-decoration: none; }
.pager .off { color: #b6afa2; }
.mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.best { background: var(--green-pale); }
.best-price { color: var(--green); font-weight: 700; }
.cover-low { color: var(--amber); }
.cover-high { color: var(--green); }
.line-pick { width: 30px; }
hr.rule { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

@media print {
  .topbar, .foot, .actions, .nav, .who { display: none !important; }
  .card { border: 0; padding: 0; }
  body { background: #fff; }
}


.btn-block { width: 100%; text-align: center; }
.card-narrow { max-width: 560px; }
.card-mid { max-width: 760px; }

/* ---------------------------------------------------------- utilities
   Small spacing and layout helpers, so no template needs a style="" --
   the Content-Security-Policy blocks inline styles by design. */
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-14 { margin-top: 14px; }
.mt-18 { margin-top: 18px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-6 { margin-bottom: 6px; } .mb-10 { margin-bottom: 10px; }
.mb-16 { margin-bottom: 16px; } .mb-22 { margin-bottom: 22px; }
.meta-single { grid-template-columns: 1fr; }
.w-full { width: 100%; }
.stack-tight > * + * { margin-top: 8px; }

/* ------------------------------------------------- lists used in sidebars */
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li {
  padding: 9px 0; border-bottom: 1px solid var(--line-soft);
}
.plain-list li:last-child { border-bottom: 0; padding-bottom: 0; }

.offer-list { list-style: none; margin: 0; padding: 0; font-variant-numeric: tabular-nums; }
.offer-list li {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  padding: 3px 6px; border-radius: 2px;
}
.offer-list li.best { background: var(--green-pale); }

/* ---------------------------------------------------- quotation rows */
/* A line a supplier has chosen not to quote. Dimmed, and its price input
   is disabled by the script, but still visible so the decision is explicit. */
tr.row-off td { opacity: .45; }
tr.row-off td:first-child { opacity: 1; }

/* ---------------------------------------------------------- admin tools */
.row-tools { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.temp-pw {
  font-family: var(--mono); font-size: 19px; letter-spacing: .06em;
  background: var(--navy); color: #f6f1e7; padding: 12px 16px;
  border-radius: var(--radius); display: inline-block; margin-top: 4px;
  user-select: all;
}

/* -------------------------------------------------------- terms clauses */
.clause { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.clause:last-of-type { border-bottom: 0; }
.clause p { margin: 0; color: #3b3730; }
.clause-title {
  font: 600 13px/1.4 var(--sans); text-transform: none; letter-spacing: 0;
  color: var(--navy); margin: 0 0 5px;
}

/* --------------------------------------------------------- account page */
.session-row { padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.session-row:last-child { border-bottom: 0; }

/* -------------------------------------------------- inline role selector */
.inline-select {
  display: inline-block; width: auto; min-width: 110px;
  padding: 4px 8px; font-size: 12.5px; margin-right: 6px;
}

/* ----------------------------------------------------- deliveries */
.receipt { border-top: 1px solid var(--line-soft); padding-top: 12px; margin-top: 12px; }
.receipt:first-of-type { border-top: 0; }
.receipt-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; flex-wrap: wrap; }

/* ------------------------------------------------ loss reason rows */
.loser-row { border-top: 1px solid var(--line-soft); padding-top: 12px; margin-top: 12px; }
.loser-row:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.loser-name { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }

/* ------------------------------------------------- commodity labels */
.label-input { min-width: 200px; }

/* ------------------------------------------------- read-only values */
.readonly-box { background: #f4f1ea; border: 1px solid var(--line); border-radius: 6px;
  padding: 9px 11px; font-size: 13.5px; color: #4a443b; min-height: 38px; line-height: 1.5; }

/* ------------------------------------------------- terms body */
.terms-read summary { cursor: pointer; font-size: 13px; color: var(--ink-2); }
.terms-body { white-space: pre-wrap; font-family: inherit; font-size: 12.5px; line-height: 1.6;
  background: #f7f4ee; border: 1px solid var(--line); border-radius: 6px; padding: 12px;
  margin: 10px 0 0; max-height: 420px; overflow: auto; color: #4a443b; }
