:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1a2330;
  --muted: #6b7785;
  --line: #94a3b8;         /* darker so borders are easy to see */
  --brand: #0f766e;        /* SupplyIt teal — distinct from Ironworks navy */
  --brand-dark: #115e59;
  --brand-ink: #ffffff;
  --primary: #2563eb;
  --success: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ── Top bar ──────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand { color: #fff; font-weight: 800; font-size: 18px; letter-spacing: 0.3px; white-space: nowrap; }
.brand-cloud { font-weight: 400; opacity: 0.8; margin-left: 2px; }
.topbar nav { display: flex; gap: 8px; flex: 1; margin-left: 12px; }
.topbar nav a { color: #fff; padding: 6px 10px; border-radius: 8px; font-weight: 700; white-space: nowrap; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.18); }
.topbar nav a:hover { filter: brightness(1.15); text-decoration: none; }
/* Every nav tile has its own color (Joseph 7/23/26) */
.topbar nav a.nt-home    { background: #475569; }
.topbar nav a.nt-newreq  { background: #16a34a; }
.topbar nav a.nt-reqs    { background: #2563eb; }
.topbar nav a.nt-recv    { background: #4f46e5; }
.topbar nav a.nt-items   { background: #b45309; }
.topbar nav a.nt-pos     { background: #7c3aed; }
.topbar nav a.nt-quotes  { background: #0891b2; }
.topbar nav a.nt-vendors { background: #ea580c; }
.topbar nav a.nt-maint   { background: #be123c; }
.topbar .logout { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar .logout-form { margin: 0; }
.topbar .who { color: rgba(255,255,255,0.9); font-size: 13px; }
.who-role {
  background: rgba(255,255,255,0.18);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  margin-left: 4px;
}
.topbar .logout button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.5);
  color: #fff;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.topbar .logout button:hover { background: rgba(255,255,255,0.12); }

.container { max-width: 1400px; margin: 0 auto; padding: 24px 28px 60px; }

h1 { font-size: 24px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 8px; }

.page-head { margin-bottom: 20px; }

/* ── Flash messages ───────────────────────────────────────────────────────── */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 600; }
.flash-error { background: #fde2e2; color: #991b1b; border: 1px solid #f5a5a5; }
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.flash-warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-block { width: 100%; }

/* ── Login ────────────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 118, 110, 0.10);
  padding: 32px 30px;
  width: 100%;
  max-width: 380px;
}
.login-brand { font-size: 28px; font-weight: 800; color: var(--brand); text-align: center; }
.login-brand .brand-cloud { color: var(--muted); }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 6px 0 22px; }
.login-form label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 14px; }
.login-form input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
}
.login-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,0.15); }
.login-form .btn-primary { margin-top: 6px; }

/* ── KPI cards ────────────────────────────────────────────────────────────── */
.kpis { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  min-width: 150px;
  flex: 1 1 150px;
}
.kpi-n { display: block; font-size: 30px; font-weight: 800; color: var(--brand); line-height: 1; }
.kpi-label { display: block; color: var(--muted); font-size: 12.5px; margin-top: 6px; }

/* ── Switchboard tiles ────────────────────────────────────────────────────── */
.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr; } }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 18px 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.tile:hover {
  text-decoration: none;
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.12);
  transform: translateY(-2px);
}
.tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.10);
  color: var(--brand);
  font-size: 22px;
  line-height: 1;
}
.tile-label { font-size: 16px; font-weight: 700; color: var(--ink); }
.tile-count {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  color: var(--brand);
  text-align: right;
}
.tile-count-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}
.tile-desc { font-size: 12.5px; color: var(--muted); line-height: 1.35; }

/* ── Section grid ─────────────────────────────────────────────────────────── */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.section-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  position: relative;
}
.section-card .section-ico { font-size: 26px; }
.section-card h2 { margin: 8px 0 4px; }
.section-card p { margin: 0; font-size: 13px; }
.section-card-muted { background: #f0fdfa; border-color: #99f6e4; }
.soon-tag {
  display: inline-block;
  margin-top: 12px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}

.topbar nav a.on { box-shadow: 0 0 0 2px #fff, inset 0 -2px 0 rgba(0,0,0,0.18); }
.acct-link { color: rgba(255,255,255,0.9); font-size: 16px; text-decoration: none; }
.acct-link:hover { text-decoration: none; opacity: 0.8; }

/* ── Page heading + actions row ───────────────────────────────────────────── */
.page-head { margin-bottom: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .page-actions { display: flex; gap: 10px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--muted); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #f8fafc; text-decoration: none; }
.btn-brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-blue { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-blue:hover { background: #1d4ed8; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #15803d; }
.btn-warn { background: var(--warn); color: #fff; border-color: var(--warn); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger-outline { color: var(--danger); border-color: #f5a5a5; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; text-align: center; }
.inline { display: inline; }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { background: #f8fafc; font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }   /* bumped one size (Joseph 7/19/26) */
table.data tbody tr:hover { background: #f9fafb; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Compact, full-width table (Open Requests / Create POs grid) */
table.data.compact th, table.data.compact td { padding: 6px 9px; font-size: 12.5px; }
table.data.compact th { letter-spacing: 0.02em; }
table.data.compact select { font-size: 12.5px; }
.fullbleed { position: relative; left: 50%; right: 50%; width: 100vw; margin-left: -50vw; margin-right: -50vw; padding: 0 24px; }

/* Columns hug their content; the last column (Item Desc) absorbs the slack */
.po-grid td, .po-grid th { white-space: nowrap; }
.po-grid td:last-child, .po-grid th:last-child { white-space: normal; width: 100%; }
table.data a.row-link { font-weight: 600; }
.po-grid a.row-link { font-size: 14px; }
/* Email-status tile next to the PO heading. */
.email-tile {
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}
.email-tile.sent { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.email-tile.unsent { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* Ring spec: fields on the left, diagram in the empty space on the right. */
.rings-layout { display: flex; gap: 28px; flex-wrap: wrap; align-items: flex-start; }
.rings-fields { flex: 1 1 320px; display: flex; flex-direction: column; gap: 12px; }
.rings-diagram { flex: 0 0 200px; margin-left: auto; display: flex; justify-content: center; align-items: flex-start; }
@media (max-width: 720px) { .rings-diagram { flex-basis: 100%; margin-left: 0; justify-content: flex-start; } }

/* Radio groups (e.g. the ring spec form). */
.radio-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.radio { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; font-size: 13px; cursor: pointer; }
.radio input { margin: 0; }

/* Compact PO screen: keep the form at a readable width, not full-bleed. */
.po-page { max-width: none; }
/* The PO page uses the full window width (Joseph 7/19/26 — "move the right
   side out a lot"): lift the container cap when it holds a PO page. */
.container:has(.po-page) { max-width: none; }

/* Legacy-style PO header form. */
.po-head-top { display: flex; gap: 14px; flex-wrap: wrap; align-items: stretch; }
.po-box { flex: 1; min-width: 220px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; }
.po-box > label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.po-box-body { font-size: 13px; line-height: 1.45; }
.po-head-meta { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.po-meta-row { display: flex; gap: 10px; align-items: center; }
.po-meta-label { width: 96px; text-align: right; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; flex: none; }
.po-meta-val { font-size: 13px; font-weight: 600; }
.po-meta-val.po-meta-soft { font-weight: 500; color: var(--muted); }
.po-meta-val .email-tile, .po-meta-val .badge { margin-left: 0; }
.po-head-row2 { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.po-field > label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.po-field > div { font-size: 13px; font-weight: 600; }
/* PO action buttons: a fixed RAIL down the right side of the screen (Joseph
   7/22/26 — was one bottom bar). Stacked in the old bar's right-to-left order
   (Delete on top … Send Email at the bottom); the page content keeps a right
   margin so nothing sits under the rail. */
.po-buttonbar { position: absolute; top: 0; right: -162px; width: 150px; display: flex; flex-direction: column; gap: 8px; z-index: 40; }
/* The button group stays TOGETHER and the whole stack bottom-aligns: Send
   Email (last button) sits level with the PO table's LAST ITEM LINE and the
   rest rise from there (Joseph 7/22/26, second pass — no gap in the group).
   poRailAlign() on the page sets the rail's top offset. */
.po-buttonbar .btn { display: block; width: 100%; text-align: center; box-sizing: border-box; }
.po-buttonbar form { display: block; margin: 0; }
.po-page { position: relative; margin-right: 172px; }
@media (max-width: 1000px) {
  .po-buttonbar { position: static !important; top: auto !important; width: auto; flex-direction: row; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); height: auto !important; }
  .po-buttonbar .btn { display: inline-block; width: auto; }
  .po-page { margin-right: 0; }
}

/* PO line items: description is the headline, item code is the small reference. */
/* Thin vertical column rules + outer left/right border, matching the PO PDF's
   clean hairlines (Joseph 7/22/26 "all the vertical lines as well left and right"). */
.po-lines { border: 1px solid var(--line); }
.po-lines th, .po-lines td { border-right: 1px solid var(--line); }
.po-lines th:last-child, .po-lines td:last-child { border-right: none; }
.po-lines tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.po-lines .line-desc { font-weight: 700; font-size: 14px; color: var(--ink); }
.po-lines .line-code { font-size: 12px; color: var(--muted); margin-left: 6px; text-decoration: none; }
.po-lines .line-code:hover { text-decoration: underline; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.search-prompt { padding: 48px 20px; font-size: 15px; }

/* Instant search-as-you-type box (vendors, items, etc.) */
.quick-search { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.quick-search input {
  flex: 1;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  background: #fff;
}
.quick-search input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

/* Searchable dropdown (enhances <select class="searchable">) */
.ss-wrap { position: relative; width: 100%; }
.ss-input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.ss-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15); }
.ss-list {
  position: absolute; z-index: 60; left: 0; right: 0; top: 100%;
  margin: 4px 0 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  max-height: 280px; overflow: auto;
  display: flex; flex-direction: column;   /* lets the JS reorder via `order` */
}
.ss-list[hidden] { display: none; }        /* keep the `hidden` attribute working */
.ss-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; display: flex; gap: 18px; align-items: baseline; }
/* Two-column rows: item code in a fixed column so descriptions line up. */
.ss-code { flex: 0 0 96px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.ss-desc { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-list li:hover, .ss-list li.on { background: #f0fdfa; }
.ss-list li.ss-hint { color: var(--muted); cursor: default; font-style: italic; }
.ss-list li.ss-hint:hover { background: transparent; }

/* "Available from" vendor chips on requests */
.item-vendors { margin-top: 10px; padding: 10px 12px; background: #f8fafc; border: 1px solid #eef2f6; border-radius: 8px; }
.iv-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 6px; }
.iv-list { display: flex; flex-wrap: wrap; gap: 8px; }
.iv-chip {
  display: inline-block; padding: 5px 11px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); font-size: 13px; color: var(--ink); text-decoration: none;
}
a.iv-chip:hover { background: #f1f5f9; text-decoration: none; }
.iv-chip[data-vid] { cursor: pointer; user-select: none; }
.iv-chip[data-vid]:hover { border-color: var(--brand); }
.iv-chip.selected { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(15,118,110,0.25); background: #ecfdf5; }
.iv-chip.iv-default { background: #ecfdf5; border-color: #6ee7b7; color: #065f46; font-weight: 600; }
.iv-chip .iv-part { color: var(--muted); font-size: 12px; }

/* Add-vendor box inside the "Available from" panel */
.iv-add { margin-top: 12px; }
.iv-add-toggle {
  background: #fff; border: 1px dashed var(--line); color: var(--brand);
  border-radius: 8px; padding: 5px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.iv-add-toggle:hover { background: #f0fdfa; border-color: #6ee7b7; }
.iv-add-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.iv-add-form input {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: #fff;
}
.iv-add-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,0.15); }
.iv-add-name { flex: 1 1 260px; }
.iv-add-part { flex: 0 1 150px; }
.iv-add-go {
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
  border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.iv-add-go:hover { background: var(--brand-dark); }
.iv-add-msg { font-size: 12px; color: var(--muted); }

/* ── Quote comparison cards ───────────────────────────────────────────────── */
.quote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.quote-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.quote-card.qc-best { border-color: #6ee7b7; box-shadow: 0 0 0 2px rgba(16,185,129,.18); }
.qc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.qc-head strong { font-size: 15px; }
.qc-x { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }
.qc-x:hover { color: var(--danger); }
.qc-ribbons { display: flex; gap: 6px; flex-wrap: wrap; }
.ribbon { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.ribbon-green { background: #dcfce7; color: #166534; }
.ribbon-blue { background: #dbeafe; color: #1e40af; }

.qdrop {
  display: block; text-align: center; cursor: pointer;
  border: 2px dashed #cbd5e1; border-radius: 10px; padding: 14px 10px; background: #f8fafc;
  font-size: 13px; color: var(--muted); transition: background .15s, border-color .15s;
}
.qdrop:hover { background: #f1f5f9; }
.qdrop.drag { background: #e0f2fe; border-color: #0891b2; }
.qdrop-has { color: var(--ink); }
.qc-pdfform { margin: 0; }

.qc-numbers { display: flex; flex-direction: column; gap: 6px; }
.qc-row { display: flex; align-items: center; gap: 8px; }
.qc-row label { width: 78px; font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.qc-row input { flex: 1; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.qc-row span { font-weight: 600; font-size: 13px; }
.qc-award { margin: 0; }
.qc-awarded { text-align: center; font-weight: 700; color: #166534; background: #dcfce7; border-radius: 8px; padding: 7px; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; max-width: 1300px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-weight: 600; font-size: 13px; }
.field input, .field select, .field textarea {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
  font-family: inherit; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,0.15);
}
.field .hint { font-size: 12px; color: var(--muted); }
.field.req label::after { content: " *"; color: var(--danger); }
.form-actions { display: flex; gap: 10px; margin-top: 18px; align-items: center; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

/* Request form: Item + fields on the left; Deliver to/Reference + wide Note on the right */
.form-card-wide { max-width: 1180px; }
.req-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
/* Left: Item on top (full), then Quantity/Units/Needed by across one row */
.req-main .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Right: Deliver to + (narrower) Reference on top row, Note spanning wide beneath.
   Nudge the whole column down so the Deliver to / Reference INPUT boxes line up
   with the "— pick an item —" box on the left. That box sits ~58px down (Item
   label + Special-item checkbox row); the Deliver to label+gap above its input
   is ~24px, so offset = 58 - 24 = 34px. The Note box runs longer at the bottom. */
.req-side { display: grid; grid-template-columns: 1fr 0.7fr; gap: 14px 16px; align-items: start; margin-top: 34px; }
.req-side .req-note { grid-column: 1 / -1; }
.req-side .req-note textarea { width: 100%; min-height: 92px; resize: vertical; }
@media (max-width: 980px) { .req-main .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Stacked layout: the columns are no longer side-by-side, so drop the nudge. */
@media (max-width: 820px) { .req-layout { grid-template-columns: 1fr; } .req-side { margin-top: 0; } }
@media (max-width: 560px) { .req-main .form-grid { grid-template-columns: 1fr; } .req-side { grid-template-columns: 1fr; } }

/* ── Detail / definition rows ─────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.dl { font-size: 14px; }
.dl dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.dl dd { margin: 2px 0 0; font-weight: 600; }

/* ── Status badges ────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge-draft { background: #f1f5f9; color: #475569; }
.badge-submitted { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-ordered { background: #e0e7ff; color: #3730a3; }
.badge-received { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #e5e7eb; color: #6b7280; }
.badge-open { background: #dbeafe; color: #1e40af; }
.badge-partial { background: #fef3c7; color: #92400e; }
.badge-closed { background: #dcfce7; color: #166534; }

/* ── Line-item editor (PO builder) ────────────────────────────────────────── */
.lines-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.lines-table th, .lines-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.lines-table th { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.lines-table input, .lines-table select { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }
.lines-table td.num { text-align: right; }

.flash-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

.progress-bar { height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; min-width: 80px; }
.progress-bar > span { display: block; height: 100%; background: var(--brand); }

@media (max-width: 700px) {
  .topbar nav { gap: 6px; font-size: 13px; margin-left: 10px; flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .topbar nav { display: none; }
  .container { padding: 16px; }
}

/* No up/down spinners on number inputs (Joseph 7/21/26 — "we will type it").
   Keeps type=number for validation/mobile numeric keypad; just hides the arrows. */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
