/* BlitzPay site: a dashboard in the marketing site's colours and type.
   Two deliberate looks, by who is signed in, not by the computer's light/dark
   setting: clients get navy (below), the BlitzPay team gets white (body.staff,
   near the end), so a staff screen can't be mistaken for a client's.  Colours
   are only ever used through these tokens.  Fonts are served from this app
   (fonts/fonts.css); nothing is fetched from anyone else. */

:root {
  --ink: #0F1A2E;          /* page */
  --surface: #17253E;      /* panels */
  --surface-2: #1E3050;    /* table heads, raised bits */
  --field: #122036;        /* inputs */
  --edge: #2B3F60;
  --edge-soft: #22314C;
  --paper: #F5F7FB;        /* text */
  --pale: #BBD3FA;         /* links */
  --muted: #8FA5C8;        /* secondary text */
  --bolt: #ECC02E;         /* the brand accent: primary actions */
  --bolt-ink: #22190A;
  --bolt-glow: rgba(236, 192, 46, .10);
  --bolt-text: var(--bolt);            /* yellow used as text: darker on white */
  --bolt-edge: rgba(236, 192, 46, .45);
  --ok: #7ED9A4;     --ok-bg: rgba(126, 217, 164, .13);     --ok-edge: rgba(126, 217, 164, .45);
  --warn: #F4A261;   --warn-bg: rgba(244, 162, 97, .14);    --warn-edge: rgba(244, 162, 97, .45);
  --danger: #F28B82; --danger-bg: rgba(242, 139, 130, .14); --danger-edge: rgba(242, 139, 130, .55);
  --info-bg: rgba(187, 211, 250, .08); --info-edge: rgba(187, 211, 250, .22);
  --on-ok: var(--ink);                 /* the tick on a ticked box */
  --sidebar: #0B1526;
  --placeholder: #5E7396;
  --row-hover: rgba(255, 255, 255, .02);
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .8);
  --focus: var(--bolt);
  --lead-bg: linear-gradient(180deg, rgba(236, 192, 46, .10), transparent 70%), #17253E;
  --radius: 8px;
  --wrap: 1320px;
  --gut: clamp(16px, 2.4vw, 32px);
  --side-w: 236px;
  --display: "Archivo Black", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0; background: var(--ink); color: var(--paper);
  font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-family: var(--body); font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(1.4rem, 2.2vw, 1.7rem); line-height: 1.2; }
h2 { font-size: 1rem; line-height: 1.3; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: .86em; }
.quiet { color: var(--muted); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.hint { font-size: .86rem; color: var(--muted); }
.eyebrow { font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--bolt-text); }
.empty { color: var(--muted); padding: 14px 16px; }
.link { color: var(--pale); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---- frame: a sidebar and the page beside it ---- */
/* On a wrapper, not <body>: an element a browser extension adds to <body> would take the sidebar's column. */
body.app .shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px; padding: 18px 12px 14px;
  background: var(--sidebar); border-right: 1px solid var(--edge-soft);
}
.brand { display: inline-flex; align-items: center; gap: 10px; padding: 0 8px; font-family: var(--display); font-size: 1.12rem; text-decoration: none; }
.brand img { border-radius: 6px; }
.side-scope { margin-top: -8px; padding: 0 8px; font-size: .78rem; color: var(--muted); }
.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px;
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: .92rem; white-space: nowrap;
}
.sidenav a:hover { color: var(--paper); background: var(--surface); }
.sidenav a[aria-current] { color: var(--paper); background: var(--surface-2); box-shadow: inset 3px 0 0 var(--bolt); }
.sidenav svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-heading { padding: 12px 10px 4px; font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.branchnav a i { width: 7px; height: 7px; margin: 0 5px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; }
.branchnav a[aria-current] i { background: var(--bolt); border-color: var(--bolt); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side-foot .sitelabel { align-self: flex-start; }
.userbtn {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; cursor: pointer; list-style: none;
  border: 1px solid var(--edge-soft); border-radius: var(--radius); background: var(--surface);
}
.userbtn::-webkit-details-marker { display: none; }
.userbtn:hover { border-color: var(--edge); }
.username { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: .9rem; }
/* Before the name, on every page, for the BlitzPay team. */
.staffpill {
  flex: none; padding: 2px 6px; border-radius: 4px; background: var(--bolt-glow); color: var(--bolt-text);
  font: 600 .66rem var(--mono); letter-spacing: .1em; text-transform: uppercase;
}
.usermenu .popover-body.menu { left: 0; right: auto; top: auto; bottom: calc(100% + 8px); width: 100%; }

.main { min-width: 0; display: flex; flex-direction: column; }
/* Staff only, on a branch's pages: whose payroll this is. */
.onbehalf {
  position: sticky; top: 0; z-index: 15; padding: 9px var(--gut);
  background: var(--info-bg); border-bottom: 1px solid var(--info-edge); color: var(--muted); font-size: .86rem;
}
.onbehalf b { color: var(--paper); font-weight: 600; }

/* Signed out (the sign-in page), and the error pages, which have no sidebar. */
.topbar { display: flex; align-items: center; gap: 16px; height: 62px; padding: 0 var(--gut); border-bottom: 1px solid var(--edge-soft); }
.topbar .sitelabel { margin-left: auto; }

.page { width: 100%; max-width: var(--wrap); padding: 24px var(--gut) 72px; display: flex; flex-direction: column; gap: 22px; }
.page.wide { max-width: none; }   /* roster, shifts, results, audit: let the table breathe */
body:not(.app) .page { margin: 0 auto; }
.pagehead { display: flex; flex-direction: column; gap: 8px; }
.lede { color: var(--muted); max-width: 68ch; }

.backlink {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: -8px; padding: 5px 13px 5px 10px; border-radius: 999px;
  border: 1px solid var(--edge); background: var(--surface);
  color: var(--paper); text-decoration: none; font-weight: 500; font-size: .86rem;
}
.backlink span { color: var(--bolt-text); font-weight: 600; }
.backlink:hover { border-color: var(--bolt-text); }

.flash { display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 11px 15px; border-radius: var(--radius); border: 1px solid var(--edge); background: var(--surface); }
.msg.success { border-color: var(--ok-edge); background: var(--ok-bg); }
.msg.error { border-color: var(--danger-edge); background: var(--danger-bg); }
.msg.warning, .msg.info { border-color: var(--warn-edge); background: var(--warn-bg); }

.block { display: flex; flex-direction: column; gap: 12px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.formbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.formbar .hint { flex: 1; }
form.inline { display: inline; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; text-decoration: none;
  font-weight: 600; font-size: .92rem; padding: 9px 16px; border-radius: 6px;
  border: 1px solid var(--bolt); background: var(--bolt); color: var(--bolt-ink);
  list-style: none; white-space: nowrap; transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.btn::-webkit-details-marker { display: none; }
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--paper); border-color: var(--edge); }
.btn.ghost:hover { border-color: var(--pale); }
.btn.quiet { background: transparent; color: var(--muted); border-color: var(--edge-soft); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger-edge); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.small { font-size: .82rem; padding: 5px 11px; }
.btn.big { font-size: 1rem; padding: 12px 24px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; }

/* ---- status chips ---- */
.chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 500;
  padding: 3px 11px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent;
}
.chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.wait { color: var(--muted); border-color: var(--edge); }
.chip.ready { color: var(--bolt-text); background: var(--bolt-glow); border-color: var(--bolt-edge); }
.chip.ok { color: var(--ok); background: var(--ok-bg); }
.chip.review { color: var(--warn); background: var(--warn-bg); }
.chip.stop { color: var(--danger); background: var(--danger-bg); }
.tag { font-family: var(--mono); font-size: .72rem; color: var(--pale); border: 1px solid var(--edge); border-radius: 4px; padding: 1px 6px; }

/* ---- panels: a titled box, as on the home page ---- */
.panel { min-width: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--edge-soft); border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--edge-soft); }
.panel .cutoffs { border: 0; background: transparent; }
.panel .danger-zone { margin: 4px 16px 16px; }
.panel > .tablewrap { border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.branchgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(540px, 100%), 1fr)); gap: 16px; align-items: start; }

/* ---- home ---- */
/* No overflow:hidden here: it would clip each row's open Edit menu. */
.cutoffs { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--edge-soft); border-radius: var(--radius); }
.cutoffs li:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.cutoffs li:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.cutoffs li:only-child { border-radius: var(--radius); }
.cutoffs li + li { border-top: 1px solid var(--edge-soft); }
.cutoffs li { display: flex; align-items: center; gap: 10px; padding-right: 16px; }
.cutoffs li:hover { background: var(--surface-2); }
.cutoffs li.empty { display: block; }
.rowmenu { flex: none; }
.popover-body.menu { width: 290px; gap: 2px; padding: 8px; }
.popover-body.menu .popover-title { padding: 6px 8px 8px; color: var(--muted); font-size: .8rem; font-weight: 500; }
.popover-body.menu a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; font-size: .9rem; }
.popover-body.menu a:hover { background: var(--surface); color: var(--bolt-text); }
/* Two lines: the dates and the amount, then the kind of cutoff and its status. */
.cutoff {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 3px;
  column-gap: 18px; align-items: center; padding: 11px 16px; text-decoration: none;
}
.cutoff .period { font-weight: 600; }
.cutoff .meta { font-size: .82rem; color: var(--muted); }
.cutoff .amount { justify-self: end; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.cutoff .chip { justify-self: end; }
@media (max-width: 480px) {
  .cutoff { grid-template-columns: 1fr; }
  .cutoff .amount, .cutoff .chip { justify-self: start; }
}

/* ---- popovers and forms ---- */
.popover { position: relative; }
.popover[open] > summary { border-color: var(--bolt-text); }
.popover-body {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; width: 310px;
  display: flex; flex-direction: column; gap: 10px; padding: 16px;
  background: var(--surface-2); border: 1px solid var(--edge); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.popover.right .popover-body { width: 370px; }
.popover-title { font-weight: 600; }
label { display: flex; flex-direction: column; gap: 5px; font-size: .84rem; color: var(--muted); font-weight: 500; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select {
  padding: 8px 10px; border: 1px solid var(--edge); border-radius: 6px;
  background: var(--field); color: var(--paper); font-size: .92rem; min-width: 0;
}
input::placeholder { color: var(--placeholder); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--bolt); width: 16px; height: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { display: flex; gap: 16px; flex-wrap: wrap; }
.choice label, label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--paper); font-weight: 500; font-size: .92rem; }

/* ---- cutoff steps ---- */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.step {
  counter-increment: step; position: relative; display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1px solid var(--edge-soft); border-radius: var(--radius); padding: 18px 20px 18px 64px;
}
.step::before {
  content: counter(step); position: absolute; left: 20px; top: 17px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font: 600 .85rem var(--mono); color: var(--bolt-ink); background: var(--bolt);
}
.step-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.stepline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .slots, .grid2 { grid-template-columns: 1fr; } }
.note { font-size: .86rem; }
.note.warn { color: var(--warn); }
.notes { margin: 0; padding-left: 18px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.figures { display: flex; gap: 24px; flex-wrap: wrap; color: var(--muted); font-size: .92rem; }
.figures b { font-family: var(--mono); color: var(--paper); font-weight: 500; margin-left: 5px; }
.run { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ---- drop zones ---- */
.dropzone {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px;
  border: 1px solid var(--edge); border-radius: var(--radius); background: var(--ink);
}
.dropzone.filled { border-color: var(--ok-edge); }
.dropzone-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dropzone .label { font-weight: 600; }
.dropzone .file { font-family: var(--mono); font-size: .8rem; color: var(--pale); word-break: break-all; }
.drop-target {
  position: relative; margin-top: 6px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 16px 12px; border: 1.5px dashed var(--edge); border-radius: 7px; text-align: center;
  color: var(--paper); cursor: pointer; transition: border-color .12s ease, background .12s ease;
}
.drop-target:hover, .dropzone.dragover .drop-target { border-color: var(--bolt); background: var(--bolt-glow); }
.drop-target:focus-within { outline: 2px solid var(--bolt); outline-offset: 2px; }
.drop-target input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.drop-cta { font-size: .9rem; }
.drop-cta u { color: var(--pale); text-underline-offset: 3px; }
.drop-types { font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.drop-status { font-size: .84rem; color: var(--bolt-text); }
.drop-status:empty { display: none; }
.js [data-drop-submit] { display: none; }
[data-drop-submit] { align-self: flex-start; }
.upload-one { max-width: 640px; }

.callout { border: 1px solid var(--edge); border-radius: var(--radius); padding: 13px 16px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.callout ul { margin: 0; padding-left: 18px; }
.callout.stop { border-color: var(--danger-edge); background: var(--danger-bg); }
.callout.warn { border-color: var(--warn-edge); background: var(--warn-bg); }
.callout-title { font-weight: 600; }
.callout form { margin-top: 4px; }

.danger-zone { border: 1px solid var(--edge-soft); border-radius: var(--radius); padding: 12px 16px; margin-top: 12px; }
.danger-zone summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.danger-zone[open] { border-color: var(--danger-edge); }
.danger-zone form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; margin-top: 12px; max-width: 70ch; }
.danger-zone p { color: var(--muted); font-size: .9rem; }

/* ---- tables ---- */
.tablewrap {
  overflow: auto; overscroll-behavior-x: contain; max-height: min(74vh, 900px);
  background: var(--surface); border: 1px solid var(--edge-soft); border-radius: var(--radius);
}
.tablewrap.narrow { max-width: 920px; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; padding: 9px 13px; border-bottom: 1px solid var(--edge-soft); vertical-align: middle; }
th { font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
/* The heading row and the totals row stay in view while the rows scroll past. */
.tablewrap thead th { position: sticky; top: 0; z-index: 3; box-shadow: inset 0 -1px 0 var(--edge); }
.tablewrap tfoot td { position: sticky; bottom: 0; z-index: 2; box-shadow: inset 0 1px 0 var(--edge); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--row-hover); }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
td.num.quiet, td.text.quiet { color: var(--muted); }
td.total { color: var(--bolt-text); font-weight: 500; }
td.name { white-space: nowrap; font-weight: 500; }
tfoot td { background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--edge); border-bottom: 0; }

table.edit td { padding: 6px 7px; }
table.edit input:not([type="checkbox"]), table.edit select { width: 100%; padding: 6px 8px; font-size: .88rem; }
table.edit td:first-child { min-width: 230px; }
/* Beside the sidebar there is less room: the table scrolls sideways rather than cut words off. */
table.edit input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { min-width: 120px; }
table.edit select { min-width: 118px; }
table.edit input.money { text-align: right; font-family: var(--mono); min-width: 92px; }
table.edit input.date { font-family: var(--mono); min-width: 120px; }
table.edit input.changed, table.edit select.changed { border-color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
tr.status-new td { background: var(--bolt-glow); }
tr.status-changed td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.status-not_in_upload td, tr.status-not_on_roster td { color: var(--muted); }
.rowtag { display: inline-block; margin-top: 3px; font-family: var(--mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); }
.rowtag.muted { color: var(--muted); }

table.shifts tr.problem td { background: var(--warn-bg); }
table.shifts tr.corrected td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
table.audit td { vertical-align: top; }
table.audit .change { min-width: 240px; }
del { color: var(--danger); text-decoration-thickness: 1px; }
ins { color: var(--ok); text-decoration: none; font-weight: 500; }

.filter { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--edge-soft); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; max-width: 580px; margin-top: 10px; }
.addday > summary { width: fit-content; }

/* ---- results ---- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 880px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--edge-soft); border-radius: var(--radius); padding: 15px 17px; display: flex; flex-direction: column; gap: 3px; }
.tile.lead { border-color: var(--bolt-edge); background: var(--lead-bg); }
.tile .k { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tile .v { font-family: var(--mono); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.tile.lead .v { color: var(--bolt-text); }
.tile.attention .v { color: var(--warn); }
.tile .v.small-v { font-size: 1.05rem; padding: 4px 0 3px; }
.tile .s { font-size: .8rem; color: var(--muted); }

.reviews { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.review-item {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 14px; align-items: start;
  background: var(--surface); border: 1px solid var(--edge-soft); border-left: 3px solid var(--warn);
  border-radius: var(--radius); padding: 12px 14px 12px 12px;
}
.review-item.done { border-left-color: var(--ok); }
.review-item.done .review-text > p:first-child { color: var(--muted); }
.tickbox {
  width: 20px; height: 20px; margin-top: 2px; border-radius: 5px; cursor: pointer; padding: 0;
  border: 1.5px solid var(--edge); background: var(--field);
}
.tickbox:hover { border-color: var(--ok); }
.tickbox[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); }
.tickbox[aria-pressed="true"]::after { content: ""; display: block; width: 5px; height: 10px; margin: 2px auto 0; border: solid var(--on-ok); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.review-text { display: flex; flex-direction: column; gap: 2px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .btn:hover { transform: none; } }

/* ---- the way back to editing, on the results page ---- */
.nextstep {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: space-between;
  padding: 18px 20px; border-radius: var(--radius);
  border: 1px solid var(--bolt-edge); background: linear-gradient(180deg, var(--bolt-glow), transparent 80%), var(--surface);
}
.nextstep-text { flex: 1 1 420px; display: flex; flex-direction: column; gap: 4px; }
.nextstep-title { font-weight: 600; font-size: 1rem; }
.nextstep p:not(.nextstep-title) { color: var(--muted); font-size: .92rem; max-width: 74ch; }
.nextstep .btn { flex: none; }

/* ---- typing the service charge total instead of uploading the sales export ---- */
.orbox { display: flex; flex-direction: column; gap: 10px; }
.orline { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; }
.orline::before, .orline::after { content: ""; flex: 1; height: 1px; background: var(--edge-soft); }
.orline span { font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.totalform { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.totalform label { flex: 0 1 330px; }
.totalform input.money { text-align: right; font-family: var(--mono); }

/* ---- putting a removed cutoff back ---- */
.restorer[open] { border-color: var(--bolt-edge); }
.restore-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.restore-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px; border: 1px solid var(--edge-soft); border-radius: var(--radius); background: var(--ink);
}
.restore-list b { font-weight: 600; }

/* ---- "save your changes first?" ---- */
dialog.ask {
  border: 1px solid var(--edge); border-radius: var(--radius); padding: 0;
  background: var(--surface); color: var(--paper); max-width: min(460px, calc(100vw - 32px));
  box-shadow: var(--shadow);
}
dialog.ask::backdrop { background: rgba(8, 14, 25, .68); }
.ask-body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 18px; }
.ask-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* ---- who is signed in ---- */
.sitelabel { font-family: var(--mono); letter-spacing: .04em; }
.menu-button {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 6px;
  background: transparent; font-size: .9rem; cursor: pointer;
}
.menu-button:hover { background: var(--surface); color: var(--bolt-text); }
.popover-body.menu form { margin: 0; }

/* ---- sign-in and password pages ---- */
.signin { max-width: 440px; display: flex; flex-direction: column; gap: 18px; }
body:not(.app) .signin { width: 100%; margin: 6vh auto 0; }
.signin-card { max-width: none; margin-top: 0; gap: 14px; padding: 20px; }
.signin-card .btn { justify-content: center; }

/* ---- accounts ---- */
tr.muted td { color: var(--muted); }
.accountform { max-width: 640px; }
.choicebox { border: 1px solid var(--edge-soft); border-radius: var(--radius); padding: 10px 14px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.choicebox legend { padding: 0 6px; font-size: .84rem; color: var(--muted); }
.branchlist { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-left: 26px; }
.actions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.actions-grid .card { max-width: none; margin-top: 0; }
@media (max-width: 860px) { .actions-grid { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding-top: 12px; border-top: 1px solid var(--edge-soft); }
.stack .confirm { align-self: stretch; }
.temppass { font-size: 1.6rem; letter-spacing: .06em; color: var(--bolt-text); user-select: all; }
.actions-grid .card > .btn { align-self: flex-start; }

/* ---- who made an audit entry ---- */
.side { display: inline-block; margin-right: 4px; padding: 1px 7px; border-radius: 4px; font-size: .74rem; font-weight: 600; }
.side.team { color: var(--bolt-text); background: var(--bolt-glow); }
.side.client { color: var(--ok); background: var(--ok-bg); }

/* ---- phones and small tablets: the sidebar becomes a bar across the top ---- */
@media (max-width: 860px) {
  body.app .shell { display: block; }
  .sidebar {
    position: relative; height: auto; overflow: visible;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 12px;
    padding: 10px 14px 6px; border-right: 0; border-bottom: 1px solid var(--edge-soft);
  }
  .side-scope, .branchnav { display: none; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; gap: 8px; }
  .userbtn { padding: 5px 9px; max-width: 200px; }
  .usermenu .popover-body.menu { top: calc(100% + 8px); bottom: auto; left: auto; right: 0; width: 250px; }
  .sidenav { order: 3; width: 100%; flex-direction: row; overflow-x: auto; }
  .sidenav a[aria-current] { box-shadow: inset 0 -2px 0 var(--bolt); }
  .onbehalf { position: static; }
  html { scroll-padding-top: 16px; }
}
@media (max-width: 700px) {
  .sitelabel { font-size: .68rem; padding: 2px 8px; }
  .page { gap: 18px; padding-top: 18px; }
  .sidenav svg { display: none; }
  .step { padding: 16px 16px 16px 52px; }
  .step::before { left: 14px; }
  .tiles .tile.lead { grid-column: 1 / -1; }                      /* the total gets the whole width */
  .review-item { grid-template-columns: 24px minmax(0, 1fr); }
  .review-item > .btn { grid-column: 2; justify-self: start; }    /* the Fix button goes under the text */
  table.edit td:first-child { min-width: 140px; }
  .nextstep .btn { flex: 1 1 100%; white-space: normal; justify-content: center; text-align: center; }
}

/* ---- the BlitzPay team's white theme ---- */
/* Only the tokens change; every rule above reads them. */
body.staff {
  --ink: #F4F6FA; --surface: #FFFFFF; --surface-2: #EEF1F6; --field: #FFFFFF;
  --edge: #CFD6E2; --edge-soft: #E2E7EF;
  --paper: #0F1A2E; --pale: #24478F; --muted: #5A6A84;
  --bolt-glow: rgba(236, 192, 46, .20); --bolt-text: #8A6600; --bolt-edge: rgba(176, 134, 0, .45);
  --ok: #1C7A4A;     --ok-bg: rgba(28, 122, 74, .10);     --ok-edge: rgba(28, 122, 74, .35);
  --warn: #A85A07;   --warn-bg: rgba(168, 90, 7, .10);    --warn-edge: rgba(168, 90, 7, .35);
  --danger: #B42318; --danger-bg: rgba(180, 35, 24, .08); --danger-edge: rgba(180, 35, 24, .35);
  --info-bg: #EDF1F8; --info-edge: #D5DDEB;
  --on-ok: #FFFFFF;
  --sidebar: #FFFFFF;
  --placeholder: #8A97AD;
  --row-hover: rgba(15, 26, 46, .03);
  --shadow: 0 16px 36px -18px rgba(15, 26, 46, .30);
  --focus: #24478F;
  --lead-bg: #FFFBEA;
}
html:has(body.staff) { color-scheme: light; }
