/* =========================================================
   Dukaan Ledger - phone app styles (mobile first)
   ========================================================= */
:root {
  --side: #063B36;
  --side-deep: #042F2B;
  --side-label: #6F918B;
  --primary: #10B981;
  --primary-dark: #111827;
  --primary-hover: #059669;
  --primary-soft: #ECFDF5;
  --accent: #10B981;
  --bg: #F6F9F8;
  --card: #FFFFFF;
  --line: #E5EAE8;
  --input-line: #D6DFDC;
  --fill: #F6F9F8;
  --text: #111827;
  --muted: #64748B;
  --muted-2: #94A3B8;
  --cash: #F59E0B;
  --online: #3B82F6;
  --green: #059669;
  --green-soft: #ECFDF5;
  --red: #EF4444;
  --red-soft: #FEF2F2;
  --amber-soft: #FFFBEB;
  --amber-text: #D97706;
  --appbar-h: 58px;
  --tabbar-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --col: 560px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 1rem; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font-family: inherit; }
a, button, label, summary, input, select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
svg[aria-hidden] { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3 { color: var(--primary-dark); }
.muted { color: var(--muted); font-size: .9rem; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.spacer { flex: 1; }
form.inline { display: inline; }
img { -webkit-user-drag: none; }
.appbar, .tabbar, button, .btn, .chip, .pill, .tabs, .seg, .menu-list { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* Installed app: no page bounce, no text selection on long press (typing still works) */
@media (display-mode: standalone) {
  html, body { overscroll-behavior-y: none; }
  body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  input, textarea { -webkit-user-select: text; user-select: text; }
}
/* Page changes: the top and bottom bars stay put, only the content fades */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
.appbar { view-transition-name: appbar; }
.tabbar { view-transition-name: tabbar; }

/* Loading line under the status bar (an installed app has no browser loading bar) */
.nav-progress { position: fixed; top: var(--safe-top); left: 50%; z-index: 120; width: 100%; max-width: var(--col); height: 3px; transform: translateX(-50%);
  overflow: hidden; pointer-events: none; opacity: 0; }
.nav-progress::before { content: ""; position: absolute; inset: 0; width: 40%; border-radius: 3px; background: var(--primary); animation: nav-load 1s ease-in-out infinite; }
body.loading .nav-progress { opacity: 1; transition: opacity .1s .12s; }
@keyframes nav-load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@keyframes spin { to { transform: rotate(360deg); } }
/* A button that was tapped and is waiting for the server */
button.busy { pointer-events: none; opacity: .8; }
button.busy svg { display: none; }
button.busy::before { content: ""; flex: none; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

/* Pull down to refresh (installed app) */
.ptr { position: fixed; top: calc(var(--appbar-h) + var(--safe-top) + 8px); left: 50%; z-index: 39; width: 40px; height: 40px; margin-left: -20px;
  border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--primary); box-shadow: 0 4px 14px rgba(15,23,42,.18);
  opacity: 0; transform: translateY(-64px); pointer-events: none; }
.ptr svg { width: 20px; height: 20px; stroke-width: 2.4; }
.ptr.ready { background: var(--primary); color: #fff; }
.ptr.spin svg { animation: spin .7s linear infinite; }

/* Wide screens: show the phone column in the middle */
@media (min-width: 600px) {
  html { background: #e3ebe7; }
  body.app { max-width: var(--col); margin: 0 auto; box-shadow: 0 0 40px rgba(15,23,42,.08); }
}

/* ---------- Top app bar ---------- */
.appbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px;
  min-height: calc(var(--appbar-h) + var(--safe-top)); padding: var(--safe-top) 14px 0;
  background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.appbar-logo { flex: none; width: 44px; height: 36px; object-fit: contain; }
img.appbar-logo { filter: drop-shadow(0 1px 2px rgba(15,23,42,.2)); }
.appbar-logo.mark { width: 36px; border-radius: 11px; font-size: 1.2rem; }
.appbar-back { flex: none; width: 40px; height: 40px; margin-left: -6px; border-radius: 50%; display: grid; place-items: center; color: var(--primary-dark); }
.appbar-back:active { background: var(--primary-soft); }
.appbar-back svg { width: 24px; height: 24px; stroke-width: 2.2; }
.appbar-title { flex: 1; min-width: 0; line-height: 1.2; }
.appbar-title b { display: block; font-size: 1.2rem; color: var(--primary-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-title small { display: block; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 700; text-decoration: none; }

/* ---------- Page area ---------- */
.app-main { padding: 14px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 24px); }
.page-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.page-head h1 { display: none; }               /* the title is in the top bar */
.page-head .sub { margin: 0; color: var(--muted); font-size: .9rem; }

/* ---------- Bottom tab bar ---------- */
.tabbar { position: fixed; bottom: 0; left: 50%; z-index: 40; width: 100%; max-width: var(--col); transform: translateX(-50%);
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; }
.tab i { width: 52px; height: 30px; border-radius: 999px; display: grid; place-items: center; transition: background .15s; }
.tab svg { width: 23px; height: 23px; }
.tab.active { color: var(--primary-dark); }
.tab.active i { background: var(--primary-soft); color: var(--primary); }
.tab:active i { background: var(--primary-soft); }
.tab-add i { width: 52px; height: 52px; margin-top: -26px; border-radius: 18px; background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(5,150,105,.35); }
.tab-add svg { width: 26px; height: 26px; stroke-width: 2.4; }
.tab-add.active i { background: var(--primary-hover); color: #fff; }
/* While the keyboard is open the tab bar steps aside, so the Save bar sits right above the keyboard */
body.typing .tabbar { display: none; }
body.typing .save-bar { bottom: 0; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(15,23,42,.04); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { margin: 0; font-size: 1rem; }
.card-head a { font-size: .9rem; font-weight: 600; text-decoration: none; }
.list-label { margin: 18px 4px 8px; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.empty, .empty-row { text-align: center; color: var(--muted); }
.empty-row { padding: 18px 0; margin: 0; }

/* ---------- Forms ---------- */
label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: .9rem; }
input[type=text], input[type=tel], input[type=password], input[type=number], input[type=search], input[type=date], select {
  width: 100%; min-height: 48px; padding: 12px 14px; font-size: 1rem; color: var(--text);
  background: #fff; border: 1px solid var(--input-line); border-radius: 12px; -webkit-appearance: none; appearance: none; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input::placeholder { color: #9aa8a2; }
select { padding-right: 38px; background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310B981' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }
.field { margin-bottom: 14px; }
.field > label:first-child, .card > label:first-child { margin-top: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row { display: flex; gap: 10px; }
.form-row .grow { flex: 1; min-width: 0; }
.form-row .qty { width: 96px; flex: none; }
.form-row label { margin-top: 0; }
label.check { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-weight: 500; }
label.check input { width: 20px; height: 20px; accent-color: var(--primary); }

/* ---------- Buttons ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 14px; background: var(--primary); color: #fff; font-size: 1rem; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: background .15s, transform .08s; }
button:active, .btn:active { transform: scale(.98); }
@media (hover: hover) { button:hover, .btn:hover { background: var(--primary-hover); } }
button svg, .btn svg { width: 18px; height: 18px; }
button.small, .btn.small { min-height: 38px; padding: 0 14px; font-size: .9rem; border-radius: 12px; }
.btn-full { width: 100%; }
.btn.light, .btn-outline, .btn.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--input-line); }
@media (hover: hover) { .btn.light:hover, .btn-outline:hover, .btn.btn-outline:hover { background: var(--primary-soft); } }
.btn.light:active, .btn-outline:active { background: var(--primary-soft); }
button.danger { background: var(--red); }
.clear-link { display: inline-block; margin-top: 10px; font-size: .9rem; font-weight: 600; }

/* ---------- Messages ---------- */
.flash { padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; font-weight: 500; font-size: .9rem; }
.flash.ok { background: var(--green-soft); color: #1d5a37; border: 1px solid #bfe0cd; }
.flash.err { background: var(--red-soft); color: #8e1b1b; border: 1px solid #f1c3c3; }
/* success messages show as a toast that fades away */
.app-main > .flash.ok { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  width: max-content; max-width: min(92vw, 520px); margin: 0; transform: translateX(-50%);
  background: #111827; color: #fff; border: 0; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: toast 4.2s ease forwards; pointer-events: none; }
.app-main:has(.save-bar) > .flash.ok { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 86px); }   /* stay above the Save bar */
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 12px); } 8%, 82% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 12px); visibility: hidden; } }

/* ---------- Chips, pills, tabs ---------- */
.tabs, .pills { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar, .pills::-webkit-scrollbar { display: none; }
.tabs a, .pill { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--primary-dark);
  text-decoration: none; font-size: .9rem; font-weight: 600; white-space: nowrap; }
.tabs a.active, .pill.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill small { margin-left: 3px; color: var(--muted); font-weight: 500; }
.pill.on small { color: #d1fae5; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg a { padding: 6px 12px; font-size: .9rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.seg a.active { background: var(--primary); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--primary-dark); font-size: .9rem; font-weight: 600; }
@media (hover: hover) { .chip:hover { background: var(--primary-soft); } }
.chip:active, .pill:active, .tabs a:active, .seg a:active, .btn-act:active, .pg:active, .qty-opt:active { transform: scale(.95); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.hs { padding: 6px 12px; border-radius: 999px; background: #eef4f1; color: var(--muted); font-size: .9rem; white-space: nowrap; align-self: flex-start; }
.hs b { margin-right: 4px; color: var(--primary-dark); }
.hs.ok b { color: var(--green); }
.head-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.role-badge { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark);
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; vertical-align: 1px; }
.role-badge.staff { background: #eef2f1; color: var(--muted); }
.tag { display: inline-block; margin-top: 4px; padding: 2px 9px; border-radius: 999px; background: var(--amber-soft); color: var(--amber-text); font-size: .72rem; font-weight: 700; }
.tag.off { background: var(--red-soft); color: #8e1b1b; }
.edited-pill { padding: 1px 8px; border-radius: 999px; background: var(--amber-soft); color: var(--amber-text); font-size: .72rem; font-weight: 700; text-decoration: none; vertical-align: 2px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.dot.c-cash { background: var(--cash); }
.dot.c-online { background: var(--online); }
.note { display: flex; gap: 10px; margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); font-size: .9rem; }
.note svg { flex: none; width: 18px; height: 18px; }

/* ---------- Summary numbers ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stats.five .stat:last-child { grid-column: span 2; }
.stat { min-width: 0; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--primary); }
.stat small { display: block; color: var(--muted); font-size: .8rem; }
.stat b { display: block; margin: 2px 0; font-size: 1.2rem; color: var(--primary-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { color: var(--muted); font-size: .8rem; }
.stat.total { background: var(--primary); border-color: var(--primary); border-left-color: #6ee7b7; }
.stat.total small, .stat.total span { color: #d1fae5; }
.stat.total b { color: #fff; }
.stat.cash { border-left-color: var(--cash); }
.stat.online { border-left-color: var(--online); }
.stat.qty { border-left-color: var(--accent); }
.delta { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.stat .delta.up { background: var(--green-soft); color: #1d5a37; }
.stat .delta.down { background: var(--red-soft); color: #8e1b1b; }
.stat .delta.same { background: #eee; color: #555; }
.stat .vs, .stat .delta-none { font-size: .72rem; }

/* ---------- Dashboard panels ---------- */
.panels { display: block; }
.panel { margin-bottom: 14px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 13px; }
.chart .hit { fill: transparent; }
.c-cash { fill: var(--cash); }
.c-online { fill: var(--online); }
.chart .bar.tapped .hit { fill: rgba(5,150,105,.08); }
.legend { display: flex; gap: 12px; font-size: .8rem; color: var(--muted); }
.legend .dot { width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; }
.chart-tip { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--bg); font-size: .8rem; color: var(--text); }
.rank { margin-bottom: 11px; }
.rank-line { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; font-size: .9rem; }
.rank .rk { width: 20px; flex: none; color: var(--muted); font-weight: 700; }
.rank .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .val { font-weight: 600; white-space: nowrap; }
.rank .val small { margin-left: 4px; color: var(--muted); font-weight: 400; }
.track { height: 8px; margin-left: 28px; border-radius: 999px; overflow: hidden; background: var(--primary-soft); }
.track div { height: 100%; border-radius: 999px; background: var(--primary); }
.track div.other { background: #b8c4bf; }
.track.gold div { background: var(--accent); }
.mix { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.donut { width: 150px; height: 150px; }
.donut circle { fill: none; stroke-width: 18; }
.donut-track { stroke: var(--line); }
.d-cash { stroke: var(--cash); }
.d-online { stroke: var(--online); }
.donut-big { font-size: 20px; font-weight: 700; fill: var(--primary-dark); }
.donut-small { font-size: 11px; fill: var(--muted); }
.mix-legend { width: 100%; margin: 0; padding: 0; list-style: none; }
.mix-legend li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.mix-legend li:first-child { border-top: 0; }
.mix-legend span { flex: 1; }
.mix-legend small { color: var(--muted); min-width: 84px; text-align: right; }
.insights { margin: 0; padding: 0; list-style: none; }
.insights li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.insights li:first-child { border-top: 0; padding-top: 0; }
.insights i { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.insights i svg { width: 18px; height: 18px; }
.insights small { display: block; color: var(--muted); font-size: .8rem; }
.insights b { color: var(--primary-dark); }
.insights span { margin-left: 6px; color: var(--muted); font-size: .9rem; }
.recent { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.recent:first-child { border-top: 0; padding-top: 0; }
.recent > div { min-width: 0; }
.recent b { display: block; font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent small { color: var(--muted); font-size: .8rem; }
.recent > span { font-weight: 700; white-space: nowrap; color: var(--primary-dark); }

/* ---------- Add Sale ---------- */
.sale-page { padding-bottom: 76px; }
.sale-form { padding: 4px 16px; }
.sale-form > .flash { margin: 14px 0 0; }
.step { padding: 16px 0; }
.step + .step { border-top: 1px dashed var(--line); }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.step-no { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800;
  background: var(--primary); }
.step-head h3 { margin: 0; font-size: 1rem; }
.step-head p { margin: 1px 0 0; color: var(--muted); font-size: .9rem; }
.money-field { display: block; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--fill); cursor: text; }
.money-field.cash { border-top: 4px solid var(--cash); }
.money-field.online { border-top: 4px solid var(--online); }
.money-field:focus-within { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--primary-soft); }
.mf-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: .9rem; font-weight: 700; color: var(--text); }
.mf-icon { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; }
.mf-icon svg { width: 16px; height: 16px; }
.money-field.cash .mf-icon { background: var(--amber-soft); color: var(--cash); }
.money-field.online .mf-icon { background: #dbeafe; color: var(--online); }
.mf-input { display: flex; align-items: baseline; gap: 6px; }
.mf-input > span { font-weight: 700; color: var(--muted); font-size: .9rem; }
.mf-input input { width: 100%; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent;
  font-size: 1.45rem; font-weight: 800; color: var(--primary-dark); -moz-appearance: textfield; }
.mf-input input:focus { outline: none; }
.mf-input input::-webkit-outer-spin-button, .mf-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.form-note { margin-top: 12px; }
.save-bar { position: fixed; z-index: 35; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom)); width: 100%; max-width: var(--col); transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(15,23,42,.06); }
.sb-sum { flex: 1; min-width: 0; line-height: 1.2; }
.sb-sum small { display: block; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-sum b { font-size: 1.2rem; color: var(--primary-dark); }
.btn-save { flex: none; min-height: 50px; padding: 0 22px; border-radius: 14px; background: var(--primary); box-shadow: 0 6px 16px rgba(5,150,105,.3); }
@media (hover: hover) { .btn-save:hover { background: var(--primary-hover); } }
.btn-save svg { stroke-width: 2.6; }
.last-saved { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 12px 14px; border-radius: 16px; background: var(--green-soft); border: 1px solid #bfe0cd; color: #1d5a37; }
.ls-icon { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; }
.ls-icon svg { width: 15px; height: 15px; stroke-width: 2.8; }
.ls-text { flex: 1; min-width: 0; font-size: .9rem; }
.ls-text small { display: block; color: #3d6b51; font-size: .8rem; }

/* quantity picker */
.qty-picker { position: relative; }
.qty-btn { width: 100%; min-height: 48px; justify-content: space-between; padding: 0 12px; border: 1px solid var(--input-line); border-radius: 12px;
  background: #fff; color: var(--text); font-weight: 600; }
@media (hover: hover) { .qty-btn:hover { background: #fff; } }
.qty-btn[aria-expanded=true], .qty-btn:focus-visible { outline: 2px solid var(--accent); border-color: var(--accent); }
.qty-btn svg { color: var(--primary); stroke-width: 2.2; transition: transform .15s; }
.qty-btn[aria-expanded=true] svg { transform: rotate(180deg); }
.qty-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: min(280px, calc(100vw - 32px)); padding: 10px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 34px rgba(15,23,42,.18);
  transform-origin: top right; animation: pop-in .14s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: scale(.92); } }
.qty-opt { min-height: 44px; padding: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--fill); color: var(--text); font-size: 1rem; }
@media (hover: hover) { .qty-opt:hover { background: var(--primary-soft); color: var(--primary-dark); } }
.qty-opt.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Lists: sales, my sales, staff rows ---------- */
.sale-list { padding: 4px 14px; }
.sale-row, .staff-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.sale-row:first-child, .staff-row:first-of-type { border-top: 0; }
.sr-main { flex: 1; min-width: 0; }
.sr-main b { display: block; color: var(--primary-dark); overflow-wrap: anywhere; }
.sr-main small { display: block; color: var(--muted); font-size: .8rem; }
.sr-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.sr-total { color: var(--primary-dark); white-space: nowrap; }
.sale-row.deleted .sr-main b, .sale-row.deleted .sr-total { color: #9aa8a2; text-decoration: line-through; }
.row-actions { display: flex; gap: 6px; }
.btn-act { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--input-line);
  background: #fff; color: var(--primary); font-size: .9rem; font-weight: 600; text-decoration: none; }
@media (hover: hover) { .btn-act:hover { background: var(--primary-soft); } }
.btn-act svg { width: 17px; height: 17px; }
button.btn-act { min-height: 36px; }
.btn-act.danger-act { color: var(--red); border-color: #f1c3c3; }
@media (hover: hover) { .btn-act.danger-act:hover { background: var(--red-soft); } }
.entry-qty { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pg { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
  color: var(--primary-dark); font-weight: 600; font-size: .9rem; text-decoration: none; }
.pg svg { width: 18px; height: 18px; }
.pg.disabled { opacity: .4; pointer-events: none; }

/* All Sales filters */
.filter-bar { margin-bottom: 14px; }
.fb-label { display: block; margin: 0 2px 6px; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.filter-bar .pills { margin-bottom: 12px; }
.more-filters { border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.more-filters summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; font-weight: 600; font-size: .9rem; color: var(--primary-dark); cursor: pointer; }
.more-filters summary::-webkit-details-marker { display: none; }
.more-filters summary svg { width: 18px; height: 18px; color: var(--primary); }
.more-filters[open] summary { border-bottom: 1px solid var(--line); }
.more-filters > :not(summary) { margin: 12px 14px; }
.more-filters > button { width: calc(100% - 28px); }
.dot-on { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.fb-search { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 12px; border: 1px solid var(--input-line); border-radius: 12px; background: #fff; font-weight: 400; }
.fb-search:focus-within { outline: 2px solid var(--accent); border-color: var(--accent); }
.fb-search svg { flex: none; width: 18px; height: 18px; color: var(--muted); }
.fb-search input { min-height: 46px; padding: 0; border: 0; background: transparent; }
.fb-search input:focus { outline: none; }
.fb-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fb-dates label { margin: 0; font-size: .8rem; color: var(--muted); }
.fb-dates input { margin-top: 4px; }

/* My sales today */
.my-sales { display: grid; gap: 10px; margin-bottom: 14px; }
.ms-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; padding: 14px; }
.ms-item.is-off { background: var(--fill); }
.ms-item.is-off .ms-main b, .ms-item.is-off .ms-total { color: #9aa8a2; text-decoration: line-through; }
.ms-main { flex: 1 1 calc(100% - 52px); min-width: 0; }
.ms-main b { display: block; color: var(--primary-dark); }
.ms-main small { color: var(--muted); font-size: .8rem; }
.ms-total { margin-left: 50px; color: var(--primary-dark); white-space: nowrap; }
.ms-action { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ms-action small { font-size: .8rem; color: var(--muted); }
.locked { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .9rem; }
.locked svg { width: 15px; height: 15px; }

/* ---------- Edit / Fix ---------- */
.settings-grid { display: block; }
.set-card { padding: 16px; }
.set-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.set-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.set-icon svg { width: 20px; height: 20px; }
.set-head h3 { margin: 0; font-size: 1rem; }
.set-head p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.set-divider { margin: 6px 0 18px; border-top: 1px dashed var(--line); }
.set-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.set-actions:has(> :only-child) { grid-template-columns: 1fr; }
.preview-card h3 { margin: 0; font-size: 1rem; }
.preview-card .hint { margin: 2px 0 12px; }
.r-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; font-size: .9rem; }
.r-row span { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.r-row b { text-align: right; overflow-wrap: anywhere; }
.r-total { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.r-total b { font-size: 1.35rem; }
.hist-title { margin: 16px 0 6px; font-size: .9rem; }
.hist-item { padding: 8px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.hist-item p { margin: 2px 0 0; }
.clock-pill { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 6px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; font-size: .9rem; }
.clock-pill svg { width: 16px; height: 16px; color: var(--primary); }

/* ---------- Settings ---------- */
.logo-uploader { display: flex; flex-direction: column; gap: 14px; padding: 14px; border: 1.5px dashed var(--input-line); border-radius: 16px; background: var(--fill); }
.logo-preview { height: 100px; padding: 10px; border-radius: 14px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.logo-preview img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.logo-preview .mark { width: 56px; height: 56px; border-radius: 14px; font-size: 1.8rem; }
.upload-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; margin: 0; min-height: 44px; padding: 0 16px;
  border-radius: 12px; background: #fff; border: 1px solid var(--input-line); color: var(--primary); font-weight: 600; cursor: pointer; }
.upload-btn svg { width: 18px; height: 18px; }
.upload-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-name { display: block; margin-top: 8px; font-size: .9rem; overflow-wrap: anywhere; }
.file-name:empty { display: none; }
.profile-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.profile-row b { display: block; color: var(--primary-dark); }
.profile-row small { color: var(--muted); }
.pw-grid { display: grid; gap: 0; }
.pw-grid label { margin-top: 12px; }
.pw-grid > div:first-child label { margin-top: 0; }

/* ---------- Avatars, marks ---------- */
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 700; }
.avatar.big { width: 50px; height: 50px; font-size: 1.2rem; }
.mark { display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }

/* ---------- Staff ---------- */
.add-staff summary { list-style: none; cursor: pointer; margin: 0; }
.add-staff summary::-webkit-details-marker { display: none; }
.add-staff[open] summary { margin-bottom: 16px; }
.sum-plus { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; transition: transform .2s; }
.sum-plus svg { width: 18px; height: 18px; stroke-width: 2.4; }
.add-staff[open] .sum-plus { transform: rotate(45deg); }
.staff-list { display: grid; gap: 12px; }
.staff-card { margin: 0; }
.staff-card.is-off { background: var(--fill); }
.staff-card.is-off .sc-top, .staff-card.is-off .sc-stats { opacity: .65; }
.sc-top { display: flex; align-items: center; gap: 12px; }
.sc-id { flex: 1; min-width: 0; }
.sc-id b { display: block; color: var(--primary-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-id small { color: var(--muted); }
.sc-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.sc-badges .role-badge { margin-left: 0; }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 700; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.on { color: var(--green); }
.status.off { color: #94a3a0; }
.sc-stats { display: grid; grid-template-columns: auto auto auto; justify-content: space-between; gap: 8px; margin: 14px 0; padding: 12px; border-radius: 12px; background: var(--fill); border: 1px solid var(--line); }
.sc-stats small { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sc-stats b { font-size: .9rem; color: var(--primary-dark); white-space: nowrap; }
.sc-actions { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
details.reset[open] { flex-basis: 100%; }
details.reset summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--input-line); background: #fff; color: var(--primary); font-size: .9rem; font-weight: 600; cursor: pointer; }
details.reset summary::-webkit-details-marker { display: none; }
details.reset summary svg { width: 16px; height: 16px; }
.reset-form { display: flex; gap: 8px; margin-top: 10px; }
.reset-form input[type=password] { flex: 1; min-width: 0; }
button.toggle-off, button.toggle-on { min-height: 38px; padding: 0 14px; font-size: .9rem; background: #fff; }
button.toggle-off { color: var(--red); border: 1px solid #f1c3c3; }
@media (hover: hover) { button.toggle-off:hover { background: var(--red-soft); } }
button.toggle-on { color: var(--green); border: 1px solid #bfe0cd; }
@media (hover: hover) { button.toggle-on:hover { background: var(--green-soft); } }
.you { padding: 8px 0; font-size: .8rem; color: var(--muted); }
.staff-row .avatar { width: 36px; height: 36px; }

/* ---------- Activity log ---------- */
.log-list { padding: 4px 14px; }
.log-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.log-item:first-child { border-top: 0; }
.log-icon { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.log-icon svg { width: 18px; height: 18px; }
.log-icon.g-sales { background: var(--green-soft); color: var(--green); }
.log-icon.g-staff { background: var(--amber-soft); color: var(--amber-text); }
.log-icon.g-login, .log-icon.g-export { background: #dbeafe; color: var(--online); }
.log-icon.warn { background: var(--red-soft); color: var(--red); }
.log-main { flex: 1; min-width: 0; }
.log-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: .9rem; }
.log-title b { color: var(--primary-dark); }
.log-sale { font-size: .8rem; font-weight: 600; text-decoration: none; }
.log-main p { margin: 3px 0 0; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.log-meta { width: 100%; padding-left: 48px; font-size: .8rem; color: var(--muted); }
.log-meta small { margin-left: 8px; }
.log-empty { padding: 14px 0; }
.log-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: .9rem; }
.log-foot svg { width: 16px; height: 16px; }

/* ---------- More ---------- */
.profile-card { display: flex; align-items: center; gap: 14px; }
.profile-card b { display: block; font-size: 1rem; color: var(--primary-dark); }
.profile-card small { color: var(--muted); }
.menu-list { padding: 0; overflow: hidden; }
.menu-list > a, .menu-list > button, .menu-help { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 62px; padding: 10px 16px;
  border: 0; border-top: 1px solid var(--line); border-radius: 0; background: #fff; color: var(--text); text-align: left; text-decoration: none; font-size: 1rem; font-weight: 400; }
.menu-list > :first-child { border-top: 0; }
.menu-list > a:active, .menu-list > button:active { background: var(--fill); transform: none; }
@media (hover: hover) { .menu-list > button:hover { background: var(--fill); } }
.menu-list i { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.menu-list i svg { width: 20px; height: 20px; }
.menu-list span { flex: 1; min-width: 0; }
.menu-list b { display: block; font-weight: 600; color: var(--primary-dark); }
.menu-list small { display: block; color: var(--muted); font-size: .8rem; }
.menu-list > a > svg, .menu-list > button > svg { flex: none; width: 18px; height: 18px; color: #9aa8a2; }
.menu-list .danger-row b { color: var(--red); }
.menu-list .danger-row i { background: var(--red-soft); color: var(--red); }
.app-foot { margin-top: 20px; text-align: center; font-size: .8rem; }

/* ---------- Confirmation sheet ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(15,23,42,.45);
  animation: fade-in .2s ease-out; touch-action: none; overscroll-behavior: contain; }
.modal-overlay.closing { animation: fade-out .18s ease-in forwards; }
.modal-overlay.closing .modal { animation: sheet-out .18s ease-in forwards; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-out { to { transform: translateY(100%); } }
.modal { width: 100%; max-width: var(--col); padding: 22px 20px calc(20px + var(--safe-bottom)); border-radius: 24px 24px 0 0; background: #fff;
  box-shadow: 0 -10px 40px rgba(15,23,42,.25); animation: sheet-in .2s ease-out; }
.modal::before { content: ""; display: block; width: 40px; height: 4px; margin: -8px auto 16px; border-radius: 999px; background: var(--line); }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
.modal-icon { width: 46px; height: 46px; margin-bottom: 12px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.modal.danger .modal-icon { background: var(--red-soft); color: var(--red); }
.modal-icon svg { width: 22px; height: 22px; }
.modal h3 { margin: 0 0 6px; font-size: 1.2rem; }
.modal-text { margin: 0; color: var(--muted); font-size: .9rem; }
.modal-detail { margin: 14px 0 0; padding: 12px 14px; list-style: none; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: .9rem; font-weight: 600; }
.modal-detail li + li { margin-top: 4px; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.modal-actions:has(.modal-cancel[hidden]) { grid-template-columns: 1fr; }
.modal-actions button { width: 100%; }
.modal-actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.modal-ok.danger { background: var(--red); }
@media (hover: hover) { .modal-ok.danger:hover { background: #a61f1f; } }

/* ---------- Login / setup ---------- */
body.auth { min-height: 100vh; min-height: 100dvh; background: var(--side); }
.auth-main { display: flex; flex-direction: column; justify-content: flex-end; min-height: 100vh; min-height: 100dvh; max-width: 480px; margin: 0 auto;
  padding: calc(28px + var(--safe-top)) 0 0; }
.auth-brand { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 20px 24px; text-align: center; color: #fff; }
.auth-logo { width: 240px; height: 140px; object-fit: contain; }
img.auth-logo { filter: drop-shadow(0 8px 20px rgba(0,0,0,.3)); }
.auth-logo.mark { width: 84px; height: 84px; border-radius: 24px; font-size: 2.6rem; background: rgba(255,255,255,.14); color: #fff; }
.auth-brand h1 { margin: 12px 0 2px; color: #fff; font-size: 1.5rem; }
.auth-brand p { margin: 0; color: #d1fae5; }
.auth-main > .flash { margin: 0 16px 12px; }
.login-box { margin: 0; padding: 26px 20px calc(28px + var(--safe-bottom)); border: 0; border-radius: 28px 28px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.15); }
.login-box h1 { margin: 0 0 6px; font-size: 1.2rem; }
.login-box button { width: 100%; margin-top: 8px; }
@media (min-width: 600px) {
  .auth-main { justify-content: center; padding-bottom: 40px; }
  .auth-brand { flex: none; }
  .login-box { margin: 0 16px; border-radius: 24px; padding-bottom: 28px; }
}

/* =========================================================
   ERP look: dark teal sidebar, emerald accent, white cards
   ========================================================= */
.side-brand, .side-only, .side-foot, .hdr-search { display: none; }
h1, h2, h3 { letter-spacing: -.01em; }

/* cards: three levels (big / standard / small) */
.card { border-radius: 16px; padding: 20px; box-shadow: 0 2px 10px rgba(15,23,42,.04); }
.card-head h3 { font-size: 1rem; font-weight: 600; }
.menu-list { padding: 0; }
.sale-list, .log-list { padding: 4px 18px; }
.sale-form { padding: 4px 20px; }
.set-card { padding: 20px; }
.panel, .stat { transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease; }
@media (hover: hover) {
  .panel:hover, .stat:hover { box-shadow: 0 6px 20px rgba(15,23,42,.07); border-color: #D3DCD9; transform: translateY(-1px); }
}
button, .btn { border-radius: 10px; font-weight: 600; }
button.small, .btn.small { border-radius: 10px; }
.btn-save { box-shadow: none; border-radius: 10px; }

/* KPI cards: soft icon, small label, big number, trend */
.stat { position: relative; min-width: 0; padding: 20px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(15,23,42,.04); }
.stat .ic { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 14px; border-radius: 12px; }
.stat .ic svg { width: 21px; height: 21px; }
.ic.t-green  { background: #ECFDF5; color: #10B981; }
.ic.t-blue   { background: #EFF6FF; color: #3B82F6; }
.ic.t-orange { background: #FFFBEB; color: #F59E0B; }
.ic.t-purple { background: #F5F3FF; color: #8B5CF6; }
.ic.t-slate  { background: #F1F5F9; color: #64748B; }
.stat small { display: block; font-size: .9rem; font-weight: 500; color: var(--muted); }
.stat b { display: block; margin: 6px 0 8px; font-size: clamp(1.2rem, 5.6vw, 1.5rem); font-weight: 700; letter-spacing: -.02em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { font-size: .8rem; color: var(--muted); }
.stat.total, .stat.cash, .stat.online, .stat.qty { background: #fff; border-color: var(--line); }
.stat.total small, .stat.total span { color: var(--muted); }
.stat.total b { color: var(--text); }
.stats .stat:first-child { grid-column: span 2; }
@media (max-width: 1099px) {
  .stats:not(.five) .stat:last-child { grid-column: span 2; }
  .stat { padding: 16px; }
  .stat .ic { width: 38px; height: 38px; margin-bottom: 10px; }
  .stat .ic svg { width: 19px; height: 19px; }
  .stat b { margin: 4px 0 6px; font-size: clamp(1.05rem, 4.6vw, 1.3rem); }
}
.delta { padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.stat .delta.up   { background: #ECFDF5; color: #059669; }
.stat .delta.down { background: #FEF2F2; color: #DC2626; }
.stat .delta.same { background: #F1F5F9; color: var(--muted); }
.stat .vs, .stat .delta-none { font-size: .8rem; color: var(--muted); }

/* soft badges */
.tag { background: #FFFBEB; color: #D97706; }
.tag.off { background: #FEF2F2; color: #DC2626; }
.edited-pill { background: #FFFBEB; color: #D97706; }
.role-badge { background: #ECFDF5; color: #059669; }
.flash.ok { background: #ECFDF5; color: #059669; border-color: #BBF7D0; }
.flash.err { background: #FEF2F2; color: #DC2626; border-color: #FECACA; }
.track div { background: var(--primary); }
.track.gold div { background: var(--cash); }

/* ---------- Big screens: dark teal sidebar + white header ---------- */
@media (min-width: 1100px) {
  :root { --side-w: 256px; }
  html { background: var(--bg); }
  body.app { max-width: none; margin: 0; padding-left: var(--side-w); box-shadow: none; transition: padding-left .2s ease; }

  .tabbar { top: 0; bottom: 0; left: 0; width: var(--side-w); max-width: none; height: auto; transform: none;
    display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 2px; padding: 0 14px;
    background: var(--side); border: 0; border-right: 1px solid rgba(255,255,255,.06); box-shadow: none; overflow: visible;
    -webkit-backdrop-filter: none; backdrop-filter: none; view-transition-name: none; z-index: 60; transition: width .2s ease; }
  .side-brand { order: -2; display: flex; align-items: center; gap: 12px; flex: none; height: 72px; padding: 0 6px; margin-bottom: 6px; }
  .side-brand b { min-width: 0; font-size: 1rem; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; color: #fff; overflow-wrap: anywhere; }
  .side-logo { flex: none; width: 46px; height: 38px; object-fit: contain; }
  .side-logo.mark { width: 38px; height: 38px; border-radius: 11px; font-size: 1.2rem; background: var(--primary); color: #fff; }
  .side-only { display: flex; }
  .tab-more { display: none; }

  .tab { position: relative; flex: none; height: auto; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px; border-radius: 12px;
    color: rgba(255,255,255,.72); font-size: .9rem; font-weight: 500; transition: background .2s ease, color .2s ease; }
  .tab i, .tab.active i, .tab:active i { width: 22px; height: 22px; border-radius: 0; background: none; color: inherit; transition: color .2s ease; }
  .tab svg { width: 21px; height: 21px; }
  @media (hover: hover) {
    .tab:not(.active):hover { background: rgba(255,255,255,.06); color: #fff; }
    .tab:not(.active):hover i { color: #10B981; }
  }
  .tab.active { background: #10B981; color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(16,185,129,.3); }
  .tab.active i { color: #fff; }

  /* Add: outlined button at the top of the menu */
  .tab-add, .tab-add.active { order: -1; justify-content: center; margin: 10px 0 8px; border: 1.5px solid rgba(16,185,129,.55); background: transparent; color: #34D399; box-shadow: none; font-weight: 600; }
  .tab-add i, .tab-add.active i { width: 22px; height: 22px; margin: 0; border-radius: 0; background: none; box-shadow: none; color: inherit; }
  .tab-add svg { stroke-width: 2.4; }
  @media (hover: hover) { .tab-add:hover { background: rgba(16,185,129,.14); color: #6EE7B7; } .tab-add:hover i { color: inherit; } }
  .tab-add.active { background: #10B981; border-color: #10B981; color: #fff; }

  /* quiet section labels */
  .side-brand + .tab, .tab-more + .side-only:not(.side-logout) { margin-top: 26px; }
  .side-brand + .tab::before, .tab-more + .side-only:not(.side-logout)::before { position: absolute; top: -20px; left: 12px; font-size: .72rem; font-weight: 600; letter-spacing: .1em; color: var(--side-label); }
  .side-brand + .tab::before { content: "MENU"; }
  .tab-more + .side-only:not(.side-logout)::before { content: "MANAGE"; }
  .tab-add + .tab { margin-top: 0; }

  .side-logout { order: 90; margin-top: auto; }
  @media (hover: hover) { .side-logout:not(.active):hover { color: #FCA5A5; } .side-logout:not(.active):hover i { color: #F87171; } }

  /* bottom: profile + collapse */
  .side-foot { order: 100; display: block; flex: none; margin: 10px -14px 0; padding: 12px 14px 14px; background: var(--side-deep); border-top: 1px solid rgba(255,255,255,.07); }
  .side-profile { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; color: #fff; text-decoration: none; }
  .side-profile .avatar { flex: none; width: 36px; height: 36px; font-size: .9rem; background: var(--primary); }
  .side-profile > div { flex: 1; min-width: 0; line-height: 1.25; }
  .side-profile b { display: block; font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-profile small { font-size: .72rem; color: #8FB3AC; }
  .side-profile > svg { width: 18px; height: 18px; color: #6F918B; }
  @media (hover: hover) { .side-profile:hover { background: rgba(255,255,255,.06); } }
  .side-collapse { width: 100%; min-height: 36px; margin-top: 8px; padding: 0 10px; gap: 8px; border-radius: 10px; background: rgba(255,255,255,.06); color: #9BC1BA; font-size: .8rem; font-weight: 600; }
  .side-collapse svg { width: 16px; height: 16px; transition: transform .2s ease; }
  @media (hover: hover) { .side-collapse:hover { background: rgba(255,255,255,.1); color: #fff; } }

  /* collapsed: icons only, names show on hover */
  body.app.side-collapsed { padding-left: 76px; }
  body.side-collapsed .tabbar { width: 76px; padding: 0 12px; }
  body.side-collapsed .side-brand { justify-content: center; padding: 0; }
  body.side-collapsed .side-brand b, body.side-collapsed .side-profile > div, body.side-collapsed .side-profile > svg,
  body.side-collapsed .side-collapse span { display: none; }
  body.side-collapsed .side-brand + .tab::before, body.side-collapsed .tab-more + .side-only:not(.side-logout)::before { content: ""; width: 24px; height: 1px; top: -13px; left: 12px; background: rgba(255,255,255,.12); }
  body.side-collapsed .tab { justify-content: center; padding: 12px 0; }
  body.side-collapsed .tab span { position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%); display: none; z-index: 80; padding: 6px 10px; border-radius: 8px;
    background: #111827; color: #fff; font-size: .8rem; font-weight: 600; white-space: nowrap; pointer-events: none; }
  body.side-collapsed .tab:hover span { display: block; }
  body.side-collapsed .side-profile { justify-content: center; padding: 4px 0; }
  body.side-collapsed .side-collapse svg { transform: rotate(180deg); }
  body.side-collapsed .side-foot { margin: 10px -12px 0; padding: 12px; }

  /* top header: title + search + profile */
  .appbar { position: sticky; top: 0; z-index: 50; gap: 20px; height: 68px; min-height: 68px; padding: 0 32px; background: #fff; border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: none; backdrop-filter: none; view-transition-name: none; }
  .appbar-logo { display: none; }
  .appbar-title { flex: 0 0 auto; }
  .appbar-title b { font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; }
  .appbar-title small { display: none; }
  .hdr-search { display: flex; align-items: center; gap: 10px; flex: 0 1 380px; height: 42px; margin-left: auto; padding: 0 14px; border-radius: 12px; background: #F3F6F5; border: 1px solid var(--line); color: var(--muted-2); }
  .hdr-search svg { flex: none; width: 18px; height: 18px; }
  .hdr-search input { flex: 1; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: .9rem; color: var(--text); }
  .hdr-search input:focus { outline: none; }
  .hdr-search:focus-within { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
  .appbar-avatar { width: 40px; height: 40px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
  .appbar-title + .appbar-avatar { margin-left: auto; }

  /* page area: airy */
  .app-main { max-width: 1200px; margin: 0 auto; padding: 28px 32px 56px; }
  .page-head { margin-bottom: 22px; }
  .tabs, .pills { margin: 0; padding: 2px 0; flex-wrap: wrap; overflow: visible; }
  .card { margin-bottom: 20px; padding: 24px; }
  .menu-list { padding: 0; }
  .sale-list, .log-list { padding: 4px 22px; }
  .sale-form { padding: 4px 24px; }
  .set-card { padding: 24px; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 20px; }
  .stats.five { grid-template-columns: repeat(5, 1fr); }
  .stats .stat:first-child, .stats .stat:last-child, .stats.five .stat:last-child { grid-column: auto; }
  .stat b { font-size: clamp(1.4rem, 2vw, 1.8rem); }

  .panels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; align-items: start; }
  .panels .panel { margin-bottom: 0; }
  .chart svg { max-width: 520px; margin: 0 auto; }
  .settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; align-items: start; }
  .staff-list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
  .sale-page { max-width: 760px; margin: 0 auto; padding-bottom: 96px; }
  .menu-list { max-width: 560px; }

  .save-bar { left: var(--side-w); right: 0; bottom: 0; width: auto; max-width: none; transform: none; justify-content: center; gap: 24px; padding: 12px 32px; transition: left .2s ease; }
  body.side-collapsed .save-bar { left: 76px; }
  .save-bar .sb-sum { flex: 0 1 280px; }
  body.typing .tabbar { display: flex; }
  body.typing .save-bar { bottom: 0; }

  .app-main > .flash.ok { left: calc(50% + var(--side-w) / 2); bottom: 28px; }
  .app-main:has(.save-bar) > .flash.ok { bottom: 92px; }
  .nav-progress { left: 0; width: 100%; max-width: none; transform: none; }
  .modal-overlay { align-items: center; }
  .modal { max-width: 440px; margin: 0 16px; border-radius: 20px; padding-bottom: 22px; animation-name: pop-in; }
  .modal::before { display: none; }
  .modal-overlay.closing .modal { animation-name: fade-out; }
  .qty-panel { width: 280px; }
}
@media (min-width: 1500px) {
  .panels { grid-template-columns: repeat(3, 1fr); }
  .panels .panel.chart { grid-column: span 2; }
}

/* =========================================================
   Add sale: form + live summary (receipt)
   ========================================================= */
.sale-grid { display: grid; gap: 16px; }
.sale-col { min-width: 0; }
.receipt { padding: 20px; border-radius: 18px; background: var(--side); color: #fff; box-shadow: 0 2px 10px rgba(15,23,42,.08); }
.rc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.rc-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(16,185,129,.18); color: #34D399; }
.rc-ic svg { width: 20px; height: 20px; }
.rc-top small { display: block; font-size: .72rem; font-weight: 600; letter-spacing: .1em; color: #8FB3AC; }
.rc-top b { font-size: 1rem; font-weight: 600; color: #fff; }
.rc-lines { margin: 0; padding: 12px 0; border-top: 1px dashed rgba(255,255,255,.22); border-bottom: 1px dashed rgba(255,255,255,.22); }
.rc-lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: .9rem; }
.rc-lines dt { display: flex; align-items: center; color: #9BC1BA; }
.rc-lines dt .dot { width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; }
.rc-lines dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.rc-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 2px; }
.rc-total span { color: #9BC1BA; }
.rc-total b { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; color: #34D399; }
.rc-save { display: none; width: 100%; margin-top: 14px; min-height: 50px; }
.rc-note { margin: 12px 0 0; font-size: .8rem; text-align: center; color: #8FB3AC; }
.money-field.cash { background: #FFFBEB; border-color: #FDE68A; }
.money-field.online { background: #EFF6FF; border-color: #BFDBFE; }
.money-field:focus-within { background: #fff; }
.sale-page { padding-bottom: 96px; }
@media (min-width: 1100px) {
  .sale-page { max-width: 1040px; padding-bottom: 40px; }
  .sale-grid { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
  .receipt { position: sticky; top: 4px; padding: 24px; }
  .rc-save { display: flex; }
  .save-bar { display: none; }
}

/* =========================================================
   Dashboard inside one big card
   ========================================================= */
.dash-shell { padding: 16px; border-radius: 20px; background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(15,23,42,.04); }
.dash-shell .page-head { margin-bottom: 16px; }
.dash-shell .stat, .dash-shell .card { background: #FAFCFB; box-shadow: none; }
.dash-shell .panels .panel:last-child { margin-bottom: 0; }
@media (hover: hover) {
  .dash-shell .stat:hover, .dash-shell .panel:hover { box-shadow: none; transform: none; border-color: #D3DCD9; }
}
@media (min-width: 1100px) {
  .dash-shell { padding: 28px; }
  .dash-shell .page-head { margin-bottom: 22px; }
  .dash-shell .stats { margin-bottom: 20px; }
}

/* Sidebar: rounded on the right */
@media (min-width: 1100px) {
  .tabbar { border-radius: 0 28px 28px 0; }
  .side-foot { border-radius: 0 0 28px 0; }
  body.side-collapsed .tabbar { border-radius: 0 24px 24px 0; }
  body.side-collapsed .side-foot { border-radius: 0 0 24px 0; }
}

/* Sidebar: curve turned the other way (page area curves into the sidebar) */
@media (min-width: 1100px) {
  html { background: var(--side); }
  body.app { background: transparent; }
  body.app::before { content: ""; position: fixed; z-index: -1; top: 0; bottom: 0; left: var(--side-w); right: 0; background: var(--bg);
    border-radius: 28px 0 0 28px; transition: left .2s ease; }
  body.side-collapsed::before { left: 76px; }
  .tabbar, body.side-collapsed .tabbar { border-radius: 0; border-right: 0; }
  .side-foot, body.side-collapsed .side-foot { border-radius: 0; }
  .appbar { border-top-left-radius: 28px; }
  .save-bar { border-bottom-left-radius: 28px; }
}

/* Sidebar brand: logo on top, shop name below it */
@media (min-width: 1100px) {
  .side-brand { flex-direction: column; justify-content: center; gap: 8px; height: auto; padding: 22px 6px 16px; margin-bottom: 4px; text-align: center; }
  .side-logo { width: 128px; height: 66px; }
  .side-logo.mark { width: 56px; height: 56px; border-radius: 16px; font-size: 1.6rem; }
  .side-brand b { font-size: 1rem; letter-spacing: .01em; }
  body.side-collapsed .side-brand { padding: 20px 0 14px; }
  body.side-collapsed .side-logo { width: 52px; height: 42px; }
  body.side-collapsed .side-logo.mark { width: 42px; height: 42px; border-radius: 12px; font-size: 1.2rem; }
}

/* Sidebar bottom (profile) uses the same teal as the sidebar: no two-tone seam next to the curve */
@media (min-width: 1100px) {
  .side-foot, body.side-collapsed .side-foot { background: var(--side); }
  .side-collapse { background: rgba(255,255,255,.07); }
}

/* =========================================================
   Big screens: the page is a floating panel with a gap on every side
   ========================================================= */
@media (min-width: 1100px) {
  html, body.app { height: 100%; }
  body.app { overflow: hidden; }
  body.app::before { content: none; }
  .app-shell { position: fixed; top: 14px; right: 14px; bottom: 14px; left: var(--side-w); border-radius: 28px; background: var(--bg);
    overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #C9D5D1 transparent; transition: left .2s ease; }
  body.side-collapsed .app-shell { left: 76px; }
  .appbar { border-radius: 28px 28px 0 0; }
  .save-bar { right: 14px; bottom: 14px; border-radius: 0 0 28px 28px; }
  body.side-collapsed .save-bar { left: 76px; }
  .app-main > .flash.ok { bottom: 42px; }
  .app-main:has(.save-bar) > .flash.ok { bottom: 106px; }
}

/* =========================================================
   Header: greeting + time. On big screens it is its own card,
   separate from the body panel below it.
   ========================================================= */
.hdr-greet, .hdr-time { display: none; }
@media (min-width: 1100px) {
  .app-shell { display: flex; flex-direction: column; gap: 12px; overflow: hidden; border-radius: 0; background: transparent; }
  .appbar { position: static; flex: none; height: 72px; min-height: 72px; padding: 0 28px; border: 0; border-radius: 22px; background: #fff;
    box-shadow: 0 2px 10px rgba(15,23,42,.05); }
  .appbar-title b { font-size: 1.2rem; line-height: 1.25; }
  .hdr-greet { display: block; margin-top: 1px; font-size: .8rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
  .hdr-time { display: flex; align-items: center; gap: 8px; height: 42px; margin-left: auto; padding: 0 16px; border-radius: 12px; background: #ECFDF5; color: #059669; font-size: .9rem; font-weight: 600; white-space: nowrap; }
  .hdr-time svg { width: 18px; height: 18px; }
  .hdr-search { margin-left: 0; }
  .app-main { flex: 1; min-height: 0; max-width: none; margin: 0; overflow-x: hidden; overflow-y: auto; border-radius: 28px; background: var(--bg);
    padding: 28px max(32px, calc((100% - 1200px) / 2)) 56px; scrollbar-width: thin; scrollbar-color: #C9D5D1 transparent; }
}

/* Body panel scrollbar stays inside the rounded corners */
@media (min-width: 1100px) {
  .app-main { scrollbar-width: auto; scrollbar-color: auto; }
  .app-main::-webkit-scrollbar { width: 14px; }
  .app-main::-webkit-scrollbar-track { margin: 26px 0; background: transparent; }
  .app-main::-webkit-scrollbar-thumb { border: 4px solid transparent; border-radius: 999px; background: #C3D0CB; background-clip: content-box; }
  .app-main::-webkit-scrollbar-thumb:hover { background: #A9BAB4; background-clip: content-box; }
  @supports (-moz-appearance: none) { .app-main { scrollbar-width: thin; scrollbar-color: #C3D0CB transparent; } }
}

/* =========================================================
   Dashboard: calmer, more professional cards and charts
   ========================================================= */
/* KPI cards: label + icon on top, big number, quiet footer */
.stat { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; padding: 18px 20px; }
.stat small { order: 1; flex: 1 1 0; min-width: 0; font-size: .8rem; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.stat .ic { order: 2; width: 38px; height: 38px; margin: 0; border-radius: 11px; }
.stat .ic svg { width: 19px; height: 19px; }
.stat b { order: 3; flex: 0 0 100%; margin: 12px 0 8px; font-size: clamp(1.15rem, 5.2vw, 1.4rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.stat > span:not(.ic), .stat .vs, .stat .delta-none { order: 4; font-size: .8rem; color: var(--muted); }
.stat .delta { margin-right: 2px; }

/* chart: fine bars, quiet grid, small axis text */
.chart svg { max-width: none; margin: 0; }
.chart .grid { stroke: #E9EFED; stroke-dasharray: 3 5; }
.chart .axis { font-size: 24px; fill: var(--muted-2); }
.chart .c-cash { fill: #F5A524; }
.chart .c-online { fill: #3B82F6; }
.legend { gap: 14px; font-size: .8rem; }
.legend .dot { width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: 0; }
.chart-tip { margin: 6px 0 0; padding: 0; background: none; font-size: .8rem; text-align: center; color: var(--muted-2); }

/* lists and bars */
.rank { margin-bottom: 14px; }
.rank-line { margin-bottom: 6px; font-size: .9rem; }
.rank .rk { width: 24px; font-size: .8rem; font-weight: 600; color: var(--muted-2); }
.rank .val { font-weight: 600; }
.track { height: 6px; background: #EEF3F1; }
.track.gold div { background: var(--primary-hover); }
.donut circle { stroke-width: 14; }
.mix-legend li { padding: 10px 0; font-size: .9rem; }
.insights li { padding: 12px 0; }
.insights i { width: 34px; height: 34px; border-radius: 10px; }
.insights b { font-size: .9rem; }
.recent { padding: 11px 0; }
.card-head h3 { font-size: .9rem; letter-spacing: 0; }

@media (max-width: 1099px) {
  .stat { padding: 16px; }
  .stat .ic { width: 34px; height: 34px; }
  .stat b { margin: 10px 0 6px; }
}
@media (min-width: 1100px) {
  .stat b { margin: 14px 0 10px; font-size: clamp(1.4rem, 2vw, 1.85rem); }
  .chart .axis { font-size: 16.5px; }
  .panels { align-items: stretch; gap: 20px; }
  .panels .panel { display: flex; flex-direction: column; padding: 22px; }
  .panels .panel .panel-body { flex: 1; }
  .panels .panel .mix { flex-direction: row; justify-content: center; gap: 28px; }
  .panels .panel .mix .donut { width: 140px; height: 140px; flex: none; }
  .panels .panel .mix .mix-legend { flex: 1; max-width: 230px; }
  .dash-shell .card-head { margin-bottom: 16px; }
}

/* =========================================================
   Period chips live in the header on big screens (more room below)
   ========================================================= */
.hdr-tabs { display: none; }
@media (min-width: 1100px) {
  .hdr-tabs { display: block; flex: 0 1 auto; min-width: 0; margin-left: 22px; }
  .hdr-tabs .tabs { margin: 0; padding: 2px 0; gap: 6px; flex-wrap: nowrap; overflow-x: auto; }
  .hdr-tabs .tabs a { padding: 7px 13px; font-size: .9rem; }
  .page-head:has(> .tabs) { display: none; }
}

/* Very wide screens: the last panel (Recent sales) spans the full row as two columns */
@media (min-width: 1500px) {
  .panels .panel:last-child { grid-column: 1 / -1; }
  .panels .panel:last-child .panel-body { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; align-content: start; }
  .panels .panel:last-child .recent:nth-child(-n+2) { border-top: 0; padding-top: 0; }
}

/* =========================================================
   Dashboard colour: tinted KPI cards, solid icon chips, small title accents
   ========================================================= */
.stat { position: relative; overflow: hidden; }
.stat > * { position: relative; z-index: 1; }
.stat::after { content: ""; position: absolute; z-index: 0; right: -30px; bottom: -38px; width: 120px; height: 120px; border-radius: 50%; pointer-events: none; }
.stat.total  { background: linear-gradient(135deg, #E6FBF1 0%, #F7FEFB 100%); border-color: #BDEBD2; }
.stat.total::after  { background: #CFF5E1; opacity: .55; }
.stat.cash   { background: linear-gradient(135deg, #FFF6DD 0%, #FFFDF6 100%); border-color: #F8DF9C; }
.stat.cash::after   { background: #FCE7A6; opacity: .5; }
.stat.online { background: linear-gradient(135deg, #E8F1FF 0%, #F8FBFF 100%); border-color: #BCD5FA; }
.stat.online::after { background: #D3E4FD; opacity: .6; }
.stat.qty    { background: linear-gradient(135deg, #F0EBFF 0%, #FAF8FF 100%); border-color: #D7CCFB; }
.stat.qty::after    { background: #E4DBFD; opacity: .6; }
.dash-shell .stat.total  { background: linear-gradient(135deg, #E6FBF1 0%, #F7FEFB 100%); }
.dash-shell .stat.cash   { background: linear-gradient(135deg, #FFF6DD 0%, #FFFDF6 100%); }
.dash-shell .stat.online { background: linear-gradient(135deg, #E8F1FF 0%, #F8FBFF 100%); }
.dash-shell .stat.qty    { background: linear-gradient(135deg, #F0EBFF 0%, #FAF8FF 100%); }
.ic.t-green  { background: #10B981; color: #fff; box-shadow: 0 5px 12px rgba(16,185,129,.32); }
.ic.t-orange { background: #F59E0B; color: #fff; box-shadow: 0 5px 12px rgba(245,158,11,.32); }
.ic.t-blue   { background: #3B82F6; color: #fff; box-shadow: 0 5px 12px rgba(59,130,246,.32); }
.ic.t-purple { background: #8B5CF6; color: #fff; box-shadow: 0 5px 12px rgba(139,92,246,.32); }
.ic.t-slate  { background: #64748B; color: #fff; box-shadow: 0 5px 12px rgba(100,116,139,.28); }
.stat .delta.up   { background: rgba(255,255,255,.75); }
.stat .delta.down { background: rgba(255,255,255,.75); }
.stat .delta.same { background: rgba(255,255,255,.75); }

/* panel titles get a small colour bar */
.panels .panel .card-head h3 { display: flex; align-items: center; gap: 10px; }
.panels .panel .card-head h3::before { content: ""; width: 4px; height: 16px; border-radius: 4px; background: var(--primary); }
.panels .panel:nth-child(2) .card-head h3::before { background: #3B82F6; }
.panels .panel:nth-child(3) .card-head h3::before { background: #8B5CF6; }
.panels .panel:nth-child(4) .card-head h3::before { background: #F59E0B; }
.panels .panel:nth-child(5) .card-head h3::before { background: #14B8A6; }
.panels .panel:nth-child(6) .card-head h3::before { background: #64748B; }

/* insight icons: one soft colour each */
.insights li:nth-child(1) i { background: #FFF6DD; color: #D97706; }
.insights li:nth-child(2) i { background: #E8F1FF; color: #2563EB; }
.insights li:nth-child(3) i { background: #F0EBFF; color: #7C3AED; }
.insights li:nth-child(4) i { background: #E6FBF1; color: #059669; }
.stat .ic.t-green, .stat .ic.t-orange, .stat .ic.t-blue, .stat .ic.t-purple, .stat .ic.t-slate { color: #fff; }

/* =========================================================
   Sales list: smaller, tidier records
   ========================================================= */
.sale-list .sale-row { align-items: center; gap: 12px; padding: 11px 0; }
.sale-row .entry-qty { width: 32px; height: 32px; font-size: .8rem; font-weight: 700; }
.sale-row .sr-main b { font-size: .9rem; font-weight: 600; line-height: 1.3; }
.sale-row .sr-main small { display: inline; font-size: .8rem; line-height: 1.5; }
.sale-row .sr-main small + small::before { content: "\00a0\00b7\00a0"; }
.sale-row .sr-total { font-size: .9rem; font-weight: 700; }
.sale-row .sr-side { gap: 6px; }
.sale-row .row-actions { gap: 6px; }
.sale-row .btn-act { width: 30px; min-height: 30px; padding: 0; justify-content: center; border-radius: 8px; }
.sale-row .btn-act svg { width: 15px; height: 15px; }
.sale-row .edited-pill { font-size: .72rem; padding: 1px 7px; }
.sale-row .tag { font-size: .72rem; margin-top: 3px; }
@media (min-width: 1100px) {
  .sale-list .sale-row { padding: 10px 0; }
  .sale-row .sr-side { flex-direction: row-reverse; align-items: center; gap: 22px; }
  .sale-row .sr-total { min-width: 96px; text-align: right; }
}

/* =========================================================
   Sales: slim totals strip (follows the filters)
   ========================================================= */
.sum-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-bottom: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--line); }
.sum-strip .ss { min-width: 0; padding: 12px 16px; background: #fff; }
.sum-strip .ss.total { grid-column: 1 / -1; }
.sum-strip small { display: flex; align-items: center; font-size: .72rem; font-weight: 600; color: var(--muted); }
.sum-strip small .dot { width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; }
.sum-strip b { display: block; margin-top: 3px; font-size: 1rem; font-weight: 700; letter-spacing: -.01em; color: var(--text); white-space: nowrap; }
.sum-strip .ss.total b { font-size: 1.2rem; color: #059669; }
.sum-note { margin: -4px 4px 10px; }
@media (min-width: 1100px) {
  .sum-strip { grid-template-columns: 1.35fr 1.1fr 1.1fr .75fr .85fr; margin-bottom: 14px; }
  .sum-strip .ss { padding: 14px 20px; }
  .sum-strip .ss.total { grid-column: auto; }
  .sum-strip .ss.total b { font-size: 1.4rem; }
}

/* =========================================================
   Reports: two columns on big screens, slightly smaller text
   ========================================================= */
.rep-grid .card .rank-line { font-size: .9rem; }
.rep-grid .card .rank { margin-bottom: 12px; }
@media (min-width: 1100px) {
  .rep-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .rep-grid > .card { margin-bottom: 0; }
}
.rep-grid .staff-row { align-items: center; padding: 11px 0; gap: 12px; }
.rep-grid .staff-row .avatar { width: 34px; height: 34px; font-size: .9rem; }
.rep-grid .staff-row .sr-main b { font-size: .9rem; font-weight: 600; }
.rep-grid .staff-row .sr-main small { font-size: .8rem; line-height: 1.5; }
.rep-grid .staff-row .sr-total { font-size: .9rem; font-weight: 700; align-self: flex-start; }
.rep-grid .card-head h3 { font-size: .9rem; }

/* =========================================================
   Type scale (the only text sizes used in the portal)
     11.5px  small labels, tiny badges
     12.8px  secondary text, hints, meta lines
     14.4px  normal text, rows, buttons, chips
     16px    card titles, important values
     19.2px  page and dialog titles
   plus big numbers (KPI, totals)
   ========================================================= */
.card-head h3, .panel h3, .set-head h3, .step-head h3 { font-size: 1rem; font-weight: 600; }
.card-head a { font-size: .9rem; }
@media (min-width: 1100px) {
  input, select, textarea, .qty-btn, .qty-opt { font-size: .9rem; }
  button, .btn { font-size: .9rem; }
  .btn-save, .rc-save { font-size: 1rem; }
  .hdr-tabs .tabs a { font-size: .8rem; padding: 7px 13px; }
  .mf-input input { font-size: 1.45rem; }
}
small { font-size: .8rem; }
.avatar.big { font-size: 1.2rem; }
.mix-legend small { font-size: .8rem; }
.r-total b, .sum-strip .ss.total b { font-size: 1.4rem; }
@media (min-width: 1100px) { .sum-strip .ss.total b { font-size: 1.4rem; } }

/* =========================================================
   Content fills wide screens (small side gap), only very wide
   monitors keep a limit so lines do not become too long
   ========================================================= */
@media (min-width: 1100px) {
  .app-main { padding: 26px max(26px, calc((100% - 2250px) / 2)) 48px; }
  .dash-shell { padding: 24px; }
  .dash-shell .stats { margin-bottom: 18px; }
  .panels, .stats { gap: 18px; }
}

/* chart keeps a sensible size (and sensible text size) inside very wide cards */
@media (min-width: 1100px) {
  .chart svg { max-width: 820px; margin: 0 auto; }
}

/* =========================================================
   Notifications bell
   ========================================================= */
.notif { position: relative; flex: none; }
.nf-btn { position: relative; width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; background: #fff; color: var(--muted); border: 1px solid var(--line); }
.nf-btn svg { width: 20px; height: 20px; }
@media (hover: hover) { .nf-btn:hover { background: var(--primary-soft); color: var(--primary-hover); } }
.nf-btn[aria-expanded=true] { background: var(--primary-soft); color: var(--primary-hover); }
.nf-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #EF4444; color: #fff; font-style: normal; font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center; border: 2px solid #fff; box-sizing: content-box; }
.nf-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 90; width: min(380px, calc(100vw - 24px)); overflow: hidden; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(15,23,42,.16); animation: pop-in .14s ease-out; transform-origin: top right; }
.nf-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.nf-head b { font-size: 1rem; }
.nf-head a { font-size: .8rem; font-weight: 600; text-decoration: none; }
.nf-list { max-height: min(60vh, 420px); overflow-y: auto; }
.nf-item { display: flex; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.nf-item:first-child { border-top: 0; }
.nf-item.new { background: #F3FBF8; }
@media (hover: hover) { .nf-item:hover { background: var(--fill); } }
.nf-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-hover); }
.nf-ic svg { width: 17px; height: 17px; }
.nf-tx { min-width: 0; font-size: .9rem; line-height: 1.35; }
.nf-tx small { display: block; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.nf-tx .nf-when { color: var(--muted-2); font-size: .72rem; margin-top: 2px; }
.nf-empty { margin: 0; padding: 24px 18px; text-align: center; color: var(--muted); font-size: .9rem; }
@media (max-width: 1099px) { .nf-btn { width: 36px; height: 36px; } .nf-btn svg { width: 19px; height: 19px; } .nf-panel { position: fixed; top: calc(var(--appbar-h) + var(--safe-top) + 4px); right: 12px; } }
@media (min-width: 1100px) { .notif { margin-left: 10px; } }

/* =========================================================
   Live sales screen (TV / second screen)
   ========================================================= */
body.live { min-height: 100vh; min-height: 100dvh; background: #042F2B; color: #E6F4F1; padding: 0; }
.lv-wrap { max-width: 1920px; margin: 0 auto; padding: 18px 22px 24px; }
.lv-top { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.lv-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.lv-brand b { display: block; font-size: 1.2rem; font-weight: 700; color: #fff; }
.lv-brand small { font-size: .8rem; color: #8FB3AC; }
.lv-logo { flex: none; width: 56px; height: 46px; object-fit: contain; }
.lv-logo.mark { width: 46px; height: 46px; border-radius: 13px; background: var(--primary); color: #fff; font-size: 1.4rem; }
.lv-status { display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 8px 14px; border-radius: 999px; background: rgba(16,185,129,.14); color: #34D399; font-size: .8rem; letter-spacing: .08em; }
.lv-dot { width: 10px; height: 10px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: lvpulse 2s infinite; }
.lv-dot.off { background: #F59E0B; animation: none; }
.lv-dot.ping { animation: lvping .6s 2; }
@keyframes lvpulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.55); } 70% { box-shadow: 0 0 0 10px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
@keyframes lvping { 50% { transform: scale(1.8); } }
.lv-clock { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; color: #fff; font-variant-numeric: tabular-nums; }
.lv-tools { display: flex; gap: 8px; }
.lv-tools button, .lv-exit { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #CFE6E1; font-size: .8rem; font-weight: 600; text-decoration: none; }
.lv-tools button[aria-pressed=true] { background: rgba(16,185,129,.2); color: #34D399; border-color: rgba(52,211,153,.4); }
@media (hover: hover) { .lv-tools button:hover, .lv-exit:hover { background: rgba(255,255,255,.12); color: #fff; } }
.lv-tools svg { width: 17px; height: 17px; }

.lv-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; align-items: start; }
.lv-left { display: grid; gap: 18px; }
.lv-hero { padding: 26px 28px; border-radius: 22px; background: linear-gradient(135deg, #10B981, #059669); color: #fff; box-shadow: 0 14px 36px rgba(0,0,0,.25); }
.lv-hero small { display: block; font-size: .72rem; font-weight: 600; letter-spacing: .12em; opacity: .85; }
.lv-hero b { display: block; margin: 8px 0 6px; font-size: calc(clamp(2.6rem, 5vw, 4.6rem) * var(--hs, 1)); font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.lv-hero span { font-size: .9rem; opacity: .9; }
.lv-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.lv-kpi, .lv-staff, .lv-feed { border-radius: 20px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.lv-kpi { padding: 20px 22px; }
.lv-kpi small { display: flex; align-items: center; font-size: .8rem; font-weight: 600; color: #9BC1BA; }
.lv-kpi small .dot { width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; }
.lv-kpi b { display: block; margin: 8px 0 12px; font-size: clamp(1.4rem, 2.2vw, 2rem); font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.lv-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.lv-bar i { display: block; height: 100%; border-radius: 99px; transition: width .6s ease; }
.lv-kpi.cash .lv-bar i { background: #F59E0B; }
.lv-kpi.online .lv-bar i { background: #3B82F6; }
.lv-bar.thin { height: 5px; margin-top: 6px; }
.lv-bar.thin i { background: #34D399; }
.lv-staff { padding: 20px 22px; }
.lv-staff h3, .lv-feed-head h3 { margin: 0 0 14px; font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #8FB3AC; }
.lv-st { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.07); }
.lv-st:first-child { border-top: 0; padding-top: 0; }
.lv-st > div { flex: 1; min-width: 0; }
.lv-st b { color: #fff; font-weight: 600; }
.lv-st small { display: block; color: #8FB3AC; font-size: .8rem; }
.lv-st .lv-amt { flex: none; font-size: 1rem; font-variant-numeric: tabular-nums; }
.lv-av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(16,185,129,.2); color: #34D399; font-weight: 700; }
.lv-muted { margin: 0; color: #8FB3AC; font-size: .9rem; }

.lv-feed { padding: 20px 22px; }
.lv-feed-head { display: flex; align-items: baseline; justify-content: space-between; }
.lv-feed-head span { font-size: .8rem; color: #8FB3AC; }
.lv-list { display: grid; gap: 8px; }
.lv-sale { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid transparent; }
.lv-sale.fresh { animation: lvin .6s ease-out, lvglow 2.4s ease-out; }
@keyframes lvin { from { opacity: 0; transform: translateY(-14px) scale(.98); } }
@keyframes lvglow { 0% { background: rgba(52,211,153,.35); border-color: rgba(52,211,153,.7); } 100% { background: rgba(255,255,255,.05); border-color: transparent; } }
.lv-qty { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(16,185,129,.2); color: #34D399; font-size: 1.05rem; font-weight: 700; }
.lv-main { flex: 1; min-width: 0; }
.lv-main b { display: block; font-size: 1.1rem; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-main small, .lv-side small { display: block; font-size: .8rem; color: #8FB3AC; }
.lv-side { flex: none; text-align: right; }
.lv-side b { display: block; font-size: 1.3rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.lv-empty { margin: 30px 0; text-align: center; color: #8FB3AC; }

@media (max-width: 1000px) {
  .lv-wrap { padding: 14px 14px 22px; }
  .lv-top { flex-wrap: wrap; gap: 12px; }
  .lv-status { margin-left: 0; }
  .lv-clock { margin-left: auto; font-size: 1.4rem; }
  .lv-tools { width: 100%; }
  .lv-tools span { display: none; }
  .lv-tools .lv-exit span { display: inline; }
  .lv-grid { grid-template-columns: 1fr; }
}
body.live.is-full .lv-exit { display: none; }
.lv-st .lv-amt { min-width: 104px; text-align: right; }

/* =========================================================
   TV: code screen, connected-TV list, and a Live layout that fits one screen without scrolling
   ========================================================= */
.tv-steps { margin: 0 0 14px; padding-left: 20px; color: var(--muted); font-size: .9rem; }
.tv-steps li { margin: 4px 0; }
.tv-url { color: var(--text); word-break: break-all; }
.tv-link-row { display: grid; grid-template-columns: 1fr; gap: 0 12px; margin-bottom: 4px; }
@media (min-width: 700px) { .tv-link-row { grid-template-columns: 1fr 1.4fr; } }
#tvCodeIn { font-size: 1.2rem; font-weight: 700; letter-spacing: .2em; text-align: center; }
.tv-list-label { margin-top: 20px; }
.tv-list { display: grid; gap: 10px; }
.tv-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--fill); border: 1px solid var(--line); }
.tv-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #CBD5E1; }
.tv-dot.on { background: #10B981; box-shadow: 0 0 0 4px rgba(16,185,129,.18); }
.tv-info { flex: 1; min-width: 0; }
.tv-info b { display: block; }
.tv-info small { color: var(--muted); }
.tv-all { margin-top: 12px; }
.tv-foot { margin-top: 16px; }

body.tv { overflow: hidden; }
.tv-pair { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.tv-pair-card { width: min(900px, 100%); }
.tv-pair-card h1 { margin: 14px 0 6px; font-size: clamp(1.6rem, 4vw, 2.6rem); color: #fff; }
.tv-logo { width: min(240px, 50vw); height: 120px; object-fit: contain; }
.tv-logo.mark { width: 96px; height: 96px; border-radius: 26px; font-size: 3rem; background: var(--primary); color: #fff; }
.tv-lead { margin: 22px auto 26px; max-width: 700px; font-size: clamp(1rem, 2.2vw, 1.5rem); line-height: 1.5; color: #B7D3CD; }
.tv-lead b { color: #fff; }
.tv-code { display: inline-block; padding: 18px 44px; border-radius: 24px; background: rgba(255,255,255,.07); border: 2px solid rgba(52,211,153,.5);
  font-size: clamp(3rem, 12vw, 8rem); font-weight: 800; letter-spacing: .12em; color: #34D399; font-variant-numeric: tabular-nums; }
.tv-note { margin: 22px 0 0; font-size: clamp(.9rem, 1.8vw, 1.2rem); color: #8FB3AC; }

/* Live layout: everything fits one screen, no scrolling; exactly 10 rows. Used by the TV and the admin Live page on big screens. */
@media (min-width: 1000px) {
  body.fit { overflow: hidden; }
  body.fit .lv-wrap { height: 100vh; padding: 1.6vh 1.6vw; display: flex; flex-direction: column; max-width: none; }
  body.fit .lv-top { flex: none; margin-bottom: 1.4vh; }
  body.fit .lv-clock { font-size: clamp(1.4rem, 4vh, 2.6rem); }
  body.fit .lv-brand b { font-size: clamp(1rem, 3vh, 1.8rem); }
  body.fit .lv-logo { height: 6vh; width: auto; max-width: 14vh; }
  body.fit .lv-grid { flex: 1; min-height: 0; align-items: stretch; gap: 1.6vw; }
  body.fit .lv-left { min-height: 0; grid-template-rows: auto auto minmax(0, 1fr); gap: 1.4vh; }
  body.fit .lv-hero { padding: 2.4vh 1.8vw; }
  body.fit .lv-hero b { font-size: calc(clamp(2.2rem, 11vh, 6rem) * var(--hs, 1)); margin: .8vh 0; }
  body.fit .lv-two { gap: 1.4vw; }
  body.fit .lv-kpi { padding: 1.8vh 1.4vw; }
  body.fit .lv-kpi b { font-size: clamp(1.2rem, 4.6vh, 2.6rem); margin: .8vh 0 1.2vh; }
  body.fit .lv-staff { padding: 1.8vh 1.4vw; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
  body.fit .lv-staff h3 { margin-bottom: 1vh; }
  body.fit #staffBox { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-start; gap: 1.2vh; overflow: hidden; }
  body.fit .lv-st { padding: .6vh 0; gap: 1vw; }
  body.fit .lv-av { width: 4.6vh; height: 4.6vh; font-size: 2vh; }
  body.fit .lv-st b { font-size: clamp(.9rem, 2.2vh, 1.4rem); }
  body.fit .lv-st small { font-size: clamp(.7rem, 1.7vh, 1rem); }
  body.fit .lv-st .lv-amt { font-size: clamp(.9rem, 2.2vh, 1.4rem); }
  body.fit .lv-feed { min-height: 0; padding: 1.8vh 1.4vw; display: flex; flex-direction: column; }
  body.fit .lv-feed-head h3 { margin-bottom: 1.2vh; }
  body.fit .lv-list { flex: 1; min-height: 0; grid-template-rows: repeat(10, minmax(0, 1fr)); gap: .8vh; overflow: hidden; }
  body.fit .lv-sale { padding: 0 1.2vw; min-height: 0; gap: 1.2vw; }
  body.fit .lv-qty { width: 5vh; height: 5vh; font-size: 2.2vh; }
  body.fit .lv-main b { font-size: clamp(.9rem, 2.6vh, 1.6rem); }
  body.fit .lv-main small, body.fit .lv-side small { font-size: clamp(.65rem, 1.7vh, 1rem); }
  body.fit .lv-side b { font-size: clamp(1rem, 3vh, 1.9rem); }
  body.fit .lv-empty { margin: 4vh 0; font-size: 2.2vh; }
}
/* very short windows: smaller text so the 10 rows still fit */
@media (min-width: 1000px) and (max-height: 580px) {
  body.fit .lv-main b { font-size: 1.7vh; }
  body.fit .lv-main small, body.fit .lv-side small { font-size: 1.35vh; }
  body.fit .lv-side b { font-size: 2.2vh; }
  body.fit .lv-qty { width: 4vh; height: 4vh; font-size: 1.8vh; }
  body.fit .lv-sale { gap: 1vw; }
}

/* Live: cash vs online donut card, and a lighter (smaller) latest-sales list */
.lv-pay { display: flex; align-items: center; gap: 22px; padding: 18px 22px; border-radius: 20px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.lv-donut { flex: none; width: 150px; height: 150px; }
.lv-donut svg { display: block; width: 100%; height: 100%; }
.lv-dn-big { font-size: 22px; font-weight: 800; fill: #fff; font-family: inherit; }
.lv-dn-small { font-size: 11px; fill: #8FB3AC; font-family: inherit; }
.lv-legend { flex: 1; min-width: 0; display: grid; gap: 14px; }
.lv-lg small { display: flex; align-items: center; font-size: .8rem; font-weight: 600; color: #9BC1BA; }
.lv-lg small .dot { width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; }
.lv-lg small em { margin-left: 8px; font-style: normal; font-weight: 700; color: #fff; }
.lv-lg b { display: block; margin-top: 2px; font-size: 1.35rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.lv-sale { padding: 10px 14px; gap: 12px; border-radius: 12px; }
.lv-qty { width: 34px; height: 34px; font-size: .9rem; }
.lv-main b { font-size: .95rem; font-weight: 600; }
.lv-main small, .lv-side small { font-size: .74rem; }
.lv-side b { font-size: 1.02rem; font-weight: 700; }
.lv-list { gap: 6px; }
@media (min-width: 1000px) {
  body.fit .lv-pay { padding: 1.6vh 1.4vw; gap: 1.4vw; }
  body.fit .lv-donut { width: min(17vh, 12vw); height: min(17vh, 12vw); }
  body.fit .lv-legend { gap: 1.6vh; }
  body.fit .lv-lg b { font-size: clamp(1.1rem, 3.4vh, 2rem); }
  body.fit .lv-lg small { font-size: clamp(.7rem, 1.7vh, 1rem); }
  body.fit .lv-sale { padding: 0 1vw; gap: 1vw; border-radius: 12px; }
  body.fit .lv-qty { width: 4.2vh; height: 4.2vh; font-size: 1.9vh; }
  body.fit .lv-main b { font-size: clamp(.8rem, 2.1vh, 1.2rem); }
  body.fit .lv-main small, body.fit .lv-side small { font-size: clamp(.62rem, 1.45vh, .85rem); }
  body.fit .lv-side b { font-size: clamp(.9rem, 2.4vh, 1.4rem); }
  body.fit .lv-list { gap: .6vh; }
  body.fit .lv-left { grid-template-rows: auto auto minmax(0, 1fr); }
}
@media (max-width: 520px) { .lv-donut { width: 112px; height: 112px; } .lv-pay { gap: 14px; padding: 14px 16px; } }

/* TV: "press OK for sound" hint */
.lv-hint { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(245,158,11,.16); color: #FBBF24; font-size: .8rem; font-weight: 600; animation: lvhint 2s ease-in-out infinite; }
.lv-hint svg { width: 17px; height: 17px; }
.lv-hint[hidden] { display: none; }
@keyframes lvhint { 50% { opacity: .55; } }
body.fit .lv-hint { font-size: clamp(.7rem, 1.8vh, 1rem); }

/* =========================================================
   Smooth motion: Live screen and dashboard charts
   ========================================================= */
/* Live: numbers give a small bump when they change, rows glide, rings and bars slide */
@keyframes lvbump { 0% { transform: scale(1); } 35% { transform: scale(1.06); } 100% { transform: scale(1); } }
b.lv-bump, em.lv-bump { display: inline-block; transform-origin: left center; animation: lvbump .55s ease-out; }
.lv-hero b.lv-bump { display: block; }
.lv-donut circle { transition: stroke-dasharray .9s cubic-bezier(.22,1,.36,1), stroke-dashoffset .9s cubic-bezier(.22,1,.36,1); }
.lv-bar i { transition: width .9s cubic-bezier(.22,1,.36,1); }
.lv-sale, .lv-st { will-change: transform; }
.lv-sale.intro { animation: lvin .65s cubic-bezier(.22,1,.36,1) backwards; }
.lv-sale.fresh { animation: lvin .7s cubic-bezier(.22,1,.36,1), lvglow 2.6s ease-out; }
@keyframes lvin { from { opacity: 0; transform: translateY(-22px) scale(.97); } to { opacity: 1; transform: none; } }

/* Dashboard: charts draw themselves when the page opens */
@keyframes gbar { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes gtrack { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes gpop { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: none; } }
@keyframes gfade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.chart g.bar rect:not(.hit) { transform-box: fill-box; transform-origin: bottom center; animation: gbar .75s cubic-bezier(.22,1,.36,1) both; }
.chart g.bar:nth-of-type(1) rect:not(.hit) { animation-delay: 88ms; }
.chart g.bar:nth-of-type(2) rect:not(.hit) { animation-delay: 116ms; }
.chart g.bar:nth-of-type(3) rect:not(.hit) { animation-delay: 144ms; }
.chart g.bar:nth-of-type(4) rect:not(.hit) { animation-delay: 172ms; }
.chart g.bar:nth-of-type(5) rect:not(.hit) { animation-delay: 200ms; }
.chart g.bar:nth-of-type(6) rect:not(.hit) { animation-delay: 228ms; }
.chart g.bar:nth-of-type(7) rect:not(.hit) { animation-delay: 256ms; }
.chart g.bar:nth-of-type(8) rect:not(.hit) { animation-delay: 284ms; }
.chart g.bar:nth-of-type(9) rect:not(.hit) { animation-delay: 312ms; }
.chart g.bar:nth-of-type(10) rect:not(.hit) { animation-delay: 340ms; }
.chart g.bar:nth-of-type(11) rect:not(.hit) { animation-delay: 368ms; }
.chart g.bar:nth-of-type(12) rect:not(.hit) { animation-delay: 396ms; }
.chart g.bar:nth-of-type(13) rect:not(.hit) { animation-delay: 424ms; }
.chart g.bar:nth-of-type(14) rect:not(.hit) { animation-delay: 452ms; }
.chart g.bar:nth-of-type(15) rect:not(.hit) { animation-delay: 480ms; }
.chart g.bar:nth-of-type(16) rect:not(.hit) { animation-delay: 508ms; }
.chart g.bar:nth-of-type(17) rect:not(.hit) { animation-delay: 536ms; }
.chart g.bar:nth-of-type(18) rect:not(.hit) { animation-delay: 564ms; }
.chart g.bar:nth-of-type(19) rect:not(.hit) { animation-delay: 592ms; }
.chart g.bar:nth-of-type(20) rect:not(.hit) { animation-delay: 620ms; }
.chart g.bar:nth-of-type(21) rect:not(.hit) { animation-delay: 648ms; }
.chart g.bar:nth-of-type(22) rect:not(.hit) { animation-delay: 676ms; }
.chart g.bar:nth-of-type(23) rect:not(.hit) { animation-delay: 704ms; }
.chart g.bar:nth-of-type(24) rect:not(.hit) { animation-delay: 732ms; }
.chart g.bar:nth-of-type(25) rect:not(.hit) { animation-delay: 760ms; }
.chart g.bar:nth-of-type(26) rect:not(.hit) { animation-delay: 788ms; }
.chart g.bar:nth-of-type(27) rect:not(.hit) { animation-delay: 816ms; }
.chart g.bar:nth-of-type(28) rect:not(.hit) { animation-delay: 844ms; }
.chart g.bar:nth-of-type(29) rect:not(.hit) { animation-delay: 872ms; }
.chart g.bar:nth-of-type(30) rect:not(.hit) { animation-delay: 900ms; }
.chart g.bar:nth-of-type(31) rect:not(.hit) { animation-delay: 928ms; }
.track div { transform-origin: left center; animation: gtrack .9s cubic-bezier(.22,1,.36,1) .15s both; }
.rank:nth-child(2) .track div { animation-delay: .22s; } .rank:nth-child(3) .track div { animation-delay: .29s; }
.rank:nth-child(4) .track div { animation-delay: .36s; } .rank:nth-child(5) .track div { animation-delay: .43s; }
.donut { animation: gpop .8s cubic-bezier(.22,1,.36,1) both; }
.stat { animation: gfade .55s cubic-bezier(.22,1,.36,1) backwards; }
.stats .stat:nth-child(2) { animation-delay: .06s; } .stats .stat:nth-child(3) { animation-delay: .12s; } .stats .stat:nth-child(4) { animation-delay: .18s; }
@media (prefers-reduced-motion: reduce) {
  .lv-donut circle, .lv-bar i { transition: none; }
  .lv-sale.intro, .lv-sale.fresh, .chart g.bar rect, .track div, .donut, .stat, b.lv-bump, em.lv-bump { animation: none !important; }
}

/* phones: half-width KPI cards keep the full amount (no "..." cut) */
@media (max-width: 480px) {
  .stats .stat:not(:first-child) { padding: 16px 14px; }
  .stats .stat:not(:first-child) b { font-size: clamp(.95rem, 4.2vw, 1.15rem); letter-spacing: -.03em; }
}

/* phones: Add Sale fits one screen, no scrolling (the Save bar already shows the total) */
@media (max-width: 1099px) {
  .sale-page .receipt { display: none; }
  .sale-page { padding-bottom: 8px; }
  .sale-form { padding: 14px 16px; }
  .sale-form .step { padding: 10px 0; }
  .sale-form .step-head { margin-bottom: 10px; }
  .sale-form .step-no { width: 28px; height: 28px; font-size: .85rem; }
  .sale-form .chips { flex-wrap: nowrap; overflow-x: auto; margin: 10px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
  .sale-form .chips::-webkit-scrollbar { display: none; }
  .sale-form .chip { flex: none; }
  .sale-form .money-field { padding: 10px 12px; }
  .sale-form .mf-top { margin-bottom: 2px; }
}

/* ===== Add Sale, phone-first: tap-to-pick type, stepper, one amount box ===== */
.sale-form .blk { padding: 0; }
.sale-form .blk + .blk { margin-top: 14px; }
.blk-label { margin-bottom: 8px; font-size: .8rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pt { min-height: 46px; padding: 0 6px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--text);
      font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .15s, border-color .15s, color .15s, transform .1s; }
.pt:active { transform: scale(.96); }
.pt.on { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(16,185,129,.28); }
.pt.other { border-style: dashed; color: var(--muted); font-weight: 500; }
.pt.other.on { border-style: solid; color: #fff; font-weight: 600; }
.other-box { margin-top: 8px; }
.other-box input { width: 100%; }
.qty-blk { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qty-blk .blk-label { margin: 0; font-size: .9rem; color: var(--text); font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; }
.stepper b { min-width: 46px; text-align: center; font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.st-btn { width: 46px; height: 42px; padding: 0; border: 0; border-radius: 10px; background: var(--primary-soft); color: var(--primary-dark); font-size: 1.5rem; font-weight: 600; line-height: 1; }
.st-btn:active { transform: scale(.92); }
.st-btn:disabled { opacity: .35; }
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: #EEF3F1; }
.seg3 button { min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; font-size: .9rem; transition: background .15s, color .15s; }
.seg3 button.on { background: #fff; color: var(--primary-dark); box-shadow: 0 1px 5px rgba(15,23,42,.12); }
.money-field.one { margin-top: 10px; padding: 8px 14px; }
.money-field.one .mf-input > span { font-size: 1rem; }
.money-field.one .mf-input input { font-size: 1.7rem; font-weight: 700; padding: 4px 0; }
#bothBox { margin-top: 10px; }
.btn-save:disabled { opacity: .45; box-shadow: none; }
.page-head .d-today { display: none; }
.d-today b { color: var(--text); font-weight: 600; }
.last-saved.just .ls-icon { animation: lspop .5s cubic-bezier(.22,1,.36,1); }
@keyframes lspop { 0% { transform: scale(.3); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .last-saved.just .ls-icon { animation: none; } }
@media (min-width: 1100px) { .types { grid-template-columns: repeat(4, minmax(0, 1fr)); } .pt { min-height: 50px; } }
@media (max-width: 1099px) {
  /* today's total replaces the date line on phones; earlier "fit one screen" block hid the whole header */
  .sale-page .page-head { display: block; margin-bottom: 8px; }
  .page-head .d-date { display: none; }
  .page-head .d-today { display: inline; }
  .sale-page .page-head .sub { font-size: .85rem; }
  .sale-form { padding: 14px 16px; }
}

/* ===== Add Sale wizard: one question per screen, calm and big ===== */
.sale-form.wizard { padding: 4px 2px 0; border: 0; background: transparent; box-shadow: none; }
.wz { animation: wzin .28s cubic-bezier(.22,1,.36,1); }
.wz[hidden] { display: none; }
@keyframes wzin { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.wz h2 { margin: 6px 0 16px; font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.wz-prog { display: flex; gap: 6px; margin: 2px 0 12px; }
.wz-prog i { flex: 1; height: 4px; border-radius: 4px; background: #DCE6E2; transition: background .25s; }
.wz-prog i.on { background: var(--primary); }
.wz-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.wz-chip { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: .9rem; font-weight: 600; }
.wz-chip[hidden] { display: none; }
.wizard .types { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wizard .pt { min-height: 64px; border-radius: 16px; font-size: 1.05rem; border-width: 1.5px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.wizard .pt.other { border-style: dashed; box-shadow: none; }
.nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.qn { min-height: 64px; padding: 0; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; color: var(--text); font-size: 1.4rem; font-weight: 700; box-shadow: 0 1px 2px rgba(15,23,42,.04); transition: background .15s, color .15s, transform .1s; }
.qn:active { transform: scale(.95); }
.qn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.qn.more { grid-column: span 4; min-height: 52px; border-style: dashed; box-shadow: none; color: var(--muted); font-size: .95rem; font-weight: 500; }
.more-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.wz-next { min-height: 48px; padding: 0 26px; border: 0; border-radius: 14px; background: var(--primary); color: #fff; font-size: 1rem; font-weight: 700; }
.more-box[hidden], .other-box[hidden] { display: none; }
.other-box { display: flex; gap: 10px; margin-top: 12px; }
.other-box input { flex: 1; min-width: 0; min-height: 48px; }
.wizard .seg3 { margin-bottom: 0; }
.wizard .money-field.one { margin-top: 14px; padding: 12px 16px; border-radius: 18px; }
.wizard .money-field.one .mf-input input { font-size: 2.3rem; font-weight: 700; padding: 2px 0; }
.wizard .money-field.one .mf-input > span { font-size: 1.2rem; }
.sale-page:not([data-step="3"]) .save-bar { display: none; }
.sale-page:not([data-step="3"]) { padding-bottom: 12px; }
@media (min-width: 1100px) {
  .wizard .types { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sale-page[data-step] .save-bar { display: none; }
}
@media (prefers-reduced-motion: reduce) { .wz { animation: none; } }

.stepper input { width: 84px; min-height: 42px; padding: 0; border: 0; background: transparent; text-align: center; font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; }

.qty-err { margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--red-soft, #FEF2F2); color: #B42318; font-size: .9rem; font-weight: 600; }
.qty-err[hidden] { display: none; }
.stepper:has(input.bad) { border-color: #F04438; }
.stepper input.bad { color: #B42318; }

/* ===== Add Sale polish: coloured saree badges, keypad, "Sale saved" screen ===== */
.wz-step { margin: 0 0 6px; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-dark); }
.wz h2 { margin: 4px 0 4px; }
.wz-hint { margin: 0 0 16px; color: var(--muted); font-size: .92rem; }
.wizard .pt { display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 0 12px; text-align: left; }
.wizard .pt span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pb { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-style: normal; font-size: .95rem; font-weight: 700; }
.pb.c0 { background: #DCFCE7; color: #15803D; } .pb.c1 { background: #FEF3C7; color: #B45309; } .pb.c2 { background: #DBEAFE; color: #1D4ED8; }
.pb.c3 { background: #FCE7F3; color: #BE185D; } .pb.c4 { background: #EDE9FE; color: #6D28D9; } .pb.c5 { background: #CCFBF1; color: #0F766E; }
.pb.o { background: #F1F5F9; color: var(--muted); font-size: 1.3rem; font-weight: 500; }
.pt.on .pb { background: rgba(255,255,255,.25); color: #fff; }
.qn { border-radius: 18px; }
.money-field.one.act, .money-field.act { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.money-field.one.online.act { border-color: #3B82F6; box-shadow: 0 0 0 3px #DBEAFE; }
.seg3 button.on[data-mode="cash"] { color: #B45309; } .seg3 button.on[data-mode="online"] { color: #1D4ED8; } .seg3 button.on[data-mode="both"] { color: var(--primary-dark); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.keypad button { min-height: 54px; padding: 0; border: 0; border-radius: 14px; background: #fff; color: var(--text); font-size: 1.4rem; font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,.08), inset 0 0 0 1px var(--line); transition: background .1s, transform .08s; }
.keypad button:active { background: var(--primary-soft); transform: scale(.95); }
.keypad button[data-k="back"], .keypad button[data-k="00"] { background: #F1F5F9; color: var(--muted); font-size: 1.15rem; }
@media (max-height: 720px) { .keypad button { min-height: 46px; } .keypad { gap: 6px; margin-top: 10px; } .wz-hint { margin-bottom: 10px; } }
@media (min-width: 1100px) and (pointer: fine) { .keypad { display: none; } }
.done-ov { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(6,59,54,.55); backdrop-filter: blur(4px); animation: dovin .25s ease; }
.done-ov.out { opacity: 0; transition: opacity .25s; }
@keyframes dovin { from { opacity: 0; } to { opacity: 1; } }
.done-card { width: min(340px, 100%); padding: 28px 24px 20px; border-radius: 26px; background: #fff; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.3); animation: dcard .45s cubic-bezier(.22,1,.36,1); }
@keyframes dcard { from { transform: translateY(24px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.done-tick { width: 84px; height: 84px; }
.done-tick circle { fill: #10B981; transform-origin: center; animation: dpop .5s cubic-bezier(.22,1,.36,1); }
.done-tick path { fill: none; stroke: #fff; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: ddraw .45s .25s ease forwards; }
@keyframes dpop { from { transform: scale(.3); } to { transform: scale(1); } }
@keyframes ddraw { to { stroke-dashoffset: 0; } }
.done-card h3 { margin: 12px 0 2px; font-size: 1.4rem; font-weight: 700; }
.done-card p { margin: 0; color: var(--muted); font-size: 1rem; }
.done-card b { display: block; margin: 6px 0 18px; font-size: 2rem; font-weight: 800; letter-spacing: -.02em; color: var(--primary-dark); }
.done-new { width: 100%; min-height: 52px; border: 0; border-radius: 14px; background: var(--primary); color: #fff; font-size: 1.05rem; font-weight: 700; }
.done-fix { display: block; margin-top: 12px; color: var(--muted); font-size: .9rem; text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .done-ov, .done-card, .done-tick circle, .done-tick path { animation: none; } .done-tick path { stroke-dashoffset: 0; } }

/* step 3 must show the whole keypad above the Save bar, also on shorter phones */
.sale-page[data-step="3"] .wz-hint { display: none; }
.sale-page[data-step="3"] .wz h2 { font-size: 1.35rem; margin-bottom: 10px; }
.sale-page[data-step="3"] .money-field.one { margin-top: 10px; padding: 6px 16px; }
.sale-page[data-step="3"] .money-field.one .mf-input input { font-size: 2rem; }
.keypad button { min-height: clamp(40px, 6.2vh, 54px); }
.keypad { margin-top: 10px; gap: 6px; }
@media (max-height: 760px) and (max-width: 1099px) {
  .sale-page[data-step="3"] .page-head, .sale-page[data-step="3"] .wz-step { display: none; }
  .sale-page[data-step="3"] .wz-prog { margin-bottom: 8px; }
  .sale-page[data-step="3"] .wz-chips { margin-bottom: 0; }
  .sale-page[data-step="3"] .wz h2 { font-size: 1.15rem; margin: 6px 0 8px; }
  .sale-page[data-step="3"] .seg3 button { min-height: 36px; }
  .sale-page[data-step="3"] .money-field.one .mf-input input { font-size: 1.7rem; }
  .keypad button { min-height: clamp(34px, 5.6vh, 54px); font-size: 1.25rem; }
  .keypad { gap: 5px; margin-top: 8px; }
}

/* staff cards: a very large month total wraps instead of pushing the card wider than the screen */
.sc-stats { grid-template-columns: minmax(0, 1.6fr) auto auto; }
.sc-stats > div { min-width: 0; }
.sc-stats b { white-space: normal; overflow-wrap: anywhere; }

/* Live/TV: any number of staff (up to 5) shares the box height, so nobody is cut off on a short screen */
@media (min-width: 1000px) {
  body.fit #staffBox { gap: 0; }
  body.fit .lv-st { flex: 1 1 0; min-height: 0; max-height: 14vh; padding: 0; overflow: hidden; }
}

/* Live/TV on shorter screens: each staff member is one line (name, then sales and pieces), so five fit */
@media (min-width: 1000px) and (max-height: 820px) {
  body.fit .lv-st > div { display: flex; align-items: baseline; gap: .6em; white-space: nowrap; overflow: hidden; line-height: 1.1; }
  body.fit .lv-st b { flex: none; max-width: 62%; overflow: hidden; text-overflow: ellipsis; font-size: clamp(.8rem, 2vh, 1.15rem); }
  body.fit .lv-st small { display: inline; overflow: hidden; text-overflow: ellipsis; font-size: clamp(.62rem, 1.5vh, .85rem); }
  body.fit .lv-st .lv-amt { font-size: clamp(.8rem, 2vh, 1.15rem); line-height: 1.1; }
}

/* Add Sale step 1: three big choices, then the detail */
.types.groups { grid-template-columns: 1fr; gap: 12px; }
.pt.big { min-height: 76px; font-size: 1.2rem; }
.pt.big .pb { width: 44px; height: 44px; font-size: 1.2rem; border-radius: 14px; }
.pane[hidden] { display: none; }
.pane-back { margin: 0 0 8px; padding: 6px 10px 6px 4px; border: 0; background: transparent; color: var(--primary-dark); font-size: .95rem; font-weight: 600; }
.pane-title { margin: 0 0 12px; font-size: 1.15rem; font-weight: 700; }
.pane-title .opt { color: var(--muted); font-weight: 500; font-size: .9rem; }

/* staff: only the Add Sale page, so no bottom bar and no side menu */
body.solo { --tabbar-h: 0px; --side-w: 0px; }
body.solo .tabbar { display: none; }

.login-forgot { margin: 4px 0 0; text-align: center; font-size: .9rem; }
.login-forgot a, .login-box a { color: var(--primary-dark); }
.btn-link { padding: 4px 0; border: 0; background: transparent; color: var(--primary-dark); font-size: .9rem; text-decoration: underline; min-height: 0; width: auto; box-shadow: none; }

/* Login, Forgot password: always one screen on a phone, no scrolling (even on the shortest phones) */
@media (max-height: 760px) {
  .auth-brand { padding-bottom: 12px; }
  .auth-logo { width: 150px; height: 84px; }
  .auth-logo.mark { width: 60px; height: 60px; font-size: 1.9rem; border-radius: 18px; }
  .auth-brand h1 { margin: 6px 0 0; font-size: 1.25rem; }
  .login-box { padding: 16px 18px calc(16px + var(--safe-bottom)); }
  .login-box h1 { margin-bottom: 2px; font-size: 1.1rem; }
  .login-box label { margin-top: 6px; font-size: .85rem; }
  .login-box input { min-height: 42px; }
  .login-box p { margin: 6px 0; }
  .login-box .muted, .login-box .hint { font-size: .82rem; line-height: 1.3; }
  .login-box button { margin-top: 4px; min-height: 44px; }
  .login-box .flash { margin: 4px 0; padding: 8px 10px; font-size: .85rem; }
}
@media (max-height: 600px) {
  .auth-brand p, .auth-logo { display: none; }
  .auth-brand h1 { margin: 0; }
  .auth-brand { padding: 0 16px 8px; }
  .auth-main { padding-top: 8px; }
}

/* Forgot password has more fields: the big logo gives way so it still fits one screen */
@media (max-height: 900px) {
  .auth-main:has(.forgot-box) .auth-logo, .auth-main:has(.forgot-box) .auth-brand p { display: none; }
  .auth-main:has(.forgot-box) .auth-brand { padding: 0 16px 10px; }
  .auth-main:has(.forgot-box) .auth-brand h1 { margin: 0; font-size: 1.15rem; }
}
@media (max-height: 700px) {
  .forgot-box .hint { display: none; }
  .forgot-box .btn-link { font-size: .82rem; }
}

/* ===== Login / Forgot password: polished look ===== */
body.auth { background: radial-gradient(120% 70% at 50% 0%, #0F7A63 0%, #0A4F45 38%, #063B36 72%, #052E2A 100%); }
.auth-main { max-width: 440px; }
.auth-brand { position: relative; }
.auth-brand::before { content: ""; position: absolute; width: 260px; height: 260px; top: 50%; left: 50%; transform: translate(-50%, -58%); border-radius: 50%;
  background: radial-gradient(circle, rgba(52,211,153,.28), rgba(52,211,153,0) 68%); pointer-events: none; }
.auth-brand > * { position: relative; }
img.auth-logo { width: 190px; height: 112px; filter: drop-shadow(0 10px 24px rgba(0,0,0,.35)); }
.auth-brand h1 { font-size: 1.55rem; letter-spacing: -.01em; }
.auth-brand p { margin-top: 2px; font-size: .9rem; letter-spacing: .12em; text-transform: uppercase; color: #7FD8BE; }
.login-box { background: #fff; border-radius: 30px 30px 0 0; box-shadow: 0 -14px 40px rgba(0,0,0,.28); animation: lbrise .5s cubic-bezier(.22,1,.36,1); }
@keyframes lbrise { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.login-box h1 { margin: 0; font-size: 1.4rem; letter-spacing: -.01em; }
.login-sub { margin: 2px 0 6px !important; color: var(--muted); font-size: .92rem; }
.login-box label { margin: 12px 0 6px; font-size: .82rem; font-weight: 600; color: #3b4a45; }
.ifield { position: relative; }
.ifield .ifi { position: absolute; z-index: 1; left: 14px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; color: #8aa39b; font-size: .85rem; font-weight: 600; pointer-events: none; }
.ifield .ifi svg { width: 18px; height: 18px; }
.login-box input { width: 100%; min-height: 50px; padding: 0 14px 0 44px; border: 1.5px solid #DDE7E3; border-radius: 14px; background: #F6F9F8; font-size: 1rem; transition: border-color .15s, background .15s, box-shadow .15s; }
.ifield:has(.ieye) input { padding-right: 46px; }
#fpPhone { padding-left: 58px; }
.login-box input:focus { outline: none; background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(16,185,129,.16); }
.ieye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; margin: 0 !important; padding: 0; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: #8aa39b; box-shadow: none; }
.ieye svg { width: 20px; height: 20px; }
.ieye.on { color: var(--primary-dark); }
.login-box button:not(.ieye):not(.btn-link) { min-height: 52px; margin-top: 14px; border-radius: 14px; background: linear-gradient(135deg, #10B981, #059669); font-size: 1.02rem; font-weight: 700; box-shadow: 0 8px 20px rgba(16,185,129,.35); }
.login-box button:not(.ieye):not(.btn-link):active { transform: scale(.98); }
.login-forgot { margin: 12px 0 0 !important; }
.login-forgot a { font-weight: 600; text-decoration: none; }
@media (max-height: 760px) {
  img.auth-logo { width: 130px; height: 76px; }
  .auth-brand::before { width: 180px; height: 180px; }
  .login-box h1 { font-size: 1.2rem; }
  .login-sub { margin: 0 0 2px !important; font-size: .85rem; }
  .login-box label { margin: 6px 0 4px; }
  .login-box input { min-height: 44px; }
  .ieye { height: 38px; }
  .login-box button:not(.ieye):not(.btn-link) { min-height: 46px; margin-top: 8px; }
  .login-forgot { margin: 6px 0 0 !important; }
}
@media (max-height: 600px) { .login-sub { display: none; } }
@media (prefers-reduced-motion: reduce) { .login-box { animation: none; } }
.login-box .ieye { width: 42px; left: auto; right: 4px; margin-top: 0; }
.auth-main { overflow: hidden; }

/* the small links under the form: same size, centred, quiet */
.fp-links { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 14px 0 0; }
.fp-links a, .fp-links .btn-link, .login-forgot a { padding: 6px 2px; border: 0; background: transparent; color: var(--primary-dark); font-size: .92rem; font-weight: 600; text-decoration: none; min-height: 0; width: auto; box-shadow: none; cursor: pointer; }
.fp-links form { margin: 0; }
.fp-links > form + a::before { content: ""; display: inline-block; width: 1px; height: 14px; margin-right: 18px; background: #cfdad6; vertical-align: middle; }
@media (max-height: 760px) { .fp-links { margin-top: 8px; } }
.fp-links a, .fp-links .btn-link { display: inline-flex; align-items: center; height: 32px; line-height: 1; font-family: inherit; }

/* Tablets and computers: the card floats in the middle with rounded corners all round (the flat-bottom sheet is only for phones) */
@media (min-width: 600px) {
  .auth-main { justify-content: center; padding: 32px 0; max-width: 460px; }
  .auth-brand { flex: none; padding-bottom: 22px; }
  .login-box { margin: 0 16px; padding: 28px 26px 26px; border-radius: 28px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
}


/* Add Sale step 1: Saree / Kurta, then an optional type box under them, then Next */
.typebox { margin-top: 18px; }
.typebox label { margin: 0 0 6px; font-size: .85rem; font-weight: 600; color: #3b4a45; }
.typebox .opt { color: var(--muted); font-weight: 500; }
.typebox input { width: 100%; min-height: 52px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; font-size: 1.05rem; transition: border-color .15s, box-shadow .15s; }
.typebox input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(16,185,129,.16); }
.wz-go { width: 100%; min-height: 54px; margin-top: 16px; border: 0; border-radius: 14px; background: linear-gradient(135deg, #10B981, #059669); color: #fff; font-size: 1.05rem; font-weight: 700; box-shadow: 0 8px 20px rgba(16,185,129,.3); transition: opacity .15s, transform .1s; }
.wz-go:active { transform: scale(.98); }
.wz-go:disabled { opacity: .4; box-shadow: none; }
.wizard .pt.big.on { box-shadow: 0 6px 16px rgba(16,185,129,.3); }
@media (max-height: 700px) { .typebox { margin-top: 12px; } .typebox input { min-height: 46px; } .wz-go { min-height: 48px; margin-top: 10px; } .pt.big { min-height: 64px; } .types.groups { gap: 8px; } }
