/* Bahi — mobile-first styles. Tokens first, then layout, then components. */
:root {
    --bg: #f4f6f3; --card: #fff; --ink: #15201b; --muted: #5b6b63; --line: #e2e8e4; --soft: #eef3f0;
    --brand: #0b6e4f; --brand-ink: #fff; --brand-soft: #e3f1ea; --accent: #e8900c; --accent-soft: #fdf1dc;
    --danger: #b93815; --danger-soft: #fbe9e3; --ok: #147a3c; --ok-soft: #e2f4e8; --warn: #8a5a00; --warn-soft: #fff3d6;
    --radius: 12px; --shadow: 0 1px 2px rgba(16, 32, 24, .06), 0 2px 8px rgba(16, 32, 24, .05);
    --font: "Mukta", system-ui, -apple-system, "Segoe UI", sans-serif;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0f1512; --card: #172019; --ink: #e6ede9; --muted: #9aaba2; --line: #26332c; --soft: #1c2721;
        --brand: #3cb37f; --brand-ink: #06140d; --brand-soft: #173127; --accent: #f0a53a; --accent-soft: #33260f;
        --danger: #f07a57; --danger-soft: #3a1c13; --ok: #56c985; --ok-soft: #133021; --warn: #f2c261; --warn-soft: #33290f;
        --shadow: none; color-scheme: dark;
    }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.45; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; font-weight: 700; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; } .center { text-align: center; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
svg.i { width: 20px; height: 20px; flex: none; }

/* ---------- App shell ---------- */
.shell { min-height: 100vh; display: flex; }
.side { width: 232px; flex: none; background: var(--card); border-right: 1px solid var(--line); padding: 16px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 8px; padding: 4px 10px 14px; font-weight: 700; font-size: 1.25rem; color: var(--ink); }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: 1rem; }
.side .shop { padding: 0 10px 12px; font-size: .9rem; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--ink); font-weight: 500; }
.nav:hover { background: var(--soft); text-decoration: none; }
.nav.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 4px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top form.search { flex: 1; max-width: 460px; }
.top .title-m { display: none; font-weight: 700; }
.content { padding: 20px; max-width: 1200px; width: 100%; }
.bottom { display: none; }
.trial-bar { background: var(--accent-soft); color: var(--warn); padding: 8px 20px; font-size: .92rem; }
.trial-bar a { font-weight: 600; }

@media (max-width: 860px) {
    /* iPhone Safari: 100vh reaches behind its own toolbar, hiding the menu's last items (Log out);
       dvh is the screen actually visible, and the padding clears the home-bar edge */
    .side { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2);
        height: 100vh; height: 100dvh; padding-bottom: calc(24px + env(safe-area-inset-bottom)); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
    .side.open { transform: none; }
    .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
    .top { padding: 8px 12px; }
    .top .title-m { display: block; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .top form.search { display: none; }
    .top .desk { display: none; }
    .content { padding: 14px 12px 96px; }
    .bottom { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; align-items: center; }
    .bottom a, .bottom button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; color: var(--muted); background: none; border: 0; font-family: inherit; padding: 4px 0; }
    .bottom a.on { color: var(--brand); }
    .bottom .plus { flex: none; width: 56px; height: 56px; margin-top: -26px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); box-shadow: 0 4px 14px rgba(11,110,79,.35); justify-content: center; font-size: .7rem; }
    .bottom .plus svg { width: 26px; height: 26px; }
    .trial-bar { padding: 8px 12px; }
}
@media (min-width: 861px) { .mobile-only { display: none !important; } }
@media (max-width: 860px) { .desktop-only { display: none !important; } }
@media (max-width: 860px) { .desk-only { display: none !important; } }

/* ---------- Components ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h2, .card-head h3 { margin: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.grid { display: grid; gap: 14px; }
.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)); }
@media (max-width: 860px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g2.stack-m { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .g2.stack-s, .g3.stack-s { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: block; color: var(--ink); }
a.stat:hover { text-decoration: none; border-color: var(--brand); }
.stat .label { font-size: .85rem; color: var(--muted); }
.stat .value { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .sub { font-size: .8rem; color: var(--muted); }
.stat.good .value { color: var(--ok); } .stat.bad .value { color: var(--danger); } .stat.warn .value { color: var(--warn); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 42px; white-space: nowrap; }
.btn:hover { text-decoration: none; background: var(--soft); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #1d1300; }
.btn.danger { color: var(--danger); border-color: var(--danger-soft); }
.btn.wa { background: #1faa55; border-color: #1faa55; color: #fff; }
.btn.small { padding: 5px 10px; min-height: 32px; font-size: .88rem; }
.btn.block { width: 100%; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn svg { width: 18px; height: 18px; }
.icon-btn { background: none; border: 0; padding: 8px; border-radius: 8px; color: var(--ink); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--soft); }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 3px; }
input:not([type]), input[type=text], input[type=number], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=search], input[type=file], select, textarea {
    width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); font: inherit; min-height: 42px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
input[type=color] { width: 60px; height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 3px; background: var(--card); }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.error { color: var(--danger); font-size: .85rem; margin-top: 3px; }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 500; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--danger-soft); color: var(--danger); }
.flash.info { background: var(--accent-soft); color: var(--warn); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.t th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--soft); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.link { cursor: pointer; }
table.t tr.link:hover td { background: var(--soft); }
table.t tfoot td { font-weight: 700; background: var(--soft); }
table.t .strong td { font-weight: 700; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list a.li { color: var(--ink); display: flex; justify-content: space-between; gap: 10px; width: 100%; }
.list a.li:hover { text-decoration: none; color: var(--brand); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .75rem; font-weight: 600; background: var(--soft); color: var(--muted); white-space: nowrap; }
.badge.paid, .badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.unpaid, .badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.partial, .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--brand); border-color: var(--brand); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input, .filters select { width: auto; flex: 1 1 140px; }
.filters { align-items: flex-end; }
.filters label.date-f input { flex: none; }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .5; }
.pager { display: flex; gap: 6px; justify-content: center; margin: 14px 0; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.pager .on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .bar span.b { width: 100%; max-width: 38px; background: var(--brand); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bars .bar.today span.b { background: var(--accent); }
.bars .bar small { font-size: .72rem; }

details.more > summary { cursor: pointer; font-weight: 600; color: var(--brand); list-style: none; padding: 6px 0; }
details.more > summary::-webkit-details-marker { display: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .95rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: .9rem; cursor: pointer; color: var(--ink); }
.pill:hover { border-color: var(--brand); color: var(--brand); }
.pill.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); text-decoration: none; }
.pill small { color: var(--muted); }

/* ---------- Bill editor ---------- */
.bill-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 980px) { .bill-grid { grid-template-columns: 1fr; } }
.finder { position: relative; }
.finder input { font-size: 1.05rem; min-height: 48px; padding-left: 40px; }
.finder > svg { position: absolute; left: 12px; top: 14px; color: var(--muted); }
.finder .scan { position: absolute; right: 6px; top: 4px; }
.dropdown { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.12); z-index: 25; max-height: 340px; overflow-y: auto; }
.dropdown button { display: flex; width: 100%; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; border-bottom: 1px solid var(--line); }
.dropdown button:last-child { border-bottom: 0; }
.dropdown button.act, .dropdown button:hover { background: var(--brand-soft); }
.lines { width: 100%; border-collapse: collapse; }
.lines th { font-size: .75rem; text-transform: uppercase; color: var(--muted); text-align: left; padding: 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lines td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.lines input, .lines select { min-height: 36px; padding: 6px 8px; }
.lines .w-qty { width: 84px; } .lines .w-rate { width: 104px; } .lines .w-gst { width: 76px; } .lines .w-disc { width: 84px; }
.lines .w-unit { display: block; width: 84px; margin-top: 4px; min-height: 32px; padding: 4px 6px; font-size: .85rem; }
.lines .amt { font-weight: 700; text-align: right; white-space: nowrap; padding-top: 14px; }
.lines .name { font-weight: 600; }
.lines .name small { display: block; font-weight: 400; }
.lines .extra { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.lines .extra input, .lines .extra select { width: 140px; font-size: .88rem; }
.lines .extra .exp-f { display: flex; align-items: center; gap: 4px; margin: 0; font-size: .78rem; color: var(--muted); font-weight: 500; }
.lines .extra .exp-f input { -webkit-appearance: none; appearance: none; min-height: 38px; }
.lines .extra .w-mrp { width: 110px; }
.lines .extra select option:disabled { color: var(--danger); }
.dropdown .drop-head { padding: 8px 12px; font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line); }
@media (max-width: 700px) {
    .lines thead { display: none; }
    .lines tr { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
    .lines td { border: 0; padding: 0; }
    .lines td.c-name { grid-column: 1 / -1; }
    .lines td.c-gst, .lines td.c-disc { display: none; }
    .lines tr.show-more td.c-gst, .lines tr.show-more td.c-disc { display: block; }
    .lines .w-qty, .lines .w-rate, .lines .w-unit { width: 100%; }
    .lines td[data-l]::before { content: attr(data-l); display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; }
    .lines .amt { padding-top: 16px; }
}
.totals { font-size: .98rem; }
.totals .tr { display: flex; justify-content: space-between; padding: 5px 0; }
.totals .grand { font-size: 1.35rem; font-weight: 800; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.sticky-save { position: sticky; top: 76px; }
@media (max-width: 980px) {
    .sticky-save { position: static; }
    .save-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: var(--card); border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: center; }
    .save-bar .gt { flex: 1; font-weight: 800; font-size: 1.2rem; }
    body.billing .bottom { display: none; }
    body.billing .content { padding-bottom: 90px; }
}
@media (min-width: 981px) { .save-bar { display: none; } }

/* ---------- Public site ---------- */
.site-nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; max-width: 1140px; margin: 0 auto; }
.site-nav .brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.3rem; color: var(--ink); }
.hero { max-width: 1140px; margin: 0 auto; padding: 30px 20px 40px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); letter-spacing: -.01em; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 10px; } }
.phone { background: #0b141a; border-radius: 28px; padding: 12px; max-width: 360px; margin: 0 auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.chat { background: #efeae2; border-radius: 18px; padding: 14px 10px; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; color: #111; min-height: 340px; }
.chat .head { background: #075e54; color: #fff; margin: -14px -10px 6px; padding: 10px 14px; border-radius: 18px 18px 0 0; font-weight: 600; }
.msg { max-width: 85%; padding: 6px 10px; border-radius: 8px; white-space: pre-line; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.msg.me { align-self: flex-end; background: #d9fdd3; }
.msg.bot { align-self: flex-start; background: #fff; }
/* in dark mode the mock phone gets a visible frame and WhatsApp's own dark chat colours */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .phone { background: #1f2c33; box-shadow: 0 0 0 1px #2f3f47, 0 20px 60px rgba(0,0,0,.5); }
    :root:not([data-theme="light"]) .chat { background: #0b141a; color: #e9edef; }
    :root:not([data-theme="light"]) .chat .head { background: #202c33; }
    :root:not([data-theme="light"]) .msg.me { background: #005c4b; }
    :root:not([data-theme="light"]) .msg.bot { background: #202c33; }
}
.section { max-width: 1140px; margin: 0 auto; padding: 30px 20px; }
.section h2 { font-size: 1.6rem; margin-bottom: 14px; }
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.type-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--ink); display: block; }
.type-card:hover { border-color: var(--brand); text-decoration: none; }
.type-card .em { font-size: 1.6rem; }
.type-card b { display: block; margin: 4px 0 2px; }
.type-card small { display: block; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; }
.plan.pop { border: 2px solid var(--brand); }
.plan .price { font-size: 2rem; font-weight: 800; }
.plan ul { padding-left: 18px; margin: 10px 0 16px; flex: 1; }
.plan li { margin-bottom: 4px; }
.compare td:nth-child(2) { font-weight: 600; color: var(--ok); }
.footer { text-align: center; color: var(--muted); padding: 30px 20px; font-size: .9rem; }

/* auth */
.auth { max-width: 520px; margin: 20px auto; padding: 0 16px; }
.type-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.type-pick label { border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; font-weight: 500; background: var(--card); display: block; margin: 0; }
.type-pick input { position: absolute; opacity: 0; }
.type-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.type-pick .em { font-size: 1.3rem; display: block; }

@media print {
    .side, .top, .bottom, .no-print, .save-bar, .trial-bar { display: none !important; }
    body { background: #fff; }
    .content { padding: 0; }
    .card { border: 0; box-shadow: none; }
}

.loc-switch select { width: auto; min-height: 38px; padding: 6px 10px; font-weight: 600; background: var(--brand-soft); border-color: transparent; color: var(--brand); max-width: 190px; }
@media (max-width: 860px) { .loc-switch select { max-width: 130px; font-size: .85rem; } }

/* Restaurant tables */
.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.table-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; min-height: 96px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--ink); }
.table-tile:hover { text-decoration: none; border-color: var(--brand); }
.table-tile b { font-size: 1.2rem; }
.table-tile small { color: var(--muted); }
.table-tile.busy { background: var(--accent-soft); border-color: var(--accent); }
.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.dish { position: relative; text-align: left; padding: 10px; min-height: 70px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.dish:active { transform: scale(.97); }
.dish small { display: block; font-weight: 500; color: var(--muted); }
.dish .cnt { position: absolute; top: -6px; right: -6px; background: var(--brand); color: var(--brand-ink); border-radius: 99px; min-width: 24px; height: 24px; display: grid; place-items: center; font-style: normal; font-size: .8rem; }
.veg { display: inline-block; width: 10px; height: 10px; border: 1.5px solid #188a3b; border-radius: 2px; margin-right: 4px; position: relative; top: -1px; background: radial-gradient(circle, #188a3b 35%, transparent 40%); }
.veg.non { border-color: #b3261e; background: radial-gradient(circle, #b3261e 35%, transparent 40%); }
.pill.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.lang-switch { display: flex; gap: 4px; padding: 10px; }
.lang-switch button { flex: 1; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: .9rem; cursor: pointer; }
.lang-switch button.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.site-nav .lang-switch { padding: 0; }
.site-nav .row { gap: 6px; flex-wrap: nowrap; }
@media (max-width: 520px) { .site-nav { padding: 10px 12px; } .site-nav .btn { padding: 8px 12px; } }
.receipt-print { display: none; }
@media print {
    body.offline-billing .shell, body.offline-billing .bottom, body.offline-billing .save-bar { display: none !important; }
    body.offline-billing .receipt-print { display: block; width: 72mm; font: 12px/1.4 "Courier New", monospace; color: #000; }
    .receipt-print hr { border: 0; border-top: 1px dashed #000; }
}

/* Online store */
.store-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.store-head h1 { margin: 0; font-size: 1.3rem; }
.store { max-width: 1000px; margin: 0 auto; padding: 14px 16px 120px; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 10px; }
.s-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.s-item.in { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.s-photo { aspect-ratio: 4 / 3; border-radius: 8px; background: var(--brand-soft); display: grid; place-items: center; overflow: hidden; margin-bottom: 4px; }
.s-photo img { width: 100%; height: 100%; object-fit: cover; }
.s-photo span { font-size: 2rem; font-weight: 800; color: var(--brand); }
.s-qty { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.s-cart { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(0,0,0,.08); max-height: 85vh; overflow-y: auto; z-index: 20; }
.s-cart > * { max-width: 1000px; margin-left: auto; margin-right: auto; }

/* Test copies (UAT): impossible to mistake for the live site */
.env-banner { background: repeating-linear-gradient(45deg, #b93815, #b93815 12px, #c9491f 12px, #c9491f 24px); color: #fff; text-align: center; font-weight: 700; padding: 4px 10px; font-size: .85rem; position: relative; z-index: 60; }

/* Number columns: heading and figures line up on the right in every table */
table.t th.right, table.t td.right { text-align: right; }
table.t th.center, table.t td.center { text-align: center; }
/* Ledger on phones: entry (with date), one amount column, balance */
.ledger .l-entry small { display: block; margin-top: 2px; }
.ledger .small-x { padding: 2px 4px; margin-left: 2px; vertical-align: middle; }
@media (max-width: 860px) {
    table.t th.mobile-only, table.t td.mobile-only { display: table-cell !important; }
    table.t td.right form.mobile-only { display: inline !important; }
    .ledger td, .ledger th { padding: 10px 8px; }
    .ledger .l-entry { min-width: 0; word-break: normal; overflow-wrap: anywhere; }
}
@media (min-width: 861px) { table.t th.mobile-only, table.t td.mobile-only, table.t td form.mobile-only { display: none !important; } }

/* Policy pages and footer links */
.legal { max-width: 780px; margin: 0 auto; padding: 10px 20px 30px; line-height: 1.65; }
.legal h2 { margin-top: 24px; font-size: 1.15rem; }
.legal ul { padding-left: 20px; } .legal li { margin-bottom: 6px; }
.legal-nav { margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .92rem; }
.footer-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.side-legal { padding: 12px 10px 4px; font-size: .78rem; color: var(--muted); }
.side-legal a { color: var(--muted); }

/* Loading bar shown while the next page is on its way (see layouts/base) */
.nav-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--brand); z-index: 1000; opacity: 0; pointer-events: none; }
.navigating .nav-progress { opacity: 1; animation: nav-progress 8s cubic-bezier(.1, .8, .2, 1) forwards; }
@keyframes nav-progress { 0% { width: 0; } 10% { width: 45%; } 100% { width: 92%; } }
@media (prefers-reduced-motion: reduce) { .navigating .nav-progress { animation: none; width: 100%; opacity: .6; } }

/* Staff attendance: one row per worker, P / ½ / A / L / Off buttons, and the month calendar */
.list li.att-row { display: grid; grid-template-columns: minmax(140px, 1fr) auto auto; gap: 10px; align-items: center; }
.att-who small { display: block; }
.att-opts { display: flex; gap: 4px; }
.att-opts label { position: relative; cursor: pointer; }
.att-opts input { position: absolute; opacity: 0; pointer-events: none; }
.att-opts span { display: grid; place-items: center; min-width: 40px; height: 36px; padding: 0 6px; border: 1px solid var(--line); border-radius: 8px; font-weight: 700; font-size: .9rem; color: var(--muted); }
.att-opts input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.att-opts .att-present input:checked + span { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.att-opts .att-half input:checked + span { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.att-opts .att-absent input:checked + span { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.att-opts .att-leave input:checked + span, .att-opts .att-off input:checked + span { background: var(--soft); color: var(--ink); border-color: var(--muted); }
.att-opts .att-none input:checked + span { border-style: dashed; }
.att-time { display: flex; gap: 8px; align-items: flex-end; }
.att-time label { display: flex; flex-direction: column; gap: 2px; margin: 0; font-weight: 500; }
.att-time label small { font-size: .75rem; color: var(--muted); }
.att-time input { width: 112px; min-width: 0; min-height: 38px; padding: 4px 8px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; -webkit-appearance: none; appearance: none; font: inherit; }
.att-time .att-hrs { padding-bottom: 10px; }
.att-date { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.att-date form { margin: 0; flex: 0 1 190px; min-width: 0; }
.att-date input[type=date] { width: 100%; min-width: 0; -webkit-appearance: none; appearance: none; }
@media (max-width: 760px) { .list li.att-row { grid-template-columns: 1fr; gap: 8px; } .att-opts span { min-width: 0; } .att-opts { display: grid; grid-template-columns: repeat(6, 1fr); } .att-time label { flex: 1; min-width: 0; } .att-time input { width: 100%; } }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-h { text-align: center; font-size: .75rem; color: var(--muted); font-weight: 600; }
.cal-d { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; }
.cal-d span { font-size: .75rem; color: var(--muted); }
.cal-d b { font-size: .85rem; min-height: 1.1em; }
.cal-d:hover { border-color: var(--brand); text-decoration: none; }
.cal-d.att-present { background: var(--ok-soft); color: var(--ok); }
.cal-d.att-half { background: var(--warn-soft); color: var(--warn); }
.cal-d.att-absent { background: var(--danger-soft); color: var(--danger); }
.cal-d.att-leave, .cal-d.att-off { background: var(--soft); }
.cal-d.auto { border-style: dashed; }

/* Date / time boxes look the same on Android and iPhone: a fixed height, never wider than their place,
   and never collapsing when empty (iPhone does). Filter bars label them, as an empty one looks like a blank dropdown. */
input[type=date], input[type=time], input[type=month] { -webkit-appearance: none; appearance: none; min-width: 0; min-height: 42px; line-height: 1.2; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; min-height: 1.2em; }
label.date-f { display: inline-flex; flex-direction: column; gap: 2px; margin: 0; font-weight: 500; min-width: 0; flex: 1 1 140px; max-width: 200px; }
label.date-f small { font-size: .75rem; color: var(--muted); }
label.date-f input { width: 100%; }

.lines .extra .w-free { width: 70px; }
.rx-box { margin-top: 10px; }
.rx-box[data-need="1"] { border-left: 3px solid var(--danger); padding-left: 10px; }
.dropdown .drop-all { background: var(--brand-soft); font-weight: 600; justify-content: flex-start; }
i.veg { display: inline-block; width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 2px; margin-right: 6px; vertical-align: -1px; position: relative; }
i.veg::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: currentColor; }
i.veg.veg { color: #1a9a3c; } i.veg.nonveg { color: #c0392b; } i.veg.egg { color: #d4a017; }
.shop-tiles .stat .value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-lookup label { font-weight: 600; display: block; margin-bottom: 6px; }
.home-lookup input { flex: 1; min-width: 0; }
.map-grid select.mapped { border-color: var(--brand); }
.how-export li { align-items: flex-start; }

/* ---- public site (home) ---- */
.site-nav .nav-login { background: transparent; }
.site-nav .lang-btn { min-width: 44px; }
@media (max-width: 420px) { .site-nav .brand { font-size: 1.1rem; } .site-nav .btn { padding: 7px 10px; font-size: .9rem; } .site-nav .logo-mark { width: 30px; height: 30px; } }
.btn.big { padding: 12px 22px; font-size: 1.05rem; min-height: 48px; }
.lp-hero { padding-top: 24px; }
.lp-hero h1 { margin: 12px 0 10px; line-height: 1.12; }
.lp-cta { margin: 20px 0 14px; gap: 10px; }
.lp-ticks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .95rem; }
.lp-ticks li { white-space: nowrap; }
.lp-demo { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lp-tabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.lp-tabs .pill { cursor: pointer; font: inherit; }
.lp-demo .chat { min-height: 300px; }
.lp-demo .chat .head small { font-weight: 400; opacity: .7; }
.lp-bill { display: flex; flex-direction: column; gap: 8px; animation: lpIn .25s ease; }
@keyframes lpIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.lp-strip { max-width: 1140px; margin: 0 auto; padding: 8px 20px 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.lp-strip > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: center; }
.lp-strip b { display: block; font-size: 1.5rem; color: var(--brand); }
.lp-strip span { color: var(--muted); font-size: .9rem; }
.lp-steps .card { position: relative; padding-top: 22px; }
.lp-num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: 6px; }
.type-card .lp-go { display: block; margin-top: 8px; font-size: .85rem; font-weight: 600; color: var(--brand); opacity: 0; transition: opacity .15s; }
.type-card:hover .lp-go, .type-card:focus .lp-go { opacity: 1; }
@media (hover: none) { .type-card .lp-go { opacity: 1; } }
.lp-features h3 { font-size: 1.05rem; margin-bottom: 4px; }
.lp-switch { display: flex; gap: 20px; align-items: center; justify-content: space-between; border: 2px dashed var(--brand); }
.lp-switch h2 { margin-bottom: 4px; }
.lp-faq details { margin-bottom: 10px; }
.lp-faq summary { font-weight: 600; cursor: pointer; padding: 2px 0; }
.lp-faq details p { margin: 8px 0 0; }
.lp-final { background: var(--brand); color: #fff; border-radius: 20px; padding: 34px 20px; text-align: center; }
.lp-final h2 { color: #fff; margin-bottom: 6px; }
.lp-final p { opacity: .9; margin: 0 0 16px; }
.lp-final .lp-light { background: #fff; color: #0b3d2c; border-color: #fff; }
.lp-final .lp-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.lp-sticky { display: none; }
@media (max-width: 860px) {
    .lp-strip { grid-template-columns: repeat(2, 1fr); }
    .lp-switch { flex-direction: column; align-items: stretch; text-align: left; }
    .lp-cta .btn { flex: 1; }
    .lp-sticky { display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0,0,0,.12); transform: translateY(110%); transition: transform .2s; }
    .lp-sticky.show { transform: none; }
    .lp-sticky .btn { flex: 1; }
    body:has(.lp-sticky) .footer { padding-bottom: 90px; }
}
@media (max-width: 520px) { .lp-features .card { padding: 14px 16px; } .lp-features .card p { margin: 4px 0 0; } .lp-features { gap: 10px; } }
/* bill register */
.reg-opts { padding: 12px 14px 0; gap: 18px; align-items: center; flex-wrap: wrap; }
.reg-hsn { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.reg-hsn input { width: 110px; min-height: 36px; }
table.reg td { padding: 4px; vertical-align: middle; }
table.reg input, table.reg select { min-height: 38px; padding: 6px 8px; font-size: .92rem; width: 100%; }
table.reg td:nth-child(1) input { min-width: 130px; -webkit-appearance: none; appearance: none; }
table.reg td:nth-child(2) input { min-width: 80px; }
table.reg td:nth-child(3) input { min-width: 160px; }
table.reg td:nth-child(4) input { min-width: 150px; }
table.reg td:nth-child(5) input { min-width: 100px; }
.reg-total { white-space: nowrap; font-weight: 600; }
.reg-foot { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 14px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--card); }
.reg-sum { color: var(--muted); }
@media (max-width: 860px) {
    table.reg thead { display: none; }
    table.reg tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
    table.reg td { padding: 0; border: 0; }
    table.reg td::before { content: attr(data-l); display: block; font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; }
    table.reg td:nth-child(3), table.reg td:nth-child(4) { grid-column: span 2; }
    table.reg td:last-child { grid-column: span 2; text-align: right; }
    table.reg td:last-child::before { content: none; }
    .reg-foot { bottom: calc(64px + env(safe-area-inset-bottom)); }
    .reg-sum { width: 100%; order: -1; font-size: .9rem; }
}
.use-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.use-pick label { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; cursor: pointer; margin: 0; background: var(--card); }
.use-pick label:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.use-pick input { margin-top: 4px; }
.use-pick b { display: block; }
.use-pick small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
@media (max-width: 560px) { .use-pick { grid-template-columns: 1fr; } }
