/* ==========================================================================
   WarungLokal Cashier POS Terminal Module (Native CSS)
   Split screen, Keypad Numpad, Floating Cart, Modal Receipt & Thermal Print
   ========================================================================== */
:root {
            --primary: #127A3E;
            --primary-hover: #0F6734;
            --primary-light: #F4FBF6;
            --primary-border: #E6F6EB;
            --bg: #F8FAFC;
            --surface: #FFFFFF;
            --border: #E2E8F0;
            --text: #0F172A;
            --text-muted: #64748B;
            --text-sub: #94A3B8;
            --danger: #EF4444;
            --danger-light: #FEE2E2;
            --success: #16A34A;
            --success-light: #DCFCE7;
        }

        body.pos-body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            background-color: var(--bg);
            color: var(--text);
            margin: 0;
            padding: 0;
            -webkit-tap-highlight-color: transparent;
        }

        .pos-container {
            max-width: 1140px;
            margin: 0 auto;
            padding: 16px;
            width: 100%;
            box-sizing: border-box;
        }

        .pos-layout {
            display: flex;
            gap: 20px;
            align-items: flex-start;
        }

        .pos-catalog-pane {
            flex: 1;
            min-width: 0;
        }

        .pos-cart-pane {
            width: 360px;
            flex-shrink: 0;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 14px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.04);
            position: sticky;
            top: 16px;
            display: flex;
            flex-direction: column;
            max-height: calc(100vh - 32px);
        }

        /* Network & Offline Status */
        .pos-network-strip {
            display: none;
        }

        .pos-status-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 8px 12px;
            border-radius: 10px;
            font-size: 0.8rem;
            font-weight: 600;
            background: #F1F5F9;
            color: #475569;
            border: 1px solid #E2E8F0;
            transition: all 0.2s ease;
            height: 44px;
            box-sizing: border-box;
            flex-shrink: 0;
            user-select: none;
        }

        .pos-status-pill .pos-status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #94A3B8;
        }

        .pos-status-pill.online {
            background: #F0FDF4;
            color: #166534;
            border-color: #BBF7D0;
        }

        .pos-status-pill.online .pos-status-dot {
            background: #16A34A;
            box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
        }

        .pos-status-pill.offline {
            background: #FEF3C7;
            color: #92400E;
            border-color: #FDE68A;
        }

        .pos-status-pill.offline .pos-status-dot {
            background: #D97706;
            box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
        }

        .pos-outbox-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 0 12px;
            border-radius: 9999px;
            font-size: 0.8rem;
            font-weight: 700;
            background: #EFF6FF;
            color: #1D4ED8;
            border: 1px solid #BFDBFE;
            cursor: pointer;
            transition: all 0.15s ease;
            height: 38px;
            box-sizing: border-box;
            flex-shrink: 0;
            white-space: nowrap;
        }

        .pos-outbox-btn:hover {
            background: #DBEAFE;
            border-color: #93C5FD;
        }

        .pos-outbox-icon {
            font-size: 1rem;
            line-height: 1;
        }

        .pos-outbox-btn.syncing .pos-outbox-icon {
            display: inline-block;
            animation: spinSync 1s linear infinite;
        }

        @keyframes spinSync {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        .pos-offline-banner {
            padding: 8px 12px;
            margin-bottom: 10px;
            border-radius: 8px;
            font-size: 0.82rem;
            font-weight: 500;
            line-height: 1.4;
            background: #FFFBEB;
            color: #B45309;
            border: 1px solid #FDE68A;
        }

        /* Cashier & Shift Bar (Above Search) */
        .pos-cashier-shift-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 12px;
            width: 100%;
            box-sizing: border-box;
        }

        .pos-cashier-area {
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
            flex: 1 1 auto;
        }

        .pos-cashier-pill {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 0 12px;
            height: 38px;
            background: #FFFFFF;
            border: 1px solid var(--border);
            border-radius: 9999px;
            font-size: 0.84rem;
            color: var(--text);
            box-sizing: border-box;
            max-width: 100%;
            user-select: none;
        }

        .pos-cashier-pill.pos-cashier-clickable {
            cursor: pointer;
            transition: all 0.15s ease;
            border-color: #CBD5E1;
        }

        .pos-cashier-pill.pos-cashier-clickable:hover {
            background: #F8FAFC;
            border-color: #94A3B8;
        }

        .pos-cashier-avatar-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: #F1F5F9;
            color: #475569;
            flex-shrink: 0;
        }

        .pos-cashier-meta {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            min-width: 0;
            overflow: hidden;
        }

        .pos-cashier-prefix {
            color: var(--text-muted);
            font-weight: 500;
            font-size: 0.8rem;
            flex-shrink: 0;
        }

        .pos-cashier-name {
            font-weight: 700;
            color: var(--text);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            max-width: 130px;
        }

        .pos-cashier-switch-badge {
            background: #EFF6FF;
            color: #2563EB;
            font-size: 0.72rem;
            font-weight: 700;
            padding: 2px 7px;
            border-radius: 6px;
            margin-left: 2px;
            flex-shrink: 0;
            border: 1px solid #DBEAFE;
        }

        .pos-shift-area {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
        }

        /* Top Action Bar */
        .pos-top-bar {
            display: flex;
            gap: 10px;
            align-items: center;
            margin-bottom: 14px;
        }

        .pos-search-wrap {
            flex: 1;
            position: relative;
        }

        .pos-search-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            pointer-events: none;
        }

        .pos-search-input {
            width: 100%;
            box-sizing: border-box;
            padding: 12px 14px 12px 42px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--surface);
            font-size: 0.95rem;
            color: var(--text);
            outline: none;
            transition: border-color 0.15s, box-shadow 0.15s;
        }

        .pos-search-input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(18, 122, 62, 0.12);
        }

        .pos-btn-scanner {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 12px 16px;
            background: var(--primary);
            color: #FFFFFF;
            border: none;
            border-radius: 10px;
            font-size: 0.9rem;
            font-weight: 700;
            cursor: pointer;
            white-space: nowrap;
            transition: background 0.15s ease;
        }

        .pos-btn-scanner:hover {
            background: var(--primary-hover);
        }

        .pos-btn-scanner-locked {
            background: #F1F5F9;
            color: #475569;
            border: 1.5px solid #CBD5E1;
            cursor: pointer;
            position: relative;
        }

        .pos-btn-scanner-locked:hover {
            background: #E2E8F0;
            color: #1E293B;
            border-color: #94A3B8;
        }

        .pos-scanner-badge-pro {
            position: absolute;
            top: -5px;
            right: -5px;
            font-size: 0.42rem !important;
            font-weight: 800;
            letter-spacing: 0.02em;
            padding: 1px 3px !important;
            border-radius: 3px;
            background: #FEF3C7;
            color: #92400E;
            border: 1px solid #FDE68A;
            line-height: 1 !important;
            box-shadow: 0 1px 2px rgba(0,0,0,0.08);
            pointer-events: none;
            display: inline-block !important;
        }

        .pos-btn-shift {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 0 14px;
            height: 38px;
            background: #FFFFFF;
            color: #334155;
            border: 1.5px solid #CBD5E1;
            border-radius: 9999px;
            font-size: 0.84rem;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.15s ease;
            box-sizing: border-box;
        }

        .pos-btn-shift:hover {
            background: #F8FAFC;
            border-color: #94A3B8;
        }

        /* Fullscreen Toggle Button (Icon Only) */
        .pos-btn-fullscreen {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 38px;
            height: 38px;
            padding: 0;
            background: #FFFFFF;
            color: #334155;
            border: 1.5px solid #CBD5E1;
            border-radius: 9999px;
            cursor: pointer;
            transition: all 0.15s ease;
            box-sizing: border-box;
            flex-shrink: 0;
        }

        .pos-btn-fullscreen:hover {
            background: #F8FAFC;
            border-color: #94A3B8;
        }

        /* Fullscreen Active State */
        body.pos-fullscreen-active .merchant-desktop-sidebar {
            display: none !important;
        }

        body.pos-fullscreen-active.app-portal-body .pos-container,
        body.pos-fullscreen-active .pos-container {
            margin-left: 0 !important;
            width: 100% !important;
            max-width: 100% !important;
            padding-left: 20px !important;
            padding-right: 20px !important;
            padding-top: 16px !important;
            box-sizing: border-box !important;
        }

        body.pos-fullscreen-active .pos-btn-fullscreen {
            background: #EFF6FF !important;
            color: #1D4ED8 !important;
            border-color: #93C5FD !important;
        }

        body.pos-fullscreen-active .pos-btn-fullscreen .icon-expand {
            display: none !important;
        }

        body.pos-fullscreen-active .pos-btn-fullscreen .icon-compress {
            display: inline-block !important;
        }

        .pos-btn-shift.shift-open {
            background: #EFF6FF;
            color: #1D4ED8;
            border-color: #93C5FD;
        }

        .pos-shift-icon-wrap {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .pos-shift-dot {
            position: absolute;
            top: -3px;
            right: -3px;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #94A3B8;
            border: 1.5px solid #FFFFFF;
            transition: background 0.2s ease;
        }

        .pos-btn-shift.shift-open .pos-shift-dot {
            background: #16A34A;
        }

        /* Category Tabs */
        .pos-cat-scroll {
            display: flex;
            align-items: center;
            gap: 8px;
            overflow-x: auto;
            scrollbar-width: none;
            padding-bottom: 12px;
        }
        .pos-cat-scroll::-webkit-scrollbar {
            display: none;
        }

        .pos-cat-tab {
            padding: 7px 14px;
            border-radius: 9999px;
            background: var(--surface);
            border: 1px solid var(--border);
            color: var(--text-muted);
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
            user-select: none;
            transition: all 0.15s;
        }
        .pos-cat-tab:hover {
            color: var(--text);
            border-color: #CBD5E1;
        }
        .pos-cat-tab.active {
            background: var(--primary);
            color: #FFFFFF;
            border-color: var(--primary);
            font-weight: 700;
        }

        /* Product Grid */
        .pos-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 12px;
        }

        .pos-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 12px;
            display: flex;
            flex-direction: column;
            cursor: pointer;
            transition: transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
            position: relative;
            user-select: none;
            min-width: 0;
        }
        .pos-card:hover {
            border-color: #CBD5E1;
            box-shadow: 0 4px 12px rgba(0,0,0,0.05);
        }
        .pos-card:active {
            transform: scale(0.98);
        }
        .pos-card.disabled {
            opacity: 0.55;
            cursor: not-allowed;
            pointer-events: none;
        }

        .pos-card-name {
            font-size: 0.95rem;
            font-weight: 700;
            color: var(--text);
            margin: 0 0 4px 0;
            line-height: 1.3;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .pos-card-barcode {
            font-size: 0.72rem;
            color: var(--text-sub);
            font-family: monospace;
            margin-bottom: 6px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .pos-card-meta {
            margin-top: auto;
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            padding-top: 8px;
            border-top: 1px dashed var(--border);
        }

        .pos-card-price {
            font-size: 1rem;
            font-weight: 800;
            color: var(--primary);
        }

        .pos-card-stock {
            font-size: 0.75rem;
            font-weight: 600;
            padding: 2px 6px;
            border-radius: 4px;
            background: #F1F5F9;
            color: var(--text-muted);
        }
        .pos-card-stock.empty {
            background: var(--danger-light);
            color: var(--danger);
            font-weight: 700;
        }
        .pos-card-stock.low {
            background: #fef3c7;
            color: #b45309;
            border: 1px solid #fde68a;
            font-weight: 700;
        }

        /* Cart Styles */
        .pos-cart-header {
            padding: 14px 16px;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .pos-cart-title {
            font-size: 1.05rem;
            font-weight: 800;
            margin: 0;
            color: var(--text);
        }
        .pos-btn-clear {
            background: none;
            border: none;
            color: var(--danger);
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 6px;
        }
        .pos-btn-clear:hover {
            background: var(--danger-light);
        }

        .pos-cart-list {
            flex: 1;
            overflow-y: auto;
            padding: 12px 16px;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .pos-cart-empty {
            text-align: center;
            padding: 40px 16px;
            color: var(--text-muted);
            font-size: 0.9rem;
        }

        .pos-cart-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
            padding-bottom: 10px;
            border-bottom: 1px solid #F1F5F9;
        }
        .pos-item-info {
            flex: 1;
            min-width: 0;
        }
        .pos-item-name {
            font-size: 0.88rem;
            font-weight: 700;
            color: var(--text);
            margin: 0 0 2px 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .pos-item-price {
            font-size: 0.78rem;
            color: var(--text-muted);
        }
        .pos-item-stepper {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .pos-btn-step {
            width: 26px;
            height: 26px;
            border: 1px solid var(--border);
            background: var(--surface);
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 0.9rem;
            color: var(--text);
            transition: background 0.1s;
        }
        .pos-btn-step:hover {
            background: #F1F5F9;
        }
        .pos-item-qty {
            font-size: 0.88rem;
            font-weight: 700;
            min-width: 20px;
            text-align: center;
        }

        .pos-cart-footer {
            padding: 14px 16px;
            border-top: 1px solid var(--border);
            background: #F8FAFC;
            border-bottom-left-radius: 14px;
            border-bottom-right-radius: 14px;
        }
        .pos-total-row {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            margin-bottom: 12px;
        }
        .pos-total-label {
            font-size: 0.95rem;
            font-weight: 700;
            color: var(--text);
        }
        .pos-total-val {
            font-size: 1.3rem;
            font-weight: 800;
            color: var(--primary);
        }

        .pos-btn-checkout {
            width: 100%;
            height: 48px;
            padding: 0 16px;
            box-sizing: border-box;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            border-radius: 10px;
            border: none;
            background: var(--primary);
            color: #FFFFFF;
            font-size: 1rem;
            font-weight: 700;
            cursor: pointer;
            transition: background 0.15s ease;
        }

        .pos-btn-checkout:hover {
            background: var(--primary-hover);
        }
        .pos-btn-checkout:disabled {
            background: #CBD5E1;
            cursor: not-allowed;
        }

        /* Mobile Drawer & Floating Bar */
        .pos-mobile-bar,
        .pos-mobile-checkout-bar {
            display: none;
            position: fixed;
            bottom: calc(56px + env(safe-area-inset-bottom, 0px));
            left: 0;
            right: 0;
            padding: 10px 14px;
            background: var(--surface);
            border-top: 1px solid var(--border);
            box-shadow: 0 -4px 14px rgba(0,0,0,0.08);
            z-index: 990;
        }
        .pos-mobile-bar-btn {
            width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 18px;
            background: var(--primary);
            color: #FFFFFF;
            border: none;
            border-radius: 10px;
            font-size: 0.95rem;
            font-weight: 700;
            cursor: pointer;
        }

        .pos-cart-backdrop {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.5);
            z-index: 1004;
            backdrop-filter: blur(1px);
        }

        .pos-btn-close-drawer {
            display: none;
            background: none;
            border: none;
            font-size: 1.5rem;
            color: var(--text-muted);
            cursor: pointer;
            line-height: 1;
            padding: 0 4px;
        }

        /* Responsive Breakpoints */

        /* Tablet (>= 768px) and Desktop Split Screen */
        @media (min-width: 768px) {
            .pos-layout {
                display: flex;
                flex-direction: row;
            }
            .pos-cart-pane {
                display: flex;
                flex-direction: column;
                width: 340px;
            }
            .pos-mobile-bar,
            .pos-mobile-checkout-bar {
                display: none !important;
            }
        }

        @media (min-width: 768px) and (max-width: 1023px) {
            .pos-container {
                padding: 14px;
            }
            .pos-layout {
                gap: 14px;
            }
            .pos-cart-pane {
                width: 340px;
                flex-shrink: 0;
            }
        }

        @media (min-width: 1200px) {
            .pos-cart-pane {
                width: 360px;
            }
        }

        /* Mobile Portrait (<= 767px) */
        @media (max-width: 767px) {
            .pos-cashier-shift-bar {
                gap: 8px;
                margin-bottom: 10px;
            }
            .pos-cashier-pill {
                height: 36px;
                padding: 0 10px;
                font-size: 0.8rem;
                gap: 6px;
            }
            .pos-cashier-avatar-icon {
                width: 20px;
                height: 20px;
            }
            .pos-cashier-name {
                max-width: 90px;
                font-size: 0.8rem;
            }
            .pos-cashier-switch-badge {
                font-size: 0.7rem;
                padding: 1px 5px;
            }
            .pos-btn-shift {
                height: 36px;
                padding: 0 12px;
                font-size: 0.8rem;
                min-width: auto;
                border-radius: 9999px;
                flex-shrink: 0;
            }
            .pos-btn-shift span#posShiftBtnLabel {
                display: inline;
                font-size: 0.8rem;
            }
            .pos-btn-fullscreen {
                width: 36px;
                height: 36px;
                padding: 0;
            }
            .pos-top-bar {
                gap: 8px;
                margin-bottom: 12px;
            }
            .pos-search-wrap {
                flex: 1;
                min-width: 0;
            }
            .pos-search-input {
                height: 44px;
                padding: 10px 12px 10px 38px;
                font-size: 0.9rem;
            }
            .pos-btn-scanner {
                padding: 0 14px;
                min-width: auto;
                height: 44px;
                flex-shrink: 0;
                justify-content: center;
                gap: 6px;
            }
            .pos-btn-scanner span:not(.pos-scanner-badge-pro) {
                display: inline;
                font-size: 0.8rem;
            }
            .pos-btn-scanner .pos-scanner-badge-pro {
                font-size: 0.42rem !important;
                padding: 1px 3px !important;
                line-height: 1 !important;
                top: -5px !important;
                right: -5px !important;
            }
            .pos-status-pill {
                padding: 0;
                width: 36px;
                height: 36px;
                border-radius: 8px;
                justify-content: center;
                flex-shrink: 0;
            }
            .pos-status-pill .pos-status-text {
                display: none;
            }
            .pos-outbox-btn {
                padding: 0 10px;
                height: 36px;
                border-radius: 9999px;
                flex-shrink: 0;
                font-size: 0.78rem;
            }
            .pos-outbox-btn span#posOutboxText {
                display: none;
            }
            body.app-portal-body .pos-container,
            .pos-container {
                padding: 12px !important;
                padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)) !important;
            }
            .pos-grid {
                padding-bottom: 24px;
            }
            .pos-layout {
                display: flex;
                flex-direction: column;
                gap: 12px;
                align-items: stretch;
            }
            .pos-catalog-pane {
                width: 100%;
                min-width: 0;
            }
            .pos-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 8px;
            }
            .pos-card {
                padding: 10px;
            }
            .pos-card-name {
                font-size: 0.88rem;
            }
            .pos-card-price {
                font-size: 0.92rem;
            }
            .pos-card-stock {
                font-size: 0.7rem;
                padding: 2px 4px;
            }
            .pos-card-meta {
                flex-wrap: wrap;
                gap: 4px;
            }
            .pos-cart-pane {
                display: none;
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
                top: auto;
                width: 100%;
                max-height: 85vh;
                border-radius: 18px 18px 0 0;
                z-index: 1005;
                box-shadow: 0 -8px 30px rgba(0,0,0,0.25);
            }
            .pos-cart-pane.open {
                display: flex;
            }
            .pos-cart-footer {
                padding: 16px 20px;
                padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
                background: #F8FAFC;
            }
            .pos-mobile-bar,
            .pos-mobile-checkout-bar {
                display: block;
            }
            .pos-btn-close-drawer {
                display: block;
            }
        }

        /* Mobile Landscape (max-height: 500px and landscape) */
        @media (max-height: 500px) and (orientation: landscape) {
            .pos-container {
                padding: 8px !important;
                padding-bottom: 8px !important;
            }
            .pos-layout {
                display: flex !important;
                flex-direction: row !important;
                gap: 8px !important;
                align-items: stretch !important;
            }
            .pos-catalog-pane {
                width: auto !important;
                flex: 1 !important;
                min-width: 0 !important;
            }
            .pos-grid {
                grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
                gap: 6px !important;
            }
            .pos-card {
                padding: 8px !important;
            }
            .pos-cart-pane {
                display: flex !important;
                flex-direction: column !important;
                position: sticky !important;
                top: 8px !important;
                bottom: auto !important;
                left: auto !important;
                right: auto !important;
                width: 280px !important;
                max-height: calc(100vh - 16px) !important;
                border-radius: 10px !important;
                box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
                z-index: auto !important;
            }
            .pos-cart-list {
                overflow-y: auto !important;
                flex: 1 !important;
                padding: 8px 10px !important;
                gap: 6px !important;
            }
            .pos-cart-footer {
                padding: 10px 12px !important;
            }
            .pos-total-row {
                margin-bottom: 8px !important;
            }
            .pos-mobile-bar,
            .pos-mobile-checkout-bar {
                display: none !important;
            }
            .pos-cart-backdrop {
                display: none !important;
            }
            .pos-btn-close-drawer {
                display: none !important;
            }
            .pos-modal-card {
                max-height: calc(100vh - 20px) !important;
            }
            .pos-modal-body {
                padding: 12px 16px !important;
            }
        }

        /* Modals */
        .pos-modal-backdrop {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.6);
            z-index: 1100;
            align-items: center;
            justify-content: center;
            padding: 16px;
            padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
            backdrop-filter: blur(2px);
        }
        .pos-modal-card {
            background: var(--surface);
            border-radius: 16px;
            width: 100%;
            max-width: 480px;
            max-height: calc(100vh - 40px);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 10px 25px rgba(0,0,0,0.2);
            animation: modalFadeIn 0.15s ease-out;
        }
        .pos-modal-body {
            padding: 20px;
            overflow-y: auto;
            flex: 1;
        }
        @keyframes modalFadeIn {
            from { opacity: 0; transform: scale(0.97); }
            to { opacity: 1; transform: scale(1); }
        }
        .pos-modal-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .pos-modal-title {
            margin: 0;
            font-size: 1.15rem;
            font-weight: 800;
            color: var(--text);
        }
        .pos-modal-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            color: var(--text-muted);
            cursor: pointer;
            line-height: 1;
        }
        .pos-modal-body {
            padding: 20px;
        }

        /* Quick Cash & Payment Selector */
        .pos-pay-methods {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            margin-bottom: 16px;
        }
        .pos-pay-opt {
            padding: 10px 6px;
            border: 1px solid var(--border);
            border-radius: 8px;
            text-align: center;
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 700;
            color: var(--text-muted);
            transition: all 0.15s;
        }
        .pos-pay-opt.active {
            background: var(--primary-light);
            border-color: var(--primary);
            color: var(--primary);
        }

        .pos-quick-cash-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            margin-bottom: 16px;
        }
        .pos-quick-btn {
            padding: 9px 6px;
            background: #F1F5F9;
            border: 1px solid #CBD5E1;
            border-radius: 8px;
            font-size: 0.85rem;
            font-weight: 700;
            color: var(--text);
            cursor: pointer;
            text-align: center;
            transition: background 0.1s;
        }
        .pos-quick-btn:hover {
            background: #E2E8F0;
        }

        .pos-field-label {
            display: block;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-muted);
            margin-bottom: 6px;
        }
        .pos-field-input {
            width: 100%;
            box-sizing: border-box;
            padding: 11px 14px;
            border: 1px solid var(--border);
            border-radius: 8px;
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--text);
            outline: none;
            margin-bottom: 14px;
        }
        .pos-field-input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(18, 122, 62, 0.12);
        }

        .pos-input-clearable-wrap {
            position: relative;
            margin-bottom: 14px;
        }
        .pos-input-clearable-wrap .pos-field-input {
            margin-bottom: 0;
            padding-right: 38px;
        }
        .pos-btn-clear-input {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            width: 24px;
            height: 24px;
            border-radius: 50%;
            border: none;
            background: #E2E8F0;
            color: #64748B;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            padding: 0;
            transition: background 0.15s, color 0.15s;
        }
        .pos-btn-clear-input:hover {
            background: #CBD5E1;
            color: #0F172A;
        }

        .pos-change-box {
            padding: 12px 16px;
            background: #F8FAFC;
            border: 1px solid var(--border);
            border-radius: 10px;
            margin-bottom: 18px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .pos-change-label {
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--text-muted);
        }
        .pos-change-val {
            font-size: 1.15rem;
            font-weight: 800;
            color: var(--primary);
        }
        .pos-change-val.negative {
            color: var(--danger);
        }

        .pos-toast {
            position: fixed;
            top: 20px;
            right: 20px;
            padding: 10px 18px;
            border-radius: 8px;
            color: #fff;
            font-size: 0.88rem;
            font-weight: 600;
            z-index: 9999;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            display: none;
        }


@media print {
    @page {
        margin: 0;
        size: auto;
    }

    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Hilangkan seluruh elemen luar agar tidak menambah tinggi dokumen/membuat halaman kosong */
    .app-topbar,
    .app-bottom-nav,
    .merchant-nav,
    nav,
    header,
    .pos-container,
    .pos-mobile-bar,
    #mobileCartBar,
    #posScannerModal,
    #posCheckoutModal,
    .pos-receipt-wa-card,
    .receipt-paper-selector,
    .pos-receipt-actions,
    .no-print {
        display: none !important;
    }

    body * {
        visibility: hidden !important;
    }

    #posReceiptModal,
    #posReceiptModal .pos-modal-card,
    #posReceiptModal .pos-modal-body,
    #posReceiptPaper,
    #posReceiptPaper *,
    #posShiftReceiptModal,
    #posShiftReceiptModal .pos-modal-card,
    #posShiftReceiptModal .pos-modal-body,
    #posShiftReceiptPaper,
    #posShiftReceiptPaper * {
        visibility: visible !important;
    }

    #posShiftReceiptModal {
        position: static !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 auto !important;
        background: transparent !important;
        display: block !important;
        backdrop-filter: none !important;
        z-index: 1 !important;
    }

    #posReceiptModal {
        position: static !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 auto !important;
        background: transparent !important;
        display: block !important;
        backdrop-filter: none !important;
        z-index: 1 !important;
    }

    .pos-modal-card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 auto !important;
        max-width: 100% !important;
        background: transparent !important;
    }

    .pos-modal-header,
    .receipt-paper-selector,
    .pos-receipt-actions,
    .pos-modal-close {
        display: none !important;
    }

    .pos-receipt-paper {
        margin: 0 auto !important;
        padding: 4px !important;
        background: #ffffff !important;
        color: #000000 !important;
        font-family: 'Courier New', Courier, monospace, -apple-system, sans-serif !important;
        font-size: 11px !important;
        line-height: 1.35 !important;
        box-sizing: border-box !important;
        box-shadow: none !important;
        border: none !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        page-break-after: avoid !important;
        break-after: avoid !important;
    }

    .pos-receipt-paper.size-58mm {
        width: 58mm !important;
        max-width: 58mm !important;
    }

    .pos-receipt-paper.size-80mm {
        width: 80mm !important;
        max-width: 80mm !important;
        font-size: 13px !important;
    }
}


/* Scanner Torch / Flashlight Button */
.pos-btn-torch {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    color: #64748B;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}
.pos-btn-torch:hover {
    background: #E2E8F0;
    color: #1E293B;
}
.pos-btn-torch.active {
    background: #FEF3C7;
    border-color: #FCD34D;
    color: #D97706;
}


/* POS Digital Receipt WhatsApp Button */
.pos-btn-wa:hover {
    background: #14532d !important;
}
.pos-btn-wa:active {
    transform: scale(0.98);
}


        /* Desktop (>= 1024px) Layout Alignment beside Left Sidebar */
        @media (min-width: 1024px) {
            .pos-container {
                margin-left: 256px !important;
                width: calc(100% - 256px) !important;
                max-width: calc(100% - 256px) !important;
                box-sizing: border-box !important;
                padding: 20px 28px 80px !important;
            }
            .pos-layout {
                gap: 24px;
            }
            .pos-cart-pane {
                width: 380px !important;
                flex-shrink: 0 !important;
                max-height: calc(100vh - 40px) !important;
                top: 20px !important;
            }
            .pos-grid {
                grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
                gap: 14px !important;
            }
        }
