/* ============================================
   Keen Systems ePOS - Modern 3D UI
   Glassmorphism + Depth + Responsive Design
   ============================================ */

/* ── Performance override ───────────────────────────────────────────────────
   backdrop-filter:blur() triggers a separate GPU compositing pass for every
   element that uses it. On Intel HD 4xxx integrated graphics this causes
   choppy animations and stuttering video. Disabling it globally keeps the
   same dark-glass aesthetic via the existing rgba() backgrounds.
   ────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

:root {
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #a78bfa;
    --primary-glow: rgba(124, 58, 237, 0.25);
    --header-bg: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
    --header-dark: #1e1b4b;
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --info: #3b82f6;
    --text-dark: #1e293b;
    --text-medium: #475569;
    --text-muted: #94a3b8;
    --border-color: rgba(148, 163, 184, 0.2);
    --bg-light: #f1f5f9;
    --bg-white: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15), 0 4px 10px rgba(0,0,0,0.08);
    --shadow-3d: 0 4px 0 rgba(0,0,0,0.15);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    /* Button size tokens */
    --btn-pad-sm: 8px 14px;
    --btn-pad-md: 10px 18px;
    --btn-pad-lg: 12px 24px;
    --btn-font-sm: 12px;
    --btn-font-md: 13px;
    --btn-font-lg: 14px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bg-light);
    background-image: 
        radial-gradient(at 20% 80%, rgba(124, 58, 237, 0.04) 0%, transparent 50%),
        radial-gradient(at 80% 20%, rgba(59, 130, 246, 0.04) 0%, transparent 50%);
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== HEADER ========== */
.pos-header {
    background: var(--header-bg);
    color: white;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(30, 27, 75, 0.4), 0 2px 4px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.pos-header .brand {
    font-size: 18px;
    font-weight: 800;
    margin-right: 20px;
    white-space: nowrap;
    letter-spacing: -0.3px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.pos-header .location-info {
    font-size: 13px;
    opacity: 0.9;
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Modern DateTime Display ===== */
.datetime-display {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(165,180,252,0.2);
    border-radius: 12px;
    padding: 6px 16px;
    font-variant-numeric: tabular-nums;
    position: relative;
    overflow: hidden;
    animation: dtGlowPulse 4s ease-in-out infinite;
}
.datetime-display::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, rgba(165,180,252,0.08), transparent);
    animation: dtShimmer 6s ease-in-out infinite;
}
@keyframes dtGlowPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(99,102,241,0.08); border-color: rgba(165,180,252,0.2); }
    50% { box-shadow: 0 0 16px rgba(99,102,241,0.2), 0 0 4px rgba(165,180,252,0.15); border-color: rgba(165,180,252,0.35); }
}
@keyframes dtShimmer {
    0%, 100% { transform: translateX(-100%); opacity: 0; }
    40%, 60% { transform: translateX(100%); opacity: 1; }
}
.dt-date {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    letter-spacing: 0.4px;
    position: relative;
}
.dt-sep {
    font-size: 12px;
    color: rgba(165,180,252,0.4);
    animation: dtSepBlink 2s ease-in-out infinite;
}
@keyframes dtSepBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.dt-time {
    display: inline-flex;
    align-items: baseline;
    font-weight: 800;
    font-size: 16px;
    color: #fff;
    letter-spacing: 0.5px;
    position: relative;
}
.dt-hm {
    text-shadow: 0 0 12px rgba(165,180,252,0.5), 0 0 4px rgba(99,102,241,0.3);
}
.dt-sec {
    font-size: 12px;
    font-weight: 700;
    color: rgba(165,180,252,0.9);
    min-width: 22px;
    transition: opacity 0.3s ease;
    text-shadow: 0 0 6px rgba(165,180,252,0.3);
}
@keyframes dtSecTick {
    0% { opacity: 1; transform: translateY(0); }
    15% { opacity: 0.3; transform: translateY(-2px); }
    30% { opacity: 1; transform: translateY(0); }
}
.dt-sec.tick {
    animation: dtSecTick 0.4s ease-out;
}

.location-dropdown {
    background: rgba(255,255,255,0.12);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    backdrop-filter: blur(4px);
    transition: var(--transition);
}
.location-dropdown:hover {
    background: rgba(255,255,255,0.2);
}
.location-dropdown option {
    color: #333;
    background: white;
}

.pos-header .header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-header .sync-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.15);
    cursor: default;
    min-width: 90px;
    transition: all 0.4s ease;
}

/* ===== 3D Signal Strength Bars ===== */
.signal-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 20px;
    perspective: 200px;
    flex-shrink: 0;
}
.signal-bar {
    width: 5px;
    border-radius: 2px;
    background: rgba(255,255,255,0.18);
    transition: height 0.4s cubic-bezier(0.34,1.56,0.64,1),
                background 0.4s ease,
                box-shadow 0.4s ease,
                transform 0.3s ease;
    transform-origin: bottom center;
}
.signal-bar.bar-1 { height: 5px; }
.signal-bar.bar-2 { height: 9px; }
.signal-bar.bar-3 { height: 14px; }
.signal-bar.bar-4 { height: 20px; }

/* Offline — all bars dim, red tint, slow pulse */
.signal-bars.offline .signal-bar {
    background: rgba(248,113,113,0.25);
    box-shadow: none;
}
.signal-bars.offline .signal-bar.bar-1 {
    background: #f87171;
    box-shadow: 0 0 4px rgba(248,113,113,0.5);
    animation: signalOfflinePulse 1.5s ease-in-out infinite;
}
@keyframes signalOfflinePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Syncing — bars animate sequentially with yellow */
.signal-bars.syncing .signal-bar {
    background: rgba(251,191,36,0.2);
    animation: signalSyncWave 1.2s ease-in-out infinite;
}
.signal-bars.syncing .signal-bar.bar-1 { animation-delay: 0s; }
.signal-bars.syncing .signal-bar.bar-2 { animation-delay: 0.15s; }
.signal-bars.syncing .signal-bar.bar-3 { animation-delay: 0.3s; }
.signal-bars.syncing .signal-bar.bar-4 { animation-delay: 0.45s; }
@keyframes signalSyncWave {
    0%, 100% { background: rgba(251,191,36,0.2); transform: scaleY(0.6); }
    50% { background: #fbbf24; transform: scaleY(1); box-shadow: 0 0 6px rgba(251,191,36,0.6); }
}

/* Signal strength levels (online) */
/* 1 bar — weak (>500ms) */
.signal-bars.signal-1 .signal-bar.bar-1 {
    background: #f87171;
    box-shadow: 0 0 5px rgba(248,113,113,0.5);
    animation: signalBarGlow 2s ease-in-out infinite;
}

/* 2 bars — fair (300-500ms) */
.signal-bars.signal-2 .signal-bar.bar-1,
.signal-bars.signal-2 .signal-bar.bar-2 {
    background: #fbbf24;
    box-shadow: 0 0 5px rgba(251,191,36,0.4);
    animation: signalBarGlow 2s ease-in-out infinite;
}
.signal-bars.signal-2 .signal-bar.bar-2 { animation-delay: 0.15s; }

/* 3 bars — good (150-300ms) */
.signal-bars.signal-3 .signal-bar.bar-1,
.signal-bars.signal-3 .signal-bar.bar-2,
.signal-bars.signal-3 .signal-bar.bar-3 {
    background: #34d399;
    box-shadow: 0 0 5px rgba(52,211,153,0.4);
    animation: signalBarGlow 2s ease-in-out infinite;
}
.signal-bars.signal-3 .signal-bar.bar-2 { animation-delay: 0.1s; }
.signal-bars.signal-3 .signal-bar.bar-3 { animation-delay: 0.2s; }

/* 4 bars — excellent (<150ms) */
.signal-bars.signal-4 .signal-bar {
    background: #34d399;
    box-shadow: 0 0 6px rgba(52,211,153,0.5);
    animation: signalBarGlow 2s ease-in-out infinite;
}
.signal-bars.signal-4 .signal-bar.bar-2 { animation-delay: 0.1s; }
.signal-bars.signal-4 .signal-bar.bar-3 { animation-delay: 0.2s; }
.signal-bars.signal-4 .signal-bar.bar-4 { animation-delay: 0.3s; }

@keyframes signalBarGlow {
    0%, 100% { opacity: 1; transform: scaleY(1); }
    50% { opacity: 0.85; transform: scaleY(1.08); box-shadow: 0 0 8px currentColor; }
}

/* 3D entrance when signal state changes */
.signal-bars.signal-changed .signal-bar {
    animation: signalBarPop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
.signal-bars.signal-changed .signal-bar.bar-1 { animation-delay: 0s; }
.signal-bars.signal-changed .signal-bar.bar-2 { animation-delay: 0.08s; }
.signal-bars.signal-changed .signal-bar.bar-3 { animation-delay: 0.16s; }
.signal-bars.signal-changed .signal-bar.bar-4 { animation-delay: 0.24s; }
@keyframes signalBarPop {
    0% { transform: perspective(200px) rotateX(90deg) scaleY(0); opacity: 0; }
    60% { transform: perspective(200px) rotateX(-10deg) scaleY(1.15); opacity: 1; }
    100% { transform: perspective(200px) rotateX(0) scaleY(1); opacity: 1; }
}

.sync-status .speed-badge {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    margin-left: 2px;
    white-space: nowrap;
}

/* Bill sync countdown pill — shown in header when bills are waiting to upload */
.bill-sync-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(251,191,36,0.15);
    border: 1px solid rgba(251,191,36,0.28);
    border-radius: 12px;
    padding: 2px 9px 2px 7px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(251,191,36,0.95);
    white-space: nowrap;
    transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease;
    cursor: default;
}
.bill-sync-pill .bill-sync-icon {
    font-size: 12px;
    line-height: 1;
}
/* When the bills are actually uploading right now */
.bill-sync-pill.uploading {
    background: rgba(52,211,153,0.15);
    border-color: rgba(52,211,153,0.28);
    color: rgba(52,211,153,0.95);
    animation: pillUploadPulse 1s ease-in-out infinite;
}
/* When interval hasn't started yet (still in startup jitter) */
.bill-sync-pill.pending-start {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.5);
}
@keyframes pillUploadPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.65; }
}

/* Remove min-width clamp when pill is visible — sync bar grows naturally */
.pos-header .sync-status {
    min-width: unset;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.header-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    padding: 7px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}
.header-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.header-btn:active {
    transform: translateY(0);
    background: rgba(255,255,255,0.25);
}
.header-btn-dashboard {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: rgba(16,185,129,0.3);
    font-weight: 700;
}
.header-btn-dashboard:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}

/* ===== SYNC DROPDOWN ===== */
.sync-dd-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.sync-dd-trigger {
    display: flex !important;
    align-items: center;
    gap: 5px;
}
.sync-dd-arrow {
    font-size: 9px;
    opacity: 0.7;
    transition: transform 0.2s;
}
.sync-dd-wrap.open .sync-dd-arrow { transform: rotate(180deg); }
.sync-icon {
    display: inline-block;
    font-size: 15px;
    line-height: 1;
    transition: transform 0.2s;
}
@keyframes syncSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.sync-icon.spinning { animation: syncSpin 0.7s linear infinite; }
.sync-dd-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.22);
    min-width: 220px;
    z-index: 9999;
    padding: 6px 0;
    animation: syncDdIn 0.15s ease;
}
@keyframes syncDdIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.sync-dd-wrap.open .sync-dd-menu { display: block; }
.sync-dd-head {
    padding: 8px 16px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sync-dd-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.1s;
    white-space: nowrap;
}
.sync-dd-item:hover { background: #f5f3ff; color: #6d28d9; }
.sync-dd-item .sdi-icon { font-size: 15px; width: 22px; text-align: center; flex-shrink: 0; }
.sync-dd-item.syncing-item { opacity: 0.6; pointer-events: none; }
.sync-dd-item .sdi-status {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    color: #059669;
}
.sync-dd-item .sdi-status.is-time {
    font-weight: 400;
    color: #9ca3af;
    font-size: 10px;
}
.sync-dd-divider { border-top: 1px solid #f3f4f6; margin: 5px 0; }
.sync-dd-all { font-weight: 800; color: #5b21b6 !important; }
.sync-dd-all:hover { background: #ede9fe !important; }
.sync-progress-bar {
    height: 2px;
    background: linear-gradient(90deg, #7c3aed, #06b6d4);
    position: fixed;
    top: 0; left: 0;
    width: 0;
    z-index: 99999;
    transition: width 0.3s;
    border-radius: 0 2px 2px 0;
}
.sync-progress-bar.active { width: 70%; }
.sync-progress-bar.done   { width: 100%; transition: width 0.2s; opacity: 1; }
.sync-progress-bar.fade   { opacity: 0; transition: opacity 0.4s; }

/* ========== DASHBOARD WEBVIEW ========== */
.dash-nav-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #ccc;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dash-nav-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.dash-close-btn {
    background: rgba(239,68,68,0.2);
    border-color: rgba(239,68,68,0.3);
    color: #f87171;
    width: auto;
    padding: 0 14px;
    font-weight: 600;
    font-size: 13px;
    gap: 4px;
}
.dash-close-btn:hover {
    background: rgba(239,68,68,0.4);
    color: #fff;
}
.dash-quick-btn {
    background: rgba(124,58,237,0.2);
    border: 1px solid rgba(124,58,237,0.3);
    color: #c4b5fd;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s ease;
}
.dash-quick-btn:hover {
    background: rgba(124,58,237,0.4);
    color: #fff;
}

/* ========== MAIN LAYOUT ========== */
.pos-main {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-middle {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 6px 16px 8px;
    overflow: hidden;
    gap: 6px;
    transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== TOP BAR (Customer + Search) ========== */
.pos-topbar {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--bg-white);
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.customer-section {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 300px;
    flex-wrap: wrap;
}

.customer-section .icon {
    font-size: 18px;
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ede9fe, #e0e7ff);
    border-radius: 50%;
    flex-shrink: 0;
}

.customer-due-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--danger), var(--danger-dark));
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(239,68,68,0.35);
    transition: all 0.2s ease;
    flex-shrink: 0;
    letter-spacing: 0.2px;
}
.customer-due-badge::before {
    content: '⚠';
    font-size: 11px;
    opacity: 0.85;
}
.customer-due-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(239,68,68,0.45);
    filter: brightness(1.05);
}
.customer-due-badge:active { transform: translateY(0); }

/* Row numbers in cart */
.row-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 11px;
    background: var(--bg-light);
    border-radius: 50%;
}

/* Weighing scale button */
.btn-weighing-scale {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 8px 14px;
    font-size: 16px;
    cursor: pointer;
    margin-right: 4px;
    flex-shrink: 0;
    box-shadow: 0 3px 0 rgba(109, 40, 217, 0.5), var(--shadow-sm);
    transition: var(--transition);
}
.btn-weighing-scale:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 rgba(109, 40, 217, 0.5), 0 6px 20px rgba(124, 58, 237, 0.3);
}
.btn-weighing-scale:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(109, 40, 217, 0.5);
}

/* Disabled price input */
.price-input:disabled {
    background: var(--bg-light);
    color: var(--text-muted);
    cursor: not-allowed;
}

.customer-search-wrapper {
    flex: 1;
    position: relative;
}

.customer-search-input {
    width: 100%;
    padding: 9px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    background: var(--bg-white);
    transition: var(--transition);
}
.customer-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.customer-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 999;
    box-shadow: var(--shadow-lg);
}
.customer-dropdown.show { display: block; }

.customer-dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition);
}
.customer-dropdown-item:hover,
.customer-dropdown-item.highlighted {
    background: linear-gradient(135deg, #ede9fe, #e0e7ff);
}
.customer-dropdown-item .cust-name {
    font-weight: 600;
    color: var(--text-dark);
}
.customer-dropdown-item .cust-detail {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.customer-dropdown-item:last-child { border-bottom: none; }
.customer-dropdown-empty {
    padding: 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.btn-add-customer {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 0 rgba(109, 40, 217, 0.4), var(--shadow-sm);
    transition: var(--transition);
}

.btn-request-contact {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: #fff;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 0 rgba(3, 105, 161, 0.45), var(--shadow-sm);
    transition: var(--transition);
}
.btn-request-contact:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 rgba(3, 105, 161, 0.45), 0 8px 20px rgba(2, 132, 199, 0.35);
}
.btn-request-contact:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(3, 105, 161, 0.45);
}
.btn-request-contact.active {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 3px 0 rgba(22, 101, 52, 0.45), var(--shadow-sm);
}

.customer-request-notice {
    font-size: 11px;
    font-weight: 700;
    color: #0f766e;
    background: linear-gradient(135deg, #ccfbf1, #99f6e4);
    border: 1px solid #5eead4;
    border-radius: 999px;
    padding: 3px 10px;
    white-space: nowrap;
}

.search-section {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input {
    flex: 1;
    padding: 9px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    background: var(--bg-white);
    transition: var(--transition);
}
.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.search-input::placeholder { color: var(--text-muted); }

/* Search autocomplete dropdown */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    max-height: 540px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    display: none;
}
.search-results.active { display: block; }

.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition);
}
.search-result-item:hover { background: linear-gradient(135deg, #faf5ff, #ede9fe); }
.search-result-item .product-info { flex: 1; }
.search-result-item .product-name { font-weight: 600; font-size: 13px; color: var(--text-dark); }
.search-result-item .product-sku { font-size: 12px; color: var(--text-muted); }
.search-result-item .product-price { font-weight: 700; color: var(--primary); font-size: 13px; }
.search-result-item .product-default-price { font-size: 11px; color: #059669; font-weight: 600; }
.search-result-item .product-stock { font-size: 11px; color: var(--text-muted); }
.search-result-item.exact-match {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-left: 3px solid #10b981;
}
.search-result-item.exact-match:hover { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }

/* Arrow-key selected row — strong, unmissable highlight */
.search-result-item.highlighted,
.search-result-item.exact-match.highlighted {
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    border-left: 4px solid #fbbf24 !important;
    box-shadow: 0 2px 12px rgba(79,70,229,0.35);
    transform: translateX(2px);
}
.search-result-item.highlighted .product-name,
.search-result-item.highlighted .product-sku,
.search-result-item.highlighted .product-price,
.search-result-item.highlighted .product-default-price,
.search-result-item.highlighted .product-stock,
.search-result-item.highlighted span {
    color: #fff !important;
}
.search-result-item.highlighted mark {
    background: rgba(251,191,36,0.5);
    color: #fff;
    border-radius: 2px;
}

/* ========== POS TABLE ========== */
.pos-table-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.pos-table {
    width: 100%;
    border-collapse: collapse;
}

.pos-table thead {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    position: sticky;
    top: 0;
    z-index: 10;
}

.pos-table th {
    padding: 12px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-medium);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pos-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    vertical-align: middle;
    font-size: 13px;
}

.pos-table tbody tr { transition: background 0.12s ease; }
.pos-table tbody tr:hover { background: #faf5ff; }

.pos-table .col-product { width: 35%; }
.pos-table .col-price { width: 15%; text-align: right; font-variant-numeric: tabular-nums; }
.pos-table .col-qty { width: 15%; text-align: center; }
.pos-table .col-subtotal { width: 20%; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.pos-table .col-action { width: 5%; text-align: center; }

.qty-input {
    width: 60px;
    min-width: 50px;
    max-width: 110px;
    text-align: center;
    padding: 6px 8px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    background: var(--bg-white);
    transition: var(--transition);
}

.qty-input.qty-auto-width {
    width: auto;
}

.btn-remove-line {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: var(--transition);
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-remove-line:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
}

/* Remove default table-cell padding for the empty row */
#emptyCartRow > td { padding: 0 !important; }

.empty-cart {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 28px 20px 0;
    min-height: calc(100vh - 260px);
    overflow: hidden;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99,102,241,0.11) 0%, transparent 52%),
        radial-gradient(ellipse at 80% 80%, rgba(139,92,246,0.09) 0%, transparent 48%),
        radial-gradient(ellipse at 60% 10%, rgba(167,139,250,0.07) 0%, transparent 40%),
        #f9f9ff;
    animation: ec-bg-breathe 10s ease-in-out infinite alternate;
}
@keyframes ec-bg-breathe {
    0%   { background:
        radial-gradient(ellipse at 20% 20%, rgba(99,102,241,0.11) 0%, transparent 52%),
        radial-gradient(ellipse at 80% 80%, rgba(139,92,246,0.09) 0%, transparent 48%),
        radial-gradient(ellipse at 60% 10%, rgba(167,139,250,0.07) 0%, transparent 40%),
        #f9f9ff; }
    50%  { background:
        radial-gradient(ellipse at 35% 45%, rgba(99,102,241,0.14) 0%, transparent 55%),
        radial-gradient(ellipse at 65% 60%, rgba(139,92,246,0.11) 0%, transparent 52%),
        radial-gradient(ellipse at 80% 25%, rgba(167,139,250,0.09) 0%, transparent 44%),
        #f9f9ff; }
    100% { background:
        radial-gradient(ellipse at 15% 65%, rgba(99,102,241,0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 30%, rgba(139,92,246,0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 85%, rgba(167,139,250,0.08) 0%, transparent 45%),
        #f9f9ff; }
}

/* ── Empty Cart Brand Center — fills the full cart area ── */
.ec-brand-center {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 20px 20px 50px;
    width: 100%;
    overflow: hidden;
    background: transparent;
    cursor: default;
    margin-top: 0;
}
.ec-brand-center::before { display: none; }
.ec-brand-center:hover .ec-logo-img {
    filter: drop-shadow(0 0 34px rgba(139,92,246,0.95)) drop-shadow(0 0 70px rgba(99,102,241,0.50));
    transform: translateY(-10px) rotate3d(0.1,1,0,10deg);
}

/* Ambient orbs */
.ec-bg-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: ec-orb-drift 14s ease-in-out infinite;
}
.ec-orb-1 {
    width: 70vw; height: 70vw;
    max-width: 700px; max-height: 700px;
    background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 65%);
    top: -30%; left: -20%;
    animation-delay: 0s;
}
.ec-orb-2 {
    width: 60vw; height: 60vw;
    max-width: 600px; max-height: 600px;
    background: radial-gradient(circle, rgba(139,92,246,0.09) 0%, transparent 65%);
    bottom: -25%; right: -15%;
    animation-delay: -7s;
}
@keyframes ec-orb-drift {
    0%,100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(60px,40px) scale(1.08); }
    66% { transform: translate(-40px,70px) scale(0.93); }
}

/* Logo wrap */
.ec-logo-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 200px;
    animation: ec-logo-entry 0.9s cubic-bezier(0.34,1.56,0.64,1) forwards;
    opacity: 0;
}
@keyframes ec-logo-entry {
    from { opacity: 0; transform: scale(0.35) translateY(24px) rotateY(-30deg); }
    to   { opacity: 1; transform: scale(1) translateY(0) rotateY(0deg); }
}
.ec-logo-ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(99,102,241,0.55), rgba(167,139,250,0.75), rgba(196,181,253,0.55), rgba(99,102,241,0.25), rgba(99,102,241,0.55));
    animation: ec-ring-spin 7s linear infinite;
    mask: radial-gradient(circle at center, transparent 52%, black 54%);
    -webkit-mask: radial-gradient(circle at center, transparent 52%, black 54%);
    opacity: 0.55;
}
@keyframes ec-ring-spin { to { transform: rotate(360deg); } }
.ec-logo-img {
    width: 170px;
    height: 170px;
    object-fit: contain;
    filter: drop-shadow(0 0 22px rgba(139,92,246,0.70)) drop-shadow(0 0 50px rgba(99,102,241,0.32));
    animation: ec-logo-float 4.5s ease-in-out infinite;
    transform-style: preserve-3d;
    transition: filter 0.45s ease, transform 0.45s ease;
}
@keyframes ec-logo-float {
    0%,100% { transform: translateY(0px) rotate3d(0.1,1,0,0deg); }
    50%      { transform: translateY(-14px) rotate3d(0.1,1,0,5deg); }
}

/* Brand text */
.ec-text-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    animation: ec-text-entry 1.0s cubic-bezier(0.34,1.56,0.64,1) 0.15s forwards;
    opacity: 0;
}
@keyframes ec-text-entry {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ec-brand-name {
    display: flex;
    gap: 12px;
    line-height: 1;
}
.ec-keen {
    font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif;
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: transparent;
    background: linear-gradient(135deg, #6366f1 0%, #a78bfa 45%, #c4b5fd 65%, #818cf8 100%);
    background-size: 250% 250%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: ec-grad-sweep 5s ease-in-out infinite;
}
.ec-systems {
    font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif;
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: transparent;
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 50%, #4f46e5 100%);
    background-size: 250% 250%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: ec-grad-sweep 5s ease-in-out infinite 0.6s;
}
@keyframes ec-grad-sweep {
    0%,100% { background-position: 0% 50%; }
    50%     { background-position: 100% 50%; }
}
.ec-divider {
    font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.50em;
    color: rgba(139,92,246,0.55);
    text-transform: uppercase;
    margin: 4px 0 6px;
}
.ec-tagline {
    font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.26em;
    color: rgba(99,102,241,0.50);
    text-transform: uppercase;
    min-height: 18px;
    display: flex;
    align-items: center;
}
.ec-cursor {
    display: inline-block;
    color: rgba(139,92,246,0.65);
    animation: ec-blink 1s step-end infinite;
    font-weight: 200;
    margin-left: 1px;
    line-height: 1;
}
@keyframes ec-blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* Badge floats above the brand */
.empty-cart-badge {
    position: relative;
    z-index: 2;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(99,102,241,0.20);
    border-radius: 14px;
    padding: 14px 32px;
    text-align: center;
    cursor: default;
    transition: all 0.28s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 4px 20px rgba(99,102,241,0.12), 0 1px 4px rgba(0,0,0,0.06);
}
.empty-cart-badge:hover {
    background: rgba(255,255,255,0.96);
    border-color: rgba(99,102,241,0.36);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 36px rgba(99,102,241,0.20);
}

.empty-cart-text {
    font-size: 15px;
    font-weight: 600;
    color: #4f46e5;
    margin: 0 0 6px;
    letter-spacing: 0.2px;
}
.empty-cart-hint {
    font-size: 13px;
    color: #94a3b8;
    display: block;
}
.empty-cart-hint kbd {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.18);
    border-radius: 5px;
    font-family: inherit;
    color: #6366f1;
    box-shadow: 0 1px 0 rgba(99,102,241,0.12);
}

/* ========== TOTALS SECTION ========== */
.pos-totals {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    gap: 12px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.totals-left {
    display: flex;
    gap: 10px;
    font-size: 13px;
    flex-wrap: wrap;
    align-items: center;
}

.totals-left .total-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-light);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
}

.totals-left .total-label {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.totals-left .total-value {
    font-weight: 800;
    color: var(--text-dark);
    font-variant-numeric: tabular-nums;
}

.discount-section {
    display: flex;
    align-items: center;
    gap: 6px;
}

.discount-section .label {
    color: var(--info);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}
.discount-section .label:hover {
    color: var(--primary);
}

/* ===== Animated Billing Control Buttons (Discount / Bank Fee / Bags) ===== */
.billing-control-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    border: 1.5px solid transparent;
    position: relative;
}
.billing-control-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.billing-control-btn:active {
    transform: translateY(1px) scale(0.97);
}
.billing-ctrl-icon {
    font-size: 13px;
}
.billing-ctrl-label {
    font-weight: 700;
    letter-spacing: 0.1px;
}
.billing-ctrl-sep {
    font-weight: 800;
    font-size: 13px;
    opacity: 0.7;
}
.billing-ctrl-value {
    font-weight: 800;
    font-size: 13px;
    min-width: 28px;
    text-align: right;
    transition: all 0.2s ease;
    font-variant-numeric: tabular-nums;
}
/* Discount: purple accent */
.discount-ctrl {
    background: linear-gradient(135deg, #f3e8ff, #ede9fe);
    color: #7c3aed;
    border-color: rgba(124,58,237,0.2);
}
.discount-ctrl:hover {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    border-color: rgba(124,58,237,0.4);
}
.discount-ctrl.has-value {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    border-color: #7c3aed;
    animation: ctrlPulse 0.4s ease;
}
/* Bank Fee: orange/red accent */
.bankfee-ctrl {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    color: #ea580c;
    border-color: rgba(234,88,12,0.2);
}
.bankfee-ctrl:hover {
    background: linear-gradient(135deg, #ffedd5, #fed7aa);
    border-color: rgba(234,88,12,0.4);
}
.bankfee-ctrl.has-value {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    color: #fff;
    border-color: #ea580c;
    animation: ctrlPulse 0.4s ease;
}
/* Bags: teal accent */
.bags-ctrl {
    background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
    color: #0d9488;
    border-color: rgba(13,148,136,0.2);
}
.bags-ctrl:hover {
    background: linear-gradient(135deg, #ccfbf1, #99f6e4);
    border-color: rgba(13,148,136,0.4);
}
.bags-ctrl.has-value {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
    border-color: #0d9488;
    animation: ctrlPulse 0.4s ease;
}
@keyframes ctrlPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

.total-payable {
    display: flex;
    align-items: center;
    gap: 12px;
}

.total-payable .label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.total-payable .amount {
    font-size: 26px;
    font-weight: 900;
    color: #065f46;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    padding: 6px 20px;
    border-radius: var(--radius);
    border: 2px solid rgba(16, 185, 129, 0.3);
    min-width: 130px;
    text-align: center;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03), 0 2px 8px rgba(16, 185, 129, 0.1);
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

/* ========== PAYMENT BUTTONS ========== */
.pos-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
    z-index: 910;
    position: relative;
}

/* Base action button — uniform sizing */
.pos-footer .action-btn {
    padding: var(--btn-pad-md);
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--btn-font-md);
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    position: relative;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 1px rgba(0,0,0,0.12);
    min-height: 38px;
}
.pos-footer .action-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.pos-footer .action-btn:active { transform: translateY(1px); filter: brightness(0.95); }
.pos-footer .action-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pos-footer .action-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }

/* Secondary group — smaller, muted 3D */
.btn-draft {
    background: linear-gradient(180deg, #60a5fa, #3b82f6);
    color: white;
    box-shadow: 0 2px 0 #2563eb, 0 3px 8px rgba(59, 130, 246, 0.2);
}
.btn-draft:active { box-shadow: 0 0px 0 #2563eb; }
.btn-drafts-alt {
    background: linear-gradient(180deg, #818cf8, #6366f1);
    color: white;
    box-shadow: 0 2px 0 #4f46e5, 0 3px 8px rgba(99, 102, 241, 0.2);
}
.btn-drafts-alt:active { box-shadow: 0 0px 0 #4f46e5; }

.btn-quotation {
    background: linear-gradient(180deg, #34d399, #10b981);
    color: white;
    box-shadow: 0 2px 0 #059669, 0 3px 8px rgba(16, 185, 129, 0.2);
}
.btn-quotation:active { box-shadow: 0 0px 0 #059669; }

.btn-suspend {
    background: linear-gradient(180deg, #f87171, #ef4444);
    color: white;
    box-shadow: 0 2px 0 #dc2626, 0 3px 8px rgba(239, 68, 68, 0.2);
}
.btn-suspend:active { box-shadow: 0 0px 0 #dc2626; }

.btn-credit-sale {
    background: linear-gradient(180deg, #64748b, #475569);
    color: white;
    box-shadow: 0 2px 0 #334155, 0 3px 8px rgba(51, 65, 85, 0.2);
}
.btn-credit-sale:active { box-shadow: 0 0px 0 #334155; }

.btn-card {
    background: linear-gradient(180deg, #a78bfa, #8b5cf6);
    color: white;
    box-shadow: 0 2px 0 #7c3aed, 0 3px 8px rgba(139, 92, 246, 0.2);
}
.btn-card:active { box-shadow: 0 0px 0 #7c3aed; }

/* Danger action */
.btn-return-alt {
    background: linear-gradient(180deg, #fb923c, #f97316);
    color: white;
    box-shadow: 0 2px 0 #ea580c, 0 3px 8px rgba(249, 115, 22, 0.2);
}
.btn-return-alt:active { box-shadow: 0 0px 0 #ea580c; }

/* ===== Primary payment group — larger, bolder 3D ===== */
.btn-multiple-pay {
    background: linear-gradient(180deg, #818cf8, #6366f1);
    color: white;
    padding: var(--btn-pad-lg);
    font-size: var(--btn-font-lg);
    box-shadow: 0 3px 0 #4f46e5, 0 4px 12px rgba(99, 102, 241, 0.3);
    min-height: 42px;
}
.btn-multiple-pay:active { box-shadow: 0 0px 0 #4f46e5; }

.btn-cash {
    background: linear-gradient(180deg, #34d399, #10b981);
    color: white;
    padding: var(--btn-pad-lg);
    font-size: var(--btn-font-lg);
    box-shadow: 0 3px 0 #059669, 0 4px 12px rgba(16, 185, 129, 0.3);
    min-height: 42px;
}
.btn-cash:active { box-shadow: 0 0px 0 #059669; }

.btn-cancel {
    background: linear-gradient(180deg, #f87171, #ef4444);
    color: white;
    padding: var(--btn-pad-md);
    box-shadow: 0 2px 0 #dc2626, 0 3px 8px rgba(239, 68, 68, 0.2);
}
.btn-cancel:active { box-shadow: 0 0px 0 #dc2626; }

.footer-spacer { flex: 1; }

/* ===== F-Key Shortcut Badges ===== */
.fkey-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.3px;
    min-width: 24px;
    height: 18px;
    padding: 0 5px;
    border-radius: 4px;
    background: rgba(255,255,255,0.22);
    color: rgba(255,255,255,0.95);
    border: 1px solid rgba(255,255,255,0.18);
    margin-left: 5px;
    line-height: 1;
    text-shadow: none;
    pointer-events: none;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
    font-family: system-ui, -apple-system, sans-serif;
}

/* Dark glass variant for light backgrounds (search bars, bags) */
.fkey-badge-dark {
    background: rgba(30,30,50,0.65);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.08);
    font-size: 9px;
    height: 17px;
    min-width: 22px;
}

/* Badge floating next to round buttons */
.fkey-badge-btn-float {
    margin-left: -2px;
    align-self: center;
}

.pos-footer .action-btn.fkey-pressed {
    transform: translateY(1px) scale(0.97) !important;
    filter: brightness(1.12);
    transition: all 0.08s ease;
}

/* ===== Shortcut Toggle (Settings Modal) ===== */
.shortcut-toggle-settings {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}
.shortcut-toggle-settings input {
    display: none;
}
.shortcut-toggle-track {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: #cbd5e1;
    transition: background 0.25s ease;
}
.shortcut-toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.shortcut-toggle-settings input:checked + .shortcut-toggle-track {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}
.shortcut-toggle-settings input:checked + .shortcut-toggle-track::after {
    transform: translateX(20px);
}

/* ===== Shortcut Guide Modal ===== */
.shortcut-guide-modal {
    width: 680px;
    max-width: 96vw;
    max-height: 90vh;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0,0,0,0.35);
    animation: modalPopIn 0.35s ease;
}
.shortcut-guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    background: linear-gradient(135deg, #4338ca, #6366f1);
    color: #fff;
}
.shortcut-guide-header h3 {
    font-size: 17px;
    font-weight: 800;
    margin: 0;
}
.shortcut-lang-toggle {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.3);
}
.shortcut-lang-btn {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 700;
    border: none;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.2s ease;
}
.shortcut-lang-btn.active {
    background: #fff;
    color: #4338ca;
}
.shortcut-print-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.shortcut-print-btn:hover {
    background: rgba(255,255,255,0.25);
}
.shortcut-guide-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px 24px;
    background: #f8fafc;
}
.sg-title {
    font-size: 15px;
    font-weight: 800;
    color: #4338ca;
    margin-bottom: 16px;
    text-align: center;
    letter-spacing: 0.3px;
}
.sg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.sg-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    animation: sgCardIn 0.3s ease both;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sg-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
@keyframes sgCardIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.sg-key {
    min-width: 42px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}
.sg-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.sg-icon {
    font-size: 20px;
    flex-shrink: 0;
}
.sg-label {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}
.sg-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.3;
    margin-top: 2px;
}
.sg-note {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

/* ========== ADD CONTACT MODAL — MODERN 3D ========== */
.contact-modal-modern {
    width: 740px;
    max-width: 95vw;
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    border: 1px solid rgba(124, 58, 237, 0.12);
    box-shadow:
        0 20px 60px rgba(30, 27, 75, 0.25),
        0 4px 16px rgba(124, 58, 237, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.contact-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: linear-gradient(135deg, #4c1d95, #7c3aed, #6d28d9);
    color: white;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}
.contact-modal-header::before {
    content: '';
    position: absolute;
    top: 0; left: -50%; width: 200%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    animation: contactHeaderShimmer 4s ease-in-out infinite;
}
@keyframes contactHeaderShimmer {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(50%); }
}
.contact-modal-header-icon {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
    flex-shrink: 0;
}
.contact-modal-close {
    margin-left: auto;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 30px; height: 30px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.contact-modal-close:hover {
    background: rgba(255,255,255,0.25);
    transform: rotate(90deg);
}

.contact-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(180deg, #faf8ff, #f8fafc);
}

/* Type Toggle */
.contact-type-toggle {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: rgba(124, 58, 237, 0.06);
    border-radius: 12px;
    border: 1px solid rgba(124, 58, 237, 0.1);
}
.contact-type-option {
    flex: 1;
    cursor: pointer;
}
.contact-type-option input { display: none; }
.contact-type-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-medium);
    transition: all 0.25s;
    user-select: none;
}
.contact-type-option input:checked + .contact-type-label {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.3);
}

/* Cards */
.contact-card {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.contact-card-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.contact-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.contact-field {
    min-width: 140px;
    flex: 1;
}
.contact-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-medium);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.contact-required {
    color: #ef4444;
    font-weight: 800;
}
.contact-input {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    background: white;
    color: var(--text-dark);
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
}
.contact-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    background: white;
}
.contact-input::placeholder {
    color: #b0b8c4;
    font-weight: 400;
}
.contact-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    cursor: pointer;
}
.contact-hint {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* More Info Button */
.contact-more-btn {
    padding: 7px 22px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}
.contact-more-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

/* Footer */
.contact-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    background: white;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 0 0 18px 18px;
}
.contact-btn-save {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 3px 0 #047857, 0 4px 14px rgba(16, 185, 129, 0.3);
}
.contact-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 0 #047857, 0 6px 20px rgba(16, 185, 129, 0.4);
}
.contact-btn-save:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #047857;
}
.contact-btn-close {
    padding: 10px 20px;
    background: var(--bg-light);
    color: var(--text-medium);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.contact-btn-close:hover {
    background: #e2e8f0;
}

/* Contact modal entrance animation */
#addCustomerModal.active .contact-modal-modern {
    animation: modalSlideRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ========== MODALS ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    width: 500px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255,255,255,0.2);
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.8), rgba(255,255,255,0));
}

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

.modal-close {
    background: var(--bg-light);
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.modal-close:hover {
    color: white;
    background: var(--danger);
    transform: rotate(90deg);
}

.modal-body { padding: 20px 24px; }
.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0), rgba(248, 250, 252, 0.5));
}

.modal-footer .btn {
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    letter-spacing: 0.2px;
}
.modal-footer .btn-primary {
    background: linear-gradient(180deg, var(--primary-light), var(--primary));
    color: white;
    box-shadow: 0 3px 0 var(--primary-dark), var(--shadow-sm);
}
.modal-footer .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 0 var(--primary-dark), 0 6px 16px var(--primary-glow);
}
.modal-footer .btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 var(--primary-dark);
}
.modal-footer .btn-secondary {
    background: var(--bg-light);
    color: var(--text-medium);
    border: 1px solid var(--border-color);
}
.modal-footer .btn-secondary:hover {
    background: #e2e8f0;
}

/* ========== PAYMENT MODAL ========== */
.payment-methods {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.payment-method-btn {
    padding: 9px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-white);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: var(--transition);
}
.payment-method-btn.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #faf5ff, #ede9fe);
    color: var(--primary);
    box-shadow: 0 2px 8px var(--primary-glow);
}
.payment-method-btn:hover:not(.active) {
    border-color: var(--primary-light);
    background: #faf5ff;
}

.payment-amount-input {
    width: 100%;
    padding: 16px;
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    outline: none;
    margin-bottom: 12px;
    background: var(--bg-white);
    transition: var(--transition);
    letter-spacing: -0.5px;
}
.payment-amount-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.payment-summary {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.payment-summary .row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 14px;
}

.payment-summary .row.total {
    font-weight: 800;
    font-size: 18px;
    border-top: 2px solid var(--border-color);
    padding-top: 8px;
    margin-top: 8px;
}

.change-return {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    color: var(--success-dark);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ========== RECENT TRANSACTIONS ========== */

/* ========== MODERN PAYMENT MODAL ========== */
.pay-modal-modern {
    width: 96vw;
    max-width: 96vw;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.1);
    animation: payModalSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 96vh;
    display: flex;
    flex-direction: column;
}
.pay-modal-modern.numpad-open {
    width: 98vw;
}
@keyframes payModalSlideIn {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.pay-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #3730a3 100%);
    color: #fff;
    border-bottom: 3px solid rgba(99,102,241,0.5);
}
.pay-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
}
.pay-modal-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.pay-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.pay-numpad-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.pay-numpad-toggle:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
    transform: translateY(-1px);
}
.pay-numpad-toggle.active {
    background: rgba(99,102,241,0.7);
    border-color: rgba(129,140,248,0.6);
    color: #fff;
    box-shadow: 0 0 16px rgba(99,102,241,0.4);
}
.pay-modal-close {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.pay-modal-close:hover {
    background: #ef4444;
    color: #fff;
    transform: rotate(90deg) scale(1.1);
}

/* Body layout */
.pay-modal-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #f1f5f9;
}

/* Left: Payment rows */
.pay-modal-left {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    border-right: none;
    background: #fff;
    margin: 10px;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.pay-advance-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    border: 2px solid #93c5fd;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(59,130,246,0.1);
}
.pay-advance-badge strong { font-weight: 700; }

.pay-rows-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Add row button */
.pay-add-row-btn {
    width: 100%;
    padding: 14px;
    margin-top: 14px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.pay-add-row-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}
.pay-add-row-btn:active {
    transform: translateY(0);
}

/* Notes */
.pay-notes-row {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}
.pay-note-field {
    flex: 1;
}
.pay-note-field label {
    font-size: 13px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}
.pay-note-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    resize: vertical;
    transition: border-color 0.2s;
    background: #fafafa;
}
.pay-note-field textarea:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* ===== Number Pad Panel ===== */
.pay-numpad-panel {
    width: 0;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    border-right: none;
    display: flex;
    flex-direction: column;
    opacity: 0;
    margin: 10px 0;
}
.pay-numpad-panel.active {
    width: 240px;
    min-width: 240px;
    padding: 0 6px;
    opacity: 1;
}
.pay-numpad-display {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    color: #a5b4fc;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 28px;
    font-weight: 700;
    text-align: right;
    padding: 12px 16px;
    border-radius: 14px;
    margin-bottom: 8px;
    letter-spacing: 1px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(30,27,75,0.3);
}
.pay-numpad-display.numpad-flash {
    background: #10b981;
    color: #fff;
}
.pay-numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    flex: 1;
    background: #fff;
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.pay-numpad-key {
    aspect-ratio: 1;
    border: none;
    border-radius: 14px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.12s ease;
    box-shadow: 0 3px 0 #e2e8f0, 0 1px 4px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.pay-numpad-key:hover {
    background: #e0e7ff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.pay-numpad-key:active {
    transform: translateY(1px);
    box-shadow: none;
    background: #c7d2fe;
}
.pay-numpad-backspace {
    background: #fef2f2;
    color: #ef4444;
}
.pay-numpad-backspace:hover { background: #fee2e2; }
.pay-numpad-clear {
    background: #fef3c7;
    color: #d97706;
    font-weight: 800;
}
.pay-numpad-clear:hover { background: #fde68a; }
.pay-numpad-enter {
    grid-column: span 1;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    gap: 4px;
    flex-direction: column;
}
.pay-numpad-enter:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 3px 12px rgba(16,185,129,0.3);
}

/* ===== Summary Panel ===== */
.pay-summary-panel {
    width: 220px;
    min-width: 220px;
    background: linear-gradient(180deg, #1e1e2e, #151525);
    color: #fff;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    margin: 10px 0;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.pay-summary-card {
    text-align: center;
    padding: 10px 8px;
    border-radius: 12px;
    animation: paySummarySlideIn 0.4s cubic-bezier(0.4,0,0.2,1) forwards;
    opacity: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}
.pay-summary-card:nth-child(1) { animation-delay: 0.05s; }
.pay-summary-card:nth-child(2) { animation-delay: 0.1s; }
.pay-summary-card:nth-child(3) { animation-delay: 0.15s; }
.pay-summary-card:nth-child(4) { animation-delay: 0.2s; }
.pay-summary-card:nth-child(5) { animation-delay: 0.25s; }
@keyframes paySummarySlideIn {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}
.pay-card-items {
    background: linear-gradient(135deg, #334155, #1e293b);
}
.pay-card-items .pay-summary-value {
    font-size: 32px;
    font-weight: 900;
}
.pay-card-total {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}
.pay-card-paying {
    background: linear-gradient(135deg, #059669, #047857);
}
.pay-card-change {
    background: linear-gradient(135deg, #d97706, #b45309);
}
.pay-card-balance {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}
.pay-summary-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 0.9;
    margin-bottom: 2px;
}
.pay-summary-value {
    font-size: 20px;
    font-weight: 800;
    transition: all 0.3s ease;
}
.pay-summary-divider {
    height: 1px;
    background: rgba(255,255,255,0.15);
    margin: 4px 0;
}

/* ===== Cash Breakdown Panel (Far Right) ===== */
.pay-breakdown-panel {
    width: 280px;
    min-width: 280px;
    background: linear-gradient(180deg, #0f172a 0%, #1a1a2e 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    border-radius: 0 0 16px 0;
    overflow: hidden;
    margin: 10px 10px 10px 0;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.pay-breakdown-header {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.9);
    text-align: center;
    padding: 14px 10px 12px;
    background: linear-gradient(135deg, rgba(99,102,241,0.3) 0%, rgba(139,92,246,0.2) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pay-denomination-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.pay-denomination-list::-webkit-scrollbar { width: 3px; }
.pay-denomination-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.pay-denom-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    animation: denomSlideIn 0.3s ease both;
    transition: background 0.2s, transform 0.15s;
}
.pay-denom-row:hover {
    background: rgba(255,255,255,0.12);
    transform: translateX(-2px);
}
@keyframes denomSlideIn {
    from { opacity: 0; transform: translateX(12px) scale(0.92); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* Real currency images */
.pay-denom-img {
    width: 100px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.12);
}
.pay-denom-img-coin {
    width: 46px;
    height: 46px;
    border-radius: 50%;
}

/* Fallback colored box if image fails */
.pay-denom-fallback {
    width: 100px;
    height: 50px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: white;
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
/* Note colors by denomination */
.pay-denom-5000 { background: linear-gradient(135deg, #7c3aed, #5b21b6); }
.pay-denom-2000 { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.pay-denom-1000 { background: linear-gradient(135deg, #059669, #047857); }
.pay-denom-500  { background: linear-gradient(135deg, #d97706, #b45309); }
.pay-denom-100  { background: linear-gradient(135deg, #0891b2, #0e7490); }
.pay-denom-50   { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.pay-denom-20   { background: linear-gradient(135deg, #ea580c, #c2410c); }
.pay-denom-10   { background: linear-gradient(135deg, #a8a29e, #78716c); width: 46px; height: 46px; border-radius: 50%; }
.pay-denom-5    { background: linear-gradient(135deg, #d4d4d8, #a1a1aa); width: 46px; height: 46px; border-radius: 50%; }
.pay-denom-2    { background: linear-gradient(135deg, #fbbf24, #d97706); width: 46px; height: 46px; border-radius: 50%; }
.pay-denom-1    { background: linear-gradient(135deg, #f59e0b, #b45309); width: 46px; height: 46px; border-radius: 50%; }

.pay-denom-count {
    font-size: 16px;
    font-weight: 800;
    color: rgba(255,255,255,0.95);
    white-space: nowrap;
}
.pay-denom-count span {
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    font-size: 13px;
}
.pay-denom-empty {
    text-align: center;
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    padding: 20px 8px;
    font-style: italic;
}

/* Highlight for numpad-targeted input */
.pay-row-amount.numpad-active {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2) !important;
    background: #eef2ff !important;
}

/* ===== Footer ===== */
.pay-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    border-top: 2px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
}
.pay-btn-close {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 30px;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    color: #6b7280;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 0 #e5e7eb;
}
.pay-btn-close:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #d1d5db;
}
.pay-btn-close:active {
    transform: translateY(1px);
    box-shadow: none;
}
.pay-btn-finalize {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 40px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 0 #047857, 0 6px 20px rgba(16,185,129,0.35);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    min-width: 260px;
    justify-content: center;
}
.pay-btn-finalize:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #047857, 0 8px 28px rgba(16,185,129,0.45);
    background: linear-gradient(135deg, #34d399, #10b981);
}
.pay-btn-finalize:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #047857;
}
.pay-btn-finalize:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== Payment Row Modern Styling ===== */
.payment-row {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px 18px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    position: relative;
}
.payment-row:hover {
    box-shadow: 0 4px 16px rgba(99,102,241,0.1);
    border-color: #c7d2fe;
}
.pay-row-top {
    display: flex;
    gap: 14px;
    align-items: flex-end;
}
.pay-row-field {
    flex: 1;
}
.pay-row-field-amount {
    flex: 1.2;
}
.pay-row-label {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 5px;
}
.pay-row-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.2s ease;
    outline: none;
}
.pay-row-input:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
}
.pay-row-input::placeholder {
    color: #cbd5e1;
    font-weight: 500;
}
.pay-row-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    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 fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.pay-row-select:focus {
    border-color: #6366f1;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
}
.pay-row-remove {
    margin-bottom: 2px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
    transition: all 0.15s ease;
    box-shadow: 0 2px 0 #b91c1c;
    flex-shrink: 0;
}
.pay-row-remove:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #b91c1c, 0 4px 12px rgba(239,68,68,0.3);
}
.pay-row-remove:active {
    transform: translateY(1px);
    box-shadow: none;
}

/* ========== RECENT TRANSACTIONS ========== */
.recent-list {
    max-height: 400px;
    overflow-y: auto;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 4px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition);
}
.recent-item:hover {
    background: #faf5ff;
    padding-left: 8px;
}

.recent-item .inv-no { font-weight: 700; color: var(--text-dark); }
.recent-item .inv-date { font-size: 12px; color: var(--text-muted); }
.recent-item .inv-total { font-weight: 800; }
.recent-item .inv-status {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
}
.inv-status.synced { background: linear-gradient(135deg, #ecfdf5, #d1fae5); color: #059669; }
.inv-status.pending { background: linear-gradient(135deg, #fffbeb, #fef3c7); color: #d97706; }
.inv-status.error { background: linear-gradient(135deg, #fef2f2, #fecaca); color: #dc2626; }

/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
    position: fixed;
    top: 66px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-white);
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    font-size: 13px;
    font-weight: 600;
    max-width: 380px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

@keyframes slideIn {
    from { transform: translateX(100%) scale(0.95); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.5); }

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .pos-topbar {
        flex-wrap: wrap;
    }
    .price-group-section {
        order: 3;
        width: 100%;
    }
    .totals-left {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 1024px) {
    .pos-topbar { flex-direction: column; }
    .customer-section { min-width: 100%; }
    .pos-footer {
        gap: 5px;
    }
    .pos-footer .action-btn {
        padding: var(--btn-pad-sm);
        font-size: var(--btn-font-sm);
    }
    .total-payable .amount {
        font-size: 22px;
        padding: 5px 14px;
    }
}

@media (max-width: 768px) {
    .pos-header {
        padding: 0 10px;
        height: 48px;
    }
    .pos-header .brand {
        font-size: 15px;
    }
    .pos-main {
        top: 48px;
    }
    .pos-content {
        padding: 8px;
        gap: 6px;
    }
    .pos-footer .action-btn {
        padding: 8px 10px;
        font-size: 11px;
    }
}

/* ========== PRICE GROUP SECTION ========== */
.price-group-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.price-group-select {
    padding: 8px 32px 8px 14px;
    border: 2px solid rgba(124, 58, 237, 0.25);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
    background: linear-gradient(180deg, #faf5ff, #f3e8ff);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-width: 170px;
    cursor: pointer;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 0 rgba(124, 58, 237, 0.15), 0 3px 10px rgba(124, 58, 237, 0.1);
    letter-spacing: 0.2px;
}
.price-group-select:hover {
    border-color: var(--primary);
    background: linear-gradient(180deg, #f3e8ff, #ede9fe);
    box-shadow: 0 2px 0 rgba(124, 58, 237, 0.2), 0 5px 16px rgba(124, 58, 237, 0.18);
    transform: translateY(-1px);
}
.price-group-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), 0 2px 0 rgba(124, 58, 237, 0.2);
    background: linear-gradient(180deg, #f3e8ff, #ede9fe);
}
.price-group-select option {
    font-weight: 600;
    padding: 8px;
    background: #fff;
    color: var(--text-dark);
}

.btn-auto-price {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border-radius: var(--radius);
    border: 2px solid rgba(156,163,175,0.4);
    background: #f3f4f6;
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.btn-auto-price:hover {
    border-color: rgba(124,58,237,0.4);
    background: #faf5ff;
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(124,58,237,0.15);
}
.btn-auto-price .btn-auto-price-icon {
    font-size: 13px;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.btn-auto-price .btn-auto-price-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9ca3af;
    flex-shrink: 0;
    transition: background 0.2s, box-shadow 0.2s;
}
/* Active (ON) state */
.btn-auto-price.active {
    border-color: rgba(16,185,129,0.5);
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
    box-shadow: 0 1px 3px rgba(16,185,129,0.2), 0 0 0 0 rgba(16,185,129,0);
}
.btn-auto-price.active:hover {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-color: #10b981;
    box-shadow: 0 3px 8px rgba(16,185,129,0.25);
    color: #064e3b;
}
.btn-auto-price.active .btn-auto-price-icon {
    opacity: 1;
}
.btn-auto-price.active .btn-auto-price-dot {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.25);
    animation: autoPriceDotPulse 2s ease-in-out infinite;
}
@keyframes autoPriceDotPulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(16,185,129,0.25); }
    50% { box-shadow: 0 0 0 4px rgba(16,185,129,0.1); }
}


/* ========== EXTRA CHARGES (Bank Fee / Shopping Bags) ========== */
.extra-charge-section {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.extra-charge-label {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.extra-charge-input {
    width: 80px;
    padding: 4px 8px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 700;
    text-align: right;
    outline: none;
    transition: var(--transition);
}
.extra-charge-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.bank-fee-section .extra-charge-input:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
.shopping-bag-section .extra-charge-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* ========== LOGOUT BUTTON ========== */
.btn-logout {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(180deg, #f87171, #ef4444);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 3px 0 #dc2626, 0 4px 12px rgba(239, 68, 68, 0.25);
}
.btn-logout:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #dc2626, 0 8px 20px rgba(239, 68, 68, 0.35);
}
.btn-logout:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #dc2626;
}
.btn-logout:disabled {
    background: linear-gradient(180deg, #cbd5e1, #94a3b8);
    color: #e2e8f0;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 3px 0 #64748b;
}

/* ========== SETTINGS TABS & FIELDS ========== */
.settings-tab {
    flex: 1;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.settings-tab:hover {
    color: #334155;
    background: rgba(99, 102, 241, 0.05);
}
.settings-tab.active {
    color: #4338ca;
    border-bottom-color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
}
.settings-tab-content {
    display: none;
}
.settings-tab-content.active {
    display: block;
}
.settings-field {
    margin-bottom: 4px;
}
.settings-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}
.settings-value {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    min-height: 24px;
}
.settings-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: #334155;
    transition: border-color 0.2s;
}
.settings-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.settings-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
}
.settings-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    accent-color: #0d9488;
}

/* ========== CUSTOMER DISPLAY MODE CARDS ========== */
.display-mode-card {
    flex: 1;
    cursor: pointer;
    position: relative;
}
.display-mode-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.display-mode-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 10px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.2s;
    text-align: center;
}
.display-mode-card input[type="radio"]:checked + .display-mode-inner {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 4px 12px rgba(99, 102, 241, 0.1);
}
.display-mode-inner:hover {
    border-color: #a5b4fc;
    background: #f1f5f9;
}

/* ========== MODERN ANIMATIONS ========== */

/* Cart row 3D entrance animation */
@keyframes cartRowSlideIn {
    0%   { opacity: 0; transform: perspective(600px) rotateX(-12deg) translateY(12px) scale(0.97); }
    50%  { opacity: 0.9; transform: perspective(600px) rotateX(2deg) translateY(-1px) scale(1.005); }
    100% { opacity: 1; transform: perspective(600px) rotateX(0) translateY(0) scale(1); }
}

.cart-row-animate {
    animation: cartRowSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Last added item highlight glow on cashier side */
.cart-row-last-added {
    animation: cartRowSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both,
               cartLastHighlight 2s ease-out 0.4s both !important;
}
@keyframes cartLastHighlight {
    0%   { background: rgba(99,102,241,0.12); box-shadow: inset 4px 0 0 #6366f1, 0 0 16px rgba(99,102,241,0.12); }
    100% { background: transparent; box-shadow: inset 3px 0 0 transparent, 0 0 0 transparent; }
}
body.dark-mode .cart-row-last-added {
    animation: cartRowSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both,
               cartLastHighlightDark 2s ease-out 0.4s both !important;
}
@keyframes cartLastHighlightDark {
    0%   { background: rgba(129,140,248,0.1); box-shadow: inset 4px 0 0 #818cf8, 0 0 16px rgba(129,140,248,0.1); }
    100% { background: transparent; box-shadow: inset 3px 0 0 transparent, 0 0 0 transparent; }
}

/* Deduction row (negative quantity) styling */
.cart-row-deduction {
    background: linear-gradient(135deg, #fef2f2, #fff1f2) !important;
    border-left: 3px solid #ef4444 !important;
}
.cart-row-deduction:hover {
    background: linear-gradient(135deg, #fee2e2, #fecaca) !important;
}
.cart-row-deduction .qty-input {
    color: #ef4444;
    border-color: #fca5a5 !important;
}
body.dark-mode .cart-row-deduction {
    background: linear-gradient(135deg, rgba(239,68,68,0.1), rgba(239,68,68,0.05)) !important;
}
body.dark-mode .cart-row-deduction:hover {
    background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.1)) !important;
}

/* Smooth cart row hover with subtle glass lift */
.pos-table tbody tr.cart-row {
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
}
.pos-table tbody tr.cart-row:hover {
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(139,92,246,0.04));
    box-shadow: inset 3px 0 0 var(--primary-light), 0 4px 12px rgba(99,102,241,0.06);
    transform: translateY(-1px);
}
body.dark-mode .pos-table tbody tr.cart-row:hover {
    background: linear-gradient(135deg, rgba(129,140,248,0.08), rgba(168,85,247,0.05));
    box-shadow: inset 3px 0 0 #818cf8, 0 4px 12px rgba(129,140,248,0.08);
}

/* Modern button press effect on all action buttons */
.pos-footer .action-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.pos-footer .action-btn:hover {
    transform: translateY(-2px);
}
.pos-footer .action-btn:active {
    transform: translateY(2px);
}

/* Enhanced header buttons */
.header-btn {
    transition: var(--transition);
}
.header-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.header-btn:active {
    transform: translateY(0);
}

/* Modern search input focus glow */
.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    transition: var(--transition);
}

/* Toast entrance animation */
@keyframes slideOut {
    from { transform: translateX(0) scale(1); opacity: 1; }
    to { transform: translateX(120%) scale(0.95); opacity: 0; }
}
.toast {
    transition: all 0.3s ease;
}

/* Smooth remove button */
.btn-remove-line {
    transition: var(--transition);
}
.btn-remove-line:hover {
    background: var(--danger) !important;
    color: white !important;
    transform: scale(1.15) rotate(90deg);
    border-radius: 50%;
}

/* Qty input modern styling */
.qty-input {
    transition: var(--transition);
}
.qty-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}

/* Search result hover animation */
.search-result-item {
    transition: background 0.15s ease, border-left 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.search-result-item:hover {
    padding-left: 18px;
}

/* Print preview modal button focus */
#printPreviewModal .modal-footer .btn:focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px var(--primary-glow);
}

/* Smooth total payable pulsing on change */
@keyframes totalPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}
.total-payable .amount {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add customer button hover */
.btn-add-customer {
    transition: var(--transition);
}
.btn-add-customer:hover {
    transform: scale(1.1) translateY(-1px);
    box-shadow: 0 4px 0 rgba(109, 40, 217, 0.4), 0 6px 16px rgba(124, 58, 237, 0.3);
}
.btn-add-customer:active {
    transform: scale(1) translateY(1px);
    box-shadow: 0 1px 0 rgba(109, 40, 217, 0.4);
}

/* Weighing scale button pulse */
.btn-weighing-scale {
    transition: var(--transition);
}
.btn-weighing-scale:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 rgba(109, 40, 217, 0.5), 0 6px 20px rgba(124, 58, 237, 0.3);
}

/* ========== PRICE INPUT 3D ========== */
.price-input {
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 5px 8px;
    font-weight: 600;
    transition: var(--transition);
    background: var(--bg-white);
}
.price-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}

/* ========== UNIT LABEL ========== */
.unit-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
    text-align: center;
}

/* ========== STOCK BADGE ========== */
.stock-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    display: inline-block;
}
.stock-badge.in-stock {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #059669;
}
.stock-badge.low-stock {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #d97706;
}
.stock-badge.no-stock {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    color: #dc2626;
}

/* ========== 3D HEADER ANIMATION ========== */
/* overflow must stay visible so the sync dropdown (position:absolute) is not clipped */
.pos-header {
    position: relative;
    overflow: visible;
}
.pos-header::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; right: 0; bottom: 0;
    width: 300%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.03) 25%,
        rgba(167,139,250,0.12) 50%,
        rgba(255,255,255,0.03) 75%,
        transparent 100%
    );
    animation: headerShimmer 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
.pos-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent, #a78bfa, #c4b5fd, #8b5cf6, transparent
    );
    animation: headerGlow 4s ease-in-out infinite;
    z-index: 0;
}
.pos-header > * { position: relative; z-index: 1; }

@keyframes headerShimmer {
    0% { transform: translateX(-33%); }
    50% { transform: translateX(0%); }
    100% { transform: translateX(-33%); }
}
@keyframes headerGlow {
    0%, 100% { opacity: 0.4; filter: blur(1px); }
    50% { opacity: 1; filter: blur(0px); }
}

/* ========== MODAL ENTRANCE ANIMATIONS ========== */
@keyframes modalPopIn {
    from { transform: scale(0.85) translateY(30px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes modalSlideRight {
    from { transform: scale(0.88) translateX(50px); opacity: 0; }
    to   { transform: scale(1) translateX(0); opacity: 1; }
}
@keyframes modalFlipIn {
    from { transform: perspective(600px) rotateY(-8deg) scale(0.9); opacity: 0; }
    to   { transform: perspective(600px) rotateY(0deg) scale(1); opacity: 1; }
}
@keyframes modalTiltIn {
    from { transform: perspective(800px) rotateX(6deg) scale(0.9) translateY(30px); opacity: 0; }
    to   { transform: perspective(800px) rotateX(0deg) scale(1) translateY(0); opacity: 1; }
}
@keyframes modalBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Default modal entrance */
.modal-overlay.active {
    animation: modalBackdropIn 0.25s ease;
}
.modal-overlay.active .modal-box,
.modal-overlay.active .pay-modal-modern {
    animation: modalPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========== MODERN BILL VIEW MODAL ========== */
.bill-view-modern {
    width: 480px;
    max-width: 95vw;
    max-height: 92vh;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    animation: bvmSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes bvmSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.bvm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #fff;
    flex-shrink: 0;
}
.bvm-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.bvm-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
}
.bvm-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.bvm-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.bvm-print-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}
.bvm-print-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16,185,129,0.4);
}
.bvm-print-btn:active { transform: scale(0.97); }
.bvm-close-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.bvm-close-btn:hover {
    background: rgba(239,68,68,0.2);
    color: #ef4444;
}
.bvm-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    max-height: calc(92vh - 70px);
}
.bvm-receipt-paper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
    max-width: 460px;
    width: fit-content;
    min-width: 280px;
    margin: 0 auto;
    position: relative;
}
.bvm-receipt-paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa);
}
.bvm-iframe {
    width: 100%;
    min-height: 200px;
    height: auto;
    border: none;
    display: block;
}
.bvm-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 14px;
}
.bvm-error-state {
    text-align: center;
    padding: 50px 20px;
    color: #ef4444;
    font-size: 14px;
}
/* Modern Invoice Card */
.bvm-invoice-card {
    max-width: 440px;
    margin: 0 auto;
}
.bvm-info-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
    background: rgba(99,102,241,0.04);
    border-radius: 12px;
    margin-bottom: 12px;
}
.bvm-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bvm-info-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94a3b8;
}
.bvm-info-value {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}
.bvm-invoice-no {
    color: #6366f1;
    font-size: 15px;
    font-weight: 800;
}
/* Items Table */
.bvm-items-section {
    margin-bottom: 12px;
}
.bvm-items-header {
    display: grid;
    grid-template-columns: 1fr 60px 70px 70px;
    gap: 4px;
    padding: 8px 10px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}
.bvm-ih-qty, .bvm-ih-price, .bvm-ih-total { text-align: right; }
.bvm-item-row {
    display: grid;
    grid-template-columns: 1fr 60px 70px 70px;
    gap: 4px;
    align-items: center;
    padding: 10px 10px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.bvm-item-row:hover { background: rgba(99,102,241,0.03); }
.bvm-item-row:last-child { border-bottom: none; }
.bvm-item-name {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.bvm-item-num {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}
.bvm-item-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}
.bvm-item-title small { color: #94a3b8; font-weight: 500; }
.bvm-item-sku {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 1px;
}
.bvm-item-qty {
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}
.bvm-item-price {
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}
.bvm-old-price {
    color: #cbd5e1;
    font-size: 10px;
    font-weight: 500;
    margin-right: 2px;
}
.bvm-item-total {
    text-align: right;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}
/* Totals */
.bvm-totals-section {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
}
.bvm-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}
.bvm-discount-row { color: #e11d48; }
.bvm-grand-total {
    padding-top: 10px;
    margin-top: 6px;
    border-top: 2px solid #e2e8f0;
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
}
/* Payments */
.bvm-payments-section {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
}
.bvm-pay-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 8px;
}
.bvm-pay-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}
.bvm-change-row { color: #059669; }
/* Savings */
.bvm-savings-badge {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border: 1px solid #86efac;
    border-radius: 10px;
    padding: 10px 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #166534;
}

/* Delivery Order section in bill view */
.bvm-delivery-section {
    border: 1.5px dashed #2d6be4;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: #f0f6ff;
}
.bvm-delivery-header {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: #1a56db;
    margin-bottom: 4px;
}
.bvm-delivery-addr {
    font-size: 12.5px;
    color: #1a2332;
    line-height: 1.5;
}
.bvm-delivery-note {
    font-size: 12px;
    color: #374151;
    margin-top: 4px;
}

/* Sell Return modal — slide from right */
#sellReturnModal.active .modal-box {
    animation: modalSlideRight 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Cashier / Register modals — 3D flip */
#closeRegisterModal.active .modal-box,
#openRegisterModal.active .modal-box {
    animation: modalFlipIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Payment modal — pop with bounce */
#paymentModal.active .pay-modal-modern {
    animation: modalPopIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Expense modal — 3D tilt */
#expenseModal.active .modal-box {
    animation: modalTiltIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#expenseModal .form-input:focus {
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15) !important;
    outline: none;
}

/* ========== RECENT TRANSACTIONS TOGGLE (Sales / Returns) ========== */
.recent-toggle-bar {
    display: flex;
    gap: 0;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 3px;
    margin: 12px 16px 0 16px;
}
.recent-toggle-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: #64748b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.recent-toggle-btn.active {
    background: #fff;
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.recent-toggle-btn:hover:not(.active) {
    color: #334155;
    background: rgba(255,255,255,0.5);
}

/* Recent items slide-in */
.recent-item {
    animation: recentItemSlide 0.3s ease forwards;
    opacity: 0;
}
@keyframes recentItemSlide {
    from { opacity: 0; transform: translateX(-15px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ========== DRAFT FOLD ANIMATION ========== */
@keyframes draftFold {
    0% {
        opacity: 1;
        transform: perspective(800px) rotateX(0deg) scale(1);
        transform-origin: top center;
    }
    40% {
        opacity: 0.8;
        transform: perspective(800px) rotateX(-30deg) scale(0.9);
    }
    70% {
        opacity: 0.4;
        transform: perspective(800px) rotateX(-60deg) scale(0.6) translateY(-50px);
    }
    100% {
        opacity: 0;
        transform: perspective(800px) rotateX(-90deg) scale(0.2) translateY(-120px);
    }
}
.draft-folding {
    animation: draftFold 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

/* ========== CANCEL DESTROY ANIMATION ========== */
@keyframes cancelDestroy {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: blur(0px);
    }
    30% {
        opacity: 0.8;
        transform: scale(1.05) rotate(2deg);
        filter: blur(0px);
    }
    60% {
        opacity: 0.5;
        transform: scale(0.7) rotate(-5deg);
        filter: blur(2px);
    }
    80% {
        opacity: 0.2;
        transform: scale(0.3) rotate(10deg);
        filter: blur(6px);
    }
    100% {
        opacity: 0;
        transform: scale(0) rotate(20deg);
        filter: blur(12px);
    }
}
.cancel-destroying {
    animation: cancelDestroy 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

/* cancel mini-particles */
.cancel-particle {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: particleFly 0.7s ease-out forwards;
}
@keyframes particleFly {
    0% { opacity: 1; transform: scale(1) translate(0, 0); }
    100% { opacity: 0; transform: scale(0) translate(var(--px), var(--py)); }
}

/* Sell return item in Recent list */
.recent-return-item {
    border-left: 3px solid #ef4444 !important;
}

/* ========== PRODUCT SIDEBAR (3D Animated) ========== */
.pos-middle {
    perspective: 1200px;
}
.product-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50%;
    background: var(--bg-white);
    border-left: 1px solid var(--border-color);
    box-shadow: -4px 0 24px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    z-index: 900;
    transform-origin: right center;
    transform: translateX(100%) rotateY(0deg);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.35s ease,
                box-shadow 0.5s ease;
    will-change: transform, opacity;
}
.product-sidebar.open {
    transform: translateX(0) rotateY(0deg);
    opacity: 1;
    box-shadow: -8px 0 40px rgba(124,58,237,0.12), -2px 0 12px rgba(0,0,0,0.06);
}
/* 3D open keyframe animation */
.product-sidebar.psb-animating-in {
    animation: psbSwingIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes psbSwingIn {
    0%   { transform: translateX(60%) rotateY(-35deg) scale(0.85); opacity: 0; box-shadow: none; }
    40%  { transform: translateX(5%) rotateY(8deg) scale(1.01); opacity: 0.9; }
    70%  { transform: translateX(-1%) rotateY(-3deg) scale(1); opacity: 1; }
    100% { transform: translateX(0) rotateY(0deg) scale(1); opacity: 1;
           box-shadow: -8px 0 40px rgba(124,58,237,0.12), -2px 0 12px rgba(0,0,0,0.06); }
}
/* 3D close keyframe animation */
.product-sidebar.psb-animating-out {
    animation: psbSwingOut 0.4s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}
@keyframes psbSwingOut {
    0%   { transform: translateX(0) rotateY(0deg) scale(1); opacity: 1;
           box-shadow: -8px 0 40px rgba(124,58,237,0.12); }
    40%  { transform: translateX(10%) rotateY(-12deg) scale(0.96); opacity: 0.7; }
    100% { transform: translateX(70%) rotateY(-30deg) scale(0.8); opacity: 0;
           box-shadow: none; }
}

/* Staggered content entrance when sidebar opens */
.product-sidebar.open .psb-header    { animation: psbContentSlideIn 0.4s 0.1s both; }
.product-sidebar.open .psb-filters   { animation: psbContentSlideIn 0.4s 0.18s both; }
.product-sidebar.open .psb-body      { animation: psbContentSlideIn 0.4s 0.26s both; }
@keyframes psbContentSlideIn {
    0%   { opacity: 0; transform: translateY(12px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Sidebar backdrop glow on .pos-middle */
.pos-middle.sidebar-open::after {
    content: '';
    position: absolute;
    top: 0; right: 50%; bottom: 0; width: 30px;
    background: linear-gradient(90deg, transparent, rgba(124,58,237,0.04));
    pointer-events: none;
    z-index: 899;
    animation: psbGlowPulse 2s ease-in-out infinite alternate;
}
@keyframes psbGlowPulse {
    0%   { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Push cart content left when sidebar is open */
.pos-middle.sidebar-open .pos-content {
    margin-right: 50%;
    transition: margin-right 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Sidebar header */
.psb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
    color: #fff;
    flex-shrink: 0;
}
.psb-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.3px;
}
.psb-close {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: none;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.psb-close:hover {
    background: #ef4444;
    color: #fff;
}

/* Filters area */
.psb-filters {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.psb-filter-tabs {
    display: flex;
    gap: 3px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    padding: 2px;
}
.psb-tab {
    flex: 1;
    padding: 6px 6px;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
    transition: all 0.15s;
    text-align: center;
}
.psb-tab:hover { color: var(--text-medium); background: rgba(124,58,237,0.06); }
.psb-tab.active {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    box-shadow: 0 2px 6px rgba(124,58,237,0.25);
}
.psb-filter-select {
    width: 100%;
    padding: 6px 9px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-white);
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.15s;
}
.psb-filter-select:focus { border-color: var(--primary); }

/* Searchable filter list */
.psb-filter-search-wrap {
    position: relative;
    margin-bottom: 6px;
}
.psb-filter-search {
    width: 100%;
    padding: 7px 10px 7px 30px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-white);
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.15s;
}
.psb-filter-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}
.psb-filter-search::placeholder { color: var(--text-muted); }
.psb-filter-search-icon {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    pointer-events: none;
    opacity: 0.55;
}
.psb-filter-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 0;
    scrollbar-width: thin;
}
.psb-filter-list::-webkit-scrollbar { width: 4px; }
.psb-filter-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
.psb-filter-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 4px;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-white);
    cursor: pointer;
    transition: all 0.18s ease;
    min-height: 56px;
}
.psb-filter-card:hover {
    border-color: var(--primary-light);
    background: rgba(124,58,237,0.04);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.psb-filter-card.active {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 3px 12px rgba(124,58,237,0.35);
}
.psb-filter-card.active .psb-card-count {
    background: rgba(255,255,255,0.25);
    color: #fff;
}
.psb-card-label {
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    margin-bottom: 4px;
}
.psb-card-count {
    font-size: 11px;
    font-weight: 800;
    background: rgba(124,58,237,0.1);
    color: var(--primary);
    padding: 2px 9px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
}
.psb-card-bottom {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}
.psb-card-arrow {
    font-size: 12px;
    color: var(--primary);
    font-weight: 700;
}
.psb-filter-card.active .psb-card-arrow { color: #fff; }
.psb-back-card {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0) !important;
    border-color: var(--border-color) !important;
    min-height: 40px !important;
}
.psb-back-card .psb-card-label {
    font-size: 11px;
    color: var(--text-medium);
}
.psb-back-card:hover {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1) !important;
}
.psb-search-input {
    width: 100%;
    padding: 7px 10px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--bg-white);
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.15s;
}
.psb-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}
.psb-search-input::placeholder { color: var(--text-muted); }

/* Body / scrollable grid */
.psb-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
.psb-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

/* Product card */
.psb-card {
    background: var(--bg-white);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
}
.psb-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(124,58,237,0.1);
}
.psb-card:active { transform: scale(0.97); }
.psb-card.out-of-stock {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
.psb-card.out-of-stock .psb-card-img { filter: grayscale(0.7); }

.psb-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--bg-light);
    display: block;
    flex-shrink: 0;
}
.psb-card-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.psb-card-info {
    padding: 4px 5px 5px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.psb-card-name {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.psb-card-sku {
    font-size: 8px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.psb-card-prices {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 2px;
}
.psb-card-price {
    font-size: 11px;
    font-weight: 800;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}
.psb-card-mrp {
    font-size: 9px;
    font-weight: 600;
    color: #059669;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.psb-card-stock-row {
    margin-top: auto;
    padding-top: 2px;
}
.psb-card-stock {
    font-size: 8px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    display: inline-block;
}
.psb-stock-ok { color: #059669; background: rgba(16,185,129,0.1); }
.psb-stock-low { color: #d97706; background: rgba(245,158,11,0.1); }
.psb-stock-out { color: #dc2626; background: rgba(239,68,68,0.1); }

/* Loading / Empty / Error states */
.psb-loading, .psb-empty, .psb-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    gap: 10px;
}
.psb-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: psbSpin 0.8s linear infinite;
}
@keyframes psbSpin { to { transform: rotate(360deg); } }
.psb-retry-btn {
    margin-top: 8px;
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.psb-retry-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(124,58,237,0.3); }

/* Floating toggle button (3D animated) */
.psb-toggle-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 56px;
    border: none;
    border-radius: 10px 0 0 10px;
    background: linear-gradient(180deg, #7c3aed, #6d28d9);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    z-index: 901;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: -2px 0 10px rgba(124,58,237,0.25);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.psb-toggle-btn:hover {
    width: 38px;
    box-shadow: -4px 0 20px rgba(124,58,237,0.5);
    background: linear-gradient(180deg, #8b5cf6, #7c3aed);
}
.psb-toggle-btn:active {
    transform: translateY(-50%) scale(0.9);
}
.psb-toggle-btn.sidebar-active {
    right: 50%;
}
/* Toggle icon 3D flip */
.psb-toggle-icon {
    display: inline-block;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.psb-toggle-btn.sidebar-active .psb-toggle-icon {
    transform: rotate(180deg) scale(1.1);
}
/* Pulse ring on toggle activation */
.psb-toggle-btn.psb-pulse::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 14px 0 0 14px;
    border: 2px solid rgba(124,58,237,0.6);
    animation: psbTogglePulse 0.6s ease-out forwards;
    pointer-events: none;
}
@keyframes psbTogglePulse {
    0%   { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Card add animation */
.psb-card.added {
    animation: psbCardAdded 0.4s ease;
}
@keyframes psbCardAdded {
    0% { transform: scale(1); }
    30% { transform: scale(0.93); border-color: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,0.3); }
    100% { transform: scale(1); }
}

/* ========== SHOPPING BAG QUICK BUTTONS ========== */
.bag-quick-btns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.bag-quick-btn {
    padding: 12px 8px;
    border: 2px solid rgba(118, 75, 162, 0.2);
    border-radius: 12px;
    background: linear-gradient(135deg, #f5f0ff, #ede5ff);
    color: #5b2d8e;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    box-shadow: 0 2px 0 rgba(91, 45, 142, 0.15), 0 2px 8px rgba(91, 45, 142, 0.08);
}
.bag-quick-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(118, 75, 162, 0.5);
    box-shadow: 0 4px 0 rgba(91, 45, 142, 0.15), 0 6px 16px rgba(91, 45, 142, 0.15);
    background: linear-gradient(135deg, #ede5ff, #ddd0ff);
}
.bag-quick-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(91, 45, 142, 0.15);
}
.bag-quick-btn.active {
    background: linear-gradient(135deg, #764ba2, #5b2d8e);
    color: #fff;
    border-color: #764ba2;
    box-shadow: 0 3px 0 #4a1d73, 0 4px 14px rgba(91, 45, 142, 0.35);
    transform: scale(1.04);
}

/* Dark mode bag buttons */
body.dark-mode .bag-quick-btn {
    background: linear-gradient(135deg, rgba(118,75,162,0.15), rgba(91,45,142,0.1));
    border-color: rgba(118,75,162,0.25);
    color: #c4b5fd;
}
body.dark-mode .bag-quick-btn:hover {
    background: linear-gradient(135deg, rgba(118,75,162,0.25), rgba(91,45,142,0.18));
    border-color: rgba(118,75,162,0.5);
}
body.dark-mode .bag-quick-btn.active {
    background: linear-gradient(135deg, #764ba2, #5b2d8e);
    color: #fff;
    border-color: #764ba2;
}

/* ========== DARK MODE ========== */
body.dark-mode {
    --text-dark: #e2e8f0;
    --text-medium: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: rgba(148, 163, 184, 0.12);
    --bg-light: #0f172a;
    --bg-white: #1e293b;
    --bg-glass: rgba(30, 41, 59, 0.85);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.15);
    --shadow: 0 4px 16px rgba(0,0,0,0.25), 0 1px 3px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.2);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.4), 0 4px 10px rgba(0,0,0,0.25);

    color: #e2e8f0;
    background: #0f172a;
    background-image:
        radial-gradient(at 20% 80%, rgba(124, 58, 237, 0.06) 0%, transparent 50%),
        radial-gradient(at 80% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);
}

/* Header — already dark, just subtle tweak */
body.dark-mode .pos-header {
    box-shadow: 0 4px 20px rgba(0,0,0,0.6), 0 2px 4px rgba(0,0,0,0.4);
}

/* Topbar */
body.dark-mode .pos-topbar {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.1);
}

/* Customer search */
body.dark-mode .customer-search-input,
body.dark-mode .search-input,
body.dark-mode .qty-input {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.15);
}
body.dark-mode .customer-search-input:focus,
body.dark-mode .search-input:focus,
body.dark-mode .qty-input:focus {
    background: #0f172a;
}
body.dark-mode .customer-search-input::placeholder,
body.dark-mode .search-input::placeholder {
    color: #64748b;
}

/* Customer / Search dropdowns */
body.dark-mode .customer-dropdown,
body.dark-mode .search-results {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.1);
}
body.dark-mode .customer-dropdown-item:hover,
body.dark-mode .customer-dropdown-item.highlighted {
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(79,70,229,0.1));
}
body.dark-mode .customer-dropdown-item .cust-name {
    color: #e2e8f0;
}
body.dark-mode .customer-dropdown-item .cust-detail {
    color: #94a3b8;
}
body.dark-mode .search-result-item:hover,
body.dark-mode .search-result-item.highlighted {
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(79,70,229,0.08));
}
body.dark-mode .search-result-item .product-name { color: #e2e8f0; }
body.dark-mode .search-result-item.exact-match {
    background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(5,150,105,0.08));
}
body.dark-mode .search-result-item.exact-match:hover {
    background: linear-gradient(135deg, rgba(16,185,129,0.18), rgba(5,150,105,0.12));
}

/* POS Table */
body.dark-mode .pos-table-container {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.1);
}
body.dark-mode .pos-table thead {
    background: linear-gradient(180deg, #1e293b, #172033);
}
body.dark-mode .pos-table th {
    color: #94a3b8;
    border-bottom-color: rgba(148, 163, 184, 0.1);
}
body.dark-mode .pos-table td {
    border-bottom-color: rgba(148, 163, 184, 0.06);
    color: #e2e8f0;
}
body.dark-mode .pos-table tbody tr:hover { background: rgba(99,102,241,0.06); }

/* Empty cart */
body.dark-mode .empty-cart-text { color: #94a3b8; }
body.dark-mode .empty-cart-hint { color: #64748b; }
body.dark-mode .empty-cart-hint kbd {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
    color: #94a3b8;
    box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}

/* Empty cart dark mode */
body.dark-mode .empty-cart-badge        { background: rgba(15,12,40,0.82); border-color: rgba(99,102,241,0.28); }
body.dark-mode .empty-cart-badge:hover  { background: rgba(25,18,60,0.92); border-color: rgba(99,102,241,0.45); }
body.dark-mode .empty-cart-text         { color: #a5b4fc; }
body.dark-mode .empty-cart-video        { opacity: 0.22; }

/* Totals section */
body.dark-mode .pos-totals {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.1);
}
body.dark-mode .totals-left .total-item {
    background: rgba(15, 23, 42, 0.6);
}
body.dark-mode .totals-left .total-label { color: #94a3b8; }
body.dark-mode .totals-left .total-value { color: #e2e8f0; }
body.dark-mode .total-payable .label { color: #94a3b8; }
body.dark-mode .total-payable .amount {
    color: #34d399;
    background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(5,150,105,0.08));
    border-color: rgba(16, 185, 129, 0.25);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.15);
}

/* Billing controls (discount, bags, bank fee) */
body.dark-mode .discount-ctrl {
    background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(109,40,217,0.1));
    color: #a78bfa;
    border-color: rgba(124,58,237,0.25);
}
body.dark-mode .discount-ctrl:hover {
    background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(109,40,217,0.15));
}
body.dark-mode .bankfee-ctrl {
    background: linear-gradient(135deg, rgba(234,88,12,0.12), rgba(194,65,12,0.08));
    color: #fb923c;
    border-color: rgba(234,88,12,0.25);
}
body.dark-mode .bankfee-ctrl:hover {
    background: linear-gradient(135deg, rgba(234,88,12,0.18), rgba(194,65,12,0.12));
}
body.dark-mode .bags-ctrl {
    background: linear-gradient(135deg, rgba(13,148,136,0.12), rgba(15,118,110,0.08));
    color: #2dd4bf;
    border-color: rgba(13,148,136,0.25);
}
body.dark-mode .bags-ctrl:hover {
    background: linear-gradient(135deg, rgba(13,148,136,0.18), rgba(15,118,110,0.12));
}

/* Modals (generic) */
body.dark-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.65);
}
body.dark-mode .modal-box {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.1);
}
body.dark-mode .modal-header {
    border-bottom-color: rgba(148, 163, 184, 0.1);
    background: linear-gradient(180deg, rgba(30,41,59,0.9), rgba(30,41,59,0));
}
body.dark-mode .modal-header h3 { color: #e2e8f0; }
body.dark-mode .modal-close {
    background: rgba(255,255,255,0.06);
    color: #94a3b8;
}
body.dark-mode .modal-footer {
    border-top-color: rgba(148, 163, 184, 0.1);
    background: linear-gradient(180deg, rgba(30,41,59,0), rgba(15,23,42,0.5));
}

/* Add Contact modal */
body.dark-mode .contact-card {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(148, 163, 184, 0.1);
}
body.dark-mode .contact-card-title { color: #a78bfa; }
body.dark-mode .contact-input {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
}
body.dark-mode .contact-input:focus {
    background: #0f172a;
}
body.dark-mode .contact-input::placeholder { color: #4b5563; }
body.dark-mode .contact-modal-footer {
    background: #1e293b;
    border-top-color: rgba(148, 163, 184, 0.1);
}

/* Payment modal */
body.dark-mode .pay-modal-modern {
    box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
}
body.dark-mode .pay-modal-body {
    background: #0f172a;
}
body.dark-mode .pay-modal-left {
    background: #1e293b;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
body.dark-mode .pay-advance-badge {
    background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(96,165,250,0.08));
    border-color: rgba(59,130,246,0.3);
    color: #93c5fd;
}

/* Payment rows + inputs */
body.dark-mode .pay-row {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.1);
}
body.dark-mode .pay-method-label { color: #e2e8f0; }
body.dark-mode .pay-input,
body.dark-mode .pay-amount-input,
body.dark-mode .pay-ref-input,
body.dark-mode .pay-note-input {
    background: rgba(15, 23, 42, 0.6);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.15);
}
body.dark-mode .pay-input:focus,
body.dark-mode .pay-amount-input:focus,
body.dark-mode .pay-ref-input:focus,
body.dark-mode .pay-note-input:focus {
    background: rgba(15, 23, 42, 0.8);
}

/* Payment footer / summary */
body.dark-mode .pay-modal-footer {
    background: #1e293b;
    border-top-color: rgba(148, 163, 184, 0.1);
}
body.dark-mode .pay-summary-label { color: #94a3b8; }
body.dark-mode .pay-summary-value { color: #e2e8f0; }

/* Numpad panel */
body.dark-mode .numpad-panel {
    background: #1e293b;
    border-left-color: rgba(148, 163, 184, 0.1);
}
body.dark-mode .numpad-btn {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.1);
}
body.dark-mode .numpad-btn:hover {
    background: rgba(99,102,241,0.12);
}

/* Denomination panel */
body.dark-mode .denom-panel {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.1);
}
body.dark-mode .denom-chip {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.1);
    color: #e2e8f0;
}
body.dark-mode .denom-chip:hover {
    background: rgba(99,102,241,0.1);
    border-color: rgba(99,102,241,0.3);
}

/* Settings modal */
body.dark-mode .settings-tab {
    color: #94a3b8;
}
body.dark-mode .settings-tab:hover {
    color: #e2e8f0;
    background: rgba(99, 102, 241, 0.08);
}
body.dark-mode .settings-tab.active {
    color: #a5b4fc;
    border-bottom-color: #818cf8;
    background: rgba(99, 102, 241, 0.12);
}
body.dark-mode .settings-label { color: #94a3b8; }
body.dark-mode .settings-value { color: #e2e8f0; }
body.dark-mode .settings-select {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.15);
}
body.dark-mode .settings-select:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Display mode cards */
body.dark-mode .display-mode-inner {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.1);
    color: #e2e8f0;
}
body.dark-mode .display-mode-inner:hover {
    border-color: rgba(99,102,241,0.3);
    background: rgba(15,23,42,0.8);
}
body.dark-mode .display-mode-card input[type="radio"]:checked + .display-mode-inner {
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(79,70,229,0.1));
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* Shortcut guide modal */
body.dark-mode .shortcut-guide-modal {
    background: #1e293b;
    color: #e2e8f0;
}
body.dark-mode .sg-card {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.1);
}

/* Price group dropdown */
body.dark-mode .price-group-dropdown {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.1);
}
body.dark-mode .price-group-option {
    color: #e2e8f0;
}
body.dark-mode .price-group-option:hover {
    background: rgba(99,102,241,0.1);
}

/* Return modal */
body.dark-mode .return-items-list {
    background: #0f172a;
}
body.dark-mode .return-item-card {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.1);
    color: #e2e8f0;
}

/* Recent transactions */
body.dark-mode .recent-tx-item {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.1);
}
body.dark-mode .recent-tx-item:hover {
    background: rgba(99,102,241,0.06);
}

/* Scrollbar dark */
body.dark-mode ::-webkit-scrollbar { width: 6px; }
body.dark-mode ::-webkit-scrollbar-track { background: #0f172a; }
body.dark-mode ::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
body.dark-mode ::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Dark mode transition (smooth) */
body.dark-mode,
body.dark-mode .pos-topbar,
body.dark-mode .pos-table-container,
body.dark-mode .pos-totals,
body.dark-mode .modal-box,
body.dark-mode .pay-modal-body,
body.dark-mode .pay-modal-left,
body.dark-mode .product-sidebar {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ========== DARK MODE: PRODUCT SIDEBAR ========== */
body.dark-mode .product-sidebar {
    background: #1e293b;
    border-left-color: rgba(148, 163, 184, 0.1);
    box-shadow: -4px 0 24px rgba(0,0,0,0.3);
}
body.dark-mode .product-sidebar.open {
    box-shadow: -8px 0 40px rgba(124,58,237,0.18), -2px 0 12px rgba(0,0,0,0.25);
}
body.dark-mode .pos-middle.sidebar-open::after {
    background: linear-gradient(90deg, transparent, rgba(124,58,237,0.06));
}
body.dark-mode .psb-filters {
    border-bottom-color: rgba(148, 163, 184, 0.1);
}
body.dark-mode .psb-filter-tabs {
    background: #0f172a;
}
body.dark-mode .psb-tab {
    color: #94a3b8;
}
body.dark-mode .psb-tab:hover { color: #e2e8f0; background: rgba(124,58,237,0.1); }
body.dark-mode .psb-filter-select,
body.dark-mode .psb-search-input,
body.dark-mode .psb-filter-search {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.15);
}
body.dark-mode .psb-search-input::placeholder,
body.dark-mode .psb-filter-search::placeholder { color: #64748b; }
body.dark-mode .psb-filter-card {
    background: #0f172a;
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.15);
}
body.dark-mode .psb-filter-card:hover {
    border-color: rgba(124,58,237,0.4);
    background: rgba(124,58,237,0.1);
}
body.dark-mode .psb-filter-card.active {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    border-color: transparent;
}
body.dark-mode .psb-card-count {
    background: rgba(124,58,237,0.2);
    color: #a78bfa;
}
body.dark-mode .psb-filter-card.active .psb-card-count {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
body.dark-mode .psb-filter-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
body.dark-mode .psb-back-card {
    background: linear-gradient(135deg, #1e293b, #0f172a) !important;
    border-color: rgba(148, 163, 184, 0.15) !important;
}
body.dark-mode .psb-back-card .psb-card-label { color: #94a3b8; }
body.dark-mode .psb-back-card:hover { background: linear-gradient(135deg, #334155, #1e293b) !important; }
body.dark-mode .psb-card-arrow { color: #a78bfa; }
/* Bill View Modal dark mode */
body.dark-mode .bill-view-modern { background: #1e293b; box-shadow: 0 25px 60px rgba(0,0,0,0.5); }
body.dark-mode .bvm-body { background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%); }
body.dark-mode .bvm-receipt-paper { background: #1e293b; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
/* Bill view invoice dark mode */
body.dark-mode .bvm-info-bar { background: rgba(99,102,241,0.08); }
body.dark-mode .bvm-info-value { color: #e2e8f0; }
body.dark-mode .bvm-invoice-no { color: #a5b4fc; }
body.dark-mode .bvm-items-header { background: #0f172a; color: #64748b; }
body.dark-mode .bvm-item-row { border-bottom-color: rgba(148,163,184,0.08); }
body.dark-mode .bvm-item-row:hover { background: rgba(99,102,241,0.06); }
body.dark-mode .bvm-item-title { color: #e2e8f0; }
body.dark-mode .bvm-item-total { color: #e2e8f0; }
body.dark-mode .bvm-totals-section, body.dark-mode .bvm-payments-section { background: #0f172a; }
body.dark-mode .bvm-total-row { color: #94a3b8; }
body.dark-mode .bvm-grand-total { color: #f1f5f9; border-top-color: rgba(148,163,184,0.15); }
body.dark-mode .bvm-savings-badge { background: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(5,150,105,0.1)); border-color: rgba(16,185,129,0.3); color: #34d399; }
body.dark-mode .psb-card {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.1);
}
body.dark-mode .psb-card:hover {
    border-color: rgba(124,58,237,0.4);
    box-shadow: 0 4px 14px rgba(124,58,237,0.15);
}
body.dark-mode .psb-card-placeholder {
    background: linear-gradient(135deg, #1e293b, #0f172a);
}
body.dark-mode .psb-card-name { color: #e2e8f0; }
body.dark-mode .psb-card-sku { color: #64748b; }

/* ========== CREDIT INVOICES MODAL ========== */
.cred-modal {
    width: 900px;
    max-width: 96vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border-radius: 14px;
}
.cred-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
    flex-shrink: 0;
}
.cred-modal-title-row { display: flex; align-items: center; gap: 12px; }
.cred-modal-icon { font-size: 24px; line-height: 1; }
.cred-modal-title { font-size: 16px; font-weight: 700; letter-spacing: 0.2px; }
.cred-modal-subtitle { font-size: 11px; opacity: 0.8; margin-top: 2px; }
.cred-modal-close {
    background: rgba(255,255,255,0.15);
    border: none; color: #fff; font-size: 16px; font-weight: 700;
    width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.cred-modal-close:hover { background: rgba(255,255,255,0.25); }

.cred-summary-bar {
    display: flex; gap: 0; flex-shrink: 0;
    background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.cred-summary-item {
    flex: 1; padding: 10px 18px;
    display: flex; flex-direction: column; gap: 2px;
    border-right: 1px solid #e2e8f0;
}
.cred-summary-item:last-child { border-right: none; }
.cred-summary-label { font-size: 10px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; }
.cred-summary-val { font-size: 15px; font-weight: 700; color: #1e293b; }
.cred-due-total { color: #dc2626; }
.cred-sel-total { color: #059669; }

.cred-table-wrap {
    flex: 1; overflow-y: auto; min-height: 0;
    padding: 0;
}
.cred-loading {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; padding: 48px; color: #6b7280; font-size: 13px;
}
.cred-spinner {
    width: 22px; height: 22px;
    border: 3px solid #e2e8f0; border-top-color: #7c3aed;
    border-radius: 50%; animation: credSpin 0.7s linear infinite;
}
@keyframes credSpin { to { transform: rotate(360deg); } }
.cred-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 48px; text-align: center;
}
.cred-table {
    width: 100%; border-collapse: collapse; font-size: 12.5px;
}
.cred-table thead tr {
    background: #f1f5f9; position: sticky; top: 0; z-index: 2;
}
.cred-table th {
    padding: 9px 12px; text-align: left; font-size: 11px;
    font-weight: 700; color: #475569; text-transform: uppercase;
    letter-spacing: 0.4px; border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.cred-col-right { text-align: right !important; }
.cred-col-center { text-align: center !important; }
.cred-col-due { color: #dc2626 !important; }
.cred-th-check { width: 36px; text-align: center !important; }
.cred-table td {
    padding: 9px 12px; border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.cred-table tbody tr:hover { background: #f8fafc; }
.cred-table tbody tr.cred-row-selected { background: #fef9ff; }
.cred-td-check { text-align: center; }
.cred-td-check input[type="checkbox"] { width: 15px; height: 15px; accent-color: #7c3aed; cursor: pointer; }
.cred-invoice-no { font-weight: 700; color: #4f46e5; }
.cred-date { color: #6b7280; }
.cred-amount { text-align: right; font-weight: 600; }
.cred-amount-due { text-align: right; font-weight: 700; color: #dc2626; }
.cred-row-num { color: #9ca3af; font-size: 11px; }

.cred-btn-view {
    padding: 4px 12px; border-radius: 6px; font-size: 11px; font-weight: 700;
    border: 2px solid rgba(79,70,229,0.3); background: transparent; color: #4f46e5;
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.cred-btn-view:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-color: transparent; color: #fff;
    box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}

.cred-modal-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 22px; background: #f8fafc;
    border-top: 1px solid #e2e8f0; flex-shrink: 0; gap: 10px;
}
.cred-footer-left { display: flex; gap: 8px; }
.cred-btn {
    padding: 8px 18px; border-radius: 8px; font-size: 12px; font-weight: 700;
    cursor: pointer; border: 2px solid transparent; transition: all 0.15s; white-space: nowrap;
}
.cred-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cred-btn-print-all {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff; box-shadow: 0 2px 6px rgba(5,150,105,0.3);
}
.cred-btn-print-all:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(5,150,105,0.4); transform: translateY(-1px);
}
.cred-btn-print-sel {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff; box-shadow: 0 2px 6px rgba(79,70,229,0.3);
}
.cred-btn-print-sel:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(79,70,229,0.4); transform: translateY(-1px);
}
.cred-btn-print-one {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff; padding: 6px 14px; font-size: 12px; font-weight: 700;
    border: none; border-radius: 7px; cursor: pointer;
    box-shadow: 0 2px 6px rgba(5,150,105,0.3); transition: all 0.15s;
}
.cred-btn-print-one:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(5,150,105,0.4); }
.cred-btn-close {
    background: #f1f5f9; color: #475569; border-color: #e2e8f0;
}
.cred-btn-close:hover { background: #e2e8f0; }

/* Receipt Viewer Modal */
.cred-receipt-modal {
    width: 680px;
    max-width: 94vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
}
.cred-receipt-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; background: #1e1b4b; color: #fff; flex-shrink: 0;
}
.cred-receipt-title { font-size: 14px; font-weight: 700; }
.cred-receipt-actions { display: flex; align-items: center; gap: 10px; }
.cred-receipt-close {
    background: rgba(255,255,255,0.12); border: none; color: #fff;
    width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
    font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.cred-receipt-close:hover { background: rgba(255,255,255,0.22); }
.cred-receipt-body {
    flex: 1; overflow-y: auto; background: #fff; padding: 16px;
}
/* Print list separator */
.cred-print-separator {
    border: none; border-top: 2px dashed #aaa;
    margin: 20px 0; page-break-after: always;
}

/* ========== ACCOUNT-SCOPED LOCATION + RESPONSIVE HEADER ========== */
:root {
    --pos-header-height: 56px;
}

.pos-header {
    position: fixed;
    height: auto;
    min-height: 56px;
    gap: clamp(6px, 1vw, 14px);
    padding: 6px clamp(10px, 1.4vw, 20px);
}

.pos-header .brand {
    flex: 0 0 auto;
    margin-right: 0;
}

.pos-header .location-info {
    flex: 1 1 320px;
    min-width: 0;
    margin-right: 0;
}

.location-dropdown {
    width: auto;
    min-width: 110px;
    max-width: min(240px, 22vw);
    text-overflow: ellipsis;
}

.pos-header .header-actions {
    flex: 0 1 auto;
    min-width: 0;
    gap: clamp(4px, 0.55vw, 8px);
}

.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 36px;
}

.header-btn-icon {
    flex: 0 0 auto;
}

.pos-main {
    top: var(--pos-header-height);
}

.settings-location-save-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.settings-location-save-row .settings-select {
    min-width: 0;
    flex: 1 1 auto;
}

.settings-location-save-btn {
    flex: 0 0 auto;
    border: 0;
    border-radius: 8px;
    padding: 0 16px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.settings-help {
    margin-top: 6px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.4;
}

@media (max-width: 1480px) {
    .pos-header .header-actions .header-btn-label {
        display: none;
    }

    .pos-header .header-actions .header-btn {
        padding-left: 9px;
        padding-right: 9px;
    }

    .pos-header .sync-status {
        min-width: 0;
        padding-left: 10px;
        padding-right: 10px;
    }

    .datetime-display {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 1050px) {
    .pos-header {
        flex-wrap: wrap;
        align-content: center;
    }

    .pos-header .location-info {
        flex: 1 1 420px;
    }

    .pos-header .header-actions {
        flex: 1 0 100%;
        justify-content: flex-end;
    }

    .location-dropdown {
        max-width: 34vw;
    }
}

@media (max-width: 720px) {
    .pos-header .brand {
        display: none;
    }

    .pos-header .location-info {
        flex-basis: 100%;
        justify-content: space-between;
    }

    .pos-header .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .datetime-display {
        padding: 4px 8px;
    }

    .dt-date,
    .dt-sep {
        display: none;
    }

    .location-dropdown {
        flex: 1 1 auto;
        max-width: none;
    }
}

/* ========== RESPONSIVE PRODUCT CATALOG WORKSPACE ========== */
/*
 * The drawer used to reserve a hard 50% of the viewport. Its remaining cart
 * area was therefore much narrower than the viewport media queries expected,
 * leaving the top search controls and totals underneath the drawer. Keep one
 * shared width for the drawer, cart offset, glow and toggle, and make controls
 * wrap according to the actual remaining workspace while the drawer is open.
 */
.pos-middle {
    --product-sidebar-width: clamp(420px, 44vw, 760px);
}

.product-sidebar {
    width: var(--product-sidebar-width);
    max-width: 100%;
}

.pos-middle.sidebar-open .pos-content {
    margin-right: var(--product-sidebar-width);
    min-width: 0;
}

.pos-middle.sidebar-open::after {
    right: var(--product-sidebar-width);
}

.psb-toggle-btn.sidebar-active {
    right: var(--product-sidebar-width);
}

.pos-middle.sidebar-open .pos-topbar {
    flex-wrap: wrap;
    align-items: stretch;
}

.pos-middle.sidebar-open .customer-section {
    flex: 1 1 290px;
    min-width: 250px;
}

.pos-middle.sidebar-open .price-group-section {
    order: 0;
    width: auto;
    flex: 0 1 auto;
    min-width: 0;
}

.pos-middle.sidebar-open .price-group-select,
.pos-middle.sidebar-open .customer-search-wrapper,
.pos-middle.sidebar-open .search-section,
.pos-middle.sidebar-open .search-input {
    min-width: 0;
}

.pos-middle.sidebar-open .search-section {
    flex: 1 1 340px;
}

.pos-middle.sidebar-open .pos-totals,
.pos-middle.sidebar-open .totals-left {
    flex-wrap: wrap;
    min-width: 0;
}

.pos-middle.sidebar-open .pos-table,
.pos-middle.sidebar-open .pos-table-container {
    width: 100%;
    min-width: 0;
}

.pos-middle.sidebar-open .ec-brand-center,
.pos-middle.sidebar-open .ec-text-block,
.pos-middle.sidebar-open .ec-brand-name {
    max-width: 100%;
}

.pos-middle.sidebar-open .ec-brand-name {
    flex-wrap: wrap;
    justify-content: center;
}

.pos-middle.sidebar-open .ec-keen,
.pos-middle.sidebar-open .ec-systems {
    font-size: clamp(24px, 3vw, 42px);
}

.psb-grid {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
}

@media (max-width: 1100px) {
    .pos-middle {
        --product-sidebar-width: min(92vw, 560px);
    }

    .pos-middle.sidebar-open .pos-content {
        margin-right: 0;
    }

    .pos-middle.sidebar-open::after {
        top: 0;
        right: var(--product-sidebar-width);
        bottom: 0;
        left: 0;
        width: auto;
        background: rgba(15, 23, 42, 0.22);
        animation: none;
    }
}

@media (max-width: 640px) {
    .pos-middle {
        --product-sidebar-width: 100%;
    }

    .psb-toggle-btn.sidebar-active {
        opacity: 0;
        pointer-events: none;
    }

    .psb-grid {
        grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    }
}

