/* Endurance Masters: dark sidebar back-office. Shop staff use it, often not computer people:
   big type, big targets, plain words. Charcoal sidebar, white work area, Endurance red for the main actions. */
:root {
    --side: #1D1E22;
    --side-hover: #2A2C31;
    --side-line: #33363C;
    --side-ink: #A7ABB4;
    --paper: #F3F4F6;
    --surface: #FFFFFF;
    --ink: #1B1C1F;
    --muted: #60656E;
    --line: #E1E3E7;
    --line-strong: #C3C7CE;
    --brand: #D0112B;
    --brand-dark: #A80D22;
    --brand-soft: #FDECEE;
    --ok-bg: #E6F4EB; --ok-ink: #17643A;
    --bad-bg: #FCEBEC; --bad-ink: #8E1424;
    --warn-bg: #FFF4D9; --warn-ink: #6A4A00;
    --radius: 12px;
    --radius-sm: 8px;
    --focus: 0 0 0 3px rgba(208, 17, 43, .3);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.5 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif; }
a { color: inherit; }
h1, h2 { line-height: 1.2; margin: 0; }
.muted { color: var(--muted); margin: 2px 0 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ico { flex: none; }
[hidden] { display: none !important; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand-mark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 800; font-size: 21px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-weight: 800; font-size: 17px; letter-spacing: .01em; }
.brand-text small { font-size: 13px; color: var(--side-ink); font-weight: 500; margin-top: 2px; }

/* ---------- app frame: sidebar + work area ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--side); color: var(--side-ink); padding: 22px 14px 16px; }
.side .brand { padding: 0 8px 24px; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
/* the menu scrolls on its own when it is taller than the screen (the logo and the signed-in user stay put) */
.side .nav { min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -14px; padding: 0 14px 8px;
             scrollbar-width: thin; scrollbar-color: #4A4E57 transparent; }
.side .nav::-webkit-scrollbar { width: 8px; }
.side .nav::-webkit-scrollbar-thumb { background: #4A4E57; border-radius: 8px; border: 2px solid var(--side); }
.side .nav::-webkit-scrollbar-thumb:hover { background: #60656E; }
.side .nav::-webkit-scrollbar-track { background: transparent; }
.side .nav a { flex: none; }
.nav a { position: relative; display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 9px; text-decoration: none; font-weight: 600; font-size: 16px; }
.nav a:hover { background: var(--side-hover); color: #fff; }
.nav a:focus-visible { outline: none; box-shadow: var(--focus); }
.nav a.on { background: var(--side-hover); color: #fff; }
.nav a.on::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.nav a.on .ico { color: var(--brand); }
.me { display: flex; align-items: center; gap: 11px; padding: 14px 8px 0; border-top: 1px solid var(--side-line); }
.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #3A3D44; color: #fff; font-weight: 700; flex: none; }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; flex: 1; }
.me-text b { color: #fff; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-out { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; color: var(--side-ink); }
.me-out:hover { background: var(--side-hover); color: #fff; }

.work { padding: 30px 36px 48px; min-width: 0; max-width: 1340px; }
.work-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.work-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-weight: 600; font-size: 15px; }
.work-title { display: flex; align-items: center; gap: 14px; }
.work-ico { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--side); color: #fff; flex: none; }
.work-ico .ico { width: 26px; height: 26px; }

/* ---------- messages ---------- */
.msg { padding: 13px 16px; border-radius: var(--radius-sm); font-weight: 600; margin: 0 0 18px; border-left: 4px solid transparent; }
.msg.ok { background: var(--ok-bg); color: var(--ok-ink); border-left-color: var(--ok-ink); }
.msg.bad { background: var(--bad-bg); color: var(--bad-ink); border-left-color: var(--bad-ink); }
.msg.warn { background: var(--warn-bg); color: var(--warn-ink); border-left-color: var(--warn-ink); }

/* ---------- home tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; min-height: 220px; transition: border-color .15s, box-shadow .15s; }
.tile:hover { border-color: var(--line-strong); box-shadow: 0 6px 18px rgba(20, 22, 26, .07); }
.tile:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--brand); }
.tile-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.tile-ico { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--side); color: #fff; }
.tile-ico .ico { width: 24px; height: 24px; }
.tile-n { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile-name { font-size: 21px; font-weight: 800; }
.tile-blurb { color: var(--muted); font-size: 15px; flex: 1; }
.tile-go { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--brand); font-size: 15px; }
.tile-go .ico { width: 18px; height: 18px; }

/* ---------- the list (full width) + the popup form ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; min-width: 0; }
.card h2 { font-size: 19px; font-weight: 800; margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.field { margin-bottom: 15px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.req { color: var(--brand); }
.hint { display: block; color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.in { width: 100%; min-height: 48px; padding: 10px 13px; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.in:hover { border-color: #9EA3AC; }
.in:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.in[readonly] { background: var(--paper); color: var(--muted); }

/* buttons: Save in red, Delete warns, the rest stay quiet */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 48px; padding: 0 18px; font: 600 16px 'Figtree', system-ui, sans-serif; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { color: var(--bad-ink); }
.btn.danger:hover { border-color: var(--bad-ink); background: var(--bad-bg); }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); border-color: var(--line-strong); }
.btn.wide { width: 100%; margin-top: 6px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn[disabled]:hover { border-color: var(--line-strong); background: var(--surface); }
.tag { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); font-size: 12.5px; font-weight: 700; white-space: nowrap; vertical-align: 1px; }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: 14.5px; gap: 5px; }
.btn.sm .ico { width: 17px; height: 17px; }

/* the list */
.list-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 16px; align-items: center; margin-bottom: 16px; }
.list-head h2 { margin: 0; }
.count { display: inline-block; margin-left: 6px; padding: 1px 10px; border-radius: 999px; background: var(--side); color: #fff; font-size: 13.5px; font-weight: 700; vertical-align: middle; font-variant-numeric: tabular-nums; }
.search { display: flex; gap: 8px; flex-wrap: wrap; }
.search-in { position: relative; display: block; }
.search-in .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-in .in { width: 250px; min-height: 44px; padding-left: 40px; }
.search .btn { min-height: 44px; }
.empty { color: var(--muted); padding: 34px 0; text-align: center; margin: 0; }
.table-wrap { overflow: auto; max-height: 640px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
th { position: sticky; top: 0; z-index: 1; background: #F7F8F9; text-align: left; font-size: 13.5px; font-weight: 700; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td:first-child { min-width: 170px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FAFAFB; }
tbody tr.on td { background: var(--brand-soft); }
tbody tr.on td:first-child { box-shadow: inset 4px 0 0 var(--brand); }
td.acts { white-space: nowrap; text-align: right; width: 1%; }
td.acts form { display: inline; margin: 0 0 0 6px; }

/* ---------- reports ---------- */
.head-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.rtabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.rtabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); text-decoration: none; font-weight: 600; font-size: 15px; }
.rtabs a:hover { border-color: var(--ink); }
.rtabs a.on { background: var(--side); border-color: var(--side); color: #fff; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 14px; align-items: end; padding: 18px 20px 4px; margin-bottom: 16px; }
.filters .f-btns { display: flex; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip { padding: 7px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14.5px; }
.chip b { font-variant-numeric: tabular-nums; }
.rcard { padding: 14px; }
.rtable { max-height: 70vh; }
.rtable table { font-size: 14.5px; }
.rtable td, .rtable th { padding: 9px 12px; white-space: nowrap; }
.rtable td:first-child { min-width: 0; }
tfoot td { position: sticky; bottom: 0; background: #F7F8F9; font-weight: 800; border-top: 2px solid var(--line-strong); border-bottom: 0; }
.print-head { display: none; }
.fdet > summary { display: none; }   /* the Filters button: phones only */
/* the phone frame (top bar, bottom tabs, Masters sheet): hidden on bigger screens */
.mtop, .mtab { display: none; }

/* ---------- popup ---------- */
.modal { width: min(640px, calc(100vw - 32px)); max-height: min(90vh, 880px); padding: 0; border: 0; border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgba(10, 12, 16, .35); }
.modal::backdrop { background: rgba(18, 20, 24, .58); }
.modal[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal form { display: flex; flex-direction: column; max-height: inherit; }
.modal-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px 16px 22px; border-bottom: 1px solid var(--line); }
.modal-head .work-ico { width: 42px; height: 42px; border-radius: 10px; }
.modal-head .work-ico .ico { width: 22px; height: 22px; }
.modal-head h2 { flex: 1; font-size: 21px; font-weight: 800; margin: 0; }
.modal-x { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.modal-x:hover { background: var(--paper); color: var(--ink); }
.modal-x:focus-visible { outline: none; box-shadow: var(--focus); }
.modal-body { padding: 20px 22px 6px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); background: #FAFAFB; border-radius: 0 0 16px 16px; }
.modal-foot .btn { min-width: 110px; }
.modal-foot .btn.primary { min-width: 150px; }
.modal-foot [hidden] { display: none; }
/* the product popup: wider, in sections */
.modal.wide { width: min(900px, calc(100vw - 32px)); }
.sec { font-size: 15px; font-weight: 800; margin: 6px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.sec:first-of-type { border-top: 0; padding-top: 0; }
.sec small { font-weight: 500; font-size: 13px; margin-left: 6px; }
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field.span2 { grid-column: span 2; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 0 12px; align-items: end; }
.line .btn { margin-bottom: 15px; min-height: 48px; }
th.r, td.r { text-align: right; font-variant-numeric: tabular-nums; }
.tag.bad { background: var(--bad-bg); color: var(--bad-ink); }

/* ---------- billing: the counter (scan box + lines on the left, the total and payment on the right) ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.pos-main { min-width: 0; }
.scan { position: relative; }
.scan > .ico { position: absolute; left: 16px; top: 19px; width: 24px; height: 24px; color: var(--muted); pointer-events: none; }
#scan { min-height: 62px; padding-left: 52px; font-size: 20px; font-weight: 600; border-width: 2px; }
.scan-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none; max-height: 380px; overflow: auto;
             background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 14px 34px rgba(20, 22, 26, .16); }
.scan-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.scan-list li span { grid-column: 1; color: var(--muted); font-size: 14px; }
.scan-list li em { grid-column: 2; grid-row: 1 / 3; align-self: center; font-style: normal; font-weight: 700; }
.scan-list li[aria-selected="true"], .scan-list li:hover { background: var(--brand-soft); }
.scan-msg { min-height: 24px; margin: 6px 2px 8px; font-size: 14.5px; color: var(--muted); }
.scan-msg.bad { color: var(--bad-ink); font-weight: 600; }
.bill-wrap { background: var(--surface); max-height: calc(100vh - 230px); min-height: 260px; }
.bill-lines td:first-child, .bill-lines th:first-child { min-width: 0; width: 40px; color: var(--muted); }
.bill-lines td { vertical-align: top; }
.bill-lines .it b { display: block; font-size: 16.5px; }
.bill-lines .it small { display: block; color: var(--muted); font-size: 13.5px; }
.bill-lines .it select { margin-top: 6px; max-width: 280px; }
.bill-lines .n, .slip .n { text-align: right; white-space: nowrap; }
.bill-lines td.amt { font-weight: 700; padding-top: 18px; }
.in.sm { min-height: 40px; padding: 6px 10px; font-size: 16px; }
.bill-lines .q { width: 80px; text-align: right; }
.bill-lines .r { width: 100px; text-align: right; }
.bill-lines .x { width: 38px; height: 38px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.bill-lines .x:hover { background: var(--bad-bg); color: var(--bad-ink); }
.bill-lines tr.flash td { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--ok-bg); } to { background: transparent; } }
.lw { display: inline-block; margin: 6px 6px 0 0; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.lw.warn { background: var(--warn-bg); color: var(--warn-ink); }
.lw.bad { background: var(--bad-bg); color: var(--bad-ink); }
.pos-side { position: sticky; top: 20px; padding: 20px; }
.sums { margin: 4px 0 0; }
.sums > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; }
.sums dt label { margin: 0; font-size: inherit; font-weight: inherit; }
.sums dd { margin: 0; font-weight: 700; }
.sums dd .in { width: 120px; min-height: 42px; text-align: right; }
.sums .muted-row { color: var(--muted); font-size: 14.5px; }
.sums .muted-row dd { font-weight: 500; }
.total { display: flex; justify-content: space-between; align-items: baseline; margin: 10px -20px 14px; padding: 14px 20px; background: var(--side); color: #fff; }
.total span { font-weight: 600; color: var(--side-ink); }
.total b { font-size: 34px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.pay { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 14px; padding: 0; border: 0; }
.pay legend { font-weight: 600; font-size: 15px; margin-bottom: 6px; padding: 0; }
.pay label { margin: 0; }
.pay input { position: absolute; opacity: 0; }
.pay span { display: grid; place-items: center; min-height: 46px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 15px; cursor: pointer; }
.pay input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.pay input:focus-visible + span { box-shadow: var(--focus); }
.lbl { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.change { display: flex; align-items: center; min-height: 48px; font-size: 22px; color: var(--ok-ink); }
.btn.save { width: 100%; min-height: 58px; font-size: 18px; }
.btn.save.wait { opacity: .6; }
.pos-side .btn.ghost { width: 100%; margin-top: 6px; }
kbd { font: 600 12px 'Figtree', system-ui, sans-serif; padding: 2px 6px; border-radius: 5px; background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .35); }
.btn:not(.primary) kbd { background: var(--paper); border-color: var(--line); }

/* ---------- the customer's slip (80 mm roll) ---------- */
.slip-page { background: var(--paper); }
.slip-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 20px 16px 0; }
.slip { width: 80mm; max-width: 100%; margin: 20px auto 40px; padding: 5mm 4mm; background: #fff; color: #000; font: 500 12.5px/1.35 'Figtree', system-ui, sans-serif; box-shadow: 0 4px 18px rgba(0, 0, 0, .12); }
.slip header { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1px; padding-bottom: 6px; border-bottom: 1px dashed #000; }
.slip-shop { font-size: 17px; font-weight: 800; }
.slip table { font-size: 12.5px; margin-top: 4px; }
.slip th { position: static; background: none; color: #000; font-size: 11.5px; padding: 3px 0; border-bottom: 1px dashed #000; }
.slip td { padding: 1px 0; border: 0; min-width: 0; }
.slip td.nm { padding-top: 5px; font-weight: 700; }
.slip tr.nums td:first-child { color: #333; font-size: 11px; }
.slip th + th, .slip td + td { padding-left: 6px; }
.slip tbody tr:hover td { background: none; }
.slip-sums { margin: 6px 0 0; padding-top: 4px; border-top: 1px dashed #000; }
.slip-sums > div { display: flex; justify-content: space-between; gap: 8px; }
.slip-sums dd { margin: 0; }
.slip-sums .grand { margin: 4px 0; padding: 4px 0; border-top: 1px solid #000; border-bottom: 1px solid #000; font-size: 17px; font-weight: 800; }
.slip-gst { margin-top: 8px !important; }
.slip footer { margin-top: 8px; padding-top: 6px; border-top: 1px dashed #000; text-align: center; font-size: 12px; }

@media (max-width: 1100px) { .pos { grid-template-columns: minmax(0, 1fr) 320px; } }

/* ---------- sign in: dark brand panel + form ---------- */
.login-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; background: var(--surface); }
.login-side { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 44px 56px; background: var(--side); color: var(--side-ink); }
.login-pitch h2 { color: #fff; font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; max-width: 15ch; margin-bottom: 30px; }
.login-pitch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; max-width: 440px; }
.login-pitch li { display: flex; gap: 15px; align-items: flex-start; font-size: 15.5px; }
.login-pitch li .ico { width: 42px; height: 42px; padding: 10px; border-radius: 10px; background: var(--side-hover); color: #fff; }
.login-pitch li b { display: block; color: #fff; font-size: 16.5px; margin-bottom: 1px; }
.login-foot { font-size: 13px; }
.login-main { display: grid; place-items: center; padding: 40px 24px; }
.login-box { width: 100%; max-width: 400px; }
.login-box .brand { display: none; }
.brand-dark-text .brand-text b { color: var(--ink); }
.brand-dark-text .brand-text small { color: var(--muted); }
.login-box h1 { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.login-box .muted { margin: 6px 0 26px; }

/* sign in: the way back to the apps page (../apps.html beside the app's folder) */
.login-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; color: var(--muted); font-weight: 600; font-size: 15px; text-decoration: none; }
.login-back:hover { color: var(--ink); }

/* employees: the billing-login switch */
.me-login { margin: 6px 0 0; padding: 14px 16px 2px; border: 1px solid var(--line); border-radius: var(--radius); }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; cursor: pointer; margin-bottom: 12px; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.check small { display: block; color: var(--muted); font-size: 13.5px; font-weight: 400; }
.tag.ok { background: var(--ok-bg); color: var(--ok-ink); }

/* ---------- Security: one card per login ---------- */
.sec-user { margin-bottom: 16px; }
.sec-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sec-head > div { display: flex; flex-direction: column; line-height: 1.3; margin-right: auto; }
.sec-head small { color: var(--muted); font-size: 13.5px; }
.sec-head .avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--side); color: #fff; font-weight: 800; flex: none; }
.sec-form { margin-top: 16px; }
.sec-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; }
.sec-cols fieldset { margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.sec-cols legend { font-weight: 700; padding: 0 6px; }
.sec-t { font-size: 15px; }
.sec-t th { position: static; background: none; padding: 6px 8px; text-align: center; }
.sec-t th:first-child, .sec-t td:first-child { text-align: left; min-width: 0; }
.sec-t td { padding: 7px 8px; text-align: center; }
.sec-t td small { color: var(--muted); }
.sec-t input, .sec-reports input { width: 20px; height: 20px; accent-color: var(--brand); }
.sec-reports { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.sec-reports .check { margin: 6px 0; align-items: center; }
.sec-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
/* ---------- Settings ---------- */
.set-form .card { margin-bottom: 16px; }
.set-note { margin: -10px 0 14px; }
.set-form textarea.in { resize: vertical; }
.set-later { background: var(--paper); }
.set-save { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--paper) 30%); }
.set-save .btn { min-width: 200px; }
.slip-line { font-size: 11.5px; }
/* counter: sales return in the bill (Return mode, F8; a line can switch between sale and return) */
.scan { display: flex; gap: 10px; } .scan > .in { flex: 1; }
.ret-mode { flex: none; min-height: 62px; border-width: 2px; font-weight: 700; }
.ret-mode.on { background: var(--bad-bg); border-color: var(--bad-ink); color: var(--bad-ink); }
#scan.ret { border-color: var(--bad-ink); background: #FFF6F6; }
.bill-lines tr.is-ret td { background: #FFF6F6; }
.bill-lines tr.is-ret .amt { color: var(--bad-ink); }
.bill-lines .ret-t { display: block; margin: 4px auto 0; padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); font: 600 12px 'Figtree', system-ui, sans-serif; color: var(--muted); cursor: pointer; }
.bill-lines .ret-t:hover { border-color: var(--bad-ink); color: var(--bad-ink); }
.total.refund { background: var(--bad-ink); }
.slip .sf-items tr.ret td { font-style: italic; }

/* counter: split payment (any mix of cash, UPI, card, credit) */
.pays { margin: 0 0 12px; padding: 0; border: 0; }
.pays legend { font-weight: 600; font-size: 15px; margin-bottom: 6px; padding: 0; }
.pays legend small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.pays-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: center; gap: 10px; margin: 0 0 6px; font-weight: 600; }
.pays-row .in { min-height: 42px; text-align: right; }
.pays-row.auto .in { background: var(--ok-bg); border-color: #9cc9ab; }
.pays-left { margin: 4px 0 0; font-weight: 700; color: var(--warn-ink); }
.pays-left.bad { color: var(--bad-ink); }

/* ---------- the bill in the shop's own format ---------- */
.slip.sf { font: 12px/1.35 Arial, Helvetica, sans-serif; padding: 4mm 3mm; }
.sf-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 10.5px; }
.sf-top b { font: 700 13px 'Times New Roman', serif; }
.sf-shop { text-align: center; margin: 8px 0 4px; font-size: 13px; letter-spacing: .04em; }
.sf-addr { text-align: center; font-weight: 700; font-size: 12px; margin-bottom: 8px; }
.sf-type { border-top: 1.5px solid #000; border-bottom: 1.5px solid #000; font-weight: 800; font-size: 15px; padding: 2px 8px; }
.sf-meta { display: flex; justify-content: space-between; align-items: center; padding: 6px 4px 8px; border-bottom: 1.5px solid #000; }
.sf-meta span { font-weight: 700; margin-right: 10px; } .sf-meta b { font-weight: 700; font-size: 13px; }
.sf-meta .r { display: grid; grid-template-columns: auto auto; gap: 4px 6px; align-items: baseline; }
.sf-meta em { font: 13px 'Times New Roman', serif; }
.sf-cust { padding: 4px; font-weight: 700; border-bottom: 1px solid #000; }
.slip .sf-items { width: 100%; margin-top: 6px; border-collapse: collapse; }
.slip .sf-items th, .slip .sf-items td { border: 1px solid #000; padding: 3px 4px; font-size: 11.5px; text-align: center; }
.slip .sf-items th { font-weight: 800; font-size: 12.5px; }
.slip .sf-items td { font-weight: 700; } .slip .sf-items td:first-child { font: 11px 'Times New Roman', serif; }
.slip .sf-items td.nm { text-align: left; padding-top: 3px; }
.slip .sf-items td:nth-child(n+3) { text-align: right; } .slip .sf-items td:nth-child(3) { text-align: center; }
.sf-tot { display: flex; justify-content: space-between; padding: 6px 4px; font-weight: 700; }
.sf-tot b { font: 700 13px 'Times New Roman', serif; margin-left: 6px; }
.sf-line { display: flex; justify-content: space-between; padding: 0 4px 3px; }
.sf-amount { display: grid; grid-template-columns: 1fr 1fr; border-top: 1.5px solid #000; border-bottom: 1.5px solid #000; }
.sf-amount b { font-size: 19px; text-align: center; padding: 6px 0; border-right: 1px solid #000; }
.sf-amount span { font-size: 15px; text-align: center; align-self: center; letter-spacing: .03em; }
.sf-line b { font: 700 13px 'Times New Roman', serif; margin-left: 4px; }
.sf-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; padding: 6px 2px 2px; }
.sf-two > div { display: grid; grid-template-columns: auto 1fr; gap: 3px 6px; align-items: baseline; }
.sf-two span { font-size: 11px; } .sf-two b { font: 700 13px 'Times New Roman', serif; text-align: right; }
.sf-two > div:last-child span { font-weight: 700; font-family: Arial, sans-serif; }
.sf-modes { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 12px; padding: 2px 0 4px; font-size: 11px; }
.sf-modes b { font-size: 12px; }
.sf-pay { display: flex; justify-content: center; gap: 14px; padding: 7px 0 2px; align-items: baseline; }
.sf-pay span { font-size: 10.5px; } .sf-pay b { font-size: 15px; }
.sf-gst { margin-top: 8px; border-top: 1.5px solid #000; padding-top: 4px; }
.sf-gst-h { font-size: 13px; }
.slip .sf-gst table { width: 100%; border: 1px solid #000; border-collapse: collapse; margin-top: 0; }
.slip .sf-gst th { font: 400 13px Arial, sans-serif; padding: 2px 4px; border-bottom: 1px solid #000; text-align: center; }
.slip .sf-gst td { font: 12px 'Times New Roman', serif; padding: 5px 4px; text-align: right; } .slip .sf-gst td:first-child { text-align: left; }
.sf-terms { display: flex; flex-direction: column; border-top: 1.5px solid #000; padding-top: 3px; font-size: 10.5px; font-weight: 700; }
.sf-terms b { font: 700 12.5px 'Times New Roman', serif; text-decoration: underline; margin-bottom: 2px; }
.sf-thanks { border-top: 1.5px solid #000; border-bottom: 1.5px solid #000; margin-top: 4px; padding: 4px 0 10px; text-align: center; font: 700 14px 'Times New Roman', serif; text-decoration: underline; }
.sf-head { text-align: center; font-weight: 800; font-size: 14px; letter-spacing: .06em; margin: -2px 0 6px; }
/* paper sizes (Settings > Invoice) */
.slip.sf.p58 { width: 58mm; font-size: 10.5px; padding: 3mm 2mm; }
.slip.sf.p58 .sf-items th, .slip.sf.p58 .sf-items td { font-size: 10px; padding: 2px; }
.slip.sf.p58 .sf-amount b { font-size: 16px; }
.slip.sf.pa5 { width: 148mm; font-size: 14px; padding: 8mm 8mm; }
.slip.sf.pa5 .sf-items th, .slip.sf.pa5 .sf-items td { font-size: 13.5px; padding: 5px 8px; }
@media print { .slip.sf { padding: 0 1mm; } .slip.sf.p58 { width: 56mm; } .slip.sf.pa5 { width: auto; padding: 0; } }

/* Printers screen: label + field rows, like the old Printer Form */
.pr-form { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px 18px; align-items: start; }
.pr-form > label { margin: 12px 0 0; }
.pr-fixed { padding: 12px 0 0; color: var(--ink); }
.pr-sm { max-width: 120px; }
.pr-find { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; } .pr-find .hint { margin: 0; flex: 1 1 260px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--ink, inherit); text-decoration: underline; cursor: pointer; }
.pr-steps { padding-left: 22px; margin: 0 0 10px; } .pr-steps li { margin-bottom: 12px; line-height: 1.6; }
.pr-steps .btn { vertical-align: middle; margin: 0 4px; }
@media (max-width: 720px) { .pr-form { grid-template-columns: minmax(0, 1fr); gap: 4px; } .pr-form > label { margin-top: 10px; } .pr-fixed { padding-top: 0; } }
/* barcode labels: the one-time printer set-up */
.lb-setup { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 14.5px; }
.lb-setup summary { cursor: pointer; font-weight: 700; }
.lb-setup ol { padding-left: 20px; margin: 10px 0 0; } .lb-setup li { margin-bottom: 8px; }
.lb-setup code, .pos-side code { background: var(--paper); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.hint code { font: 600 13px 'Figtree', system-ui, sans-serif; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--ink); }
.pv { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.pv-l { font-size: 13px; color: var(--muted); margin-right: 2px; }
.pv-c { padding: 3px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--ok-ink); font-size: 13.5px; font-weight: 600; }
.pv-c.bad { background: var(--bad-bg); color: var(--bad-ink); }
@media (max-width: 900px) { .sec-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
    .sec-t, .sec-t tbody { display: table; } .sec-t thead { display: table-header-group; } .sec-t tbody { display: table-row-group; }
    .sec-t tr { display: table-row; padding: 0; margin: 0; background: none; border: 0; border-radius: 0; }
    .sec-t td, .sec-t th { display: table-cell; padding: 6px 4px; }
    .sec-t td::before { content: none !important; }
    .set-save { bottom: calc(var(--tabh) + var(--safe)); }
}

/* ---------- smaller screens ---------- */

@media (max-width: 900px) {
    .pos { grid-template-columns: minmax(0, 1fr); }
    .pos-side { position: static; }
    .bill-wrap { max-height: none; }
}
@media (min-width: 721px) and (max-width: 900px) {
    /* the sidebar turns into a top bar with the forms in a row */
    .app { grid-template-columns: minmax(0, 1fr); }
    .side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 14px; }
    .side .brand { padding: 0; order: 1; }
    .brand-mark { width: 36px; height: 36px; font-size: 19px; }
    .me { order: 2; margin-left: auto; padding: 0; border: 0; }
    .me-text, .avatar { display: none; }
    .nav { order: 3; flex: 1 1 100%; flex-direction: row; overflow-x: auto; gap: 4px; margin: 0 -4px; }
    .nav a { flex: 1 1 0; flex-direction: column; gap: 3px; padding: 8px 4px; font-size: 12.5px; min-width: 0; text-align: center; }
    .nav a.on::before { left: 10px; right: 10px; top: auto; bottom: 0; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
    .work { padding: 22px 16px 36px; }
    .work-head h1 { font-size: 25px; }
    .login-page { grid-template-columns: minmax(0, 1fr); }
    .login-side { display: none; }
    .login-box .brand { display: flex; margin-bottom: 28px; }
}
/* ---------- phones: their own light app frame ----------
   White top bar with the page name, tabs at the bottom within thumb reach, lists as tight rows you tap to edit,
   the main "New" action floating above the tabs, popups as full screens with the buttons always in view. */
@media (max-width: 720px) {
    :root { --paper: #F2F2F5; --tabh: 66px; --safe: env(safe-area-inset-bottom, 0px); }
    body { font-size: 16px; }
    .app { display: block; min-height: 100dvh; }
    .side { display: none; }

    .mtop { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; padding: 10px 10px 10px 16px;
            background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
    .mtop .brand-mark { width: 34px; height: 34px; border-radius: 9px; font-size: 18px; text-decoration: none; flex: none; }
    .mtop-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
    .mtop-t b { font-size: 18px; font-weight: 800; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mtop-t small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mtop-out { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--muted); }
    .mtop-out:active { background: var(--paper); }

    .mtab { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
            padding: 6px 4px calc(6px + var(--safe)); background: #fff; border-top: 1px solid var(--line); }
    .mtab a, .mtab button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px 0; min-width: 0;
            font: 600 12px/1.3 'Figtree', system-ui, sans-serif; color: var(--muted); background: none; border: 0; text-decoration: none; cursor: pointer;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
    .mtab .pill { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px; transition: background .15s; }
    .mtab .on { color: var(--ink); font-weight: 800; }
    .mtab .on .pill { background: var(--brand-soft); color: var(--brand); }
    .mtab a:focus-visible, .mtab button:focus-visible { outline: none; }
    .mtab a:focus-visible .pill, .mtab button:focus-visible .pill { box-shadow: var(--focus); }

    /* Masters: a sheet rising from the bottom */
    .msheet { width: 100vw; max-width: 100vw; margin: auto 0 0; padding: 8px 12px calc(16px + var(--safe)); border: 0; border-radius: 20px 20px 0 0; background: #fff; color: var(--ink); }
    .msheet::backdrop { background: rgba(18, 20, 24, .5); }
    .msheet[open] { animation: rise .2s ease-out; }
    .msheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 8px 8px; font-size: 18px; }
    .msheet a { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-radius: 14px; text-decoration: none; }
    .msheet a:active, .msheet a.on { background: var(--paper); }
    .msheet a > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
    .msheet small { color: var(--muted); font-size: 13.5px; }
    .msheet .tile-ico { width: 44px; height: 44px; flex: none; }
    .msheet a.on .tile-ico { background: var(--brand); }
    @keyframes rise { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

    .work { padding: 14px 14px calc(var(--tabh) + 96px + var(--safe)); }
    .work-head { margin-bottom: 12px; align-items: center; }
    .work-title { display: none; }            /* the top bar already names the page */
    .work-head h1 { font-size: 22px; }
    .eyebrow { display: none; }                /* the shop name is in the top bar */
    .msg { font-size: 15px; padding: 11px 13px; margin-bottom: 12px; }

    /* the page's main action floats above the tabs */
    .work-head > .btn.primary { position: fixed; right: 14px; bottom: calc(var(--tabh) + 14px + var(--safe)); z-index: 25; min-height: 54px; padding: 0 20px 0 16px;
            border-radius: 999px; box-shadow: 0 10px 24px rgba(208, 17, 43, .32); font-size: 16px; }
    .work-head > .btn.primary .ico { width: 22px; height: 22px; }

    /* home: small tiles, two to a row, numbers first */
    .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
    .tile { min-height: 0; padding: 14px; gap: 2px; border-radius: 16px; }
    .tile:first-child { grid-column: 1 / -1; }
    .tile-ico { width: 40px; height: 40px; border-radius: 11px; }
    .tile-ico .ico { width: 21px; height: 21px; }
    .tile-n { font-size: 26px; }
    .tile-name { font-size: 16px; }
    .tile-blurb, .tile-go { display: none; }

    /* lists: no box around them, each row a small white card */
    .card { padding: 0; border: 0; background: none; }
    .list-head { margin-bottom: 10px; gap: 10px; }
    .list-head h2 { font-size: 15px; color: var(--muted); font-weight: 700; }
    .search { width: 100%; flex-wrap: nowrap; }
    .search-in { flex: 1; min-width: 0; }
    .search-in .in { width: 100%; background: #fff; border-color: var(--line); }
    .table-wrap { max-height: none; overflow: visible; border: 0; }
    thead, tfoot { display: none; }
    table, tbody { display: block; width: 100%; }
    tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 14px; padding: 12px 14px; margin-bottom: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
    td, .rtable td { display: block; padding: 0; border: 0; font-size: 14px; white-space: normal; min-width: 0; text-align: left; }
    td:first-child { min-width: 0; }
    td:empty, td.acts { display: none; }
    td[data-label]::before { content: attr(data-label) "  "; white-space: pre; color: var(--muted); font-size: 12.5px; font-weight: 500; }
    td[data-label="Name"], td.nm { order: -1; flex: 1 1 100%; font-size: 16.5px; }
    td[data-label="Name"]::before, td.nm::before { display: none; }
    td .tag { margin-left: 4px; }
    tbody tr:hover td { background: none; }
    tr.tap { cursor: pointer; padding-right: 34px; position: relative; -webkit-tap-highlight-color: transparent; }
    tr.tap::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border: solid var(--line-strong); border-width: 2px 2px 0 0; transform: rotate(45deg); }
    tr.tap:active { background: var(--paper); }
    tbody tr.on td { background: none; }
    tbody tr.on { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); }
    .empty { padding: 28px 12px; }

    /* reports: buttons side by side, tabs and totals in one swipeable row, filters folded */
    .head-btns { width: 100%; }
    .head-btns .btn { flex: 1 1 40%; min-height: 44px; }   /* Print, PDF, CSV, Excel: two to a row */
    .rtabs, .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 12px; padding: 0 14px; scrollbar-width: none; }
    .rtabs::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
    .rtabs a { flex: none; padding: 8px 14px; font-size: 14.5px; }
    .chip { flex: none; font-size: 13.5px; padding: 6px 12px; }
    .fdet { margin-bottom: 12px; }
    .fdet > summary { display: inline-flex; list-style: none; min-height: 42px; font-size: 15px; }
    .fdet > summary::-webkit-details-marker { display: none; }
    .fdet[open] > summary { margin-bottom: 10px; border-color: var(--ink); }
    .filters { grid-template-columns: 1fr 1fr; padding: 14px 14px 2px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
    .filters .field:first-child, .filters .f-btns { grid-column: 1 / -1; }
    .filters .f-btns .btn { flex: 1; }
    .rcard { padding: 0; }

    /* the counter on a phone: lines as cards, quantity and rate side by side */
    #scan { font-size: 17px; }
    .bill-lines td:first-child { display: none; }
    .bill-lines td.it { flex: 1 1 100%; }
    .bill-lines td.amt { padding-top: 10px; margin-left: auto; }
    .bill-lines .x { position: absolute; top: 6px; right: 6px; }
    .bill-lines tr { position: relative; padding-right: 44px; }
    .total { margin: 10px -20px 14px; }
    /* the slip stays a slip */
    .slip table { display: table; } .slip thead { display: table-header-group; } .slip tbody { display: table-row-group; }
    .slip tr { display: table-row; padding: 0; margin: 0; background: none; border: 0; border-radius: 0; }
    .slip td, .slip th { display: table-cell; font-size: inherit; }
    .slip-page .slip { margin-top: 12px; }

    /* popups fill the screen; Save stays in reach at the bottom */
    .modal, .modal.wide { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
    .modal[open] { animation: rise .2s ease-out; }
    .modal form { height: 100%; }
    .modal-head { padding: 10px 8px 10px 16px; gap: 10px; }
    .modal-head .work-ico { display: none; }
    .modal-head h2 { font-size: 19px; }
    .modal-body { padding: 16px 16px 4px; }
    /* boxes in pairs: in a row of three the third takes the whole line (product name, quantity, category, opening stock,
       remarks); long boxes (name, address, e-mail, GSTIN with its typing hint) always take the whole line */
    .grid, .grid.g3, .grid.g4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
    .grid.g3 > .field:nth-child(3), .field:has(#mf-tin), .field:has(#mf-cp), .field:has(#mf-name) { grid-column: 1 / -1; }
    .hint { font-size: 12.5px; }
    .field.span2 { grid-column: 1 / -1; }
    .modal-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 16px calc(10px + var(--safe)); border-radius: 0; }
    .modal-foot .btn, .modal-foot .btn.primary { min-width: 0; }
    .modal-foot .btn.primary { grid-column: 1 / -1; min-height: 52px; font-size: 17px; }

    /* sign in: the whole screen is the dark brand panel; the form sits in a white sheet at the bottom, within thumb reach */
    .login-page { display: flex; flex-direction: column; min-height: 100dvh; background: var(--side); }
    .login-side { display: flex; flex: 1; gap: 22px; justify-content: flex-end; padding: 28px 22px 30px;
                  background: radial-gradient(120% 70% at 100% 0, rgba(208, 17, 43, .28), transparent 60%), var(--side); }
    .login-side .brand-mark { width: 52px; height: 52px; border-radius: 14px; font-size: 27px; }
    .login-side .brand-text b { font-size: 20px; }
    .login-side .brand-text small { font-size: 14px; }
    .login-pitch h2 { font-size: 27px; margin-bottom: 18px; max-width: 13ch; }
    .login-pitch ul { grid-template-columns: 1fr 1fr; gap: 8px; }
    .login-pitch li { align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: rgba(255, 255, 255, .06); font-size: 14px; }
    .login-pitch li .ico { width: 34px; height: 34px; padding: 8px; border-radius: 9px; flex: none; }
    .login-pitch li b { font-size: 14.5px; margin: 0; }
    .login-pitch li span { font-size: 0; }            /* the name only; the long description is for big screens */
    .login-pitch li span b { font-size: 14.5px; }
    .login-foot { display: none; }
    .login-main { display: block; padding: 0; background: var(--surface); border-radius: 24px 24px 0 0; }
    .login-box { max-width: none; padding: 26px 22px calc(26px + var(--safe)); }
    .login-box .brand { display: none; }
    .login-box h1 { font-size: 26px; }
    .login-box .muted { margin: 4px 0 20px; font-size: 15px; }
}
/* printing a report: just the table, small and black on white */
@media print {
    /* A4 landscape only for the app's own pages (reports, the bills list). The bill slip is not an .app page,
       so it does not get A4: it prints on the roll printer's own paper (see @page slip below). */
    body { background: #fff; font-size: 11px; }
    .app { display: block; page: report; }
    .side, .no-print, .work-head .muted { display: none !important; }
    .work { padding: 0; max-width: none; }
    .work-head { display: none !important; }
    .print-head { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: 13px; }
    .chips { margin-bottom: 8px; } .chip { border: 0; padding: 0 10px 0 0; font-size: 11px; }
    .card, .rcard { border: 0; padding: 0; }
    .table-wrap, .rtable { max-height: none; overflow: visible; border: 0; }
    .rtable table { font-size: 10px; } .rtable td, .rtable th { padding: 4px 6px; white-space: normal; }
    .rtable td[data-label="Date"], .rtable td[data-label="Next expiry"], .rtable td[data-label="Code"] { white-space: nowrap; }   /* dates and codes stay on one line */
    th { position: static; background: #eee !important; color: #000; font-size: 9.5px; } tfoot td { position: static; background: #eee !important; }
    .tag { background: none !important; color: #000 !important; padding: 0; margin: 0; font-size: 10px; }
    thead { display: table-header-group; } tr { page-break-inside: avoid; }
    .slip-page { page: slip; background: #fff; }
    .slip { width: 72mm; margin: 0; padding: 2mm 1mm; box-shadow: none; font-size: 11.5px; }
    .slip th { background: none !important; font-size: 10.5px; }
    .slip.p58 { width: 48mm; padding: 2mm 0; font-size: 10px; }          /* Shop settings > bill paper 58 mm */
    .slip.p58 th, .slip.p58 .sf-meta b, .slip.p58 .sf-type { font-size: 9.5px; }
    .slip.pa5 { page: slipa5; width: auto; padding: 0; font-size: 12.5px; }   /* bill paper A5 */
}
@page report { size: A4 landscape; margin: 10mm; }
@page slip { margin: 0; }   /* no size: the bill starts at the top of the paper picked in the print window (72 x 297); zero margins leave Chrome no room for its date / web address lines */
@page slipa5 { size: A5 portrait; margin: 8mm; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Printers > Label design (the shop's own .prn) */
.pr-design-grid { display: grid; grid-template-columns: minmax(0, 330px) 1fr; gap: 22px; align-items: start; margin-top: 6px; }
.pr-preview { margin: 0; }
.pr-preview svg { display: block; width: 100%; max-width: 330px; height: auto; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.pr-preview figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.pr-roles table { width: 100%; margin-bottom: 12px; }
.pr-roles td { vertical-align: middle; }
.pr-design-acts { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0 4px; }
.pr-design-acts form { margin: 0; }
.pr-up { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.pr-up label { display: block; font-weight: 600; margin-bottom: 8px; }
.pr-up-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pr-up-row input[type=file] { flex: 1 1 260px; }
@media (max-width: 760px) { .pr-design-grid { grid-template-columns: 1fr; } }
.slip-del { display: inline; margin: 0; }
/* Purchase entry / purchases (2026-11-15) */
.pur-lines th small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.pur-lines input[type=date] { width: 140px; }
.pur-lines input[data-k=disper] { width: 64px; }
.pur-lines .noexp { display: flex; gap: 6px; align-items: center; margin-top: 4px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.pur-head { margin-bottom: 16px; }
.pur-head .card { padding: 14px 18px; }
.pur-head .card span, .pur-head .card small { display: block; font-size: 13px; }
.pur-head .card b { display: block; font-size: 20px; margin-top: 2px; }
.bad-ink { color: var(--bad-ink); }
@media (max-width: 760px) { .pur-head.g4, .pur-head.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pur-lines .in.sm { padding-left: 8px; padding-right: 8px; }
.pur-lines input.q { width: 62px; }
.pur-lines input.r { width: 78px; }
.pur-lines input[type=date] { width: 128px; font-size: 13.5px; }
.pur-lines input[data-k=disper] { width: 54px; }
.pur-lines th, .pur-lines td { padding-left: 6px; padding-right: 6px; }
.pur-lines .it { min-width: 140px; }
.pur-lines .it small + small { font-style: italic; }
/* the Printer popup (lib/print_popup.php) */
.pp-ways { margin: 0 0 14px; padding: 0; border: 0; min-width: 0; } .pp-ways legend { font-weight: 700; margin-bottom: 10px; padding: 0; }
.pp-pc { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); } .pp-pc h3 { font-size: 15px; font-weight: 800; margin: 0 0 10px; }
