:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17233a;
  background: #f4f6f9;
}

* { box-sizing: border-box; }
body { margin: 0; }
.page-shell { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
h1, h2, h3 { color: #132440; line-height: 1.2; }
h1 { margin: 6px 0 20px; font-size: clamp(1.75rem, 4vw, 2.25rem); }
h2 { margin-top: 0; font-size: 1.25rem; }
.context, .muted { color: #5c6c80; }
.context { font-size: .875rem; }
.panel { margin: 16px 0; padding: 20px; border: 1px solid #d7e0eb; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgb(23 35 58 / 4%); }
.selection-form { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; }
.form-field { display: grid; gap: 5px; font-weight: 600; }
input[type="text"] { width: 12rem; padding: .6rem .7rem; border: 1px solid #8e9eaf; border-radius: 5px; font: inherit; }
button, .button-link { min-height: 2.55rem; padding: .55rem 1rem; border: 0; border-radius: 5px; background: #1c5d9f; color: #fff; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
button:hover, .button-link:hover { background: #144b82; }
.check { display: flex; align-items: center; gap: .45rem; min-height: 2.55rem; }
.validation, .error { color: #9d1c22; }
.notice, .warning, .error-panel { border-radius: 7px; padding: .8rem 1rem; }
.notice { background: #eef5ff; border: 1px solid #bdd4f0; }
.warning { background: #fff6de; border: 1px solid #e7cb7e; }
.error-panel { background: #fff0f1; border: 1px solid #e7bcc1; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 28px; }
.summary-grid dt { margin-bottom: .2rem; color: #647386; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.summary-grid dd { margin: 0; overflow-wrap: anywhere; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.scroll { overflow-x: auto; }
table { width: 100%; min-width: 980px; border-collapse: collapse; margin-top: 16px; }
th, td { padding: .7rem .55rem; border-bottom: 1px solid #dde5ee; text-align: left; vertical-align: top; }
th { color: #35465d; background: #f3f6f9; font-size: .8rem; }
td { overflow-wrap: anywhere; }
.notes { min-width: 15rem; max-width: 27rem; white-space: pre-wrap; }
.details { margin-top: .35rem; }
.details summary { cursor: pointer; color: #1c5d9f; }
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 20px; margin: .7rem 0 0; }
.details-grid dt { color: #647386; font-size: .8rem; }
.details-grid dd { margin: 0 0 .45rem; overflow-wrap: anywhere; }
.deleted { color: #9d1c22; font-weight: 650; }
.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; }

@media (max-width: 600px) {
  .page-shell { width: min(100% - 20px, 1240px); padding-top: 16px; }
  .panel { padding: 14px; }
  .selection-form > button { width: 100%; }
}

/* Workstation evidence viewer */
nav { margin-bottom: 1.4rem; }
.ws-filters { display:flex; flex-wrap:wrap; gap:1rem; align-items:end; margin:1.5rem 0; }
.ws-filters label { display:flex; flex-direction:column; gap:.35rem; }
.ws-filters input,.ws-filters select { padding:.55rem; max-width:100%; }
.ws-warning { border-left:3px solid #c58b23; padding:.65rem 1rem; background:#fff6df; color:#493711; }
.ws-timeline { padding-left:1.5rem; }
.ws-timeline li { border-left:4px solid #247d9f; background:#eef5f8; color:#172a3c; padding:.8rem; margin:.5rem 0; }
.ws-timeline span { display:block; margin-top:.3rem; }
.ws-selected, tr:target { background:#fff0b8!important; outline:2px solid #9f7712; }
.table-scroll { overflow-x:auto; }
section { margin-block:1.8rem; }

.ws-queue { max-height:26rem; }
.ws-timeline { max-height:36rem; overflow:auto; }
.ws-queue th { position:sticky; top:0; background:#eef3f8; color:#172a3c; }

.production-banner { background:#8a1c1c; color:#fff; font-weight:700; padding:.6rem 1rem; text-align:center; letter-spacing:.02em; }

/* Project schedule (Gantt). The axis is working time: each day column is one 480-minute shop day. */
.gantt-issues { border-left:4px solid #b7791f; background:#fffaf0; padding:.6rem 1rem; margin-block:.8rem; }
.gantt-issues h3 { margin:0 0 .3rem; font-size:1rem; }
.gantt-issues ul { margin:0; padding-left:1.2rem; }
.gantt-issues a { margin-right:.3rem; }
.gantt-legend { display:flex; flex-wrap:wrap; gap:.4rem 1.2rem; list-style:none; padding:0; margin:.6rem 0; font-size:.85rem; }
.gantt-legend li { display:flex; align-items:center; gap:.35rem; }
.gantt-swatch { display:inline-block; width:1.4rem; height:.75rem; border-radius:2px; }
.gantt-swatch.overlap { background:#fff; outline:2px solid #c53030; outline-offset:-2px; }
.gantt-swatch.marker { width:.75rem; background:#4a5568; transform:rotate(45deg); }
.gantt-swatch.due { width:2px; background:#b7791f; }
.gantt { overflow:auto; max-height:44rem; border:1px solid #d5dde6; background:#fff; }
.gantt-inner { position:relative; }
.gantt-row { display:flex; height:1.75rem; border-bottom:1px solid #edf1f5; }
.gantt-row:target { background:#fff8d6; }
.gantt-label { flex:0 0 var(--gantt-label); width:var(--gantt-label); position:sticky; left:0; z-index:3; display:flex; align-items:center; gap:.4rem;
  padding:0 .5rem; background:#f7f9fb; border-right:1px solid #d5dde6; font-size:.82rem; white-space:nowrap; overflow:hidden; }
.gantt-label a { overflow:hidden; text-overflow:ellipsis; flex:1 1 auto; }
.gantt-order { flex:0 0 3.4rem; color:#5a6b7b; font-variant-numeric:tabular-nums; }
.gantt-order.out-of-sequence { color:#9c4221; font-weight:700; }
.gantt-heading-task { flex:1 1 auto; }
.gantt-legend .gantt-order { flex:0 0 auto; }
.gantt-status { flex:0 0 auto; padding:0 .35rem; border-radius:3px; color:#fff; font-size:.72rem; font-weight:700; }
.gantt-track { position:relative; flex:0 0 auto;
  background-image:linear-gradient(to right, #e3e9ef 1px, transparent 1px); background-size:var(--gantt-day) 100%; }
.gantt-days, .gantt-milestones { position:sticky; z-index:4; background:#eef3f8; font-size:.75rem; font-weight:700; }
.gantt-milestones { top:0; }
.gantt-days { top:1.75rem; }
.gantt-days .gantt-label, .gantt-milestones .gantt-label { background:#eef3f8; z-index:5; }
.gantt-day { position:absolute; top:0; width:var(--gantt-day); line-height:1.75rem; text-align:center; color:#172a3c; overflow:hidden; }
.gantt-day.week-start { border-left:2px solid #8fa3b8; }
.gantt-body { position:relative; }
.gantt-bar { position:absolute; top:.3rem; height:1.15rem; border-radius:3px; box-sizing:border-box; z-index:1; }
.gantt-marker { position:absolute; top:.45rem; width:.8rem !important; height:.8rem; margin-left:-.4rem; transform:rotate(45deg); box-sizing:border-box; z-index:1; }
.status-active { background:#2b6cb0; }
.status-staged { background:#2f855a; }
.status-pending { background:#8795a5; }
.status-closed, .actual { background:#4a5568; }
.gantt-bar.overlap, .gantt-marker.overlap { outline:2px solid #c53030; outline-offset:1px; }
.gantt-due { position:absolute; top:.15rem; width:2px; height:1.45rem; background:#b7791f; }
.gantt-uncharted { position:sticky; left:calc(var(--gantt-label) + .5rem); font-size:.78rem; line-height:1.75rem; }
.gantt-milestone-line { position:absolute; top:0; bottom:0; width:0; border-left:2px dashed; z-index:2; pointer-events:none; }
.gantt-milestone-flag { position:absolute; top:.2rem; transform:translateX(-100%); padding:0 .4rem; border-radius:3px 0 0 3px; color:#fff; line-height:1.35rem; white-space:nowrap; }
.milestone-projectdue { border-color:#805ad5; }
.milestone-estimatedship { border-color:#dd6b20; }
.milestone-shipby { border-color:#c53030; }
.gantt-milestone-flag.milestone-projectdue { background:#805ad5; }
.gantt-milestone-flag.milestone-estimatedship { background:#dd6b20; top:.2rem; }
.gantt-milestone-flag.milestone-shipby { background:#c53030; }
.gantt-milestone-flag.flip { transform:none; border-radius:0 3px 3px 0; }
.gantt-line { flex:0 0 5rem; overflow:hidden; text-overflow:ellipsis; color:#172a3c; font-weight:600; }
.gantt-bar.early, .gantt-marker.early { outline:2px solid #c05621; outline-offset:1px; }
.gantt-swatch.early { background:#fff; outline:2px solid #c05621; outline-offset:-2px; }

/* Vendor invoice review POC. All comparison colors signal evidence to inspect, not approval. */
.page-shell-wide { width:calc(100% - 32px); }
.invoice-heading { margin-bottom:1.2rem; }
.invoice-heading h1 { margin-bottom:.45rem; }
.eyebrow { margin:0; color:#176756; font-size:.78rem; font-weight:750; letter-spacing:.08em; text-transform:uppercase; }
.invoice-upload { display:grid; grid-template-columns:minmax(0, 1fr) auto; align-items:end; gap:1.25rem; }
.invoice-upload form { display:flex; flex-wrap:wrap; align-items:end; justify-content:end; gap:.7rem; }
.file-picker { display:grid; gap:.35rem; color:#35465d; font-weight:650; }
.file-picker input { max-width:100%; }
.invoice-upload #invoice-upload-progress { flex-basis:100%; margin:0; }
.invoice-progress { border-left:4px solid #1c5d9f; }
.invoice-steps { display:flex; flex-wrap:wrap; gap:.8rem 1.4rem; margin:1.1rem 0; color:#5c6c80; }
.invoice-steps .complete { color:#176756; font-weight:700; }
.invoice-steps strong { color:#132440; }
.invoice-review-grid { display:grid; grid-template-columns:minmax(0, 1fr); }
.invoice-details { min-width:0; }
.invoice-summary-grid { margin:1rem 0; }
.invoice-summary-grid > div { min-width:0; }
.invoice-reference-list { margin:.5rem 0 1rem; padding-left:1.3rem; }
.invoice-reference-list code { white-space:pre-wrap; overflow-wrap:anywhere; }
.invoice-po-form { display:flex; flex-wrap:wrap; align-items:end; gap:.7rem; margin:.75rem 0; }
.invoice-po-form label { display:grid; gap:.3rem; color:#35465d; font-weight:650; }
.invoice-po-form input { width:14rem; max-width:100%; padding:.6rem .7rem; border:1px solid #8e9eaf; border-radius:5px; font:inherit; }
.invoice-comparison-summary { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:.75rem; margin:1rem 0; }
.invoice-comparison-summary > div { padding:.8rem; border:1px solid #d7e0eb; border-radius:6px; background:#f8fafc; }
.invoice-comparison-summary p { margin:.45rem 0 0; }
.invoice-lines table { min-width:1120px; }
.invoice-extracted-lines table { min-width:920px; }
.invoice-lines select { width:100%; min-width:15rem; padding:.42rem; font:inherit; }
.line-match { display:block; margin-top:.35rem; }
.delta { color:#9b5c13; font-weight:750; }
.invoice-footer { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin-top:1.2rem; padding:.8rem 0; }
.invoice-footer form { margin:0; flex:0 0 auto; }
.button-link.secondary, button.secondary { color:#1c5d9f; border:1px solid #9ab5d0; background:#fff; }
.button-link.secondary:hover, button.secondary:hover { color:#fff; background:#1c5d9f; }

@media (max-width: 900px) {
  .invoice-upload { grid-template-columns:1fr; }
  .invoice-upload form { justify-content:start; }
}

@media (max-width: 600px) {
  .invoice-comparison-summary { grid-template-columns:1fr; }
  .invoice-footer { align-items:flex-start; flex-direction:column; }
  .invoice-po-form > button { width:100%; }
}
/* Workstation Gantt: no milestone row, so the day header sticks to the top. */
.gantt.no-milestones .gantt-days { top:0; }
.gantt-project { flex:0 0 4.2rem; font-variant-numeric:tabular-nums; }
.gantt-label a.gantt-project { flex:0 0 4.2rem; }
.gantt-task-name { flex:1 1 auto; overflow:hidden; text-overflow:ellipsis; }
.gantt-row.ws-selected .gantt-label { background:#fff8d6; }
