* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 "Segoe UI", system-ui, sans-serif; color: #1a2330; background: #f4f6f9; }
header { background: #10233f; color: #fff; padding: 10px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
header h1 { font-size: 17px; margin: 0; font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #2c3e5c; }
.chip.green { background: #1e7d3c; }
.chip.shipped-late { background: #4f8d2c; }
.chip.yellow { background: #b58900; color: #fff; }
.chip.red { background: #c62828; }
.chip.overdue { background: #7b1114; }
.chip.covered { background: #35597d; }
.chip.future { background: #5b6b80; }

nav { background: #fff; border-bottom: 1px solid #d7dee8; padding: 0 18px; }
nav button { border: 0; background: none; padding: 11px 16px; font: inherit; cursor: pointer; border-bottom: 3px solid transparent; color: #47576b; }
nav button.active { border-bottom-color: #10233f; color: #10233f; font-weight: 600; }

main { padding: 16px 18px; }
.tab { display: none; }
.tab.active { display: block; }
.hint { color: #64748b; font-size: 12.5px; }
.hint.pad { padding: 12px; }   /* was an inline style attribute, which the CSP blocks */

.summary { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.stat { background: #fff; border: 1px solid #d7dee8; border-radius: 8px; padding: 8px 14px; min-width: 110px; }
.stat b { display: block; font-size: 20px; }
.stat.red b { color: #c62828; }
.stat.yellow b { color: #b58900; }
.stat.overdue b { color: #7b1114; }
.stat.risk b { color: #9c27b0; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 10px; }
.toolbar input[type=search] { padding: 6px 10px; border: 1px solid #c4cfdc; border-radius: 6px; width: 280px; }
.toolbar button, form button, .dropzone input { font: inherit; }
.toolbar button, form button[type=submit], #addException { background: #10233f; color: #fff; border: 0; border-radius: 6px; padding: 7px 14px; cursor: pointer; }
#addException { background: #35597d; }

.grid-wrap { overflow: auto; max-height: 70vh; background: #fff; border: 1px solid #d7dee8; border-radius: 8px; }
table.grid { border-collapse: collapse; font-size: 12.5px; }
table.grid th, table.grid td { border: 1px solid #e3e9f1; padding: 4px 7px; white-space: nowrap; text-align: center; }
table.grid thead th { position: sticky; top: 0; background: #eef2f7; z-index: 2; }
table.grid td.part, table.grid th.part { position: sticky; left: 0; background: #fff; text-align: left; z-index: 1; max-width: 300px; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
table.grid thead th.part { z-index: 3; background: #eef2f7; }
tr.at-risk td.part { box-shadow: inset 4px 0 0 #9c27b0; }
.badge { font-size: 10px; border-radius: 8px; padding: 1px 6px; margin-left: 5px; color: #fff; vertical-align: middle; }
.badge.risk { background: #9c27b0; }
.badge.excess { background: #35597d; }

td.cell-green { background: #c8e6c9; color: #144d22; }
td.cell-shipped-late { background: #dcedc8; color: #33691e; }
td.cell-yellow { background: #ffe082; color: #5d4300; }
td.cell-red { background: #ef5350; color: #fff; font-weight: 700; }
td.cell-overdue { background: #8e1116; color: #fff; font-weight: 700; }
td.cell-covered { background: #e3eaf3; color: #35597d; }
td.cell-future { background: #fafbfd; color: #64748b; }

.hidden { display: none !important; }
.navright { float: right; padding: 8px 0; }
.signout { background: none; border: 1px solid #c4cfdc; border-radius: 6px; padding: 4px 10px; cursor: pointer; color: #47576b; }
.authcard { max-width: 420px; }
.authcard label { display: block; font-weight: 600; margin: 12px 0 4px; }
.authcard input { width: 100%; padding: 9px 11px; border: 1px solid #c4cfdc; border-radius: 7px; font: inherit; }
.authcard button[type=submit], .authcard #pendingSignOut { width: 100%; margin-top: 16px; padding: 10px; background: #10233f; color: #fff; border: 0; border-radius: 7px; font: 600 14px "Segoe UI"; cursor: pointer; }
.sharedtag { font-size: 10px; background: #35597d; color: #fff; border-radius: 8px; padding: 1px 7px; vertical-align: middle; }
table.users { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #d7dee8; font-size: 13px; }
table.users th, table.users td { border-bottom: 1px solid #e3e9f1; padding: 8px 12px; text-align: left; }
table.users thead th { background: #eef2f7; }
table.users select { font: inherit; padding: 4px 6px; border-radius: 6px; border: 1px solid #c4cfdc; }

.quicklist { display: flex; flex-wrap: wrap; gap: 10px; }
.qpart { font: 600 16px/1 "Segoe UI", system-ui, sans-serif; padding: 13px 16px; border-radius: 9px; border: 1px solid #c4cfdc; background: #fff; color: #47576b; cursor: pointer; }
.qpart.issue { background: #c62828; border-color: #a01f1f; color: #fff; font-weight: 700; }
.qpart.warn { background: #ffe082; border-color: #d3a900; color: #5d4300; }
.qpart.good { background: #e6f2e8; border-color: #b9d6bf; color: #1e4d2b; }

@media (max-width: 640px) {
  header { padding: 8px 12px; }
  .legend { display: none; }
  main { padding: 10px; }
  nav button { padding: 10px 10px; }
  .toolbar input[type=search] { width: 100%; }
  .qpart { flex: 1 1 44%; text-align: center; padding: 15px 8px; }
}

.dropzone { background: #fff; border: 2px dashed #a9b8ca; border-radius: 10px; padding: 26px; text-align: center; }
.dropzone.drag { border-color: #10233f; background: #eef2f7; }
#fileCards { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.filecard { background: #fff; border: 1px solid #d7dee8; border-left: 5px solid #1e7d3c; border-radius: 8px; padding: 10px 14px; min-width: 260px; }
.filecard.err { border-left-color: #c62828; }
.filecard h4 { margin: 0 0 4px; font-size: 13.5px; }
.filecard .problem { color: #c62828; font-size: 12px; }
.filecard details { font-size: 12px; margin-top: 6px; }

form fieldset { background: #fff; border: 1px solid #d7dee8; border-radius: 8px; margin-bottom: 14px; padding: 12px 16px; }
form legend { font-weight: 600; padding: 0 6px; }
form label { display: block; margin: 8px 0; }
form input[type=number] { width: 90px; padding: 5px 8px; border: 1px solid #c4cfdc; border-radius: 6px; }
form textarea, #exceptionsTable input { padding: 5px 8px; border: 1px solid #c4cfdc; border-radius: 6px; font: inherit; }
form textarea { width: 340px; }
#exceptionsTable { border-collapse: collapse; margin: 6px 0; }
#exceptionsTable th, #exceptionsTable td { padding: 4px 6px; text-align: left; }
#exceptionsTable input.mats { width: 380px; }
#exceptionsTable button { background: none; border: 0; color: #c62828; cursor: pointer; font-size: 16px; }
.workdays label { display: inline-block; margin-right: 12px; }

.drilldown { position: fixed; inset: 0; background: rgba(16, 35, 63, .45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 10; }
.drilldown.hidden { display: none; }
/* Codex verifier fix #1 (2026-09-25): .page-nav sits at z-index:20 (public/css/page-nav.css), above
   this class's z-index:10 — the strip painted over the drill-down card's × close button, which starts
   only 8px into a card that itself starts 40px from the top. #drilldown (the actual popup card, never
   #authOverlay's pre-sign-in card — that one is fixed by padding, not stacking, below) needs to paint
   above the strip instead. */
#drilldown { z-index: 30; }
/* Codex verifier fix #2 (2026-09-25): #authOverlay stays BELOW .page-nav (it keeps the shared
   .drilldown z-index:10 on purpose — signed out, the strip must stay clickable on top of it, per
   page-nav.css's own comment) — so its card is pushed down far enough that the 40px .drilldown
   padding no longer leaves its <h2> title under the strip at 1280px or 390px. */
#authOverlay { padding-top: 104px; overflow-y: auto; } /* LOW-A: fixed overlay must scroll on short screens */
.drilldown-card { background: #fff; border-radius: 10px; max-width: 980px; width: 100%; max-height: 85vh; overflow: auto; padding: 18px 22px; position: relative; }
.drilldown-card .close { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 22px; cursor: pointer; color: #47576b; }
.drilldown-card h2 { margin-top: 0; }
.drilldown-card table { border-collapse: collapse; font-size: 12.5px; margin: 8px 0 16px; }
.drilldown-card th, .drilldown-card td { border: 1px solid #e3e9f1; padding: 4px 8px; text-align: right; }
.drilldown-card th:first-child, .drilldown-card td:first-child { text-align: left; }
.status-pill { display: inline-block; padding: 1px 8px; border-radius: 8px; font-size: 11px; color: #fff; }
.status-pill.green { background: #1e7d3c; } .status-pill.shipped-late { background: #4f8d2c; }
.status-pill.yellow { background: #b58900; } .status-pill.red { background: #c62828; }
.status-pill.overdue { background: #7b1114; } .status-pill.covered { background: #35597d; }
.status-pill.future { background: #5b6b80; }
