:root {
    color-scheme: light;
    --background: #f8f8fa;
    --paper: #fff;
    --ink: #25242b;
    --muted: #5e5c69;
    --line: #e7e6ec;
    --control-line: #cbc9d3;
    --soft: #f5f5f7;
    --accent: #634fd1;
    --accent-hover: #503bbd;
    --accent-soft: #efecfc;
    --accent-line: #d9d0fa;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 16px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
body { margin: 0; min-width: 300px; background: var(--background); color: var(--ink); font: 16px/1.55 "Nirmala UI", "Noto Sans Bengali", system-ui, sans-serif; }
a { color: inherit; }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 230px; display: flex; flex-direction: column; padding: 23px 15px 16px; background: var(--paper); color: var(--ink); box-shadow: inset -1px 0 var(--line); overflow-y: auto; z-index: 1; }
.brand { display: flex; gap: 11px; align-items: center; margin: 0 7px 20px; color: var(--ink); text-decoration: none; font-size: 25px; font-weight: 750; line-height: 1.2; }
.brand small { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; font-weight: 500; }
.logo { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 12px; font-size: 21px; }
.sidebar nav { display: grid; gap: 12px; margin-bottom: 16px; }
.nav-group { display: grid; gap: 3px; }
.nav-caption { margin: 0 10px 3px; color: var(--muted); font-size: 13px; font-weight: 650; }
.sidebar nav a { display: flex; min-height: 39px; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; text-decoration: none; font-size: 15px; white-space: nowrap; }
.sidebar nav a:hover { background: var(--soft); }
.sidebar nav a[aria-current] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 3px 0 var(--accent); font-weight: 700; }
.nav-icon { display: inline-grid; width: 19px; place-items: center; font-family: system-ui, sans-serif; color: var(--muted); font-size: 18px; }
.sidebar nav a[aria-current] .nav-icon { color: inherit; }
.demo-pane { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding: 14px 4px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.demo-pane i { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--muted); }
.demo-pane button { padding: 3px 5px; color: var(--muted); background: transparent; border: 0; text-decoration: underline; }
main { margin-left: 230px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 61px; padding: 8px clamp(16px, 3vw, 42px); background: var(--paper); border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 700; }
.today { display: flex; align-items: center; gap: 13px; color: var(--muted); font-weight: 500; }
.language-switch { display: flex; flex: 0 0 auto; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--background); }
.language-switch a { padding: 3px 8px; border-radius: 5px; text-decoration: none; color: var(--muted); font-size: 14px; }
.language-switch a:hover { background: var(--paper); }
.language-switch a[aria-current] { color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.brand-name { min-width: 0; overflow-wrap: anywhere; font-size: 21px; }
.shop-logo, .settings-logo, .print-logo { object-fit: contain; background: #fff; }
.top-pos { min-height: 34px !important; padding: 5px 10px !important; }
.content { max-width: 1480px; margin: 0 auto; padding: 30px clamp(16px, 3vw, 42px) 42px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 24px; }
h1 { font-size: clamp(25px, 3vw, 35px); line-height: 1.3; letter-spacing: -.02em; }
.page-head p, .panel-head p { margin-top: 5px; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.page-dashboard .page-head { min-height: 124px; padding: 20px 24px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); border-radius: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 7px 14px; border: 1px solid transparent; border-radius: 8px; font-weight: 700; line-height: 1.35; text-decoration: none; white-space: nowrap; }
.primary { color: #fff; background: var(--accent); }
.primary:hover { background: var(--accent-hover); }
.secondary { color: var(--ink); background: var(--paper); border-color: var(--control-line); }
.secondary:hover { background: var(--soft); }
.plain { background: transparent; color: var(--accent); }
.plain:hover:enabled { background: var(--accent-soft); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; }
.stat { display: grid; align-content: start; gap: 7px; min-height: 145px; padding: 16px 17px; text-decoration: none; }
.stat:hover { border-color: var(--accent-line); background: #fdfcff; }
.stat > span:nth-child(2) { color: var(--muted); font-size: 14px; }
.stat strong { color: var(--accent); font-size: clamp(22px, 2.4vw, 30px); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat strong small { font-size: 15px; color: var(--muted); }
.stat-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 9px; color: var(--accent); background: var(--accent-soft); font: 22px/1 system-ui, sans-serif; }
.badge.amber { color: #794b15; background: #fbefd9; }
.badge.danger { color: #8a3129; background: #fae9e7; }
.badge.green { color: #235a44; background: #e0f1e8; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(225px, 1fr); gap: 18px; align-items: start; }
.summary-bar { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
.summary-bar a { display: grid; gap: 5px; padding: 13px 17px; text-decoration: none; }
.summary-bar a + a { border-left: 1px solid var(--line); }
.summary-bar a:hover { background: var(--soft); }
.summary-bar span, .field-help { color: var(--muted); font-size: 14px; }
.summary-bar strong { font-size: 21px; }
.panel { margin-bottom: 18px; overflow: hidden; }
.panel-head { padding: 17px 19px 15px; }
.panel-head h2, .receipt h2 { font-size: 21px; line-height: 1.35; }
.panel-head p { font-size: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 15px; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 19px; }
th:last-child, td:last-child { padding-right: 19px; }
thead th { background: var(--soft); color: var(--muted); font-weight: 700; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td small, .stock-line small, .receipt-id small { display: block; color: var(--muted); font-size: 13px; }
.number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ref { color: var(--ink); font-weight: 700; }
a.ref { color: var(--accent); }
a.ref { text-underline-offset: 3px; }
.badge { display: inline-block; padding: 4px 9px; border-radius: 999px; white-space: nowrap; font-size: 13px; font-weight: 700; }
.stock-line { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin: 0 19px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.stock-line strong, .stock-line small { display: block; }
.panel-link { display: inline-block; margin: 13px 19px 17px; font-size: 15px; color: var(--accent); font-weight: 700; text-underline-offset: 4px; }
.quick { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.quick > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; }
.filters, .actions { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.filters { padding: 15px 19px; }
.panel-head + .filters { padding-top: 0; }
.filters .push { margin-left: auto; }
.form-body { padding: 0 19px 19px; }
.form-body > .button { margin-top: 18px; }
.fields { display: grid; gap: 13px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.fields.three { grid-template-columns: 1.4fr 1fr 1fr; }
.span-all { grid-column: 1 / -1; }
label { display: grid; gap: 5px; color: var(--ink); font-size: 15px; font-weight: 650; }
input:not([type=hidden],[type=checkbox]), select { min-width: 0; width: 100%; min-height: 42px; padding: 7px 9px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--paper); color: var(--ink); font-weight: 500; }
.check { display: flex; align-items: center; gap: 6px; min-height: 42px; }
.check input { accent-color: var(--accent); }
.narrow { max-width: 720px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); align-items: start; gap: 15px; }
summary { padding: 15px 19px; font-weight: 700; }
.item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 22px 0 10px; }
h3 { font-size: 17px; }
.sale-row { display: grid; grid-template-columns: minmax(120px, 2fr) 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 9px; }
.remove { min-width: 39px; padding-inline: 6px; }
.totals-fields { margin-top: 16px; align-items: end; }
.form-total { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 13px; margin-top: 12px; background: var(--soft); border-radius: 8px; }
.form-total strong { font-size: 21px; }
.form-total[data-document-total] { display: grid; grid-template-columns: 1fr auto 1fr auto; }
.form-total[data-document-total] span:nth-of-type(2) { justify-self: end; padding-left: 12px; }
.ledger-total { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 19px; color: var(--ink); background: var(--soft); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.document-actions { margin-bottom: 17px; }
.field-help { margin-top: 12px; }
.document-payment { display: flex; flex-wrap: wrap; gap: 9px 22px; }
.settings-layout { max-width: 1020px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; align-items: start; }
.settings-layout > .panel { margin-bottom: 0; }
.settings-layout > .panel:first-of-type { grid-row: span 2; }
.settings-controls { display: grid; align-items: start; gap: 7px; }
.settings-controls .ref { margin-top: 5px; }
.settings-save { grid-column: 1 / -1; }
.settings-layout + .panel { margin-top: 18px; }
.setup-shell { max-width: 700px; margin: 0 auto; padding: 34px 16px; }
.setup-shell header { margin-bottom: 18px; }
.setup-brand { color: var(--accent); font-weight: 750; margin-bottom: 5px; }
.logo-field, .language-options { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.settings-logo { width: 65px; height: 65px; border: 1px solid var(--line); border-radius: 8px; }
.logo-field label { flex: 1; min-width: 0; }
.logo-field small { color: var(--muted); }
.language-options { margin-top: 5px; }
.print-brand { display: flex; align-items: center; gap: 12px; margin: 16px 19px 0; padding-bottom: 11px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.print-brand strong { font-size: 19px; }
.print-brand div div { font-size: 13px; color: var(--muted); }
.print-logo { width: 55px; height: 46px; }
.receipt .print-brand { margin: 0 0 12px; }
.page-invoice .signature, .page-purchase-detail .signature { display: none; }
.density-compact .content { padding-top: 19px; }
.density-compact th, .density-compact td { padding-block: 6px; }
.density-compact .panel-head, .density-compact .pos-panel-head { padding-block: 11px; }
.density-compact .pos-product { min-height: 130px; gap: 4px; }
.notice, .error { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; padding: 10px 14px; margin-bottom: 15px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink); background: var(--paper); }
.empty, .panel-note { padding: 14px 19px; color: var(--muted); }
.positive { color: var(--accent); font-weight: 700; }
.negative { color: #515151; font-weight: 700; }
.report-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; margin: 0 19px 18px; background: var(--line); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.aging-strip { grid-template-columns: repeat(5,minmax(0,1fr)); }
.report-strip > div { display: grid; gap: 3px; padding: 10px 13px; background: #fafafa; font-size: 14px; }
.report-strip strong { font-size: 19px; }
.receipt { max-width: 645px; padding: 25px; }
.receipt-top { display: flex; justify-content: space-between; gap: 12px; align-items: end; border-bottom: 1px solid var(--line); padding-bottom: 15px; }
.receipt-brand { display: block; margin-bottom: 4px; color: var(--accent); font-weight: 700; }
.receipt-id { text-align: right; }
.receipt dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.receipt dt { color: var(--muted); font-size: 14px; }
.receipt dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.signature { width: max-content; max-width: 100%; margin: 65px 0 0 auto; padding: 7px 8px 0; text-align: center; border-top: 1px solid var(--muted); color: var(--muted); }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(302px, 1fr); align-items: start; gap: 18px; }
.pos-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 19px; border-bottom: 1px solid var(--line); }
.pos-panel-head h2 { font-size: 21px; }
.pos-panel-head p { color: var(--muted); font-size: 14px; }
.pos-cart-jump { display: none; }
.pos-tools { display: grid; gap: 13px; padding: 17px 19px 14px; }
.pos-search { position: relative; }
.pos-search input { min-height: 48px !important; padding-inline: 40px 39px !important; }
.search-mark { position: absolute; top: 16px; left: 15px; height: 13px; width: 13px; border: 1.7px solid var(--muted); border-radius: 50%; pointer-events: none; }
.search-mark::after { content: ""; position: absolute; width: 6px; height: 1.7px; background: var(--muted); transform: rotate(45deg); bottom: -3px; right: -4px; }
kbd { font: 12px/1.2 system-ui, sans-serif; padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; white-space: nowrap; }
.pos-search kbd { position: absolute; top: 12px; right: 11px; color: var(--muted); pointer-events: none; }
.unit-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.unit-filter { padding: 5px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--muted); font-weight: 700; font-size: 14px; }
.unit-filter[aria-pressed=true], .unit-filter:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.pos-products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 2px 19px 19px; }
.pos-product { display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 8px; min-width: 0; min-height: 158px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); color: var(--ink); }
.pos-product:hover:enabled { background: #faf9fe; border-color: var(--accent-line); }
.pos-product strong { overflow-wrap: anywhere; line-height: 1.3; font-size: 16px; }
.pos-product-meta, .pos-product-foot { display: flex; align-items: center; justify-content: space-between; gap: 5px; font-size: 13px; color: var(--muted); }
.pos-product-meta > span:last-child { overflow-wrap: anywhere; text-align: right; }
.pos-unit { white-space: nowrap; font-weight: 700; }
.pos-product-price { font-size: 19px; font-weight: 750; line-height: 1.2; }
.pos-product-price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.pos-product-foot { margin-top: auto; padding-top: 5px; }
.pos-add { display: grid; place-items: center; min-width: 26px; height: 26px; color: var(--accent); background: var(--accent-soft); border-radius: 7px; font: 21px/1 system-ui, sans-serif; }
.pos-cart-list { padding: 12px 17px; max-height: 295px; overflow-y: auto; }
.pos-cart-empty { display: grid; place-items: center; min-height: 89px; text-align: center; border: 1px dashed #cccccc; border-radius: 9px; color: var(--muted); font-size: 14px; padding: 10px; }
.pos-cart-row { display: grid; gap: 8px; padding: 9px 0; }
.pos-cart-row + .pos-cart-row { border-top: 1px solid var(--line); }
.pos-line-heading, .pos-line-controls { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.pos-line-heading strong:last-child { white-space: nowrap; }
.pos-line-heading small { display: block; color: var(--muted); font-size: 13px; }
.pos-line-controls { align-items: center; }
.qty-control { display: grid; grid-template-columns: 33px minmax(55px, 83px) 33px; align-items: stretch; border: 1px solid #d1d1d1; border-radius: 8px; overflow: hidden; }
.qty-control button { border: 0; color: var(--accent); background: #f5f5f5; font: 21px/1 system-ui, sans-serif; }
.qty-control input { appearance: textfield; min-height: 34px !important; padding: 4px !important; text-align: center; border: 0 !important; border-radius: 0 !important; }
.qty-control input::-webkit-inner-spin-button { appearance: none; }
.qty-control :focus-visible { outline-offset: -3px; }
.remove-line { min-height: 33px; padding: 4px 8px; }
.pos-checkout { display: grid; gap: 11px; padding: 15px 17px 17px; border-top: 1px solid var(--line); }
.pos-totals { display: grid; gap: 4px; background: var(--soft); padding: 10px 12px; border-radius: 9px; }
.pos-totals > div { display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
.pos-totals > div:first-child { align-items: center; font-weight: 700; }
.pos-totals > div:first-child strong { font-size: 24px; color: var(--accent); }
.pos-totals > div:not(:first-child) { font-size: 14px; }
.pos-feedback { color: #3f3f3f; font-size: 14px; padding-inline: 3px; }
.pos-submit { display: flex; justify-content: space-between; gap: 8px; min-height: 46px; }
.pos-submit kbd { border-color: #b9b9b9; }
@media (min-width: 1051px) {
    .pos-cart { position: sticky; top: 15px; }
}
@media (max-width: 1200px) {
    .pos-products { grid-template-columns: repeat(2,minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
    .sidebar { width: 205px; }
    main { margin-left: 205px; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 0; }
    .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
    .pos-layout { grid-template-columns: 1fr; gap: 0; }
    .pos-cart-jump { display: inline-flex; }
}
@media (max-width: 700px) {
    .sidebar { position: static; width: auto; padding: 12px; box-shadow: inset 0 -1px var(--line); }
    .brand { margin: 0 2px 10px; font-size: 20px; }
    .logo { width: 35px; height: 35px; }
    .sidebar nav { display: flex; overflow-x: auto; padding-bottom: 4px; }
    .nav-group { display: contents; }
    .nav-caption { display: none; }
    .sidebar nav a { padding: 7px 9px; }
    .demo-pane { margin-top: 7px; padding-top: 6px; }
    main { margin-left: 0; }
    .topbar { min-height: 45px; }
    .content { padding-top: 18px; }
    .page-head { align-items: start; flex-wrap: wrap; }
    .form-grid { grid-template-columns: 1fr; gap: 0; }
    .report-strip, .aging-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .fields.three { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .fields.three label:first-child { grid-column: 1/-1; }
    .pos-cart-list { max-height: none; }
    .page-dashboard .page-head { min-height: auto; padding: 15px; }
    .settings-layout { grid-template-columns: 1fr; }
    .settings-layout > .panel:first-of-type { grid-row: auto; }
    .today { gap: 6px; }
    .today time { display: none; }
}
@media (max-width: 425px) {
    .sale-row { grid-template-columns: 1fr 1fr auto; }
    .sale-row label:first-child { grid-column: 1/-1; }
    .fields, .fields.three { grid-template-columns: 1fr; }
    .stats { gap: 9px; }
    .stat { padding: 12px; min-height: 84px; }
    .summary-bar { grid-template-columns: 1fr; }
    .summary-bar a + a { border-top: 1px solid var(--line); border-left: 0; }
    .form-total[data-document-total] { grid-template-columns: 1fr auto; }
    .form-total[data-document-total] span:nth-of-type(2) { justify-self: start; padding-left: 0; }
    .top-pos { display: none; }
    .pos-product-foot .badge { white-space: normal; }
    .pos-add { display: none; }
}
@media print {
    body { min-width: 0; background: #fff; font-size: 12pt; color: #111; }
    .sidebar, .topbar, .page-head, .notice, .no-print { display: none !important; }
    main, .content { margin: 0; padding: 0; }
    .print-area { max-width: none; border: 0; border-radius: 0; overflow: visible; }
    .table-wrap { overflow: visible; }
    th, td { padding: 8px; }
    tr { break-inside: avoid; }
    .report-strip { grid-template-columns: repeat(4,minmax(0,1fr)); }
    a, a.ref { text-decoration: none; color: inherit; }
    .page-invoice .signature, .page-purchase-detail .signature { display: block; margin-right: 19px; }
    .print-brand { margin-top: 0; break-inside: avoid; }
}
