:root {
    --bg: #F1F5F9;
    --surface: #FFFFFF;
    --surface-alt: #F8FAFC;
    --border: #CBD5E1;
    --border-light: #E2E8F0;
    --text: #0F172A;
    --text-muted: #475569;
    --primary: #1E40AF;
    --primary-hover: #1E3A8A;
    --primary-soft: #EFF6FF;
    --success: #16A34A;
    --success-hover: #15803D;
    --success-soft: #DCFCE7;
    --warning: #D97706;
    --warning-soft: #FEF3C7;
    --danger: #DC2626;
    --danger-soft: #FEE2E2;
    --info: #0284C7;
    --info-soft: #E0F2FE;
    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 6px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.09), 0 2px 6px rgba(15, 23, 42, 0.05);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'IBM Plex Sans Thai', 'Sarabun', 'Noto Sans Thai', 'Segoe UI', Tahoma, sans-serif;
    font-size: 15px;
    line-height: 1.48;
    -webkit-font-smoothing: antialiased;
}

.kpi-value,
.prod-price,
.sum-net,
.data-table td.text-right,
.login-clock-time {
    font-variant-numeric: tabular-nums;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

.hidden { display: none !important; }

/* Lock / PIN Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg);
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    box-shadow: var(--shadow-md);
}

.login-brand {
    text-align: center;
    margin-bottom: 20px;
}

.login-brand img {
    max-height: 64px;
    max-width: 160px;
    object-fit: contain;
    margin-bottom: 8px;
}

.login-brand h1 {
    margin: 0;
    font-size: 22px;
    color: var(--primary);
}

.login-brand p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

.pin-display {
    width: 100%;
    text-align: center;
    font-size: 28px;
    letter-spacing: 10px;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    margin: 10px 0 14px;
    font-weight: 700;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.keypad button {
    padding: 15px 10px;
    font-size: 20px;
    font-weight: 700;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text);
}

.keypad button:hover { background: var(--surface-alt); }
.keypad button:active { background: var(--primary-soft); }
.keypad button.key-enter {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.keypad button.key-enter:hover { background: var(--primary-hover); }

.demo-hint {
    margin-top: 14px;
    padding: 10px 12px;
    background: var(--surface-alt);
    border-radius: 8px;
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: center;
}

/* App Shell & Topbar */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--primary);
    color: #fff;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
    padding: 2px;
}

.brand-title {
    font-weight: 700;
    font-size: 17px;
    line-height: 1.2;
}

.brand-sub {
    font-size: 12px;
    opacity: 0.85;
}

.nav-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.1);
    color: #fff;
    padding: 8px 13px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    min-height: 40px;
    transition: background 0.14s ease, transform 0.1s ease;
}

.nav-ico {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-btn:hover { background: rgba(255,255,255,0.2); }
.nav-btn:active { transform: scale(0.98); }
.nav-btn.active {
    background: #fff;
    color: var(--primary);
    border-color: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

.user-area {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pill-badge {
    background: rgba(255,255,255,0.16);
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 14px 16px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

/* Common Controls */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    min-height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover { background: var(--surface-alt); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: var(--success-hover); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-sm { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.btn-lg { min-height: 50px; padding: 12px 20px; font-size: 17px; }

.input, .select, .textarea {
    width: 100%;
    padding: 9px 12px;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

.input:focus, .select:focus, .textarea:focus {
    outline: 2px solid rgba(30, 64, 175, 0.25);
    border-color: var(--primary);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}

.card-title {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.badge-green { background: var(--success-soft); color: #166534; }
.badge-orange { background: var(--warning-soft); color: #92400E; }
.badge-red { background: var(--danger-soft); color: #991B1B; }
.badge-blue { background: var(--info-soft); color: #075985; }
.badge-gray { background: var(--surface-alt); color: var(--text-muted); }

/* POS Layout (65% Left / 35% Right) */
.pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 65fr) minmax(320px, 35fr);
    gap: 14px;
    align-items: start;
}

.pos-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.pos-search-input {
    flex: 1;
    font-size: 16px;
    min-height: 46px;
    border: 2px solid var(--primary);
}

.cat-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.cat-pill {
    white-space: nowrap;
    padding: 7px 14px;
    min-height: 36px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-weight: 600;
    cursor: pointer;
}

.cat-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.view-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
    flex-shrink: 0;
}

.view-toggle-btn {
    border: 0;
    background: transparent;
    padding: 0 12px;
    min-height: 44px;
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text-muted);
    cursor: pointer;
}

.view-toggle-btn.active {
    background: var(--primary);
    color: #fff;
}

.pos-info-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-muted);
    min-height: 24px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(182px, 1fr));
    gap: 10px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    padding-right: 2px;
}

.product-grid.list-mode {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.product-card:hover {
    border-color: #93C5FD;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.08);
}

.product-card.out-of-stock {
    opacity: 0.6;
    background: #FEF2F2;
    border-color: #FECACA;
}

.product-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.product-cat-tag {
    font-size: 11.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-name {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.35;
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-unit-btns {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 2px;
}

.unit-pick-btn {
    width: 100%;
    padding: 8px 10px;
    min-height: 38px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 13.5px;
}

.unit-pick-btn.primary-unit {
    background: var(--primary-soft);
    border-color: #BFDBFE;
}

.unit-pick-btn:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.unit-pick-btn:hover:not(:disabled) .price {
    color: #fff;
}

.unit-pick-btn .price {
    color: var(--primary);
    font-weight: 800;
    font-size: 15px;
}

/* Compact List Mode Row */
.product-list-row {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}

.product-list-row.out-of-stock {
    opacity: 0.6;
    background: #FEF2F2;
    border-color: #FECACA;
}

.product-list-info {
    min-width: 0;
    flex: 1;
}

.product-list-name {
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-list-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.product-list-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.pos-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-size: 13.5px;
}

/* Cart Panel */
.cart-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 96px);
    position: sticky;
    top: 12px;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 410px);
    margin: 8px 0;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    padding: 9px 6px;
    border-bottom: 1px dashed var(--border-light);
    border-radius: 6px;
}

.cart-item.recent {
    background: var(--primary-soft);
}

.cart-item-title {
    font-weight: 700;
    font-size: 14px;
}

.cart-item-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.cart-qty-ctrl {
    display: flex;
    align-items: center;
    gap: 4px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

.cart-summary {
    border-top: 2px solid var(--border-light);
    padding-top: 10px;
}

.sum-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.sum-net {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
}

/* Stats KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 14px;
}

.kpi-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.kpi-value {
    font-size: 24px;
    font-weight: 800;
    margin-top: 4px;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    font-size: 14px;
}

table.data-table th, table.data-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
    vertical-align: middle;
}

table.data-table th {
    background: var(--surface-alt);
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

table.data-table tr:hover td {
    background: #F8FAFC;
}

.text-right { text-align: right !important; }
.text-center { text-align: center !important; }

/* Modals & Popups */
@keyframes modalPopIn {
    from { opacity: 0; transform: scale(0.96) translateY(6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes menuDropIn {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
}

.modal-backdrop.modal-top {
    z-index: 1200;
}

.modal-box {
    width: 100%;
    max-width: 540px;
    max-height: 92vh;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
    animation: modalPopIn 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-box.modal-sm { max-width: 420px; }
.modal-box.modal-lg { max-width: 780px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
}

.modal-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: var(--surface-alt);
    color: var(--text-muted);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #FECACA;
}

/* Dialog Confirmation & Prompt */
.dialog-hero {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.dialog-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
}

.dialog-icon.warn { background: var(--warning-soft); color: var(--warning); }
.dialog-icon.danger { background: var(--danger-soft); color: var(--danger); }
.dialog-icon.info { background: var(--primary-soft); color: var(--primary); }
.dialog-icon.success { background: var(--success-soft); color: var(--success); }

.quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 10px;
}

.quick-chip {
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
}

.quick-chip:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

/* Popup Dropdown Menu */
.popup-anchor {
    position: relative;
    display: inline-block;
}

.popup-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    min-height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.14);
    color: #fff;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
}

.popup-trigger-btn:hover {
    background: rgba(255,255,255,0.22);
}

.popup-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 240px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
    z-index: 950;
    animation: menuDropIn 130ms ease-out;
}

.popup-menu-head {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 4px;
}

.popup-menu-head .name {
    font-weight: 800;
    font-size: 14px;
}

.popup-menu-head .role {
    font-size: 12px;
    color: var(--text-muted);
}

.popup-section-label {
    padding: 6px 10px 2px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.popup-item {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--text);
    padding: 9px 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.popup-item:hover {
    background: var(--surface-alt);
}

.popup-item.active {
    background: var(--primary-soft);
    color: var(--primary);
}

.popup-item.danger {
    color: var(--danger);
}

.popup-item.danger:hover {
    background: var(--danger-soft);
}

.popup-divider {
    height: 1px;
    background: var(--border-light);
    margin: 5px 4px;
}

.cash-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 10px 0;
}

.cash-quick-grid button {
    min-height: 46px;
    font-size: 16px;
    font-weight: 700;
}

.change-box {
    padding: 14px;
    border-radius: var(--radius);
    background: var(--success-soft);
    color: #14532D;
    text-align: center;
    margin: 12px 0;
}

.change-box .amount {
    font-size: 32px;
    font-weight: 800;
}

.change-box.insufficient {
    background: var(--danger-soft);
    color: #7F1D1D;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 18px;
    right: 18px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
}

.toast {
    padding: 12px 16px;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
    background: #1E293B;
    border-left: 5px solid rgba(255,255,255,0.4);
    animation: toastSlideIn 160ms ease-out;
}
.toast.ok { background: var(--success); border-left-color: #BBF7D0; }
.toast.err { background: var(--danger); border-left-color: #FECACA; }
.toast.warn { background: var(--warning); border-left-color: #FDE68A; }

/* Sub-tabs inside modules */
.subtabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.subtab-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-weight: 700;
    cursor: pointer;
}

.subtab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Denomination Counter Grid */
.denom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}

.denom-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg);
}

.denom-item input {
    width: 74px;
    text-align: center;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-weight: 700;
}

/* Print Receipt Area */
#printReceiptArea { display: none; }

@media print {
    body * { visibility: hidden !important; }
    #printReceiptArea, #printReceiptArea * { visibility: visible !important; }
    #printReceiptArea {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        color: #000;
        background: #fff;
        font-family: 'Sarabun', Tahoma, sans-serif;
        font-size: 12px;
        line-height: 1.35;
        padding: 4mm;
    }
    #printReceiptArea.w-58mm { width: 58mm; }
    #printReceiptArea.w-80mm { width: 80mm; }
}

@media (max-width: 1024px) {
    .pos-layout {
        grid-template-columns: 1fr;
    }
    .cart-panel {
        position: static;
        min-height: auto;
    }
    .product-grid {
        max-height: 460px;
    }
}

.mv-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.mv-sum-pill {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    font-size: 13px;
}

.mv-sum-pill.is-in {
    background: var(--success-soft);
    border-color: #BBF7D0;
    color: var(--success);
}

.mv-sum-pill.is-out {
    background: var(--danger-soft);
    border-color: #FECACA;
    color: var(--danger);
}

.mv-sum-label {
    color: var(--text-muted);
    font-weight: 600;
}

.table-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-alt);
    box-shadow: 0 1px 0 var(--border);
}

/* 2-Column Commercial Login Shell & PIN Dots */
.login-shell {
    width: 100%;
    max-width: 840px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    display: grid;
    grid-template-columns: 0.92fr 1.15fr;
    overflow: hidden;
}

.login-aside {
    background: var(--primary);
    color: #fff;
    padding: 34px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
}

.login-aside .login-brand {
    text-align: left;
    margin-bottom: 0;
}

.login-aside .login-brand img {
    background: #fff;
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 12px;
}

.login-aside .login-brand h1 {
    color: #fff;
    font-size: 24px;
    line-height: 1.25;
}

.login-aside .login-brand p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 13.5px;
}

.login-clock-box {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    padding: 16px 18px;
}

.login-clock-date {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.86);
    margin-bottom: 4px;
}

.login-clock-time {
    font-size: 34px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.8px;
    line-height: 1.1;
}

.login-aside-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.login-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ADE80;
    flex-shrink: 0;
}

.login-form-pane {
    padding: 28px 30px;
}

.login-pane-head {
    margin-bottom: 16px;
}

.login-pane-head h2 {
    margin: 0;
    font-size: 19px;
    color: var(--text);
}

.login-pane-head p {
    margin: 3px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.login-select-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.pin-entry-wrap {
    margin: 10px 0 14px;
}

.pin-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface-alt);
    border: 1.5px solid var(--border);
    border-radius: 12px;
}

.pin-dots span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.pin-dots span.filled {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.12);
}

.sr-only-pin {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
}

.keypad button {
    transition: background 0.12s ease, transform 0.08s ease;
}

.keypad button:active {
    transform: scale(0.96);
}

.keypad button.key-clear {
    color: var(--danger);
    font-size: 15px;
}

/* POS Cockpit Polish */
.product-card {
    border-top: 3px solid var(--border);
    transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.08s ease;
}

.product-card.pinned {
    border-top-color: var(--primary);
}

.product-card:hover:not(.out-of-stock) {
    border-color: var(--primary);
    border-top-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.product-card:active:not(.out-of-stock) {
    transform: scale(0.985);
}

.cart-total-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--primary-soft);
    border: 1px solid #BFDBFE;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
}

.kpi-card {
    border-left: 4px solid var(--primary);
}

@media (max-width: 760px) {
    .login-shell {
        grid-template-columns: 1fr;
    }
    .login-aside {
        padding: 22px 20px;
        gap: 14px;
    }
    .login-form-pane {
        padding: 20px;
    }
    .login-select-row {
        grid-template-columns: 1fr;
    }
}
