/* ============================================================
   TXA Quote Desk — application stylesheet
   Design tokens: navy #0f2b46 / TXA red #c62a2a / surface white
   No framework, no build step. Every UI class lives here.
   ============================================================ */

:root {
  --navy-950: #081527;
  --navy-900: #0b1f33;
  --navy-800: #0f2b46;
  --navy-700: #12395c;
  --navy-100: #dce8f2;
  --red-600: #c62a2a;
  --red-700: #a32222;
  --red-50: #fdf1f1;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --line: #e4e8ee;
  --line-strong: #cdd5df;
  --txt: #1b2530;
  --dim: #5a6472;
  --faint: #8a94a2;
  --ok-700: #0f7b4f;
  --ok-50: #e9f7f0;
  --warn-700: #92580a;
  --warn-50: #fdf3e2;
  --bad-700: #a32c2c;
  --bad-50: #fdefef;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 8px 28px rgba(11, 31, 51, .16);
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font: 14.5px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

h1, h2, h3 { letter-spacing: -0.01em; }

/* ------------------------------------------------------------
   App header (authenticated chrome)
   ------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 26px;
  height: 58px;
  padding: 0 26px;
  background: linear-gradient(90deg, var(--navy-950), var(--navy-800) 55%, var(--navy-700));
  border-bottom: 3px solid var(--red-600);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .01em;
  text-decoration: none;
}
.brand:hover { text-decoration: none; opacity: .92; }

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--red-600);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18);
  flex: none;
}

.brand-sub {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, .62);
  border-left: 1px solid rgba(255, 255, 255, .22);
  padding-left: 10px;
  letter-spacing: .02em;
  white-space: nowrap;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}
.topnav a {
  color: rgba(255, 255, 255, .78);
  font-size: 13.5px;
  padding: 7px 12px;
  border-radius: 7px;
  text-decoration: none;
}
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, .10); text-decoration: none; }

.topbar .who {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.who-name { color: #fff; font-size: 13px; font-weight: 600; }

.role-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.role-admin { background: var(--red-600); color: #fff; }
.role-sales { background: rgba(255, 255, 255, .16); color: #dbe7f1; }
.role-tech  { background: #274b6d; color: #dbe7f1; }

.topbar .btn.ghost { color: rgba(255, 255, 255, .78); border-color: rgba(255, 255, 255, .25); }
.topbar .btn.ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* ------------------------------------------------------------
   Layout
   ------------------------------------------------------------ */

.page {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 26px 64px;
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 26px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--faint);
  font-size: 12px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--navy-950);
}
.page-title .mono { font-size: 20px; color: var(--navy-700); }

.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  color: var(--dim);
  font-size: 13px;
}

.small { font-size: 12.5px; }
.muted { color: var(--dim); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

.table-card { padding: 0; overflow: hidden; }

.empty {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  color: var(--dim);
  margin: 14px 0;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--txt);
  font: 600 13.5px/1.2 var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
  white-space: nowrap;
}
.btn:hover { background: #f6f8fb; border-color: #b8c2cf; text-decoration: none; }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 2px solid var(--navy-700); outline-offset: 2px; }

.btn.primary {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}
.btn.primary:hover { background: var(--navy-700); border-color: var(--navy-700); }

.btn.accent {
  background: var(--red-600);
  border-color: var(--red-600);
  color: #fff;
}
.btn.accent:hover { background: var(--red-700); border-color: var(--red-700); }

.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.ghost:hover { background: #eef1f5; color: var(--txt); }

.btn.danger { background: var(--bad-50); border-color: #f0c4c4; color: var(--bad-700); }
.btn.danger:hover { background: #fbe0e0; }

.btn.small { padding: 5px 11px; font-size: 12.5px; }

/* ------------------------------------------------------------
   Tables
   ------------------------------------------------------------ */

.table-scroll { overflow-x: auto; border-radius: var(--radius); }

table.lines {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 13.5px;
}
table.lines thead th {
  background: var(--navy-800);
  color: #e8f0f7;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 11px 14px;
  white-space: nowrap;
}
table.lines tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #eef1f5;
  vertical-align: middle;
}
table.lines tbody tr:nth-child(even) { background: #fafbfd; }
table.lines tbody tr:hover { background: #f2f6fb; }
table.lines tbody tr:last-child td { border-bottom: none; }
table.lines td.col-money, table.lines th.col-money { text-align: right; }
table.lines td.col-no, table.lines th.col-no { width: 44px; color: var(--faint); }
table.lines td.col-qty, table.lines th.col-qty { text-align: center; width: 90px; }
table.lines td.mono { font-weight: 600; color: var(--navy-800); }

.table-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ------------------------------------------------------------
   Quote page
   ------------------------------------------------------------ */

.quote-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.quote-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.quote-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.summary {
  position: sticky;
  top: 78px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.summary .sum-title {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}
.sum-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 5px 0;
  font-size: 13.5px;
}
.sum-row .num { font-variant-numeric: tabular-nums; }
.sum-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: var(--navy-950);
}
.sum-total .num { font-family: var(--mono); font-size: 19px; }
.sum-sep { height: 1px; background: var(--line); margin: 10px 0; }
.sum-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 4px 0 6px;
}
.basis-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.basis-list li {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  color: var(--dim);
}

.footnote { color: var(--dim); font-size: 12.5px; margin: 12px 2px 4px; }
.footnote.muted { color: var(--faint); }

/* ------------------------------------------------------------
   Pills / badges / flash
   ------------------------------------------------------------ */

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  vertical-align: middle;
}
.pill-draft, .pill-void { background: #eef1f5; color: var(--dim); border-color: var(--line); }
.pill-review { background: var(--warn-50); color: var(--warn-700); border-color: #f3ddb5; }
.pill-review_requested { background: var(--warn-50); color: var(--warn-700); border-color: #f3ddb5; }
.pill-sent { background: var(--ok-50); color: var(--ok-700); border-color: #bfe8d4; }
.pill-superseded { background: #f4f4f6; color: var(--faint); border-color: var(--line); }

.flash {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy-700);
  background: #f2f7fc;
  color: var(--txt);
  padding: 11px 14px;
  margin: 12px 0;
  font-size: 13.5px;
}
.flash.good { border-left-color: var(--ok-700); background: var(--ok-50); }
.flash.bad { border-left-color: var(--bad-700); background: var(--bad-50); }
.flash.warn { border-left-color: var(--warn-700); background: var(--warn-50); }
.flash.note { border-left-color: var(--line-strong); background: #f7f9fb; color: var(--dim); }

/* ------------------------------------------------------------
   Forms
   ------------------------------------------------------------ */

.field { margin: 14px 0; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--txt);
  margin-bottom: 6px;
}
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="tel"], .field input[type="url"], .field select, .field textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--txt);
  font: 14px/1.4 var(--font);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235a6472' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.field textarea { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(18, 57, 92, .14);
}
.field .req { color: var(--red-600); margin-left: 2px; }
.field-hint { color: var(--faint); font-size: 12px; margin-top: 5px; }
.field-error { color: var(--bad-700); font-size: 12.5px; margin-top: 5px; font-weight: 600; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad-700); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.pin-input {
  font-family: var(--mono);
  font-size: 20px;
  letter-spacing: .5em;
  text-align: center;
  padding-left: 0.5em;
}

/* chips (multi-select) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--dim);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: all .12s ease;
  position: relative;
}
.chip:hover { border-color: var(--navy-700); color: var(--navy-800); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
  font-weight: 600;
}

/* ------------------------------------------------------------
   Login (split brand layout)
   ------------------------------------------------------------ */

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  min-height: calc(100vh - 200px);
  padding: 20px 0 40px;
}

.login-brand {
  background: linear-gradient(150deg, var(--navy-950) 0%, var(--navy-800) 60%, var(--navy-700) 100%);
  border-radius: 16px;
  color: #fff;
  padding: 44px 42px;
  position: relative;
  overflow: hidden;
  min-height: 430px;
  display: flex;
  flex-direction: column;
}
.login-brand::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198, 42, 42, .35), transparent 65%);
}
.login-brand .brand-mark { width: 38px; height: 38px; font-size: 13px; border-radius: 9px; }
.login-brand h2 {
  font-size: 26px;
  line-height: 1.25;
  margin: 26px 0 10px;
  letter-spacing: -0.015em;
}
.login-brand p { color: rgba(255, 255, 255, .72); font-size: 14px; margin: 0 0 26px; max-width: 340px; }
.login-brand ul { list-style: none; margin: 0; padding: 0; }
.login-brand li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 0;
  color: rgba(255, 255, 255, .88);
  font-size: 13.5px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.login-brand li b { color: #fff; font-weight: 600; }
.login-brand .tick { color: #ff9d9d; font-weight: 700; }
.login-brand .brand-foot { margin-top: auto; padding-top: 24px; color: rgba(255, 255, 255, .5); font-size: 12px; }

.login-wrap { display: flex; justify-content: center; }
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 30px 30px 26px;
  border-top: 4px solid var(--red-600);
}
.login-card .page-title { font-size: 20px; }
.login-submit { width: 100%; margin-top: 18px; padding: 11px; font-size: 14px; }
.login-help { color: var(--faint); font-size: 12px; text-align: center; margin: 14px 0 0; }

/* ------------------------------------------------------------
   Dropdown menu (details)
   ------------------------------------------------------------ */

.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { background: #f6f8fb; border-color: #b8c2cf; }
.menu-body {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 30;
}
.menu-body a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--txt);
  font-size: 13.5px;
}
.menu-body a:hover { background: #f2f6fb; text-decoration: none; }

/* ------------------------------------------------------------
   Dialog
   ------------------------------------------------------------ */

dialog.dialog {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  width: min(480px, calc(100vw - 40px));
}
dialog.dialog::backdrop { background: rgba(8, 21, 39, .5); }
dialog.dialog h2 { margin: 0 0 6px; font-size: 17px; }
dialog.dialog label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; }
dialog.dialog textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px; font: 14px/1.5 var(--font); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ------------------------------------------------------------
   History / admin tables
   ------------------------------------------------------------ */

.admin-filters-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.inline-form { display: inline; }

/* ------------------------------------------------------------
   Public (supplier) pages
   ------------------------------------------------------------ */

body.public { background: var(--bg); }

.public-top {
  background: linear-gradient(90deg, var(--navy-950), var(--navy-800) 55%, var(--navy-700));
  border-bottom: 3px solid var(--red-600);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 26px;
}
.public-top .brand {
  color: #fff;
  font-size: 16.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.public-top .muted { color: rgba(255, 255, 255, .62); font-size: 12.5px; }

.public-main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px 70px;
}

.supplier-hero {
  background: linear-gradient(150deg, var(--navy-950), var(--navy-800) 65%, var(--navy-700));
  /* Same width as the .supplier-card blocks below: no negative side margins.
     A bleeding banner reads as "misaligned" next to the cards, not as a hero. */
  border-radius: var(--radius);
  color: #fff;
  margin: 0 0 18px;
  padding: 30px 28px 28px;
  position: relative;
  overflow: hidden;
}
.supplier-hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198, 42, 42, .4), transparent 65%);
}
.supplier-hero .eyebrow {
  color: #ff9d9d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.supplier-h1 {
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  line-height: 1.15;
}
.supplier-lede { color: rgba(255, 255, 255, .8); font-size: 15px; margin: 0; max-width: 560px; }

.supplier-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px;
  margin-bottom: 18px;
}
.supplier-card > h3 { margin: 0 0 4px; font-size: 15px; color: var(--navy-950); }
.supplier-card > .hint { margin: 0 0 14px; }

.supplier-form .chips-field { margin: 14px 0; }
.supplier-offline {
  background: var(--warn-50);
  border: 1px solid #f3ddb5;
  color: var(--warn-700);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin: 12px 0;
}
.supplier-submit {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  background: var(--navy-800);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s ease;
}
.supplier-submit:hover { background: var(--navy-700); }
.supplier-submit:disabled { opacity: .55; cursor: wait; }
.supplier-optin {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--dim);
  margin: 14px 0 18px;
}
.supplier-optin input { margin-top: 3px; }

.public-foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 26px;
  font-size: 12px;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 900px) {
  .quote-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
  .login-shell { grid-template-columns: 1fr; gap: 18px; }
  .login-brand { min-height: 0; padding: 28px 26px; }
  .login-brand ul { display: none; }
  .login-brand h2 { font-size: 21px; margin-top: 16px; }
}

@media (max-width: 640px) {
  .page { padding: 18px 16px 50px; }
  .topbar { padding: 0 14px; gap: 12px; }
  .brand-sub { display: none; }
  .topnav a { padding: 6px 8px; font-size: 12.5px; }
  .who-name { display: none; }
  .quote-head { flex-direction: column; align-items: stretch; }
  .quote-actions { width: 100%; }
  .quote-actions .btn, .quote-actions form { flex: 1; }
  .quote-actions form .btn { width: 100%; }
  .field-row { grid-template-columns: 1fr; }
  .supplier-hero { margin: 0 0 16px; padding: 24px 18px; }
  .supplier-h1 { font-size: 24px; }
  .supplier-card { padding: 20px 18px; }
  .card { padding: 16px; }
  .table-card { padding: 0; }
  .public-top { padding: 14px 16px; }
}

/* ------------------------------------------------------------
   Addenda: quote table controls, summary heading, honeypot
   ------------------------------------------------------------ */

.summary h2 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}

.dagger { color: var(--red-600); font-weight: 700; margin-left: 2px; }

table.lines input.qty {
  width: 78px;
  height: 34px;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font: 600 13.5px var(--mono);
  color: var(--txt);
  background: #fff;
}
table.lines input.qty:focus {
  outline: none;
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(18, 57, 92, .14);
}

fieldset.chips-field { border: none; padding: 0; margin: 14px 0; }
fieldset.chips-field legend {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--txt);
  padding: 0;
  margin-bottom: 8px;
}

.hp { position: absolute !important; left: -10000px !important; top: auto !important; width: 1px; height: 1px; overflow: hidden; }

.quote-banner {
  border-radius: var(--radius-sm);
  border: 1px solid #cfe0ef;
  background: #eef5fb;
  color: var(--navy-800);
  padding: 11px 14px;
  font-size: 13.5px;
  margin: 0 0 16px;
}

/* T07 confirmation grid: confidence states */
tr.row-low > td {
  background: #fdf3d7;
}
tr.row-unmatched > td {
  background: #fde2e2;
}

/* ============================================================
   v2 — document layout, mobile cards, intake composer
   ============================================================ */

/* --- quotation document header --- */
.doc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.doc-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--red-600);
}
.doc-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.doc-no {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy-950);
}
.doc-sub { margin: 8px 0 0; color: var(--dim); font-size: 14px; }
.doc-sub b { color: var(--txt); font-weight: 600; }

/* --- meta grid --- */
.doc-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.doc-meta > div {
  padding: 12px 16px;
  border-right: 1px solid var(--line);
}
.doc-meta > div:last-child { border-right: none; }
.doc-meta dt {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}
.doc-meta dd { margin: 0; font-size: 14px; color: var(--txt); }

/* --- quantity bar: the layout the client flagged --- */
.table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}
.table-actions .hint {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.45;
}
.table-actions .btn { flex: none; }

/* --- intake composer --- */
.intake-head { margin-bottom: 18px; }
.intake-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy-950);
}
.intake-sub { margin: 0; color: var(--dim); font-size: 14px; max-width: 640px; }
.intake-card { padding: 22px; }
.intake-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 8px;
}
.intake-textarea {
  width: 100%;
  min-height: 220px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: 14.5px/1.65 var(--font);
  color: var(--txt);
  background: #fff;
  resize: vertical;
}
.intake-textarea:focus {
  outline: none;
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(18, 57, 92, .14);
}
.dropzone {
  margin-top: 14px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fafbfd;
  padding: 26px 20px;
  text-align: center;
  color: var(--dim);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--navy-700); background: #f4f8fc; }
.dropzone.is-over { border-color: var(--red-600); background: var(--red-50); }
.dz-icon { color: var(--navy-700); margin-bottom: 8px; }
.dz-title { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--txt); }
.dz-sub { margin: 0; font-size: 12.5px; color: var(--faint); }
.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;
}
.file-chips { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  background: #eef3f9;
  border: 1px solid #d8e2ee;
  font-size: 12.5px;
}
.file-chip-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-size { color: var(--faint); font-variant-numeric: tabular-nums; }
.file-chip-x {
  border: none; background: #dfe8f3; color: var(--dim);
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 14px; line-height: 1; cursor: pointer;
}
.file-chip-x:hover { background: var(--red-600); color: #fff; }
.intake-note { margin: 12px 0 0; font-size: 12px; color: var(--faint); }
.intake-actions { margin-top: 16px; display: flex; justify-content: flex-end; }
.intake-submit { padding: 12px 26px; font-size: 14.5px; }

/* ============================================================
   Mobile — the salesperson's primary device
   ============================================================ */

@media (max-width: 760px) {
  .doc-head { gap: 14px; }
  .doc-no { font-size: 24px; }
  .quote-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .quote-actions .menu, .quote-actions form { width: 100%; }
  .quote-actions .menu > summary, .quote-actions .btn { width: 100%; }
  .doc-meta { grid-template-columns: 1fr 1fr; }
  .doc-meta > div { border-bottom: 1px solid var(--line); }
  .doc-meta > div:nth-child(2n) { border-right: none; }
  .doc-meta > div:nth-last-child(-n+2) { border-bottom: none; }

  /* table becomes a stack of cards: no horizontal scrolling on a phone */
  .table-card { background: transparent; border: none; box-shadow: none; }
  .table-card .table-scroll { overflow: visible; }
  table.lines { background: transparent; }
  table.lines thead { display: none; }
  table.lines, table.lines tbody, table.lines tr, table.lines td { display: block; width: 100%; }
  table.lines tr {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    padding: 8px 0 6px;
    position: relative;
  }
  table.lines tbody tr:nth-child(even) { background: var(--surface); }
  table.lines tbody tr:hover { background: var(--surface); }
  table.lines td {
    border: none;
    padding: 5px 16px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    text-align: right;
    font-size: 14px;
  }
  table.lines td::before {
    content: attr(data-label);
    flex: none;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--faint);
    text-align: left;
  }
  table.lines td.col-no { display: none; }
  table.lines td[data-label]:nth-child(2) {
    display: block;
    text-align: left;
    font-size: 16px;
    padding-top: 2px;
  }
  table.lines td[data-label]:nth-child(2)::before { display: none; }
  table.lines td[data-label]:nth-child(3) {
    display: block;
    text-align: left;
    color: var(--dim);
    font-size: 13px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--line);
    margin-bottom: 4px;
  }
  table.lines td[data-label]:nth-child(3)::before { display: none; }
  table.lines input.qty { width: 88px; height: 38px; font-size: 15px; }

  .table-actions { flex-direction: column-reverse; align-items: stretch; border-top: none; }
  .table-actions .btn { width: 100%; padding: 11px; }

  .summary { margin-top: 4px; }
  .sum-total .num { font-size: 22px; }

  .intake-card { padding: 16px; }
  .intake-title { font-size: 22px; }
  .intake-textarea { min-height: 170px; }
  .intake-actions { position: sticky; bottom: 0; padding: 10px 0; background: linear-gradient(180deg, transparent, var(--bg) 40%); }
  .intake-submit { width: 100%; padding: 14px; }
  .dropzone { padding: 20px 14px; }
}

/* ============================================================
   v2 — document layout, mobile cards, intake composer
   ============================================================ */

/* --- quotation document header --- */
.doc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.doc-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--red-600);
}
.doc-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.doc-no {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy-950);
}
.doc-sub { margin: 8px 0 0; color: var(--dim); font-size: 14px; }
.doc-sub b { color: var(--txt); font-weight: 600; }

/* --- meta grid --- */
.doc-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.doc-meta > div {
  padding: 12px 16px;
  border-right: 1px solid var(--line);
}
.doc-meta > div:last-child { border-right: none; }
.doc-meta dt {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}
.doc-meta dd { margin: 0; font-size: 14px; color: var(--txt); }

/* --- quantity bar: the layout the client flagged --- */
.table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}
.table-actions .hint {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.45;
}
.table-actions .btn { flex: none; }

/* --- intake composer --- */
.intake-head { margin-bottom: 18px; }
.intake-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy-950);
}
.intake-sub { margin: 0; color: var(--dim); font-size: 14px; max-width: 640px; }
.intake-card { padding: 22px; }
.intake-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 8px;
}
.intake-textarea {
  width: 100%;
  min-height: 220px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: 14.5px/1.65 var(--font);
  color: var(--txt);
  background: #fff;
  resize: vertical;
}
.intake-textarea:focus {
  outline: none;
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(18, 57, 92, .14);
}
.dropzone {
  margin-top: 14px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fafbfd;
  padding: 26px 20px;
  text-align: center;
  color: var(--dim);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--navy-700); background: #f4f8fc; }
.dropzone.is-over { border-color: var(--red-600); background: var(--red-50); }
.dz-icon { color: var(--navy-700); margin-bottom: 8px; }
.dz-title { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--txt); }
.dz-sub { margin: 0; font-size: 12.5px; color: var(--faint); }
.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;
}
.file-chips { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  background: #eef3f9;
  border: 1px solid #d8e2ee;
  font-size: 12.5px;
}
.file-chip-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-size { color: var(--faint); font-variant-numeric: tabular-nums; }
.file-chip-x {
  border: none; background: #dfe8f3; color: var(--dim);
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 14px; line-height: 1; cursor: pointer;
}
.file-chip-x:hover { background: var(--red-600); color: #fff; }
.intake-note { margin: 12px 0 0; font-size: 12px; color: var(--faint); }
.intake-actions { margin-top: 16px; display: flex; justify-content: flex-end; }
.intake-submit { padding: 12px 26px; font-size: 14.5px; }

/* ============================================================
   Mobile — the salesperson's primary device
   ============================================================ */

@media (max-width: 760px) {
  .doc-head { gap: 14px; }
  .doc-no { font-size: 24px; }
  .quote-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .quote-actions .menu, .quote-actions form { width: 100%; }
  .quote-actions .menu > summary, .quote-actions .btn { width: 100%; }
  .doc-meta { grid-template-columns: 1fr 1fr; }
  .doc-meta > div { border-bottom: 1px solid var(--line); }
  .doc-meta > div:nth-child(2n) { border-right: none; }
  .doc-meta > div:nth-last-child(-n+2) { border-bottom: none; }

  /* table becomes a stack of cards: no horizontal scrolling on a phone */
  .table-card { background: transparent; border: none; box-shadow: none; }
  .table-card .table-scroll { overflow: visible; }
  table.lines { background: transparent; }
  table.lines thead { display: none; }
  table.lines, table.lines tbody, table.lines tr, table.lines td { display: block; width: 100%; }
  table.lines tr {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    padding: 8px 0 6px;
    position: relative;
  }
  table.lines tbody tr:nth-child(even) { background: var(--surface); }
  table.lines tbody tr:hover { background: var(--surface); }
  table.lines td {
    border: none;
    padding: 5px 16px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    text-align: right;
    font-size: 14px;
  }
  table.lines td::before {
    content: attr(data-label);
    flex: none;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--faint);
    text-align: left;
  }
  table.lines td.col-no { display: none; }
  table.lines td[data-label]:nth-child(2) {
    display: block;
    text-align: left;
    font-size: 16px;
    padding-top: 2px;
  }
  table.lines td[data-label]:nth-child(2)::before { display: none; }
  table.lines td[data-label]:nth-child(3) {
    display: block;
    text-align: left;
    color: var(--dim);
    font-size: 13px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--line);
    margin-bottom: 4px;
  }
  table.lines td[data-label]:nth-child(3)::before { display: none; }
  table.lines input.qty { width: 88px; height: 38px; font-size: 15px; }

  .table-actions { flex-direction: column-reverse; align-items: stretch; border-top: none; }
  .table-actions .btn { width: 100%; padding: 11px; }

  .summary { margin-top: 4px; }
  .sum-total .num { font-size: 22px; }

  .intake-card { padding: 16px; }
  .intake-title { font-size: 22px; }
  .intake-textarea { min-height: 170px; }
  .intake-actions { position: sticky; bottom: 0; padding: 10px 0; background: linear-gradient(180deg, transparent, var(--bg) 40%); }
  .intake-submit { width: 100%; padding: 14px; }
  .dropzone { padding: 20px 14px; }
}

/* --- mobile overflow fixes (390px viewport) --- */
@media (max-width: 760px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .topbar {
    gap: 10px;
    padding: 0 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .topbar::-webkit-scrollbar { display: none; }
  .topbar .brand span:not(.brand-mark) { display: none; }
  .topbar .topnav { margin-left: 0; gap: 0; }
  .topbar .topnav a { padding: 6px 8px; font-size: 12px; }
  .topbar .who { display: none; }
  .doc-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-actions > * { min-width: 0; }
}

@media (max-width: 560px) {
  .topnav a[href="/admin/suppliers"] { display: none; }
  .quote-actions { grid-template-columns: 1fr; }
  .quote-actions .btn, .quote-actions .menu > summary { padding: 11px 12px; }
}

/* --- mobile nav: two rows, no page-level overflow --- */
@media (max-width: 900px) {
  .topbar {
    height: auto;
    min-height: 92px;
    flex-wrap: wrap;
    align-content: center;
    row-gap: 6px;
    padding: 8px 12px;
    overflow: visible;
  }
  .topbar .brand { order: 1; }
  .topbar .who { display: none; }
  .topbar .topnav {
    order: 3;
    width: 100%;
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .topbar .topnav::-webkit-scrollbar { display: none; }
  .topbar .topnav a { flex: none; }
  .topbar .topnav .inline-form { margin-left: auto; flex: none; }
  .page { padding-top: 18px; }
}

/* --- clamp every block to the viewport on phones --- */
@media (max-width: 760px) {
  .page, .page > *, .quote-grid, .quote-grid > *, .card, .doc-meta, .doc-meta > div,
  .summary, .table-card, .table-scroll { min-width: 0; max-width: 100%; }
  .doc-meta dt, .doc-meta dd { overflow-wrap: anywhere; word-break: break-word; }
  table.lines td { min-width: 0; }
  table.lines td .num, table.lines td.num { flex: 0 1 auto; }
}

/* --- bottom tab bar (mobile primary navigation) --- */
.tabbar { display: none; }

@media (max-width: 900px) {
  .topnav { display: none; }
  .topbar { min-height: 56px; height: 56px; flex-wrap: nowrap; }
  .brand-name { display: inline; font-size: 15px; }
  .brand-sub { display: none; }
  .topbar .who { display: flex; margin-left: auto; }
  .who-name { display: none; }
  .role-badge { display: none; }
  .topbar .btn.small { padding: 7px 10px; font-size: 12px; }

  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -6px 20px rgba(11, 31, 51, .07);
  }
  .tabbar a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 9px 2px 8px;
    color: var(--faint);
    text-decoration: none;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .01em;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a:active { background: #f2f6fb; }
  .tabbar a.is-active { color: var(--navy-800); }
  .tabbar a.is-active::before {
    content: "";
    position: absolute;
    top: 0; left: 22%; right: 22%;
    height: 2.5px;
    border-radius: 0 0 3px 3px;
    background: var(--red-600);
  }
  .tabbar a.is-active svg { stroke: var(--navy-800); }

  .foot { padding-bottom: 18px; }
}

@media (max-width: 380px) {
  .tabbar a { font-size: 9.5px; }
  .tabbar a svg { width: 19px; height: 19px; }
}

/* --- bottom tab bar (mobile primary navigation) --- */
.tabbar { display: none; }

@media (max-width: 900px) {
  .topnav { display: none; }
  .topbar { min-height: 56px; height: 56px; flex-wrap: nowrap; }
  .brand-name { display: inline; font-size: 15px; }
  .brand-sub { display: none; }
  .topbar .who { display: flex; margin-left: auto; }
  .who-name { display: none; }
  .role-badge { display: none; }
  .topbar .btn.small { padding: 7px 10px; font-size: 12px; }

  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -6px 20px rgba(11, 31, 51, .07);
  }
  .tabbar a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 9px 2px 8px;
    color: var(--faint);
    text-decoration: none;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .01em;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a:active { background: #f2f6fb; }
  .tabbar a.is-active { color: var(--navy-800); }
  .tabbar a.is-active::before {
    content: "";
    position: absolute;
    top: 0; left: 22%; right: 22%;
    height: 2.5px;
    border-radius: 0 0 3px 3px;
    background: var(--red-600);
  }
  .tabbar a.is-active svg { stroke: var(--navy-800); }

  .foot { padding-bottom: 18px; }
}

@media (max-width: 380px) {
  .tabbar a { font-size: 9.5px; }
  .tabbar a svg { width: 19px; height: 19px; }
}

/* --- mobile header: single row, tab bar owns navigation --- */
@media (max-width: 900px) {
  .topbar {
    height: 56px;
    min-height: 56px;
    flex-wrap: nowrap;
    overflow: visible;
    padding: 0 14px;
    gap: 10px;
  }
  .topbar .brand { order: 0; }
  .topbar .brand-name { display: inline; }
  .topbar .topnav { display: none !important; order: 0; width: auto; overflow: visible; }
  .topbar .who { order: 2; margin-left: auto; }
}

/* --- glass tab bar: auto-hide on scroll, spring back when idle --- */
@media (max-width: 900px) {
  .tabbar {
    background: rgba(250, 251, 253, .72);
    -webkit-backdrop-filter: blur(22px) saturate(190%);
    backdrop-filter: blur(22px) saturate(190%);
    border-top: 1px solid rgba(255, 255, 255, .65);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .85),
      0 -1px 0 rgba(15, 43, 70, .07),
      0 -12px 32px rgba(11, 31, 51, .10);
    transform: translateY(0);
    opacity: 1;
    transition:
      transform .46s cubic-bezier(.32, 1.28, .58, 1),
      opacity .28s ease;
    will-change: transform, opacity;
  }
  .tabbar.is-hidden {
    transform: translateY(calc(100% + 10px));
    opacity: .65;
    transition:
      transform .26s cubic-bezier(.4, 0, 1, 1),
      opacity .2s ease;
  }
  .tabbar a.is-active::before {
    box-shadow: 0 0 10px rgba(198, 42, 42, .35);
  }
}

/* translucent frosted layer only where the browser supports it */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tabbar { background: rgba(255, 255, 255, .98); }
}

@media (prefers-reduced-motion: reduce) {
  .tabbar, .tabbar.is-hidden { transition: none; }
}

/* --- glass tab bar: auto-hide on scroll, spring back when idle --- */
@media (max-width: 900px) {
  .tabbar {
    background: rgba(250, 251, 253, .72);
    -webkit-backdrop-filter: blur(22px) saturate(190%);
    backdrop-filter: blur(22px) saturate(190%);
    border-top: 1px solid rgba(255, 255, 255, .65);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .85),
      0 -1px 0 rgba(15, 43, 70, .07),
      0 -12px 32px rgba(11, 31, 51, .10);
    transform: translateY(0);
    opacity: 1;
    transition:
      transform .46s cubic-bezier(.32, 1.28, .58, 1),
      opacity .28s ease;
    will-change: transform, opacity;
  }
  .tabbar.is-hidden {
    transform: translateY(calc(100% + 10px));
    opacity: .65;
    transition:
      transform .26s cubic-bezier(.4, 0, 1, 1),
      opacity .2s ease;
  }
  .tabbar a.is-active::before {
    box-shadow: 0 0 10px rgba(198, 42, 42, .35);
  }
}

/* translucent frosted layer only where the browser supports it */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tabbar { background: rgba(255, 255, 255, .98); }
}

@media (prefers-reduced-motion: reduce) {
  .tabbar, .tabbar.is-hidden { transition: none; }
}

/* --- parsed-line editor (inquiry confirmation) --- */
.line-editor { table-layout: fixed; }
.line-editor th.col-no { width: 46px; }
.line-editor th.col-step { width: 178px; }
.line-editor th.col-unit { width: 132px; }
.line-editor th.col-conf { width: 108px; }
.line-editor th.col-raw { width: 190px; }
.line-editor td { padding: 9px 10px; vertical-align: middle; }

.cell-input,
.cell-select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 0 11px;
  font: 14px/1.2 var(--font);
  color: var(--txt);
  background: #fff;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.cell-input.mono { font-family: var(--mono); font-weight: 600; letter-spacing: .01em; }
.cell-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235a6472' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}
.cell-input:focus,
.cell-select:focus {
  outline: none;
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(18, 57, 92, .14);
}

/* quantity stepper */
.stepper {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
}
.stepper .step {
  flex: none;
  width: 38px;
  border: none;
  background: #f3f7fb;
  color: var(--navy-800);
  font: 600 17px/1 var(--font);
  cursor: pointer;
  transition: background .1s ease;
}
.stepper .step:hover { background: #e5eef8; }
.stepper .step:active { background: #d7e5f4; }
.stepper .step:focus-visible { outline: 2px solid var(--navy-700); outline-offset: -3px; }
.stepper .qty-input {
  border: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
  text-align: center;
  min-width: 0;
  font-family: var(--mono);
  font-weight: 600;
}
.stepper .qty-input:focus { box-shadow: inset 0 0 0 2px rgba(18, 57, 92, .18); }

.line-editor tr.row-low > td:first-child { box-shadow: inset 3px 0 0 #d99b2b; }
.line-editor tr.row-unmatched > td:first-child { box-shadow: inset 3px 0 0 var(--red-600); }
.line-editor tr.row-unmatched .cell-input[name^="part_no"] { border-color: #e8b4b4; background: #fffafa; }
.customer-row { margin-top: 18px; }

@media (max-width: 760px) {
  .line-editor { table-layout: auto; }
  .line-editor thead { display: none; }
  .line-editor, .line-editor tbody, .line-editor tr, .line-editor td {
    display: block;
    width: auto;
  }
  .line-editor tr {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 10px 14px 12px;
    margin-bottom: 10px;
  }
  .line-editor tbody tr:nth-child(even) { background: var(--surface); }
  .line-editor td { padding: 5px 0; }
  .line-editor td::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 4px;
  }
  .line-editor td.col-no {
    font-size: 11px;
    font-weight: 700;
    color: var(--faint);
    letter-spacing: .08em;
    padding-bottom: 2px;
  }
  .line-editor td.col-no::before { display: inline; margin-right: 6px; }
  .line-editor td.col-raw { font-size: 12px; color: var(--faint); line-height: 1.4; }
  .line-editor .cell-input,
  .line-editor .cell-select { height: 44px; font-size: 15px; }
  .customer-row { grid-template-columns: 1fr; }
}

/* --- inquiry draft notice + wider description column --- */
.line-editor th.col-part { width: 172px; }
.line-editor th.col-conf { width: 96px; }
.line-editor th.col-raw { width: 158px; }
.draft-note {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: #f2f7fc;
  border: 1px solid #d8e6f3;
  color: var(--navy-800);
  font-size: 12.5px;
}

/* --- inquiry draft notice + wider description column --- */
.line-editor th.col-part { width: 172px; }
.line-editor th.col-conf { width: 96px; }
.line-editor th.col-raw { width: 158px; }
.draft-note {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: #f2f7fc;
  border: 1px solid #d8e6f3;
  color: var(--navy-800);
  font-size: 12.5px;
}

/* Quote page: live repricing feedback (debounced fetch after a qty edit). */
.summary.is-loading {
  opacity: 0.6;
  transition: opacity 0.15s ease;
}
.summary.is-flash {
  animation: summary-flash 300ms ease;
}
@keyframes summary-flash {
  from {
    background: #fff7e0;
  }
  to {
    background: transparent;
  }
}

/* Supplier form: attachment dropzone and chips. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.dropzone {
  border: 1.5px dashed #c9ccd4;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  background: #fafbfc;
}
.dropzone.is-dragover {
  border-color: #c62a2a;
  background: #fff5f5;
}
.dropzone-hint {
  margin: 0 0 10px;
  color: #5b6270;
  font-size: 13px;
}
.file-chips {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eef1f5;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12.5px;
}
.chip-remove {
  border: 0;
  background: transparent;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: #5b6270;
}
.qr-thumb {
  display: block;
  width: 60px;
  height: 60px;
}
.file-links {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
}
.detail-row > td {
  background: #fafbfc;
}

/* A4 scan cards (admin print page). */
.print-sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8mm;
}
.print-card {
  border: 1px solid #d5d8de;
  border-radius: 8px;
  padding: 6mm;
  text-align: center;
  break-inside: avoid;
  page-break-inside: avoid;
}
.print-qr {
  width: 40mm;
  height: 40mm;
  display: block;
  margin: 4mm auto;
}
.print-code {
  font-size: 20px;
  letter-spacing: 2px;
  margin: 2mm 0 1mm;
}
.print-owner {
  font-weight: 600;
  margin: 0;
}
@media print {
  .topbar,
  .foot,
  .print-toolbar {
    display: none !important;
  }
  .page {
    padding: 0;
  }
  .print-sheet {
    gap: 6mm;
  }
  .print-card {
    border-color: #bbb;
  }
  @page {
    size: A4;
    margin: 12mm;
  }
}

/* Send dialog: a real form field look (44px, rounded, focus ring). */
.dialog .field {
  margin: 12px 0;
}
.dialog .field label {
  display: block;
  font-size: 12.5px;
  color: #5b6270;
  margin-bottom: 6px;
}
.dialog .field input {
  width: 100%;
  height: 44px;
  border: 1px solid #c9ccd4;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  box-sizing: border-box;
}
.dialog .field textarea {
  width: 100%;
  border: 1px solid #c9ccd4;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  box-sizing: border-box;
  resize: vertical;
}
.dialog .field input:focus,
.dialog .field textarea:focus {
  outline: none;
  border-color: #c62a2a;
  box-shadow: 0 0 0 3px rgba(198, 42, 42, 0.15);
}
.versions-card .table-scroll {
  overflow-x: auto;
}

/* Compose (B stage): provenance tags, catalog list, line remove button. */
.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef1f5;
  color: #5b6270;
  font-size: 11px;
  vertical-align: middle;
}
.line-remove {
  border: 0;
  background: transparent;
  color: #8a909b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}
.line-remove:hover {
  color: #c62a2a;
}
.catalog-results {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #e3e6ec;
  border-radius: 8px;
}
.catalog-results li {
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid #f0f2f6;
  cursor: pointer;
}
.catalog-results li:last-child {
  border-bottom: 0;
}
.catalog-results li.is-selected {
  background: #fff1f1;
}
.dialog .field label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #1a1a1a;
}

/* Price check page and the admin price-override control. */
.price-search input {
  height: 52px;
  font-size: 18px;
  border-radius: 10px;
}
.price-table td {
  vertical-align: middle;
}
.price-table input.qty {
  width: 90px;
  height: 36px;
}
.menu-body .menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 9px 12px;
  font-size: 13.5px;
  color: #1a1a1a;
  cursor: pointer;
}
.menu-body .menu-item:hover {
  background: #f4f6f9;
}
.menu-body .menu-item:disabled {
  color: #a9aeb8;
  cursor: default;
}
.line-price {
  border: 1px solid #d5d8de;
  background: #fff;
  color: #0f2b46;
  font-size: 12px;
  line-height: 1;
  border-radius: 6px;
  padding: 4px 7px;
  margin-right: 4px;
  cursor: pointer;
}
.line-price:hover {
  border-color: #c62a2a;
  color: #c62a2a;
}
.tag-override {
  background: #fdf3d7;
  color: #8a6d1f;
}

/* Batch 2: inline admin details (resolve / reset PIN) and wrapping cells. */
.inline-details {
  display: inline-block;
  position: relative;
}
.inline-details > summary {
  list-style: none;
  cursor: pointer;
}
.inline-details > summary::-webkit-details-marker {
  display: none;
}
.inline-details[open] > summary {
  margin-bottom: 8px;
}
.resolve-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 240px;
  padding: 10px;
  border: 1px solid #e3e6ec;
  border-radius: 8px;
  background: #fbfcfd;
}
.resolve-form textarea,
.resolve-form input {
  width: 100%;
  border: 1px solid #c9ccd4;
  border-radius: 6px;
  padding: 8px;
  font-size: 13px;
}
.wrap-cell {
  max-width: 280px;
  white-space: normal;
}

/* Parts catalogue: laid out like the printed PDF pages, not an admin table. */
.catalog-head {
  align-items: flex-end;
}
.catalog-meta {
  display: flex;
  gap: 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.catalog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.catalog-filters .catalog-search {
  flex: 1 1 260px;
  height: 38px;
  border: 1px solid #c9ccd4;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
}
.catalog-filters select {
  height: 38px;
  border: 1px solid #c9ccd4;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  background: #fff;
}
.catalog-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #3c4250;
}
.catalog-sheet {
  border: 1px solid #e3e6ec;
  border-radius: 6px;
  background: #fff;
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.catalog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.catalog-table th {
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10.5px;
  font-weight: 600;
  color: #6b7280;
  padding: 8px 10px;
  border-bottom: 1px solid #d5d8de;
  background: #f7f8fa;
  white-space: nowrap;
}
.catalog-table td {
  height: 38px;
  padding: 0 10px;
  border-bottom: 1px solid #eef0f4;
  vertical-align: middle;
}
.catalog-table tbody tr:nth-child(even) td {
  background: #fbfbfc;
}
.catalog-table .mono {
  white-space: nowrap;
}
.catalog-txa {
  color: #5b6270;
}
.catalog-desc {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}
.catalog-fam,
.catalog-series,
.catalog-sub {
  color: #4b5261;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.catalog-price {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.catalog-rfq {
  color: #9aa0aa;
  font-size: 12px;
}
.catalog-action {
  text-align: right;
  white-space: nowrap;
}
.catalog-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 4px;
}
@media (max-width: 720px) {
  /* The sheet scrolls sideways; the page itself must never widen. */
  .catalog-sheet {
    max-width: calc(100vw - 32px);
  }
  .catalog-filters .catalog-search {
    flex: 1 1 100%;
  }
  .catalog-table {
    font-size: 11.5px;
  }
  .catalog-table th,
  .catalog-table td {
    padding: 0 8px;
  }
  .catalog-desc {
    max-width: 150px;
  }
  .catalog-fam,
  .catalog-series {
    display: none;
  }
}

/* The catalogue table may be wider than a phone; the page must not be. */
.catalog-head {
  flex-wrap: wrap;
  gap: 8px;
}
body:has(.catalog-sheet) {
  overflow-x: hidden;
}

/* Full product browser at /price: catalogue look, phone-first columns. */
.no-price-dash {
  display: none;
}
.price-list-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 0 5px;
  border-radius: 4px;
  background: #f0f1f4;
  color: #8a909b;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.price-table {
  table-layout: fixed;
}
.price-table .col-part {
  width: 16%;
}
.price-table .col-txa {
  width: 18%;
}
.price-table .col-brand {
  width: 14%;
}
.price-table .col-engine {
  width: 12%;
}
.price-table .catalog-price {
  width: 10%;
}
.price-table .catalog-action {
  width: 8%;
}
.price-table .catalog-desc {
  max-width: none;
  white-space: normal;
  line-height: 1.25;
  padding-top: 6px;
  padding-bottom: 6px;
}
@media (max-width: 720px) {
  .price-table .col-txa,
  .price-table .col-brand,
  .price-table .col-engine {
    display: none;
  }
  .price-table .col-part {
    width: 24%;
    white-space: normal;
    word-break: break-all;
  }
  .price-table th {
    white-space: nowrap;
    font-size: 9.5px;
    letter-spacing: 0.04em;
  }
  .price-table .catalog-price {
    width: 18%;
    padding-right: 8px;
  }
  .price-table .catalog-action {
    width: 30%;
    font-size: 11px;
    white-space: normal;
    line-height: 1.2;
  }
  /* Phones: the PRICE column already says RFQ, so the action cell stays a dash. */
  .price-table .no-price-text {
    display: none;
  }
  .price-table .no-price-dash {
    display: inline;
  }
  .price-table .catalog-action .btn.small {
    width: 100%;
    padding: 4px 6px;
  }
  .price-table {
    table-layout: fixed;
  }
  .price-table th,
  .price-table td {
    padding: 4px 6px;
  }
}

/* --- queue row actions: reference on the left, buttons flush right --- */
.queue-cell-actions { width: 340px; }
.queue-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  white-space: nowrap;
}
.queue-buttons { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-left: auto; }
.queue-actions .btn { min-width: 0; }
.queue-actions .btn.primary { padding-left: 14px; padding-right: 14px; }
.queue-actions .quote-no { font-size: 12px; color: var(--faint); margin-left: 2px; }
table.lines td .queue-actions .btn.small { height: 30px; padding: 0 12px; font-size: 12.5px; }

/* every select shares the custom chevron, dialogs included */
select, .cell-select, .field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235a6472' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}

@media (max-width: 760px) {
  .queue-cell-actions { width: auto; }
  .queue-actions { gap: 8px; }
  .queue-buttons { gap: 6px; }
}

/* --- inquiry parsing spinner --- */
.parsing-line { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.spinner {
  width: 16px; height: 16px; flex: 0 0 auto;
  border: 2px solid rgba(20, 40, 80, .18);
  border-top-color: #1f3b66;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* --- unpriced lines on a blocked quotation --- */
tr.line-unpriced > td { background: #fff4f4; }
tr.line-unpriced > td:first-child { box-shadow: inset 3px 0 0 #c0392b; }
tr.line-unpriced .mono { color: #8c1d18; font-weight: 600; }
.no-price-chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: #fde2e1; color: #97211b; font-size: 11.5px; font-weight: 700;
  letter-spacing: .02em;
}
.unpriced-hint { display: block; margin-top: 4px; font-weight: 600; }

/* --- unpriced lines on a blocked quotation --- */
tr.line-unpriced > td { background: #fff4f4; }
tr.line-unpriced > td:first-child { box-shadow: inset 3px 0 0 #c0392b; }
tr.line-unpriced .mono { color: #8c1d18; font-weight: 600; }
.no-price-chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: #fde2e1; color: #97211b; font-size: 11.5px; font-weight: 700;
  letter-spacing: .02em;
}
.unpriced-hint { display: block; margin-top: 4px; font-weight: 600; }

/* --- defect list inside the blocked banner --- */
.blocked-defects { display: block; }
.defect-list { margin: 8px 0 0; padding-left: 18px; }
.defect-list li { margin: 4px 0; line-height: 1.5; }
.defect-line { font-weight: 700; margin-right: 6px; }
.defect-part {
  display: inline-block; margin-right: 6px; padding: 1px 6px;
  border-radius: 4px; background: #fbd9d7; color: #8c1d18; font-weight: 700;
}
.defect-reason { color: #5c1a16; }

/* Inquiry queue: the price column (hidden on phones). */
.queue-rfq {
  color: #c0392b;
  font-size: 11px;
  white-space: nowrap;
}
.blocked-unpriced .unpriced-details {
  margin-top: 6px;
}
.blocked-unpriced .unpriced-details summary {
  cursor: pointer;
  font-size: 12px;
  color: #5b6270;
}
@media (max-width: 720px) {
  .queue-price {
    display: none;
  }
}

/* Web prices and the price-gap progress bar. */
.price-web {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 4px;
  background: #eef1f5;
  color: #7a8290;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.gap-bar {
  height: 8px;
  border-radius: 999px;
  background: #eef1f5;
  overflow: hidden;
  margin: 8px 0 10px;
}
.gap-bar span {
  display: block;
  height: 100%;
  background: #0f2b46;
  transition: width 0.3s ease;
}
.gap-line {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: #4b5261;
}

/* printed badge cards: the encoded URL must be visible so a wrong base is caught before printing */
.print-url { font-size: 9px; color: #5a6472; word-break: break-all; margin: 2px 0 0; }

/* printed badge cards: the encoded URL must be visible so a wrong base is caught before printing */
.print-url { font-size: 9px; color: #5a6472; word-break: break-all; margin: 2px 0 0; }

/* a suggestion far from its category bench is usually the wrong part, not a bargain */
.deviation-high { color: #97211b; font-weight: 700; }
.deviation-high::after { content: " !"; }

/* a suggestion far from its category bench is usually the wrong part, not a bargain */
.deviation-high { color: #97211b; font-weight: 700; }
.deviation-high::after { content: " !"; }

/* Price suggestion source tags. */
.source-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.source-alibaba {
  background: #0f2b46;
  color: #fff;
}
.source-other {
  background: #eef1f5;
  color: #7a8290;
}

/* ------------------------------------------------------------
   Quote table: inline price edit + summary explainer
   ------------------------------------------------------------ */

/* The unit price itself is the button. The small "$" at the row end stays for
   discoverability, but a salesperson points at the number they want to change. */
.price-edit {
  all: unset;
  cursor: pointer;
  border-bottom: 1px dashed rgba(31, 78, 121, .45);
  padding-bottom: 1px;
}
.price-edit:hover { border-bottom-color: var(--navy-700); color: var(--navy-800); }
.price-edit:focus-visible { outline: 2px solid var(--navy-700); outline-offset: 3px; }

/* "6% off orders over $40,000" under "Volume discount": the rule behind the number. */
.sum-hint {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--dim);
  font-weight: 500;
}

/* TXA catalogue number on a quotation line: fixed-width and never wrapped -
   a broken part number reads as a different part number. */
table.lines .col-txa {
  width: 128px;
  white-space: nowrap;
  font-size: 12px;
  color: var(--dim);
}

/* ============================================================
   Brand entry (unauthenticated) — V2 design pack
   Scoped to body.brand-entry: nothing here can leak into the
   signed-in workbench, and no existing selector is redefined.
   ============================================================ */
body.brand-entry {
  background: #F4F7FB;
  color: #344861;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- white brand header ---- */
.entry-head {
  background: #fff;
  border-bottom: 1px solid #E6EDF5;
  position: relative;
  z-index: 20;
}
.entry-head-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
  height: 78px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.entry-logo { display: inline-flex; align-items: center; }
.entry-logo img { width: 150px; height: auto; display: block; }
.entry-head-meta { display: flex; align-items: center; gap: 16px; }
.entry-head-rule {
  width: 1px; height: 34px; background: #DCE4EE; display: block;
}
.entry-head-lines { display: flex; flex-direction: column; gap: 3px; line-height: 1.15; }
.entry-head-lines b {
  font-size: 11.5px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: #C91E2C;
}
.entry-head-lines span { font-size: 13px; color: #60718A; }
.entry-signin {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  background: #fff;
  border: 1px solid #DCE4EE;
  border-radius: 8px;
  color: #10365F; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.entry-signin:hover { border-color: #B9CBE0; background: #F7FAFD; }
.entry-signin:focus-visible, .entry-submit:focus-visible {
  outline: 2px solid #2167AC; outline-offset: 2px;
}

/* ---- navy hero ---- */
.entry-hero {
  background: linear-gradient(135deg, #061733 0%, #0B2444 55%, #10365F 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.entry-hero-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 78px 32px 84px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 64px;
  align-items: center;
  position: relative;
  z-index: 2;
}
.entry-watermark {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 560px;
  opacity: .05;
  filter: brightness(0) invert(1);
  pointer-events: none;
  user-select: none;
  z-index: 1;
}
.entry-eyebrow {
  margin: 0 0 18px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #FF8D8D;
}
.entry-eyebrow.is-red { color: #C91E2C; }
.entry-title {
  margin: 0 0 20px;
  font-size: 46px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}
.entry-lede {
  margin: 0 0 40px;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .76);
  max-width: 46ch;
}
.entry-signature {
  width: 168px;
  height: auto;
  display: block;
  opacity: .94;
  filter: brightness(0) invert(1);
}

.entry-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.entry-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px;
  background: #17375A;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 10px;
}
.entry-card-icon {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  color: rgba(255, 255, 255, .82);
}
.entry-card-text { display: flex; flex-direction: column; gap: 5px; }
.entry-card-text b { font-size: 16px; font-weight: 600; color: #fff; }
.entry-card-text span {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .74);
}

/* ---- pale support band ---- */
.entry-band {
  background: #F4F7FB;
  flex: 1;
  display: flex;
  flex-direction: column;
  /* The band is the page's free space: centre its content and keep the footer
     anchored to the bottom of the viewport. */
  justify-content: center;
}
.entry-band-inner {
  max-width: 1440px;
  padding-bottom: 64px;
  /* width:100% matters: with auto side margins a flex item is NOT stretched in
     the cross axis, so the band content collapsed to its content width. */
  width: 100%;
  margin: 0 auto;
  padding: 60px 32px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}
.entry-band-copy h2 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #10365F;
}
.entry-band-copy p:not(.entry-eyebrow) {
  margin: 0;
  font-size: 14px;
  color: #60718A;
}
.entry-band-logo { width: 150px; height: auto; opacity: .95; }


/* ---- sign-in panel: compact, deep navy, no white card ---- */
.entry-panel {
  position: fixed;
  top: 96px;
  right: max(32px, calc((100vw - 1440px) / 2 + 32px));
  width: 352px;
  max-width: calc(100vw - 32px);
  background: #0B2340;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(6, 23, 51, .38);
  padding: 20px 22px 22px;
  z-index: 40;
  color: #fff;
}
/* Without JS the panel stays visible; with JS it starts closed. */
.js .entry-panel:not(.is-open) { display: none; }

.entry-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.entry-panel-head h2 { margin: 0; font-size: 18px; font-weight: 600; color: #fff; }
.entry-panel-close {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .7);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 6px;
  cursor: pointer;
}
.entry-panel-close:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.entry-panel-hint {
  margin: 6px 0 16px;
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .66);
}
.entry-field { margin-bottom: 14px; }
.entry-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .74);
}
.entry-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 7px;
  color: #fff;
  font: inherit;
  font-size: 14px;
}
.entry-field input:focus {
  outline: none;
  border-color: #5C9BD8;
  box-shadow: 0 0 0 3px rgba(33, 103, 172, .35);
  background: rgba(255, 255, 255, .1);
}
.entry-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #2167AC;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s ease;
}
.entry-submit:hover { background: #17568E; }
.entry-panel-foot {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .5);
}
.entry-error {
  margin: 0 0 14px;
  padding: 9px 11px;
  background: rgba(201, 30, 44, .2);
  border: 1px solid rgba(255, 128, 138, .45);
  border-radius: 7px;
  color: #FFD9DC;
  font-size: 12.5px;
  line-height: 1.45;
}

/* ---- tablet ---- */
@media (max-width: 1024px) {
  .entry-hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 60px 32px 64px;
  }
  .entry-title { font-size: 40px; }
  .entry-lede { margin-bottom: 28px; }
  .entry-signature { width: 148px; }
  /* Stacked layout puts the cards across the full width: a ghost logo behind
     them reads as a smudge around the cards rather than as a watermark. */
  .entry-watermark { display: none; }
  .entry-band-inner { padding-top: 48px; }
  .entry-band-copy h2 { font-size: 26px; }
}

/* ---- phone ---- */
@media (max-width: 640px) {
  .entry-head-inner { height: 66px; padding: 0 16px; gap: 12px; }
  .entry-logo img { width: 112px; }
  /* Logo + sign-in only: the tagline wraps to two lines and squeezes the
     button at 375px, which is worse than dropping it. */
  .entry-head-meta { display: none; }
  .entry-head-lines b { font-size: 10.5px; letter-spacing: .1em; }
  .entry-signin { min-height: 40px; padding: 0 12px; font-size: 12.5px; }
  .entry-hero-inner { padding: 44px 16px 48px; gap: 32px; }
  .entry-title { font-size: 31px; }
  .entry-lede { font-size: 14px; margin-bottom: 24px; }
  .entry-signature { width: 132px; }
  .entry-watermark { display: none; }
  .entry-card { padding: 16px; gap: 12px; }
  .entry-card-text b { font-size: 15px; }
  .entry-band-inner { padding: 40px 16px 48px; flex-direction: column; gap: 24px; }
  .entry-band-copy h2 { font-size: 23px; }
  .entry-band-logo { width: 120px; }
  .entry-panel {
    top: 74px;
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
  }
}

/* ============================================================
   V3 shell — signed-in workbench (rail + topbar + drawer)
   Scope: body.app. Nothing here touches the brand entry page.
   ============================================================ */
body.app {
  display: block;
  background: #F4F7FB;
  font-size: 14px;
  line-height: 1.55;
}
.shell { display: flex; min-height: 100vh; }
.shell-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---- 236px navy rail ---- */
.side {
  flex: 0 0 236px;
  width: 236px;
  background: #081A34;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px 16px;
  box-sizing: border-box;
}
.side-brand { display: block; padding: 4px 8px 0; }
.side-brand img {
  width: 150px; height: auto; display: block;
  filter: brightness(0) invert(1);
}
.side-tag {
  margin: 12px 8px 18px;
  display: flex; flex-direction: column; gap: 2px;
  line-height: 1.2;
}
.side-tag b {
  font-size: 10px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: #FF8D8D;
}
.side-tag span { font-size: 11.5px; color: rgba(255, 255, 255, .55); }

.side-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.side-heading {
  margin: 16px 8px 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .42);
}
.side-heading:first-child { margin-top: 0; }
.side-nav a {
  display: flex; align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  color: rgba(255, 255, 255, .8);
  font-size: 13.5px;
  text-decoration: none;
  transition: background .16s ease, color .16s ease;
}
.side-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.side-nav a.is-active {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #C91E2C;
}
.side-nav a:focus-visible { outline: 2px solid #6FA8DC; outline-offset: 2px; }

.side-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.side-who { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.side-who .who-name {
  font-size: 13px; font-weight: 600; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-out { margin: 0; }
.side-out .btn { min-height: 34px; padding: 0 12px; font-size: 12.5px; }

/* ---- top bar ---- */
body.app .topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-bottom: 1px solid #E4EAF2;
  border-top: 0;
  box-shadow: none;
  color: var(--txt);
}
body.app .topbar-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #60718A;
}
body.app .topbar .who { margin-left: auto; gap: 10px; }
body.app .topbar .who-name { color: var(--navy-900); font-size: 13px; }
.burger {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border: 1px solid #DCE4EE;
  border-radius: 8px;
  background: #fff;
  color: var(--navy-800);
  cursor: pointer;
}
.burger:focus-visible { outline: 2px solid #2167AC; outline-offset: 2px; }
.topbar-brand { display: none; }
.scrim {
  position: fixed; inset: 0;
  background: rgba(6, 23, 51, .45);
  z-index: 50;
}

/* ---- page rhythm ---- */
body.app .page {
  max-width: 1240px;
  padding: 32px 32px 72px;
}
body.app .page-title {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  color: #081A34;
}
body.app .doc-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #C91E2C;
  margin: 0 0 8px;
}
body.app .meta { font-size: 13px; color: #60718A; }
body.app .page > .card,
body.app .page > .table-card { margin-top: 20px; }
body.app .card {
  border-radius: 12px;
  border: 1px solid #E4EAF2;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  padding: 24px;
}
body.app .card + .card { margin-top: 20px; }
body.app .foot {
  padding: 18px 32px;
  color: #8A94A2;
  font-size: 12px;
  background: #fff;
}

/* ---- controls ---- */
body.app .btn {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
body.app .btn.small { min-height: 34px; padding: 0 12px; font-size: 12.5px; }
body.app .btn.primary { background: #2167AC; border-color: #2167AC; color: #fff; }
body.app .btn.primary:hover { background: #17568E; border-color: #17568E; }
body.app .btn:focus-visible { outline: 2px solid #2167AC; outline-offset: 2px; }
body.app .field > label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #344861;
  margin-bottom: 6px;
}
body.app .field input:not([type="checkbox"]):not([type="radio"]),
body.app .field select,
body.app .field textarea {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid #DCE4EE;
  background: #fff;
  font-size: 14px;
  padding: 10px 12px;
}
body.app .field textarea { min-height: 120px; }
body.app .field input:focus, body.app .field select:focus, body.app .field textarea:focus {
  outline: none;
  border-color: #2167AC;
  box-shadow: 0 0 0 3px rgba(33, 103, 172, .16);
}

/* ---- tables ---- */
body.app table.lines thead th,
body.app .price-table thead th {
  padding: 13px 16px;
  font-size: 11px;
  letter-spacing: .08em;
  background: #0B2440;
}
body.app table.lines tbody td,
body.app .price-table tbody td {
  padding: 15px 16px;
  font-size: 13.5px;
}
body.app table.lines, body.app .price-table { font-size: 13.5px; }
body.app .table-card { padding: 0; overflow: hidden; }
body.app .table-scroll, body.app .catalog-sheet { border-radius: 12px; }

/* ---- filters / toolbars ---- */
body.app .catalog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 18px 20px;
}
body.app .catalog-search { flex: 1 1 320px; min-width: 220px; }
body.app .catalog-filters select { min-height: 44px; }

/* ---- dialogs ---- */
body.app .dialog {
  border-radius: 12px;
  max-width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow: auto;
}

/* ---- responsive: drawer below 1280 ---- */
@media (max-width: 1279px) {
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform .18s ease;
    box-shadow: 0 18px 48px rgba(6, 23, 51, .45);
  }
  .side.is-open { transform: none; }
  .burger { display: inline-flex; }
  .topbar-brand { display: inline-flex; }
  .topbar-brand img { width: 118px; height: auto; }
  body.app .topbar { padding: 0 20px; height: 60px; gap: 12px; }
  body.app .topbar-title { display: none; }
  body.app .page { padding: 24px 20px 56px; }
}
@media (max-width: 767px) {
  body.app .topbar { padding: 0 16px; }
  body.app .topbar .who .who-name { display: none; }
  body.app .page { padding: 20px 16px 48px; }
  body.app .page-title { font-size: 24px; }
  body.app .card { padding: 18px 16px; border-radius: 10px; }
  body.app .btn { min-height: 44px; }
  body.app .foot { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .side { transition: none; }
}

/* ---- V3 table refinements ---- */
/* A part number that wraps reads as two different part numbers. */
body.app table.lines td.mono { white-space: nowrap; }
body.app table.lines thead th.col-money,
body.app table.lines td.col-money { white-space: nowrap; }

/* The two line actions sit in a 44px column and used to wrap in the middle. */
body.app table.lines td.col-no:last-child {
  width: 76px;
  padding-left: 6px;
  padding-right: 6px;
  white-space: nowrap;
  text-align: right;
}
body.app .line-price { padding: 5px 7px; font-size: 11.5px; vertical-align: middle; }
body.app .line-remove { padding: 2px 4px; font-size: 17px; vertical-align: middle; }

/* Row rhythm: 52-56px, except rows whose description genuinely wraps. */
body.app table.lines tbody td { padding-top: 16px; padding-bottom: 16px; }
body.app .table-card table.lines tbody td { padding-top: 14px; padding-bottom: 14px; }

/* Wide tables scroll inside their own card; the page itself never scrolls
   sideways and no column is clipped away. */
body.app .quote-grid > * { min-width: 0; }
body.app .table-card { overflow-x: auto; overflow-y: visible; }
body.app .table-card > table { min-width: 100%; }

/* The quotation table carries eight columns next to a 320px summary. Tighter
   cell padding buys the ~60px that keeps every column - including the row
   actions - inside the card instead of behind a horizontal scroll. */
body.app .quote-grid table.lines thead th,
body.app .quote-grid table.lines tbody td {
  padding-left: 12px;
  padding-right: 12px;
}
body.app .quote-grid table.lines td.col-no:last-child {
  width: 58px;
  padding-left: 4px;
  padding-right: 8px;
}
body.app .quote-grid table.lines .col-txa { font-size: 11.5px; }

/* ---- admin forms: two columns on wide screens, one on phones ----
   CSS grid only; DOM order, ids, names and the tab order are untouched. */
@media (min-width: 900px) {
  body.app .provider-form,
  body.app .user-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
    align-items: start;
  }
  body.app .provider-form > .field,
  body.app .user-form > .field { margin: 0; }
  body.app .provider-form > .form-actions,
  body.app .user-form > .form-actions { grid-column: 1 / -1; }
  body.app .codes-form {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) 140px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: end;
  }
  body.app .codes-form > .field { margin: 0; }
}

/* Provider row actions stay in one group instead of spilling onto a second line. */
body.app #provider-table td:last-child { white-space: nowrap; }
body.app #provider-table .inline-form { display: inline-block; margin: 0; }
body.app #provider-table .test-result { display: block; }
@media (min-width: 900px) {
  body.app .provider-form > .admin-filters-actions,
  body.app .user-form > .admin-filters-actions { grid-column: 1 / -1; }
  body.app .codes-form > .admin-filters-actions { grid-column: 1 / -1; }
}
/* Actions wrap inside their own column instead of being clipped by the card. */
body.app #provider-table td:last-child {
  min-width: 248px;
  white-space: normal;
}
body.app #provider-table td:last-child .btn { margin: 0 6px 6px 0; }
body.app #provider-table td:last-child .test-result { margin-top: 2px; }

/* Phone: keep every header action reachable without turning the top of the
   page into five stacked full-width buttons. */
@media (max-width: 767px) {
  body.app .quote-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }
  body.app .quote-actions > * { width: 100%; }
  body.app .quote-actions .btn { width: 100%; }
}
/* The generate button belongs at the end of the row, not on its own line. */
@media (min-width: 900px) {
  body.app .codes-form > .admin-filters-actions { grid-column: auto; }
}

/* Row-level actions are secondary: a column of ten solid primary buttons
   competes with the page's one real primary action. */
body.app table td .btn.primary {
  background: #fff;
  border-color: #C9D6E4;
  color: #17568E;
}
body.app table td .btn.primary:hover {
  background: #F2F7FC;
  border-color: #A9BFD6;
  color: #10365F;
}

/* Business cards on the supplier admin list: small, contained, admin-only. */
.card-thumb {
  display: inline-block;
  width: 180px;
  height: auto;
  margin: 6px 8px 0 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

/* ============================================================
   Supplier registration — three-step wizard
   Scoped to body.supplier-wizard-page / .supplier-wizard so the
   signed-in workbench and the quote screens are untouched.
   ============================================================ */

body.supplier-wizard-page {
  background: #F4F7FB;
  color: #344861;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* .sw-* rules set their own display, so hidden must win everywhere. */
.supplier-wizard [hidden] { display: none !important; }

/* The real file inputs stay in the form (and keep submitting) but sit behind
   the styled buttons: clipped rather than display:none, which Safari can drop
   from the multipart body. */
.supplier-wizard .sw-file {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.supplier-wizard .sw-slot { position: relative; }

/* No script: the steps cannot be switched, so show all of them and hide the
   step buttons. The form still posts as one page. */
html:not(.js) .supplier-wizard .sw-step[hidden] { display: block !important; }
html:not(.js) .supplier-wizard [data-next],
html:not(.js) .supplier-wizard [data-back] { display: none !important; }
html:not(.js) .supplier-wizard [data-manual][hidden] { display: block !important; }

/* ---- footer ---- */
.sw-foot { border-top: 1px solid #E6EDF5; background: #fff; margin-top: auto; }
.sw-foot-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #7A8AA0;
  font-size: 12px;
}
.sw-foot-inner img { width: 104px; height: auto; display: block; }

/* ---- hero ---- */
.sw-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #061733 0%, #0B2444 55%, #10365F 100%);
}
.sw-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 960px;
  margin: 0 auto;
  padding: 34px 32px 38px;
}
.sw-hero-mark {
  position: absolute;
  z-index: 1;
  right: 3%;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  height: auto;
  opacity: .06;
  filter: brightness(0) invert(1);
  pointer-events: none;
  user-select: none;
}
.sw-hero-eyebrow {
  margin: 0 0 10px;
  color: #FF8D8D;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.sw-hero-title {
  margin: 0 0 8px;
  color: #fff;
  font-size: 34px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sw-hero-lede {
  margin: 0;
  color: rgba(255, 255, 255, .78);
  font-size: 15px;
  line-height: 1.6;
}

/* ---- layout ---- */
.sw-body {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 22px 32px 56px;
}
.sw-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.sw-flash {
  margin: 0 0 14px;
  padding: 12px 16px;
  border: 1px solid #F0C4C4;
  border-radius: 8px;
  background: #FDEFEF;
  color: #A32C2C;
  font-size: 13px;
}

/* ---- progress ---- */
.sw-progress { margin: 0 0 18px; }
.sw-position {
  margin: 0 0 10px;
  color: #10365F;
  font-size: 14px;
  font-weight: 700;
}
.sw-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 16px;
}
.sw-seg {
  height: 5px;
  border-radius: 99px;
  background: #DCE4EE;
}
/* Behind you = light engineering blue, current screen = deep blue. The track
   reports position only; it never claims the profile is saved or complete. */
.sw-seg.is-filled { background: #7EA0C4; }
.sw-seg.is-current { background: #10365F; }
.sw-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.sw-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #7A8AA0;
  font-size: 13px;
  line-height: 1.35;
}
.sw-step-badge {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #D3DEEA;
  border-radius: 50%;
  background: #EDF2F8;
  color: #5E7391;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.sw-step-item.is-current { color: #081A34; font-weight: 700; }
.sw-step-item.is-current .sw-step-badge {
  border-color: #10365F;
  background: #10365F;
  color: #fff;
}
/* Visited steps stay visible but read lighter than the screen you are on. */
.sw-step-item.is-complete .sw-step-badge {
  border-color: #7EA0C4;
  background: #7EA0C4;
  color: #fff;
}
.sw-step-name { display: block; min-width: 0; }

/* ---- card ---- */
.sw-card {
  padding: 28px 30px 24px;
  border: 1px solid #E1E8F1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 28px rgba(16, 40, 70, .05);
}
.sw-title {
  margin: 0 0 6px;
  color: #081A34;
  font-size: 23px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.sw-title:focus { outline: none; }
.sw-help {
  margin: 0 0 14px;
  color: #5E7391;
  font-size: 12.5px;
  line-height: 1.6;
}
.sw-optional {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 99px;
  background: #EDF2F8;
  color: #5E7391;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.sw-lede { margin: 0 0 12px; color: #344861; font-size: 15px; line-height: 1.6; }

.sw-field { margin: 0 0 18px; }
.sw-field > label {
  display: block;
  margin: 0 0 7px;
  color: #344861;
  font-size: 13px;
  font-weight: 600;
}
.sw-control {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #C6D3E2;
  border-radius: 7px;
  background: #fff;
  color: #081A34;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
}
.sw-control::placeholder { color: #9AA9BC; }
.sw-control:focus {
  outline: none;
  border-color: #2167AC;
  box-shadow: 0 0 0 3px rgba(33, 103, 172, .16);
}
textarea.sw-control { min-height: 96px; resize: vertical; }
.is-invalid .sw-control,
.sw-control[aria-invalid="true"] { border-color: #C0566A; }
.sw-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}
.sw-error,
.sw-field-error {
  margin: 6px 0 0;
  color: #A82734;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}
.sw-qms-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.sw-extra {
  margin: 4px 0 14px;
  padding-top: 12px;
  border-top: 1px solid #EDF2F8;
}
.sw-extra > summary {
  color: #17568E;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.sw-extra[open] > summary { margin-bottom: 12px; }

/* ---- photo slots ---- */
.sw-slot-photo .sw-slot-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 34px 20px;
  border: 1px dashed #8DABCA;
  border-radius: 8px;
  background: #F7FAFE;
  text-align: center;
}
.sw-slot-icon { color: #10365F; }
.sw-slot-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.sw-slot-note { margin: 0; color: #7A8AA0; font-size: 12px; }
.sw-slot-label {
  margin: 0 0 10px;
  color: #5E7391;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sw-slot-filled {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid #DCE4EE;
  border-radius: 8px;
  background: #F9FBFE;
}
.sw-thumb {
  width: 104px;
  height: 68px;
  flex: 0 0 auto;
  border: 1px solid #DCE4EE;
  border-radius: 6px;
  background: #fff;
  object-fit: cover;
}
.sw-slot-file {
  display: flex;
  flex: 1 1 160px;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sw-file-name {
  color: #081A34;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-file-size {
  color: #7A8AA0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.sw-slot-back { margin-top: 16px; }

/* ---- drop zones and file rows ---- */
.sw-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 24px 16px;
  border: 1px dashed #8DABCA;
  border-radius: 8px;
  background: #F7FAFE;
  color: #10365F;
  text-align: center;
  cursor: pointer;
}
.sw-drop:hover, .sw-drop:focus-visible, .sw-drop.is-over {
  border-color: #2167AC;
  background: #F1F7FD;
  outline: none;
}
.sw-drop-title { font-size: 13.5px; font-weight: 600; }
.sw-drop-note { color: #7A8AA0; font-size: 12px; }
.sw-slot-drop .sw-slot-file,
.sw-slot-compact .sw-slot-file {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid #DCE4EE;
  border-radius: 7px;
  background: #F9FBFE;
}
.sw-slot-compact { display: flex; justify-content: flex-end; }
.sw-slot-compact .sw-slot-file { margin-top: 0; }
.sw-slot-compact .sw-file-name { max-width: 180px; }
.sw-file-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sw-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid #E1E8F1;
  border-radius: 7px;
  background: #F9FBFE;
}
.sw-file-row-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  min-width: 0;
}

/* ---- buttons and links ---- */
.sw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #fff;
  color: #10365F;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.sw-btn:focus-visible { outline: 3px solid rgba(33, 103, 172, .4); outline-offset: 2px; }
.sw-btn:disabled { opacity: .6; cursor: progress; }
.sw-btn-primary { border-color: #10365F; background: #10365F; color: #fff; }
.sw-btn-primary:hover { border-color: #0B2A4C; background: #0B2A4C; }
.sw-btn-outline { border-color: #C6D3E2; background: #fff; color: #10365F; }
.sw-btn-outline:hover { border-color: #8DABCA; background: #F4F8FC; }
.sw-btn-quiet { border-color: #DCE4EE; background: #fff; color: #17568E; }
.sw-btn-quiet:hover { border-color: #8DABCA; background: #F4F8FC; }
.sw-btn-mini {
  min-height: 32px;
  padding: 0 12px;
  border-color: #C6D3E2;
  font-size: 12.5px;
}
.sw-btn-danger { border-color: #EBC9CC; color: #A82734; }
.sw-btn-danger:hover { border-color: #D9A9AF; background: #FDF3F4; }
.sw-btn-next { border-color: #10365F; background: #10365F; color: #fff; min-width: 116px; }
.sw-btn-next:hover { border-color: #0B2A4C; background: #0B2A4C; }
.sw-btn-back { border-color: #C6D3E2; background: #fff; color: #10365F; min-width: 96px; }
.sw-btn-back:hover { border-color: #8DABCA; background: #F4F8FC; }
.sw-btn-submit {
  min-width: 196px;
  border-color: #C91E2C;
  background: #C91E2C;
  color: #fff;
  font-weight: 700;
}
.sw-btn-submit:hover { border-color: #AD1724; background: #AD1724; }
.sw-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: #17568E;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.sw-link:hover { color: #0B2A4C; }
.sw-link.is-danger { color: #A82734; }
.sw-link:focus-visible { outline: 2px solid rgba(33, 103, 172, .45); outline-offset: 2px; }
.sw-alt { margin: 16px 0 0; }
.sw-add-back { margin-top: 12px; }

/* ---- step navigation ---- */
.sw-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #E1E8F1;
}
.sw-nav-spacer { flex: 1; }
.sw-submit-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.sw-note {
  margin: 0;
  color: #7A8AA0;
  font-size: 11.5px;
  line-height: 1.5;
  text-align: right;
}

/* ---- card scan status ---- */
.sw-scan-status {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 7px;
  background: #EDF4FA;
  color: #334A66;
  font-size: 12.5px;
  line-height: 1.55;
}
.sw-scan-status.is-ok { background: #EAF2FA; color: #10365F; }

/* ---- step 3 files ---- */
.sw-files { gap: 18px; align-items: start; }
.sw-file-block {
  min-width: 0;
  padding: 18px;
  border: 1px solid #E1E8F1;
  border-radius: 9px;
  background: #fff;
}
.sw-file-title {
  margin: 0 0 4px;
  color: #081A34;
  font-size: 14.5px;
  font-weight: 700;
}
.sw-file-block .sw-help { margin-bottom: 8px; }
.sw-file-block .sw-link { display: inline-block; margin-bottom: 12px; }
.sw-files-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 20px;
}
.sw-files-foot .sw-help { margin: 0; }

/* ---- review ---- */
.sw-review {
  margin: 6px 0 22px;
  padding-top: 20px;
  border-top: 1px solid #E1E8F1;
}
.sw-review-title {
  margin: 0 0 12px;
  color: #081A34;
  font-size: 16px;
  font-weight: 700;
}
.sw-review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.sw-review-row {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 1px solid #E1E8F1;
  border-radius: 9px;
  background: #F9FBFE;
}
.sw-review-label {
  margin: 0 0 6px;
  color: #5E7391;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.sw-review-value {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #344861;
  font-size: 12.5px;
  line-height: 1.5;
  word-break: break-word;
}
.sw-review-line b { color: #081A34; font-weight: 600; }
.sw-review-thumb {
  width: 100%;
  max-width: 168px;
  height: auto;
  margin-bottom: 4px;
  border: 1px solid #DCE4EE;
  border-radius: 6px;
  background: #fff;
}
.sw-review-row > .sw-link { align-self: flex-start; }

/* ---- confirmation ---- */
.sw-confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 0;
  color: #344861;
  font-size: 13px;
  line-height: 1.6;
  cursor: pointer;
}
.sw-confirm input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 3px;
}

/* ---- simple result / notice pages ---- */
.sw-plain-wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 32px 64px;
}
.sw-plain-wrap .sw-title { font-size: 26px; margin-bottom: 10px; }

@media (max-width: 767px) {
  .sw-hero-inner { padding: 26px 16px 28px; }
  .sw-hero-title { font-size: 27px; }
  .sw-hero-mark { width: 210px; right: -40px; opacity: .05; }
  .sw-body { padding: 18px 16px 40px; }
  .sw-card { padding: 20px 16px 18px; }
  .sw-title { font-size: 21px; }
  .sw-steps { gap: 8px; }
  .sw-step-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-size: 10.5px;
    line-height: 1.3;
  }
  .sw-step-badge { flex-basis: 26px; width: 26px; height: 26px; font-size: 11.5px; }
  .sw-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .sw-qms-row { grid-template-columns: minmax(0, 1fr); }
  .sw-slot-compact { justify-content: flex-start; }
  .sw-slot-photo .sw-slot-empty { padding: 26px 16px; }
  .sw-slot-actions { width: 100%; }
  .sw-slot-actions .sw-btn { flex: 1 1 auto; }
  .sw-review-list { grid-template-columns: minmax(0, 1fr); }
  .sw-nav { flex-direction: column; align-items: stretch; }
  .sw-nav .sw-btn { width: 100%; }
  .sw-nav-spacer { display: none; }
  .sw-submit-wrap { align-items: stretch; }
  .sw-note { text-align: center; }
  .sw-files { grid-template-columns: minmax(0, 1fr); }
  .sw-plain-wrap { padding: 26px 16px 48px; }
  .sw-foot-inner { padding: 16px; }
}
