/* The design system: one green-tinted neutral family (the old neutrals were
   navy-tinted and quietly fought the brand on every screen), soft hairlines
   over heavy borders, one ambient shadow, and a single focus ring everywhere.
   Minimal is the default; loudness is reserved for things that are loud on
   purpose (warnings, the calendar's red/amber days, the ZIP bar). */
:root {
  --bg: #f3f5f2;
  --panel: #ffffff;
  --ink: #1b2420;
  --muted: #5f6b61;
  --line: #e4e8e2;
  --brand: #14532d;
  --brand-mid: #1f7a45;
  --brand-soft: #e2f1e7;
  --accent: #1d4ed8;
  --warn: #b45309;
  --warn-soft: #fdf3d8;
  --danger: #b91c1c;
  --danger-soft: #fdecec;
  --ok: #15803d;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(18, 28, 22, .05), 0 6px 22px rgba(18, 28, 22, .05);
}

* { box-sizing: border-box; }
/* Author `display` rules below outrank the UA stylesheet, so [hidden] needs teeth. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }

/* One keyboard-focus language for the whole app: green on light surfaces,
   and a LIGHT or GOLD ring on the dark ones (sidebar, register, gate),
   where a dark-green ring would vanish into the chrome. */
:where(a, button, select, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--brand-mid); outline-offset: 2px;
}
.side :where(a, button):focus-visible { outline-color: #cfe6d8; }
.gate :where(a, button, input):focus-visible { outline-color: #e7cb65; }
.posgrid :where(a, button, select):focus-visible { outline-color: #e9c46a; }
.posrecent :where(a, button):focus-visible { outline-color: var(--brand-mid); }

/* Quiet scrollbars - but still visible enough to find and to read as a
   position indicator from arm's length. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #9aa89b; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #7f8f80; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- gate ---------- */
.gate {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: linear-gradient(160deg, #14532d, #0b3a1f 60%, #082a17);
  z-index: 50; padding: 20px;
}
.gate-card {
  background: #14171d; padding: 30px 32px; border-radius: 14px; width: 100%; max-width: 380px;
  border: 1px solid rgba(231, 203, 101, .28);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
}
.gate-card h1 { font-size: 21px; color: #f6f3ea; }
.gate-card p { color: #9aa3ad; margin: 6px 0 18px; font-size: 13.5px; }
.gate-forms .gate-card input {
  width: 100%; padding: 11px 13px; border: 1px solid #2a2f37; border-radius: 8px; font: inherit;
  background: #0b0d10; color: #f6f3ea;
}
.gate-forms .gate-card input::placeholder { color: #6b7480; }
.gate-forms .gate-card input:focus { outline: none; border-color: #e7cb65; box-shadow: none; }
.gate-card button {
  width: 100%; margin-top: 12px; padding: 11px; border: 0; border-radius: 8px;
  background: #e7cb65; color: #14171d; font-weight: 800;
}
.gate-card button:hover { background: #f0d675; }
.gate-err { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side {
  background: #0b2015; color: #cfe6d8; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 20px 18px 16px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(145deg, #238b4f, #16603a);
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px;
  letter-spacing: .04em; flex: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}
.brand-name { font-weight: 700; color: #fff; font-size: 14px; line-height: 1.2; }
.brand-sub { font-size: 11px; color: #74a98b; margin-top: 2px; }

#nav { display: flex; flex-direction: column; padding: 6px 10px 10px; gap: 1px; flex: 1; overflow-y: auto; }
#nav::-webkit-scrollbar-thumb { background: #3f5c4a; }
#nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border-radius: 8px; color: #afd0bd; text-decoration: none;
  font-size: 13.5px; font-weight: 500;
}
#nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
#nav a.on { background: #1f7a45; color: #fff; font-weight: 600; }
.badge {
  background: #f59e0b; color: #4a2a00; border-radius: 20px; font-size: 11px;
  font-weight: 800; padding: 1px 7px; min-width: 20px; text-align: center;
}
#nav a.on .badge { background: #fff; color: #14532d; }

/* Collapsible sidebar section. The header reads like a heading, not a link;
   its links indent underneath, and the caret says which way it is folded. */
.navgroup-t {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: 0; padding: 9px 12px; border-radius: 7px;
  color: #8fbfa4; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; cursor: pointer; text-align: left;
}
.navgroup-t:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.navgroup-t .caret { transition: transform .15s; font-size: 13px; }
.navgroup.closed .caret { transform: rotate(-90deg); }
/* The open group sits in a darker well, so what dropped down reads as
   contained by the header rather than blending into the rest of the list. */
.navgroup-b {
  display: flex; flex-direction: column; gap: 1px;
  background: rgba(0, 0, 0, .30); border-radius: 8px;
  padding: 4px; margin: 2px 0 5px;
}
.navgroup-b a { padding-left: 18px; }
.navgroup-b a:hover { background: rgba(255, 255, 255, .10); }
.navgroup.closed .navgroup-b { display: none; }
/* A closed group with the current page inside it still shows where you are. */
.navgroup.closed.holds-current .navgroup-t { background: #1f7a45; color: #fff; }
/* A department subfolder nested inside a group: the same folding behavior,
   indented and a shade deeper so it reads as belonging to the group above. */
.navgroup.sub { margin: 0 0 0 8px; }
.navgroup.sub .navgroup-t { font-size: 11.5px; padding: 7px 10px; }
.navgroup.sub .navgroup-b { background: rgba(0, 0, 0, .28); }
.navgroup.sub .navgroup-b a { padding-left: 16px; }

.side-foot { padding: 12px 18px 18px; border-top: 1px solid rgba(255, 255, 255, .08); }
.link { background: none; border: 0; color: #7fb99a; font-size: 12.5px; padding: 0; text-decoration: underline; }

/* ---------- main ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 24px; background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5; flex-wrap: wrap;
}
.topbar h2 { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.view { padding: 22px 24px 64px; }

.warnings { margin: 14px 24px 0; display: flex; flex-direction: column; gap: 6px; }
.warn-item {
  background: var(--warn-soft); border-left: 4px solid var(--warn); color: #6b4708;
  padding: 9px 13px; border-radius: 8px; font-size: 13px;
}

/* ---------- controls ---------- */
.btn {
  border: 1px solid #dbe1da; background: #fff; color: var(--ink);
  padding: 8px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 500;
  transition: background .1s, border-color .1s;
}
.btn:hover { background: #f4f7f3; border-color: #c9d2c8; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn.primary:hover { background: #1a6b3a; }
.btn.danger { background: #fff; border-color: #e8bcbc; color: var(--danger); }
.btn.danger:hover { background: #fdf5f5; border-color: #dba3a3; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

select, input[type=text], input[type=date], input[type=email], input[type=tel],
input[type=number], textarea {
  border: 1px solid #d7ddd6; border-radius: 9px; padding: 8px 11px; font: inherit;
  background: #fff; color: var(--ink); max-width: 100%;
}
select:focus, input[type=text]:focus, input[type=date]:focus, input[type=email]:focus,
input[type=tel]:focus, input[type=number]:focus, textarea:focus, input[type=search]:focus {
  outline: none; border-color: var(--brand-mid); box-shadow: 0 0 0 3px rgba(31, 122, 69, .15);
}
textarea { resize: vertical; min-height: 66px; width: 100%; }
label.fld { display: block; margin-bottom: 12px; }
label.fld > span {
  display: block; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px;
}
label.fld > input, label.fld > select, label.fld > textarea { width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 130px; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
.card .n {
  font-size: 27px; font-weight: 700; color: var(--brand); line-height: 1.1;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.card .k {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-top: 3px; font-weight: 600;
}
.card.alert .n { color: var(--warn); }
.card.clickable { cursor: pointer; }
.card.clickable:hover {
  border-color: #b9c6ba; transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(18, 28, 22, .07), 0 10px 28px rgba(18, 28, 22, .06);
}

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-top: 18px; overflow: hidden;
}
.panel-head {
  padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.panel-head h3 { font-size: 14.5px; font-weight: 700; }
.panel-body { padding: 16px; }
.panel-body.flush { padding: 0; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #edf0ec; vertical-align: top; }
th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  background: var(--panel); font-weight: 700; position: sticky; top: 0;
  border-bottom: 1px solid var(--line);
  /* Collapsed borders stay behind when a header sticks (Chromium paints
     them with the table) - this shadow travels WITH the stuck cell, so the
     header keeps a visible edge while rows scroll under it. */
  box-shadow: 0 1px 0 var(--line);
}
tbody tr:hover { background: #f6f8f5; }
tbody tr.click { cursor: pointer; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------- pills ---------- */
.pill {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
}
.pill.new { background: #dbeafe; color: #1e40af; }
.pill.awaiting_photos { background: var(--warn-soft); color: var(--warn); }
.pill.approved, .pill.scheduled { background: var(--brand-soft); color: var(--brand); }
.pill.completed { background: #d1fae5; color: #065f46; }
.pill.en_route { background: #ede9fe; color: #5b21b6; }
.pill.cancelled, .pill.declined { background: #e2e8f0; color: #475569; }
.pill.needs_reschedule, .pill.not_home { background: var(--danger-soft); color: var(--danger); }
.pill.sent, .pill.dryrun { background: var(--brand-soft); color: var(--brand); }
.pill.skipped { background: #e2e8f0; color: #475569; }
.pill.failed { background: var(--danger-soft); color: var(--danger); }
.pill.ghost { background: #eef2f7; color: var(--muted); }
.pill.ok { background: #d1fae5; color: #065f46; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border: 0; cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
button.pill { border: 0; cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ---------- day schedule ---------- */
.truck-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.truck-col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.truck-head {
  padding: 12px 15px; border-bottom: 1px solid var(--line); display: flex;
  justify-content: space-between; align-items: center; gap: 10px;
}
.truck-head h4 { font-size: 14.5px; display: flex; align-items: center; }
.truck-meta { font-size: 12px; color: var(--muted); }
.stop-list { padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 60px; }
.stop-item {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: #fff;
  display: flex; gap: 10px; cursor: grab;
}
.stop-item:hover { border-color: #b9c6ba; }
.stop-item.dragging { opacity: .4; }
.stop-item.over { border-color: var(--accent); border-style: dashed; }
.stop-item .seq {
  flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--brand);
  color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.stop-item.completed { opacity: .6; }
.stop-item.completed .seq { background: #94a3b8; }
.stop-main { flex: 1; min-width: 0; }
.stop-name { font-weight: 600; font-size: 13.5px; }
.stop-addr { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.stop-tags { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; align-items: center; }

/* ---------- map ---------- */
#mapCanvas { width: 100%; height: 62vh; min-height: 380px; border-radius: var(--radius); background: #e6ebf2; }
.map-missing { display: grid; place-items: center; height: 100%; text-align: center; padding: 30px; color: var(--muted); }

/* ---------- drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer-back { position: absolute; inset: 0; background: rgba(14, 22, 17, .48); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: var(--panel); box-shadow: -12px 0 40px rgba(0, 0, 0, .22);
  border-radius: 16px 0 0 16px;
  overflow-y: auto; padding: 22px 24px 50px;
}
@media (max-width: 860px) { .drawer-panel { border-radius: 0; } }
.drawer-x {
  position: absolute; top: 14px; right: 16px; border: 0; background: none;
  font-size: 22px; line-height: 1; color: var(--muted);
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
}
.drawer-x:hover { background: #f1f4f0; color: var(--ink); }
.drawer h3 { font-size: 18px; margin-bottom: 3px; }
.drawer .sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 7px 12px; font-size: 13.5px; margin: 14px 0; }
.dl dt { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.dl dd { margin: 0; }
.section-title {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  font-weight: 700; margin: 22px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line);
}
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.preview-frame { width: 100%; height: 320px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: #16211b; color: #f2f6f2; padding: 12px 20px; border-radius: 12px;
  font-size: 13.5px; z-index: 60; box-shadow: 0 10px 32px rgba(0, 0, 0, .3); max-width: 90vw;
  border-left: 3px solid var(--brand-mid);
}
.toast.err { background: #2b1413; border-left-color: #ef6b61; color: #ffe9e7; }

/* ---------- calendar ---------- */
/* Everything in a month cell is glanced at from arm's length, so nothing in it
   gets to be pale: day numbers in ink, chips with real contrast and a border,
   and the summary line dark enough to read without leaning in. */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink);
  font-weight: 700; text-align: center; padding: 6px 0;
}
.cal .day {
  background: #fff; border: 1px solid #c8d0c8; border-radius: 10px; min-height: 96px;
  padding: 8px 9px; font-size: 12.5px;
}
.cal .day.pad { background: #eef1f6; border-style: dashed; border-color: var(--line); }
.cal .day.today { border-color: var(--brand); border-width: 2px; background: #f4fbf7; }
.cal .day .d { font-weight: 700; color: var(--ink); font-size: 14px; }
.cal .day.today .d { color: var(--brand); }
.cal .day .chip {
  display: block; margin-top: 4px; padding: 3px 7px; border-radius: 5px;
  background: var(--brand-soft); color: #0c3d20; font-weight: 700; font-size: 12px;
  border: 1px solid #a7d9bc;
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; }
  #nav { flex-direction: row; overflow-x: auto; flex: 1 1 100%; }
  .side-foot { border: 0; padding: 12px; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
}

/* Driver link panel in the day view. */
.linkish {
  background: none; border: 0; padding: 0; font: inherit; font-size: 12px;
  color: var(--brand); text-decoration: underline; cursor: pointer;
}
.linkish:disabled { opacity: .5; cursor: wait; }
.driver-link {
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f7f9f6;
}
.driver-link[hidden] { display: none; }
.driver-link input {
  width: 100%; font: inherit; font-size: 12px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.driver-link .row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.driver-link .hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* Item picker and consent line in the manual pickup drawer. */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.chips .chip {
  padding: 8px 13px; border: 1px solid #d7ddd6; border-radius: 20px;
  background: #fff; font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer;
  transition: background .1s, border-color .1s;
}
.chips .chip:hover { background: #f4f7f3; border-color: #c2cdc2; }
.chips .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
label.consent { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 14px; line-height: 1.45; }
label.consent input { margin-top: 3px; flex: none; }
label.consent em { display: block; font-style: normal; margin-top: 3px; }
#tWhen[hidden] { display: none; }

/* Photo approval gate on a request. */
fieldset.bare { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.bare[disabled] { opacity: .45; }
.ok-item {
  padding: 10px 12px; margin-bottom: 16px; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand);
  border-left: 4px solid var(--brand); font-size: 13.5px;
}
.ok-item .linkish { color: var(--brand); }

/* Adding photos is done on the phone the donor texted them to, so it gets a
   real tap target rather than a toolbar-sized button. */
#pAddBtn { width: 100%; min-height: 46px; font-weight: 600; margin-bottom: 6px; }

@media (max-width: 860px) {
  /* Eight columns will not fit a handset; let the table scroll on its own. */
  .panel-body.flush { overflow-x: auto; }
  .panel-body.flush table { min-width: 720px; }
  #topActions { flex-wrap: wrap; }
  #topActions input[type="search"] { flex: 1 1 100%; min-width: 0; }
}

/* Texted-in photos nobody has placed yet. */
.panel.warn { border-color: #e6cf92; }
.panel.warn .panel-head { background: var(--warn-soft); }
.panel.warn .panel-head h3 { color: #6b4708; }
.unfiled-row {
  display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line);
}
.unfiled-row:last-child { border-bottom: 0; padding-bottom: 0; }
.unfiled-meta { flex: 1; min-width: 0; }
.unfiled-hits { margin-top: 4px; }
.unfiled-q { min-width: 200px; }
@media (max-width: 860px) { .unfiled-row { flex-direction: column; } }

/* Month overview: every day is a place to book from. */
.cal .day { display: flex; flex-direction: column; }
.cal .day.past { background: #fafbfc; }
.cal .day.past .d { opacity: .55; }
.cal .dhead { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.cal .dadd {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  width: 22px; height: 22px; border-radius: 6px; line-height: 1; font-size: 15px;
  cursor: pointer; padding: 0; flex: none; opacity: 0; transition: opacity .12s;
}
.cal .day:hover .dadd, .cal .dadd:focus-visible { opacity: 1; }
.cal .dadd:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.cal .dbody {
  flex: 1; margin-top: 4px; cursor: pointer; border-radius: 6px;
  display: flex; flex-direction: column; gap: 3px;
}
.cal .dbody:hover { background: #f4f7f3; }
.cal .dbody:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* A closed day reads as unavailable at a glance: warm grey stripes, and a red
   chip naming the reason. The lock button sits beside the +, and stays visible
   on days that already have a closure so reopening is one click away. */
.cal .day.closed {
  background: repeating-linear-gradient(-45deg, #f5f2f0, #f5f2f0 7px, #ece7e4 7px, #ece7e4 14px);
}
.cal .chip.closedchip { background: #fee2e2; color: #991b1b; border-color: #f3b4b4; }
.cal .dlock.on { opacity: 1; color: #991b1b; border-color: #f3b4b4; }
.cal .dlock:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }

.cal .dsum { font-size: 11.5px; font-weight: 600; color: #3d4a61; margin-top: auto; }
/* "free" stays quieter than a booked day on purpose - but still legible. */
.cal .dfree { font-size: 11.5px; color: var(--muted); margin-top: auto; }

/* Touch has no hover, so the add button is always visible - and a little
   larger, since a fingertip is not a mouse pointer. */
@media (hover: none) {
  .cal .dadd { opacity: 1; width: 26px; height: 26px; font-size: 17px; }
  .cal .day { padding: 6px 5px; }
}

/* Sign-in variants and the People screen. */
.gate-alt, .gate-card button.gate-alt {
  background: none; border: 0; padding: 8px 0 0; width: 100%;
  color: #9aa3ad; font: inherit; font-size: 12.5px; font-weight: 500;
  text-decoration: underline; cursor: pointer;
}
.gate-alt:hover, .gate-card button.gate-alt:hover { color: #e7cb65; background: none; }
.gate-card[hidden] { display: none; }
.whoami { margin-bottom: 8px; line-height: 1.3; }
.whoami-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.whoami-role { font-size: 11.5px; color: var(--muted); }
.whoami[hidden] { display: none; }
#nav a[hidden] { display: none; }
#view tr.off td { opacity: .55; }
.temp-pass {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 19px; letter-spacing: .04em; padding: 14px 16px; margin: 4px 0 12px;
  background: var(--brand-soft); color: var(--brand); border-radius: 9px;
  user-select: all; word-break: break-all; text-align: center;
}

/* Fleet tabs. */
.btn.tab.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* "This one has donated before" in the pickup form. */
.ok-item.match { margin-bottom: 14px; }
.ok-item.match .btn { background: #fff; }

/* Compact history tables inside the donor drawer. */
table.mini { margin-bottom: 4px; }
table.mini td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.mini tr:last-child td { border-bottom: 0; }

/* Register color language: green means money moves forward (complete a sale),
   red means something is taken away (void, remove a line), blue means going
   somewhere (reports, drawers, outside tools). Same colors, same places,
   every shift. Targets sized for fingers, not cursors. */
.btn.go { background: #15803d; border-color: #15803d; color: #fff; font-weight: 700; }
.btn.go:hover { background: #166534; }
.btn.go.outline { background: #fff; color: #15803d; border-color: #15803d; }
.btn.go.outline:hover { background: #f0fdf4; }
.btn.nav { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; font-weight: 600; }
.btn.nav:hover { background: #dbeafe; }
.btn.danger.solid { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn.danger.solid:hover { background: #991b1b; }
.pos-pay button { min-height: 58px; font-size: 17px; flex: 1; }
.pos-cats button { min-height: 58px; }

/* The on-screen keypad: keys sized for fingertips, identical layout on the
   register and the pricing station. */
/* Three across, always - a keypad that reflows into two columns is a keypad
   nobody can use without looking at it. */
.pos-pad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px;
}
.pos-pad button { min-height: 56px; font-size: 21px; font-weight: 700; }

/* --- Phase 3: zero-click store cards, warning tints, small screens ------- */
/* The store row leads the dashboard. Values can be dollar amounts or
   category names, so they scale down instead of overflowing. */
.store-cards { margin-bottom: 12px; }
.store-cards .card { border-left: 3px solid var(--brand); }
.store-cards .n { font-size: clamp(17px, 2.2vw, 24px); word-break: break-word; }
.store-cards .card.alert { border-left-color: var(--danger, #b91c1c); }

/* Soft red, the universal "needs a look": stagnant stock. */
.warn-tint { border-color: #fecaca; }
.warn-tint .panel-head { background: #fef2f2; }
.warn-tint h3 { color: #b91c1c; }
.warn-row td { background: #fef2f2; }

/* Small screens: every wide thing scrolls inside its own box instead of
   stretching the page, and the report toolbars stack. */
.panel-body.flush { overflow-x: auto; }
@media (max-width: 860px) {
  .store-cards { grid-template-columns: repeat(2, 1fr); }
  .pos-pay .btn { min-width: 0; }
}

/* On a phone the sidebar becomes one scrollable strip; grouped sections
   flatten into it (their headers hide) so every link sits in the same row. */
@media (max-width: 860px) {
  .navgroup, .navgroup-b { display: contents; }
  .navgroup-t { display: none; }
  .navgroup.closed .navgroup-b { display: contents; }
  .navgroup-b a { padding-left: 12px; white-space: nowrap; }
  #nav a { white-space: nowrap; }
  /* A grid item's implicit min-width is its content; without this, the
     one-line nav strip drags the whole page out to its full width. */
  .side { min-width: 0; }
}

/* ZIP lookup on the month calendar: the days that serve the typed ZIP.
   Loud on purpose - the dispatcher reads these to a donor across a phone
   call, so they must jump off the grid at a glance. */
/* The month grid's expanded pickup listing - a name per chip, grouped by
   truck, like the wall calendar the crew grew up on. */
.dtruck {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  margin: 6px 0 3px; width: 100%;
}
.chip.namechip {
  display: block; width: 100%; text-align: left; background: #e7f2ea; color: #14532d;
  border: 1px solid #cfe3d6; font-weight: 600; margin: 0 0 3px; padding: 3px 8px;
  border-radius: 7px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip.namechip:hover { background: #d8ecdf; }
/* No truck against its name. Amber on the month overview until somebody puts
   it on one - a pickup nobody is driving to is not a booking yet. Red for the
   administrator's own queue is defined after this on purpose, so a day that is
   both reads as the more urgent of the two. */
.cal .day.needstruck { border-color: #d97706; border-width: 2px; background: #fffbeb; }
.cal .day.needstruck .d { color: #92400e; }
.cal .day .chip.trucklesschip {
  background: #fef3c7; color: #92400e; border-color: #fcd34d;
}
.chip.namechip.notruck {
  background: #fef3c7; color: #92400e; border-color: #fcd34d;
}
.chip.namechip.notruck:hover { background: #fde68a; }

/* Waiting for an administrator. Red on the month overview until confirmed -
   the day, the chip with the donor's name on it, and a count at the top of
   the cell, so a pickup nobody has said yes to cannot be scrolled past. */
.cal .day.waiting { border-color: #dc2626; border-width: 2px; background: #fef2f2; }
.cal .day.waiting .d { color: #b91c1c; }
.cal .day .chip.waitchip {
  background: #fee2e2; color: #991b1b; border-color: #fca5a5;
}
.chip.namechip.waiting {
  background: #fee2e2; color: #991b1b; border-color: #fca5a5;
}
.chip.namechip.waiting:hover { background: #fecaca; }

.chip.namechip.done { background: #f1f5f3; color: #64748b; border-color: #e2e8f0; text-decoration: line-through; }

.day.zipday {
  box-shadow: inset 0 0 0 3px #15803d;
  background: #bbf7d0;
}
.day.zipday .d { color: #14532d; font-weight: 800; }
.day.zipday .dfree { color: #14532d; font-weight: 800; }
.zipnote {
  display: inline-block; background: #15803d; color: #fff; font-weight: 700;
  border-radius: 6px; padding: 1px 8px; margin-top: 3px;
}

/* The search bar itself: a labeled green strip, not a whisper under the grid. */
.zipbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #f0fdf4; border: 2px solid #15803d; border-radius: 10px;
  padding: 10px 14px;
}
.zipbar label { font-weight: 800; font-size: 15px; color: #14532d; }
.zipbar input {
  width: 120px; font-size: 20px; font-weight: 700; text-align: center;
  letter-spacing: 2px; border: 2px solid #15803d; border-radius: 8px;
  padding: 6px 8px;
}
.zipbar input:focus { outline: 3px solid #86efac; }
#calZipMsg { font-size: 14px; }

/* Route pills on the month calendar: who is on the road that day. */
.servrow { margin-bottom: 3px; }
.servpill {
  display: inline-block; font-size: 10px; font-weight: 700; color: #fff;
  border-radius: 8px; padding: 1px 7px; margin: 0 3px 2px 0; line-height: 1.5;
}
.servdot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  vertical-align: -1px; margin-right: 4px;
}

/* Month navigation on the calendar: one tap back or forward. */
.monthnav { display: inline-flex; align-items: center; gap: 4px; }
.monthnav #cPrev, .monthnav #cNext { font-size: 18px; line-height: 1; padding: 4px 12px; }
.monthname { font-weight: 700; min-width: 150px; text-align: center; }
/* The native month input hides behind the name button and only supplies its
   picker popup - visually the name IS the control. */
.monthinput { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* The go-live board on the Messages screen. */
.mmrow {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 8px;
}
.mmrow.live { border-color: #a7d9bc; background: #f0fdf4; }
.mmrow.test { border-color: #fcd34d; background: #fffbeb; }
.mmctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mmdest { width: 220px; }
.mmflip { font-weight: 700; min-width: 130px; }

/* The next-openings chips inside the ZIP bar. Tapping one jumps the month. */
.zipnext { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex-basis: 100%; }
.zipchip {
  border: 2px solid #15803d; background: #15803d; color: #fff; font-weight: 700;
  border-radius: 999px; padding: 3px 12px; cursor: pointer; font-size: 13px;
}
.zipchip.on { outline: 3px solid #14532d; outline-offset: 1px; }
.zipchip.other { background: #fff; color: #14532d; }
.zipchip.other:hover { background: #dcfce7; }

/* The register's wall of buttons. Sized for a thumb on a touch screen at a
   counter, not a mouse: nothing under 64px tall, the name big enough to read
   standing up, and the price underneath where the eye already goes. */
.tilebar { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.tilebar input[type="search"] {
  font-size: 15px; padding: 8px 10px; border: 1px solid var(--line, #dfe4ec); border-radius: 8px;
}
.postiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px; margin-bottom: 12px;
}
.postile {
  min-height: 92px; padding: 12px 10px; border-radius: 12px; cursor: pointer;
  border: 1px solid #1f4f36; background: #22543d; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; text-align: center; font: inherit; line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
}
.postile:hover { background: #2c6a4d; }
.postile:active { transform: translateY(1px); }
.postile.dept { background: #14532d; border-color: #0f3d21; }
.postile .ptname { font-size: 19px; font-weight: 700; letter-spacing: .01em; }
.postile .ptsub { font-size: 13px; opacity: .82; }

/* The department grid runs a size smaller than the item tiles - sixteen
   price-book departments plus the house ones should fit without scrolling. */
.postiles.deptview { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 9px; }
.postiles.deptview .postile { min-height: 80px; padding: 10px 9px; border-radius: 11px; }
.postiles.deptview .postile .ptname { font-size: 17px; }
.postiles.deptview .postile .ptsub { font-size: 12px; }

/* A counter screen is wide and shallow: more columns, not more scrolling. */
@media (min-width: 1500px) {
  .postiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .postile { min-height: 104px; }
  .postile .ptname { font-size: 21px; }
}
@media (max-width: 860px) {
  .postiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .postile { min-height: 78px; }
  .postile .ptname { font-size: 16px; }
}

/* Function keys under the departments on the register. */
.posfns {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.posfn {
  min-height: 56px; border-radius: 6px; border: 1px solid transparent; font: inherit;
  font-weight: 700; font-size: 14px; line-height: 1.2; cursor: pointer; padding: 8px 10px;
  color: #fff; display: flex; align-items: center; justify-content: center; text-align: center;
  text-decoration: none;
}
.posfn.grey { background: #7d7d7d; }
.posfn.white { background: #fff; color: #222; border-color: #cfd6df; box-shadow: inset 0 -4px 0 #222; }
.posfn.gold { background: #fff; color: #222; border-color: #cfd6df; box-shadow: inset 0 -4px 0 #f59e0b; }
.posfn.purple { background: #7a0c7a; }
.posfn.orange { background: #f59e0b; color: #1a1a1a; }
.posfn:hover { filter: brightness(1.07); }
.posfn:active { transform: translateY(1px); }

/* =========================== The register =========================== */
/* The register is an appliance, not a page: a fixed full-height surface in
   its own fixed palette. Dark green counter chrome, a paper ticket on the
   right, brand gold wherever money changes hands. Everything else in the
   app stays on the light theme - this skin is scoped to the register view
   and the .posgrid it renders. */
body[data-view="pos"] .view { padding: 0; background: #101d15; }
@media (min-width: 1101px) {
  body[data-view="pos"] .main { height: 100vh; }
  body[data-view="pos"] .view { flex: 1; min-height: 0; overflow: hidden; }
}

.posgrid { display: flex; height: 100%; min-height: 0; position: relative; }
.posleft {
  flex: 1 1 58%; min-width: 0; display: flex; flex-direction: column;
  gap: 10px; padding: 14px 14px 10px;
}
.postkt {
  flex: 0 0 430px; min-width: 0; display: flex; flex-direction: column;
  background: #18271e; border-left: 1px solid #2a3c31; overflow-y: auto;
}

/* --- scan + manual entry --- */
.posentry { display: flex; flex-direction: column; gap: 10px; }
.scanwrap { position: relative; }
.scanglyph {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: #9eb4a6; font-size: 17px; pointer-events: none;
}
.posgrid #tkScan {
  width: 100%; font-size: 17px; font-weight: 600; padding: 14px 14px 14px 44px;
  background: #18271e; border: 1.5px solid #2a3c31; border-radius: 12px; color: #edf5ee;
}
.posgrid input::placeholder { color: #7a9183; }
.posgrid #tkScan:focus, .posgrid .bigfld input:focus, .posgrid #tkFind:focus,
.posgrid .custfind input:focus, .posgrid .emailline:focus {
  outline: none; border-color: #d9a62b; box-shadow: 0 0 0 3px rgba(217, 166, 43, .22);
}
.entryrow { display: flex; gap: 10px; }
.bigfld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bigfld.grow { flex: 1; }
.bigfld.qty { flex: 0 0 96px; }
.bigfld > span {
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #9eb4a6;
}
.posgrid .bigfld input {
  width: 100%; border: 1.5px solid #2a3c31; background: #18271e; color: #edf5ee;
  border-radius: 12px; font-size: 30px; font-weight: 700; text-align: right;
  padding: 7px 14px; font-variant-numeric: tabular-nums;
}
.bigfld.qty input { text-align: center; }

/* --- the button wall --- */
.posgrid .tilebar { margin: 0; }
.posgrid .tilebar strong { color: #edf5ee; }
.posgrid .tilebar .btn {
  background: #18271e; color: #d7e4d9; border-color: #2a3c31;
}
.posgrid #tkFind {
  max-width: 220px; background: #18271e; border: 1.5px solid #2a3c31;
  color: #edf5ee; border-radius: 10px; padding: 9px 12px;
}
.posgrid .postiles {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start;
  padding: 2px 2px 8px;
}
.posgrid .postile {
  background: #f7f5ec; color: #16281c; border: 1px solid #e0dcc8; border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.posgrid .postile:hover { background: #fffdf3; }
.posgrid .postile:active { transform: scale(.97); }
.posgrid .postile .ptname { color: #16281c; }
.posgrid .postile .ptsub { color: #1f8a4c; font-weight: 700; opacity: 1; }
.posgrid .postile.dept {
  background: linear-gradient(145deg, #1d6f42, #134a28); border-color: #0d3a20;
}
.posgrid .postile.dept .ptname { color: #fff; }
.posgrid .postile.dept .ptsub { color: #cfe8d6; font-weight: 600; }
.posgrid .ptsubhead { color: #9eb4a6; }
.posgrid .postile.tiered { background: #f7f5ec; border: 1px solid #e0dcc8; }
.posgrid .postile.tiered .tapname { color: #16281c; }
.posgrid .ptchip { background: #fff; border-color: #d9d4bd; }
.posgrid .ptchip:hover { background: #eef7f0; }

/* --- function keys: one calm family, a colored dot carries the legend --- */
.posgrid .posfns {
  border-top: 1px solid #2a3c31; padding-top: 10px; display: flex;
  flex-wrap: wrap; gap: 8px;
}
.posgrid .posfn {
  background: #18271e; color: #d7e4d9; border: 1px solid #2a3c31; border-radius: 10px;
  font-size: 13px; font-weight: 600; padding: 10px 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; box-shadow: none;
  text-decoration: none; min-height: 0;
}
.posgrid .posfn:hover { background: #20332a; filter: none; transform: none; }
.posgrid .posfn:active { transform: translateY(1px); }
.posgrid .posfn.on { border-color: #d9a62b; color: #ffe9b3; }
.fdot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.d-grey { background: #8b9aa8; } .d-red { background: #e0564a; }
.d-blue { background: #4a90e0; } .d-purple { background: #b06ae0; }
.d-gold { background: #d9a62b; } .d-orange { background: #f08a3c; }
.d-green { background: #35c06b; }

/* --- the paper ticket --- */
.tktpaper {
  flex: 1 0 auto; display: flex; flex-direction: column;
  background: #fbfaf5; color: #1a241d; margin: 14px 14px 0;
  border-radius: 10px 10px 0 0; box-shadow: 0 8px 26px rgba(0, 0, 0, .45);
}
.tktpaper::after {
  content: ''; flex: 0 0 9px;
  background:
    linear-gradient(45deg, transparent 33.3%, #18271e 33.3%, #18271e 66.6%, transparent 66.6%),
    linear-gradient(-45deg, transparent 33.3%, #18271e 33.3%, #18271e 66.6%, transparent 66.6%);
  background-size: 14px 18px; background-position: 0 -9px;
}
.tkthead {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 11px 16px 7px; border-bottom: 1px dashed #c9c4b2;
  font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  font-size: 11.5px; color: #6b7467;
}
.tktlines { flex: 1 1 auto; min-height: 90px; max-height: 36vh; overflow-y: auto; padding: 0 14px; }
.tktlines table { width: 100%; border-collapse: collapse; }
.tktlines td {
  border-bottom: 1px dashed #e6e2d2; padding: 8px 3px; font-size: 14px;
  vertical-align: middle; background: none; color: #1a241d;
}
.tktlines td .small { color: #8a8f83; }
.tktlines td.empty { color: #9a9f93; text-align: center; padding: 28px 8px; border: 0; }
.tktlines .btn.sm { background: #fff; border-color: #d9d4c0; color: #1a241d; }
.tktlines .btn.sm.danger { color: #b0493f; }
.tkttotals {
  width: calc(100% - 28px); margin: 4px 14px 0; border-collapse: collapse; flex: 0 0 auto;
}
.tkttotals td {
  padding: 4px 3px; font-size: 14.5px; border: 0; color: #2a3329;
  font-variant-numeric: tabular-nums;
}
.tkttotals .num { text-align: right; white-space: nowrap; }
.tkttotals .save { color: #1f8a4c; font-weight: 700; }
/* The Rewards picker lives on the paper ticket - its focus speaks the
   register's gold, not the app's green. */
.tkttotals select:focus {
  outline: none; border-color: #d9a62b; box-shadow: 0 0 0 3px rgba(217, 166, 43, .25);
}
.tkttotals .bigtotal td {
  border-top: 2px solid #1a241d; font-size: 25px; font-weight: 800;
  padding: 7px 3px 8px; letter-spacing: .02em;
}
.linex {
  border: 0; background: none; color: #b0493f; font-size: 16px;
  cursor: pointer; padding: 0 5px; font-weight: 700;
}

/* sale-complete card, on the paper where the next receipt will be */
.donecard {
  margin: 10px 14px 14px; border: 2px solid #1f8a4c; border-radius: 12px;
  padding: 12px 14px; background: #f0faf2;
}
.doneref { font-weight: 700; color: #14532d; }
.donechange { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0; }
.donechange span {
  text-transform: uppercase; font-size: 11px; letter-spacing: .08em;
  font-weight: 800; color: #6b7467;
}
.donechange strong { font-size: 34px; color: #14532d; font-variant-numeric: tabular-nums; }
.donemeta { font-size: 12.5px; color: #4a5547; margin-bottom: 8px; }

/* --- the pay zone under the paper --- */
.payzone { flex: 0 0 auto; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.custzone { display: flex; flex-direction: column; gap: 6px; }
.custfind { display: flex; gap: 8px; }
.posgrid .custfind input {
  flex: 1; background: #101d15; border: 1.5px solid #2a3c31; color: #edf5ee;
  border-radius: 10px; padding: 10px 12px; font-size: 13.5px; min-width: 0;
}
.custfind .btn { background: #20332a; color: #d7e4d9; border-color: #2a3c31; }
#tkCustomer { color: #edf5ee; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#tkCustomer:empty, #tkMatches:empty { display: none; }
#tkMatches { background: #fbfaf5; border-radius: 10px; max-height: 210px; overflow-y: auto; }
.cashrow { display: flex; gap: 10px; align-items: stretch; }
.changebox { flex: 0 0 150px; display: flex; flex-direction: column; gap: 4px; }
.changebox > span {
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #9eb4a6;
}
#tkChange {
  flex: 1; font-size: 30px; font-weight: 800; color: #edf5ee; text-align: right;
  padding: 7px 8px; border-radius: 12px; font-variant-numeric: tabular-nums;
}
#tkChange.due { background: #d9a62b; color: #231a04; }
.quickcash { display: flex; gap: 8px; }
.quickcash:empty { display: none; }
.qcash {
  flex: 1; border: 1.5px solid #3a4f41; background: #18271e; color: #ffe9b3;
  border-radius: 10px; font-weight: 800; font-size: 15px; padding: 7px 4px;
  cursor: pointer; font-variant-numeric: tabular-nums; line-height: 1.25; min-width: 0;
}
.qcash small { font-size: 9.5px; letter-spacing: .08em; font-weight: 800; color: #c9b27a; }
.qcash:hover { background: #20332a; }
.qcash.exact { background: #2a3c31; border-color: #d9a62b; }
.payzone .pos-pad { margin: 0; }
.payzone .pos-pad .btn {
  background: #223528; border: 1px solid #31463a; color: #edf5ee;
  border-radius: 12px; min-height: 50px; font-size: 20px;
}
.payzone .pos-pad .btn:hover { background: #2a4234; }
.payzone .pos-pad .btn.danger { background: #2c1f1d; border-color: #5a3531; color: #ff9d94; }
.posgrid .emailline {
  background: #101d15; border: 1.5px solid #2a3c31; color: #edf5ee;
  border-radius: 10px; padding: 9px 12px; font-size: 13px; width: 100%;
}
.payzone .pos-pay { display: flex; gap: 10px; }
.payzone .pos-pay .btn.go {
  min-height: 62px; font-size: 20px; letter-spacing: .06em;
  border-radius: 14px; flex: 1.4;
}
.payzone .pos-pay .btn.go.outline {
  background: transparent; color: #a9e3c0; border-color: #35634a; flex: 1;
}
.payzone .pos-pay .btn.go.outline:hover { background: #1c2f24; }

/* --- today's sales slide-over --- */
.posrecent {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(580px, 92%);
  background: #fff; box-shadow: -14px 0 34px rgba(0, 0, 0, .45); z-index: 6;
  display: flex; flex-direction: column; border-left: 1px solid var(--line);
}
.recenthead {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.recenthead h3 { font-size: 15px; }
.recentbody { flex: 1; overflow-y: auto; padding: 0 10px; }

.posgrid ::-webkit-scrollbar { width: 10px; }
.posgrid ::-webkit-scrollbar-thumb { background: #33483c; border-radius: 6px; }
.tktlines::-webkit-scrollbar-thumb, .recentbody::-webkit-scrollbar-thumb,
#tkMatches::-webkit-scrollbar-thumb { background: #cfcaba; }

/* On a narrow screen the register stacks and scrolls like any other page. */
@media (max-width: 1100px) {
  .posgrid { flex-direction: column; height: auto; }
  .posleft { padding-bottom: 0; }
  .posgrid .postiles { max-height: 46vh; }
  /* Stacked, the 430px flex-basis would become a HEIGHT and trap the whole
     pay panel in a scrolling box - let it take its natural height. */
  .postkt { flex: 1 1 auto; border-left: 0; border-top: 1px solid #2a3c31; overflow-y: visible; }
  .posrecent { position: fixed; }
  .changebox { flex: 0 0 120px; }
}

/* Reordering on the route map list. */
#mapRows tr { cursor: grab; }
#mapRows tr.dragging { opacity: .45; }
#mapRows tr.over td { border-top: 2px solid var(--brand, #15803d); }
.draghandle { color: #94a3b8; white-space: nowrap; width: 1%; letter-spacing: -3px; }
.ordbtns { letter-spacing: 0; margin-left: 6px; }
.ordbtn {
  border: 1px solid var(--line, #cbd5e1); background: #fff; border-radius: 6px;
  padding: 1px 6px; font-size: 10px; color: #475569; cursor: pointer;
}
.ordbtn:hover { background: #f1f5f9; }

/* ---------- the landing: mission first, sign-in beside it ----------
   Palette lifted from the print piece: deep navy, warm cream, serif
   headlines, one hot accent. The donor CTA leads; staff sign in beside. */
.gate {
  display: flex; align-items: stretch; justify-content: center; gap: 0;
  background: #f4efe6; padding: 0; overflow: auto;
}
.gate-hero {
  flex: 1.3; min-width: 0; background: #253546; color: #f6f3ea;
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px 56px; font-family: Georgia, 'Times New Roman', serif;
  position: relative; overflow: hidden;
}
/* The brand film loops behind everything; the navy shade keeps the words
   readable over whatever frame happens to be up. */
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
  animation: heroDrift 36s ease-in-out infinite alternate;
}
@keyframes heroDrift {
  from { transform: scale(1); }
  to   { transform: scale(1.07); }
}
.hero-shade {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg, rgba(23, 33, 44, .82) 0%, rgba(23, 33, 44, .62) 55%, rgba(23, 33, 44, .45) 100%);
}
.gate-hero > .hero-brandbar, .gate-hero > .hero-lead, .gate-hero > .hero-lines,
.gate-hero > .hero-cta, .gate-hero > .hero-sub {
  position: relative; z-index: 2;
  opacity: 0; animation: heroRise .7s cubic-bezier(.2, .7, .3, 1) forwards;
}
.gate-hero > .hero-lead  { animation-delay: .12s; }
.gate-hero > .hero-lines { animation-delay: .24s; }
.gate-hero > .hero-cta   { animation-delay: .36s; }
.gate-hero > .hero-sub   { animation-delay: .48s; }
@keyframes heroRise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gate-logo { opacity: 0; animation: heroRise .7s cubic-bezier(.2, .7, .3, 1) .2s forwards; }
@media (prefers-reduced-motion: reduce) {
  .hero-video, .gate-hero > *, .gate-logo { animation: none; opacity: 1; transform: none; }
}
.hero-brandbar { border-left: 6px solid #e7cb65; padding-left: 14px; margin-bottom: 18px; }
.hero-org {
  font-family: -apple-system, 'Segoe UI', Roboto, sans-serif; font-weight: 800;
  font-size: 15px; letter-spacing: .18em; text-transform: uppercase; color: #f6f3ea;
  border-bottom: 2px solid #f6f3ea; padding-bottom: 6px; display: inline-block;
}
.hero-lead { font-size: clamp(30px, 4vw, 46px); line-height: 1.12; margin: 0 0 18px; font-weight: 400; text-shadow: 0 1px 10px rgba(0, 0, 0, .35); }
.hero-lead em { font-style: normal; font-weight: 800; color: #253546; background: #e7cb65; padding: 0 8px; border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; text-shadow: none; }
.hero-lines { margin: 0 0 24px; }
.hero-lines p {
  font-size: clamp(18px, 2.2vw, 24px); font-weight: 700; line-height: 1.25; margin: 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .4);
}
.hero-lines p em { font-style: normal; color: #253546; background: #e7cb65; padding: 0 5px; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; text-shadow: none; }
.hero-dot { display: block; text-align: left; color: #c9a83d; font-size: 14px; margin: 10px 4px; }
.hero-cta {
  display: inline-block; align-self: flex-start; background: #e7cb65; color: #253546;
  font-family: -apple-system, 'Segoe UI', Roboto, sans-serif; font-weight: 800;
  font-size: 16px; text-decoration: none; padding: 14px 26px; border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.hero-cta:hover {
  background: #f0d675; transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
}
.hero-sub {
  margin-top: 14px; max-width: 460px; font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 13.5px; color: #dfe4ea; line-height: 1.5; text-shadow: 0 1px 6px rgba(0, 0, 0, .4);
}
.gate-forms {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 30px; padding: 40px 32px;
  background: #0b0d10;
}
.gate-logo { width: min(250px, 62%); height: auto; display: block; }
.gate-logo3d {
  width: min(940px, 100%); height: 680px; display: block;
  --poster-color: transparent; --progress-bar-color: transparent;
  background: transparent;
  opacity: 0; animation: heroRise .7s cubic-bezier(.2, .7, .3, 1) .2s forwards;
}
.gate-logo3d .gate-logo { width: 100%; }
@media (prefers-reduced-motion: reduce) { .gate-logo3d { animation: none; opacity: 1; } }
@media (max-width: 860px) {
  .gate { flex-direction: column; }
  .gate-hero { padding: 34px 24px 30px; }
  .gate-forms { padding: 28px 16px 44px; }
}

/* Register full-screen mode: sidebar folds away, hamburger overlays it back. */
.side-toggle {
  display: none; border: 1px solid var(--line); background: #fff; border-radius: 10px;
  font-size: 19px; line-height: 1; padding: 7px 11px; cursor: pointer; color: #2c4335;
  margin-right: 4px;
}
.side-toggle:hover { background: #ebf1ec; border-color: #c9d2c8; }
/* Back and Refresh live in the top bar on every screen - the app is often on
   a phone home screen with no browser chrome to provide either, and touch
   has no hover: these must LOOK tappable at rest. */
.nav-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  font-size: 16px; line-height: 1; padding: 8px 11px; cursor: pointer; color: #2c4335;
  margin-right: 4px;
}
.nav-btn:hover { background: #ebf1ec; border-color: #c9d2c8; }
body.posmode .side-toggle { display: inline-block; }
body.posmode .shell { grid-template-columns: 1fr; }
/* The hot edge: a slim rail that stays on the left in full-screen mode. Rest
   the mouse on it or tap it and the sidebar slides out - no reaching for the
   top bar from the far side of a counter screen. */
.side-edge {
  display: none; position: fixed; left: 0; top: 0; height: 100vh; width: 14px; z-index: 79;
  border: 0; padding: 18px 0 0; background: #0f2a1c; color: #7fb99a; font-size: 11px;
  line-height: 1; cursor: pointer; align-items: flex-start; justify-content: center;
}
.side-edge:hover { background: #1f7a45; color: #fff; }
body.posmode .side-edge { display: flex; }
body.posmode.side-open .side-edge { display: none; }
body.posmode .main { padding-left: 14px; }
body.posmode .side {
  position: fixed; left: 0; top: 0; height: 100vh; width: 232px; z-index: 80;
  transform: translateX(-102%); transition: transform .18s ease;
}
body.posmode.side-open .side {
  transform: none; box-shadow: 12px 0 40px rgba(0, 0, 0, .35);
}
@media (prefers-reduced-motion: reduce) { body.posmode .side { transition: none; } }

/* Price-book tiles: an item with three condition prices as thumb chips. */
.ptsubhead {
  flex-basis: 100%; width: 100%; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em; color: #5c6b58;
  margin: 8px 2px 0; border-bottom: 1px solid #e2e8f0; padding-bottom: 3px;
}
.postile.tiered {
  display: flex; flex-direction: column; gap: 6px; padding: 8px 10px;
  cursor: default;
}
.postile.tiered .tapname {
  background: none; border: 0; font: inherit; font-weight: 700; text-align: left;
  padding: 0; cursor: pointer; color: inherit;
}
.ptchips { display: flex; gap: 5px; }
.ptchip {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  border: 1px solid #cfe3d6; background: #eef6f0; border-radius: 8px;
  padding: 5px 4px; cursor: pointer; font: inherit;
}
.ptchip span { font-size: 10px; font-weight: 700; text-transform: uppercase; color: #476253; }
.ptchip b { font-size: 14px; color: #14532d; }
.ptchip:hover { background: #dcefe2; }

/* The driver's morning launch cards. Big targets for work gloves. */
.drivgo {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 2px solid var(--line); background: #fff; border-radius: 14px;
  padding: 16px 18px; margin-bottom: 10px; cursor: pointer; font: inherit;
}
.drivgo.big { border-color: var(--brand); background: #f0fdf4; }
.drivgo:hover { border-color: var(--brand); }
.drivname { font-size: 19px; font-weight: 800; flex: 1; }
.drivmeta { color: var(--muted); font-size: 14px; }
.drivarrow { font-size: 22px; color: var(--brand); font-weight: 700; }

/* Dumps, deliveries and service runs on the month calendar. */
.siderunbar {
  margin-top: 12px; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; background: #f7f9f6;
}
.siderunhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.sidersow {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 5px 0; border-bottom: 1px solid var(--line);
}
.sidersow:last-child { border-bottom: 0; }
.chip.sidechip { background: #fff7ed; border: 1px solid #fdba74; color: #9a3412; }
.chip.sidechip.done { opacity: .55; text-decoration: line-through; }

/* Weekday pills on the standing-pickup editor. */
.rcday {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer;
}
.rcday:has(input:checked) { border-color: var(--brand); background: #f0fdf4; font-weight: 700; }

/* Daily task rows. */
.taskrow {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 8px;
}
.taskrow.receipt { border-left: 4px solid #d97706; background: #fffbeb; }
.taskmain { flex: 1; min-width: 220px; }
.taskacts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Inline result banners on the Raiser's Edge sync screen. */
.banner { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.banner.ok  { background: #e7f2ea; color: #14532d; border: 1px solid #bcd9c6; }
.banner.err { background: #fdeeee; color: #b91c1c; border: 1px solid #efc4c4; }

/* Home screens: a quiet section label (its color reduced to a small tick)
   over a grid of clean launcher cards. The old pastel bands and gradient
   tiles went the way of the software they imitated. */
.hub-panel { margin-bottom: 26px; }
.hub-band {
  display: flex; align-items: center; gap: 8px;
  padding: 0 2px 10px; text-align: left; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.hub-band::before {
  content: ''; width: 8px; height: 8px; border-radius: 3px; background: var(--brand-mid);
}
.hub-band.c1::before { background: #6366f1; }
.hub-band.c2::before { background: #16a34a; }
.hub-band.c3::before { background: #a855f7; }
.hub-band.c4::before { background: #d97706; }
.hub-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px; padding: 0;
}
.hub-tile {
  min-height: 112px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  font: inherit; padding: 12px 10px; text-align: center; cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
.hub-tile:hover {
  border-color: #b9c6ba; transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(18, 28, 22, .08), 0 12px 30px rgba(18, 28, 22, .07);
}
.hub-tile .ico {
  line-height: 0; width: 46px; height: 46px; border-radius: 13px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center;
}
.hub-tile:hover .ico { background: #d2eadb; }
.hub-tile .ico svg {
  width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.hub-tile .lbl { font-size: 12.5px; font-weight: 600; line-height: 1.25; }

/* Scanned check images (the scan station's to-enter pile) */
.scanthumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.scanthumb {
  width: 150px; height: 92px; padding: 0; border: 1px solid var(--line);
  border-radius: 6px; background: #f6f7f9; cursor: pointer; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font: inherit;
}
.scanthumb:hover { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.scanthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanpdf { font-weight: 700; color: var(--muted); letter-spacing: .06em; }

/* ---------- echo entry (voice intake on the new-pickup drawer) ---------- */
.voicebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 2px; }
.voicebar .chips { margin: 0; display: inline-flex; gap: 4px; }
#vMic.live {
  background: var(--danger); border-color: var(--danger); color: #fff;
  animation: vpulse 1.3s ease-in-out infinite;
}
@keyframes vpulse { 50% { opacity: .7; } }
@media (prefers-reduced-motion: reduce) { #vMic.live { animation: none; } }
#vHeard {
  margin: 6px 0 2px; overflow: hidden; white-space: nowrap;
  text-overflow: ellipsis; font-style: italic;
}
.voicefill { background: var(--warn-soft); }
