:root {
    color-scheme: light;
    --bg: #f6f8fa;
    --surface: #fff;
    --text: #475467;
    --head: #182230;
    --muted: #667085;
    --line: #edf0f4;
    --brand: #087f70;
    --brand-dark: #066658;
    --brand-soft: #eaf7f3;
}
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/poppins-700.woff2") format("woff2"); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
#pwa-status:empty { display: none; }
#pwa-status:not(:empty) { margin: 12px 24px; }
.report-help { margin-bottom: 16px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.6 "Poppins", "Segoe UI", sans-serif; }
a { color: var(--brand-dark); text-decoration: none; }
h1, h2, h3, strong { color: var(--head); }
h1 { font-size: 27px; line-height: 1.25; margin: 5px 0 9px; letter-spacing: -.8px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 16px; }
p { margin: 0 0 16px; }
button, input, select, textarea { font: inherit; }
button:disabled { opacity: .5; cursor: not-allowed; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid #4a9388; outline-offset: 2px; }
label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
input { width: 100%; min-width: 0; height: 44px; border: 1px solid #e2e7ed; background: var(--surface); border-radius: 8px; padding: 9px 12px; color: var(--head); }
input:focus { outline: none; border-color: #77afa7; box-shadow: 0 0 0 2px #087f7014; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 16px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color .15s, border-color .15s; }
.primary { background: var(--brand); color: white; }
.primary:hover:not(:disabled) { background: var(--brand-dark); }
.secondary { background: white; color: var(--text); border-color: var(--line); }
.secondary:hover:not(:disabled) { background: #f8fafc; border-color: #cfd7e2; }
.full-width { width: 100%; }
.button.is-loading::before, .salesman-combobox.is-loading::after, .loading-spinner { content: ""; display: inline-block; width: 16px; height: 16px; flex: 0 0 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: loading-spin .8s linear infinite; }
.salesman-combobox.is-loading::after { position: absolute; right: 12px; top: 14px; color: var(--brand); }
.salesman-combobox.is-loading input { padding-right: 36px; }
.button.is-loading:disabled { opacity: .85; }
.page-loading { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--brand-dark); box-shadow: 0 4px 20px #18223012; font-size: 12px; pointer-events: none; }
.is-shimmer, .navigation-loading .kpi-value { border-radius: 6px; background: linear-gradient(100deg, #edf1f4 20%, #fafcfd 45%, #edf1f4 70%); background-size: 240% 100%; animation: loading-shimmer 1.5s ease-in-out infinite; color: transparent !important; }
.is-shimmer > * { color: transparent !important; }
.is-loading-data { position: relative; min-height: 190px; }
.is-loading-data > table { visibility: hidden; }
.loading-skeleton { position: absolute; inset: 0; overflow: hidden; padding: 32px 16px 16px; background: var(--surface); pointer-events: none; }
.skeleton-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.skeleton-row span { height: 14px; border-radius: 5px; background: #edf1f4; }
.skeleton-row:nth-child(2) span:first-child { width: 80%; }
.skeleton-row:nth-child(3) span:first-child { width: 65%; }
.loading-skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, #ffffffa6 45%, transparent 70%); background-size: 240% 100%; animation: loading-shimmer 1.5s ease-in-out infinite; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
@keyframes loading-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .button.is-loading::before, .salesman-combobox.is-loading::after, .loading-spinner, .is-shimmer, .loading-skeleton::after, .navigation-loading .kpi-value { animation: none; } }
@media print { .page-loading, .loading-skeleton, .button.is-loading::before, .salesman-combobox.is-loading::after { display: none !important; } .is-loading-data > table { visibility: visible; } .is-shimmer, .is-shimmer > *, .navigation-loading .kpi-value { color: inherit !important; background: none; } }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.eyebrow, .nav-caption { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .08em; }
.app-shell { display: grid; grid-template-columns: 72px minmax(0, 1fr); min-height: 100vh; }
.app-shell[data-sidebar-expanded="true"] { grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 30; height: 100dvh; min-height: 0; display: flex; flex-direction: column; gap: 16px; background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; }
.sidebar-toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.sidebar-toggle svg { flex-shrink: 0; }
.sidebar-toggle:hover { background: var(--brand-soft); color: var(--brand-dark); }
.sidebar-toggle-label { white-space: nowrap; }
.sidebar nav { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.sidebar .nav-link { min-height: 44px; }
.sidebar .account-actions { flex-shrink: 0; justify-content: center; border-top: 1px solid var(--line); padding-top: 12px; }
.sidebar .account-menu-panel { left: calc(100% + 16px); right: auto; top: auto; bottom: 0; max-width: calc(100vw - 100px); }
.app-shell[data-sidebar-expanded="false"] :is(.shop-name, .nav-caption, .sidebar-toggle-label, .nav-link > span) { display: none; }
.app-shell[data-sidebar-expanded="false"] .shop-brand { justify-content: center; }
.app-shell[data-sidebar-expanded="false"] .nav-link { justify-content: center; padding: 10px; }
.app-shell[data-sidebar-expanded="false"] .account-actions { flex-direction: column; }
.sidebar-backdrop { display: none; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--head); font-size: 23px; font-weight: 600; }
.brand small { display: block; font-size: 9px; color: var(--muted); letter-spacing: .08em; font-weight: 500; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--brand); color: white; font-size: 24px; }
.shop-brand { min-width: 0; font-size: 18px; line-height: 1.4; }
.shop-brand .brand-mark { flex-shrink: 0; }
.shop-name { min-width: 0; overflow-wrap: anywhere; }
.sidebar .nav-caption { margin: 6px 12px 0; }
.store-context { display: flex; gap: 9px; align-items: center; border: 1px solid var(--line); background: #fbfcfd; border-radius: 10px; padding: 12px; margin: 28px 0; font-size: 12px; overflow-wrap: anywhere; }
.store-context small, .cashier-context small { display: block; color: var(--muted); font-size: 10px; }
.status-dot { flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.nav-caption { margin: 0 12px 10px; }
.nav-link { display: flex; align-items: center; gap: 10px; border-radius: 8px; padding: 11px 12px; margin-bottom: 4px; font-size: 12px; color: var(--text); }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-link:hover { background: #f4f7fa; }
.nav-link.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.sidebar-note { margin-top: auto; padding: 40px 12px 18px; color: var(--muted); font-size: 11px; }
.cashier-context { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 18px; font-size: 12px; overflow-wrap: anywhere; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; background: #e8eeff; color: #4e5ab3; border-radius: 50%; }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: 12px; }
.topbar form { display: flex; gap: 14px; align-items: center; }
.account-topbar { justify-content: flex-end; padding: 12px 28px; background: var(--bg); border-bottom: 0; }
.account-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.account-actions .icon-button { width: 34px; min-height: 34px; padding: 0; }
.account-menu { position: relative; }
.account-menu > summary { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; list-style: none; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-initials { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #cce9e1; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; font-weight: 600; }
.account-menu[open] .account-initials { box-shadow: 0 0 0 2px var(--brand); }
.account-menu-panel { position: absolute; right: 0; top: calc(100% + 10px); z-index: 20; width: 250px; max-width: calc(100vw - 28px); padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px #20293924; overflow-wrap: anywhere; }
.account-menu-panel > strong, .account-menu-panel > span { display: block; }
.account-menu-panel form { margin-top: 12px; }
.account-menu-panel .button { min-height: 34px; }
.separator { color: #b6bdc7; padding: 0 10px; }
.page-shell { flex: 1; padding: 20px 28px 28px; width: 100%; max-width: 1800px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-heading p { margin: 0; }
.status-badge { display: inline-flex; align-items: center; background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #cce9e1; padding: 5px 10px; border-radius: 20px; font-size: 11px; overflow-wrap: anywhere; }
.notice { background: #fffbef; border: 1px solid #efdfb4; border-radius: 5px; color: #765917; padding: 12px 16px; font-size: 12px; margin-bottom: 20px; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 24px; background: var(--surface); box-shadow: 0 2px 6px #10182804; }
.sales-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 20px; }
.scan-form { display: flex; align-items: end; gap: 10px; padding: 16px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 5px; }
.scan-form > div { flex: 1; min-width: 0; }
.empty-state { text-align: center; padding: 52px 16px; }
.empty-symbol { display: inline-block; color: var(--brand); font-size: 35px; letter-spacing: 7px; }
.empty-state h3 { margin: 10px 0; }
.product-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 26px; }
.product-heading h2 { margin: 3px 0; }
.product-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
dt { font-size: 11px; color: var(--muted); }
dd { margin: 5px 0 0; font-weight: 600; color: var(--head); overflow-wrap: anywhere; }
.summary-total { display: flex; justify-content: space-between; align-items: center; border-block: 1px solid var(--line); margin: 28px 0; padding: 20px 0; }
.summary-total strong { font-size: 30px; }
.summary .small { margin: 14px 0 0; }
.roadmap { margin-top: 20px; }
.module-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.module-grid strong { font-size: 13px; }
.module-grid span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.app-footer { display: flex; justify-content: space-between; gap: 12px; padding: 16px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.anonymous-header { padding: 26px 5vw; }
.anonymous-main { padding: 20px 5vw 50px; }
.login-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); align-items: center; gap: 80px; max-width: 1080px; margin: 6vh auto; }
.login-intro h1 { font-size: clamp(32px, 4vw, 52px); margin-block: 20px; }
.login-intro p { max-width: 420px; color: var(--muted); }
.login-card { padding: 32px; }
.login-card h2 { margin: 10px 0; font-size: 24px; }
.login-card input { margin-bottom: 18px; }
.login-card .small { margin: 22px 0 0; }
.validation-summary-errors { background: #fff2f3; border: 1px solid #f5d0d6; color: #a42639; padding: 10px 16px; border-radius: 5px; margin: 16px 0; font-size: 12px; }
.validation-summary-errors ul { padding-left: 16px; margin: 0; }
.validation-summary-valid { display: none; }
.transfer-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.transfer-filters > div { flex: 1; min-width: min(100%, 200px); }
.notice.success { background: var(--brand-soft); border-color: #cce9e1; color: var(--brand-dark); font-weight: 600; }
.notice.warning { background: #fff2f3; border-color: #f5d0d6; color: #a42639; margin: 12px 0 0; }
.status-badge.warning { background: #fff2f3; border-color: #f5d0d6; color: #a42639; }
.data-table tr.row-warning td { background: #fff7f8; }
.data-table tr.row-warning td:last-child { color: #a42639; font-weight: 600; }
.receive-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.receive-form textarea { width: 100%; border: 1px solid #d9dee5; border-radius: 5px; padding: 9px 12px; font: inherit; color: var(--head); resize: vertical; }
.receive-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
select { width: 100%; min-height: 44px; border: 1px solid #e2e7ed; border-radius: 8px; background: var(--surface); color: var(--head); font: inherit; padding: 9px 12px; }
.table-scroll { position: relative; max-width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
.data-table th { font-weight: 600; color: var(--muted); background: #f9fafb; white-space: nowrap; font-size: 11px; }
.data-table th, .data-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table td { min-width: 90px; max-width: 300px; overflow-wrap: anywhere; }
.data-table tbody tr:hover { background: #fbfdfc; }
.cell-note { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.pagination { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 20px 0; font-size: 12px; }
.search-results-heading { margin-top: 24px; }
.quantity-field { max-width: 110px; }
.cart-quantity { width: 100px; }
.error-message { color: #a42639; }
dialog { width: min(1100px, 95vw); max-height: 90vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 24px; color: var(--text); background: var(--surface); }
dialog::backdrop { background: #20293980; }
.salesman-picker { margin-bottom: 18px; max-width: 440px; }
.salesman-picker .small { margin: 6px 0; }
.input-validation-error { border-color: #c43245; }
.skip-link { position: fixed; top: -60px; left: 16px; padding: 10px; background: var(--head); color: white; z-index: 100; }
.skip-link:focus { top: 10px; }
.dashboard-heading { margin-bottom: 24px; }
.dashboard-heading h1 { margin-top: 8px; }
.dashboard-heading .button { flex-shrink: 0; }
.dashboard-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.dashboard-filters > div { width: 170px; }
.dashboard-filters > span { margin: 0 0 11px auto; }
.dashboard-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.kpi-card { min-width: 0; padding: 20px; }
.kpi-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--head); font-size: 12px; }
.kpi-symbol { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px; background: var(--brand-soft); color: var(--brand-dark); font-size: 18px; }
.kpi-symbol.violet { background: #f1edff; color: #6941c6; }
.kpi-symbol.blue { background: #edf4ff; color: #175cd3; }
.kpi-symbol.amber { background: #fff5e7; color: #9b570b; }
.kpi-value { display: block; font-size: clamp(22px, 2.2vw, 32px); line-height: 1.3; font-weight: 600; letter-spacing: -.8px; margin: 18px 0 8px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kpi-card > .small { font-size: 10px; }
.dashboard-main-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); gap: 24px; margin-bottom: 24px; }
.dashboard-main-grid > section { min-width: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 20px; }
.section-heading h2 { margin: 0 0 4px; font-size: 16px; }
.section-heading p { margin: 0; }
.section-heading > a { font-size: 12px; font-weight: 600; }
.chart-legend { display: flex; align-items: center; gap: 7px; font-size: 10px; white-space: nowrap; }
.chart-legend i { width: 8px; height: 8px; border-radius: 3px; background: var(--brand); }
.sales-chart { display: block; width: 100%; height: auto; min-height: 220px; }
.chart-gridline { stroke: var(--line); stroke-dasharray: 3 5; }
.chart-zero { stroke: #bbc7d4; }
.chart-axis-label { fill: var(--muted); font-size: 11px; font-family: "Poppins", sans-serif; }
.chart-bar { fill: var(--brand); }
.chart-bar:hover { fill: var(--brand-dark); }
.chart-bar.negative { fill: #bb5b45; }
.chart-missing { fill: #a42639; font-size: 18px; }
.dashboard-breakdown { margin-top: 18px; font-size: 12px; }
.dashboard-breakdown summary { cursor: pointer; width: fit-content; color: var(--brand-dark); }
.dashboard-breakdown .table-scroll { margin-top: 12px; }
.dashboard-empty { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.dashboard-empty h3 { margin: 8px 0; }
.dashboard-empty p { font-size: 12px; margin: 0; }
.inventory-health { display: flex; flex-direction: column; }
.inventory-health-list { margin: 0 0 18px; }
.inventory-health-list > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 13px 0; }
.inventory-health-list dt { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.inventory-health-list dd { font-size: 15px; margin: 0; font-variant-numeric: tabular-nums; }
.health-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.health-dot.teal { background: var(--brand); }
.health-dot.amber { background: #bc7b25; }
.health-dot.gray { background: #98a2b3; }
.health-dot.rose { background: #bb5b45; }
.inventory-health > p { font-size: 10px; }
.inventory-health .button { margin-top: auto; font-size: 11px; }
.dashboard-recent { min-width: 0; }
.dashboard-recent .numeric { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.dashboard-recent th:nth-child(4) { text-align: right; }
.dashboard-data-note { padding: 12px 16px; margin-bottom: 24px; border-left: 3px solid #bc7b25; background: #fffaf2; font-size: 12px; border-radius: 0 8px 8px 0; }
.dashboard-data-note > span { display: block; margin-top: 4px; }
@media (max-width: 1250px) {
    .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-main-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
    .dashboard-heading .button { width: 100%; }
    .dashboard-filters > div { flex: 1; min-width: 120px; }
    .dashboard-filters > span { margin: 0; flex-basis: 100%; }
    .dashboard-kpis { gap: 12px; }
    .kpi-card { padding: 14px; }
    .kpi-label { align-items: start; font-size: 11px; }
    .kpi-symbol { width: 24px; height: 24px; font-size: 15px; }
    .kpi-value { font-size: 22px; }
    .section-heading { flex-wrap: wrap; }
    .sales-chart { min-height: 0; }
}
@media (max-width: 1100px) {
    .sales-grid { grid-template-columns: minmax(0, 1fr); }
    .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-shell { gap: 30px; }
}
@media (max-width: 700px) {
    .app-shell[data-sidebar-expanded="true"] { grid-template-columns: 72px minmax(0, 1fr); }
    .app-shell[data-sidebar-expanded="true"] .sidebar { position: fixed; left: 0; top: 0; width: min(238px, calc(100vw - 24px)); box-shadow: 8px 0 32px #1822301a; }
    .sidebar-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 25; border: 0; background: #18223033; }
    .sidebar .account-menu-panel { left: 0; bottom: calc(100% + 12px); max-width: calc(100vw - 96px); }
    .store-context, .sidebar-note, .nav-caption, .cashier-context { display: none; }
    .topbar { padding: 12px 16px; flex-wrap: wrap; }
    .topbar .status-badge { display: none; }
    .page-shell { padding: 20px 16px; }
    .page-heading { align-items: start; flex-direction: column; }
    .card { padding: 18px; }
    .scan-form { align-items: stretch; flex-direction: column; }
    .product-heading { align-items: start; flex-direction: column; }
    .product-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-shell { grid-template-columns: minmax(0, 1fr); margin: 0 auto; gap: 24px; }
    .login-intro h1 { font-size: 32px; }
    .login-card { padding: 24px; }
    .app-footer { padding: 16px; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.sales-page [hidden] { display: none !important; }
.sales-page .app-shell { height: 100dvh; }
.sales-page .app-footer { justify-content: flex-end; flex-shrink: 0; border: 0; padding: 0 14px 3px; font-size: 9px; line-height: 1.4; }
.sales-page .content { min-height: 0; }
.sales-page .topbar { padding: 5px 16px; min-height: 42px; }
.sales-page .topbar .button { min-height: 30px; padding: 3px 12px; }
.sales-page .page-shell { display: flex; flex-direction: column; min-height: 0; max-width: none; padding: 8px 14px; }
.sales-page .page-heading { flex-direction: row; align-items: center; margin-bottom: 8px; }
.sales-page h1 { font-size: 21px; margin: 0; }
.sales-page .notice { padding: 6px 10px; margin-bottom: 10px; }
#sales-workspace { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sales-page .sales-grid { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 10px; }
.sales-page .sale-items { width: 100%; padding: 10px; display: flex; flex-direction: column; flex: 1; min-height: 180px; }
.sale-entry { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 16px; align-items: end; }
.sales-page .salesman-picker { margin: 0; max-width: none; }
.salesman-combobox { position: relative; }
#salesman-search { padding-right: 24px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%23697586' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
#salesman-search[aria-invalid="true"] { border-color: #c43245; }
#salesman-options { position: absolute; top: calc(100% + 6px); left: 0; width: 100%; max-height: min(288px, 45dvh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #cbd5dc transparent; z-index: 5; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 5px 18px #1822300d; }
#salesman-options::-webkit-scrollbar { width: 5px; }
#salesman-options::-webkit-scrollbar-track { background: transparent; }
#salesman-options::-webkit-scrollbar-thumb { background: #cbd5dc; border-radius: 8px; }
#salesman-options::-webkit-scrollbar-button { display: none; height: 0; }
#salesman-options [role="option"] { display: grid; grid-template-columns: minmax(44px, max-content) minmax(0, 1fr); align-items: center; gap: 10px; min-height: 36px; padding: 8px 9px; border-radius: 6px; cursor: pointer; font-size: 12px; overflow-wrap: anywhere; }
#salesman-options .salesman-option-code { color: var(--muted); font-size: 10px; font-weight: 400; font-variant-numeric: tabular-nums; }
#salesman-options .salesman-option-name { color: var(--head); }
#salesman-options [role="option"].salesman-unassigned { display: flex; flex-direction: column; align-items: start; gap: 2px; padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; }
#salesman-options .salesman-unassigned .salesman-option-code { color: var(--head); font-size: 12px; }
#salesman-options .salesman-unassigned .salesman-option-name { color: var(--muted); font-size: 10px; }
#salesman-options [role="option"]:hover, #salesman-options [aria-selected="true"] { background: var(--brand-soft); }
#salesman-options [aria-selected="true"] .salesman-option-name { color: var(--brand-dark); }
.salesman-no-match { padding: 10px; margin: 0; font-size: 12px; color: #a42639; }
.sales-page .sale-entry .scan-form { flex-direction: row; align-items: end; padding: 0; border: 0; background: transparent; gap: 8px; }
.sales-page .sale-entry .quantity-field { flex: 0 0 76px; }
.sales-page .sale-entry input, .sales-page .sale-entry select { height: 34px; min-height: 34px; padding: 4px 10px; }
.sales-page .sale-entry .button { min-height: 34px; padding: 4px 12px; white-space: nowrap; }
.sales-page label { margin-bottom: 4px; }
.sale-policy { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: 6px 0; }
.sale-policy p { margin: 0; font-size: 11px; }
.sale-policy .button { min-height: 30px; padding: 3px 10px; }
.return-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 2px 0; border: 0; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; font-size: 12px; }
.switch-track { display: flex; align-items: center; width: 32px; height: 18px; padding: 2px; border-radius: 20px; background: #b9c3cd; transition: background-color .15s; }
.switch-thumb { width: 14px; height: 14px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #1822301a; transition: transform .15s; }
.return-switch[aria-checked="true"] .switch-track { background: #a86328; }
.return-switch[aria-checked="true"] .switch-thumb { transform: translateX(14px); }
.return-switch[aria-checked="true"] { color: #854510; }
.switch-value { min-width: 22px; font-size: 10px; color: var(--muted); }
.date-field { position: relative; }
.date-field input { padding-right: 40px; }
.date-field input::-webkit-calendar-picker-indicator { display: none; }
.date-trigger { position: absolute; right: 4px; top: 4px; bottom: 4px; display: grid; place-items: center; width: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.date-trigger:hover { background: var(--brand-soft); color: var(--brand-dark); }
.date-picker { position: fixed; width: 320px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 50px #1822301a; }
.date-picker::backdrop { background: #1822300a; }
.calendar-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 13px; }
.calendar-icon { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 23px; cursor: pointer; }
.calendar-icon:hover:not(:disabled) { background: #f4f7fa; color: var(--head); }
.calendar-navigation { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.calendar-navigation select, .calendar-navigation input { height: 34px; min-height: 34px; padding: 4px 6px; border-color: var(--line); font-size: 12px; }
.calendar-navigation .calendar-month { flex: 1; min-width: 0; }
.calendar-navigation .calendar-year { width: 76px; }
.calendar-navigation .calendar-icon { flex-shrink: 0; }
.calendar-grid { width: 100%; border-collapse: separate; border-spacing: 2px; table-layout: fixed; }
.calendar-grid th { padding-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 400; }
.calendar-grid td { padding: 0; text-align: center; }
.calendar-day { width: 100%; height: 32px; border: 1px solid transparent; border-radius: 8px; padding: 0; background: transparent; color: var(--head); font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums; }
.calendar-day.other-month { color: var(--muted); }
.calendar-day[aria-current="date"] { border-color: #cce9e1; color: var(--brand-dark); }
.calendar-day:hover:not(:disabled) { background: var(--brand-soft); }
.calendar-day.selected, .calendar-day.selected:hover { background: var(--brand); color: white; }
.calendar-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.calendar-footer > span { font-size: 10px; }
.calendar-today { padding: 5px 10px; border: 0; border-radius: 7px; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; cursor: pointer; }
@media print { .date-picker, .date-trigger { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-thumb { transition: none; } }
#cart-message { margin: 0 0 4px; font-size: 11px; }
#cart-message:empty, #checkout-message:empty { display: none; }
.sale-table-scroll { flex: 1; min-height: 80px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.sale-table { table-layout: fixed; min-width: 920px; }
.sale-table .col-item { width: 22%; }
.sale-table .col-salesman { width: 14%; }
.sale-table .col-quantity { width: 8%; }
.sale-table .col-gross { width: 12%; }
.sale-table .col-percent { width: 9%; }
.sale-table .col-discount { width: 11%; }
.sale-table .col-net { width: 14%; }
.sale-table .col-action { width: 10%; }
.sale-table th { position: sticky; top: 0; z-index: 1; }
.sale-table th, .sale-table td { padding: 4px 8px; vertical-align: middle; min-width: 0; max-width: none; }
.sale-table th { white-space: normal; }
.sale-table th:nth-child(4), .sale-table td:nth-child(4), .sale-table th:nth-child(7), .sale-table td:nth-child(7) { text-align: right; font-variant-numeric: tabular-nums; }
.sale-table td:nth-child(7) { color: var(--head); font-weight: 600; font-size: 14px; }
.sale-table .cart-quantity { width: 100%; height: 30px; padding: 3px 7px; font-size: 13px; font-variant-numeric: tabular-nums; }
.sale-table td:nth-child(5), .sale-table td:nth-child(6) { background: #f0faf7; }
.sale-table .cell-note { font-weight: 400; font-size: 10px; line-height: 1.4; }
.sale-table tbody tr:hover { background: #fafcfb; }
.sale-table .return-line td:first-child { border-left: 3px solid #bd7740; }
.sale-table .return-line td:first-child strong, .sale-table .return-line td:nth-child(7) { color: #854510; }
.sale-table .remove-line { width: 28px; min-height: 28px; padding: 0; font-size: 20px; line-height: 1; }
.sale-table td:last-child { text-align: center; }
.sales-page .empty-state { padding: 20px 12px; margin: 0; }
.sales-page .sale-totals { width: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 20px; padding: 8px 12px; flex-shrink: 0; }
.sale-metrics { display: flex; flex: 1; gap: 28px; flex-wrap: wrap; }
.sale-metrics > div { display: flex; flex-direction: column; }
.sale-metrics span, .sale-totals .summary-total > span { font-size: 11px; color: var(--muted); }
.sale-metrics strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.sale-totals .summary-total { flex-direction: column; align-items: end; border: 0; border-left: 1px solid var(--line); margin: 0; padding: 0 0 0 24px; }
.sale-totals .summary-total strong { color: var(--brand-dark); font-size: 26px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.cash-preview { display: flex; align-items: center; gap: 16px; }
.paid-amount-field { width: 145px; }
.paid-amount-field label, .cash-balance > span { font-size: 11px; color: var(--muted); }
.paid-amount-field input { height: 34px; padding: 4px 9px; font-size: 16px; font-variant-numeric: tabular-nums; }
.paid-amount-field input[aria-invalid="true"] { border-color: #c43245; }
.cash-balance { display: flex; flex-direction: column; min-width: 105px; }
.cash-balance > strong { color: var(--brand-dark); font-size: 22px; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cash-balance > span strong { font-variant-numeric: tabular-nums; }
#payment-message { flex-basis: 100%; margin: 0; font-size: 11px; line-height: 1.4; }
#checkout-sale { min-height: 36px; padding: 6px 12px; }
.sale-help { flex-shrink: 0; margin-top: 6px; }
.sale-help summary { cursor: pointer; width: fit-content; }
.sale-help p { margin: 6px 0 0; }
#checkout-message { flex-shrink: 0; margin: 4px 0 0; }
@font-face { font-family: "Kinetix Receipt"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Kinetix Receipt"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Kinetix Receipt"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/poppins-700.woff2") format("woff2"); }
.receipt-actions { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.receipt-actions h1 { font-size: 23px; margin: 0 0 5px; }
.receipt-actions p { margin: 0; }
.receipt-action-buttons { display: flex; gap: 10px; }
.receipt-preview { display: flex; flex-direction: column; align-items: center; padding: 24px 12px; background: #e9edef; border-radius: 12px; }
.printed-receipt { width: 80mm; max-width: 100%; background: white; color: #141414; padding: 5mm; font: 12px/1.55 "Kinetix Receipt", "Segoe UI", sans-serif; box-shadow: 0 8px 28px #20293912; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.printed-receipt header, .printed-receipt footer { text-align: center; }
.receipt-store-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: white; font-size: 23px; font-weight: 700; margin-bottom: 10px; }
.printed-receipt .receipt-store h2 { font: 700 20px/1.25 "Kinetix Receipt", "Segoe UI", sans-serif; color: #111; margin: 0 0 8px; letter-spacing: -.5px; }
.printed-receipt .receipt-store p { margin: 3px 0; font-size: 10px; color: #333; }
.receipt-invoice { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-block: 1px solid #222; padding: 9px 0; margin-top: 16px; font-size: 11px; }
.printed-receipt strong { color: #111; }
.printed-receipt dl { margin: 12px 0; }
.printed-receipt dl > div { display: flex; justify-content: space-between; gap: 12px; }
.printed-receipt dt, .printed-receipt dd { color: #222; font-size: 11px; margin: 3px 0; }
.printed-receipt dt { flex-shrink: 0; }
.printed-receipt dd { text-align: right; font-weight: 600; }
.printed-receipt .receipt-meta dt, .printed-receipt .receipt-meta dd { font-size: 10px; }
.receipt-cashier dd { max-width: 72%; }
.printed-receipt table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.printed-receipt th, .printed-receipt td { text-align: left; vertical-align: top; padding: 10px 0; border-bottom: 1px dashed #aaa; overflow-wrap: anywhere; }
.printed-receipt th { font-size: 10px; font-weight: 600; border-bottom: 1px solid #222; }
.printed-receipt th:last-child, .printed-receipt td:last-child { width: 30%; text-align: right; padding-left: 8px; }
.receipt-article { display: block; font-size: 13px; }
.receipt-variant, .receipt-sku, .receipt-item-price, .receipt-item-discount, .receipt-salesman { display: block; font-size: 10px; line-height: 1.65; }
.receipt-sku, .receipt-salesman { font-size: 9px; color: #333; }
.receipt-item-price { margin-top: 5px; }
.receipt-item-discount { font-weight: 600; }
.receipt-line-net { font-weight: 700; font-size: 13px; }
.receipt-totals > div { padding: 2px 0; }
.printed-receipt .receipt-grand-total { border-block: 2px solid #111; padding: 9px 0; margin: 8px 0; }
.printed-receipt .receipt-grand-total dt, .printed-receipt .receipt-grand-total dd { font-size: 15px; font-weight: 700; }
.printed-receipt .receipt-change dd { font-weight: 700; }
.printed-receipt footer { border-top: 1px dashed #aaa; padding-top: 16px; margin-top: 18px; font-size: 10px; }
.printed-receipt footer span { display: block; font-size: 9px; margin-top: 5px; }
.receipt-print-hint { margin: 18px 0 0; text-align: center; }
.receipt-notes { border-top: 1px solid #222; padding-top: 12px; margin-top: 16px; }
.receipt-notes h3 { font-size: 11px; margin: 0 0 8px; color: #111; }
.receipt-notes ol { margin: 0; padding-left: 17px; }
.receipt-notes li { font-size: 10px; line-height: 1.6; margin-bottom: 5px; white-space: pre-line; break-inside: avoid; }
.report-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 16px; margin-bottom: 20px; }
.report-filters > div { flex: 1; min-width: 150px; }
.report-filters > div:first-child { flex: 2; min-width: 220px; }
.report-result-heading { margin-top: 20px; }
.report-metrics { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 16px; }
.report-table-card { padding: 0; }
.report-number { font-variant-numeric: tabular-nums; text-align: right; }
@media print {
    .report-filters, #print-report, .report-result-heading > a, .pagination a { display: none !important; }
    .report-result .table-scroll, .report-table-card .table-scroll { overflow: visible; }
    .report-result .data-table, .report-table-card .data-table { font-size: 9px; }
    .report-result .data-table td, .report-table-card .data-table td { min-width: 0; padding: 4px; }
    .report-result .data-table th, .report-table-card .data-table th { white-space: normal; padding: 4px; }
    .report-table-card { border: 0; box-shadow: none; }
    .report-table-card tr { break-inside: avoid; }
    .report-table-card thead { display: table-header-group; }
}
@media print {
    @page { size: auto; margin: 0; }
    body { background: white; }
    .sidebar, .topbar, .app-footer, .receipt-actions, .skip-link, .receipt-print-hint, #pwa-status { display: none !important; }
    .app-shell, .content, .page-shell { display: block; padding: 0; margin: 0; min-height: 0; }
    .printed-receipt { width: 80mm; max-width: 100%; box-shadow: none; }
    .printed-receipt tr { break-inside: avoid; }
    .receipt-preview { display: block; background: none; padding: 0; border-radius: 0; }
    .printed-receipt .receipt-store-mark { background: white; color: black; border: 2px solid black; }
    .printed-receipt .receipt-store, .printed-receipt .receipt-totals, .printed-receipt footer { break-inside: avoid; }
}
@media (max-width: 1100px) {
    .sale-entry { grid-template-columns: 190px minmax(0, 1fr); gap: 10px; }
    .sale-metrics { gap: 18px; }
    .sales-page .sale-totals { gap: 6px 18px; }
}
@media (max-width: 800px) {
    .sales-page .app-shell { height: auto; min-height: 100dvh; }
    .sales-page .page-shell { padding: 10px; }
    .sale-entry { grid-template-columns: minmax(0, 1fr); }
    .sales-page .sale-entry .scan-form { flex-wrap: wrap; }
    .sales-page .sale-entry .scan-form > div:first-child { flex-basis: 60%; }
    .sale-table-scroll { max-height: 55dvh; flex: auto; }
    .sales-page .sale-totals { gap: 12px; }
    .sale-metrics { flex-basis: 100%; justify-content: space-between; gap: 12px; }
    .sale-totals .summary-total { align-items: start; padding: 0; border: 0; margin-right: auto; }
    .cash-preview { flex-wrap: wrap; gap: 12px; }
    #payment-message { margin-top: 0; }
}
.dispatch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; align-items: start; }
.dispatch-items { min-width: 0; padding: 20px; }
.dispatch-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.dispatch-section-heading h2 { margin: 0 0 2px; }
.dispatch-section-heading p { margin: 0; }
.dispatch-draft { flex-shrink: 0; font-size: 9px; font-weight: 600; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 4px 7px; }
.dispatch-entry { padding: 16px; background: #f8fafb; border: 1px solid var(--line); border-radius: 6px; }
.dispatch-entry .destination-picker { max-width: 420px; margin-bottom: 14px; }
.dispatch-scan { display: grid; grid-template-columns: minmax(140px, 1fr) 76px auto auto; gap: 10px; align-items: end; }
.dispatch-scan > div { min-width: 0; }
.dispatch-scan label { white-space: nowrap; }
.dispatch-scan .button { white-space: nowrap; padding-inline: 12px; }
.dispatch-table-scroll { border: 1px solid var(--line); border-radius: 6px; overflow: auto; max-height: 55vh; }
.send-table { table-layout: fixed; min-width: 520px; }
.send-table .dispatch-item-col { width: 30%; }
.send-table .dispatch-variant-col { width: 23%; }
.send-table .dispatch-stock-col { width: 13%; }
.send-table .dispatch-qty-col { width: 17%; }
.send-table .dispatch-action-col { width: 17%; }
.send-table th, .send-table td { min-width: 0; max-width: none; padding: 10px; vertical-align: middle; }
.send-table th { position: sticky; top: 0; white-space: normal; }
.send-table td:nth-child(3) { font-variant-numeric: tabular-nums; }
.send-table input[type=number] { width: 100%; height: 36px; padding: 5px 7px; }
.send-table .button { min-height: 32px; padding: 4px 8px; font-size: 11px; }
.dispatch-empty { text-align: center; padding: 44px 12px 36px; }
.dispatch-empty[hidden] { display: none; }
.dispatch-empty-mark { display: inline-grid; place-items: center; width: 44px; height: 44px; background: var(--brand-soft); color: var(--brand); border-radius: 12px; font-size: 27px; }
.dispatch-empty h3 { margin: 14px 0 5px; }
.dispatch-empty p { font-size: 12px; margin-bottom: 6px; }
.dispatch-summary { padding: 20px; }
.dispatch-summary h2 { font-size: 15px; margin-bottom: 18px; }
.dispatch-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.dispatch-metrics span, .dispatch-destination > span { display: block; font-size: 11px; color: var(--muted); }
.dispatch-metrics strong { display: block; font-size: 23px; font-variant-numeric: tabular-nums; }
.dispatch-destination { margin: 18px 0; padding: 12px; background: var(--brand-soft); border-radius: 5px; }
.dispatch-destination strong { display: block; font-size: 14px; color: var(--brand-dark); overflow-wrap: anywhere; margin-top: 3px; }
.dispatch-summary #send-transfer { width: 100%; margin-top: 14px; }
.dispatch-confirm-hint { margin: 8px 0 0; font-size: 10px; text-align: center; }
.dispatch-summary #send-message:empty { display: none; }
.dispatch-summary #send-message { margin: 12px 0 0; overflow-wrap: anywhere; }
@media (max-width: 1250px) {
    .dispatch-layout { grid-template-columns: minmax(0, 1fr); }
    .dispatch-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; align-items: start; }
    .dispatch-summary h2, .dispatch-summary #send-message { grid-column: 1 / -1; margin: 0; }
    .dispatch-destination { margin: 0; }
    .dispatch-metrics { border: 0; padding: 0; }
    .dispatch-summary #send-transfer { align-self: end; }
}
@media (max-width: 700px) {
    .dispatch-items, .dispatch-summary { padding: 14px; }
    .dispatch-entry { padding: 12px; }
    .dispatch-scan { grid-template-columns: minmax(0, 1fr) 76px; }
    .dispatch-scan .button { width: 100%; }
    .dispatch-summary { grid-template-columns: minmax(0, 1fr); }
    .dispatch-summary h2, .dispatch-summary #send-message { grid-column: auto; }
    .dispatch-draft { display: none; }
}
.send-workspace textarea { width: 100%; resize: vertical; min-height: 72px; font: inherit; padding: 8px 10px; border: 1px solid #cfd8d6; border-radius: 8px; }
.dispatch-note dd { white-space: pre-wrap; }
.workspace-store-context { display: flex; align-items: center; gap: 10px; min-width: 0; margin-bottom: 14px; font-size: 13px; }
.workspace-store-context strong { overflow-wrap: anywhere; }
.workspace-store-logo { width: 48px; height: 40px; object-fit: contain; flex: 0 0 48px; }
.receipt-store-logo { display: block; width: 160px; height: 72px; max-width: 100%; object-fit: contain; margin: 0 auto 8px; }
.receipt-store h2 { overflow-wrap: anywhere; }
@media print {
    .no-print, .sidebar, .topbar, .app-footer, .skip-link, .pagination { display: none !important; }
    .app-shell, .content, .page-shell { display: block; padding: 0; margin: 0; min-height: 0; }
}
