/* Keep POS cart controls fixed while the item list scrolls. */
.pos-workspace{min-height:0}
.pos-cart-panel{min-height:0;overflow:hidden}
.pos-cart{min-height:0;overflow-x:hidden;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#c4ccda transparent}
.pos-cart::-webkit-scrollbar{width:7px}
.pos-cart::-webkit-scrollbar-track{background:transparent}
.pos-cart::-webkit-scrollbar-thumb{border-radius:8px;background:#c4ccda}
@media(max-width:850px){.pos-cart-panel{min-height:440px;overflow:visible}.pos-cart{min-height:260px;max-height:calc(100vh - 600px)}}
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #3b82f6;
    --primary-dark: #1d4ed8;
    --warning: #f59e0b;
    --danger: #ef4444;
    --success: #22c55e;
    --border: rgba(148, 163, 184, 0.25);
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); }
a { text-decoration: none; color: inherit; }
.app-shell, .sm-shell { display: flex; min-height: 100vh; }
.app-sidebar, .sm-sidebar {
    width: 280px; flex: 0 0 280px; background: linear-gradient(180deg, #0f172a, #111827); color: #e2e8f0; padding: 30px 18px; position: sticky; top: 0; height: 100vh;
}
.brand, .sm-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; padding: 10px 12px; color: #fff; text-decoration: none; }
.brand-mark, .sm-brand-mark { width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(16,185,129,0.24)); display: grid; place-items: center; color: #60a5fa; font-size: 1.5rem; border: 1px solid rgba(255,255,255,0.08); }
.brand h1, .sm-brand strong { margin: 0; font-size: 1.4rem; }
.brand p, .sm-brand small { margin: 4px 0 0; color: #cbd5e1; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; display: block; }
.nav, .sm-nav { display: grid; gap: 10px; }
.nav a, .nav-toggle, .sm-nav>a, .sm-nav-toggle { padding: 12px 14px; border-radius: 12px; color: #dbeafe; display: flex; align-items: center; gap: 12px; border: 1px solid transparent; transition: 0.2s ease; }
.nav-toggle, .sm-nav-toggle { width: 100%; justify-content: space-between; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.nav-toggle span, .sm-nav-toggle span { display: flex; align-items: center; gap: 12px; }
.nav-toggle .nav-caret, .sm-chevron { transition: transform .2s ease; }
.nav-group.is-open .nav-caret, .sm-nav-group.is-open .sm-chevron { transform: rotate(180deg); }
.nav-submenu, .sm-subnav { display: none; gap: 4px; padding: 4px 0 4px 18px; }
.nav-group.is-open .nav-submenu, .sm-nav-group.is-open .sm-subnav { display: grid; }
.nav-submenu a, .sm-subnav a { padding: 9px 12px; font-size: .82rem; }
.nav a.active, .nav a:hover, .nav-toggle:hover, .nav-group.is-open > .nav-toggle, .sm-nav>a:hover, .sm-nav>a.is-active, .sm-nav-toggle:hover, .sm-nav-group.is-open>.sm-nav-toggle { background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.2); transform: translateX(2px); color: #fff; }
.nav i, .sm-nav i { width: 16px; text-align: center; }
.app-main, .sm-main { flex: 1; min-width: 0; }
.business-topbar, .sm-topbar { display:flex; align-items:center; gap:10px; min-height:58px; padding:8px 18px; border-bottom:1px solid var(--border); background:var(--surface); color:var(--text); position:sticky; top:0; z-index:25; box-shadow:0 4px 16px rgba(35,45,75,.06); }
.business-topbar-links, .sm-top-actions { display:flex; align-items:center; gap:7px; }
.business-topbar-collapse { display:grid; place-items:center; flex:0 0 32px; width:32px; height:32px; padding:0; border:0; border-radius:7px; background:transparent; color:var(--muted); cursor:pointer; }
.business-topbar-collapse:hover { background:var(--surface-soft); color:#7656f6; }
.business-topbar-collapse:focus-visible,.business-topbar-action:focus-visible,.theme-toggle:focus-visible { outline:3px solid rgba(118,86,246,.25); outline-offset:2px; }
.topbar-collapsed .app-sidebar { display:none; }
.topbar-collapsed .app-main { width:100%; }
.business-topbar-link { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:32px; padding:0 10px; border-radius:7px; background:#a28af8; color:#fff; font-size:.68rem; font-weight:700; white-space:nowrap; }
.business-topbar-link:hover,.business-topbar-link.active { background:#7656f6; }
.business-topbar-spacer { flex:1; }
.business-topbar-alert { position:relative; display:grid; place-items:center; flex:0 0 38px; width:38px; height:38px; border:1px solid rgba(118,86,246,.18); border-radius:12px; background:linear-gradient(145deg, rgba(118,86,246,.14), rgba(118,86,246,.04)); color:#7656f6; text-decoration:none; box-shadow:0 5px 14px rgba(118,86,246,.08); transition:transform .2s ease, box-shadow .2s ease, background .2s ease; }
.business-topbar-alert:hover { transform:translateY(-2px); background:linear-gradient(145deg, rgba(118,86,246,.22), rgba(118,86,246,.08)); box-shadow:0 8px 18px rgba(118,86,246,.16); }
.business-topbar-alert:focus-visible { outline:3px solid rgba(118,86,246,.25); outline-offset:2px; }
.business-topbar-alert i { font-size:.92rem; }
.business-topbar-alert-count { position:absolute; top:-6px; right:-6px; display:grid; place-items:center; min-width:18px; height:18px; padding:0 4px; border:3px solid var(--surface); border-radius:999px; background:#7656f6; color:#fff; font-size:.56rem; font-weight:800; line-height:1; animation:alert-count-pulse 1.8s ease-out infinite; }
.stock-alert { border-color:rgba(220,38,38,.2); background:linear-gradient(145deg, rgba(220,38,38,.13), rgba(220,38,38,.035)); color:#dc2626; box-shadow:0 5px 14px rgba(220,38,38,.08); }
.stock-alert:hover { background:linear-gradient(145deg, rgba(220,38,38,.21), rgba(220,38,38,.07)); box-shadow:0 8px 18px rgba(220,38,38,.16); }
.stock-alert .business-topbar-alert-count { border-radius:50%; background:#dc2626; }
@keyframes alert-count-pulse {
    0% { transform:scale(1); box-shadow:0 0 0 0 rgba(118,86,246,.48); }
    65% { transform:scale(1.08); box-shadow:0 0 0 7px rgba(118,86,246,0); }
    100% { transform:scale(1); box-shadow:0 0 0 0 rgba(118,86,246,0); }
}
.stock-alert .business-topbar-alert-count { animation-name: stock-count-pulse; }
@keyframes stock-count-pulse {
    0% { transform:scale(1); box-shadow:0 0 0 0 rgba(220,38,38,.5); }
    65% { transform:scale(1.08); box-shadow:0 0 0 7px rgba(220,38,38,0); }
    100% { transform:scale(1); box-shadow:0 0 0 0 rgba(220,38,38,0); }
}
@media (prefers-reduced-motion: reduce) {
    .business-topbar-alert-count { animation:none; }
}
.business-topbar-status, .sm-status { padding:7px 12px; border:1px solid #f4d27b; border-radius:999px; background:#fffaf0; color:#a66a00; font-size:.64rem; white-space:nowrap; }
.business-topbar-action, .business-topbar-profile, .sm-icon-button, .sm-avatar { display:grid; place-items:center; cursor:pointer; }
.business-topbar-action, .sm-icon-button { width:32px; height:32px; padding:0; border:0; border-radius:7px; background:transparent; color:var(--muted); }
.business-topbar-action:hover { background:var(--surface-soft); color:#7656f6; }
.theme-toggle:hover,.theme-toggle[aria-pressed="true"] { color:#7656f6; background:rgba(118,86,246,.1); }
.business-topbar-profile { width:32px; height:32px; padding:0; border:1px solid var(--border); border-radius:50%; background:var(--surface-soft); color:var(--text); font-size:.62rem; font-weight:700; }
.business-topbar-profile-wrap { position:relative; flex:0 0 32px; }
.business-topbar-profile-menu { position:absolute; top:40px; right:0; z-index:40; display:none; min-width:150px; padding:7px; border:1px solid var(--border); border-radius:8px; background:var(--surface); box-shadow:0 14px 32px rgba(35,45,75,.16); }
.business-topbar-profile-menu.is-open { display:grid; gap:3px; }
.business-topbar-profile-menu span,.business-topbar-profile-menu a { padding:7px 9px; color:var(--text); font-size:.68rem; white-space:nowrap; }
.business-topbar-profile-menu span { color:var(--muted); font-weight:700; }
.business-topbar-profile-menu a:hover { border-radius:5px; background:var(--surface-soft); color:#7656f6; }
html[data-theme="dark"] .business-topbar-profile-menu { border-color:var(--theme-border); background:var(--theme-surface); }
html[data-theme="dark"] .business-topbar-profile-menu a,html[data-theme="dark"] .business-topbar-profile-menu span { color:var(--theme-text); }
.sm-topbar h1 { margin: 4px 0 0; font-size: 1.25rem; }
.sm-kicker { display:block; color:var(--muted); font-size:.66rem; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
.sm-avatar { width:32px; height:32px; border:1px solid var(--border); border-radius:50%; color:var(--text); font-size:.62rem; font-weight:700; text-decoration:none; }
.app-content, .sm-content { padding: 28px; }
.card, .sm-card { background: var(--surface); border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow); }
.sm-page-head { display:flex; justify-content:space-between; align-items:end; gap:16px; margin-bottom:20px; }
.sm-page-head h2 { margin:0 0 5px; font-size:1.35rem; letter-spacing:-.04em; }
.sm-page-head p { margin:0; color:var(--muted); font-size:.78rem; }
.sm-actions { display:flex; gap:8px; align-items:center; }
.sm-btn { display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:10px 14px; border:0; border-radius:8px; background:#7b61e8; color:#fff; font:inherit; font-size:.74rem; font-weight:800; text-decoration:none; cursor:pointer; }
.sm-btn.secondary { background:var(--surface-soft); color:var(--muted); }
.sm-table-card { margin-top:16px; padding:20px; }.sm-table-wrap { overflow:auto; }.sm-table { width:100%; border-collapse:collapse; font-size:.75rem; }.sm-table th { padding:10px 8px; color:var(--muted); text-align:left; font-size:.65rem; text-transform:uppercase; }.sm-table td { padding:13px 8px; border-top:1px solid var(--border); }
.sm-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; }.sm-card { padding:20px; }.sm-field { display:grid; gap:7px; color:var(--muted); font-size:.72rem; font-weight:800; }.sm-field.full { grid-column:1/-1; }.sm-field input,.sm-field select,.sm-field textarea { width:100%; padding:11px 12px; border:1px solid var(--border); border-radius:8px; background:var(--surface-soft); color:var(--text); font:inherit; font-size:.78rem; }.sm-field textarea { min-height:90px; }.sm-empty { padding:35px 10px; color:var(--muted); text-align:center; font-size:.76rem; }.sm-label-grid,.sm-report-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }.sm-label { padding:18px; text-align:center; border:1px dashed var(--border); border-radius:10px; }.sm-label strong,.sm-label small { display:block; }.sm-label strong { margin:8px 0 4px; }.sm-label small { color:var(--muted); }
@media(max-width:980px){.app-shell,.sm-shell{flex-direction:column}.app-sidebar,.sm-sidebar{width:100%;height:auto;position:static}.sm-grid,.sm-report-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.sm-form-grid,.sm-grid,.sm-report-grid{grid-template-columns:1fr}.app-content,.sm-content{padding:16px}.sm-page-head{align-items:start;flex-direction:column}.business-topbar,.sm-topbar{padding:8px 12px}.business-topbar-links{overflow-x:auto}.business-topbar-link span{display:none}}
html[data-theme="dark"] body{background:#0b1220;color:#e8eef8}html[data-theme="dark"] .business-topbar,html[data-theme="dark"] .sm-topbar,html[data-theme="dark"] .card,html[data-theme="dark"] .sm-card{background:#111b2d;border-color:var(--theme-border)}html[data-theme="dark"] .sm-field input,html[data-theme="dark"] .sm-field select,html[data-theme="dark"] .sm-field textarea{background:#172338;color:#e8eef8;border-color:var(--theme-border)}

/* Shared dashboard visual system for supermarket modules. */
.sm-shell { background:#f4f8fc; }
.sm-shell > .sm-sidebar { width:260px; flex-basis:260px; padding:30px 18px; background:linear-gradient(180deg,#0d1729 0%,#111b2d 100%); }
.sm-shell > .sm-main { background:#f4f8fc; }
.sm-shell .business-topbar { min-height:62px; padding:10px 28px; box-shadow:0 2px 12px rgba(35,45,75,.04); }
.sm-shell .business-topbar-link { background:#8f78ef; }
.sm-shell .business-topbar-link:hover,.sm-shell .business-topbar-link.active { background:#7358e8; }
.sm-content { width:100%; max-width:1420px; padding:28px; }
.sm-page-head { margin-bottom:24px; align-items:flex-end; }
.sm-page-head h2 { margin:0 0 6px; font-size:1.75rem; letter-spacing:-.045em; }
.sm-page-head p { margin:0; color:var(--muted); font-size:.82rem; }
.sm-card { padding:20px; border-radius:15px; box-shadow:0 8px 24px rgba(35,45,75,.06); }
.sm-table-card { padding:20px; margin-top:16px; }
.sm-form-grid { gap:15px; }
.sm-field { gap:8px; color:var(--muted); font-size:.8rem; font-weight:600; }
.sm-field input,.sm-field select,.sm-field textarea { padding:12px 14px; border-radius:12px; background:#fff; color:var(--text); font-size:.8rem; }
.sm-btn { min-height:40px; padding:11px 16px; border-radius:10px; background:linear-gradient(135deg,var(--primary),#10b981); font-size:.76rem; }
.sm-btn:hover { filter:brightness(.97); transform:translateY(-1px); }
.sm-btn.secondary { background:var(--surface-soft); color:var(--muted); }
.sm-table { font-size:.78rem; }
.sm-table th { padding:11px 10px; font-size:.68rem; }
.sm-table td { padding:14px 10px; }
.sm-empty { padding:42px 14px; }
html[data-theme="dark"] .sm-shell,html[data-theme="dark"] .sm-shell > .sm-main { background:#0b1220; }
html[data-theme="dark"] .sm-field input,html[data-theme="dark"] .sm-field select,html[data-theme="dark"] .sm-field textarea { background:#172338; color:#e8eef8; }
@media(max-width:700px) {
    .sm-shell > .sm-sidebar { width:100%; flex-basis:auto; }
    .sm-shell .business-topbar { padding:8px 12px; }
    .sm-content { padding:16px; }
    .sm-page-head { align-items:flex-start; }
}
.sm-page-products-create .sm-page-head { max-width:980px; }
.sm-page-products-create .sm-card { width:min(980px,100%); }
.sm-page-products-create .sm-form-grid { display:block; }
.sm-page-products-create .sm-product-form-intro { display:flex; align-items:center; gap:14px; margin-bottom:24px; padding-bottom:20px; border-bottom:1px solid var(--border); }
.sm-page-products-create .sm-product-form-icon { display:grid; place-items:center; flex:0 0 42px; width:42px; height:42px; border-radius:12px; color:#fff; background:linear-gradient(135deg,#3b82f6,#0ea5e9); box-shadow:0 8px 18px rgba(59,130,246,.18); }
.sm-page-products-create .sm-product-form-intro h3 { margin:0 0 5px; font-size:1.05rem; }
.sm-page-products-create .sm-product-form-intro p { margin:0; color:var(--muted); font-size:.76rem; line-height:1.5; }
.sm-page-products-create .sm-product-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.sm-page-products-create .sm-price-field[hidden] { display:none; }
.sm-page-products-create .sm-product-fields > .sm-field:first-child { grid-column:1/-1; }
.sm-page-products-create .sm-upload-field { grid-column:1/-1; }
.sm-page-products-create .sm-product-fields .sm-field input { min-height:44px; }
.sm-page-products-create .sm-product-fields .sm-field select { min-height:44px; }
.sm-page-products-create .sm-field input:hover,.sm-page-products-create .sm-field select:hover,.sm-page-products-create .sm-field textarea:hover { border-color:var(--border); box-shadow:none; }
.sm-page-products-create .sm-barcode-input:hover { border-color:var(--border); box-shadow:none; }
.sm-page-products-create .sm-barcode-input { display:flex; align-items:center; min-height:44px; overflow:hidden; border:1px solid var(--border); border-radius:12px; background:var(--surface-soft); }
.sm-page-products-create .sm-barcode-input > i { flex:0 0 42px; display:grid; place-items:center; height:44px; color:#7656f6; background:rgba(118,86,246,.08); }
.sm-page-products-create .sm-barcode-scan,.sm-page-products-create .sm-barcode-generate { flex:0 0 42px; display:grid; place-items:center; height:44px; padding:0; border:0; color:#7656f6; background:rgba(118,86,246,.08); cursor:pointer; }
.sm-page-products-create .sm-barcode-scan:hover,.sm-page-products-create .sm-barcode-generate:hover { color:#6243e6; background:rgba(118,86,246,.16); }
.sm-page-products-create .sm-barcode-scan:focus-visible,.sm-page-products-create .sm-barcode-generate:focus-visible { outline:2px solid rgba(118,86,246,.35); outline-offset:-2px; }
.sm-page-products-create .sm-barcode-input .sm-barcode-end { flex-basis:34px; color:#8b7cf6; background:transparent; }
.sm-page-products-create .sm-barcode-generate { flex-basis:34px; color:#8b7cf6; background:transparent; }
.sm-page-products-create .sm-barcode-input input { min-width:0; min-height:42px; border:0; border-radius:0; background:transparent; }
.sm-page-products-create .sm-barcode-input input:focus { outline:0; box-shadow:none; }
.sm-page-products-create .sm-field > small { color:var(--muted); font-size:.68rem; font-weight:500; line-height:1.4; }
.sm-page-products-create .sm-field > span > small.sm-field-note { display:inline-block; margin-left:6px; padding:3px 7px; border:1px solid rgba(118,86,246,.2); border-radius:999px; color:#6243e6; background:rgba(118,86,246,.08); font-size:.62rem; font-weight:700; line-height:1.2; vertical-align:middle; }
html[data-theme="dark"] .sm-page-products-create .sm-field > span > small.sm-field-note { color:#c4b5fd; border-color:rgba(196,181,253,.28); background:rgba(118,86,246,.18); }
html[data-theme="dark"] .sm-page-products-create .sm-barcode-input { background:#172338; border-color:var(--theme-border); }
.sm-page-products-create .sm-required { color:#dc2626; }
.sm-page-products-create .required-feedback { color:#dc2626 !important; }
.sm-page-products-create .sm-upload-field input[type="file"] { min-height:44px; padding:10px; border-style:dashed; }
.sm-page-products-create .sm-image-input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.sm-page-products-create .sm-image-dropzone { position:relative; display:grid; place-items:center; gap:4px; min-height:130px; padding:14px 20px; border:2px dashed #cbd5e1; border-radius:12px; color:var(--muted); background:var(--surface-soft); text-align:center; cursor:pointer; transition:border-color .2s ease,background .2s ease; }
.sm-page-products-create .sm-image-dropzone:hover,.sm-page-products-create .sm-image-dropzone.is-dragging,.sm-page-products-create .sm-image-dropzone:focus-visible { border-color:#7656f6; background:rgba(118,86,246,.08); outline:none; }
.sm-page-products-create .sm-image-upload-icon { color:#7656f6; font-size:1.35rem; }
.sm-page-products-create .sm-image-dropzone strong { color:var(--text); font-size:.78rem; }
.sm-page-products-create .sm-image-dropzone > small { font-size:.68rem; font-weight:500; }
.sm-page-products-create .sm-image-file-name { max-width:100%; overflow:hidden; color:#6243e6; font-size:.68rem; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
.sm-page-products-create .sm-image-preview { width:100%; max-height:70px; border-radius:8px; object-fit:contain; }
.sm-page-products-create .sm-upload-progress { display:flex; align-items:center; gap:8px; width:100%; margin-top:4px; }
.sm-page-products-create .sm-upload-progress[hidden] { display:none; }
.sm-page-products-create .sm-upload-progress > span { flex:1; height:7px; overflow:hidden; border-radius:99px; background:#e2e8f0; }
.sm-page-products-create .sm-upload-progress-bar { display:block; width:0; height:100%; border-radius:inherit; background:linear-gradient(90deg,#7656f6,#0ea5e9); transition:width .15s ease; }
.sm-page-products-create .sm-upload-progress-text { min-width:30px; color:#6243e6; font-size:.65rem; font-weight:700; text-align:right; }
.sm-page-products-create .sm-upload-field small { color:var(--muted); font-size:.68rem; font-weight:500; }
.sm-page-products-create .sm-select-action { display:flex; align-items:stretch; gap:0; }
.sm-page-products-create .sm-select-action select { min-width:0; border-radius:12px 0 0 12px; }
.sm-page-products-create .sm-select-action a { display:grid; place-items:center; flex:0 0 42px; border-radius:0 12px 12px 0; color:#fff; background:#7656f6; text-decoration:none; }
.sm-page-products-create .sm-select-action a:hover { background:#6243e6; }
.sm-page-products-create .sm-description-field { grid-column:1/-1; }
.sm-page-products-create .sm-description-field textarea { min-height:120px; resize:vertical; }
.sm-page-products-create .sm-actions { margin-top:20px; padding-top:20px; border-top:1px solid var(--border); }
.sm-scan-modal[hidden],.sm-scan-upload[hidden],.sm-scan-video[hidden] { display:none !important; }
.sm-scan-modal { position:fixed; inset:0; z-index:1000; display:grid; place-items:center; padding:20px; }
.sm-scan-backdrop { position:absolute; inset:0; background:rgba(15,23,42,.55); backdrop-filter:blur(4px); }
.sm-scan-dialog { position:relative; width:min(480px,100%); padding:26px; border:1px solid var(--border); border-radius:16px; background:var(--surface); box-shadow:0 24px 70px rgba(15,23,42,.25); }
.sm-scan-dialog h2 { margin:0; font-size:1.15rem; color:var(--text); }
.sm-scan-status { margin:8px 0 16px; color:var(--muted); font-size:.76rem; }
.sm-scan-options { display:flex; flex-wrap:wrap; gap:9px; margin-bottom:16px; }
.sm-scan-options .sm-btn { min-height:40px; }
.sm-scan-upload { display:grid; place-items:center; gap:8px; min-height:220px; margin-bottom:16px; padding:28px 20px; border:2px dashed #cbd5e1; border-radius:12px; color:var(--muted); background:var(--surface-soft); text-align:center; cursor:pointer; }
.sm-scan-upload:hover,.sm-scan-upload.is-dragging { border-color:#7656f6; background:rgba(118,86,246,.08); }
.sm-scan-upload > i { color:#7656f6; font-size:2rem; }
.sm-scan-upload strong { color:var(--text); font-size:.82rem; }
.sm-scan-upload span { font-size:.72rem; }
.sm-scan-upload .sm-btn { margin-top:4px; }
.sm-scan-close { position:absolute; top:12px; right:12px; width:30px; height:30px; border:0; border-radius:7px; background:transparent; color:var(--muted); cursor:pointer; }
.sm-scan-close:hover { background:var(--surface-soft); color:var(--text); }
.sm-scan-video { display:block; width:100%; min-height:220px; border-radius:10px; background:#0f172a; object-fit:cover; }
.sm-scan-manual { display:flex; align-items:end; gap:10px; margin-top:16px; }
.sm-scan-manual .sm-field { flex:1; }
.sm-scan-use { flex:0 0 auto; }
html[data-theme="dark"] .sm-scan-dialog { background:var(--theme-surface); border-color:var(--theme-border); }
@media(max-width:480px) { .sm-scan-dialog { padding:22px 16px; } .sm-scan-manual { align-items:stretch; flex-direction:column; } }
@media(max-width:480px) { .sm-scan-options { flex-direction:column; } .sm-scan-options .sm-btn { width:100%; } }
@media(max-width:640px) { .sm-page-products-create .sm-product-fields { grid-template-columns:1fr; } }

/* Keep module navigation independently scrollable from page content. */
.sm-shell{min-height:100vh;align-items:stretch}
.sm-shell>.sm-sidebar{position:sticky;top:0;align-self:flex-start;height:100vh;max-height:100vh;overflow-x:hidden;overflow-y:auto;scrollbar-width:thin;scrollbar-color:rgba(148,163,184,.45) transparent}
.sm-shell>.sm-sidebar::-webkit-scrollbar{width:7px}.sm-shell>.sm-sidebar::-webkit-scrollbar-track{background:transparent}.sm-shell>.sm-sidebar::-webkit-scrollbar-thumb{border-radius:8px;background:rgba(148,163,184,.45)}
.sm-shell>.sm-main{min-height:100vh;min-width:0}
@media(max-width:700px){.sm-shell{display:flex;flex-direction:column}.sm-shell>.sm-sidebar{width:100%;height:auto;max-height:42vh;position:sticky;top:0;z-index:30}.sm-shell>.sm-main{min-height:58vh}}
.sm-row-actions{display:flex;align-items:center;gap:6px;white-space:nowrap}.sm-row-actions form{display:inline}.sm-row-edit,.sm-row-delete{width:30px;height:30px;display:grid;place-items:center;border:1px solid var(--border);border-radius:7px;background:var(--surface-soft);color:var(--muted);cursor:pointer}.sm-row-edit:hover{color:#7358e8;border-color:#b7aafb}.sm-row-delete:hover{color:#c24141;border-color:#f0aaaa}.sm-edit-card{margin-bottom:16px}.sm-edit-card .sm-page-head{margin-bottom:16px}
.sm-delete-modal[hidden]{display:none}.sm-delete-modal{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:20px}.sm-delete-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.48);backdrop-filter:blur(4px)}.sm-delete-dialog{position:relative;width:min(390px,100%);padding:28px 26px 24px;border:1px solid var(--border);border-radius:16px;background:var(--surface);box-shadow:0 24px 70px rgba(15,23,42,.24);text-align:center;animation:sm-delete-in .18s ease-out}.sm-delete-close{position:absolute;top:12px;right:12px;width:30px;height:30px;border:0;border-radius:7px;background:transparent;color:var(--muted);cursor:pointer}.sm-delete-close:hover{background:var(--surface-soft);color:var(--text)}.sm-delete-icon{width:48px;height:48px;display:grid;place-items:center;margin:0 auto 15px;border-radius:50%;color:#c24141;background:#ffeded;font-size:1.05rem}.sm-delete-dialog h2{margin:0;font-size:1.05rem;color:var(--text)}.sm-delete-dialog p{margin:9px 0 20px;color:var(--muted);font-size:.75rem;line-height:1.5}.sm-delete-actions{display:flex;justify-content:center;gap:9px}.sm-btn-danger{background:#d94b4b}.sm-btn-danger:hover{background:#bd3838}@keyframes sm-delete-in{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}

/* Supermarket POS */
.pos-page{background:#f4f7fb;color:#172033;overflow:hidden}.pos-shell{min-height:100vh;display:flex;flex-direction:column}.pos-header{height:64px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:8px 18px;background:#fff;border-bottom:1px solid var(--border);box-shadow:0 2px 12px rgba(35,45,75,.05)}.pos-brand{display:flex;align-items:center;gap:10px;color:var(--text);text-decoration:none}.pos-brand-mark{width:34px;height:34px;display:grid;place-items:center;border-radius:9px;color:#7358e8;background:#eeeaff}.pos-brand strong,.pos-brand small{display:block}.pos-brand strong{font-size:.92rem}.pos-brand small{margin-top:2px;color:var(--muted);font-size:.6rem;text-transform:uppercase;letter-spacing:.08em}.pos-header-actions{display:flex;align-items:center;gap:8px}.pos-live{color:#14804a;font-size:.68rem;font-weight:800}.pos-live i{font-size:.5rem}.pos-header-button,.pos-close{height:34px;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 11px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--muted);font:inherit;font-size:.68rem;text-decoration:none;cursor:pointer}.pos-header-button{width:34px;padding:0}.pos-close:hover,.pos-header-button:hover{color:#7358e8;border-color:#b7aafb}.pos-workspace{display:grid;grid-template-columns:minmax(0,1fr) 430px;flex:1;min-height:0}.pos-catalog{min-width:0;padding:14px;background:#f7f9fc;overflow:auto}.pos-toolbar{display:grid;grid-template-columns:minmax(0,1fr) 150px;gap:9px;margin-bottom:14px}.pos-search{position:relative}.pos-search i{position:absolute;left:13px;top:12px;color:#8a96a8;font-size:.75rem}.pos-search input,.pos-toolbar select,.pos-cart-toolbar select{width:100%;height:34px;padding:0 11px;border:1px solid #dce3ed;border-radius:7px;background:#fff;color:var(--text);font:inherit;font-size:.7rem}.pos-search input{padding-left:32px}.pos-product-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:11px}.pos-product{min-width:0;padding:0 9px 10px;border:1px solid #dde4ed;border-radius:9px;background:#fff;color:var(--text);text-align:left;cursor:pointer;box-shadow:0 4px 12px rgba(35,45,75,.04);transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease}.pos-product:hover{transform:translateY(-2px);border-color:#a995fa;box-shadow:0 8px 18px rgba(115,88,232,.14)}.pos-product:disabled{opacity:.55;cursor:not-allowed}.pos-product-image{height:108px;display:grid;place-items:center;margin:0 -9px 9px;border-radius:8px 8px 0 0;color:#fff;font-size:2.3rem;background:linear-gradient(135deg,#c3b7ff,#8069e9)}.pos-product:nth-child(3n) .pos-product-image{background:linear-gradient(135deg,#a9e7df,#27b9aa)}.pos-product:nth-child(3n+2) .pos-product-image{background:linear-gradient(135deg,#ffd89a,#f19b28)}.pos-product strong{display:block;min-height:28px;font-size:.7rem;line-height:1.3}.pos-product-meta{display:flex;justify-content:space-between;align-items:center;gap:5px;margin-top:7px}.pos-product-meta b{color:#008f80;font-size:.68rem}.pos-product-meta small{color:var(--muted);font-size:.62rem}.pos-empty-catalog{padding:70px 20px;color:var(--muted);text-align:center;font-size:.8rem}.pos-cart-panel{display:flex;flex-direction:column;min-width:0;background:#fff;border-left:1px solid #dfe5ee}.pos-cart-toolbar{display:flex;align-items:center;gap:7px;padding:10px 14px;border-bottom:1px solid #e6ebf2}.pos-cart-toolbar select{flex:1}.pos-cart-count{padding:7px 9px;border-radius:999px;color:#008f80;background:#e8faf7;font-size:.62rem;font-weight:800;white-space:nowrap}.pos-trash{width:32px;height:32px;border:0;border-radius:7px;color:#8a96a8;background:#f0f3f7;cursor:pointer}.pos-trash:hover{color:#d34b4b;background:#ffeded}.pos-cart{flex:1;min-height:260px;margin:0 14px;padding:10px 0;overflow:auto}.pos-cart-empty{height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;border:1px dashed #d8e0eb;border-radius:12px;color:#7d899b;text-align:center}.pos-cart-empty i{margin-bottom:5px;color:#b4bed0;font-size:1.3rem}.pos-cart-empty strong{font-size:.82rem;font-weight:600}.pos-cart-empty span{font-size:.72rem}.pos-cart-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:8px;padding:12px 0;border-bottom:1px solid #edf0f5}.pos-cart-item{display:flex;align-items:center;gap:8px;min-width:0}.pos-cart-item>div{min-width:0}.pos-cart-item strong,.pos-cart-item small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pos-cart-item strong{font-size:.7rem}.pos-cart-item small{margin-top:3px;color:var(--muted);font-size:.62rem}.pos-cart-thumb{width:30px;height:30px;display:grid;place-items:center;flex:0 0 30px;border-radius:8px;color:#7358e8;background:#eeeaff;font-size:.7rem}.pos-quantity{display:flex;align-items:center;gap:7px}.pos-quantity button{width:21px;height:21px;padding:0;border:1px solid #dce3ed;border-radius:5px;background:#fff;color:#7358e8;cursor:pointer}.pos-quantity b{font-size:.68rem}.pos-cart-row>strong{font-size:.68rem;white-space:nowrap}.pos-summary{padding:14px;border-top:1px solid #e6ebf2}.pos-summary>div{display:flex;justify-content:space-between;padding:6px 0;color:var(--muted);font-size:.7rem}.pos-summary>div strong{color:var(--text)}.pos-summary .pos-total{margin-top:5px;padding-top:12px;border-top:1px solid #dce3ed;color:var(--text);font-size:.82rem;font-weight:800}.pos-payment-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:13px}.pos-pay{height:40px;border:0;border-radius:6px;color:#fff;font:inherit;font-size:.68rem;font-weight:800;cursor:pointer}.pos-pay.primary{background:#13b9aa}.pos-pay.secondary{background:#f3a00d}.pos-toast{position:fixed;right:20px;top:78px;z-index:30;padding:10px 14px;border-radius:8px;color:#14804a;background:#e9faf1;border:1px solid #bce8ce;font-size:.72rem;font-weight:700}.pos-product[hidden]{display:none!important}@media(max-width:850px){.pos-workspace{grid-template-columns:1fr}.pos-cart-panel{min-height:440px;border-top:1px solid #dfe5ee;border-left:0}.pos-catalog{min-height:420px}.pos-header-actions .pos-live{display:none}}@media(max-width:520px){.pos-header{padding:8px 12px}.pos-brand small{display:none}.pos-toolbar{grid-template-columns:1fr}.pos-product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.pos-product-image{height:90px}.pos-close{font-size:0;width:34px;padding:0}.pos-close i{font-size:.75rem}}
html[data-theme="dark"] .pos-page{background:#0b1220;color:#e8eef8}html[data-theme="dark"] .pos-header,html[data-theme="dark"] .pos-cart-panel,html[data-theme="dark"] .pos-product,html[data-theme="dark"] .pos-search input,html[data-theme="dark"] .pos-toolbar select,html[data-theme="dark"] .pos-cart-toolbar select,html[data-theme="dark"] .pos-header-button,html[data-theme="dark"] .pos-close{background:#111b2d;color:#e8eef8;border-color:var(--theme-border)}html[data-theme="dark"] .pos-catalog{background:#0f192a}html[data-theme="dark"] .pos-cart-row{border-color:var(--theme-border)}html[data-theme="dark"] .pos-cart-empty{border-color:var(--theme-border)}html[data-theme="dark"] .pos-summary{border-color:var(--theme-border)}

/* The cart body gets the only vertical scroll area in the POS pane. */
.pos-page,.pos-shell{height:100vh;max-height:100vh}
.pos-shell{min-height:0;overflow:hidden}
.pos-workspace{height:calc(100vh - 64px);min-height:0;overflow:hidden}
.pos-cart-panel{height:100%;min-height:0;overflow:hidden}
.pos-cart{height:auto;min-height:0;overflow-x:hidden;overflow-y:scroll}
@media(max-width:850px){.pos-page,.pos-shell{height:auto;max-height:none;min-height:100vh}.pos-shell{overflow:visible}.pos-workspace{height:auto;min-height:0;overflow:visible}.pos-cart-panel{height:auto;min-height:440px;overflow:visible}.pos-cart{height:260px;min-height:260px;max-height:260px;overflow-y:scroll}}

/* Keep the product filters visible while the catalog items scroll. */
.pos-catalog{display:flex;flex-direction:column;overflow:hidden}
.pos-catalog{padding-top:0}
.pos-toolbar{position:sticky;top:0;z-index:2;flex:0 0 auto;padding:12px 14px;margin:0 -14px 14px;border:0;border-bottom:1px solid var(--border);border-radius:0;background:#fff;box-shadow:none}
.pos-product-grid{min-height:0;overflow-x:hidden;overflow-y:auto;padding:1px;scrollbar-width:thin;scrollbar-color:#c4ccda transparent}
.pos-product-grid::-webkit-scrollbar{width:7px}
.pos-product-grid::-webkit-scrollbar-track{background:transparent}
.pos-product-grid::-webkit-scrollbar-thumb{border-radius:8px;background:#c4ccda}
html[data-theme="dark"] .pos-toolbar{background:#111b2d;border-bottom-color:var(--theme-border)}
.pos-cart-row{grid-template-columns:minmax(0,1fr) auto auto auto}
.pos-cart-remove{width:26px;height:26px;display:grid;place-items:center;padding:0;border:1px solid transparent;border-radius:7px;background:transparent;color:#8a96a8;font:inherit;font-size:.65rem;cursor:pointer}
.pos-cart-remove:hover{border-color:#f0aaaa;background:#fff1f1;color:#c24141}
html[data-theme="dark"] .pos-cart-remove:hover{border-color:#8f4b52;background:#321d25;color:#ff8d96}
@media(max-width:850px){.pos-page{overflow-x:hidden;overflow-y:auto}.pos-catalog{overflow:visible}.pos-product-grid{overflow:visible}}
.pos-toast.is-hidden{display:none}
.pos-toast.error{border-color:#f0aaaa;background:#fff1f1;color:#a93636}
html[data-theme="dark"] .pos-toast.error{border-color:#8f4b52;background:#321d25;color:#ffb0b7}
