/* Guardian Orders — one hand-written, mobile-first stylesheet. */
/* Nunito (SIL Open Font License, assets/fonts/OFL.txt), one variable file for all weights */
@font-face {
  font-family: "Nunito";
  src: url("fonts/nunito-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}
:root {
  /* Warm, rounded look: cream canvas, coral accent, soft pastel tiles */
  --bg: #fbf7f0;
  --card: #ffffff;
  --card-2: #f6f0e7;          /* soft fill: secondary buttons, table heads */
  --ink: #2b2522;
  --muted: #6e6660;
  --line: #ece4d8;
  --accent: #c4502a;           /* coral: buttons (white text passes AA) */
  --accent-text: #a9441f;      /* coral for links and text */
  --accent-ink: #ffffff;
  --accent-soft: #fce9e0;
  --accent-deco-1: #f3a07e;    /* decorative circles on hero cards */
  --accent-deco-2: #f2b33d;
  --blue-soft: #e6f1fb; --blue-ink: #0c447c;
  --yellow-soft: #fcefd2; --yellow-ink: #7a4a06;
  --green-soft: #e6f2dc; --green-ink: #2f5b10;
  --lilac-soft: #eeedfe; --lilac-ink: #3c3489;
  --warn: #8a5300;
  --warn-soft: #fcefd2;
  --bad: #b42318;
  --bad-soft: #fde8e7;
  --ok: #2f6b14;
  --ok-soft: #e6f2dc;
  --info-soft: #e6f1fb;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(80, 50, 20, .04), 0 6px 20px rgba(80, 50, 20, .06);
  --tabbar-h: 66px;
  --font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1c30;
    --card: #25273f;
    --card-2: #2e3150;
    --ink: #f3eee8;
    --muted: #a9a6b8;
    --line: #363955;
    --accent: #ff8a5c;
    --accent-text: #ff9a70;
    --accent-ink: #2a1206;
    --accent-soft: #46303a;
    --accent-deco-1: #c4502a;
    --accent-deco-2: #b97813;
    --blue-soft: #1f3555; --blue-ink: #b5d4f4;
    --yellow-soft: #43361a; --yellow-ink: #fac775;
    --green-soft: #22391a; --green-ink: #c0dd97;
    --lilac-soft: #33305a; --lilac-ink: #cecbf6;
    --warn: #fac775;
    --warn-soft: #43361a;
    --bad: #ff8f86;
    --bad-soft: #4a2027;
    --ok: #9fd27a;
    --ok-soft: #22391a;
    --info-soft: #1f3555;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
}
body.out { padding-bottom: 0; }
a { color: var(--accent-text); }
h1 { font-size: 1.75rem; line-height: 1.2; margin: .2em 0 .5em; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin: 1.4em 0 .6em; font-weight: 800; }
.card > h2:first-child, section > h2:first-child { margin-top: 0; }
h3 { font-size: 1rem; margin: 1.2em 0 .4em; font-weight: 800; }
code { font: .9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--accent-soft); padding: .05em .35em; border-radius: 5px; }
.big-code { font-size: 1.2em; letter-spacing: .05em; user-select: all; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 16px; }

/* Header + navigation */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.05rem; }
.brand img { border-radius: 10px; }
.topnav { display: none; gap: 4px; margin-left: auto; }
.topnav a { color: var(--muted); text-decoration: none; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: .95rem; }
.topnav a:hover { background: var(--card-2); color: var(--ink); }
.topnav a[aria-current] { background: var(--accent-soft); color: var(--accent-text); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: var(--card); box-shadow: 0 -4px 20px rgba(80, 50, 20, .06);
  border-radius: 22px 22px 0 0; padding: 0 6px env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tabbar-h); color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 700;
}
.tabbar a .ic { width: 46px; height: 28px; padding: 3px 12px; border-radius: 999px; }
.tabbar a[aria-current] { color: var(--accent-text); }
.tabbar a[aria-current] .ic { background: var(--accent-soft); }
@media (min-width: 760px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  body { padding-bottom: 32px; }
  .wrap { padding: 24px; }
}

/* Cards, lists */
.card { background: var(--card); border: 0; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin: 0 0 18px; }
.narrow { max-width: 480px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.hero { padding: 24px; }
.hero h1 { margin-top: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1 .small { font-weight: 400; }
.list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list li + li { border-top: 1px solid var(--line); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; color: inherit; text-decoration: none; }
.list-row:hover { background: var(--card-2); }
.row-title { font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.right { text-align: right; flex: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.menu .list-row { font-size: 1rem; }
ul.plain { list-style: none; padding: 0; margin: 0 0 12px; }
.file-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 0 16px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.card .stats { grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--card); border: 0; border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat-n { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-l { color: var(--muted); font-size: .85rem; }
.stat-big { background: var(--accent-soft); box-shadow: none; }
.stat-big .stat-n { font-size: 2.2rem; color: var(--accent-text); }
.stat-alert { background: var(--yellow-soft); box-shadow: none; }
.stat-alert .stat-n { color: var(--warn); }

/* Badges, flash, warnings */
.badge { display: inline-block; font-size: .75rem; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--card-2); color: var(--muted); vertical-align: middle; }
.badge-needs_input { background: var(--warn-soft); color: var(--warn); }
.badge-ready { background: var(--blue-soft); color: var(--blue-ink); }
.badge-exported { background: var(--ok-soft); color: var(--ok); }
.flash { padding: 14px 18px; border-radius: 18px; margin: 0 0 16px; background: var(--info-soft); }
.flash-ok { background: var(--ok-soft); }
.flash-error { background: var(--bad-soft); color: var(--bad); }
.warnings { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 6px; }
.warnings li { padding: 11px 14px 11px 40px; border-radius: 16px; position: relative; font-size: .92rem; }
.warnings li::before { position: absolute; left: 12px; top: 9px; font-weight: 700; }
.w-warn { background: var(--warn-soft); }
.w-warn::before { content: "!"; color: var(--warn); }
.w-info { background: var(--info-soft); }
.w-info::before { content: "i"; color: var(--blue-ink); }
.field-error { color: var(--bad); font-size: .9rem; margin: 6px 0 0; }

/* Forms */
label { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: .9rem; }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; }
label.check input { margin-top: 4px; width: 18px; height: 18px; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--card);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; min-height: 46px; width: 100%;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 0; border-color: var(--accent); }
.hint { font-weight: 400; font-size: .82rem; color: var(--muted); }
.hint.bad { color: var(--bad); font-weight: 600; }
.hint.good { color: var(--ok); }
.grid2, .grid3 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: 1fr 1fr 2fr; } }
fieldset.resolve { border: 1.5px solid var(--line); border-radius: 18px; padding: 14px 16px 16px; margin: 0; }
fieldset.resolve legend { font-weight: 800; padding: 0 6px; }
fieldset.has-error { border-color: var(--bad); }
.missing { box-shadow: 0 0 0 2px var(--yellow-soft), var(--shadow); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0 0 16px; }
.filters label { flex: 1 1 140px; }
.filter-buttons { display: flex; gap: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 800; min-height: 46px; padding: 10px 20px; border-radius: 999px;
  border: 0; background: var(--card-2); color: var(--ink); cursor: pointer; text-decoration: none;
  transition: transform .08s ease, background-color .15s ease, filter .15s ease;
}
.btn:active { transform: scale(.98); }
label.btn { flex-direction: row; font-size: 1rem; }
.btn:hover { background: var(--line); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-big { min-height: 56px; padding: 14px 26px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-small { min-height: 34px; padding: 5px 14px; font-size: .85rem; }
.btn-ghost { background: transparent; color: var(--accent-text); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { color: var(--bad); background: var(--bad-soft); }
.btn-danger:hover { background: var(--bad-soft); filter: brightness(.97); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); text-decoration: underline; cursor: pointer; }
.upload { margin-top: 8px; }
.upload .btn-big { width: 100%; }
@media (min-width: 640px) { .upload .btn-big { width: auto; } }
.is-busy { opacity: .6; pointer-events: none; }
.danger-zone { margin: 24px 0; text-align: right; }

/* Downloads */
.downloads { display: grid; gap: 10px; margin: 0 0 14px; }
@media (min-width: 640px) { .downloads { grid-template-columns: 1fr 1fr; } }
.download { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 18px; border: 0; text-decoration: none; color: var(--ink); background: var(--accent-soft); font-weight: 700; }
.download span span { display: block; word-break: break-all; }
.download .ic { color: var(--accent-text); width: 26px; height: 26px; }
.download:hover { filter: brightness(.98); }

/* Tables: scroll sideways on phones */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--card); border: 0; border-radius: 18px; margin: 0 0 16px; box-shadow: var(--shadow); }
.card .table-scroll { box-shadow: none; border: 1.5px solid var(--line); }
.table-scroll .table-scroll { border: 0; margin: 6px 0 0; }
.table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.table th, .table td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table th { font-size: .8rem; font-weight: 800; color: var(--muted); background: var(--card-2); white-space: nowrap; }
.table th.num, .table td.num { text-align: right; }
.table tr:last-child td { border-bottom: 0; }
.table tr.sub td { border-top: 0; padding-top: 0; }
.table-tight th, .table-tight td { padding: 5px 8px; }
.table tr.inactive td { color: var(--muted); }
.diff { background: var(--warn-soft); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.diff form { margin-top: 4px; }
details summary { cursor: pointer; color: var(--accent); }
del { color: var(--bad); }

/* Rules page */
.rules dt { font-weight: 700; margin-top: 14px; }
.rules dd { margin: 4px 0 0; color: var(--muted); }

/* Login */
.login { max-width: 400px; margin: 8vh auto 0; text-align: center; }
.login form, .login .card { text-align: left; }
.login-logo { border-radius: 14px; }

/* Pick list (screen + A4 print) */
.picklist h1 { margin-bottom: 0; }
.pick td, .pick th { font-size: 1rem; }
.pick .tick { width: 44px; text-align: center; }
.pick td.tick { border: 1px solid var(--line); }
.pick tfoot th { font-size: 1rem; color: var(--ink); text-transform: none; border-top: 2px solid var(--ink); }
@media print {
  @page { size: A4; margin: 14mm; }
  :root { --bg: #fff; --card: #fff; --ink: #000; --muted: #444; --line: #bbb; }
  body { background: #fff; padding: 0; font-size: 11pt; }
  .top, .tabbar, .noprint, .flash { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .table-scroll { border: 0; overflow: visible; }
  .pick th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pick tr { break-inside: avoid; }
  .pick thead { display: table-header-group; }
  a { color: #000; text-decoration: none; }
}

/* Ranging picker */
fieldset.pick-group { border: 0; padding: 0; margin: 0 0 14px; }
fieldset.pick-group legend { font-weight: 700; padding: 6px 0; display: flex; gap: 10px; align-items: baseline; }
label.pick { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); margin: 0 0 6px; cursor: pointer; }
label.pick input { width: 20px; height: 20px; min-height: 0; margin-top: 2px; flex: none; }
label.pick:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
label.pick.inactive { opacity: .65; }
@media (min-width: 760px) {
  fieldset.pick-group { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8px; }
  fieldset.pick-group legend { grid-column: 1 / -1; }
}
input[data-filter] { width: 200px; }
.range-order { columns: 2 280px; margin: 0; padding-left: 22px; }
.range-order li { break-inside: avoid; margin-bottom: 2px; }

/* Allocation editor */
.alloc-store h2 { margin: 0 0 2px; }
.fill-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.inline-label { flex-direction: row; align-items: center; gap: 6px; font-weight: 600; font-size: .85rem; }
.inline-label select { width: auto; min-height: 34px; padding: 4px 8px; }
.qty-mini { width: 64px; min-height: 34px; padding: 4px 8px; }
.alloc-table input.qty { width: 72px; min-height: 38px; padding: 6px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.alloc-table input.qty:placeholder-shown { background: var(--warn-soft); }
.alloc-table td { vertical-align: middle; }
.alloc-total { font-size: 1.05rem; margin: 6px 0 12px; text-align: right; }
.combine-bar { position: sticky; top: 64px; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; }
.alloc-list .outlets { padding: 0 14px 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.alloc-list label.outlet { font-size: .9rem; }
.alloc-list label.outlet input { width: 20px; height: 20px; min-height: 0; margin-top: 1px; }
@media (max-width: 759px) { .combine-bar { top: 56px; } }
.store-pick { display: flex; flex-direction: column; }
.range-choice { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 0 10px 8px 40px; }
.range-choice label.check { font-weight: 400; gap: 6px; }
.range-choice label.check input { margin-top: 2px; width: 16px; height: 16px; min-height: 0; }
.range-choice label.check { flex-direction: row; align-items: center; display: inline-flex; }
.start-choice { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.start-choice legend { font-weight: 700; padding: 6px 0; }
.copy-store { padding-left: 28px; }
.inline-email { display: inline-flex; gap: 4px; margin-left: 6px; }
.inline-email input { width: 170px; min-height: 34px; padding: 4px 8px; }
.excl-table td { vertical-align: middle; }
.excl-table input[type=checkbox] { width: 20px; height: 20px; min-height: 0; }
.excl-reason { min-width: 340px; }
.excl-reason select, .excl-reason input { min-height: 36px; padding: 5px 8px; font-size: .9rem; }
.excl-reason input { margin-top: 4px; }
.promo-table input.qty { width: 80px; }
.promo-table td { vertical-align: middle; }
.promo-table input[type=checkbox] { width: 18px; height: 18px; min-height: 0; }
@media (min-width: 760px) { .phone-only { display: none !important; } }

/* Sales */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.subnav a { padding: 7px 16px; text-decoration: none; color: var(--muted); font-weight: 800; font-size: .92rem; border-radius: 999px; background: var(--card-2); }
.subnav a[aria-current] { color: var(--accent-ink); background: var(--accent); }
.stats-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .stats-4 { grid-template-columns: repeat(4, 1fr); } }
svg.chart { width: 100%; height: auto; display: block; margin: 4px 0 8px; overflow: visible; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
svg.chart .bar path { fill: var(--accent); }
svg.chart .bar.weekend path { fill: var(--accent); opacity: .62; }
svg.chart .bar .hit { fill: transparent; }
svg.chart .bar:hover path { opacity: .85; }
svg.chart .bar:hover .hit { fill: var(--accent-soft); opacity: .5; }
svg.chart .ref { stroke: var(--warn); stroke-width: 2; stroke-dasharray: 5 4; }
svg.chart .ref-label { fill: var(--warn); font-weight: 600; }
.cover-low { color: var(--bad); font-weight: 700; }
.cover-high { color: var(--muted); }

/* Backups */
.inline-details { display: inline-block; vertical-align: middle; }
.inline-details summary { list-style: none; }
.inline-details summary::-webkit-details-marker { display: none; }
.inline-details[open] .restore-form { margin-top: 8px; white-space: normal; max-width: 320px; }
code.break { word-break: break-all; }
fieldset.plain { border: 0; padding: 0; margin: 0; }
fieldset.plain legend { font-weight: 700; padding: 0 0 6px; }
/* Activity log */
.activity-detail { color: var(--muted); word-break: break-word; }
.storage-total { font-size: 1.4rem; margin: 0 0 8px; }
.bad { color: var(--bad); }
/* SiteGiant SKU suggestions on a new item */
.sku-suggest { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.sku-pick { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card, transparent); color: inherit; font: inherit; cursor: pointer; }
.sku-pick:hover { border-color: var(--accent); }
.sku-pick.picked { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* Hero card: the one bold coral card per page, with soft decorative circles */
.hero-accent { position: relative; overflow: hidden; background: var(--accent); color: var(--accent-ink); }
.hero-accent { isolation: isolate; }
.hero-accent::before, .hero-accent::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; z-index: -1; }
.hero-accent::before { width: 190px; height: 190px; right: -60px; top: -70px; background: var(--accent-deco-1); opacity: .55; }
.hero-accent::after { width: 120px; height: 120px; right: 50px; bottom: -70px; background: var(--accent-deco-2); opacity: .55; }
.hero-accent > * { position: relative; z-index: 1; }
.hero-accent a { color: inherit; }
.hero-accent .muted { color: inherit; opacity: .9; }
.hero-accent code { background: rgba(255, 255, 255, .2); }
.hero-accent .btn-primary { background: var(--card); color: var(--accent-text); }
.hero-accent .btn-primary:hover { filter: none; background: var(--card-2); }

/* Home: greeting, tiles, quick links */
.greeting { margin: 4px 0 14px; }
.greeting p { margin: 0; font-weight: 700; }
.greeting h1 { margin: 0; font-size: 2rem; }
.hero-accent h2 { font-size: 1.45rem; margin: 0 0 6px; }
.hero-accent p { margin: 0 0 4px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); } }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: 22px; text-decoration: none; min-height: 126px; transition: transform .08s ease; }
.tile:active { transform: scale(.98); }
@media (max-width: 759px) { .tile:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 0; } }
.tile .ic { width: 26px; height: 26px; margin-bottom: 8px; }
.tile-l { font-size: .85rem; font-weight: 700; }
.tile-n { font-size: 1.45rem; font-weight: 900; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile-s { font-size: .78rem; font-weight: 600; opacity: .85; }
.tile-blue { background: var(--blue-soft); color: var(--blue-ink); }
.tile-yellow { background: var(--yellow-soft); color: var(--yellow-ink); }
.tile-green { background: var(--green-soft); color: var(--green-ink); }
.tile-lilac { background: var(--lilac-soft); color: var(--lilac-ink); }
.quick { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; margin: 0 0 8px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 16px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; font-weight: 800; font-size: .9rem; }
.chip:hover { background: var(--card-2); }

/* Phase 3: page headers, charts on phones, PO tiles */
h1 > .small, h1 > .muted.small { display: block; font-size: .92rem; font-weight: 700; letter-spacing: 0; margin-top: 2px; }
@media (max-width: 759px) {
  .chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -6px; padding: 0 6px; }
  svg.chart-wide { min-width: 640px; }
}
svg.chart .axis { font-size: 12px; }
.stat-good { background: var(--green-soft); box-shadow: none; }
.stat-good .stat-n { color: var(--green-ink); }
.stat-good .stat-l { color: var(--green-ink); }
@media (max-width: 639px) { .stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.table td.nowrap a, .table td a.nowrap { white-space: nowrap; }
/* More menu: round pastel icons */
.menu-ic { flex: none; width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.menu-ic .ic { width: 21px; height: 21px; }
.tint-blue { background: var(--blue-soft); color: var(--blue-ink); }
.tint-yellow { background: var(--yellow-soft); color: var(--yellow-ink); }
.tint-green { background: var(--green-soft); color: var(--green-ink); }
.tint-lilac { background: var(--lilac-soft); color: var(--lilac-ink); }
.tint-coral { background: var(--accent-soft); color: var(--accent-text); }
.list-row .chev { color: var(--muted); font-size: 1.3rem; font-weight: 700; }
/* Allocation editor on phones */
.page-head + details.card, .page-head + p + details.card { margin-top: 12px; }
.page-head > .actions { margin-bottom: 4px; }
.fill-tools { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 4px 0 12px; }
.fill-tools .inline-label { min-width: 0; max-width: 100%; }
.inline-label select { max-width: 100%; min-width: 0; flex: 1 1 auto; }
@media (max-width: 639px) { .fill-tools .inline-label:has(select) { flex: 1 1 100%; } .alloc-table td:nth-child(2) { min-width: 150px; } }
.inline-label { white-space: nowrap; }

/* PO delivery tracking */
.badge-open { background: var(--card-2); color: var(--muted); }
.badge-late { background: var(--bad-soft); color: var(--bad); }
.tile-coral { background: var(--accent-soft); color: var(--accent-text); }
.tile-late { background: var(--bad-soft); color: var(--bad); }
.date-mini { width: auto; min-height: 34px; padding: 4px 10px; }
.po-tracks { display: flex; flex-direction: column; gap: 12px; }
.po-track { border: 1.5px solid var(--line); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.po-track.po-late { border-color: var(--bad-soft); background: color-mix(in srgb, var(--bad-soft) 35%, transparent); }
.po-track.po-delivery { background: color-mix(in srgb, var(--green-soft) 45%, transparent); border-color: transparent; }
.po-dates { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: flex-start; }
.po-due, .po-readyby { display: flex; flex-direction: column; gap: 2px; font-weight: 400; }
.po-due strong { font-size: 1.15rem; }
.inline-row { display: flex; gap: 6px; align-items: center; }
.inline-row input[type=date] { width: auto; min-height: 38px; padding: 4px 10px; }

/* Home: pick POs for a combined pick list */
.deliveries .page-head { align-items: center; }
.deliveries .page-head h2 { margin: 1rem 0 .6rem; }
.pick-bar { gap: 12px; }
.pick-all { font-weight: 700; align-items: center; }
.pick-all input { width: 20px; height: 20px; min-height: 0; margin: 0; }
.pick-row { display: flex; align-items: stretch; }
.pick-row .list-row { flex: 1 1 auto; min-width: 0; padding-left: 4px; }
.pick-tick { flex: none; display: flex; align-items: center; justify-content: center; padding: 0 4px 0 16px; cursor: pointer; }
.pick-tick input { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--accent); }
.pick-row.picked { background: var(--accent-soft); }
.pick-all input, label.check input { accent-color: var(--accent); }
.pick-combined td, .pick-combined th { vertical-align: middle; }
@media print { .pick-combined { font-size: 9.5pt; } .pick-combined th, .pick-combined td { padding: 4px 5px; } }
.deliveries .page-head { position: sticky; top: 56px; z-index: 4; background: var(--bg); padding: 2px 0; }
@media (min-width: 760px) { .deliveries .page-head { top: 60px; } }
.pick-combined td:first-child { white-space: nowrap; }
.picklist h1 { margin-top: 14px; }

/* Home deliveries: row tools and bulk actions */
.pick-bar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; justify-content: flex-end; }
.pick-bar .bulk { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pick-bar .btn:disabled, .pick-bar input:disabled { opacity: .45; cursor: default; }
.pick-main { flex: 1 1 auto; min-width: 0; padding: 12px 8px 12px 4px; display: flex; flex-direction: column; gap: 8px; }
.row-link { display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; }
.row-link:hover .row-title { color: var(--accent-text); }
.row-tools { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.row-tools .inline-row { flex-direction: row; font-weight: 700; color: var(--muted); }
.row-tools input[type=date] { width: auto; min-height: 34px; padding: 3px 8px; font-size: .88rem; }
.pick-due { flex: none; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; padding: 12px 18px 12px 8px; color: inherit; text-decoration: none; }
.pick-due strong { font-size: 1.05rem; }
.due-inline { display: none; }
@media (max-width: 639px) {
  .deliveries .page-head { position: static; }
  .pick-due { display: none; }
  .due-inline { display: block; margin-top: 2px; }
  .pick-tick { align-items: flex-start; padding-top: 14px; }
  .pick-main { padding-right: 16px; }
  .deliveries:not(.has-pick) .bulk { display: none; }
  .pick-bar { justify-content: flex-start; }
}

/* Drag-and-drop upload zone */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; font-weight: 400;
  min-height: 150px; padding: 22px; border: 2px dashed var(--accent-deco-1); border-radius: 22px; background: var(--accent-soft); cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent-deco-1)); }
.dropzone.is-over { border-style: solid; }
.dz-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; }
.dz-main { font-size: 1.05rem; }
.dz-busy { font-weight: 700; color: var(--accent-text); }
.dropzone.is-busy { opacity: .7; pointer-events: none; }
.report-item { border: 1.5px solid var(--line); border-radius: 18px; padding: 12px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.report-item legend { font-weight: 800; padding: 0 6px; }
.report-item legend label.check { font-weight: 800; align-items: center; }
.report-file { margin: -4px 0 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }

/* Chart tooltip */
.chart-scroll { position: relative; }
svg.chart { height: auto; max-width: 100%; }
svg.chart .bar { cursor: pointer; outline: none; }
svg.chart .bar.active path { opacity: 1; filter: brightness(.88); }
svg.chart .bar.active .hit { fill: var(--accent-soft); opacity: .6; }
.chart-tip { position: absolute; z-index: 5; transform: translate(-50%, -100%); pointer-events: none;
  background: var(--ink); color: var(--bg); border-radius: 12px; padding: 8px 12px; font-size: .8rem; line-height: 1.45;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18); white-space: nowrap; display: flex; flex-direction: column; }
.chart-tip strong { font-size: .88rem; margin-bottom: 2px; }

/* Daily sales by store grid */
.daily-grid th, .daily-grid td { white-space: nowrap; }
.daily-grid thead th { text-align: right; line-height: 1.2; }
.daily-grid thead th.we { color: var(--accent-text); }
.daily-grid .sticky-col { position: sticky; left: 0; z-index: 1; background: var(--card); text-align: left; font-weight: 400; box-shadow: 1px 0 0 var(--line); }
.daily-grid thead .sticky-col, .daily-grid tfoot .sticky-col { background: var(--card-2); font-weight: 800; }
.daily-grid td.heat-1 { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.daily-grid td.heat-2 { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.daily-grid td.heat-3 { background: color-mix(in srgb, var(--accent) 38%, transparent); }
.daily-grid td.heat-4 { background: color-mix(in srgb, var(--accent) 48%, transparent); font-weight: 800; }
.chart-tip[hidden] { display: none; }

/* HSA */
.chip-on { background: var(--accent); color: var(--accent-ink); }
.chip-on .muted { color: inherit; opacity: .8; }
.hsa-links summary { list-style: none; }
.hsa-links .quick { flex-wrap: wrap; margin-top: 12px; }
.hsa-products .pick-bar { justify-content: flex-start; padding: 12px 16px; margin-bottom: 12px; position: sticky; top: 60px; z-index: 4; }
.hsa-products .pick-bar select { width: auto; max-width: 320px; min-height: 36px; padding: 4px 10px; }
.hsa-table tr.picked td { background: var(--accent-soft); }
.hsa-table td input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
.hsa-notes .group-row th { background: var(--card-2); font-size: .85rem; }
@media (max-width: 639px) { .hsa-products .pick-bar { position: static; } .hsa-products .pick-bar select { max-width: 100%; } }
