/* Repariology v19 — PDF design system: Cream #F7F5EF, Deep Green #0B3D2E, Amber #D9A441.
   Self-hosted Poppins ONLY (woff2 in /fonts/). No remote font imports. */
[hidden]{display:none!important}
@font-face{font-family:'Poppins';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/poppins-400.woff2') format('woff2')}
@font-face{font-family:'Poppins';font-style:normal;font-weight:500;font-display:swap;src:url('/fonts/poppins-500.woff2') format('woff2')}
@font-face{font-family:'Poppins';font-style:normal;font-weight:600;font-display:swap;src:url('/fonts/poppins-600.woff2') format('woff2')}
@font-face{font-family:'Poppins';font-style:normal;font-weight:700;font-display:swap;src:url('/fonts/poppins-700.woff2') format('woff2')}
@font-face{font-family:'Poppins';font-style:normal;font-weight:800;font-display:swap;src:url('/fonts/poppins-800.woff2') format('woff2')}
:root { --bg:#F7F5EF; --accent:#0B3D2E; --accent2:#D9A441; --sidebar-bg:#0B3D2E; --ink:#1E2A26; --muted:#6B7A74; --line:#E4DDCF; --red:#B3261E; --blue:#1D4ED8; --purple:#6D28D9; --green:#0B3D2E; --green-2:#0E4A38; --cream:#F7F5EF; --amber:#D9A441; --pale-amber:#FDEBC8; --pale-green:#DDF2E3; --pale-blue:#DCE8F7; --pale-red:#FBDCDC; }
* { box-sizing:border-box; }
html,body { margin:0; padding:0; }
body { font-family:'Poppins',system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif; background:var(--bg); color:var(--ink); }
button { font-family:inherit; cursor:pointer; }
input,select,textarea { font-family:inherit; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:#fff; width:100%; font-size:14px; }
input:focus,select:focus,textarea:focus { outline:2px solid var(--accent2); outline-offset:0; border-color:var(--accent); }
label { display:block; font-size:13px; margin:12px 0 4px; color:var(--ink); font-weight:500; }
.muted { color:var(--muted); } .small { font-size:12px; } .center { text-align:center; }
.error { color:var(--red); font-size:13px; min-height:18px; }
.form-error { color:var(--red); font-size:13px; background:#FBDCDC; border:1px solid #F0C4C0; border-radius:8px; padding:8px 10px; margin-bottom:8px; }
.amber-link { color:var(--amber); font-weight:600; text-decoration:none; }
.link-btn { background:none; border:0; color:#fff; text-decoration:underline; padding:0; font-size:12px; }
.link-btn.dark { color:var(--accent); }

/* ---------- Headings: bold dark green + short amber rule (PDF) ---------- */
.view h1 { margin:0 0 4px; font-size:24px; color:var(--accent); font-weight:700; }
.view h1::after { content:''; display:block; width:34px; height:4px; background:var(--accent2); border-radius:2px; margin-top:4px; }
.view h2 { font-size:18px; color:var(--accent); margin:18px 0 8px; font-weight:700; }
.view h2::after { content:''; display:block; width:34px; height:3px; background:var(--accent2); border-radius:2px; margin-top:3px; }
.view h3 { font-size:15px; color:var(--accent); margin:14px 0 6px; }
.page-head { display:flex; align-items:center; gap:10px; margin-bottom:4px; }
.page-head h1 { flex:1; }
.back-btn { background:#fff; border:1px solid var(--line); border-radius:50%; width:36px; height:36px; font-size:18px; color:var(--accent); flex-shrink:0; line-height:1; }

/* ---------- Logo ---------- */
.logo { display:flex; align-items:center; gap:10px; justify-content:center; }
.logo svg { width:52px; height:52px; flex-shrink:0; }
.logo-white { color:#fff; }
.logo-dark { color:var(--accent); }
.logo-text { text-align:left; }
.logo-name { font-weight:800; font-size:17px; letter-spacing:.4px; line-height:1.15; }
.logo-sub { color:var(--amber); font-weight:600; font-size:11px; letter-spacing:3px; }
.logo-dark .logo-sub { color:var(--amber); }
.logo-small svg { width:38px; height:38px; }
.logo-small .logo-name { font-size:15px; }
.logo-small .logo-sub { font-size:9px; letter-spacing:2px; }

/* ---------- Auth (PDF P02/P03) ---------- */
#login-wrap,#setup-wrap { min-height:100vh; display:flex; align-items:flex-start; justify-content:center; padding:0; background:var(--bg); }
.auth-card { background:#fff; width:100%; max-width:430px; min-height:100vh; box-shadow:0 8px 30px rgba(11,61,46,.12); }
.auth-banner { background:var(--accent); border-radius:0 0 50% 50% / 0 0 42px 42px; padding:34px 20px 44px; }
.auth-body { padding:22px 24px 28px; }
.auth-body h1 { text-align:center; margin:6px 0 2px; font-size:24px; color:var(--accent); font-weight:700; }
.login-sub { text-align:center; color:var(--muted); margin:0 0 10px; font-size:14px; }
.field { display:flex; align-items:center; gap:8px; background:#fff; border:1px solid var(--line); border-radius:12px; padding:0 6px 0 12px; }
.field input { border:0; padding:11px 6px; flex:1; min-width:0; }
.field input:focus { outline:none; }
.field:focus-within { border-color:var(--accent); outline:2px solid var(--accent2); }
.field-icon { font-size:15px; flex-shrink:0; }
.pw-eye { background:none; border:0; font-size:16px; padding:6px 8px; flex-shrink:0; }
.login-row { display:flex; justify-content:space-between; align-items:center; margin-top:10px; font-size:13px; }
.login-row .check { display:flex; align-items:center; gap:6px; margin:0; font-weight:400; }
.login-row .check input { width:auto; }
.login-row a { color:var(--accent); text-decoration:none; font-weight:600; }
.btn-primary { background:var(--accent); color:#fff; border:0; border-radius:12px; padding:12px 16px; font-weight:600; margin-top:12px; font-size:15px; }
.btn-primary:hover { background:var(--green-2); }
.btn-block { width:100%; }
.btn-google { background:#fff; border:1px solid var(--line); border-radius:12px; padding:12px 16px; width:100%; font-weight:600; margin-top:10px; display:flex; align-items:center; justify-content:center; gap:10px; font-size:15px; color:var(--ink); }
.g-logo { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%; background:#4285F4; color:#fff; font-weight:800; font-size:15px; }
.btn-outline { background:#fff; border:1px solid var(--line); border-radius:12px; padding:10px 14px; font-weight:600; color:var(--ink); }
.btn-outline:hover { border-color:var(--accent); }
.btn-small { padding:8px 10px; font-size:13px; border-radius:8px; }
.or-row { display:flex; align-items:center; gap:10px; color:var(--muted); margin:16px 0 4px; font-size:13px; }
.or-row::before,.or-row::after { content:''; flex:1; border-top:1px solid var(--line); }

/* ---------- Shell ---------- */
#app { display:flex; min-height:100vh; }
#sidebar { width:248px; background:var(--sidebar-bg); color:#EAF3EE; display:flex; flex-direction:column; position:sticky; top:0; height:100vh; flex-shrink:0; }
.side-brand { padding:18px 16px 14px; border-bottom:1px solid rgba(255,255,255,.12); }
.side-brand .logo { justify-content:flex-start; }
#side-nav { display:flex; flex-direction:column; gap:2px; padding:10px; flex:1; overflow-y:auto; }
#side-nav button.nav-item { background:transparent; border:0; color:#EAF3EE; text-align:left; padding:11px 12px; border-radius:10px; font-size:14px; display:flex; align-items:center; gap:10px; }
#side-nav button.nav-item svg { width:18px; height:18px; fill:currentColor; flex-shrink:0; }
#side-nav button.nav-item:hover { background:rgba(255,255,255,.08); }
#side-nav button.nav-item.active { background:var(--accent2); color:#231A06; font-weight:600; }
.side-foot { padding:12px 16px; border-top:1px solid rgba(255,255,255,.15); font-size:13px; display:flex; flex-direction:column; gap:10px; }
.sync-line { color:#BFD8CC; font-size:12px; }
.side-user { display:flex; gap:10px; align-items:center; }
.side-avatar { width:40px; height:40px; border-radius:50%; background:var(--accent2); color:#231A06; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:15px; }
.side-user-text { min-width:0; }
.side-user-text div { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.btn-logout { background:var(--red); color:#fff; border:0; border-radius:10px; padding:10px; font-weight:600; }
.main-col { flex:1; min-width:0; display:flex; flex-direction:column; }

/* ---------- Top bar ---------- */
#topbar { display:flex; align-items:center; gap:12px; padding:12px 22px; background:#fff; border-bottom:1px solid var(--line); position:sticky; top:0; z-index:20; }
.top-shop { display:none; align-items:center; gap:8px; font-weight:700; color:var(--accent); font-size:16px; white-space:nowrap; }
.top-search-wrap { flex:1; position:relative; max-width:420px; }
.top-search-wrap input { padding:10px 12px; }
.top-actions { display:flex; align-items:center; gap:8px; margin-left:auto; }
.top-actions .btn-primary,.top-actions .btn-outline { margin-top:0; padding:9px 14px; }
.icon-btn { background:#fff; border:1px solid var(--line); border-radius:10px; padding:9px 12px; font-size:16px; position:relative; color:var(--ink); }
.avatar-btn { width:38px; height:38px; border-radius:50%; background:var(--accent); color:#fff; border:0; font-weight:700; }
.bell-badge { position:absolute; top:-6px; right:-6px; background:var(--red); color:#fff; font-size:11px; font-weight:700; min-width:18px; height:18px; border-radius:9px; display:flex; align-items:center; justify-content:center; padding:0 4px; }
.bell-wrap,.avatar-wrap { position:relative; }
.dropdown { position:absolute; top:calc(100% + 8px); right:0; background:#fff; border:1px solid var(--line); border-radius:12px; box-shadow:0 12px 30px rgba(11,61,46,.18); min-width:280px; max-width:360px; z-index:30; overflow:hidden; }
.top-search-wrap .dropdown { left:0; right:0; top:calc(100% + 6px); }
.dropdown .dd-item { display:block; width:100%; text-align:left; padding:10px 14px; border:0; background:#fff; font-size:13px; border-bottom:1px solid var(--line); }
.dropdown .dd-item:hover { background:var(--cream); }
.dropdown .dd-empty { padding:14px; color:var(--muted); font-size:13px; }
.dropdown .dd-head { padding:10px 14px; font-weight:600; border-bottom:1px solid var(--line); background:var(--cream); font-size:13px; }

/* ---------- PWA banner ---------- */
.pwa-banner { background:var(--accent); color:#fff; border-radius:12px; padding:12px 16px; display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:14px; }
.pwa-banner .btn-primary { background:var(--accent2); color:#231A06; margin-top:0; }
.pwa-banner .btn-outline { background:transparent; color:#fff; border-color:rgba(255,255,255,.4); margin-top:0; }

#main { flex:1; padding:22px 22px 110px; min-width:0; }
.card { background:#fff; border:1px solid var(--line); border-radius:14px; padding:16px; box-shadow:0 2px 10px rgba(11,61,46,.05); }
.grid { display:grid; gap:14px; }

/* ---------- KPI cards (PDF P04: white card, big amber value, amber underline) ---------- */
.kpis { grid-template-columns:repeat(3,1fr); }
.kpi { text-align:left; padding:14px 12px; }
.kpi b { font-size:24px; display:block; color:var(--amber); font-weight:700; line-height:1.2; }
.kpi b::after { content:''; display:block; width:26px; height:3px; background:var(--accent2); border-radius:2px; margin:5px 0 6px; }
.kpi span { color:var(--accent); font-size:12px; font-weight:600; display:block; }
.kpi small { display:block; color:var(--muted); font-size:11px; margin-top:2px; }
.kpi .kpi-count { color:var(--accent); }

.period { display:flex; gap:8px; margin:10px 0; }
.period button { border:1px solid var(--line); background:#fff; border-radius:20px; padding:7px 16px; font-size:13px; font-weight:500; }
.period button.active { background:var(--accent); color:#fff; border-color:var(--accent); }
.tabs { display:flex; gap:8px; flex-wrap:wrap; margin:10px 0; }
.tabs button { border:1px solid var(--line); background:#fff; border-radius:20px; padding:7px 14px; font-size:13px; }
.tabs button.active { background:var(--amber); border-color:var(--amber); font-weight:600; color:#231A06; }
.pill { display:inline-block; padding:3px 10px; border-radius:20px; font-size:12px; font-weight:600; background:#E7EFEA; color:var(--accent); white-space:nowrap; }
.pill.waiting_approval { background:var(--pale-amber); color:#7A4A00; }
.pill.ready { background:var(--pale-blue); color:var(--blue); }
.pill.delivered { background:var(--pale-green); color:var(--accent); }
.pill.cancelled { background:var(--pale-red); color:var(--red); }
.pill.low { background:var(--amber); color:#fff; }
.pill.received { background:#E7EFEA; color:var(--accent); }

/* ---------- Lists / rows (PDF list style) ---------- */
.list-row { display:flex; align-items:center; gap:10px; padding:11px 2px; border-bottom:1px solid var(--line); }
.list-row:last-child { border-bottom:0; }
.list-row .lr-main { flex:1; min-width:0; }
.list-row .lr-main b { color:var(--accent); font-size:14px; display:block; }
.list-row .lr-main small { color:var(--muted); font-size:12px; }
.list-row .lr-right { text-align:right; flex-shrink:0; }
.money-amber { color:var(--amber); font-weight:700; }
.money-green { color:var(--accent); font-weight:700; }

/* ---------- Big repair cards (PDF P17) ---------- */
.job-card { background:#fff; border:1px solid var(--line); border-radius:14px; padding:16px; margin-bottom:14px; box-shadow:0 2px 10px rgba(11,61,46,.05); }
.job-card .top { display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; align-items:center; }
.job-card .top b { color:var(--accent); font-size:16px; }
.job-card .fault { background:var(--cream); border:1px solid var(--line); border-radius:10px; padding:10px; margin:10px 0; font-size:14px; }
.job-card .money { font-weight:600; font-size:14px; }
.job-card .money b { color:var(--amber); }
.job-card .actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.job-card .actions button { border:1px solid var(--line); background:#fff; border-radius:10px; padding:9px 12px; font-weight:600; font-size:13px; }
.job-card .actions button.primary { background:var(--accent); color:#fff; border-color:var(--accent); }
.job-card .actions button.danger { color:var(--red); border-color:#F0C4C0; }

/* ---------- Tables ---------- */
table { width:100%; border-collapse:collapse; background:#fff; }
th,td { text-align:left; padding:10px; border-bottom:1px solid var(--line); font-size:14px; vertical-align:top; }
th { color:var(--muted); font-size:12px; text-transform:uppercase; }
.row { display:flex; gap:10px; flex-wrap:wrap; }
.row > * { flex:1; min-width:160px; }
.form-card { max-width:720px; }
.cancel-banner { background:var(--red); color:#fff; font-weight:700; text-align:center; padding:8px; border-radius:8px; margin-bottom:10px; }
.sub-tabs { display:flex; gap:8px; flex-wrap:wrap; margin:12px 0; }
.sub-tabs button { border:1px solid var(--line); background:#fff; border-radius:20px; padding:7px 14px; font-size:13px; }
.sub-tabs button.active { background:var(--accent); color:#fff; border-color:var(--accent); }
.mini { font-size:13px; color:var(--muted); }
.search-field { display:flex; align-items:center; gap:8px; background:#fff; border:1px solid var(--line); border-radius:12px; padding:0 6px 0 12px; margin:10px 0; }
.search-field input { border:0; padding:11px 6px; flex:1; min-width:0; }
.search-field input:focus { outline:none; }
.search-field:focus-within { border-color:var(--accent); outline:2px solid var(--accent2); }
.filter-pills { display:flex; gap:8px; overflow-x:auto; padding:4px 0 10px; scrollbar-width:none; }
.filter-pills::-webkit-scrollbar { display:none; }
.filter-pills button { flex-shrink:0; border:1px solid var(--line); background:#fff; border-radius:20px; padding:7px 14px; font-size:13px; white-space:nowrap; }
.filter-pills button.active { background:var(--accent); color:#fff; border-color:var(--accent); font-weight:600; }

/* ---------- Job detail vertical stepper (PDF P16 visual, 4 live steps) ---------- */
.stepper { list-style:none; margin:6px 0; padding:0; }
.stepper li { display:flex; gap:12px; position:relative; padding-bottom:22px; }
.stepper li:last-child { padding-bottom:0; }
.stepper li::before { content:''; position:absolute; left:15px; top:32px; bottom:2px; width:2px; background:var(--line); }
.stepper li:last-child::before { display:none; }
.step-num { width:32px; height:32px; border-radius:50%; border:2px solid var(--accent); background:#fff; color:var(--accent); font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:14px; position:relative; z-index:1; }
.stepper li.done .step-num { background:var(--accent); color:#fff; }
.stepper li.current .step-num { background:var(--amber); border-color:var(--amber); color:#231A06; }
.stepper li .step-label { padding-top:6px; font-weight:600; color:var(--accent); font-size:14px; }
.stepper li.current .step-label { color:var(--amber); }
.stepper li.todo .step-num { border-color:#B9C4BE; color:#8AA096; }
.stepper li.todo .step-label { color:var(--muted); }
.detail-card-label { font-weight:700; color:var(--accent); font-size:14px; margin-bottom:4px; }
.summary-strip { display:flex; background:#fff; border:1px solid var(--line); border-radius:14px; padding:14px 8px; margin-top:14px; }
.summary-strip > div { flex:1; text-align:center; padding:0 6px; }
.summary-strip > div + div { border-left:1px solid var(--line); }
.summary-strip span { display:block; color:var(--muted); font-size:12px; }
.summary-strip b { color:var(--amber); font-size:17px; }

/* ---------- Supplier cards (PDF P12) / ledger (P10) / purchase bill (P11) ---------- */
.supplier-card { background:#fff; border:1px solid var(--line); border-radius:14px; padding:16px; margin-bottom:12px; box-shadow:0 2px 10px rgba(11,61,46,.05); cursor:pointer; }
.supplier-card h3 { margin:0 0 10px; color:var(--accent); font-size:16px; }
.supplier-card h3 .muted { font-weight:400; font-size:12px; }
.trio { display:flex; text-align:center; }
.trio > div { flex:1; padding:0 6px; }
.trio > div + div { border-left:1px solid var(--line); }
.trio span { display:block; color:var(--muted); font-size:12px; }
.trio b { font-size:15px; color:var(--accent); }
.trio b.amber { color:var(--amber); }
.total-bar { background:var(--accent); color:#fff; border-radius:12px; padding:14px 16px; display:flex; justify-content:space-between; align-items:center; font-weight:600; margin-top:6px; }
.total-bar b { color:var(--amber); font-size:18px; }
.ledger-amt-amber { color:var(--amber); font-weight:700; }
.ledger-amt-green { color:var(--accent); font-weight:700; }
.purchase-bill-head { display:flex; justify-content:space-between; gap:10px; align-items:baseline; }
.purchase-bill-head .bill-no { font-size:18px; font-weight:700; color:var(--accent); }
.stock-updated { display:flex; gap:10px; align-items:center; background:var(--pale-green); border-radius:12px; padding:12px 14px; margin-top:12px; }
.stock-updated .tick { width:28px; height:28px; border-radius:50%; background:var(--accent); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; flex-shrink:0; }

/* ---------- Inventory (PDF P13) ---------- */
.inv-card { background:#fff; border:1px solid var(--line); border-radius:14px; padding:14px 16px; margin-bottom:10px; box-shadow:0 2px 10px rgba(11,61,46,.05); }
.inv-grid { display:grid; grid-template-columns:1.6fr 1fr 1fr .6fr .8fr; gap:8px; align-items:center; font-size:14px; }
.inv-grid.head { font-size:11px; text-transform:uppercase; color:var(--muted); font-weight:600; padding:4px 16px 8px; }
.inv-grid .inv-name b { color:var(--accent); display:block; font-size:14px; }
.inv-grid .inv-name small { color:var(--muted); font-size:12px; }
.inv-low { color:var(--amber); font-weight:700; }
.inv-low-row { background:#FFF7E6; }

/* ---------- Customers (PDF P15) ---------- */
.customer-card { background:#fff; border:1px solid var(--line); border-radius:14px; padding:16px; margin-bottom:12px; box-shadow:0 2px 10px rgba(11,61,46,.05); cursor:pointer; }
.customer-head { display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.customer-avatar { width:44px; height:44px; border-radius:50%; background:var(--accent); color:#fff; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:15px; }
.customer-head b { color:var(--accent); font-size:16px; display:block; }
.customer-head small { color:var(--muted); font-size:12px; }
.customer-stats { display:flex; text-align:center; }
.customer-stats > div { flex:1; padding:0 6px; }
.customer-stats > div + div { border-left:1px solid var(--line); }
.customer-stats b { display:block; font-size:16px; color:var(--accent); }
.customer-stats b.amber { color:var(--amber); }
.customer-stats span { font-size:12px; color:var(--muted); }

/* ---------- Payments (PDF P14) ---------- */
.methods-row { display:flex; background:#fff; border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.methods-row > div { flex:1; text-align:center; padding:14px 4px; font-weight:600; color:var(--accent); font-size:13px; }
.methods-row > div + div { border-left:1px solid var(--line); }

/* ---------- Reports (PDF P09) ---------- */
.chart-card { background:#fff; border:1px solid var(--line); border-radius:14px; padding:16px; box-shadow:0 2px 10px rgba(11,61,46,.05); }
.chart-card h3 { margin:0 0 12px; color:var(--accent); font-size:16px; }
.bars { display:flex; align-items:flex-end; gap:8px; height:140px; padding-top:6px; }
.bar-col { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; gap:4px; }
.bar-col .bar-val { font-size:11px; font-weight:700; color:var(--accent); }
.bar-col .bar { width:100%; max-width:34px; background:var(--accent); border-radius:6px 6px 0 0; min-height:4px; }
.bar-col .bar-day { font-size:11px; color:var(--muted); }
.stat-pair { display:grid; grid-template-columns:1fr 1fr; gap:14px; }

/* ---------- Bottom nav (mobile, PDF P07 Variant C) ---------- */
#bottom-nav { display:none; }

/* ---------- More sheet (PDF P08) ---------- */
.sheet { position:fixed; inset:0; z-index:55; }
.sheet-backdrop { position:absolute; inset:0; background:rgba(0,0,0,.5); }
.sheet-card { position:absolute; left:0; right:0; bottom:0; background:var(--bg); border-radius:22px 22px 0 0; padding:8px 16px 26px; max-height:88vh; overflow-y:auto; box-shadow:0 -8px 30px rgba(0,0,0,.25); }
.sheet-handle { width:44px; height:5px; border-radius:3px; background:#C9C0AE; margin:4px auto 10px; }
.sheet-head { display:flex; align-items:center; justify-content:space-between; }
.sheet-head h2 { margin:0; color:var(--accent); font-size:20px; }
.sheet-user { display:flex; gap:12px; align-items:center; background:#fff; border:1px solid var(--line); border-radius:14px; padding:14px; margin:12px 0; }
.sheet-user-name { font-weight:700; color:var(--accent); font-size:15px; }
.more-list { display:flex; flex-direction:column; gap:8px; margin-bottom:14px; }
.more-row { display:flex; align-items:center; gap:12px; background:#fff; border:1px solid var(--line); border-radius:14px; padding:13px 14px; text-align:left; width:100%; }
.more-row-icon { font-size:20px; width:28px; text-align:center; flex-shrink:0; }
.more-row-main { flex:1; min-width:0; }
.more-row-main b { display:block; color:var(--accent); font-size:15px; }
.more-row-main small { color:var(--muted); font-size:12px; }
.more-row-chev { color:var(--muted); font-size:20px; }

/* ---------- Generic modal + toast ---------- */
#modal-root { position:fixed; inset:0; z-index:60; display:flex; align-items:center; justify-content:center; padding:20px; }
.modal-backdrop { position:absolute; inset:0; background:rgba(0,0,0,.5); }
.modal-card { position:relative; background:#fff; border-radius:16px; padding:20px; width:100%; max-width:520px; max-height:85vh; overflow:auto; box-shadow:0 16px 40px rgba(0,0,0,.3); }
.modal-card h2 { margin-top:0; color:var(--accent); }
.modal-card .modal-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; margin-top:14px; }
.modal-card .modal-actions .btn-primary { width:auto; margin-top:0; }
#toast-root { position:fixed; bottom:96px; left:50%; transform:translateX(-50%); z-index:70; display:flex; flex-direction:column; gap:8px; align-items:center; width:max-content; max-width:92vw; }
.toast { background:var(--accent); color:#fff; padding:10px 18px; border-radius:20px; font-size:14px; box-shadow:0 8px 24px rgba(0,0,0,.25); text-align:center; }

/* ---------- 80mm bill (PDF P06 layout, live content) ---------- */
#bill-overlay,#purchase-bill-overlay { position:fixed; inset:0; background:rgba(0,0,0,.55); display:flex; flex-direction:column; align-items:center; justify-content:flex-start; overflow:auto; padding:24px 12px; z-index:50; }
.bill-modal { display:flex; flex-direction:column; align-items:center; width:100%; }
#bill-content,#purchase-bill-content { background:#fff; width:76mm; max-width:94vw; padding:10px 8px; font-size:12px; color:#000; box-shadow:0 8px 30px rgba(0,0,0,.3); }
#bill-content h3,#purchase-bill-content h3 { margin:2px 0; font-size:15px; text-align:center; color:#000; }
#bill-content .c,#purchase-bill-content .c { text-align:center; }
#bill-content hr,#purchase-bill-content hr { border:0; border-top:1px dashed #000; margin:6px 0; }
#bill-content table,#purchase-bill-content table { font-size:12px; }
#bill-content th,#bill-content td,#purchase-bill-content th,#purchase-bill-content td { padding:2px 0; border:0; }
#bill-content .big-inv { font-size:20px; font-weight:700; text-align:center; }
#bill-content .bill-logo,#purchase-bill-content .bill-logo { display:flex; justify-content:center; color:#000; }
#bill-content .bill-logo svg,#purchase-bill-content .bill-logo svg { width:44px; height:44px; }
#bill-content .bill-shop,#purchase-bill-content .bill-shop { text-align:center; font-weight:800; font-size:14px; }
#bill-content .bill-sub,#purchase-bill-content .bill-sub { text-align:center; font-size:11px; letter-spacing:2px; font-weight:600; }
#bill-content .terms { font-size:11px; line-height:1.6; }
#bill-content .terms h4 { margin:6px 0 2px; font-size:12px; text-align:center; color:#000; }
#bill-content .no-warranty { text-align:center; font-weight:700; margin-top:6px; }
.modal-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:center; margin-top:12px; }
.modal-actions .btn-primary { width:auto; margin-top:0; }
.modal-actions .btn-outline { background:#fff; }

/* ---------- Print: only the bill prints, at 76mm ---------- */
@media print {
  @page bill { size:80mm auto; margin:2mm; }
  @page { size:auto; margin:10mm; }
  body.print-bill { background:#fff; }
  body.print-bill #app, body.print-bill #login-wrap, body.print-bill #setup-wrap, body.print-bill .modal-actions, body.print-bill #toast-root, body.print-bill #modal-root, body.print-bill #more-sheet, body.print-bill #bottom-nav, body.print-bill #purchase-bill-overlay { display:none !important; }
  body.print-bill #bill-overlay { position:static; background:#fff; padding:0; display:block; }
  body.print-bill #bill-content { width:76mm; margin:0; box-shadow:none; page:bill; }
}

/* ---------- Desktop (>700px): sidebar, no bottom nav ---------- */
@media (min-width:701px) {
  #bottom-nav { display:none !important; }
  #main { padding-bottom:22px; }
  #toast-root { bottom:20px; }
  .auth-card { min-height:0; border-radius:16px; overflow:hidden; margin:40px 0; }
  .kpis { grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); }
}

/* ---------- Mobile (<=700px): bottom nav, compact top bar ---------- */
@media (max-width:700px) {
  #sidebar { display:none; }
  #app { flex-direction:column; }
  .top-shop { display:flex; }
  #topbar { flex-wrap:wrap; padding:10px 12px; gap:8px; }
  .top-search-wrap { max-width:none; flex-basis:100%; order:3; }
  .top-actions .btn-primary, .top-actions .btn-outline { display:none; }
  #main { padding:14px 14px 110px; }
  .kpis { grid-template-columns:repeat(3,1fr); gap:10px; }
  .kpi { padding:12px 8px; }
  .kpi b { font-size:16px; }
  .kpi span { font-size:11px; }
  #bottom-nav { display:flex; position:fixed; left:0; right:0; bottom:0; z-index:40; background:#fff; border-top:1px solid var(--line); padding:6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow:0 -4px 16px rgba(11,61,46,.08); }
  #bottom-nav .bn-item { flex:1; background:none; border:0; display:flex; flex-direction:column; align-items:center; gap:2px; padding:4px 0 2px; color:var(--accent); font-size:11px; font-weight:500; position:relative; }
  #bottom-nav .bn-item.active { color:var(--accent); font-weight:700; }
  #bottom-nav .bn-item.active .bn-icon { color:var(--amber); }
  #bottom-nav .bn-icon { font-size:20px; line-height:1; }
  #bottom-nav .bn-centre .bn-label { margin-top:22px; }
  #bottom-nav .bn-plus { position:absolute; top:-22px; left:50%; transform:translateX(-50%); width:52px; height:52px; border-radius:50%; background:var(--accent); color:#fff; font-size:28px; font-weight:400; display:flex; align-items:center; justify-content:center; border:4px solid #fff; box-shadow:0 4px 12px rgba(11,61,46,.35); line-height:1; }
  .inv-grid { grid-template-columns:1.5fr .9fr .9fr .5fr .7fr; font-size:13px; }
  .inv-grid.head { padding:4px 14px 8px; }
  .stat-pair { grid-template-columns:1fr 1fr; gap:10px; }
}
@media (max-width:380px) {
  .kpi b { font-size:14px; }
  .inv-grid { grid-template-columns:1.4fr .8fr .8fr .5fr .6fr; }
}
