/* Taj Kirana ERP — stylesheet */
@font-face { font-family: "Figtree"; font-style: normal; font-display: swap; font-weight: 300 900;
  src: url(../fonts/figtree-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; font-style: normal; font-display: swap; font-weight: 300 900;
  src: url(../fonts/figtree-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ink: #10302a;
  --ink-2: #1a4238;
  --leaf: #1b7a56;
  --leaf-dark: #145f43;
  --leaf-soft: #e3f1ea;
  --haldi: #f0b429;
  --haldi-soft: #fdf3d8;
  --chili: #c2412d;
  --chili-soft: #fbe9e5;
  --sky: #2563a8;
  --sky-soft: #e5eef8;
  --paper: #f3f5f1;
  --surface: #ffffff;
  --line: #e0e5dd;
  --line-2: #cfd7cb;
  --text: #1b2420;
  --muted: #66716b;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 48, 42, .06), 0 2px 8px rgba(16, 48, 42, .04);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--text); background: var(--paper); font-feature-settings: "tnum" 1; }
a { color: var(--leaf); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 .6em; }
:focus-visible { outline: 2.5px solid var(--haldi); outline-offset: 2px; }
.ic { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 236px; flex: none; background: var(--ink); color: #cfe0d8; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; text-decoration: none !important; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--haldi); color: var(--ink); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.nav-group { font-size: 12px; color: #82a397; padding: 14px 10px 4px; font-weight: 600; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: #d5e4dd; font-weight: 500; text-decoration: none !important; }
.nav-link:hover { background: var(--ink-2); color: #fff; }
.nav-link.active { background: rgba(240, 180, 41, .14); color: #fff; box-shadow: inset 3px 0 0 var(--haldi); }
.nav-link.active .ic { color: var(--haldi); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--leaf); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.who { flex: 1; min-width: 0; line-height: 1.2; }
.who strong { display: block; color: #fff; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: #8fb0a3; font-size: 12px; }
.sidebar .icon-btn { color: #b9d0c6; }
.sidebar .icon-btn:hover { background: var(--ink-2); color: #fff; }
.scrim { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 28px 6px; flex-wrap: wrap; }
.topbar-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; flex-wrap: wrap; }
.topbar-title h1 { font-size: 23px; font-weight: 800; letter-spacing: -.025em; }
.topbar-title .sub { margin: 0; color: var(--muted); width: 100%; font-size: 13.5px; }
.topbar-title .back { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--text); border: 1px solid var(--line); background: var(--surface); }
.topbar-title .back:hover { border-color: var(--line-2); }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.menu-btn { display: none !important; }
.content { padding: 14px 28px 40px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s; }
.btn:hover { background: #f6f8f5; border-color: #b9c4b5; }
.btn .ic { width: 17px; height: 17px; }
.btn-primary { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.btn-primary:hover { background: var(--leaf-dark); border-color: var(--leaf-dark); }
.btn-danger { color: var(--chili); border-color: #e9c3bb; }
.btn-danger:hover { background: var(--chili-soft); border-color: var(--chili); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(16,48,42,.06); border-color: transparent; }
.btn-sm { height: 31px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: rgba(16,48,42,.07); color: var(--text); }
.actions-cell { display: flex; gap: 4px; justify-content: flex-end; }
.actions-cell form { margin: 0; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head .muted { font-size: 13px; }
.panel-body { padding: 18px; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid > .panel + .panel { margin-top: 0; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; } .col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span, .label { font-size: 13px; font-weight: 600; color: #3a4640; }
.field small, .hint { color: var(--muted); font-size: 12.5px; }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; font: inherit; color: var(--text); }
textarea.input { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; }
select.input { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2366716b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.input:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(27,122,86,.15); }
.input.num { text-align: right; }
.input-group { display: flex; align-items: stretch; }
.input-group .addon { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--line-2); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: #f4f6f2; color: var(--muted); font-weight: 600; }
.input-group .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--leaf); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------- Toolbar & filters ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; }
.toolbar .search .input { padding-left: 34px; }
.toolbar select.input, .toolbar input[type=date] { width: auto; min-width: 140px; }
.toolbar .spacer { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none !important; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbf9; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid #edf0ea; vertical-align: middle; }
.table tbody tr:hover { background: #fafcf9; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num, .table th.num { text-align: right; white-space: nowrap; }
.table tfoot td { font-weight: 700; border-top: 1px solid var(--line); background: #fafbf9; }
.table .strong { font-weight: 650; }
.table .sub { display: block; font-size: 12.5px; color: var(--muted); }
.table-compact td, .table-compact th { padding: 8px 12px; }
.row-muted td { color: var(--muted); }
.row-muted td .strong { text-decoration: line-through; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 650; background: #eef1ec; color: #48544e; white-space: nowrap; }
.badge-green { background: var(--leaf-soft); color: var(--leaf-dark); }
.badge-red { background: var(--chili-soft); color: #a33320; }
.badge-yellow { background: var(--haldi-soft); color: #8a5d00; }
.badge-blue { background: var(--sky-soft); color: var(--sky); }
.text-red { color: var(--chili); } .text-green { color: var(--leaf); } .muted { color: var(--muted); }
.right { text-align: right; } .nowrap { white-space: nowrap; }
.mt { margin-top: 18px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pager .row { gap: 6px; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { width: 38px; height: 38px; color: #a7b5ad; margin-bottom: 8px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }

/* ---------- Dashboard ---------- */
.today { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.today > div { padding: 18px 20px; border-left: 1px solid var(--line); }
.today > div:first-child { border-left: 0; background: var(--ink); color: #fff; }
.today .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.today > div:first-child .k { color: #9fc0b3; }
.today .v { font-size: 25px; font-weight: 800; letter-spacing: -.03em; margin-top: 2px; }
.today > div:first-child .v { font-size: 32px; color: var(--haldi); }
.today .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.today > div:first-child .d { color: #bcd3c9; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 18px; border-bottom: 1px solid #eef1ec; align-items: center; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list .name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 6px; border-radius: 4px; background: #edf1ec; overflow: hidden; margin-top: 5px; }
.bar > i { display: block; height: 100%; background: var(--leaf); border-radius: 4px; }
.chart-box { position: relative; height: 260px; padding: 12px 16px 16px; }
.money-split { display: grid; grid-template-columns: repeat(4, 1fr); }
.money-split > div { padding: 16px 18px; border-left: 1px solid var(--line); }
.money-split > div:first-child { border-left: 0; }
.money-split .k { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); font-weight: 600; }
.money-split .v { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-top: 3px; }

/* ---------- Statement / summary lists ---------- */
.statement { width: 100%; border-collapse: collapse; }
.statement td { padding: 9px 18px; border-bottom: 1px solid #eef1ec; }
.statement td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
.statement tr.total td { font-weight: 800; font-size: 16px; border-top: 2px solid var(--text); border-bottom: 0; }
.statement tr.indent td:first-child { padding-left: 34px; color: var(--muted); }
.statement tr.head td { font-weight: 700; background: #fafbf9; }

/* ---------- Dialog ---------- */
dialog.modal { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(16,48,42,.3); color: var(--text); }
dialog.modal::backdrop { background: rgba(16, 32, 28, .45); }
dialog.modal[open] { animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fafbf9; }
dialog.modal-wide { width: min(820px, calc(100vw - 24px)); }

/* ---------- Flash ---------- */
.flash-stack { position: fixed; top: 14px; right: 14px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 28px)); }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 12px 12px 14px; border-radius: 10px; background: var(--ink); color: #fff; box-shadow: 0 8px 28px rgba(16,48,42,.25); animation: pop .2s ease-out; }
.flash .ic { color: #7ed3a8; margin-top: 1px; }
.flash-error { background: #5c1e14; }
.flash-error .ic { color: #ffb4a3; }
.flash span { flex: 1; }
.flash-x { background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 0; }
.flash-x .ic { color: inherit; width: 16px; }

/* ---------- Notices ---------- */
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 9px; background: var(--sky-soft); color: #1d4a7d; font-size: 13.5px; }
.notice .ic { margin-top: 1px; }
.notice-warn { background: var(--haldi-soft); color: #6d4a00; }
.notice-red { background: var(--chili-soft); color: #8a2a1a; }

/* ---------- Auth / installer ---------- */
body.plain { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--ink); background-image: radial-gradient(circle at 20% 10%, #1d4a3f 0, transparent 45%); }
.auth-card { width: min(400px, 100%); background: var(--surface); border-radius: 16px; padding: 30px 28px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.auth-card.wide { width: min(620px, 100%); }
.auth-card .brand-mark { width: 46px; height: 46px; border-radius: 12px; margin-bottom: 14px; }
.auth-card .brand-mark svg { width: 30px; height: 30px; }
.auth-card h1 { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.auth-card .lead { color: var(--muted); margin: 4px 0 22px; }
.auth-card .field { margin-bottom: 14px; }
.error-page { text-align: center; padding: 60px 20px; max-width: 460px; margin: 0 auto; }
body.plain .error-page { background: #fff; border-radius: 16px; }
.error-code { font-size: 64px; font-weight: 900; color: var(--haldi); letter-spacing: -.05em; line-height: 1; }
.error-page h2 { margin: 8px 0; font-size: 22px; }
.error-page p { color: var(--muted); margin-bottom: 18px; }

/* ---------- Document (invoice/purchase view) ---------- */
.doc { max-width: 860px; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.doc-head h2 { font-size: 20px; }
.doc-meta { display: grid; grid-template-columns: auto auto; gap: 3px 16px; font-size: 13.5px; }
.doc-meta dt { color: var(--muted); }
.doc-meta dd { margin: 0; font-weight: 600; text-align: right; }
.doc-totals { display: flex; justify-content: flex-end; padding: 14px 24px 22px; }
.doc-totals table { min-width: 280px; }
.doc-totals td { padding: 5px 0; }
.doc-totals td:last-child { text-align: right; font-weight: 600; padding-left: 30px; }
.doc-totals tr.grand td { font-size: 18px; font-weight: 800; border-top: 2px solid var(--text); padding-top: 9px; }

/* ---------- POS ---------- */
body.pos .content { padding: 0 20px 20px; }
body.pos .topbar { padding-bottom: 10px; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; height: calc(100vh - 92px); min-height: 520px; }
.pos-catalog { display: flex; flex-direction: column; min-height: 0; }
.pos-search { display: flex; gap: 10px; margin-bottom: 10px; }
.pos-search .search { position: relative; flex: 1; }
.pos-search .search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.pos-search .input { height: 48px; padding-left: 44px; font-size: 16px; border-radius: 10px; border-width: 1.5px; }
.pos-cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.pos-cats .chip { flex: none; }
.pos-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; padding: 2px 2px 10px; }
.pcard { display: flex; flex-direction: column; text-align: left; gap: 2px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; color: inherit; min-height: 96px; transition: border-color .1s, transform .06s; }
.pcard:hover { border-color: var(--leaf); }
.pcard:active { transform: scale(.98); }
.pcard .pn { font-weight: 650; line-height: 1.3; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .pp { font-weight: 800; font-size: 16px; color: var(--leaf-dark); }
.pcard .ps { font-size: 12px; color: var(--muted); }
.pcard .ps.low { color: var(--chili); font-weight: 600; }
.pcard.flash-add { border-color: var(--haldi); box-shadow: 0 0 0 3px var(--haldi-soft); }

/* The bill: a thermal receipt */
.bill { display: flex; flex-direction: column; min-height: 0; background: #fffef9; border-radius: 4px 4px 0 0; box-shadow: 0 2px 14px rgba(16,48,42,.12); position: relative; }
.bill::after { content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 10px; background: linear-gradient(-45deg, transparent 6px, #fffef9 0) 0 0 / 12px 10px repeat-x, linear-gradient(45deg, transparent 6px, #fffef9 0) 0 0 / 12px 10px repeat-x; filter: drop-shadow(0 3px 2px rgba(16,48,42,.08)); }
.bill-head { padding: 14px 16px 10px; border-bottom: 1.5px dashed #d6d3c4; }
.bill-head .row { gap: 8px; }
.bill-cust { flex: 1; position: relative; }
.bill-cust .input { height: 36px; background: #fff; }
.cust-results { position: absolute; top: 40px; left: 0; right: 0; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 10px 30px rgba(16,48,42,.15); z-index: 10; max-height: 240px; overflow-y: auto; }
.cust-results button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; font: inherit; cursor: pointer; border-bottom: 1px solid #f0f2ee; }
.cust-results button:hover, .cust-results button.on, .cust-results button.hl { background: var(--leaf-soft); }
.cust-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px; background: var(--leaf-soft); font-weight: 600; font-size: 13.5px; }
.bill-lines { flex: 1; overflow-y: auto; padding: 6px 0; }
.bill-empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.bill-empty .ic { width: 34px; height: 34px; color: #c3cbc4; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 9px 16px; border-bottom: 1px dotted #e3e0d2; }
.line .ln { font-weight: 600; line-height: 1.3; }
.line .lt { font-weight: 750; text-align: right; }
.line .lc { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.line .lc input { width: 66px; height: 28px; text-align: center; border: 1px solid var(--line-2); border-radius: 6px; font: inherit; }
.line .lc input.price { width: 76px; text-align: right; padding-right: 6px; }
.line .qbtn { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line-2); background: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; color: var(--text); }
.line .qbtn .ic { width: 14px; height: 14px; }
.line .rm { justify-self: end; color: #b9b5a5; }
.line .rm:hover { color: var(--chili); }
.line.warn .ln::after { content: " · low stock"; color: var(--chili); font-size: 12px; font-weight: 600; }
.bill-sum { padding: 10px 16px 6px; border-top: 1.5px dashed #d6d3c4; font-size: 14px; }
.bill-sum .r { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; }
.bill-sum .r input { width: 90px; height: 28px; text-align: right; border: 1px solid var(--line-2); border-radius: 6px; font: inherit; padding: 0 6px; }
.bill-total { display: flex; justify-content: space-between; align-items: baseline; margin: 6px -16px 0; padding: 12px 16px; background: var(--haldi); color: var(--ink); }
.bill-total span { font-weight: 700; }
.bill-total strong { font-size: 30px; font-weight: 900; letter-spacing: -.03em; }
.bill-pay { padding: 12px 16px 16px; }
.pay-methods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
.pay-methods label { cursor: pointer; }
.pay-methods input { position: absolute; opacity: 0; pointer-events: none; }
.pay-methods span { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border: 1.5px solid var(--line-2); border-radius: 8px; font-size: 12px; font-weight: 650; background: #fff; }
.pay-methods span .ic { width: 18px; height: 18px; }
.pay-methods input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.pay-methods input:focus-visible + span { outline: 2.5px solid var(--haldi); }
.tender { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.tender .input { height: 40px; font-size: 16px; font-weight: 700; }
.tender .change { display: flex; flex-direction: column; justify-content: center; padding: 0 12px; border-radius: 8px; background: var(--leaf-soft); }
.tender .change small { color: var(--muted); font-size: 12px; }
.tender .change strong { font-size: 17px; color: var(--leaf-dark); }
.quick-cash { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.quick-cash button { flex: 1; height: 30px; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.quick-cash button:hover { border-color: var(--leaf); }
.kbd { display: inline-block; padding: 0 5px; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; font-size: 11px; margin-left: 6px; }
.pos-mobile-bar { display: none; }

/* ---------- Import ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 20px; border: 2px dashed var(--line-2); border-radius: 12px; background: #fafbf9; text-align: center; cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--leaf); background: var(--leaf-soft); }
.dropzone .ic { width: 36px; height: 36px; color: var(--leaf); }
.dropzone input { display: none; }
.steps { display: flex; gap: 8px; margin-bottom: 16px; counter-reset: s; }
.steps li { list-style: none; display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.steps li::before { counter-increment: s; content: counter(s); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #e5e9e2; font-size: 12px; }
.steps li.on { color: var(--text); }
.steps li.on::before { background: var(--leaf); color: #fff; }
.steps li + li::after { order: -1; content: ""; width: 24px; height: 1px; background: var(--line-2); }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; background: #f1f4ef; padding: 1px 5px; border-radius: 4px; }

.bill-close { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .today { grid-template-columns: repeat(3, 1fr); }
  .today > div:first-child { grid-column: span 3; }
  .today > div:nth-child(2), .today > div:nth-child(4) { border-left: 0; }
  .today > div { border-top: 1px solid var(--line); }
  .today > div:nth-child(5) { grid-column: span 1; }
  .grid-main { grid-template-columns: 1fr; }
  .pos { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 30; }
  .menu-btn { display: inline-grid !important; }
  .topbar { padding: 12px 16px 4px; }
  .topbar-title h1 { font-size: 20px; }
  .content { padding: 12px 16px 32px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .money-split { grid-template-columns: 1fr 1fr; }
  .money-split > div:nth-child(3) { border-left: 0; }
  .money-split > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .col-8, .col-6, .col-4, .col-3 { grid-column: span 12; }
  .form-grid .col-3.half, .form-grid .col-4.half, .form-grid .col-6.half { grid-column: span 6; }
  /* POS on phones: catalog first, bill slides up */
  body.pos .content { padding: 0 12px 76px; }
  .pos { display: block; height: auto; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); overflow: visible; }
  .bill { position: fixed; inset: 0; z-index: 50; border-radius: 0; transform: translateY(100%); transition: transform .22s ease; }
  .bill::after { display: none; }
  body.bill-open .bill { transform: none; }
  .pos-mobile-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--ink); color: #fff; align-items: center; gap: 12px; }
  .pos-mobile-bar .t { flex: 1; }
  .pos-mobile-bar .t small { display: block; color: #9fc0b3; font-size: 12px; }
  .pos-mobile-bar .t strong { font-size: 20px; color: var(--haldi); }
  .bill-close { display: inline-grid !important; }
}
@media (max-width: 560px) {
  .today { grid-template-columns: 1fr 1fr; }
  .today > div:first-child { grid-column: span 2; }
  .today > div:nth-child(2n+1):not(:first-child) { border-left: 1px solid var(--line); }
  .today > div:nth-child(2n) { border-left: 0; }
  .today .v { font-size: 20px; }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .table td, .table th { padding: 9px 10px; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media print {
  .sidebar, .topbar, .no-print, .flash-stack { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .panel { box-shadow: none; border: 0; }
}

/* ---------- Purchase entry ---------- */
.pur-search { position: relative; }
.pur-search .cust-results { top: 46px; max-height: 320px; }
.pur-search .cust-results button { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.pur-search .cust-results .sub { display: block; font-size: 12.5px; color: var(--muted); }
.pur-table td { vertical-align: middle; }
.pur-table .input { height: 34px; min-width: 0; }
.pur-table input.q { width: 80px; } .pur-table input.c { width: 96px; }
.pur-table input[name$="[selling_price]"] { width: 96px; } .pur-table select { width: 76px; }
.pur-table .rm { color: #b9b5a5; } .pur-table .rm:hover { color: var(--chili); }
#pur-empty { padding: 28px 18px; }

/* ---------- Finance / reports ---------- */
.method-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.method-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.method-card .k { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.method-card .k .ic { width: 17px; height: 17px; }
.method-card .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.method-card .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.method-card.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.method-card.primary .k, .method-card.primary .d { color: rgba(255,255,255,.7); }
.method-card.primary .v { color: var(--haldi); }
.amt-in { color: var(--leaf); font-weight: 650; } .amt-out { color: var(--chili); font-weight: 650; }
.report-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pl-big { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.settings-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
@media (max-width: 900px) { .method-cards { grid-template-columns: 1fr 1fr; } }
@media print { .report-tabs, .settings-nav { display: none; } }
