/*
 * Grocery & Super Shop Pro — design system
 * GeckoX Technology
 *
 * Calm, dense, ledger-like: deep emerald for actions only, green-tinted
 * neutrals everywhere else, tabular figures for every number.
 * Bootstrap 5.3 supplies only the grid and utilities; every visible
 * component below is ours. All fonts are self-hosted (offline POS).
 */

/* ------------------------------------------------------------------ fonts */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Noto Sans Bengali"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/noto-sans-bengali-bengali-400-normal.woff2") format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Noto Sans Bengali"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/noto-sans-bengali-bengali-500-normal.woff2") format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Noto Sans Bengali"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/noto-sans-bengali-bengali-600-normal.woff2") format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Noto Sans Bengali"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/noto-sans-bengali-bengali-700-normal.woff2") format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }

/* ------------------------------------------------------------------ tokens */
:root {
  --brand: #0B5D45; --brand-hover: #094C39; --brand-tint: #E8F4EE; --brand-ink: #FFFFFF;
  --ink: #111A17; --ink-2: #4A5550; --ink-3: #848E89;
  --page: #F5F7F6; --card: #FFFFFF; --sunken: #EEF2F0; --hover: #F0F4F2;
  --line: #DFE5E2; --line-strong: #C9D2CD;
  --success: #18794E; --success-tint: #E6F4EC;
  --warning: #A86200; --warning-tint: #FDF2E2;
  --danger: #BE3A2E; --danger-tint: #FBECEA;
  --info: #2563A8; --info-tint: #E8F0FA;
  --focus: 0 0 0 3px rgba(11, 93, 69, .28);

  --font: "Inter", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 30px;
  --lh: 1.5; --lh-bn: 1.65;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --shadow-1: 0 1px 2px rgba(17, 26, 23, .05);
  --shadow-2: 0 4px 12px rgba(17, 26, 23, .08), 0 1px 2px rgba(17, 26, 23, .05);
  --shadow-3: 0 16px 40px rgba(17, 26, 23, .16), 0 2px 6px rgba(17, 26, 23, .06);

  --sidebar-w: 248px; --sidebar-w-collapsed: 64px; --header-h: 56px;
  --t-fast: 120ms ease; --t: 180ms ease;
  --z-header: 30; --z-sidebar: 40; --z-dropdown: 50; --z-modal: 60; --z-toast: 70;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #3FB58A; --brand-hover: #5CC79F; --brand-tint: #12352A; --brand-ink: #06140F;
    --ink: #E5ECE8; --ink-2: #A7B2AC; --ink-3: #6F7A75;
    --page: #0B110F; --card: #131B18; --sunken: #0F1613; --hover: #18221E;
    --line: #26312C; --line-strong: #34413B;
    --success: #4CC38A; --success-tint: #10291E; --warning: #E7A33E; --warning-tint: #2B2010;
    --danger: #F07167; --danger-tint: #2E1513; --info: #6CA6E8; --info-tint: #122136;
    --focus: 0 0 0 3px rgba(63, 181, 138, .35);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 4px 12px rgba(0, 0, 0, .45); --shadow-3: 0 16px 40px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #3FB58A; --brand-hover: #5CC79F; --brand-tint: #12352A; --brand-ink: #06140F;
  --ink: #E5ECE8; --ink-2: #A7B2AC; --ink-3: #6F7A75;
  --page: #0B110F; --card: #131B18; --sunken: #0F1613; --hover: #18221E;
  --line: #26312C; --line-strong: #34413B;
  --success: #4CC38A; --success-tint: #10291E; --warning: #E7A33E; --warning-tint: #2B2010;
  --danger: #F07167; --danger-tint: #2E1513; --info: #6CA6E8; --info-tint: #122136;
  --focus: 0 0 0 3px rgba(63, 181, 138, .35);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 4px 12px rgba(0, 0, 0, .45); --shadow-3: 0 16px 40px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font); font-size: var(--fs-md); line-height: var(--lh); -webkit-font-smoothing: antialiased; }
:lang(bn) body, body:lang(bn) { line-height: var(--lh-bn); }
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 600; line-height: 1.3; }
h1 { font-size: var(--fs-2xl); } h2 { font-size: var(--fs-xl); } h3 { font-size: var(--fs-lg); } h4 { font-size: var(--fs-md); }
p { margin: 0 0 var(--s3); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd { font-family: var(--font-mono); font-size: .92em; }
.num, td.num, th.num, .money { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--ink-2); } .subtle { color: var(--ink-3); } .small { font-size: var(--fs-sm); } .xsmall { font-size: var(--fs-xs); }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.icon-sm { width: 16px; height: 16px; } .icon-lg { width: 22px; height: 22px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; transition: grid-template-columns var(--t); }
.shell.is-collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: var(--z-sidebar); }
.sidebar-brand { display: flex; align-items: center; gap: var(--s3); height: var(--header-h); padding: 0 var(--s4); border-bottom: 1px solid var(--line); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: .02em; flex: none; }
.brand-text { line-height: 1.15; overflow: hidden; white-space: nowrap; }
.brand-text strong { display: block; font-size: var(--fs-sm); }
.brand-text span { font-size: var(--fs-xs); color: var(--ink-3); }
.nav { padding: var(--s3) var(--s2); display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section { padding: var(--s4) var(--s3) var(--s1); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.nav-link { display: flex; align-items: center; gap: var(--s3); min-height: 36px; padding: 0 var(--s3); border-radius: var(--r-sm); color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.nav-link:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav-link.is-active { background: var(--brand-tint); color: var(--brand); }
.nav-link .badge { margin-left: auto; }
.sidebar-foot { padding: var(--s3); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.shell.is-collapsed .brand-text, .shell.is-collapsed .nav-section, .shell.is-collapsed .nav-label, .shell.is-collapsed .nav-link .badge, .shell.is-collapsed .sidebar-foot span { display: none; }
.shell.is-collapsed .nav-link { justify-content: center; padding: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: var(--z-header); height: var(--header-h); display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s5); background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--line); }
.topbar-search { flex: 1; max-width: 420px; position: relative; }
.topbar-search .input { padding-left: 34px; height: 36px; background: var(--sunken); }
.topbar-search .icon { position: absolute; left: 10px; top: 9px; color: var(--ink-3); }
.topbar-spacer { flex: 1; }
.content { padding: var(--s5); max-width: 1440px; width: 100%; }
.license-banner { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s5); font-size: var(--fs-sm); border-bottom: 1px solid var(--line); }
.license-banner.is-warning { background: var(--warning-tint); color: var(--warning); }
.license-banner.is-danger { background: var(--danger-tint); color: var(--danger); }
.license-banner a { color: inherit; font-weight: 600; text-decoration: underline; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.page-header p { margin: var(--s1) 0 0; color: var(--ink-2); }
.breadcrumbs { display: flex; gap: var(--s2); font-size: var(--fs-xs); color: var(--ink-3); margin-bottom: var(--s2); }
.breadcrumbs a { color: var(--ink-3); }
.actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------------ components */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: var(--fs-lg); }
.card-body { padding: var(--s5); }
.card-foot { padding: var(--s3) var(--s5); border-top: 1px solid var(--line); background: var(--sunken); border-radius: 0 0 var(--r-md) var(--r-md); }
.stack > :not(:first-child) { margin-top: var(--s4); }
.stack-lg > :not(:first-child) { margin-top: var(--s5); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); height: 36px; padding: 0 var(--s4); border-radius: var(--r-sm); border: 1px solid transparent; font: 500 var(--fs-md)/1 var(--font); cursor: pointer; white-space: nowrap; transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast); text-decoration: none !important; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--card); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--hover); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--hover); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-sm { height: 30px; padding: 0 var(--s3); font-size: var(--fs-sm); }
.btn-lg { height: 44px; padding: 0 var(--s5); font-size: var(--fs-lg); }
.btn-icon { width: 36px; padding: 0; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: var(--fs-sm); font-weight: 500; color: var(--ink); }
.label .req { color: var(--danger); margin-left: 2px; }
.hint { font-size: var(--fs-xs); color: var(--ink-3); }
.error { font-size: var(--fs-xs); color: var(--danger); }
.input, .select, .textarea { width: 100%; height: 38px; padding: 0 var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--card); color: var(--ink); font: 400 var(--fs-md) var(--font); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.textarea { height: auto; min-height: 96px; padding: var(--s2) var(--s3); line-height: var(--lh); resize: vertical; }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.input::placeholder { color: var(--ink-3); }
.check { display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; font-size: var(--fs-md); }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.form-actions { display: flex; gap: var(--s2); justify-content: flex-end; padding-top: var(--s2); }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.badge-success { background: var(--success-tint); color: var(--success); }
.badge-warning { background: var(--warning-tint); color: var(--warning); }
.badge-danger { background: var(--danger-tint); color: var(--danger); }
.badge-info { background: var(--info-tint); color: var(--info); }
.badge-brand { background: var(--brand-tint); color: var(--brand); }

.alert { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r-sm); border: 1px solid transparent; font-size: var(--fs-md); }
.alert .icon { margin-top: 2px; }
.alert-success { background: var(--success-tint); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-warning { background: var(--warning-tint); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert-danger { background: var(--danger-tint); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-info { background: var(--info-tint); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert ul { margin: var(--s1) 0 0; padding-left: var(--s4); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; padding: var(--s3) var(--s4); background: var(--sunken); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table th.num, .table td.num { text-align: right; }
.table .row-actions { text-align: right; white-space: nowrap; }
.table-toolbar { display: flex; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.pagination { display: flex; gap: var(--s1); align-items: center; justify-content: space-between; padding: var(--s3) var(--s4); border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-2); }

.kpis { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.kpi { padding: var(--s4) var(--s5); }
.kpi-label { font-size: var(--fs-sm); color: var(--ink-2); display: flex; align-items: center; gap: var(--s2); }
.kpi-value { font-size: var(--fs-2xl); font-weight: 600; margin-top: var(--s2); font-variant-numeric: tabular-nums; }
.kpi-note { font-size: var(--fs-xs); color: var(--ink-3); margin-top: var(--s1); }

.empty { text-align: center; padding: var(--s7) var(--s5); color: var(--ink-2); }
.empty .icon { width: 36px; height: 36px; color: var(--ink-3); margin-bottom: var(--s3); }
.empty h3 { margin-bottom: var(--s2); }

.dl { display: grid; grid-template-columns: minmax(96px, max-content) 1fr; gap: var(--s2) var(--s4); margin: 0; font-size: var(--fs-md); }
.dl dt { color: var(--ink-2); }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; padding: var(--s1); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); display: none; z-index: var(--z-dropdown); }
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-item { display: flex; align-items: center; gap: var(--s2); width: 100%; padding: var(--s2) var(--s3); border: 0; border-radius: var(--r-sm); background: none; color: var(--ink); font: 400 var(--fs-md) var(--font); text-align: left; cursor: pointer; }
.dropdown-item:hover { background: var(--hover); text-decoration: none; }
.dropdown-item.is-active { color: var(--brand); font-weight: 600; }
.dropdown-sep { height: 1px; background: var(--line); margin: var(--s1) 0; }
.dropdown-head { padding: var(--s2) var(--s3); font-size: var(--fs-xs); color: var(--ink-3); }

.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; font-weight: 600; font-size: var(--fs-sm); flex: none; }
.chip-btn { display: inline-flex; align-items: center; gap: var(--s2); height: 36px; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); color: var(--ink); font: 500 var(--fs-sm) var(--font); cursor: pointer; }
.chip-btn:hover { background: var(--hover); }

.toast-stack { position: fixed; right: var(--s5); bottom: var(--s5); display: flex; flex-direction: column; gap: var(--s2); z-index: var(--z-toast); }
.toast { min-width: 280px; max-width: 420px; padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--ink); color: var(--page); box-shadow: var(--shadow-3); display: flex; gap: var(--s3); align-items: flex-start; font-size: var(--fs-md); animation: toast-in 180ms ease; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 14, 12, .45); display: none; align-items: center; justify-content: center; padding: var(--s4); z-index: var(--z-modal); }
.modal-backdrop.is-open { display: flex; }
.modal { width: 100%; max-width: 480px; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-3); }
.modal-body { padding: var(--s5); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s2); padding: var(--s3) var(--s5) var(--s5); }

.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin-bottom: var(--s5); overflow-x: auto; }
.tab { padding: var(--s3) var(--s4); color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

.skeleton { background: linear-gradient(90deg, var(--sunken), var(--hover), var(--sunken)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-sm); min-height: 14px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.code-block { font-family: var(--font-mono); font-size: var(--fs-xs); background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s3); overflow-wrap: anywhere; white-space: pre-wrap; max-height: 160px; overflow-y: auto; }
.perm-grid { display: grid; gap: var(--s2) var(--s4); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.perm-module { padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.perm-module:last-child { border-bottom: 0; }

/* ------------------------------------------------------------------ auth pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); }
.auth-aside { background: var(--brand); color: #E8F4EE; padding: var(--s8); display: flex; flex-direction: column; justify-content: space-between; }
.auth-aside h2 { color: #fff; font-size: var(--fs-3xl); max-width: 460px; }
.auth-aside p { color: #CFE7DC; max-width: 440px; }
.auth-aside .brand-mark { background: #fff; color: var(--brand); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: var(--s6) var(--s5); background: var(--card); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: var(--fs-2xl); margin-bottom: var(--s2); }
.auth-foot { display: flex; justify-content: space-between; margin-top: var(--s5); font-size: var(--fs-sm); }

/* ------------------------------------------------------------------ responsive */
.mobile-only { display: none; }
@media (max-width: 960px) {
  .shell, .shell.is-collapsed { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform var(--t); box-shadow: var(--shadow-3); }
  .shell.is-nav-open .sidebar { transform: none; }
  .shell.is-nav-open .main::before { content: ""; position: fixed; inset: 0; background: rgba(8, 14, 12, .45); z-index: calc(var(--z-sidebar) - 1); }
  .shell.is-collapsed .brand-text, .shell.is-collapsed .nav-section, .shell.is-collapsed .nav-label { display: initial; }
  .shell.is-collapsed .nav-link { justify-content: flex-start; padding: 0 var(--s3); }
  .mobile-only { display: inline-flex; }
  .desktop-only { display: none !important; }
  .topbar { padding: 0 var(--s4); }
  .content { padding: var(--s4); }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .dl { grid-template-columns: 1fr; gap: 2px var(--s4); }
  .dl dd { margin-bottom: var(--s2); }
}
@media (max-width: 560px) {
  .topbar-search { display: none; }
  .page-header { align-items: flex-start; }
  .table th, .table td { padding: var(--s2) var(--s3); }
}

@media print {
  .sidebar, .topbar, .license-banner, .actions, .toast-stack { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; }
}

/* ------------------------------------------------------------------ small modifiers */
.dropdown-menu.is-left { left: 0; right: auto; }
.chip-btn.is-static { cursor: default; }
.chip-btn.is-static:hover { background: var(--card); }
.chip-btn.is-user { border: 0; padding: 0 4px; background: transparent; }
.qr-box { display: inline-block; padding: var(--s3); background: #fff; border-radius: var(--r-md); border: 1px solid var(--line); }
.qr-box svg { display: block; width: 180px; height: 180px; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); font-family: var(--font-mono); font-size: var(--fs-md); }
.codes span { padding: var(--s2) var(--s3); background: var(--sunken); border-radius: var(--r-sm); text-align: center; letter-spacing: .04em; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .tick { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-strong); color: transparent; flex: none; }
.checklist .is-done .tick { background: var(--success); border-color: var(--success); color: #fff; }
.checklist .is-done a, .checklist .is-done span.text { color: var(--ink-3); text-decoration: line-through; }
.meter { height: 6px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.meter.is-high > span { background: var(--warning); }
.meter.is-full > span { background: var(--danger); }
.grid-2 { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.mw-sm { max-width: 520px; } .mw-md { max-width: 640px; } .mw-lg { max-width: 880px; }
.w-30 { width: 30%; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 0; }
.steps { padding-left: 20px; margin: 0; }
td.num.text-start { text-align: left; }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: var(--s5); text-align: center; }
.error-page .code { font-size: 64px; font-weight: 700; color: var(--brand); line-height: 1; font-variant-numeric: tabular-nums; }
.input[type=file] { height: auto; padding: 6px; }
.input[type=file]::file-selector-button { margin-right: var(--s3); height: 28px; padding: 0 var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--sunken); color: var(--ink); font: 500 var(--fs-sm) var(--font); cursor: pointer; }
.dl dd .btn { vertical-align: middle; }
fieldset.card { min-width: 0; padding: 0; margin: 0; }
fieldset[disabled] .input, fieldset[disabled] .select, fieldset[disabled] .textarea { background: var(--sunken); color: var(--ink-2); }
.logo-preview { width: 96px; height: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; padding: var(--s2); }
.check-grid { display: grid; gap: var(--s2) var(--s4); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.check.is-muted { color: var(--ink-3); }
.toolbar-form { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.toolbar-form .input, .toolbar-form .select { width: auto; min-width: 160px; height: 34px; }
.temp-password { font-family: var(--font-mono); font-size: var(--fs-lg); letter-spacing: .05em; }

/* ------------------------------------------------------------------ line items and picker */
.lines { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.lines th { text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; padding: var(--s2); background: var(--sunken); border-bottom: 1px solid var(--line); white-space: nowrap; }
.lines td { padding: var(--s2); border-bottom: 1px solid var(--line); vertical-align: top; }
.lines .input, .lines .select { height: 34px; font-size: var(--fs-sm); }
.lines .col-num { width: 120px; } .lines .col-unit { width: 140px; } .lines .col-act { width: 44px; text-align: right; }
.lines .sub { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; min-height: 1em; }
.lines .batch-row { display: flex; gap: var(--s2); margin-top: var(--s2); }
.lines .batch-row .input { width: auto; flex: 1; }
.picker { position: relative; }
.picker-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); z-index: var(--z-dropdown); display: none; max-height: 300px; overflow-y: auto; padding: var(--s1); }
.picker-menu.is-open { display: block; }
.picker-option { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: var(--s2) var(--s3); border: 0; background: none; border-radius: var(--r-sm); text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.picker-option small { color: var(--ink-3); font-size: var(--fs-xs); }
.picker-option:hover, .picker-option.is-active { background: var(--brand-tint); }
.picker-empty { padding: var(--s3); color: var(--ink-3); font-size: var(--fs-sm); }
.variant-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s4); background: var(--card); }
.variant-card + .variant-card { margin-top: var(--s3); }
.variant-card .packs { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px dashed var(--line); }
.barcode-field { display: flex; gap: var(--s2); align-items: flex-end; }
.barcode-field .field { flex: 1; }
.subnav { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.stat-strip { display: flex; gap: var(--s5); flex-wrap: wrap; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.stat-strip strong { font-variant-numeric: tabular-nums; }
.qty-neg { color: var(--danger); }
.qty-pos { color: var(--success); }

/* ------------------------------------------------------------------ labels */
.label-sheet { display: grid; grid-template-columns: repeat(auto-fill, 50mm); gap: 2mm; }
.shelf-label { width: 50mm; height: 30mm; border: 1px dashed var(--line-strong); padding: 1.5mm 2mm; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; background: #fff; color: #000; }
.shelf-label .l-name { font-size: 8pt; font-weight: 600; line-height: 1.2; max-height: 2.4em; overflow: hidden; }
.shelf-label .l-price { font-size: 11pt; font-weight: 700; }
.shelf-label .l-code svg { width: 100%; height: 11mm; }
.shelf-label .l-digits { font-size: 7pt; text-align: center; letter-spacing: .08em; font-family: var(--font-mono); }
@media print {
  @page { size: A4; margin: 8mm; }
  body { background: #fff; }
  .no-print { display: none !important; }
  .content { padding: 0; max-width: none; }
  .shelf-label { border-color: transparent; break-inside: avoid; }
}

/* ------------------------------------------------------------------ POS */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s4); align-items: start; }
.pos-cart { display: flex; flex-direction: column; min-height: calc(100vh - var(--header-h) - 2 * var(--s5)); }
.pos-search { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.pos-search .input { height: 44px; font-size: var(--fs-lg); }
.pos-lines { flex: 1; }
.pos-lines .empty { padding: var(--s8) var(--s5); }
.pos-foot { display: flex; gap: var(--s2); align-items: center; }
.pos-side { position: sticky; top: calc(var(--header-h) + var(--s4)); }
.pos-grand { display: flex; justify-content: space-between; align-items: baseline; padding: var(--s3) 0; margin-top: var(--s3); border-top: 1px solid var(--line); }
.pos-grand strong { font-size: var(--fs-3xl); font-variant-numeric: tabular-nums; color: var(--brand); }
.pos-customer { display: flex; justify-content: space-between; align-items: center; padding: var(--s2) var(--s3); border-radius: var(--r-sm); background: var(--brand-tint); }
.pos-modal { max-width: 560px; }
.pos-tenders { display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pos-tender { display: flex; flex-direction: column; gap: 4px; }
.pos-tender .input { height: 40px; }
.pos .lines .name { font-weight: 500; }
.pos .lines .input { text-align: right; }
@media (max-width: 1100px) { .pos { grid-template-columns: 1fr; } .pos-side { position: static; } .pos-cart { min-height: 0; } }
@media (max-width: 560px) { .pos-tenders { grid-template-columns: 1fr; } }
.pos .lines .col-num { width: 92px; }
.pos .lines .col-unit { width: 108px; }
.pos .lines td:first-child { min-width: 180px; }
.denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: var(--s2); }
.denom { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); }
.denom span { min-width: 60px; font-variant-numeric: tabular-nums; }
.denom .input { height: 34px; }
.report-table td.indent { padding-left: var(--s6); }
.report-table tr.total td { font-weight: 700; border-top: 2px solid var(--line-strong); }
.report-link { color: inherit; text-decoration: none !important; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.report-link:hover { border-color: var(--brand); box-shadow: var(--shadow-2); }
.input.input-sm, .select.select-sm { height: 32px; padding: 0 var(--s2); font-size: var(--fs-sm); }
.input.num { text-align: right; font-variant-numeric: tabular-nums; }
.btn.text-danger, .text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
@media print { .count-sheet .input { border: 0; background: none; } }
.print-only { display: none; }
@media print { .print-only { display: block; } .page-header .actions, .tabs { display: none !important; } }
/* ------------------------------------------------------------------ notifications */
.notice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); color: inherit; text-decoration: none !important; }
.notice:hover { background: var(--sunken); }
.notice .icon { margin-top: 3px; color: var(--ink-3); flex: none; }
.notice-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notice.is-unread { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.notice.is-unread .icon { color: var(--brand); }
.bell { position: relative; }
.bell-count { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; text-align: center; font-weight: 600; }
.dropdown-menu.is-wide { width: min(360px, calc(100vw - 32px)); padding: 0; }
.dropdown-menu.is-wide .notice { padding: var(--s2) var(--s3); }
.support-thread { display: flex; flex-direction: column; gap: var(--s3); }
.support-msg { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3) var(--s4); background: var(--card); white-space: pre-wrap; }
.support-msg.is-platform { background: color-mix(in srgb, var(--brand) 6%, var(--card)); border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); }
/* ------------------------------------------------------------------ till: connection status and offline receipt */
.pos-status { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3) 0; min-height: 28px; }
.pos-net { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs, 12px); color: var(--ink-3); }
.pos-net::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.pos-net.is-offline { color: var(--warning); font-weight: 600; }
.pos-net.is-offline::before { background: var(--warning); }
.pos-receipt-print { display: none; }
@media print {
  body.printing-offline-receipt * { visibility: hidden; }
  body.printing-offline-receipt .pos-receipt-print, body.printing-offline-receipt .pos-receipt-print * { visibility: visible; }
  body.printing-offline-receipt .pos-receipt-print { display: block; position: absolute; top: 0; left: 0; width: 72mm; font: 12px/1.35 "Inter", "Noto Sans Bengali", sans-serif; color: #000; }
  .pos-receipt-print .r-head { text-align: center; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
  .pos-receipt-print .r-row { display: flex; justify-content: space-between; gap: 8px; }
  .pos-receipt-print .r-strong { font-weight: 700; border-top: 1px dashed #000; padding-top: 2px; }
  .pos-receipt-print .r-foot { text-align: center; margin-top: 6px; }
}
