/* Ferral tracking — high-fidelity tracking page */
:root {
  --navy:        #0A2540;
  --navy-2:      #142d4c;
  --navy-soft:   #1a3a60;
  --red:         #E8332B;
  --red-soft:    #fdecea;
  --bg:          #F7F6F3;
  --surface:     #ffffff;
  --line:        #E5E2DA;
  --line-strong: #D4D0C5;
  --ink:         #0A2540;
  --ink-2:       #43526a;
  --muted:       #8a93a3;
  --muted-2:     #b6bcc7;
  --gray-bg:     #F0EEE8;
  --good:        #1f8a5b;
  --good-soft:   #e6f3ec;
  --shadow-sm:   0 1px 2px rgba(10,37,64,0.04), 0 1px 3px rgba(10,37,64,0.05);
  --shadow:      0 2px 4px rgba(10,37,64,0.04), 0 8px 24px rgba(10,37,64,0.06);
  --radius:      14px;
  --radius-sm:   10px;
  --radius-xs:   6px;
  --mono:        'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans:        'Inter', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ----- Header ----- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-left { display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 28px; width: auto; display: block; }
.header-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
  border-left: 1px solid var(--line);
  padding-left: 18px;
}
.lang-toggle {
  display: inline-flex;
  background: var(--gray-bg);
  border-radius: 999px;
  padding: 3px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.lang-toggle button {
  background: transparent;
  border: 0;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.lang-toggle button.active {
  background: var(--navy);
  color: #fff;
}

/* ----- Hero (PO entry) ----- */
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px 80px;
}
.hero-card {
  width: 100%;
  max-width: 640px;
  text-align: center;
}
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 16px;
}
.hero h1 {
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 16px;
  color: var(--navy);
}
.hero p.sub {
  color: var(--ink-2);
  font-size: 17px;
  max-width: 480px;
  margin: 0 auto 36px;
  text-wrap: pretty;
}
.po-form {
  display: flex;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.po-form:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(10,37,64,0.08), var(--shadow);
}
.po-form input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 18px;
  padding: 14px 16px;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.po-form input::placeholder {
  color: var(--muted-2);
  letter-spacing: 0.04em;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0 22px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.12s;
}
.btn-primary:hover { background: var(--navy-2); }
.btn-primary:disabled { background: var(--muted-2); cursor: not-allowed; }
.btn-secondary {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.12s;
}
.btn-secondary:hover { background: var(--surface); border-color: var(--ink-2); color: var(--ink); }
.btn-link {
  background: transparent; border: 0; color: var(--red); font-weight: 500;
  text-decoration: none; padding: 0;
}
.btn-link:hover { text-decoration: underline; }

.hero-help {
  margin-top: 28px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}
.hero-help .sample {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--gray-bg);
  border: 1px dashed var(--line-strong);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink-2);
}
.hero-help .sample:hover { background: var(--surface); border-color: var(--navy); }

.error {
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid #f5c4c1;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 16px;
  text-align: left;
}

/* ----- Tracking screen ----- */
.tracking {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}
.t-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 22px;
}
.t-back:hover { color: var(--navy); }

.summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}
.summary-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.summary-po-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.summary-po {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.summary-ov {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  background: var(--gray-bg);
  padding: 4px 10px;
  border-radius: 6px;
}
.summary-status {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--good-soft);
  color: var(--good);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.status-pill.processing { background: #eaf1fb; color: #1c4ea3; }
.status-pill.sourcing   { background: #fff3e6; color: #b15c00; }
.status-pill.qc         { background: #efeafd; color: #5a3fb0; }
.status-pill.shipping   { background: #e6f1ff; color: #1c4ea3; }
.status-pill.delivered  { background: var(--good-soft); color: var(--good); }
.status-dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }
.status-dot.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50% { box-shadow: 0 0 0 6px transparent; opacity: 0.6; }
}
.status-eta {
  font-size: 13px;
  color: var(--ink-2);
}
.status-eta strong { color: var(--ink); font-weight: 600; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.summary-grid .cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cell-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.cell-value {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}
.cell-value.mono { font-family: var(--mono); font-size: 13px; }

/* ----- Progress bar (overall) ----- */
.progress-rail {
  display: flex;
  gap: 6px;
  margin-bottom: 28px;
  padding: 0 4px;
}
.progress-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.progress-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  position: relative;
}
.progress-fill {
  position: absolute; inset: 0;
  background: var(--navy);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.1, 1);
}
.progress-fill.partial { background: var(--red); }
.progress-label {
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.progress-step.active .progress-label { color: var(--red); }
.progress-step.done .progress-label { color: var(--navy); }

/* ----- Stage accordion ----- */
.stages { display: flex; flex-direction: column; gap: 12px; }
.stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}
.stage.locked { background: var(--gray-bg); border-color: var(--line); }
.stage.active { border-color: var(--navy); box-shadow: var(--shadow); }

.stage-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.stage.locked .stage-head { cursor: not-allowed; }
.stage-num {
  width: 32px; height: 32px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  background: var(--gray-bg);
  color: var(--muted);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.stage.done .stage-num { background: var(--navy); color: #fff; }
.stage.active .stage-num { background: var(--red); color: #fff; }

.stage-title-wrap { flex: 1; min-width: 0; }
.stage-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.stage.locked .stage-title { color: var(--muted); }
.stage-meta {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 2px;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}
.stage.locked .stage-meta { color: var(--muted-2); }

.stage-state {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--gray-bg);
  color: var(--muted);
  flex-shrink: 0;
}
.stage.done .stage-state { background: rgba(31, 138, 91, 0.1); color: var(--good); }
.stage.active .stage-state { background: var(--red-soft); color: var(--red); }

.stage-chevron {
  width: 18px; height: 18px;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.2s;
}
.stage.open .stage-chevron { transform: rotate(180deg); }

.stage-body {
  border-top: 1px solid var(--line);
  padding: 22px 24px 24px;
  background: #fafaf6;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.stage.locked .stage-body { background: var(--gray-bg); color: var(--muted); }

/* ----- Sub-items ----- */
.sub-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.sub-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.sub-icon {
  width: 22px; height: 22px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.sub-icon.done { background: var(--navy); color: #fff; }
.sub-icon.pending { background: var(--gray-bg); color: var(--muted); }
.sub-icon.active { background: var(--red); color: #fff; }
.sub-icon svg { width: 12px; height: 12px; }
.sub-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.005em;
}
.sub-locked .sub-title { color: var(--muted); }
.sub-desc {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 2px;
}
.sub-locked .sub-desc { color: var(--muted-2); }
.sub-time {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.sub-body { padding-left: 34px; }
.sub-note {
  font-size: 13px;
  color: var(--ink-2);
  font-style: italic;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--navy);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}
.code-chip.red { background: var(--red); }
.code-chip.muted { background: var(--gray-bg); color: var(--ink-2); }

/* ETA table */
.eta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface);
  border-radius: var(--radius-xs);
  overflow: hidden;
}
.eta-table th, .eta-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.eta-table th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: #fafaf6;
  font-weight: 500;
}
.eta-table tr:last-child td { border-bottom: 0; }
.eta-table td.mono { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.eta-table td.qty { font-variant-numeric: tabular-nums; }
.received-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-family: var(--mono);
  background: var(--good-soft);
  color: var(--good);
  padding: 2px 8px;
  border-radius: 999px;
}
.received-pill.partial { background: #fff3e6; color: #b15c00; }
.received-pill.none { background: var(--gray-bg); color: var(--muted); }

/* QC bar */
.qc-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qc-bar {
  height: 32px;
  background: var(--gray-bg);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.qc-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--navy-soft));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.1, 1);
}
.qc-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.qc-bar-text .on-fill { color: #fff; }
.qc-bar-text .on-track { color: var(--ink); }

/* Logistics map section */
.logistics-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.logistics-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 16px; flex-wrap: wrap; }
.logistics-title { font-size: 17px; font-weight: 600; color: var(--navy); letter-spacing: -0.01em; }
.logistics-sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.map-real { background: #f4f1ea; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.map-real svg { display: block; width: 100%; height: auto; }

/* Leaflet container */
.leaflet-map {
  width: 100%;
  height: clamp(300px, 50vw, 480px);
  border-radius: 10px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #f4f1ea;
}
.leaflet-container { font-family: var(--sans); }
.leaflet-tooltip {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  white-space: nowrap;
}
.leaflet-tooltip-top:before { border-top-color: var(--line); }

/* VEX selector */
.vex-selector { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.vex-tab {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px;
  font-family: var(--mono); font-size: 12px;
  color: var(--ink-2); cursor: pointer; transition: all 0.12s;
}
.vex-tab:hover { border-color: var(--ink-2); }
.vex-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.vex-tab .vex-status-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--muted); }
.vex-tab .vex-status-dot.invoiced { background: #b15c00; }
.vex-tab .vex-status-dot.in-transit { background: #1c4ea3; }
.vex-tab .vex-status-dot.delivered { background: var(--good); }
.vex-tab.active .vex-status-dot { background: #fff; }

.vex-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.vex-meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.vex-meta .label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.vex-meta .value { font-size: 13px; color: var(--ink); font-weight: 500; margin-top: 2px; }
.vex-meta .value.mono { font-family: var(--mono); font-size: 12px; }

/* Order progress widget */
.order-progress {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.order-progress-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--gray-bg); }
.order-progress-bar .seg { height: 100%; transition: width 0.6s cubic-bezier(0.4,0,0.1,1); }
.order-progress-bar .seg.delivered { background: var(--good); }
.order-progress-bar .seg.shipped   { background: #1c4ea3; }
.order-progress-bar .seg.invoiced  { background: #b15c00; }
.order-progress-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.order-progress-legend .lp { display: inline-flex; align-items: center; gap: 6px; }
.order-progress-legend .swatch { width: 10px; height: 10px; border-radius: 3px; }
.order-progress-legend .swatch.delivered { background: var(--good); }
.order-progress-legend .swatch.shipped   { background: #1c4ea3; }
.order-progress-legend .swatch.invoiced  { background: #b15c00; }
.order-progress-legend .swatch.pending   { background: var(--gray-bg); border: 1px solid var(--line-strong); }
.order-progress-legend strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Invoice summary cards */
.invoice-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.inv-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.inv-card .label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.inv-card .value { font-size: 22px; font-weight: 600; color: var(--navy); font-family: var(--mono); margin-top: 4px; }
.inv-card .sub { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.inv-card.pending .value { color: #b15c00; }

/* Expandable QC item */
.qc-item-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.12s;
}
.qc-item-row.open { border-color: var(--navy); }
.qc-item-head {
  width: 100%; background: transparent; border: 0;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px;
  cursor: pointer; text-align: left; color: inherit;
}
.qc-item-head:hover { background: #fafaf6; }
.qc-item-sku { font-family: var(--mono); font-size: 12px; color: var(--ink-2); width: 80px; flex-shrink: 0; }
.qc-item-desc { flex: 1; min-width: 0; font-size: 13px; }
.qc-item-progress {
  width: 120px; height: 6px; background: var(--gray-bg);
  border-radius: 999px; overflow: hidden; flex-shrink: 0;
}
.qc-item-progress .fill { height: 100%; background: var(--good); transition: width 0.3s; }
.qc-item-progress .fill.partial { background: #b15c00; }
.qc-item-progress .fill.none    { background: var(--muted-2); }
.qc-item-count {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--ink); width: 60px; text-align: right; flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.qc-item-chevron { width: 14px; height: 14px; color: var(--muted); transition: transform 0.2s; flex-shrink: 0; }
.qc-item-row.open .qc-item-chevron { transform: rotate(180deg); }
.qc-item-body { border-top: 1px solid var(--line); padding: 12px 14px 14px; background: #fafaf6; }
.receipt-list { display: flex; flex-direction: column; gap: 8px; }
.receipt-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 8px 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px;
}
.receipt-row .receipt-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--good); margin-top: 5px; flex-shrink: 0;
}
.receipt-row .receipt-meta { flex: 1; min-width: 0; }
.receipt-row .receipt-date { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.receipt-row .receipt-qty { font-size: 13px; color: var(--ink); font-weight: 500; }
.receipt-row .receipt-note { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.qc-pending-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-family: var(--mono);
  background: #fff3e6; color: #b15c00;
  padding: 4px 8px; border-radius: 6px; margin-top: 8px;
}

/* Items table inside VEX */
.vex-items-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vex-items-table th, .vex-items-table td {
  text-align: left; padding: 8px 10px;
  border-bottom: 1px solid var(--line); vertical-align: middle;
}
.vex-items-table th {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
.vex-items-table tr:last-child td { border-bottom: 0; }
.vex-items-table td.mono { font-family: var(--mono); font-size: 12px; }
.vex-items-table td.num  { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.vex-items-table tfoot td { font-weight: 600; color: var(--navy); border-top: 2px solid var(--line-strong); border-bottom: 0; }

@media (max-width: 720px) {
  .invoice-summary { grid-template-columns: 1fr; }
  .vex-meta-grid { grid-template-columns: repeat(2, 1fr); }
  .qc-item-progress { display: none; }
}

/* Delivered cell */
.delivery-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.delivery-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--good-soft);
  border-radius: 8px;
  border: 1px solid #cfe6db;
}
.delivery-status .check {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--good);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.delivery-status .check svg { width: 14px; height: 14px; }
.delivery-status-text { display: flex; flex-direction: column; }
.delivery-status-text strong { color: var(--ink); font-weight: 600; }
.delivery-status-text span { font-size: 12px; color: var(--ink-2); }
.delivery-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.delivery-actions .dispute-note { font-size: 12px; color: var(--muted); }

.locked-empty {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  flex-wrap: wrap;
  gap: 12px;
}
.footer .footer-help { display: flex; gap: 16px; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--red); }

/* Responsive */
@media (max-width: 720px) {
  .header { padding: 14px 18px; }
  .header-meta { display: none; }
  .hero h1 { font-size: 40px; }
  .hero p.sub { font-size: 15px; }
  .tracking { padding: 22px 14px 60px; }
  .summary { padding: 22px 18px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .summary-po { font-size: 20px; white-space: normal; }
  .summary-status { text-align: left; align-items: flex-start; }
  .stage-head { padding: 16px 16px; }
  .stage-state { display: none; }
  .stage-body { padding: 18px 16px 20px; }
  .progress-rail { padding: 0; gap: 4px; }
  .progress-label { font-size: 10px; }
}
