:root {
  --ink: #16181d;
  --ink-2: #3f444d;
  --muted: #7b818c;
  --bg: #f2f3ef;
  --card: #ffffff;
  --line: #e2e4de;
  --soft: #f6f7f3;
  --brand: #ff5a1f;
  --brand-2: #ff5a1f;
  --brand-d: #d9420c;
  --ok: #138a4a;
  --warn: #c97a00;
  --bad: #d92d2d;
  --wa: #138a4a;
  --radius: 10px;
  --shadow: 0 1px 0 rgba(22, 24, 29, .05);
  --side: 232px;
  --cartw: 400px;
  --bar: 36px;
  --nav: 58px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "Manrope", "Noto Sans Sinhala", "Nirmala UI", "Iskoola Pota", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
html[data-lang="si"] body { font-family: "Noto Sans Sinhala", "Manrope", "Nirmala UI", "Iskoola Pota", system-ui, sans-serif; }
body { font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
kbd { font: 600 11px/1 "Manrope", sans-serif; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--soft); color: var(--muted); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* demo bar */
.demo-bar {
  height: var(--bar); display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: #0d0e11; color: #c9ccd3; font-size: 13px;
  position: sticky; top: 0; z-index: 60;
}
.demo-tag { font: 700 11px/1 "Manrope", sans-serif; letter-spacing: 1px; padding: 5px 8px; border-radius: 6px; background: #ffb020; color: #16181d; }
.demo-msg { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-cta { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--wa); color: #fff; font-weight: 600; white-space: nowrap; }
.demo-cta svg { width: 16px; height: 16px; stroke: none; }
.demo-cta:hover { filter: brightness(1.08); }

/* layout */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: calc(100vh - var(--bar)); }
.side {
  position: sticky; top: var(--bar); height: calc(100vh - var(--bar));
  background: #16181d; color: #b9bec7; display: flex; flex-direction: column; padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: #fff; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font: 800 19px/1 "Manrope", sans-serif; color: #fff; background: var(--brand); box-shadow: 0 6px 16px rgba(255, 90, 31, .45); }
.brand-txt { font: 600 18px/1 "Manrope", sans-serif; letter-spacing: -.3px; }
.brand-txt b { font-weight: 800; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: #b9bec7; font-weight: 600; font-size: 15px; text-align: left; transition: background .15s, color .15s; }
.nav button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav button.on { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(255, 90, 31, .35); }
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #ffb020; color: #16181d; font: 700 12px/22px "Manrope", sans-serif; text-align: center; font-style: normal; }
.nav-badge[hidden] { display: none; }
.side-foot { margin-top: auto; }
.offline-pill { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); font-size: 13px; }
.offline-pill i { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 4px rgba(47, 211, 155, .18); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px 4px; }
.topbar h1 { font-size: 24px; font-weight: 700; letter-spacing: -.3px; }
.tb-shop { color: var(--muted); font-size: 14px; }
.tb-right { display: flex; align-items: center; gap: 14px; }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.clock b { font: 600 17px/1.2 "Manrope", "Noto Sans Sinhala", sans-serif; }
.clock span { font-size: 12px; color: var(--muted); }
.lang { font-family: "Noto Sans Sinhala", "Manrope", "Nirmala UI", sans-serif; display: flex; padding: 3px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.lang span { padding: 5px 11px; border-radius: 999px; color: var(--muted); }
html[data-lang="si"] .lang-on, html[data-lang="en"] .lang-off { background: var(--ink); color: #fff; }

.page { display: none; padding: 14px 24px 28px; }
.page.on { display: block; }

/* billing */
.bill-grid { display: grid; grid-template-columns: 1fr var(--cartw); gap: 20px; align-items: start; }
.catalog { min-width: 0; }
.search-row { display: flex; gap: 10px; }
.search { flex: 1; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); box-shadow: var(--shadow); color: var(--muted); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255, 90, 31, .12); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; color: var(--ink); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search.sm { height: 44px; box-shadow: none; flex: 1 1 240px; }
.search.sm input { font-size: 15px; }
.scan-btn { display: flex; align-items: center; gap: 8px; padding: 0 16px; border-radius: 14px; background: var(--card); border: 1.5px dashed #c3c7bf; color: var(--brand); font-weight: 600; font-size: 14px; white-space: nowrap; transition: .15s; }
.scan-btn:hover { background: #fff0e9; border-color: var(--brand); }
.scan-btn.beep { background: #e3fbef; border-color: var(--ok); color: var(--ok); }

.cats { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 12px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.chip { display: flex; align-items: center; gap: 7px; padding: 7px 14px 7px 8px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--ink-2); white-space: nowrap; transition: .15s; }
.chip-ic { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--c) 14%, #fff); font-size: 15px; }
.chip:hover { border-color: var(--c); }
.chip.on { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 35%, transparent); }
.chip.on .chip-ic { background: rgba(255, 255, 255, .22); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; min-height: 166px;
  border-radius: var(--radius); background: var(--card); border: 1.5px solid transparent; box-shadow: var(--shadow); text-align: left;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.tile:hover:not(:disabled) { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 55%, #fff); box-shadow: 0 12px 28px rgba(22, 24, 29, .1); }
.tile:active:not(:disabled) { transform: scale(.98); }
.tile.in { border-color: var(--c); background: color-mix(in srgb, var(--c) 5%, #fff); }
.tile-ic { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; font-size: 28px; background: color-mix(in srgb, var(--c) 13%, #fff); margin-bottom: 6px; }
.tile-name { font-weight: 600; font-size: 14.5px; line-height: 1.35; color: var(--ink); }
.tile-price { font: 700 15px/1.3 "Manrope", sans-serif; color: var(--ink); margin-top: auto; }
.tile-price small { font-weight: 500; font-size: 12px; color: var(--muted); }
.tile-meta { width: 100%; display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); }
.tile-meta i { font-style: normal; font-weight: 700; }
.tile.st-low .stk { color: var(--warn); }
.tile.st-out { opacity: .5; }
.tile.st-out .stk { color: var(--bad); }
.tile-n { position: absolute; top: 10px; right: 10px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--c); color: #fff; font: 700 12.5px/26px "Manrope", sans-serif; text-align: center; }
.empty-tiles { grid-column: 1 / -1; padding: 48px; text-align: center; color: var(--muted); background: var(--card); border-radius: var(--radius); }

/* cart */
.cart {
  display: flex; flex-direction: column; background: var(--card); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden;
}
.cart-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.cart-head > div { flex: 1; }
.cart-head h2 { font-size: 18px; font-weight: 700; }
.cart-head span { font-size: 13px; color: var(--muted); }
.ghost-btn { padding: 6px 12px; border-radius: 10px; color: var(--bad); font-weight: 600; font-size: 13.5px; }
.ghost-btn:hover { background: #fdecf1; }
.cart-close { display: none; width: 36px; height: 36px; border-radius: 10px; font-size: 24px; background: var(--soft); }
.lines { flex: 1; overflow-y: auto; scrollbar-width: thin; padding: 6px 12px; }
.line { display: grid; grid-template-columns: 38px 1fr auto 78px; grid-template-areas: "ic name name x" "ic sub qty tot"; align-items: center; gap: 2px 10px; padding: 10px 8px; border-radius: 12px; animation: pop .2s ease; }
.line + .line { border-top: 1px dashed var(--line); }
.line-ic { grid-area: ic; align-self: start; margin-top: 2px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; font-size: 20px; background: color-mix(in srgb, var(--c) 13%, #fff); }
.line-name { grid-area: name; min-width: 0; font-weight: 600; font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-sub { grid-area: sub; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qty { grid-area: qty; display: flex; align-items: center; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }
.qty button { width: 30px; height: 32px; font-size: 18px; font-weight: 600; color: var(--brand); border-radius: 9px; }
.qty button:hover { background: #fff0e9; }
.qty span { min-width: 26px; text-align: center; font: 600 14px/1 "Manrope", sans-serif; }
.qty .qty-kg { width: auto; padding: 0 10px; font-size: 13.5px; color: var(--ink); white-space: nowrap; }
.line-tot { grid-area: tot; text-align: right; font: 600 14px/1.2 "Manrope", sans-serif; }
.line-x { grid-area: x; justify-self: end; width: 24px; height: 24px; border-radius: 8px; color: var(--muted); font-size: 18px; line-height: 1; }
.line-x:hover { background: #fdecf1; color: var(--bad); }
.cart-empty { height: 100%; min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; color: var(--muted); padding: 20px; }
.ce-ic { font-size: 42px; width: 84px; height: 84px; display: grid; place-items: center; border-radius: 50%; background: var(--soft); margin-bottom: 10px; }
.cart-empty b { color: var(--ink-2); }
.cart-foot { padding: 14px 20px 18px; border-top: 1px solid var(--line); background: var(--soft); }
.cart-foot .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 14px; color: var(--ink-2); }
.cart-foot .row b { font: 600 14.5px/1.3 "Manrope", sans-serif; color: var(--ink); }
.cart-foot .row small { color: var(--muted); }
.disc-in { display: flex; align-items: center; gap: 6px; margin-right: auto; margin-left: 10px; }
.disc-in input { width: 78px; height: 32px; padding: 0 8px; border-radius: 9px; border: 1px solid var(--line); background: #fff; text-align: right; }
.neg { color: var(--bad) !important; }
.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: #e9ebe5; }
.seg button { padding: 4px 9px; border-radius: 7px; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(22, 24, 29, .12); }
.seg.big button { padding: 8px 16px; font-size: 14px; }
.row.grand { padding-top: 10px; margin-top: 6px; border-top: 1px dashed #d7dad3; }
.row.grand span { font-weight: 700; color: var(--ink); font-size: 16px; }
.row.grand b { font-size: 24px !important; font-weight: 700 !important; letter-spacing: -.5px; }
.pay-btn {
  width: 100%; margin-top: 12px; height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 20px; border-radius: 15px;
  background: var(--brand); color: #fff; font-size: 17px; font-weight: 700;
  box-shadow: 0 10px 24px rgba(255, 90, 31, .35); transition: transform .12s, filter .12s;
}
.pay-btn b { margin-left: auto; font: 700 18px/1 "Manrope", sans-serif; }
.pay-btn kbd { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .25); color: #fff; }
.pay-btn:hover:not(:disabled) { filter: brightness(1.07); }
.pay-btn:active:not(:disabled) { transform: scale(.99); }
.pay-btn:disabled { background: #c9ccc4; box-shadow: none; }
.cart-fab { display: none; }
@media (min-width: 900px) {
  body[data-page="bill"] .main { height: calc(100vh - var(--bar)); overflow: hidden; }
  body[data-page="bill"] #pg-bill.on { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: 18px; }
  .bill-grid { flex: 1; min-height: 0; }
  .catalog { height: 100%; min-height: 0; display: flex; flex-direction: column; }
  .tiles { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; align-content: start; margin: 0 -6px; padding: 4px 6px 16px; }
  .cart { height: 100%; min-height: 0; }
}

/* panels & reports */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpis.three { grid-template-columns: repeat(3, 1fr); }
.kpi { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); min-width: 0; }
.kpi > div { min-width: 0; display: flex; flex-direction: column; }
.kpi-ic { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--soft); font-size: 24px; }
.kpi > div > span { font-size: 13.5px; color: var(--muted); }
.kpi b { font: 700 22px/1.3 "Manrope", sans-serif; letter-spacing: -.4px; white-space: nowrap; }
.kpi small { font-size: 12.5px; color: var(--muted); }
.kpi em { font-style: normal; font-weight: 700; }
.kpi em.up { color: #3ddc84; }
.kpi em.down { color: #ff9a9a; }
.kpi.hero { background: var(--ink); color: #fff; box-shadow: 0 12px 28px rgba(255, 90, 31, .3); }
.kpi.hero > div > span, .kpi.hero small { color: rgba(255, 255, 255, .8); }
.kpi.hero .kpi-ic { background: rgba(255, 255, 255, .16); }
.kpi.warn .kpi-ic { background: #fff4e0; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; min-width: 0; }
.panel h3 { font-size: 16.5px; font-weight: 700; margin-bottom: 14px; }
.panel h3 small { color: var(--muted); font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.grid-2 > .panel { margin-bottom: 16px; display: flex; flex-direction: column; }
.grid-2 > .panel > .bars { flex: 1; min-height: 200px; height: auto; }
.grid-2.settings { align-items: start; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding-top: 18px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; position: relative; }
.bar i { width: 100%; max-width: 34px; min-height: 3px; border-radius: 8px 8px 4px 4px; background: #4a4f58; transition: height .4s; }
.bar.now i { background: linear-gradient(180deg, var(--brand), var(--brand-2)); }
.bar span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.bar em { font: 600 11.5px/1 "Manrope", sans-serif; font-style: normal; color: var(--ink-2); }
.bars.week .bar i { max-width: 46px; }
.bars.week .bar.now span { color: var(--brand); font-weight: 700; }
.bars.hours .bar:hover i, .bars.week .bar:hover i { filter: brightness(.92); }

.mix { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut { width: 168px; height: 168px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.donut > div { width: 108px; height: 108px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut b { font: 700 28px/1 "Manrope", sans-serif; }
.donut span { font-size: 12.5px; color: var(--muted); }
.mix ul { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 180px; }
.mix li { display: grid; grid-template-columns: 12px 1fr auto 42px; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.mix li:last-child { border: 0; }
.mix li i { width: 12px; height: 12px; border-radius: 4px; }
.mix li b { font: 600 14px/1 "Manrope", sans-serif; }
.mix li small { text-align: right; color: var(--muted); }

.top { display: flex; flex-direction: column; gap: 12px; }
.top-row { display: flex; gap: 12px; align-items: center; }
.top-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; font-size: 20px; background: color-mix(in srgb, var(--c) 13%, #fff); }
.top-main { flex: 1; min-width: 0; }
.top-main > div:first-child { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.top-main > div:first-child span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.top-main b { font: 600 14px/1.4 "Manrope", sans-serif; white-space: nowrap; }
.top-bar { height: 6px; border-radius: 6px; background: var(--soft); margin: 5px 0 2px; overflow: hidden; }
.top-bar i { display: block; height: 100%; border-radius: 6px; }
.top-main small { font-size: 12px; color: var(--muted); }

.tbl-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.r { text-align: right; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid #eef0eb; vertical-align: middle; }
.tbl tbody tr:hover td { background: #fafaf7; }
.tbl tr.click { cursor: pointer; }
.tbl td small { display: block; }
.tbl td small.muted { display: inline; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.m-cash { background: #e2f7f3; color: #0b7d71; }
.m-card { background: #fff0e9; color: #c2410c; }
.m-credit { background: #fff1d9; color: #a3650a; }
.s-ok { background: #e2f7f3; color: #0b7d71; }
.s-low { background: #fff1d9; color: #a3650a; }
.s-out { background: #fde6ec; color: #b8325a; }
.link-btn { color: var(--brand); font-weight: 600; font-size: 13.5px; }
.link-btn:hover { text-decoration: underline; }

/* stock */
.alert { padding: 12px 16px; border-radius: 14px; background: #fff6e6; border: 1px solid #ffe0a8; color: #7a4e07; margin-bottom: 16px; font-size: 14px; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar h3 { margin: 0 auto 0 0; }
.ti { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.ti-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 11px; font-size: 21px; background: color-mix(in srgb, var(--c) 13%, #fff); }
.ti b { display: block; font-weight: 600; }
.ti small { color: var(--muted); font-size: 12px; }
.bc { color: var(--muted); font-size: 11.5px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 14.5px; white-space: nowrap; transition: filter .12s, background .12s; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(255, 90, 31, .28); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.primary:disabled { background: #c9ccc4; box-shadow: none; }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
.btn.ghost:hover { background: var(--soft); }
.btn.soft { background: #fff0e9; color: var(--brand); }
.btn.soft:hover { background: #ffe3d6; }
.btn.wa { background: var(--wa); color: #fff; }
.btn.wa:hover { filter: brightness(1.07); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.big { height: 52px; font-size: 16px; }

/* credit */
.credit-grid { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
.cust-list { padding: 16px 12px; }
.cust-list .toolbar { padding: 0 8px; }
.cust { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; text-align: left; transition: background .12s; }
.cust:hover { background: var(--soft); }
.cust.on { background: #fff0e9; box-shadow: inset 3px 0 0 var(--brand); }
.av { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 16px; color: #fff; background: var(--ink); }
.av.lg { width: 56px; height: 56px; font-size: 22px; }
.cn { flex: 1; min-width: 0; }
.cn b { display: block; font-weight: 600; font-size: 14.5px; }
.cn small, .cb small { font-size: 12px; color: var(--muted); }
.cb { text-align: right; }
.cb b { display: block; font: 600 14.5px/1.3 "Manrope", sans-serif; white-space: nowrap; }
.cb.over b, .cb.over small { color: var(--bad); }
.pick-hint { padding: 60px 20px; text-align: center; color: var(--muted); }
.back-btn { display: none; margin-bottom: 12px; color: var(--brand); font-weight: 600; }
.cd-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.cd-head h3 { margin: 0; font-size: 19px; }
.cd-head > div > span { color: var(--muted); font-size: 14px; }
.cd-bal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 10px; padding: 16px 18px; border-radius: 14px; background: var(--soft); }
.cd-bal span { display: block; font-size: 13px; color: var(--muted); }
.cd-bal b { font: 700 22px/1.3 "Manrope", sans-serif; }
.cd-bal .r b { font-size: 16px; color: var(--ink-2); }
.cd-bal .meter { flex-basis: 100%; height: 8px; border-radius: 8px; background: #e6e8e2; overflow: hidden; }
.cd-bal .meter i { display: block; height: 100%; border-radius: 8px; background: var(--ok); }
.cd-bal.over { background: #fff0f3; }
.cd-bal.over b:first-of-type { color: var(--bad); }
.cd-bal.over .meter i { background: var(--bad); }
.cd-bal small { color: var(--bad); font-weight: 600; }
.cd-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 20px; }
.cust-detail h4 { font-size: 15px; margin-bottom: 8px; }
.tx-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px dashed var(--line); }
.tx-row > div:nth-child(2) { flex: 1; min-width: 0; }
.tx-row b { display: block; font-weight: 600; font-size: 14px; }
.tx-row small { display: block; font-size: 12px; color: var(--muted); }
.tx-row .r b { font-family: "Manrope", sans-serif; }
.tx-ic { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 700; }
.t-sale .tx-ic { background: #fff1d9; color: #a3650a; }
.t-pay .tx-ic { background: #e2f7f3; color: #0b7d71; }
.t-pay .r b { color: #0b7d71; }
.t-open .tx-ic { background: var(--soft); color: var(--muted); }

/* settings */
.settings .stack { display: flex; flex-direction: column; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.form label.full { grid-column: 1 / -1; }
.form label small { font-weight: 400; color: var(--muted); }
.form input, .form select { height: 46px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 400; font-size: 15px; outline: 0; }
.form input:focus, .form select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255, 90, 31, .12); }
.promo { background: var(--ink); color: #e6e8ff; }
.promo h3 { color: #fff; }
.promo ul { padding: 0; margin: 0 0 18px; list-style: none; }
.promo li { padding: 6px 0 6px 28px; position: relative; font-size: 14px; }
.promo li::before { content: "✓"; position: absolute; left: 0; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: rgba(47, 211, 155, .2); color: #3ddc84; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.promo .btn { width: 100%; }

/* modal */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(13, 14, 17, .5); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
.modal-wrap[hidden] { display: none; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; border-radius: 22px; padding: 22px; box-shadow: 0 30px 80px rgba(13, 14, 17, .35); animation: rise .2s ease; }
.modal.sm { max-width: 440px; }
.modal.rc { max-width: 430px; }
.modal p { color: var(--ink-2); }
.m-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.m-head > div { flex: 1; min-width: 0; }
.m-head h3 { font-size: 19px; font-weight: 700; }
.m-head > div > span { font-size: 13.5px; color: var(--muted); }
.m-head .x { width: 36px; height: 36px; flex: none; border-radius: 10px; font-size: 22px; color: var(--muted); background: var(--soft); }
.m-head .x:hover { color: var(--ink); background: #e9ebe5; }
.m-ic { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 13px; font-size: 26px; background: color-mix(in srgb, var(--c) 14%, #fff); }
.m-head .av { width: 44px; height: 44px; }
.done-ic { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #dff7ef; color: var(--ok); font-size: 22px; font-weight: 700; }
.m-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.m-actions .btn { flex: 1; }
.m-actions.three .btn { padding: 0 10px; }
.weigh { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.weigh label, .big-in { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.weigh input, .big-in input { height: 56px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--line); font: 600 22px/1 "Manrope", sans-serif; outline: 0; width: 100%; }
.weigh input:focus, .big-in input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255, 90, 31, .12); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.quick button { flex: 1 1 0; min-width: 50px; height: 40px; padding: 0 10px; border-radius: 11px; background: var(--soft); border: 1px solid var(--line); font: 600 14px/1 "Manrope", "Noto Sans Sinhala", sans-serif; color: var(--ink-2); white-space: nowrap; }
.quick button:hover { border-color: var(--brand); color: var(--brand); background: #fff0e9; }
.m-total { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--soft); }
.m-total b { font: 700 22px/1 "Manrope", sans-serif; }
.pay-total { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-radius: 16px; background: var(--ink); color: #fff; margin-bottom: 16px; }
.pay-total span { opacity: .85; }
.pay-total b { font: 700 30px/1 "Manrope", sans-serif; letter-spacing: -.5px; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.tabs button { height: 48px; border-radius: 13px; border: 1.5px solid var(--line); font-weight: 600; font-size: 15px; color: var(--ink-2); background: #fff; }
.tabs button.on { border-color: var(--brand); background: #fff0e9; color: var(--brand); }
.change { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; margin-top: 14px; padding: 16px 18px; border-radius: 14px; background: var(--soft); }
.change b { font: 700 26px/1.1 "Manrope", sans-serif; }
.change small { flex-basis: 100%; font-size: 12.5px; color: var(--muted); }
.change.good { background: #e2f7f3; color: #0b6e63; }
.change.short { background: #fde9ee; color: #b8325a; }
.change.short small { color: #b8325a; }
.card-note { padding: 22px; border-radius: 14px; background: var(--soft); text-align: center; color: var(--ink-2); }
.cust-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cp { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 13px; border: 1.5px solid var(--line); text-align: left; min-width: 0; }
.cp .av { width: 34px; height: 34px; font-size: 14px; }
.cp.on { border-color: var(--brand); background: #fff0e9; }
.cp-n { min-width: 0; font-weight: 600; font-size: 14px; line-height: 1.3; }
.cp-n small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* receipt */
.rcpt-wrap { padding: 18px; border-radius: 16px; background: var(--soft); }
.rcpt { max-width: 300px; margin: 0 auto; background: #fff; padding: 18px 16px 14px; font: 13px/1.45 "Noto Sans Sinhala", "Manrope", sans-serif; color: #111; box-shadow: 0 6px 18px rgba(22, 24, 29, .12); border-radius: 4px; }
.r-shop { text-align: center; font-weight: 700; font-size: 17px; }
.r-addr { text-align: center; font-size: 11.5px; color: #555; margin-bottom: 8px; }
.r-meta { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; padding: 6px 0; border-top: 1px dashed #999; border-bottom: 1px dashed #999; }
.rcpt table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.rcpt td { padding: 0; vertical-align: top; }
.rcpt .rn { padding-top: 5px; font-weight: 600; }
.rcpt .rq td { font-size: 12px; color: #444; }
.rcpt .rq td:last-child { text-align: right; color: #111; font-weight: 600; }
.r-tot { display: flex; justify-content: space-between; font-size: 12.5px; padding: 1px 0; }
.r-grand { font-size: 15px; font-weight: 700; padding: 6px 0; margin: 4px 0; border-top: 1px dashed #999; border-bottom: 1px dashed #999; }
.r-foot { text-align: center; margin-top: 10px; font-weight: 600; }
.r-pow { text-align: center; font-size: 10.5px; color: #777; margin-top: 4px; }
#printArea { display: none; }

/* toasts */
.toasts { position: fixed; left: 50%; top: calc(var(--bar) + 14px); transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { padding: 11px 18px; border-radius: 12px; background: #16181d; color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px rgba(13, 14, 17, .3); animation: rise .2s ease; transition: opacity .3s, transform .3s; }
.toast.ok { background: #0d6e64; }
.toast.bad { background: #b8325a; }
.toast.warn { background: #8a5a06; }
.toast.out { opacity: 0; transform: translateY(8px); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop { from { opacity: 0; transform: translateX(8px); } }

/* medium screens */
@media (max-width: 1280px) {
  :root { --side: 84px; --cartw: 360px; }
  .side { padding: 18px 10px; align-items: center; }
  .brand { padding: 4px 0 22px; }
  .brand-txt, .offline-pill span { display: none; }
  .nav button { flex-direction: column; gap: 4px; padding: 10px 6px; font-size: 11.5px; width: 64px; text-align: center; line-height: 1.25; }
  .nav-badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; font-size: 10.5px; line-height: 18px; padding: 0 4px; }
  .offline-pill { justify-content: center; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .credit-grid { grid-template-columns: 320px 1fr; }
}

/* phones & small tablets */
@media (max-width: 899px) {
  :root { --bar: 44px; }
  body { font-size: 14.5px; }
  .demo-bar { padding: 0 12px; gap: 8px; font-size: 12px; }
  .demo-msg { white-space: normal; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .demo-cta { padding: 6px 10px; font-size: 12px; }
  .app { display: block; }
  .side {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 70; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    flex-direction: row; box-shadow: 0 -6px 24px rgba(13, 14, 17, .2);
  }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; gap: 2px; }
  .nav button { flex: 1; width: auto; padding: 7px 2px; font-size: 11px; border-radius: 10px; }
  .main { padding-bottom: 80px; }
  .topbar { padding: 14px 16px 2px; }
  .topbar h1 { font-size: 20px; }
  .clock span { display: none; }
  .clock b { font-size: 15px; }
  .page { padding: 10px 16px 24px; }
  .bill-grid { display: block; }
  .search { height: 48px; }
  .scan-btn { padding: 0 12px; }
  .scan-btn span, .search kbd { display: none; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding-bottom: 76px; }
  .tile { min-height: 150px; padding: 12px; }
  .tile-ic { width: 44px; height: 44px; font-size: 24px; }
  .cart {
    position: fixed; inset: auto 0 0 0; top: auto; height: 88vh; min-height: 0; z-index: 90; border-radius: 22px 22px 0 0;
    transform: translateY(105%); transition: transform .25s ease; box-shadow: 0 -20px 50px rgba(13, 14, 17, .3);
  }
  body.cart-open .cart { transform: none; }
  body.cart-open::after { content: ""; position: fixed; inset: 0; background: rgba(13, 14, 17, .45); z-index: 80; }
  .cart-close { display: grid; place-items: center; }
  .cart-foot { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .pay-btn kbd { display: none; }
  .line-ic { width: 34px; height: 34px; font-size: 18px; }
  .cart-fab {
    position: fixed; left: 16px; right: 16px; bottom: 74px; z-index: 65; height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 18px;
    border-radius: 16px; background: #c9ccc4; color: #fff; font-weight: 600; box-shadow: 0 10px 24px rgba(13, 14, 17, .25);
  }
  .cart-fab.has { background: var(--brand); }
  .cart-fab b { margin-left: auto; font: 700 17px/1 "Manrope", sans-serif; }
  .fab-n { min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font: 700 13px/1 "Manrope", sans-serif; }
  #pg-bill:not(.on) .cart-fab { display: none; }
  .kpis, .kpis.three { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpis.three .kpi:first-child { grid-column: 1 / -1; }
  .kpi { padding: 14px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .kpi-ic { width: 40px; height: 40px; font-size: 20px; }
  .kpi b { font-size: 18px; }
  .kpi.hero { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .kpi.hero b { font-size: 24px; }
  .kpis .kpi:nth-child(4):last-child { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .bills-tbl th:nth-child(3), .bills-tbl td:nth-child(3), .bills-tbl th:nth-child(6), .bills-tbl td:nth-child(6) { display: none; }
  .bills-tbl td, .bills-tbl th { white-space: nowrap; padding: 10px 6px; }
  .bills-tbl td small.muted { display: none; }
  .stock-tbl thead { display: none; }
  .stock-tbl, .stock-tbl tbody { display: block; }
  .stock-tbl tr { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid #eef0eb; }
  .stock-tbl td { border: 0; padding: 0; text-align: left; }
  .stock-tbl tbody tr:hover td { background: none; }
  .stock-tbl td:nth-child(1) { grid-column: 1 / -1; }
  .stock-tbl td:nth-child(4), .stock-tbl td:nth-child(7) { text-align: right; }
  .stock-tbl td:nth-child(4)::before { content: "📦 "; }
  .panel { padding: 16px; }
  .tbl-wrap { margin: 0 -16px; padding: 0 16px; }
  .bars { height: 170px; gap: 3px; }
  .bars.hours .bar span { font-size: 10px; }
  .bars.hours .bar:nth-child(even) span { visibility: hidden; }
  .bar em { font-size: 10px; }
  .donut { width: 140px; height: 140px; margin: 0 auto; }
  .donut > div { width: 90px; height: 90px; }
  .mix { justify-content: center; }
  .credit-grid { display: block; }
  .credit-grid.has-sel .cust-list { display: none; }
  .credit-grid:not(.has-sel) .cust-detail { display: none; }
  .back-btn { display: inline-block; }
  .toolbar .btn.primary { flex: 1 1 100%; }
  .cust-list .toolbar .btn.primary { flex: 0 0 auto; }
  .form { grid-template-columns: 1fr; }
  .modal-wrap { place-items: end center; padding: 0; }
  .modal { max-width: none !important; border-radius: 22px 22px 0 0; max-height: 92vh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .cust-pick { grid-template-columns: 1fr; }
  .stock-tbl th:nth-child(2), .stock-tbl td:nth-child(2), .stock-tbl th:nth-child(5), .stock-tbl td:nth-child(5) { display: none; }
}

@media (max-width: 420px) {
  .demo-cta span { display: none; }
  .demo-cta { padding: 7px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .lang span { padding: 5px 9px; }
}

/* print: receipt only, 80mm roll */
@media print {
  @page { size: 80mm auto; margin: 0; }
  body { background: #fff; }
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block; }
  #printArea .rcpt { max-width: none; width: 72mm; margin: 0 auto; box-shadow: none; padding: 4mm 0; }
}

/* ===== Samsoft POS look: light cashier UI, charcoal top bar, orange actions ===== */
body { font-weight: 500; }
.demo-bar { font-size: 12.5px; }
.demo-tag { background: var(--brand); color: #fff; }
.demo-cta { border-radius: 8px; }

/* top navigation bar instead of a sidebar */
.app { display: block; }
.side {
  position: sticky; top: var(--bar); z-index: 55; height: var(--nav); width: 100%;
  flex-direction: row; align-items: center; gap: 28px; padding: 0 22px;
  background: var(--ink); color: #b9bec7; box-shadow: none;
}
.brand { padding: 0; gap: 10px; }
.brand-mark { width: 32px; height: 32px; border-radius: 0; background: url(samsoft-mark.png) center / contain no-repeat; box-shadow: none; font-size: 0; color: transparent; }
.brand-txt { font: 800 17px/1 "Manrope", sans-serif; letter-spacing: -.02em; display: inline !important; }
.brand-txt b { font-weight: 800; }
.nav { flex-direction: row; gap: 2px; height: 100%; }
.nav button { height: 100%; flex-direction: row !important; width: auto !important; padding: 0 16px !important; gap: 9px; border-radius: 0; font-size: 14.5px !important; color: #b9bec7; border-bottom: 3px solid transparent; border-top: 3px solid transparent; background: none !important; box-shadow: none !important; }
.nav button svg { width: 18px; height: 18px; }
.nav button:hover { color: #fff; }
.nav button.on { color: #fff; border-bottom-color: var(--brand); }
.nav-badge { position: static !important; background: var(--brand); color: #fff; margin-left: 2px; }
.side-foot { margin: 0 0 0 auto; }
.offline-pill { background: rgba(255, 255, 255, .06); border-radius: 30px; padding: 7px 12px; }
.offline-pill span { display: inline !important; }
.offline-pill i { background: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, .2); }
.topbar { padding: 18px 24px 6px; }
.topbar h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
html[data-lang="si"] .topbar h1 { letter-spacing: 0; font-size: 23px; }
.lang { border-radius: 8px; padding: 3px; }
.lang span { border-radius: 6px; }

/* billing */
.search { border: 2px solid var(--ink); box-shadow: none; border-radius: 10px; }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 90, 31, .18); }
.scan-btn { border: 2px dashed #c3c7bf; color: var(--ink); border-radius: 10px; }
.scan-btn:hover { background: #fff; border-color: var(--brand); color: var(--brand-d); }
.chip { border-radius: 8px; padding: 8px 14px 8px 10px; background: #fff; border: 1px solid var(--line); }
.chip-ic { background: none !important; width: auto; height: auto; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: none; }
.tile { border-radius: 10px; border: 1px solid var(--line); box-shadow: none; padding: 14px 14px 12px; min-height: 158px; }
.tile::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--c); opacity: .85; }
.tile:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--ink); box-shadow: 0 6px 16px rgba(22, 24, 29, .08); }
.tile.in { border: 2px solid var(--brand); background: #fff; padding: 13px 13px 11px; }
.tile-ic { width: auto; height: auto; background: none; font-size: 30px; margin-bottom: 8px; }
.tile-name { font-weight: 700; font-size: 15px; }
.tile-price { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.tile-n { background: var(--brand); border-radius: 6px; }
.line-ic, .top-ic, .ti-ic, .m-ic { background: none; }

/* cart = dark receipt panel */
.cart { border-radius: 12px; border: 1px solid var(--line); box-shadow: none; }
.cart-head { background: var(--ink); color: #fff; border: 0; }
.cart-head span { color: #9aa0aa; }
.ghost-btn { color: #ff9a7a; }
.ghost-btn:hover { background: rgba(255, 255, 255, .08); }
.cart-close { background: rgba(255, 255, 255, .1); color: #fff; }
.qty { border-radius: 8px; }
.qty button { color: var(--ink); border-radius: 7px; }
.qty button:hover { background: #fff0e9; color: var(--brand-d); }
.cart-foot { background: var(--soft); }
.row.grand b { font-weight: 800 !important; font-size: 26px !important; }
.pay-btn { border-radius: 10px; background: var(--brand); box-shadow: none; font-weight: 800; }
.pay-btn:hover:not(:disabled) { filter: none; background: var(--brand-d); }
.pay-btn:disabled { background: #d5d8d0; color: #fff; }
.seg { border-radius: 8px; }
.seg button { border-radius: 6px; }
.ce-ic { background: var(--soft); border: 1px dashed #c9ccc4; }

/* KPI row: big numbers, no icon boxes */
.kpi { display: block; border: 1px solid var(--line); box-shadow: none; padding: 16px 18px; border-radius: 10px; }
.kpi-ic { display: none; }
.kpi > div > span { font-size: 13px; font-weight: 600; }
.kpi b { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.kpi.hero { background: var(--ink); box-shadow: none; border-color: var(--ink); }
.kpi.hero b { color: #fff; }
.kpi.hero > div > span { color: #9aa0aa; }
.kpi.hero::before { content: ""; display: block; width: 26px; height: 4px; border-radius: 2px; background: var(--brand); margin-bottom: 10px; }
.kpi.warn { border-color: #ffd1bd; background: #fff7f2; }
.kpi.warn b { color: var(--brand-d); }

.panel { border: 1px solid var(--line); box-shadow: none; border-radius: 12px; }
.panel h3 { font-weight: 800; }
.bar i { border-radius: 4px 4px 0 0; }
.bar.now i { background: var(--brand); }
.bars.week .bar.now span { color: var(--brand-d); }
.tbl th { color: var(--muted); text-transform: uppercase; font-size: 11.5px; letter-spacing: .06em; }
html[data-lang="si"] .tbl th { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.pill { border-radius: 6px; }
.m-cash, .s-ok { background: #e3f5ea; color: #0f6e3a; }
.m-card { background: #e8eefc; color: #2b4fa8; }
.m-credit, .s-low { background: #fff0e0; color: #a35a00; }
.s-out { background: #fde4e4; color: #b42020; }
.link-btn { color: var(--brand-d); }
.alert { border-radius: 10px; background: #fff7f2; border: 1px solid #ffd1bd; color: #8a3410; }

.btn { border-radius: 9px; }
.btn.primary { box-shadow: none; }
.btn.primary:hover:not(:disabled) { filter: none; background: var(--brand-d); }
.btn.ghost { border: 1px solid #c9ccc4; }
.btn.soft { background: #fff0e9; color: var(--brand-d); }
.btn.soft:hover { background: #ffe3d6; }

.cust { border-radius: 8px; }
.cust.on { background: #fff4ee; box-shadow: inset 3px 0 0 var(--brand); }
.av { border-radius: 10px; background: var(--ink); }
.cd-bal { border-radius: 10px; border: 1px solid var(--line); }
.cd-bal .meter i { background: var(--ok); }
.promo { background: var(--ink); }
.promo li::before { background: rgba(255, 90, 31, .2); color: #ff9a7a; }
.pay-total { background: var(--ink); border-radius: 12px; }
.pay-total b { color: #fff; }
.tabs button { border-radius: 9px; }
.tabs button.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.modal { border-radius: 14px; }
.cp.on { border-color: var(--brand); background: #fff4ee; }
.toast { border-radius: 9px; }

@media (min-width: 900px) {
  body[data-page="bill"] .main { height: calc(100vh - var(--bar) - var(--nav)); }
}
@media (max-width: 1280px) {
  .side { gap: 18px; padding: 0 16px; }
  .brand-txt { display: none !important; }
  .nav button { padding: 0 12px !important; font-size: 13.5px !important; }
  .offline-pill span { display: none !important; }
}
@media (max-width: 899px) {
  .side { position: fixed; top: auto; bottom: 0; height: auto; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .nav button { flex-direction: column !important; gap: 3px; padding: 6px 2px !important; font-size: 11px !important; border: 0; border-top: 3px solid transparent; }
  .nav button.on { border-bottom: 0; border-top-color: var(--brand); }
  .nav-badge { position: absolute !important; top: 2px; right: 8px; }
  .cart { border-radius: 16px 16px 0 0; }
  .cart-fab { border-radius: 12px; }
  .cart-fab.has { background: var(--brand); }
  .kpi.hero, .kpis .kpi:nth-child(4):last-child { display: block; }
}
