/* Puff Stop Backend. Brand: the orange→coral of the logo pin. Green is kept soft and only means "good / done". */
:root {
  --brand: #ee6a1f;
  --brand-2: #ff5f52;
  --brand-hover: #d95a12;
  --brand-ink: #ffffff;
  --brand-text: #c2410c;            /* orange that reads well as text on white */
  --brand-soft: #fff1e7;
  --brand-ring: rgba(238, 106, 31, .28);

  --bg: #f6f5f3;
  --panel: #ffffff;
  --panel-2: #faf9f7;
  --text: #1c1917;
  --muted: #78716c;
  --line: #e9e5e0;
  --line-strong: #d6d0c9;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --danger: #c81e1e;
  --danger-soft: #fdecec;
  --warn: #b45309;
  --warn-soft: #fff4e0;
  --info: #1d4ed8;
  --info-soft: #e8eefc;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(28, 25, 23, .04), 0 2px 8px rgba(28, 25, 23, .04);
  --shadow-lg: 0 18px 48px rgba(28, 25, 23, .18);
  --display: "League Spartan", "Inter", system-ui, sans-serif;
  --side-w: 236px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #f47a32;
    --brand-hover: #ff8a45;
    --brand-text: #ff9a5c;
    --brand-soft: #2d1d12;
    --brand-ring: rgba(244, 122, 50, .35);
    --bg: #141211;
    --panel: #1d1a18;
    --panel-2: #191715;
    --text: #f3f0ec;
    --muted: #a69e96;
    --line: #2e2a27;
    --line-strong: #3d3833;
    --ok: #4ade80;
    --ok-soft: #13291b;
    --danger: #f87171;
    --danger-soft: #361616;
    --warn: #fbbf24;
    --warn-soft: #33260d;
    --info: #93b4ff;
    --info-soft: #18213a;
    --shadow: none;
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); letter-spacing: -.01em; }
h1 { font-size: 1.7rem; font-weight: 800; margin: 0 0 16px; line-height: 1.15; }
h2 { font-size: 1.12rem; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 1rem; font-weight: 700; margin: 0 0 8px; }
a { color: var(--brand-text); }
.muted { color: var(--muted); }
.small-text { font-size: .85rem; }
.ok { color: var(--ok); font-weight: 700; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.docno { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pagehead h1 { margin: 0; }
.pagehead .sub { color: var(--muted); margin-top: 4px; }

/* ---------- shell: side menu + top bar ---------- */
.shell { display: flex; min-height: 100vh; }
.app { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side {
  position: sticky; top: 0; height: 100vh; width: var(--side-w); flex: none;
  display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line);
  padding: 16px 12px 12px; overflow-y: auto; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); padding: 2px 8px 14px; }
.brand { flex-direction: column; align-items: flex-start; gap: 4px; }
.brand .logo { height: 46px; width: auto; }
.brand .logo-dark { display: none; }
.brand .ver { font-size: .7rem; font-weight: 700; color: var(--muted); letter-spacing: .04em; padding-left: 2px; }
@media (prefers-color-scheme: dark) { .brand .logo-light { display: none; } .brand .logo-dark { display: block; } }
.brand .word { font-family: var(--display); font-weight: 900; font-size: 1.32rem; letter-spacing: .01em; line-height: 1; display: inline-flex; align-items: flex-end; padding-top: 5px; }
.brand .word .o { height: 1.2em; margin: 0 .03em -.04em; }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
nav .group { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-weight: 550; font-size: .94rem;
}
nav a svg { width: 19px; height: 19px; flex: none; color: var(--muted); }
nav a:hover { background: var(--panel-2); }
nav a.on { background: var(--brand-soft); color: var(--brand-text); font-weight: 700; }
nav a.on svg { color: var(--brand-text); }
nav a .badge { margin-left: auto; }
.side-foot { border-top: 1px solid var(--line); margin-top: 12px; padding: 12px 6px 0; display: grid; gap: 8px; }
.side-foot .who { display: flex; align-items: center; gap: 10px; }
.side-foot .who small { display: block; color: var(--muted); font-size: .78rem; }
.side-foot .who strong { display: block; font-size: .9rem; line-height: 1.2; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; font-size: .9rem;
}
.side-links { display: flex; gap: 14px; padding-left: 44px; }
.side-links .link { color: var(--muted); font-size: .85rem; text-decoration: none; }
.side-links .link:hover { color: var(--brand-text); }

.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  padding: 10px 24px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .where select { font-weight: 650; padding: 7px 32px 7px 12px; }
.top .where strong { font-weight: 700; }
.top .shift { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--muted); }
.top .shift strong { color: var(--text); }
.chip-device { font-size: .8rem; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; background: var(--panel); white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: 1px; }
.dot.off { background: var(--line-strong); }
.icon-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 7px; line-height: 0; color: var(--text); }
.menu-btn { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 25; }

main { width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 24px 72px; }

/* ---------- building blocks ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.card > h2:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { min-width: 0; }
.grow { flex: 1 1 220px; }
.stack { display: grid; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; color: var(--muted); font-weight: 550; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: .94rem; font-weight: 500; }
label.inline { flex-direction: row; align-items: center; gap: 6px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }

input, select, textarea, button { font: inherit; }
input, select, textarea {
  padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text); min-width: 0;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
input.qty { width: 84px; text-align: right; }
input.money { width: 118px; text-align: right; }
input.code { width: 130px; font-family: ui-monospace, Consolas, monospace; }

button {
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--text); cursor: pointer; font-weight: 600;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .05s;
}
button:hover { background: var(--panel-2); border-color: var(--muted); }
button.small, .top button, .member button { white-space: nowrap; }
button:active { transform: translateY(1px); }
button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-ring); }
button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 700; }
button.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--panel-2); }
button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: transparent; }
button.danger:hover { background: var(--danger-soft); }
button.big { padding: 13px 24px; font-size: 1.04rem; border-radius: 12px; }
button.link { border: 0; background: none; padding: 0; text-decoration: underline; cursor: pointer; color: var(--brand-text); font-weight: 600; }
button.small { padding: 5px 10px; font-size: .84rem; border-radius: 8px; }
button:disabled { opacity: .45; cursor: default; transform: none; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: .72rem; color: var(--muted); font-weight: 700; white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }
tr.voided td { text-decoration: line-through; color: var(--muted); }
tr.inactive td { opacity: .5; }
tfoot td { font-weight: 800; border-top: 2px solid var(--line-strong); border-bottom: 0; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 700; background: var(--ok-soft); color: var(--ok); white-space: nowrap; }
.pill.low, .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.out { background: var(--danger-soft); color: var(--danger); }
.pill.brand { background: var(--brand-soft); color: var(--brand-text); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.gray { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 800; }
.qty-low { color: var(--warn); font-weight: 700; }
.qty-out { color: var(--danger); font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.note { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .9rem; }
.note.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.install-steps { margin: 6px 0 10px; padding-left: 20px; display: grid; gap: 6px; }
.note.info { background: var(--info-soft); border-color: transparent; color: var(--info); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; border-radius: 0; background: none; padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button:hover { color: var(--text); background: none; }
.tabs button.on { color: var(--brand-text); border-bottom-color: var(--brand); }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.seg.wrap { flex-wrap: wrap; }
.seg.full { display: flex; }
.seg.full button { flex: 1; }
.seg button { border: 0; border-radius: 9px; padding: 7px 13px; background: transparent; color: var(--muted); font-weight: 600; }
.seg button:hover { background: var(--panel); color: var(--text); }
/* Selected option: solid brand orange so it stands out in light and dark mode. */
.seg button.on, .seg button.on:hover { background: var(--brand); color: #fff; box-shadow: 0 1px 4px rgba(238, 106, 31, .35); }

/* item search (shared editor) */
.picker { position: relative; }
.picker input { width: 100%; font-size: 1.02rem; padding: 12px 14px 12px 40px; }
.picker::before {
  content: ""; position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); opacity: .5;
  background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.5 3a7.5 7.5 0 0 1 5.9 12.1l4.8 4.8-1.4 1.4-4.8-4.8A7.5 7.5 0 1 1 10.5 3zm0 2a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.5 3a7.5 7.5 0 0 1 5.9 12.1l4.8 4.8-1.4 1.4-4.8-4.8A7.5 7.5 0 1 1 10.5 3zm0 2a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.results {
  position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin-top: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); max-height: 360px; overflow-y: auto;
}
.results div { padding: 10px 14px; display: flex; justify-content: space-between; gap: 12px; cursor: pointer; }
.results div.sel, .results div:hover { background: var(--brand-soft); }

.lines td { padding: 7px 8px; }
.lines select { padding: 7px; max-width: 170px; }
.totalbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.total { font-family: var(--display); font-size: 2rem; font-weight: 900; letter-spacing: -.01em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { padding: 6px 12px; border-radius: 99px; font-size: .86rem; font-weight: 600; }
.chip.on, .chip.on:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- sell screen ---------- */
.sell { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.sell-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.sell-head h1 { margin: 0; }
.catalog .chips { margin: 12px 0; }
.tiles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ptile {
  text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 12px; min-height: 96px;
  border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 500;
}
.ptile:hover { border-color: var(--brand); background: var(--panel); }
.ptile .n { font-weight: 700; line-height: 1.25; }
.ptile .f { font-size: .8rem; color: var(--muted); }
.ptile .b { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: .88rem; }
.ptile .b strong { font-variant-numeric: tabular-nums; }
.ticket { position: sticky; top: 76px; display: flex; flex-direction: column; max-height: calc(100vh - 96px); padding: 0; overflow: hidden; }
.ticket .t-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ticket .t-head h2 { margin: 0; }
.ticket .t-body { overflow-y: auto; padding: 4px 16px 12px; flex: 1; }
.ticket .t-foot { border-top: 1px solid var(--line); padding: 14px 16px 16px; background: var(--panel-2); display: grid; gap: 12px; }
.tline { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.tline:last-child { border-bottom: 0; }
.tline .nm { font-weight: 650; line-height: 1.25; }
.tline .nm small { display: block; color: var(--muted); font-weight: 500; }
.tline .amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.tline .amt s { color: var(--muted); font-weight: 500; font-size: .85rem; display: block; }
.tline .ctl { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tline .ctl select { padding: 5px 8px; font-size: .84rem; max-width: 190px; }
.tline .ctl input.money { width: 96px; padding: 5px 8px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.stepper button { border: 0; border-radius: 0; padding: 4px 11px; font-size: 1.05rem; background: var(--panel); }
.stepper input { width: 46px; border: 0; border-radius: 0; text-align: center; padding: 5px 2px; box-shadow: none !important; }
.member { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 12px; margin: 12px 0 4px; }
.member.has { border-style: solid; border-color: var(--brand); background: var(--brand-soft); }
.member .grow { min-width: 0; }
.member .nm { font-weight: 700; }
.member small { color: var(--muted); display: block; }
.sumrow { display: flex; justify-content: space-between; font-size: .9rem; color: var(--muted); }
.sumrow.big { color: var(--text); font-size: 1rem; font-weight: 700; align-items: baseline; }
.sumrow.big .total { font-size: 1.9rem; }
.charge { width: 100%; padding: 15px; font-size: 1.1rem; }
.opt-fields { display: grid; gap: 8px; }
.opt-fields .row label { flex: 1 1 120px; }

/* stamp card */
.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 340px; }
.stamp {
  aspect-ratio: 1; border-radius: 50%; border: 2px dashed var(--line-strong); display: grid; place-items: center;
  font-size: .78rem; font-weight: 800; color: var(--muted); position: relative;
}
.stamp.on { border: 0; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.stamp.goal { border-color: var(--brand); color: var(--brand-text); }
.stamp.on.goal::after { content: "★"; position: absolute; top: -4px; right: -2px; font-size: .8rem; color: var(--brand-text); }
.mini-stamps { display: inline-flex; gap: 3px; vertical-align: middle; flex-wrap: wrap; }
.mini-stamps i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); display: block; }
.mini-stamps i.on { background: var(--brand); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .k { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.tile .v { font-family: var(--display); font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 4px; }
.tile .s { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.tile.accent { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; }
.tile.accent .k, .tile.accent .s { color: rgba(255, 255, 255, .85); }
.bar { height: 8px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 4px; min-width: 2px; }

.cashcalc { max-width: 440px; }
.cashcalc tr.sum td { font-weight: 800; border-top: 2px solid var(--text); }
.roles { padding-left: 18px; }
.roles li { margin: 4px 0; }

/* product editor */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 10px 0; }
.bulk { margin: 10px 0; border: 1px dashed var(--line-strong); border-radius: 12px; padding: 10px 14px; }
.bulk summary { cursor: pointer; font-weight: 600; }
.bulk .row { margin-top: 10px; }
.bulk textarea { width: 100%; }
.flavors td { padding: 5px 4px; }
.flavors input:not([type=checkbox]) { padding: 8px 8px; }
.flavors input[data-k=variant] { width: 100%; min-width: 150px; }

dialog {
  border: 1px solid var(--line); border-radius: 18px; padding: 0;
  background: var(--panel); color: var(--text); width: min(660px, calc(100vw - 24px));
  box-shadow: var(--shadow-lg);
}
dialog.wide { width: min(1100px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(20, 16, 12, .5); backdrop-filter: blur(3px); }
#modalBody { padding: 22px; max-height: 88vh; overflow-y: auto; }
#modalBody > h2:first-child { font-size: 1.3rem; }
.ask-body p { margin: 0 0 10px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .full { grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(8px); z-index: 50;
  background: #1c1917; color: #fff; padding: 11px 18px; border-radius: 12px; border-left: 4px solid var(--ok);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-lg); font-weight: 600;
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { border-left-color: #ef4444; background: #3b1212; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; width: 100%; }
.login { width: min(420px, 100%); margin: 0; padding: 28px; }
.login input, .login select { width: 100%; }
.login form { display: grid; gap: 14px; }
.login h1 { font-size: 1.4rem; }
.login-brand { text-align: center; margin: -8px 0 10px; }
.login-brand img { width: 220px; max-width: 70%; height: auto; display: block; margin: 0 auto; border-radius: 16px; }
.login-brand .sub { margin-top: 2px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
.login-brand .logo-dark { display: none; }
@media (prefers-color-scheme: dark) { .login-brand .logo-light { display: none; } .login-brand .logo-dark { display: block; } }
.login-brand .ver { font-size: .72rem; color: var(--muted); margin-top: 6px; }
/* Order types: each its own colour so staff can tell them apart at a glance. */
.seg.chan button.on[data-ch="walkin"] { background: var(--brand); }
.seg.chan button.on[data-ch="delivery"] { background: #2563eb; box-shadow: 0 1px 4px rgba(37, 99, 235, .35); }
.seg.chan button.on[data-ch="cod"] { background: #7c3aed; box-shadow: 0 1px 4px rgba(124, 58, 237, .35); }
.pill.dlv { background: #dbeafe; color: #1d4ed8; }
.pill.cod { background: #ede9fe; color: #6d28d9; }
@media (prefers-color-scheme: dark) { .pill.dlv { background: #172554; color: #93c5fd; } .pill.cod { background: #2e1065; color: #c4b5fd; } }
.clock-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.clock-list button { text-align: left; display: grid; gap: 2px; padding: 12px; }
.clock-list button small { color: var(--muted); font-weight: 500; }
.clock-list button.in { border-color: var(--ok); }
.pin-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; }
.timein-clock { font-family: var(--display); font-size: 3rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }

/* ---------- payslip ---------- */
.slip { font-size: .92rem; }
.slip .slip-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; border-bottom: 3px solid var(--brand); padding-bottom: 12px; margin-bottom: 14px; }
.slip .slip-head img { height: 40px; vertical-align: bottom; }
.slip .slip-addr { font-size: .8rem; color: var(--muted); margin-top: 6px; line-height: 1.35; }
.slip .slip-addr strong { color: var(--text); }
.slip .slip-title { font-family: var(--display); font-weight: 800; font-size: 1.6rem; letter-spacing: .12em; color: var(--brand-text); }
.slip .slip-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); padding: 12px 14px; }
.slip .slip-info span { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.slip .slip-rate { margin: 8px 2px 12px; }
.slip table td, .slip table th { padding: 5px 6px; }
.slip .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.slip .slip-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.slip .slip-box h3 { margin: 0 0 6px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-text); }
.slip .slip-box table { width: 100%; }
.slip .slip-box tfoot td { font-weight: 800; border-top: 2px solid var(--line-strong); border-bottom: 0; }
.slip .slip-box tr.ded-total td { color: var(--danger); }
.slip .slip-foot { display: grid; grid-template-columns: 1fr 280px; gap: 14px; margin-top: 14px; align-items: start; }
.slip .slip-notes p { margin: 0 0 6px; }
.slip .netpay { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--brand); color: var(--brand-ink); border-radius: 12px; padding: 12px 16px;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.slip .netpay span { font-size: .8rem; font-weight: 800; letter-spacing: .1em; }
.slip .netpay strong { font-size: 1.4rem; }
.slip .slip-sign { display: grid; gap: 30px; margin-top: 34px; }
.slip .slip-sign div { border-top: 1px solid var(--text); padding-top: 3px; font-size: .75rem; color: var(--muted); }
.edit-list .row { margin-bottom: 6px; }
.print-only { display: none; }

@media (max-width: 1100px) {
  .sell { grid-template-columns: 1fr; }
  .ticket { position: static; max-height: none; }
}
/* Phones: the current sale is a sheet at the bottom. Collapsed it shows items + total; tap to open. */
.t-toggle { display: none; }
@media (max-width: 760px) {
  .sell { padding-bottom: 84px; }
  .ticket { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; border-radius: 18px 18px 0 0; max-height: 88vh;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .18); transform: translateY(calc(100% - 68px)); transition: transform .22s ease; }
  .ticket.open { transform: none; }
  .ticket .t-head { min-height: 68px; cursor: pointer; }
  .t-toggle { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
  .t-toggle .tt-total { color: var(--brand-text); }
  .ticket .t-head h2 { display: none; }
  .ptile { min-height: 84px; }
  .sell-head h1 { display: none; }
}
@media (max-width: 860px) {
  /* bottom:0 + dvh keep the drawer inside the visible area: plain 100vh runs under mobile browser toolbars (Brave), hiding Settings */
  .side { position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; height: 100dvh; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg);
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .side.open { transform: none; }
  .menu-btn { display: inline-block; }
  .top { padding: 8px 12px; }
  .top .shift { margin-left: 0; width: 100%; justify-content: space-between; }
  main { padding: 16px 12px 72px; }
  .card { padding: 14px; }
  h1 { font-size: 1.4rem; }
  .form { grid-template-columns: 1fr; }
  th, td { padding: 8px 6px; }
  .hide-sm { display: none; }
  .tiles-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .slip .cols, .slip .slip-foot { grid-template-columns: 1fr; }
  .slip .slip-info { grid-template-columns: 1fr 1fr; }
}

@media print {
  /* only #print is laid out (not just hidden), so page breaks between payslips work */
  body > *:not(#print) { display: none !important; }
  html, body { background: #fff !important; }
  #print { display: block; position: static; width: 100%; color: #000; text-align: left;
    /* paper is always light, whatever the screen theme */
    --text: #000; --muted: #555; --line: #d6d0c9; --line-strong: #999; --panel: #fff; --panel-2: #faf9f7;
    --brand: #ee6a1f; --brand-ink: #fff; --brand-text: #c2410c; --danger: #c81e1e; }
  #print .slip .cols { grid-template-columns: 1fr 1fr; }
  #print .slip .slip-foot { grid-template-columns: 1fr 260px; }
  #print .slip .slip-info { grid-template-columns: repeat(3, 1fr); }
  #print .slip .slip-info, #print .slip .slip-box { break-inside: avoid; }
  .slip { page-break-after: always; padding: 8px 0; }
  .slip:last-child { page-break-after: auto; }
}

.slip-days th, .slip-days td { font-size: .78rem; padding: 4px 5px; white-space: nowrap; }
.slip-days tfoot td { font-size: .8rem; }
.slip-head .logo-dark { display: none; }
@media (prefers-color-scheme: dark) { .slip-head .logo-light { display: none; } .slip-head .logo-dark { display: inline; } }
@media print { #print .slip-head .logo-dark { display: none !important; } #print .slip-head .logo-light { display: inline !important; } }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--brand-text); }
.rtable td, .rtable th { white-space: nowrap; }

/* ---------- product photos (initials when there's no photo) ---------- */
.ph { display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: var(--panel-2); flex: none; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph.ini { background: hsl(var(--h) 60% 92%); color: hsl(var(--h) 45% 32%); font-family: var(--display); font-weight: 800; letter-spacing: .02em; }
@media (prefers-color-scheme: dark) { .ph.ini { background: hsl(var(--h) 30% 22%); color: hsl(var(--h) 70% 80%); } }
.ptile .ph { width: 100%; aspect-ratio: 16 / 9; margin-bottom: 8px; font-size: 1.5rem; }
.ph.sm { width: 34px; height: 34px; font-size: .78rem; border-radius: 8px; }
.ph.lg { width: 96px; height: 96px; font-size: 1.8rem; border-radius: 14px; }
.with-ph { display: inline-flex; align-items: center; gap: 10px; }
.ptile.flavor .n { display: flex; align-items: center; gap: 8px; }
.fthumb { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; flex: none; }
.fdot { width: 12px; height: 12px; border-radius: 50%; background: hsl(var(--h) 65% 55%); flex: none; display: inline-block; }
.photo-edit { display: flex; gap: 14px; align-items: center; }
.btn-file { display: inline-block; padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; color: var(--text); font-size: .88rem; }
.btn-file:hover { border-color: var(--brand); }
.ph-pick { width: 38px; height: 38px; border: 1px dashed var(--line-strong); border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--muted); overflow: hidden; font-size: 1.1rem; }
.ph-pick img { width: 100%; height: 100%; object-fit: cover; }
.pill.bday { background: #fdf2f8; color: #be185d; }
@media (prefers-color-scheme: dark) { .pill.bday { background: #3b0a23; color: #f9a8d4; } }
/* v2.3.0 */
.top .shift .team { margin-left: 8px; padding-left: 10px; border-left: 1px solid var(--line); }
.clock-head { margin: 14px 0 6px; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
tr.overdue td { background: rgba(239, 68, 68, .08); }
.dlv-pick { display: grid; gap: 6px; margin-top: 6px; max-height: 220px; overflow: auto; }
.inv-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 10px; }
.inv-file { border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 6px; }
.inv-file img { width: 100%; height: 180px; object-fit: cover; border-radius: 6px; display: block; }
.inv-file .pdf { display: grid; place-items: center; height: 180px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-text); font-weight: 800; text-align: center; }
.inv-file .row { justify-content: space-between; font-size: .85rem; }
@media (max-width: 760px) { .top .shift .team { display: block; margin: 4px 0 0; padding: 0; border: 0; } }

/* v2.3.1: top bar (cashier / also here), late minutes, payroll overrides */
.top .shift #shiftBadge { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.top .cashier { padding: 4px 10px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-text); }
.top .cashier strong { color: inherit; }
.top .reg-closed { padding: 4px 10px; border-radius: 99px; background: #fef3c7; color: #92400e; font-weight: 700; }
.top .also { background: none; border: 0; padding: 4px 6px; color: inherit; cursor: pointer; font: inherit; }
.top .also:hover { text-decoration: underline; }
.top .also .short-names { display: none; }
.who-device { display: block; color: var(--muted); font-size: .72rem; }
.late { color: #dc2626; font-weight: 700; }
.ov-table input { width: 110px; }
tr.ov-on td { background: var(--brand-soft); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .top .reg-closed { background: #3a2a06; color: #fbbf24; } :root:not([data-theme="light"]) .late { color: #f87171; } }
@media (max-width: 760px) { .top .also .full-names { display: none; } .top .also .short-names { display: inline; } }
