/* Receiptify - clean, flat UI. Palette: #FFDE26 #FF6117 #FF473A #FC3744 #FF0048 (theme.css overrides --brand etc.) */
:root {
  --brand: #FF473A; --accent: #FF6117; --hi: #FFDE26; --danger: #FF0048; --dark: #17151C;
  --brand-soft: #FFF0EE; --brand-deep: #CC3A2F;
  --ok: #12A150; --ok-soft: #E7F6EE; --warn-ink: #8A6A00; --warn-soft: #FFF8D6; --bad-soft: #FFE8EE;
  --ink: #17151C; --muted: #6B6872; --line: #ECEAEF; --bg: #F7F6F9; --card: #FFFFFF;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; --fs: 15px; --r: 10px;
  --shadow: 0 1px 2px rgba(23, 21, 28, .05), 0 4px 16px rgba(23, 21, 28, .04);
  --strip: linear-gradient(90deg, #FFDE26 0 20%, #FF6117 20% 40%, #FF473A 40% 60%, #FC3744 60% 80%, #FF0048 80% 100%);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: var(--fs); line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a.link, .link { color: var(--brand-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; }
p { margin: 0 0 .75em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; }
.ic { width: 18px; height: 18px; flex: none; }
.strip { height: 4px; background: var(--strip); }

/* ---------- helpers ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .xs { font-size: .78rem; } .bold { font-weight: 700; } .semi { font-weight: 600; }
.right { text-align: right; } .center { text-align: center; } .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; } .break { word-break: break-word; }
.mt1 { margin-top: 4px; } .mt2 { margin-top: 8px; } .mt3 { margin-top: 12px; } .mt4 { margin-top: 20px; } .mb2 { margin-bottom: 8px; } .mb3 { margin-bottom: 12px; } .mb4 { margin-bottom: 20px; }
.hide { display: none !important; }
.ok-ink { color: var(--ok); } .bad-ink { color: var(--danger); } .warn-ink { color: var(--warn-ink); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .g12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-hd { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-hd h3 { flex: 1; }
.card-bd { padding: 18px; }
.card-ft { padding: 12px 18px; border-top: 1px solid var(--line); background: #FCFBFD; border-radius: 0 0 var(--r) var(--r); }
.kpi { padding: 16px 18px; }
.kpi .lbl { color: var(--muted); font-size: .8rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 1.5rem; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.kpi .ic { color: var(--brand); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; color: var(--line); margin: 0 auto 8px; display: block; stroke-width: 1.5; color: #C9C5CF; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; min-height: 40px; border-radius: calc(var(--r) - 2px);
  border: 1px solid transparent; background: #F1EFF4; color: var(--ink); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: #fff; border-color: var(--line); }
.btn-outline:hover { border-color: #D5D1DA; background: #FCFBFD; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: #F1EFF4; }
.btn-soft { background: var(--brand-soft); color: var(--brand-deep); }
.btn-wa { background: #1FA855; color: #fff; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
.btn-xs { min-height: 28px; padding: 3px 9px; font-size: .78rem; border-radius: 6px; }
.btn-lg { min-height: 50px; padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn .ic { width: 16px; height: 16px; }

/* ---------- forms ---------- */
label, .lbl { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 5px; color: #3C3943; }
.hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.input, .select, .textarea { width: 100%; padding: 9px 12px; min-height: 40px; border: 1px solid #DCD8E1; border-radius: calc(var(--r) - 2px); background: #fff;
  font: inherit; font-size: .94rem; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.textarea { min-height: 90px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input[readonly] { background: #FAF9FB; }
.field { margin-bottom: 14px; }
.input-ic { position: relative; }
.input-ic .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-ic .input { padding-left: 36px; }
.chk { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; font-size: .9rem; cursor: pointer; margin: 0; }
.chk input { width: 18px; height: 18px; accent-color: var(--brand); margin-top: 2px; flex: none; }
.chks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.seg { display: inline-flex; background: #F1EFF4; border-radius: calc(var(--r) - 2px); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button, .seg label { padding: 6px 12px; border-radius: 7px; font-weight: 600; font-size: .85rem; color: var(--muted); border: 0; background: transparent; cursor: pointer; margin: 0; }
.seg .on, .seg input:checked + span { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.seg input { display: none; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.filters .input, .filters .select { width: auto; min-width: 150px; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 4px; margin: 0 0 16px; }
legend { font-weight: 700; font-size: .9rem; padding: 0 6px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: #F1EFF4; color: var(--muted); white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-ok { background: var(--ok-soft); color: var(--ok); } .b-warn { background: var(--warn-soft); color: var(--warn-ink); }
.b-bad { background: var(--bad-soft); color: var(--danger); } .b-brand { background: var(--brand-soft); color: var(--brand-deep); } .b-dark { background: var(--dark); color: #fff; }
.kra { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .7rem; font-weight: 800; letter-spacing: .03em; white-space: nowrap; }
.kra::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.kra-posted { background: var(--ok-soft); color: var(--ok); }
.kra-pending { background: #FFF6C2; color: #7A5D00; }
.kra-failed { background: var(--bad-soft); color: var(--danger); }
.kra-na { background: #F1EFF4; color: var(--muted); }

/* ---------- alerts / flash ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1px solid transparent; font-size: .9rem; }
.alert .ic { margin-top: 2px; }
.alert-success { background: var(--ok-soft); color: #0B6B35; border-color: #C9EBD7; }
.alert-error { background: var(--bad-soft); color: #B0003A; border-color: #FFC9D7; }
.alert-warn { background: var(--warn-soft); color: #6B5200; border-color: #F7E7A1; }
.alert-info { background: #F1EFF4; color: #3C3943; border-color: var(--line); }
.flash-wrap { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 200; width: min(560px, calc(100% - 24px)); animation: drop .25s ease; }
.flash-wrap .alert { box-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -10px); } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FCFBFD; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FCFBFD; }
.table tr.clickable { cursor: pointer; }
.table .m-only { display: none; }
.pager { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 14px; }

/* ---------- auth / public ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: #fff; }
.auth-box { width: min(420px, 100%); }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.logo-mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 900; background: var(--brand); position: relative; overflow: hidden; }
.logo-mark::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--strip); }
.pub-hd { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.pub-hd .in { max-width: 1120px; margin: 0 auto; padding: 12px 18px; display: flex; align-items: center; gap: 12px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 18px; }
.hero { padding: 64px 0 48px; background: #fff; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 900; letter-spacing: -.035em; line-height: 1.05; }
.hero p.lead { font-size: 1.12rem; color: var(--muted); max-width: 620px; margin: 16px 0 26px; }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #F7F6F9; border: 1px solid var(--line); font-size: .82rem; font-weight: 600; }
.chip .ic { width: 15px; height: 15px; color: var(--brand); }
.section { padding: 56px 0; }
.section h2 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.feature { padding: 20px; }
.feature .fi { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 12px; color: #fff; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: .92rem; margin: 0; }
.swatch-1 { background: #FFDE26; color: var(--ink) !important; } .swatch-2 { background: #FF6117; } .swatch-3 { background: #FF473A; } .swatch-4 { background: #FC3744; } .swatch-5 { background: #FF0048; }
.price-card { padding: 28px; text-align: center; }
.price-card .amt { font-size: 2.6rem; font-weight: 900; letter-spacing: -.03em; }
.pub-ft { border-top: 1px solid var(--line); padding: 28px 0; background: #fff; font-size: .88rem; color: var(--muted); }
.mock { background: var(--dark); border-radius: 16px; padding: 14px; color: #fff; box-shadow: 0 20px 60px rgba(23, 21, 28, .25); }
.mock .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mock .tile { background: #2A2730; border-radius: 10px; padding: 12px 10px; font-size: .8rem; font-weight: 600; }
.mock .tile b { display: block; margin-top: 6px; color: #FFDE26; }

/* ---------- wizard ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.steps .st { flex: 1; display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.steps .st i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #F1EFF4; font-style: normal; flex: none; }
.steps .st.on { color: var(--ink); } .steps .st.on i { background: var(--brand); color: #fff; }
.steps .st.done i { background: var(--ok); color: #fff; }
.step-pane { display: none; } .step-pane.on { display: block; }
.calc { background: var(--dark); color: #fff; border-radius: var(--r); padding: 18px; }
.calc .big { font-size: 2rem; font-weight: 900; letter-spacing: -.03em; }
.months { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.months label { margin: 0; }
.months input { display: none; }
.months span { display: block; text-align: center; padding: 9px 0; border: 1px solid var(--line); border-radius: 8px; font-weight: 700; cursor: pointer; background: #fff; }
.months input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.review-box { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: #FCFBFD; }
.review-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 10px 0; font-size: .9rem; }
.review-dl dt { color: var(--muted); } .review-dl dd { margin: 0; font-weight: 600; }
.review-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
form.reviewing > :not(.review-box) { display: none; }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }
.side { width: 252px; flex: none; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 50; }
.side::before { content: ''; height: 4px; background: var(--strip); flex: none; }
.side-hd { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.side-nav { flex: 1; overflow-y: auto; padding: 8px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #3C3943; font-size: .9rem; font-weight: 500; margin-bottom: 1px; }
.side-nav a:hover { background: #F7F6F9; }
.side-nav a.on { background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }
.side-nav a .ic { color: #8E8A95; }
.side-nav a.on .ic { color: var(--brand); }
.side-nav .sec { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #A39FAA; font-weight: 800; padding: 14px 10px 6px; }
.side-nav .cnt { margin-left: auto; background: var(--brand); color: #fff; font-size: .7rem; font-weight: 800; padding: 1px 7px; border-radius: 999px; }
.side-nav .cnt.warn { background: #FFE97A; color: var(--ink); }
.side-ft { border-top: 1px solid var(--line); padding: 8px; }
.side.dark { background: var(--dark); border-right: 0; }
.side.dark .side-hd { border-color: #2A2730; }
.side.dark .side-nav a { color: #CFCBD6; }
.side.dark .side-nav a:hover { background: #24212A; }
.side.dark .side-nav a.on { background: #2E2A35; color: #fff; }
.side.dark .side-nav a.on .ic { color: var(--hi); }
.side.dark .side-ft { border-color: #2A2730; }
.side-biz { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border-radius: 10px; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; color: inherit; }
.side-biz:hover { background: #F7F6F9; }
.side-biz .av { width: 38px; height: 38px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-deep); display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: none; }
.side-biz .av img { width: 100%; height: 100%; object-fit: cover; }
.biz-menu { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #FCFBFD; }
.biz-menu .bs-item { display: flex; gap: 8px; align-items: center; width: 100%; padding: 6px; border: 0; background: transparent; border-radius: 8px; text-align: left; font: inherit; cursor: pointer; }
.biz-menu .bs-item:hover:not(:disabled) { background: #fff; }
.biz-menu .bs-item span span { display: block; font-size: .74rem; color: var(--muted); }
.biz-menu .bs-av { width: 28px; height: 28px; border-radius: 7px; background: #F1EFF4; display: grid; place-items: center; font-size: .72rem; font-weight: 800; flex: none; overflow: hidden; }
.biz-menu-add { display: flex; gap: 6px; align-items: center; padding: 8px 6px 2px; font-weight: 700; font-size: .85rem; color: var(--brand-deep); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.appbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: rgba(247, 246, 249, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.appbar h1 { font-size: 1.15rem; }
.content { padding: 22px 24px 90px; max-width: 1280px; width: 100%; }
.menu-btn { display: none; }
.side-backdrop { display: none; }
.imp-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 24px; background: var(--hi); font-size: .85rem; font-weight: 600; }
.page-hd { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-hd .grow h2 { font-size: 1.1rem; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; font-size: .9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a.on { color: var(--ink); border-color: var(--brand); }
.dl { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 8px 16px; font-size: .9rem; margin: 0; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; font-weight: 600; word-break: break-word; }
.copybox { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.copybox input { flex: 1; min-width: 0; border: 0; padding: 7px 10px; font: inherit; font-size: .85rem; color: var(--muted); background: transparent; }
.copybox button { border: 0; border-left: 1px solid var(--line); background: #FCFBFD; padding: 0 12px; font: inherit; font-weight: 600; font-size: .82rem; display: flex; gap: 5px; align-items: center; cursor: pointer; }
.checklist a { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.checklist a:last-child { border-bottom: 0; }
.checklist .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.checklist .done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist .done span { color: var(--muted); text-decoration: line-through; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 10px; }
.bars .b { flex: 1; background: var(--brand-soft); border-radius: 4px 4px 0 0; position: relative; min-height: 2px; transition: background .15s; }
.bars .b:hover { background: var(--brand); }
.bars .b.today { background: var(--brand); }
.bars-x { display: flex; gap: 4px; font-size: .66rem; color: var(--muted); margin-top: 4px; }
.bars-x span { flex: 1; text-align: center; overflow: hidden; }
.meter { height: 8px; border-radius: 99px; background: #F1EFF4; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.json { background: #17151C; color: #EDEAF2; padding: 14px; border-radius: 8px; overflow: auto; max-height: 420px; font-size: .8rem; white-space: pre-wrap; word-break: break-word; }

/* ---------- modal / sheet ---------- */
.modal { position: fixed; inset: 0; z-index: 120; display: none; align-items: center; justify-content: center; background: rgba(23, 21, 28, .45); padding: 16px; }
.modal.on { display: flex; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal-box { background: #fff; border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 24px 64px rgba(0, 0, 0, .25); }
.modal-box.wide { width: min(820px, 100%); }
.modal-hd { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-hd > :first-child { flex: 1; }
.modal-bd { padding: 18px; }
.modal-ft { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; position: sticky; bottom: 0; background: #fff; }
.dr-close { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #F1EFF4; display: grid; place-items: center; cursor: pointer; flex: none; color: var(--ink); }

/* ---------- support + install ---------- */
.support-fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px; border: 0; background: var(--dark); color: #fff; font: inherit; font-weight: 700; font-size: .88rem; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.sup-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.sup-row .ic { color: var(--brand); }
.install-pill { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 70; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 36px rgba(0, 0, 0, .15); width: min(440px, calc(100% - 24px)); }
.install-pill img { border-radius: 9px; }
.inst-steps { padding-left: 20px; margin: 0; } .inst-steps li { margin-bottom: 8px; }
.inst-ic { display: inline-flex; vertical-align: middle; }
.or-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; }
.or-line::before, .or-line::after { content: ''; flex: 1; border-top: 1px solid var(--line); }

/* ---------- bottom nav (phones) ---------- */
.bnav { display: none; }

/* ---------- receipt / document web view ---------- */
.doc { max-width: 760px; margin: 24px auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.doc-hd { padding: 22px 24px; display: flex; gap: 16px; align-items: flex-start; border-bottom: 1px solid var(--line); }
.doc-hd .logo-img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.doc-title { text-align: right; }
.doc-title .t { font-size: 1.25rem; font-weight: 900; letter-spacing: .02em; }
.doc-bd { padding: 20px 24px; }
.doc .lines td, .doc .lines th { padding: 9px 6px; }
.tot { width: min(340px, 100%); margin-left: auto; }
.tot div { display: flex; justify-content: space-between; padding: 4px 0; font-size: .92rem; }
.tot .grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 8px; font-size: 1.15rem; font-weight: 900; }
.kra-box { display: flex; gap: 18px; align-items: center; background: #FCFBFD; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.kra-box img { width: 132px; height: 132px; flex: none; }
.doc-ft { padding: 16px 24px 22px; text-align: center; color: var(--muted); font-size: .84rem; }
.stamp { display: inline-block; padding: 4px 12px; border-radius: 6px; font-weight: 900; letter-spacing: .08em; font-size: .78rem; border: 2px solid currentColor; }
.doc-actions { max-width: 760px; margin: 0 auto; padding: 0 16px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

@media (max-width: 1020px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  .side.on { transform: none; }
  .side-backdrop.on { display: block; position: fixed; inset: 0; background: rgba(23, 21, 28, .4); z-index: 45; }
  .menu-btn { display: inline-flex; }
  .appbar { padding: 10px 14px; }
  .content { padding: 16px 14px 96px; }
  .hide-sm { display: none !important; }
  .g2, .g3, .g21, .g12 { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
  .bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bnav a, .bnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; font-weight: 600; color: var(--muted); background: none; border: 0; font-family: inherit; position: relative; padding: 4px 0; cursor: pointer; }
  .bnav a.on { color: var(--brand); }
  .bnav .ic { width: 21px; height: 21px; }
  .bnav .bdot { position: absolute; top: 0; left: 55%; background: var(--brand); color: #fff; font-size: .62rem; border-radius: 99px; padding: 0 5px; }
  .support-fab { bottom: 76px; right: 12px; padding: 10px; }
  .support-fab span { display: none; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-box { border-radius: 16px 16px 0 0; max-height: 92vh; width: 100%; }
  /* tables become cards */
  .table.mc thead { display: none; }
  .table.mc, .table.mc tbody, .table.mc tr, .table.mc td { display: block; width: 100%; }
  .table.mc tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table.mc td { padding: 2px 0; border: 0; text-align: left; }
  .table.mc tbody tr:hover td { background: none; }
  .table.mc td[data-m="x"] { display: none; }
  .table.mc td[data-m="t"] { font-weight: 700; }
  .table.mc td[data-m="m"], .table.mc td[data-m="b"] { display: none; }
  .table.mc td.m-only { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; color: var(--muted); font-size: .84rem; }
  .table.mc td[data-m="v"] { font-weight: 800; font-size: 1rem; }
  .table.mc td[data-m="k"] { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; }
  .table.mc td[data-m="k"]::before { content: attr(data-label); color: var(--muted); }
  .table.mc td[data-m="a"] { padding-top: 8px; }
  .table.mc .num { text-align: left; }
  .months { grid-template-columns: repeat(4, 1fr); }
  .doc { margin: 0; border-radius: 0; border-left: 0; border-right: 0; }
  .doc-hd { flex-direction: column; }
  .doc-title { text-align: left; }
  .kra-box { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) { .g4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .kpi .val { font-size: 1.2rem; } }
@media print {
  .no-print, .side, .appbar, .bnav, .support-fab, .install-pill, .flash-wrap, .doc-actions { display: none !important; }
  body { background: #fff; }
  .doc { box-shadow: none; border: 0; margin: 0; max-width: none; }
}

/* =====================================================================
   POS / till
   ===================================================================== */
body.pos { background: #EFEDF2; height: 100vh; overflow: hidden; }
.pos-shell { display: grid; grid-template-rows: auto 1fr; height: 100vh; height: 100dvh; }
.pos-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--dark); color: #fff; position: relative; }
.pos-top::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--strip); }
.pos-top .logo-mark { width: 30px; height: 30px; border-radius: 8px; font-size: .9rem; }
.pos-top .biz { font-weight: 800; font-size: .95rem; line-height: 1.1; }
.pos-top .who { font-size: .74rem; color: #A9A4B2; }
.pos-top .btn { background: #2A2730; color: #fff; min-height: 36px; padding: 6px 12px; }
.pos-top .btn:hover { background: #36323D; }
.pos-top .btn-primary { background: var(--brand); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill-on { background: rgba(18, 161, 80, .18); color: #4ADE80; }
.pill-off { background: rgba(255, 222, 38, .16); color: var(--hi); }
.pill-sync { background: rgba(255, 255, 255, .12); color: #fff; }
.pill-sync::before { display: none; }
.sync-btn { display: inline-flex; align-items: center; gap: 8px; }
.sync-btn .n { background: var(--hi); color: var(--ink); border-radius: 999px; padding: 0 7px; font-size: .74rem; font-weight: 900; }
.sync-btn.spin .ic { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pos-body { display: grid; grid-template-columns: minmax(0, 1fr) 400px; min-height: 0; }
.pos-left { display: flex; flex-direction: column; min-height: 0; padding: 12px; gap: 10px; }
.pos-search { display: flex; gap: 8px; }
.pos-search .input { min-height: 46px; font-size: 1rem; border-radius: 12px; }
.cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 15px; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; color: #3C3943; }
.cats button.on { background: var(--dark); color: #fff; border-color: var(--dark); }
.tiles { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; align-content: start; padding-bottom: 12px; }
.tile { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 12px 12px; text-align: left; font: inherit; cursor: pointer; min-height: 96px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px; transition: transform .06s, box-shadow .15s, border-color .15s; overflow: hidden; }
.tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tile, var(--brand)); }
.tile:hover { border-color: #D5D1DA; box-shadow: var(--shadow); }
.tile:active { transform: scale(.97); }
.tile .nm { font-weight: 700; font-size: .92rem; line-height: 1.25; }
.tile .pr { font-weight: 900; font-size: 1rem; }
.tile .st { position: absolute; top: 8px; right: 8px; font-size: .68rem; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: #F1EFF4; color: var(--muted); }
.tile .st.low { background: #FFF6C2; color: #7A5D00; } .tile .st.out { background: var(--bad-soft); color: var(--danger); }
.tile.custom { border-style: dashed; background: transparent; align-items: center; justify-content: center; color: var(--muted); }
.tile.custom::before { display: none; }
.pos-right { background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.cart-hd { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cart-hd .t { font-weight: 800; }
.cart-hd .no { font-size: .78rem; color: var(--muted); }
.cart-meta { display: flex; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cart-meta button { border: 1px dashed #D5D1DA; background: #fff; border-radius: 8px; padding: 5px 10px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; color: #3C3943; display: inline-flex; gap: 5px; align-items: center; }
.cart-meta button.set { border-style: solid; background: var(--brand-soft); border-color: transparent; color: var(--brand-deep); }
.cart-meta .ic { width: 14px; height: 14px; }
.cart-lines { flex: 1; overflow-y: auto; }
.cl { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.cl .nm { font-weight: 700; font-size: .92rem; }
.cl .sub { font-size: .76rem; color: var(--muted); }
.cl .amt { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.qty button { width: 32px; height: 32px; border: 0; background: #F7F6F9; cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.qty button:hover { background: #ECEAEF; }
.qty span { min-width: 40px; text-align: center; font-weight: 800; font-size: .9rem; cursor: pointer; }
.cl-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: #F1EFF4; color: var(--ink); }
.cart-empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.cart-empty .ic { width: 40px; height: 40px; margin: 0 auto 8px; color: #D5D1DA; stroke-width: 1.5; }
.cart-tot { padding: 12px 14px; border-top: 1px solid var(--line); background: #FCFBFD; }
.cart-tot .r { display: flex; justify-content: space-between; font-size: .86rem; color: var(--muted); padding: 1px 0; }
.cart-tot .g { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; }
.cart-tot .g b { font-size: 1.7rem; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cart-act { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 8px; padding: 10px 14px 14px; }
.cart-act .btn { min-height: 54px; border-radius: 12px; font-size: .95rem; }
.cart-act .pay { font-size: 1.05rem; font-weight: 800; }
.pos-mobile-bar { display: none; }
.pay-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pay-methods button { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 14px 10px; font: inherit; font-weight: 800; cursor: pointer; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.pay-methods button .ic { width: 24px; height: 24px; color: var(--brand); }
.pay-methods button.on { border-color: var(--brand); background: var(--brand-soft); }
.pay-methods button:disabled { opacity: .4; cursor: not-allowed; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.keypad button { min-height: 50px; border: 1px solid var(--line); background: #fff; border-radius: 10px; font: inherit; font-size: 1.15rem; font-weight: 800; cursor: pointer; }
.keypad button:active { background: #F1EFF4; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; }
.amount-big { font-size: 2rem; font-weight: 900; text-align: center; letter-spacing: -.02em; padding: 6px 0; font-variant-numeric: tabular-nums; }
.done-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; margin: 0 auto 10px; }
.done-ic .ic { width: 34px; height: 34px; stroke-width: 3; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-row:hover { background: #FCFBFD; }
.list-row:last-child { border-bottom: 0; }
.pos-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--dark); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: .9rem; z-index: 300; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); max-width: calc(100% - 24px); }
.pos-banner { padding: 8px 14px; font-size: .84rem; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.pos-banner.warn { background: var(--hi); color: var(--ink); }
.pos-banner.bad { background: var(--danger); color: #fff; }

@media (max-width: 900px) {
  .pos-body { grid-template-columns: minmax(0, 1fr); }
  .pos-right { position: fixed; inset: 0; z-index: 90; transform: translateY(100%); transition: transform .22s ease; border-left: 0; }
  .pos-right.on { transform: none; }
  .pos-mobile-bar { display: flex; gap: 10px; align-items: center; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
  .pos-mobile-bar .btn { flex: 1; min-height: 52px; border-radius: 12px; font-size: 1rem; }
  .pos-left { padding: 10px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
  .pos-top .hide-sm { display: none !important; }
  .pos-shell { grid-template-rows: auto 1fr auto; }
}

/* support sheet */
.sup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sup-btn { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.sup-btn:hover { border-color: #D5D1DA; background: #FCFBFD; }
.sup-btn strong { display: block; font-size: .9rem; } .sup-btn small { display: block; font-size: .74rem; color: var(--muted); }
.sup-wa .ic { color: #1FA855; } .sup-call .ic, .sup-sms .ic, .sup-mail .ic { color: var(--brand); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.auth-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 12px; }
.otp { text-align: center; font-size: 1.6rem; letter-spacing: .5em; font-weight: 800; min-height: 54px; }
.switch-note { position: fixed; inset: 0; z-index: 400; background: rgba(23, 21, 28, .5); display: grid; place-items: center; padding: 16px; }
.switch-note .card { width: min(380px, 100%); }
@media (max-width: 520px) { .sup-grid, .form-grid { grid-template-columns: 1fr; } }

/* admin settings form helpers */
.help { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.form-grid .full { grid-column: 1 / -1; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type=color] { width: 44px; height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; }
.settings-form { display: flex; flex-direction: column; gap: 16px; max-width: 980px; }
.settings-form .card-bd.form-grid { gap: 0 16px; }
.palette-row { display: flex; gap: 0; border-radius: 10px; overflow: hidden; height: 44px; border: 1px solid var(--line); }
.palette-row span { flex: 1; }
body.pos .support-fab{display:none}
