:root {
  color-scheme: light;
  --green-900: #14532d;
  --green-800: #166534;
  --green-700: #15803d;
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --green-50: #f0fdf4;
  --ink: #18221c;
  --muted: #69766d;
  --line: #e4e9e5;
  --canvas: #f6f8f6;
  --surface: #fff;
  --amber: #a65b08;
  --amber-bg: #fff7e8;
  --red: #b42318;
  --red-bg: #fff1f0;
  --shadow: 0 8px 26px rgba(20, 40, 26, .06);
  font-family: 'DM Sans', Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #86efac; outline-offset: 2px; }
.app-shell { min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 244px; background: #fff; border-right: 1px solid var(--line); padding: 25px 16px 18px; display: flex; flex-direction: column; z-index: 5; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--green-700); color: white; flex: 0 0 auto; }
.brand-name { display: block; font: 800 16px/1.1 'Manrope', sans-serif; letter-spacing: -.55px; }
.brand-caption { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.side-business { margin: 28px 4px 20px; padding: 13px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.eyebrow { color: #78837b; font-weight: 700; font-size: 10px; letter-spacing: .09em; text-transform: uppercase; }
.side-business strong { display: block; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.side-business span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.side-nav { display: grid; gap: 5px; }
.nav-link { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 8px; background: transparent; padding: 11px 12px; color: #58645b; text-align: left; font-size: 13px; font-weight: 600; }
.nav-link:hover { background: #f5f8f5; color: var(--green-800); }
.nav-link.active { color: var(--green-800); background: var(--green-50); }
.nav-link.active svg { stroke-width: 2.25; }
.sidebar-foot { margin-top: auto; padding: 15px 8px 0; border-top: 1px solid var(--line); color: #78837b; font-size: 11px; line-height: 1.5; }
.main-column { margin-left: 244px; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { min-height: 70px; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-left .business-name { font-size: 13px; font-weight: 700; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-left .business-type { font-size: 11px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 10px; }
.icon-button { display: inline-grid; place-items: center; border: 0; background: transparent; color: #59675d; width: 34px; height: 34px; border-radius: 8px; }
.icon-button:hover { background: #f2f6f2; color: var(--green-800); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.demo-label { display: inline-flex; align-items: center; gap: 8px; color: #59675d; font-size: 12px; font-weight: 600; white-space: nowrap; }
.demo-label input { appearance: none; width: 34px; height: 20px; margin: 0; border: 1px solid #c9d2cb; border-radius: 99px; background: #e9eeea; position: relative; transition: background .16s ease; cursor: pointer; }
.demo-label input::after { content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #0002; transition: transform .16s ease; }
.demo-label input:checked { background: var(--green-700); border-color: var(--green-700); }
.demo-label input:checked::after { transform: translateX(14px); }
.demo-active { color: var(--green-800); background: var(--green-50); border-radius: 99px; font-size: 10px; font-weight: 700; padding: 5px 8px; white-space: nowrap; }
.text-button { border: 0; padding: 6px 4px; background: transparent; color: var(--green-800); font-size: 11px; font-weight: 700; white-space: nowrap; }
.content { width: min(100%, 1180px); margin: 0 auto; padding: 34px 36px 64px; flex: 1; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.page-heading h1 { margin: 4px 0 0; font: 800 clamp(24px, 2.5vw, 30px)/1.15 'Manrope', sans-serif; letter-spacing: -.8px; }
.page-heading p { color: var(--muted); margin: 8px 0 0; font-size: 13px; line-height: 1.55; }
.heading-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.greeting { color: var(--green-800); font-size: 12px; font-weight: 700; margin-bottom: 9px; }
.home-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 27px; }
.home-hero h1 { font: 800 clamp(27px, 3vw, 35px)/1.12 'Manrope', sans-serif; letter-spacing: -1.1px; max-width: 560px; margin: 0; }
.home-hero p { color: var(--muted); max-width: 570px; margin: 10px 0 0; line-height: 1.6; font-size: 14px; }
.today-chip { display: inline-flex; align-items: center; gap: 7px; color: #5d695f; padding: 9px 12px; background: white; border: 1px solid var(--line); border-radius: 8px; font-size: 11px; white-space: nowrap; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 13px; }
.section-title h2 { margin: 0; font: 700 16px/1.3 'Manrope', sans-serif; letter-spacing: -.25px; }
.section-title span { color: var(--muted); font-size: 11px; }
.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 25px; }
.action-card { min-height: 147px; padding: 19px; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); background: white; border-radius: 11px; box-shadow: 0 2px 8px rgba(24,34,28,.025); color: var(--ink); text-align: left; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.action-card:hover { border-color: #9bd6a8; transform: translateY(-2px); box-shadow: var(--shadow); }
.action-card .action-icon { display: grid; place-items: center; width: 39px; height: 39px; background: var(--green-50); color: var(--green-800); border-radius: 10px; }
.action-card strong { margin-top: 15px; font: 700 15px 'Manrope', sans-serif; }
.action-card p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.action-card .card-arrow { position: absolute; right: 17px; top: 19px; color: #859087; }
.action-card { position: relative; }
.stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: white; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stat-cell { padding: 15px 18px; min-width: 0; }
.stat-cell + .stat-cell { border-left: 1px solid var(--line); }
.stat-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.stat-value { margin-top: 7px; font: 700 20px/1.15 'Manrope', sans-serif; letter-spacing: -.4px; }
.stat-note { margin-top: 5px; color: #89938b; font-size: 10px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 10px; }
.panel-pad { padding: 21px; }
.quick-lower { display: grid; grid-template-columns: 1.4fr 1fr; gap: 15px; margin-top: 16px; }
.recent-list { display: grid; }
.recent-row { min-height: 55px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid #eef1ee; }
.recent-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mini-icon { display: grid; place-items: center; width: 32px; height: 32px; color: var(--green-800); background: var(--green-50); border-radius: 8px; flex: 0 0 auto; }
.recent-info strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-info span, .recent-amount span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.recent-amount { text-align: right; font-size: 12px; font-weight: 700; white-space: nowrap; }
.low-stock-box { padding: 16px; display: flex; align-items: flex-start; gap: 11px; background: #fffbf2; border: 1px solid #f5e4b9; border-radius: 9px; }
.low-stock-box .alert-icon { color: var(--amber); }
.low-stock-box strong { font-size: 12px; }
.low-stock-box p { margin: 4px 0 0; color: #766b54; font-size: 11px; line-height: 1.5; }
.btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 1px solid transparent; border-radius: 7px; font-size: 12px; font-weight: 700; text-decoration: none; transition: background .15s ease, border-color .15s ease; }
.btn-primary { color: white; background: var(--green-700); border-color: var(--green-700); }
.btn-primary:hover { background: var(--green-800); border-color: var(--green-800); }
.btn-secondary { color: #344238; background: white; border-color: #d8e0da; }
.btn-secondary:hover { border-color: #aab8ad; background: #fbfcfb; }
.btn-quiet { color: #56635a; background: transparent; border-color: transparent; }
.btn-quiet:hover { background: #f2f6f2; }
.btn-danger { color: white; background: #b42318; border-color: #b42318; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.field { display: grid; gap: 7px; }
.field label, .field-label { color: #354239; font-size: 11px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 10px 11px; color: var(--ink); background: #fff; border: 1px solid #dce3de; border-radius: 7px; outline: none; font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(22,163,74,.1); }
.field textarea { min-height: 80px; resize: vertical; }
.field-help { color: #7b867e; font-size: 10px; line-height: 1.4; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.sale-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); gap: 16px; align-items: start; }
.sale-form { display: grid; gap: 19px; }
.product-select { min-height: 52px !important; }
.quantity-control { display: inline-flex; align-items: center; height: 43px; border: 1px solid #dce3de; border-radius: 7px; overflow: hidden; }
.quantity-control button { display: grid; place-items: center; width: 43px; height: 100%; border: 0; background: #f8faf8; color: #435147; }
.quantity-control button:hover { background: var(--green-50); color: var(--green-800); }
.quantity-control input { width: 54px; height: 100%; min-height: 0; text-align: center; padding: 0; border: 0; border-radius: 0; font-weight: 700; appearance: textfield; }
.quantity-control input::-webkit-inner-spin-button { appearance: none; }
.sale-total-card { padding: 19px; background: var(--green-50); border: 1px solid #ccebd3; border-radius: 9px; }
.sale-total-card .total-caption { color: #47714f; font-size: 11px; font-weight: 600; }
.sale-total-card .total-amount { margin-top: 5px; color: var(--green-900); font: 800 29px 'Manrope', sans-serif; letter-spacing: -.8px; }
.sale-total-card .total-detail { margin-top: 7px; color: #64816a; font-size: 10px; }
.payment-options { display: flex; gap: 8px; }
.payment-option { flex: 1; }
.payment-option input { position: absolute; opacity: 0; pointer-events: none; }
.payment-option span { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 41px; padding: 0 10px; color: #526056; border: 1px solid #dce3de; border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; }
.payment-option input:checked + span { color: var(--green-800); border-color: #86c996; background: var(--green-50); }
.sale-actions { display: flex; gap: 9px; }
.sale-side { position: sticky; top: 18px; }
.sale-side h3 { margin: 0; font: 700 14px 'Manrope', sans-serif; }
.sale-side p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.stock-indicator { display: flex; align-items: center; gap: 7px; margin-top: 14px; color: #526056; font-size: 11px; }
.stock-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-600); }
.stock-dot.low { background: #d99018; }
.stock-dot.out { background: #c7493e; }
.success-wrap { width: min(100%, 620px); margin: 2px auto 0; text-align: center; }
.success-mark { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 50%; color: var(--green-800); background: #e7f8eb; }
.success-wrap h1 { margin: 0; font: 800 28px 'Manrope', sans-serif; letter-spacing: -.8px; }
.success-wrap > p { color: var(--muted); font-size: 13px; margin: 8px auto 20px; }
.receipt { padding: 19px; text-align: left; background: white; border: 1px solid var(--line); border-radius: 10px; }
.receipt-heading { color: #7d887f; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.receipt-line { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px solid #edf0ed; font-size: 12px; }
.receipt-line span:first-child { color: var(--muted); }
.receipt-line strong { text-align: right; }
.receipt-total { display: flex; justify-content: space-between; align-items: center; padding-top: 15px; font-weight: 700; }
.receipt-total strong { font: 800 21px 'Manrope', sans-serif; }
.success-note { margin-top: 12px; padding: 13px; display: flex; align-items: center; gap: 9px; text-align: left; color: var(--green-800); background: var(--green-50); border-radius: 8px; font-size: 11px; }
.success-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 15px; }
.success-actions .wide { grid-column: 1 / -1; }
.metric-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 19px; }
.metric-card { padding: 15px 17px; background: white; border: 1px solid var(--line); border-radius: 9px; }
.metric-card .metric-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.metric-card strong { display: block; margin-top: 10px; font: 700 21px 'Manrope', sans-serif; letter-spacing: -.4px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.search-field { position: relative; width: min(100%, 320px); }
.search-field svg { position: absolute; top: 11px; left: 11px; color: #7b887e; }
.search-field input { width: 100%; height: 39px; padding: 0 12px 0 36px; border: 1px solid #dce3de; border-radius: 7px; background: white; font-size: 12px; }
.filter-row { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.filter-chip { min-height: 32px; padding: 0 11px; color: #67736a; border: 1px solid transparent; background: transparent; border-radius: 99px; font-size: 11px; font-weight: 600; }
.filter-chip:hover { background: #edf3ee; }
.filter-chip.active { color: var(--green-800); border-color: #ccebd3; background: var(--green-50); }
.inventory-list { overflow: hidden; }
.inventory-head, .inventory-row { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(100px, .8fr) minmax(90px, .6fr) minmax(120px, .8fr) 76px; align-items: center; gap: 12px; padding: 12px 17px; }
.inventory-head { color: #7b867e; background: #fafbfa; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.inventory-row { min-height: 62px; border-bottom: 1px solid #edf0ed; font-size: 12px; }
.inventory-row:last-child { border-bottom: 0; }
.inventory-product { display: flex; align-items: center; gap: 10px; min-width: 0; }
.inventory-product strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.inventory-product span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.product-symbol { display: grid; place-items: center; width: 35px; height: 35px; color: var(--green-800); background: #f1f7f2; border-radius: 8px; flex: 0 0 auto; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 5px 8px; border-radius: 99px; color: var(--green-800); background: var(--green-50); font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green-600); }
.status-pill.low { color: #8b5b0b; background: var(--amber-bg); }
.status-pill.low::before { background: #d99018; }
.status-pill.out { color: var(--red); background: var(--red-bg); }
.status-pill.out::before { background: #c7493e; }
.row-actions { display: flex; justify-content: flex-end; gap: 1px; }
.row-actions .icon-button { width: 31px; height: 31px; }
.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty-state .empty-symbol { display: grid; place-items: center; width: 45px; height: 45px; margin: 0 auto 12px; border-radius: 12px; color: var(--green-800); background: var(--green-50); }
.empty-state strong { display: block; color: var(--ink); font: 700 14px 'Manrope', sans-serif; }
.empty-state p { max-width: 340px; margin: 7px auto 14px; font-size: 11px; line-height: 1.5; }
.cash-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .92fr); gap: 15px; align-items: start; }
.cash-breakdown { display: grid; gap: 0; margin-top: 14px; }
.cash-line { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid #edf0ed; font-size: 12px; }
.cash-line span { color: var(--muted); }
.cash-line.total { padding-top: 16px; font-weight: 700; }
.cash-line.total span { color: var(--ink); }
.cash-fields { display: grid; gap: 14px; }
.diff-box { padding: 14px; margin-top: 4px; border: 1px solid var(--line); background: #fafbfa; border-radius: 8px; }
.diff-top { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 700; }
.diff-top span:last-child { font: 700 16px 'Manrope', sans-serif; }
.diff-box p { color: var(--muted); margin: 5px 0 0; font-size: 10px; }
.diff-box.even { border-color: #ccebd3; background: var(--green-50); color: var(--green-800); }
.diff-box.plus { border-color: #f3ddad; background: #fffbf2; color: #8b5b0b; }
.diff-box.minus { border-color: #f3c8c3; background: var(--red-bg); color: var(--red); }
.status-banner { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border-radius: 8px; margin-bottom: 14px; color: #58645b; background: #f4f6f4; font-size: 11px; line-height: 1.45; }
.status-banner.success { color: var(--green-800); background: var(--green-50); }
.status-banner.warning { color: #8b5b0b; background: var(--amber-bg); }
.date-control { display: flex; align-items: center; gap: 8px; }
.date-control input { height: 38px; padding: 0 10px; border: 1px solid #dce3de; border-radius: 7px; background: white; color: #39463c; font-size: 11px; }
.summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 11px; margin-bottom: 15px; }
.summary-grid .metric-card strong { font-size: 18px; }
.summary-layout { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(250px,.8fr); gap: 14px; align-items: start; }
.sales-table { width: 100%; border-collapse: collapse; }
.sales-table th { padding: 11px 13px; color: #7b867e; background: #fafbfa; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.sales-table td { padding: 12px 13px; border-top: 1px solid #edf0ed; font-size: 11px; vertical-align: top; }
.sales-table td:last-child, .sales-table th:last-child { text-align: right; }
.sales-table .secondary-cell { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.history-list { display: grid; gap: 0; }
.history-item { padding: 13px 0; border-top: 1px solid #edf0ed; }
.history-item:first-child { border-top: 0; }
.history-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.history-top strong { font-size: 12px; }
.history-item p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 18px; background: rgba(17, 28, 20, .38); }
.modal { width: min(100%, 465px); max-height: min(90dvh, 760px); overflow: auto; background: white; border-radius: 12px; box-shadow: 0 18px 60px rgba(0,0,0,.2); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 19px 20px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font: 700 17px 'Manrope', sans-serif; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.modal-body { padding: 18px 20px 20px; }
.modal-form { display: grid; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.toast { position: fixed; z-index: 30; right: 22px; bottom: 22px; display: flex; align-items: center; gap: 9px; max-width: min(410px, calc(100vw - 32px)); padding: 13px 16px; color: white; background: #203128; border-radius: 9px; box-shadow: 0 8px 30px #0002; font-size: 12px; line-height: 1.4; animation: toast-in .18s ease-out; }
.toast.error { background: #9f251c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.mobile-brand { display: none; }
.bottom-nav { display: none; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.top-gap { margin-top: 14px; }
.hidden { display: none !important; }

@media (max-width: 1050px) {
  .sidebar { width: 216px; }
  .main-column { margin-left: 216px; }
  .content { padding: 29px 25px 55px; }
  .topbar { padding: 0 25px; }
  .inventory-head, .inventory-row { grid-template-columns: minmax(155px, 1.4fr) minmax(90px, .75fr) minmax(70px, .5fr) minmax(105px, .75fr) 70px; gap: 8px; padding-left: 13px; padding-right: 13px; }
}
@media (max-width: 820px) {
  .sidebar { width: 72px; padding: 21px 9px 14px; align-items: center; }
  .brand { padding: 0; }
  .brand-copy, .side-business, .nav-link .nav-text, .sidebar-foot { display: none; }
  .brand-mark { width: 40px; height: 40px; }
  .side-nav { margin-top: 34px; width: 100%; }
  .nav-link { justify-content: center; padding: 12px 0; }
  .nav-link svg { width: 21px; height: 21px; }
  .main-column { margin-left: 72px; }
  .topbar { padding: 0 20px; }
  .content { padding: 26px 20px 48px; }
  .action-grid { gap: 10px; }
  .action-card { padding: 15px; }
  .sale-layout { grid-template-columns: minmax(0,1.15fr) minmax(210px,.85fr); }
  .inventory-head, .inventory-row { grid-template-columns: minmax(145px,1.4fr) minmax(80px,.75fr) 64px minmax(100px,.8fr) 62px; font-size: 11px; }
}
@media (max-width: 640px) {
  body { background: #f8faf8; }
  .sidebar { display: none; }
  .main-column { margin-left: 0; min-height: 100dvh; }
  .topbar { min-height: 62px; padding: 0 14px; gap: 8px; }
  .topbar-left { gap: 8px; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .mobile-brand .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
  .mobile-brand .brand-name { font-size: 12px; }
  .mobile-brand .business-mini { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; max-width: 133px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .desktop-business { display: none; }
  .topbar-actions { gap: 6px; }
  .demo-label { gap: 6px; font-size: 10px; }
  .demo-label input { width: 30px; height: 18px; }
  .demo-label input::after { width: 12px; height: 12px; }
  .demo-label input:checked::after { transform: translateX(12px); }
  .demo-active { font-size: 9px; padding: 5px 6px; }
  .text-button { font-size: 10px; }
  .content { padding: 23px 15px 94px; }
  .home-hero { display: block; margin-bottom: 23px; }
  .home-hero h1 { font-size: 28px; }
  .home-hero p { font-size: 12px; max-width: 400px; }
  .today-chip { margin-top: 13px; }
  .action-grid { display: grid; grid-template-columns: 1fr; gap: 9px; margin-bottom: 18px; }
  .action-card { min-height: 80px; display: grid; grid-template-columns: 42px 1fr 18px; grid-template-rows: auto auto; align-items: center; column-gap: 12px; padding: 13px; }
  .action-card .action-icon { grid-row: 1 / 3; width: 40px; height: 40px; }
  .action-card strong { margin: 0; align-self: end; font-size: 13px; }
  .action-card p { margin: 3px 0 0; grid-column: 2; align-self: start; font-size: 10px; }
  .action-card .card-arrow { position: static; grid-column: 3; grid-row: 1 / 3; }
  .stat-strip { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .stat-cell { padding: 12px 9px; }
  .stat-label { gap: 4px; font-size: 9px; }
  .stat-label svg { width: 13px; height: 13px; }
  .stat-value { font-size: 15px; }
  .stat-note { font-size: 9px; }
  .quick-lower { grid-template-columns: 1fr; gap: 10px; margin-top: 11px; }
  .panel-pad { padding: 15px; }
  .section-title h2 { font-size: 14px; }
  .page-heading { align-items: flex-start; margin-bottom: 19px; }
  .page-heading h1 { font-size: 25px; }
  .page-heading p { max-width: 330px; font-size: 11px; }
  .page-heading .heading-actions { justify-content: flex-end; }
  .page-heading .heading-actions .btn { min-height: 36px; padding: 0 10px; font-size: 10px; }
  .sale-layout, .cash-layout, .summary-layout { grid-template-columns: 1fr; gap: 11px; }
  .sale-side { position: static; }
  .sale-form { gap: 16px; }
  .field-row { gap: 10px; }
  .sale-total-card { padding: 15px; }
  .sale-total-card .total-amount { font-size: 25px; }
  .payment-options { gap: 6px; }
  .payment-option span { font-size: 11px; }
  .sale-actions .btn { flex: 1; }
  .success-wrap h1 { font-size: 24px; }
  .success-wrap > p { font-size: 12px; }
  .metric-row { gap: 7px; margin-bottom: 13px; }
  .metric-card { padding: 12px 10px; }
  .metric-card .metric-top { font-size: 9px; }
  .metric-card .metric-top svg { width: 14px; height: 14px; }
  .metric-card strong { font-size: 17px; }
  .toolbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .search-field { width: 100%; }
  .filter-row { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .filter-chip { flex: 0 0 auto; }
  .inventory-head { display: none; }
  .inventory-list { overflow: visible; background: transparent; border: 0; display: grid; gap: 8px; }
  .inventory-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 10px; padding: 12px; background: white; border: 1px solid var(--line); border-radius: 9px; }
  .inventory-row > :nth-child(1) { grid-column: 1; }
  .inventory-row > :nth-child(2) { grid-column: 1; grid-row: 2; padding-left: 45px; color: #3a483e; }
  .inventory-row > :nth-child(3) { grid-column: 1; grid-row: 3; padding-left: 45px; }
  .inventory-row > :nth-child(4) { grid-column: 2; grid-row: 1; justify-self: end; }
  .inventory-row > :nth-child(5) { grid-column: 2; grid-row: 2 / 4; align-self: center; }
  .inventory-product strong { font-size: 12px; }
  .inventory-product span { font-size: 9px; }
  .inventory-row .stock-mobile-label { color: var(--muted); font-size: 9px; }
  .inventory-row .stock-mobile-label strong { color: var(--ink); font-size: 11px; }
  .row-actions { gap: 2px; }
  .row-actions .icon-button { width: 29px; height: 29px; }
  .metric-row.inventory-metrics .metric-card strong { font-size: 15px; }
  .date-control { flex: 0 0 auto; }
  .date-control input { width: 130px; }
  .summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .summary-grid .metric-card strong { font-size: 17px; }
  .summary-grid .metric-card { min-height: 83px; }
  .summary-grid .metric-top { font-size: 9px; }
  .table-wrap { overflow-x: auto; }
  .sales-table { min-width: 480px; }
  .sales-table th, .sales-table td { padding: 10px 11px; }
  .bottom-nav { position: fixed; z-index: 10; inset: auto 0 0; display: grid; grid-template-columns: repeat(5,1fr); min-height: calc(65px + env(safe-area-inset-bottom)); padding: 7px 5px calc(7px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); }
  .bottom-nav .nav-link { display: flex; flex-direction: column; gap: 3px; justify-content: center; padding: 4px 0; border-radius: 7px; color: #758078; font-size: 9px; }
  .bottom-nav .nav-link.active { color: var(--green-800); background: transparent; }
  .bottom-nav .nav-link svg { width: 18px; height: 18px; }
  .bottom-nav .nav-link .nav-text { display: block; }
  .modal-backdrop { align-items: end; padding: 8px; }
  .modal { width: 100%; max-height: 88dvh; border-radius: 13px 13px 8px 8px; }
  .modal-head { padding: 16px 16px 12px; }
  .modal-body { padding: 15px 16px 18px; }
  .toast { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); font-size: 11px; }
}
@media (max-width: 380px) {
  .topbar { padding: 0 10px; }
  .mobile-brand .business-mini { max-width: 105px; }
  .demo-label { font-size: 9px; }
  .demo-active { display: none; }
  .content { padding-left: 12px; padding-right: 12px; }
  .field-row { grid-template-columns: 1fr; }
  .payment-options { flex-direction: column; }
  .inventory-row { padding: 10px; }
}
@media print {
  body { background: white; }
  .sidebar, .topbar, .bottom-nav, .heading-actions, .text-button, .btn { display: none !important; }
  .main-column { margin: 0; }
  .content { width: 100%; padding: 0; }
  .panel, .metric-card { break-inside: avoid; box-shadow: none; }
}
