/* --- CORE THEME --- */
        :root {
            --bg-dark: #121212; --card-bg: #1E1E1E; --panel-bg: #222222; 
            --input-bg: #383838; --border-color: #434343; 
            --text-primary: #E0E0E0; --text-secondary: #9E9E9E;
            --orange-accent: #ff9200; --danger-color: #ff5252; --success-color: #4caf50;
        }
        * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; outline: none; }
        body { 
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
            margin: 0; background-color: var(--bg-dark); color: var(--text-primary); 
            height: 100vh; overflow: hidden; display: flex; flex-direction: column;
            overscroll-behavior: none; touch-action: pan-x pan-y;
        }
        input, textarea, select { -webkit-user-select: text; user-select: text; }

        /* --- SCROLLBARS --- */
        ::-webkit-scrollbar { width: 5px; height: 5px; }
        ::-webkit-scrollbar-track { background: var(--bg-dark); }
        ::-webkit-scrollbar-thumb { background: var(--orange-accent); border-radius: 10px; }
        
        .grid-list, .sheet-scroll-content, .pay-section, #history-list {
            scrollbar-width: thin;
            scrollbar-color: var(--orange-accent) var(--bg-dark);
        }

        /* --- UTILS --- */
        .hidden { display: none !important; }
        .full-screen-view {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%;
            background: var(--bg-dark); z-index: 10; display: flex; flex-direction: column;
            transition: opacity 0.3s ease;
        }

        /* --- OPTIMIZED ANIMATIONS --- */
        @keyframes fadeInUp {
            0% { opacity: 0; transform: translateY(15px); }
            100% { opacity: 1; transform: translateY(0); }
        }
        @keyframes popBadge {
            0% { transform: scale(1); }
            50% { transform: scale(1.4); }
            100% { transform: scale(1); }
        }
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        
        /* --- SIDEBAR STYLES --- */
        .sidebar-overlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.7); z-index: 900; opacity: 0;
            pointer-events: none; transition: opacity 0.3s ease;
            backdrop-filter: blur(4px);
        }
        .sidebar-overlay.active {
            opacity: 1; pointer-events: auto;
        }
        .sidebar-menu {
            position: fixed; top: 0; left: 0; width: 280px; height: 100%;
            background: #1e1e1e; z-index: 901;
            transform: translateX(-100%);
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            border-right: 1px solid #434343; display: flex; flex-direction: column;
            box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
        }
        .sidebar-menu.active {
            transform: translateX(0);
        }
        .nav-item {
            display: flex; align-items: center; gap: 12px; padding: 12px 20px;
            color: #9e9e9e; transition: 0.2s; border-radius: 0 25px 25px 0;
            margin-right: 10px; cursor: pointer; font-weight: 500; font-size: 14px;
        }
        .nav-item:hover {
            background: rgba(255, 146, 0, 0.1); color: #ff9200;
        }
        .nav-item.active {
            background: rgba(255, 146, 0, 0.2); color: #ff9200;
            font-weight: bold; border-left: 3px solid #ff9200;
        }
        .nav-item i {
            width: 20px; text-align: center;
        }
        
        /* --- HEADER --- */
        .app-header {
            background-color: var(--card-bg); 
            padding: calc(env(safe-area-inset-top) + 15px) 20px 15px 20px;
            display: flex; align-items: center; justify-content: space-between;
            border-bottom: 1px solid var(--border-color); 
            min-height: 60px; flex-shrink: 0; z-index: 50;
            position: sticky; top: 0;
        }
        .header-left { display: flex; align-items: center; gap: 15px; }
        .app-title { font-weight: bold; font-size: 1.1em; letter-spacing: 0.5px; }
        .back-btn, .menu-btn { 
            background: none; border: none; color: var(--text-primary); 
            font-size: 1.2em; cursor: pointer; transition: transform 0.2s;
            width: 40px; height: 40px; display: flex; align-items: center;
            justify-content: center; border-radius: 10px;
            color: var(--orange-accent); transform: translateX(-3px); 
            background: rgba(255, 146, 0, 0.1);
        }
        .back-btn:hover, .menu-btn:hover { 
            color: var(--orange-accent); transform: translateX(-3px); 
            background: rgba(49, 49, 49, 0.1);
        }
        .logout-btn {
            width: 40px; height: 40px; border-radius: 10px;
            background: var(--orange-accent); color: black;
            border: none; cursor: pointer; transition: 0.2s;
            display: flex; align-items: center; justify-content: center;
        }
        .logout-btn:hover {
            background: #ffaa33; transform: scale(1.0);
        }

        /* --- LOGIN --- */
        #login-view { z-index: 200; justify-content: center; align-items: center; padding: 30px; }
        .login-logo { font-size: 4em; color: var(--orange-accent); margin-bottom: 20px; }
        .pin-input {
            width: 100%; max-width: 300px; padding: 15px; text-align: center;
            background: var(--input-bg); border: 1px solid var(--border-color);
            color: white; border-radius: 12px; font-size: 1.5em; letter-spacing: 5px;
            margin-bottom: 20px;
        }
        .pin-input:focus { border-color: var(--orange-accent); }

        /* --- NEW DASHBOARD WELCOME CARD --- */
        .welcome-card {
            background: linear-gradient(135deg, #ff9200 0%, #ffaa33 100%);
            border-radius: 20px; padding: 25px; margin-bottom: 20px;
            box-shadow: 0 8px 25px rgba(255, 146, 0, 0.3);
        }
        .welcome-header {
            display: flex; justify-content: space-between; align-items: start;
            margin-bottom: 20px;
        }
        .welcome-title {
            font-size: 0.75em; text-transform: uppercase;
            color: rgba(0,0,0,0.6); font-weight: bold; margin-bottom: 5px;
        }
        .welcome-name {
            font-size: 1.8em; font-weight: bold; color: #000;
        }
        .welcome-badge {
            background: rgba(255,255,255,0.3); padding: 6px 12px;
            border-radius: 8px; font-size: 0.85em; color: #000;
            font-weight: bold;
        }
        .stats-row-new {
            display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
        }
        .stat-box-new {
            background: rgba(0,0,0,0.15); padding: 15px;
            border-radius: 12px; text-align: center;
        }
        .stat-label {
            font-size: 0.75em; color: rgba(0,0,0,0.6);
            font-weight: bold; margin-bottom: 5px;
        }
        .stat-value {
            font-size: 1.5em; font-weight: bold; color: #000;
        }
        
        /* --- QUICK ACTIONS GRID --- */
        .quick-actions-title {
            font-weight: bold; margin: 20px 0 15px 5px; color: white;
            font-size: 0.95em;
        }
        .dash-grid { 
            display: grid; grid-template-columns: 1fr 1fr; gap: 15px;
            margin-bottom: 25px;
        }
        .dash-card, .menu-card {
            background: var(--panel-bg); border: 1px solid var(--border-color);
            border-radius: 16px; padding: 25px 15px; text-align: center;
            display: flex; flex-direction: column; align-items: center; gap: 10px;
            cursor: pointer; transition: all 0.2s; aspect-ratio: 1;
            justify-content: center;
        }
        .dash-card:hover, .menu-card:hover { 
            border-color: var(--orange-accent); background: #2a2a2a; 
            transform: translateY(-3px); 
            box-shadow: 0 10px 30px rgba(255, 146, 0, 0.2);
        }
        .dash-card.primary {
            border-color: var(--orange-accent);
            background: rgba(255, 146, 0, 0.1);
        }
        .dash-icon, .menu-icon { 
            font-size: 2em; color: var(--text-secondary); 
            transition: 0.2s;
        }
        .dash-card:hover .dash-icon,
        .menu-card:hover .menu-icon {
            color: var(--orange-accent);
        }
        .dash-card.primary .dash-icon {
            color: var(--orange-accent);
        }

        /* --- TODAY'S ACTIVITY FEED --- */
        .activity-section {
            margin-top: 25px;
        }
        .activity-title {
            font-weight: bold; margin-bottom: 15px; color: white;
            font-size: 0.95em; margin-left: 5px;
        }
        .activity-card {
            background: var(--panel-bg); border: 1px solid var(--border-color);
            border-radius: 16px; padding: 15px; margin-bottom: 10px;
            display: flex; gap: 15px; align-items: center;
            transition: 0.2s;
        }
        .activity-card:hover {
            border-color: var(--orange-accent); background: #2a2a2a;
        }
        .activity-icon-wrap {
            width: 45px; height: 45px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
        }
        .activity-icon-wrap.success {
            background: rgba(76, 175, 80, 0.2); color: #4caf50;
        }
        .activity-icon-wrap.info {
            background: rgba(59, 130, 246, 0.2); color: #3b82f6;
        }
        .activity-icon-wrap.warning {
            background: rgba(245, 158, 11, 0.2); color: #f59e0b;
        }
        .activity-content {
            flex: 1;
        }
        .activity-text {
            font-weight: 600; font-size: 0.95em; margin-bottom: 3px;
        }
        .activity-time {
            font-size: 0.75em; color: var(--text-secondary);
        }
        .activity-amount {
            font-weight: bold; color: var(--orange-accent);
            font-size: 1.1em; white-space: nowrap;
        }
        .empty-activity {
            text-align: center; padding: 40px 20px; color: var(--text-secondary);
        }
        .empty-activity i {
            font-size: 3em; opacity: 0.3; margin-bottom: 15px;
            display: block;
        }

        /* --- POS COMPONENTS --- */
        .search-container { padding: 5px; position: relative; }
        .search-input {
            width: 100%; background: var(--input-bg); border: 1px solid var(--border-color);
            color: white; border-radius: 12px; padding: 14px 14px 14px 45px; font-size: 1em;
        }
        .search-icon { position: absolute; left: 30px; top: 50%; transform: translateY(-35%); color: var(--text-secondary); }

        .filter-bar { display: flex; overflow-x: auto; gap: 10px; padding: 10px 15px; flex-shrink: 0; }
        .filter-btn {
            background: var(--panel-bg); color: var(--text-secondary); border: 1px solid var(--border-color);
            padding: 8px 18px; border-radius: 20px; font-size: 0.9em; white-space: nowrap; cursor: pointer; transition: 0.2s;
        }
        .filter-btn:hover { background: var(--border-color); color: white; }
        .filter-btn.active { background: var(--orange-accent); color: black; border-color: var(--orange-accent); font-weight: bold; }
        .filter-btn.active:hover { background: #e08000; }

        .grid-list { 
            display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
            gap: 15px; padding: 15px; padding-bottom: 100px; overflow-y: auto; 
            scroll-behavior: smooth;
        }
        .list-item-card {
            background-color: var(--panel-bg); border: 1px solid var(--border-color); border-radius: 16px;
            padding: 15px; display: flex; flex-direction: column; align-items: center; gap: 10px;
            text-align: center; cursor: pointer; position: relative; transition: all 0.2s;
            will-change: transform, opacity;
        }
        .list-item-card:hover { border-color: var(--orange-accent); background: #2a2a2a; transform: translateY(-3px); }
        .list-item-card:active { transform: scale(0.96); }

        .card-icon-area { 
            width: 60px; height: 60px; background: rgba(255,255,255,0.05); 
            border-radius: 50%; display: flex; align-items: center; justify-content: center;
        }
        .qty-badge {
            position: absolute; top: 10px; right: 10px; background: var(--orange-accent); color: black;
            width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
            font-size: 0.8em; opacity: 0; transform: scale(0); transition: 0.2s; font-weight: bold;
        }
        .qty-badge.visible { opacity: 1; transform: scale(1); }
        .qty-badge.pop { animation: popBadge 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

        .fab-container { position: absolute; bottom: 20px; right: 20px; z-index: 50; }
        .fab-btn {
            width: 60px; height: 60px; border-radius: 30px; background: var(--orange-accent); 
            color: black; border: none; box-shadow: 0 4px 15px rgba(255, 146, 0, 0.4);
            font-size: 1.5em; cursor: pointer; display: flex; align-items: center; justify-content: center;
            transition: 0.2s;
        }
        .fab-btn:hover { transform: scale(1.1) rotate(5deg); box-shadow: 0 8px 25px rgba(255, 146, 0, 0.6); }
        .cart-badge-fab {
            position: absolute; top: -5px; right: -5px; background: #ff0000; color: white;
            padding: 4px 8px; border-radius: 10px; border: 2px solid var(--bg-dark); font-size: 0.75em;
        }
        .cart-badge-fab.pop { animation: popBadge 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

        /* --- CART SHEET --- */
.bottom-sheet-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); z-index: 200; opacity: 0; pointer-events: none;
    transition: opacity 0.3s; backdrop-filter: blur(4px);
}
        .bottom-sheet-overlay.active { opacity: 1; pointer-events: auto; }
        .bottom-sheet {
            position: absolute; bottom: 0; left: 0; width: 100%; background: var(--card-bg); 
            border-radius: 25px 25px 0 0; padding: 16px; transform: translateY(100%); 
            transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); max-height: 85vh; display: flex; flex-direction: column;
        }
        .bottom-sheet-overlay.active .bottom-sheet { transform: translateY(0); }

        .cart-item-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-color); }
        
        .qty-control { display: flex; align-items: center; gap: 10px; background: var(--input-bg); border-radius: 20px; padding: 5px; }
        .qty-btn { width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
        .qty-btn:hover { transform: scale(1.15); filter: brightness(1.2); }
        .qty-btn.minus { background: #444; color: white; }
        .qty-btn.trash { background: var(--danger-color); color: white; }
        .qty-btn.plus { background: var(--orange-accent); color: black; }
        .qty-val { font-weight: bold; width: 20px; text-align: center; }

        .action-btn { 
            width: 100%; padding: 16px; background: var(--orange-accent); color: black; border: none; border-radius: 14px;
            font-weight: bold; font-size: 1.1em; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
            transition: 0.2s;
        }
        .action-btn:hover { filter: brightness(1.1); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255, 146, 0, 0.4); }

        /* --- PAYMENT MODAL --- */
        .payment-modal {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%;
            background: var(--card-bg); z-index: 150; display: flex; flex-direction: column;
            transform: translateY(100%); visibility: hidden; 
            transition: transform 0.3s ease, visibility 0s linear 0.3s;
        }
        .payment-modal.active { 
            transform: translateY(0); visibility: visible;
            transition: transform 0.3s ease, visibility 0s linear 0s;
        }
        
        .pay-section { padding: 20px; overflow-y: auto; flex: 1; }
        .pay-header { margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); }
        
        .bill-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.95em; color: var(--text-secondary); }
        .bill-row.final { font-size: 1.2em; color: var(--text-primary); font-weight: bold; margin-top: 15px; padding-top: 10px; border-top: 1px dashed var(--border-color); align-items: center; }
        .highlight-amt { color: var(--orange-accent); font-size: 1.5em; }

        .pay-group { margin-bottom: 20px; background: var(--panel-bg); padding: 15px; border-radius: 12px; border: 1px solid var(--border-color); }
        .pay-group-title { font-size: 0.8em; color: var(--text-secondary); margin-bottom: 10px; font-weight: bold; text-transform: uppercase; }
        
        .toggle-row { display: flex; gap: 10px; margin-top: 10px; }
        .toggle-btn { 
            flex: 1; padding: 12px; background: var(--input-bg); border: 1px solid var(--border-color); 
            color: var(--text-secondary); border-radius: 8px; cursor: pointer; text-align: center; font-size: 0.9em; transition: 0.2s;
        }
        .toggle-btn:hover { background: var(--border-color); color: white; }
        .toggle-btn.active { background: var(--orange-accent); color: black; border-color: var(--orange-accent); font-weight: bold; }
        .toggle-btn.active:hover { background: #e08000; }
        
        .input-row { display: flex; gap: 10px; align-items: center; }
        .form-control { 
            width: 100%; padding: 12px; background: var(--input-bg); border: 1px solid var(--border-color);
            color: white; border-radius: 8px; font-size: 1em; 
        }

        /* --- HISTORY VIEW --- */
        #history-view .invoice-item {
            background: var(--panel-bg); padding: 15px; border-radius: 12px; margin-bottom: 10px;
            display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--border-color);
            cursor: pointer;
            transition: all 0.2s ease;
        }
        #history-view .invoice-item:hover {
            background: #2a2a2a;
            border-color: var(--orange-accent);
            transform: translateX(5px);
        }
        #history-view .invoice-item:active {
            transform: scale(0.98);
        }
        .status-badge { padding: 4px 8px; border-radius: 6px; font-size: 0.75em; font-weight: bold; }
        .status-paid { background: rgba(76, 175, 80, 0.2); color: #4caf50; }
        .status-partial { background: rgba(255, 146, 0, 0.2); color: #ff9200; }
        .status-unpaid { background: rgba(244, 67, 54, 0.2); color: #ff5252; }

        /* --- RESPONSIVE --- */
        @media (min-width: 768px) {
            .dash-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
            .stats-row-new { gap: 15px; }
        }
        
        /* Customer Header Button */
/* Customer Header Button - Two Column Layout */
       .customer-header-btn {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Pushes arrow to the far right */
    background: #2c2c2c; /* Dark card background */
    border-left: 4px solid var(--orange-accent); /* The orange accent border */
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 220px; /* Ensure enough width */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.customer-header-btn:hover {
    background: #333; /* Slightly lighter on hover */
    transform: translateY(-2px);
}

.customer-header-btn:active {
    transform: scale(0.98);
}

/* The circular icon container */
.cust-icon-circle {
    width: 42px;
    height: 42px;
    background: #3a3a3a; /* Slightly lighter than card bg */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #eee;
    font-size: 1.1em;
}

/* Column structure for Name and Balance */
.cust-info-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

/* Customer Name Style (White, Bold) */
.cust-name-text {
    font-weight: 700;
    font-size: 1em;
    color: #ffffff; 
    letter-spacing: 0.5px;
}

/* Balance Text Style (Orange) */
.cust-balance-text {
    font-size: 0.85em;
    color: var(--orange-accent); /* Orange color for balance */
    font-weight: 500;
}

/* Right dropdown arrow style */
.cust-arrow-icon {
    color: #888;
    font-size: 0.9em;
    padding-left: 10px;
}
        /* Customer List Items */
/* Customer List Items - Improved */
        .customer-list-item {
            padding: 12px 15px; 
            background: var(--input-bg); 
            border-radius: 12px;
            margin-bottom: 10px; 
            display: flex; 
            align-items: center; 
            justify-content: space-between;
            border: 1px solid var(--border-color); 
            cursor: pointer; 
            transition: all 0.2s ease;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }

        .customer-list-item:hover { 
            border-color: var(--orange-accent); 
            background: #454545; /* Lighter on hover */
            
        }

        .customer-list-item.selected { 
            border-color: var(--orange-accent); 
            background: rgba(255, 146, 0, 0.15); 
        }
        
        /* Avatar Icon Style */
        .customer-avatar {
            width: 40px; height: 40px;
            background: var(--card-bg);
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            color: var(--text-secondary);
            border: 1px solid var(--border-color);
            margin-right: 15px;
            transition: 0.2s;
        }

        /* Highlight avatar on hover */
        .customer-list-item:hover .customer-avatar {
            color: var(--orange-accent);
            border-color: var(--orange-accent);
        }
        .customer-list-item i { color: var(--text-secondary); }
        .customer-list-item.selected i { color: var(--orange-accent); }
        
        
        /* Click Animation - Deep Bounce */
        @keyframes bounceDepth {
            0% { transform: scale(1); }
            40% { transform: scale(0.9); filter: brightness(0.7); } /* Deep down & Darker */
            70% { transform: scale(1.03); filter: brightness(1.0); } /* Slight Bounce up */
            100% { transform: scale(1); }
        }

        .animate-click {
            animation: bounceDepth 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        
        
        /* Scanner Button inside Search Bar */
.search-container { position: relative; }
.scanner-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--orange-accent);
    border: none;
    border-radius: 8px;
    color: black;
    padding: 8px 12px;
    cursor: pointer;
    z-index: 5;
}

/* Full Screen Scanner Overlay */
.scanner-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 2000;
    display: flex; align-items: center; justify-content: center;
}
.scanner-container {
    width: 90%; max-width: 400px;
    background: var(--card-bg); border-radius: 20px; overflow: hidden;
}
.scanner-header {
    padding: 15px 20px; display: flex; justify-content: space-between;
    align-items: center; border-bottom: 1px solid var(--border-color);
}
.scanner-header button {
    background: none; border: none; color: white; font-size: 24px; cursor: pointer;
}
#reader { width: 100%; background: #000; }
/* Adjust input padding to fit both icons on the right */
.search-input {
    padding-right: 90px !important;
}

/* Clear Button Styling */
.clear-btn {
    position: absolute;
    right: 52px; /* Positioned to the left of the scanner button */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    z-index: 5;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.clear-btn:hover {
    color: var(--danger-color);
}

.clear-btn.hidden {
    display: none;
}
/* Checkout Summary Card */
.pay-summary-card {
    background: var(--panel-bg);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.pay-divider { border: 0; border-top: 1px solid var(--border-color); margin: 15px 0; }

/* VAT Toggle Switch */
.vat-row { align-items: center; color: var(--text-secondary); }
.vat-toggle {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    font-size: 0.9em; user-select: none;
}
.vat-toggle input { display: none; }
.checkmark {
    width: 20px; height: 20px; border: 2px solid var(--orange-accent);
    border-radius: 5px; position: relative;
}
.vat-toggle input:checked + .checkmark::after {
    content: '\f00c'; font-family: "Font Awesome 6 Free"; font-weight: 900;
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 12px; color: var(--orange-accent);
}

/* Discount Dual Inputs */
.discount-container {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 15px;
}
.discount-label { font-weight: 600; color: var(--text-secondary); }
.discount-inputs { display: flex; gap: 10px; width: 65%; }
.input-with-label { position: relative; flex: 1; }
.input-with-label .unit {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    font-size: 0.7em; color: var(--text-secondary); pointer-events: none;
}
.input-with-label .form-control { padding-right: 35px; text-align: right; }

/* Total Row */
.total-row { font-weight: 600; margin-top: 5px; color: var(--text-primary); }





/* Standard Row Layout */
.bill-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}




/* --- DISCOUNT ROW STYLING --- */

/* Ensures the label and the input group stay on one line */
.discount-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

/* Container for both input boxes */
.discount-inputs-inline {
    display: flex;
    align-items: center;
    gap: 8px; /* Space between the % box and the OMR box */
    flex-shrink: 0;
}

/* The box surrounding the input and its suffix (%, OMR) */
.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 10px;
    height: 38px; /* Consistent height */
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--orange-accent);
}

/* The actual number input */
.compact-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0;
    font-size: 0.95em;
    font-weight: 500;
    outline: none;
    text-align: right;
}

/* Specific widths for each type */
#payDiscPct {
    width: 35px; /* Narrow for percentage */
}

#payDiscFixed {
    width: 65px; /* Wider for 0.000 OMR */
}

/* Suffix labels (%, OMR) */
.input-suffix {
    color: var(--text-secondary);
    font-size: 0.8em;
    margin-left: 5px;
    user-select: none;
    font-weight: 600;
}

/* The separator dash between boxes */
.separator {
    color: var(--border-color);
    font-weight: bold;
}

/* Ensure Total and Net labels match the weight */
.total-row, .discount-row span:first-child {
    font-weight: 600;
    color: var(--text-secondary);
}

.highlight-amt {
    font-size: 1.4em;
    font-weight: 800;
    color: var(--orange-accent);
}

/* --- CHECKOUT CUSTOMER CARD --- */
.checkout-customer-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #2c2c2c 0%, #242424 100%);
    border: 2px solid var(--border-color);
    border-left: 4px solid var(--orange-accent);
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.checkout-customer-card:hover {
    background: linear-gradient(135deg, #333 0%, #2a2a2a 100%);
    border-color: var(--orange-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 146, 0, 0.2);
}

.checkout-customer-card:active {
    transform: scale(0.98);
}

.checkout-cust-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--orange-accent) 0%, #ff7700 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 1.2em;
    box-shadow: 0 3px 8px rgba(255, 146, 0, 0.3);
}

.checkout-cust-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.checkout-cust-name {
    font-weight: 700;
    font-size: 1.05em;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.checkout-cust-balance {
    font-size: 0.9em;
    color: var(--orange-accent);
    font-weight: 600;
}

.checkout-cust-arrow {
    color: #888;
    font-size: 1em;
    padding-left: 10px;
    transition: transform 0.2s;
}

.checkout-customer-card:hover .checkout-cust-arrow {
    color: var(--orange-accent);
    transform: translateX(3px);
}

/* --- FILTER TOGGLE BUTTON --- */
.filter-toggle-btn {
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--panel-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85em;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    height: 40px;
    min-width: 110px;
}

.filter-toggle-btn:hover {
    background: rgba(255, 146, 0, 0.1);
    border-color: var(--orange-accent);
    color: var(--orange-accent);
    transform: translateY(-1px);
}

.filter-toggle-btn:active {
    transform: translateY(0);
}

.filter-toggle-btn i {
    font-size: 1em;
    color: var(--orange-accent);
}

/* --- ACTION SHEET STYLES --- */
.bottom-sheet.action-sheet {
    padding: 0;
}

.bottom-sheet.action-sheet.active {
    transform: translateY(0);
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin: 12px auto 0;
}

.action-sheet-btn {
    width: 100%;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.25s ease;
    color: var(--text-primary);
    font-size: 1em;
    position: relative;
    overflow: hidden;
}

.action-sheet-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 146, 0, 0.1), transparent);
    transition: left 0.5s;
}

.action-sheet-btn:hover::before {
    left: 100%;
}

.action-sheet-btn:hover {
    background: #2a2a2a;
    border-color: var(--orange-accent);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(255, 146, 0, 0.15);
}

.action-sheet-btn:active {
    transform: translateX(3px) scale(0.98);
}

.action-sheet-btn i:first-child {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--orange-accent);
    font-size: 1.2em;
    background: rgba(255, 146, 0, 0.1);
    border-radius: 8px;
    flex-shrink: 0;
}

.action-sheet-btn.danger i:first-child {
    color: var(--danger-color);
    background: rgba(255, 82, 82, 0.1);
}

.action-sheet-btn.danger:hover {
    border-color: var(--danger-color);
    box-shadow: 0 4px 12px rgba(255, 82, 82, 0.15);
}

.action-sheet-btn span {
    flex: 1;
    font-weight: 600;
    text-align: left;
}

.action-sheet-btn i.fa-chevron-right {
    color: var(--text-secondary);
    font-size: 0.9em;
    transition: transform 0.2s;
}

.action-sheet-btn:hover i.fa-chevron-right {
    color: var(--orange-accent);
    transform: translateX(3px);
}

/* --- PDF DIALOG STYLES --- */
.pdf-dialog {
    max-width: 95% !important;
}

.pdf-container {
    padding: 0 !important;
    margin: 0 !important;
}

.pdf-container iframe {
    background: white;
}

/* Mobile PDF optimization */
@media (max-width: 768px) {
    .pdf-dialog {
        max-width: 98% !important;
        margin: 10px !important;
    }
    
    .pdf-container {
        max-height: 60vh !important;
    }
}

/* --- INVOICE SUMMARY FOOTER --- */
.invoice-summary-footer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
    background: var(--card-bg);
    border-top: 2px solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    bottom: 0;
    z-index: 40;
}

.summary-stat-box {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.summary-stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    transition: height 0.3s;
}

.summary-stat-box.paid::before {
    background: var(--success-color);
}

.summary-stat-box.partial::before {
    background: #f59e0b;
}

.summary-stat-box.unpaid::before {
    background: var(--danger-color);
}

.summary-stat-box:hover {
    background: #2a2a2a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.summary-stat-box:hover::before {
    height: 100%;
    opacity: 0.1;
}

.summary-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    flex-shrink: 0;
}

.summary-stat-box.paid .summary-icon {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success-color);
}

.summary-stat-box.partial .summary-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.summary-stat-box.unpaid .summary-icon {
    background: rgba(255, 82, 82, 0.15);
    color: var(--danger-color);
}

.summary-content {
    flex: 1;
    width: 100%;
    min-width: 0;
    text-align: center;
}

.summary-label {
    font-size: 0.7em;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 1em;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 2px;
    word-break: break-all;
}

.summary-stat-box.paid .summary-value {
    color: var(--success-color);
}

.summary-stat-box.partial .summary-value {
    color: #f59e0b;
}

.summary-stat-box.unpaid .summary-value {
    color: var(--danger-color);
}

.summary-detail {
    font-size: 0.75em;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 2px;
}

.summary-count {
    font-size: 0.7em;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 600px) {
    .invoice-summary-footer {
        gap: 6px;
        padding: 10px 8px;
    }
    
    .summary-stat-box {
        padding: 8px 6px;
    }
    
    .summary-icon {
        width: 28px;
        height: 28px;
        font-size: 0.95em;
    }
    
    .summary-label {
        font-size: 0.6em;
    }
    
    .summary-value {
        font-size: 0.85em;
    }
    
    .summary-detail {
        font-size: 0.65em;
    }
    
    .summary-count {
        font-size: 0.6em;
    }
}

@media (max-width: 400px) {
    .invoice-summary-footer {
        padding: 8px 5px;
        gap: 5px;
    }
    
    .summary-stat-box {
        padding: 6px 4px;
    }
    
    .summary-icon {
        width: 24px;
        height: 24px;
        font-size: 0.85em;
    }
    
    .summary-label {
        font-size: 0.55em;
    }
    
    .summary-value {
        font-size: 0.75em;
    }
    
    .summary-detail {
        font-size: 0.6em;
    }
    
    .summary-count {
        font-size: 0.55em;
    }
}

/* --- CUSTOMERS LIST STYLES --- */
.customer-list-item {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.customer-list-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--border-color);
    transition: all 0.3s;
}

.customer-list-item.has-due::before {
    background: var(--danger-color);
}

.customer-list-item:hover {
    background: #2a2a2a;
    border-color: var(--orange-accent);
    /*transform: translateX(5px);*/
    box-shadow: 0 4px 12px rgba(255, 146, 0, 0.15);
}

.customer-list-item:hover::before {
    width: 100%;
    opacity: 0.05;
}



.customer-info {
    flex: 1;
    min-width: 0;
}

.customer-name {
    font-weight: 700;
    font-size: 1.05em;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-phone {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 3px;
    font-family: monospace;
}

.customer-meta {
    font-size: 0.75em;
    color: #666;
}

.customer-due {
    text-align: right;
    flex-shrink: 0;
}

.due-label {
    font-size: 0.7em;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.due-amount {
    font-size: 1.1em;
    font-weight: 800;
    color: var(--success-color);
}

.due-amount.has-amount {
    color: var(--danger-color);
}

/* Responsive adjustments for customer list */
@media (max-width: 600px) {
    .customer-list-item {
        padding: 12px;
        gap: 12px;
    }
    
    .customer-avatar {
        width: 45px;
        height: 45px;
        font-size: 1.2em;
    }
    
    .customer-name {
        font-size: 1em;
    }
    
    .customer-phone {
        font-size: 0.8em;
    }
    
    .due-amount {
        font-size: 1em;
    }
}

@media (max-width: 400px) {
    .customer-list-item {
        padding: 10px;
        gap: 10px;
    }
    
    .customer-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.1em;
    }
    
    .customer-name {
        font-size: 0.95em;
    }
    
    .customer-phone {
        font-size: 0.75em;
    }
    
    .customer-meta {
        font-size: 0.7em;
    }
    
    .due-label {
        font-size: 0.65em;
    }
    
    .due-amount {
        font-size: 0.9em;
    }
}

/* ========================================
   COLLECTIONS STYLES
   ======================================== */

/* Summary Grid */
.collections-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.collection-summary-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.2s;
}

.collection-summary-card:hover {
    border-color: var(--orange-accent);
    background: #2a2a2a;
    box-shadow: 0 4px 12px rgba(255, 146, 0, 0.15);
}

.summary-icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
    flex-shrink: 0;
}

.summary-content {
    flex: 1;
    min-width: 0;
}

.summary-content .summary-label {
    font-size: 0.75em;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
}

.summary-content .summary-value {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--text-primary);
}

/* Filter Tabs */
.collections-filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.collection-filter-btn {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.collection-filter-btn:hover {
    background: #2a2a2a;
    border-color: var(--orange-accent);
}

.collection-filter-btn.active {
    background: var(--orange-accent);
    border-color: var(--orange-accent);
    color: #000;
}

.filter-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
}

.collection-filter-btn.active .filter-count {
    background: rgba(0, 0, 0, 0.2);
}

/* Search Bar */
.collection-search-bar {
    position: relative;
    margin-bottom: 20px;
}

.collection-search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.collection-search-bar input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: 12px;
    padding: 14px 14px 14px 45px;
    font-size: 1em;
}

.collection-search-bar input:focus {
    border-color: var(--orange-accent);
}

/* Collection Items */
.collection-item {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.collection-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--border-color);
    transition: all 0.3s;
}

.collection-item.has-due::before {
    background: var(--danger-color);
}

.collection-item:hover {
    background: #2a2a2a;
    border-color: var(--orange-accent);
    box-shadow: 0 4px 12px rgba(255, 146, 0, 0.15);
}

.collection-item:hover::before {
    width: 100%;
    opacity: 0.05;
}

.collection-item-info {
    flex: 1;
    min-width: 0;
}

.collection-item-name {
    font-weight: 700;
    font-size: 1.05em;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collection-item-meta {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.collection-item-amount {
    text-align: right;
    flex-shrink: 0;
}

.collection-amount {
    font-size: 1.2em;
    font-weight: 800;
    margin-bottom: 2px;
}

.collection-amount.has-due {
    color: var(--danger-color);
}

.collection-amount.clear {
    color: var(--success-color);
}

.collection-currency {
    font-size: 0.7em;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

/* Collection Payment Sheet */
.collection-payment-sheet {
    max-height: 85vh !important;
}

.collection-customer-info {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.collection-customer-name {
    font-weight: 700;
    font-size: 1.1em;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.collection-customer-phone {
    font-size: 0.85em;
    color: var(--text-secondary);
    font-family: monospace;
}

.collection-outstanding-box {
    background: linear-gradient(135deg, rgba(255, 82, 82, 0.2), rgba(255, 82, 82, 0.1));
    border: 1px solid var(--danger-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 25px;
}

.outstanding-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
}

.outstanding-amount {
    font-size: 2em;
    font-weight: bold;
    color: var(--danger-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9em;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
}

.form-input, .form-textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: 12px;
    padding: 14px;
    font-size: 1em;
    font-family: inherit;
}

.form-input:focus, .form-textarea:focus {
    border-color: var(--orange-accent);
    outline: none;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.quick-amount-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.quick-amount-btn {
    flex: 1;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-amount-btn:hover {
    background: var(--orange-accent);
    border-color: var(--orange-accent);
    color: #000;
}

.action-btn-header {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 146, 0, 0.1);
    color: var(--orange-accent);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn-header:hover {
    background: var(--orange-accent);
    color: #000;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .collections-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-icon-circle {
        width: 45px;
        height: 45px;
        font-size: 1.1em;
    }
    
    .summary-content .summary-value {
        font-size: 1.2em;
    }
    
    .collection-item {
        padding: 12px;
    }
    
    .collection-amount {
        font-size: 1.1em;
    }
    
    .outstanding-amount {
        font-size: 1.6em;
    }
}

@media (max-width: 400px) {
    .collection-summary-card {
        padding: 15px;
    }
    
    .summary-icon-circle {
        width: 40px;
        height: 40px;
        font-size: 1em;
    }
    
    .summary-content .summary-label {
        font-size: 0.7em;
    }
    
    .summary-content .summary-value {
        font-size: 1.1em;
    }
    
    .collection-item {
        padding: 10px;
        gap: 12px;
    }
    
    .collection-item-name {
        font-size: 1em;
    }
    
    .collection-amount {
        font-size: 1em;
    }
}





/*#####################*/
/* Navigation Items */
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 5px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
    color: var(--text-primary);
    font-size: 0.95em;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: var(--orange-accent);
    color: #000;
}

.nav-item i {
    font-size: 1.2em;
    width: 24px;
    text-align: center;
}

.nav-item.active i {
    color: #000;
}

