:root {
  --navy: #1F3A5F;
  --red: #C00000;
  --body: #1b2430;
  --screen-bg: #f4f6f8;
  --hairline: #d4d9df;
  --card: #ffffff;
  --muted: #5a6570;
  --teal: #0d6b5c;
  --purple: #5b3d8a;
  --amber: #9a5b00;
  --steel: #2d6a8f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  color: var(--body);
  font-size: 17px;
  line-height: 1.4;
  background: var(--screen-bg);
}

button, input, select { font: inherit; color: inherit; }

button { cursor: pointer; }

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.page {
  max-width: 920px;
  margin: 16px auto 48px;
  padding: 0 12px 24px;
}

.header {
  background: var(--navy);
  color: #fff;
  padding: 14px 18px 12px;
  border-bottom: 4px solid var(--red);
  border-radius: 4px 4px 0 0;
}

.header-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #fff;
  object-fit: cover;
  flex: 0 0 auto;
}

.titles { min-width: 0; flex: 1; }

.kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.header h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.header .meta {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.35;
  opacity: 0.95;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
}

.btn {
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 10px 14px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}

.btn.ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

.btn.print {
  background: var(--red);
  color: #fff;
  font-size: 17px;
  padding: 12px 16px;
}

.btn.small {
  background: #fff;
  color: var(--navy);
  border-color: var(--hairline);
  padding: 6px 10px;
  font-size: 14px;
}

.btn:disabled { opacity: 0.6; cursor: wait; }

.sample-banner {
  background: var(--red);
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
  font-size: 15px;
}

.warn-banner {
  background: #fff4e5;
  color: var(--body);
  border-bottom: 1px solid var(--hairline);
  padding: 10px 16px;
  font-size: 15px;
}

.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-top: none;
}

.toolbar {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--hairline);
  background: #fbfcfd;
}

.store-block { margin-bottom: 14px; }

.lbl-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.lbl-row.spread { justify-content: space-between; }

.store-block .lbl { margin-bottom: 8px; }

.store-hint { margin: 8px 0 0; }

.lbl {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--navy);
}

.hint-inline {
  font-size: 13px;
  color: var(--muted);
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seg button {
  border: 1px solid var(--hairline);
  background: #fff;
  color: var(--navy);
  border-radius: 4px;
  padding: 10px 16px;
  font-weight: 700;
  min-height: 44px;
}

.seg button[aria-pressed="true"] {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

select, input[type="text"] {
  width: 100%;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: #fff;
  padding: 10px 12px;
  min-height: 44px;
}

.date-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 280px;
  overflow: auto;
}

.date-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px 4px;
  font-size: 16px;
  min-height: 40px;
}

.date-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--navy);
}

.date-row .when { color: var(--muted); font-size: 14px; }

.date-row .when.old { color: var(--red); font-weight: 700; }

.date-row .count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--navy);
  min-width: 4.5em;
  text-align: right;
}

.sku-result { margin-top: 10px; }

.hint { margin: 0; color: var(--muted); font-size: 14px; }

.sku-card {
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--navy);
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #fff;
}

.sku-card.coupon { border-left-color: var(--red); }

.sku-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.sku-card .code {
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
}

.sku-card .pname { font-weight: 600; }
.aging .hint { padding: 0 16px 14px; }

input::placeholder { color: #8a94a0; }

.sku-card .sku-qty {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.sku-card .sku-qty.multi { color: var(--red); font-size: 20px; }

.sku-card ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.sku-card li { font-size: 14px; }

.more { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  font-size: 15px;
}

.summary strong { color: var(--navy); }

.summary .quiet { color: var(--muted); }

.section-banner {
  background: var(--navy);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 14px;
  margin: 14px 12px 0;
  border-radius: 2px;
}

.section-banner.nb { background: var(--teal); }
.section-banner.ns { background: var(--purple); }
.section-banner.cf { background: var(--amber); }
.section-banner.cb { background: var(--steel); }
.section-banner.other { background: var(--navy); }

table.pick {
  width: calc(100% - 24px);
  margin: 0 12px;
  border-collapse: collapse;
}

table.pick th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--navy);
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--hairline);
  font-weight: 700;
}

table.pick td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
  font-size: 17px;
}

table.pick tr:last-child td { border-bottom: none; }

table.pick .sku {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  width: 1%;
  padding-right: 14px;
}

table.pick .name { font-size: 18px; font-weight: 600; color: var(--body); }

table.pick .orders {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

table.pick .qty {
  text-align: right;
  width: 1%;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  font-weight: 700;
  color: var(--body);
}

table.pick .qty.multi {
  color: var(--red);
  font-size: 26px;
  font-weight: 800;
}

table.pick .check { width: 36px; text-align: center; }

.tick {
  width: 26px;
  height: 26px;
  border: 2px solid var(--navy);
  background: #fff;
  border-radius: 3px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tick[aria-pressed="true"] { background: var(--navy); }

.tick[aria-pressed="true"]::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.row-accent.nb td:first-child { box-shadow: inset 4px 0 0 var(--teal); }
.row-accent.ns td:first-child { box-shadow: inset 4px 0 0 var(--purple); }
.row-accent.cf td:first-child { box-shadow: inset 4px 0 0 var(--amber); }
.row-accent.cb td:first-child { box-shadow: inset 4px 0 0 var(--steel); }
.row-accent.other td:first-child { box-shadow: inset 4px 0 0 var(--navy); }

tr.hit td { background: #fff6d8; }

.empty-sheet {
  padding: 28px 16px;
  color: var(--muted);
  font-size: 16px;
}

.coupons {
  margin: 22px 12px 8px;
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--red);
  background: #fff;
  break-inside: avoid;
}

.coupons .c-head {
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 10px 14px 0;
}

.coupons .c-note {
  font-size: 13px;
  color: var(--body);
  padding: 2px 14px 8px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid var(--hairline);
}

.coupons table { width: 100%; border-collapse: collapse; }

.coupons td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--hairline);
  font-size: 16px;
  vertical-align: top;
}

.coupons tr:last-child td { border-bottom: none; }

.coupons .cq {
  text-align: right;
  font-weight: 800;
  color: var(--red);
  font-size: 20px;
  white-space: nowrap;
  width: 1%;
}

.coupons .orders {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 400;
}

.footer-note {
  padding: 12px 16px 16px;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.aging {
  background: #fff;
  border-bottom: 1px solid var(--hairline);
}

.aging summary {
  cursor: pointer;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

.aging summary:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: -2px;
}

.aging .scroll { max-height: 360px; overflow: auto; }

table.aging-table {
  width: 100%;
  border-collapse: collapse;
}

table.aging-table th,
table.aging-table td {
  text-align: left;
  padding: 8px 12px;
  border-top: 1px solid var(--hairline);
  font-size: 15px;
  vertical-align: top;
}

table.aging-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--navy);
  position: sticky;
  top: 0;
  background: #fff;
}

table.aging-table td.num,
table.aging-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table.aging-table tr.off { opacity: 0.45; }

table.aging-table .old { color: var(--red); font-weight: 700; }

@media (max-width: 800px) {
  .tool-grid { grid-template-columns: 1fr; }
  .header-row { flex-wrap: wrap; }
  .header-actions { width: 100%; }
  .header-actions .print { flex: 1; }
  .page { margin-top: 0; padding: 0 0 24px; }
  .header { border-radius: 0; }
  table.pick .name { font-size: 16px; }
}

@media print {
  html, body { background: #fff; font-size: 14px; }
  .page { margin: 0; max-width: none; padding: 0; }
  .no-print { display: none !important; }
  .header { border-radius: 0; }
  .header h1 { font-size: 22px; }
  .card { border: none; }
  .section-banner { margin-left: 0; margin-right: 0; }
  table.pick { width: 100%; margin: 0; }
  table.pick td { font-size: 14px; padding: 6px 8px; }
  table.pick .name { font-size: 15px; }
  table.pick .qty { font-size: 16px; }
  table.pick .qty.multi { font-size: 20px; color: #C00000 !important; }
  .coupons { margin-left: 0; margin-right: 0; }
  .coupons .cq { color: #C00000 !important; }
  .tick { width: 16px; height: 16px; }
  .header,
  .section-banner,
  .sample-banner,
  table.pick .qty.multi,
  .coupons .cq,
  .tick[aria-pressed="true"] {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .section-banner, table.pick tr, .coupons { break-inside: avoid; }
  .section-banner { break-after: avoid; }
  thead { display: table-header-group; }
}

@page { margin: 0.5in; }
