
        :root { 
            --primary: #4361ee; 
            --primary-light: #3a56d4;
            --danger: #ef4444; 
            --success: #10b981; 
            --warning: #f59e0b;
            --info: #3b82f6;
            --purple: #8b5cf6;
            --dark: #0f172a; 
            --sidebar: #1e293b; 
            --bg: #f1f5f9;
            --card-shadow: 0 4px 20px rgba(0,0,0,0.08);
        }
        * { 
            box-sizing: border-box; 
            margin: 0;
            padding: 0;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
        }
        body { 
            margin: 0; 
            background: var(--bg); 
            color: var(--dark); 
            overflow-x: hidden; 
            font-size: 14px;
        }

        /* Login Overlay */
        #loginOverlay { 
            position: fixed; 
            inset: 0; 
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
            display: flex; 
            align-items: center; 
            justify-content: center; 
            z-index: 9999; 
        }
        .login-card { 
            width: 400px; 
            padding: 40px; 
            border-radius: 20px; 
            background: white;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3); 
            text-align: center; 
            animation: fadeIn 0.5s;
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .login-card input { 
            width: 100%; 
            padding: 14px; 
            margin: 12px 0; 
            border: 1px solid #ddd; 
            border-radius: 10px; 
            font-size: 15px;
            transition: border 0.3s;
        }
        .login-card input:focus {
            border-color: var(--primary);
            outline: none;
            box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
        }

        /* Layout Structure */
        .wrapper { 
            display: flex; 
            min-height: 100vh; 
        }
        nav.sidebar { 
            width: 280px; 
            background: var(--sidebar); 
            color: white; 
            display: flex; 
            flex-direction: column; 
            position: fixed; 
            height: 100vh; 
            transition: 0.3s; 
            z-index: 100; 
            box-shadow: 5px 0 15px rgba(0,0,0,0.1);
        }
        .sidebar-brand { 
            padding: 25px 20px; 
            font-size: 1.5rem; 
            font-weight: 800; 
            color: white; 
            text-align: center; 
            border-bottom: 1px solid #334155; 
            background: linear-gradient(135deg, #4361ee 0%, #3a56d4 100%);
        }
        .nav-link { 
            padding: 16px 25px; 
            color: #94a3b8; 
            text-decoration: none; 
            cursor: pointer; 
            display: flex; 
            align-items: center; 
            gap: 15px; 
            transition: all 0.3s; 
            font-size: 15px;
            border-left: 4px solid transparent;
        }
        .nav-link:hover, .nav-link.active { 
            background: rgba(255,255,255,0.05); 
            color: white; 
            border-left-color: var(--primary); 
            padding-left: 30px;
        }
        .nav-link i { 
            width: 20px; 
            text-align: center; 
        }
        
        main { 
            flex: 1; 
            margin-left: 280px; 
            padding: 30px; 
            width: calc(100% - 280px); 
        }
        .card { 
            background: white; 
            border-radius: 16px; 
            padding: 25px; 
            box-shadow: var(--card-shadow); 
            margin-bottom: 25px; 
            border: 1px solid #eef2f6; 
            transition: transform 0.3s;
        }
        .card:hover {
            transform: translateY(-2px);
        }
        .hidden { 
            display: none !important; 
        }

        /* Stats Cards */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 20px;
            margin-bottom: 25px;
        }
        .stat-card {
            background: white;
            border-radius: 16px;
            padding: 25px;
            box-shadow: var(--card-shadow);
            position: relative;
            overflow: hidden;
            border-left: 5px solid var(--primary);
        }
        .stat-card:nth-child(2) { border-left-color: var(--success); }
        .stat-card:nth-child(3) { border-left-color: var(--warning); }
        .stat-card:nth-child(4) { border-left-color: var(--danger); }
        .stat-card:nth-child(5) { border-left-color: var(--info); }
        .stat-card:nth-child(6) { border-left-color: var(--purple); }
        .stat-card h4 {
            color: #64748b;
            font-size: 14px;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 10px;
        }
        .stat-card h2 {
            font-size: 2.2rem;
            color: var(--dark);
            margin: 0;
        }

        /* Tables & Inputs */
        .grid { 
            display: grid; 
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
            gap: 15px; 
            margin-bottom: 20px; 
        }
        .btn { 
            padding: 12px 24px; 
            border-radius: 10px; 
            border: none; 
            cursor: pointer; 
            font-weight: 600; 
            background: var(--primary); 
            color: white; 
            transition: all 0.3s;
            font-size: 14px;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }
        .btn:hover {
            background: var(--primary-light);
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
        }
        .btn-danger { 
            background: var(--danger); 
        }
        .btn-danger:hover {
            background: #dc2626;
            box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
        }
        .btn-success { 
            background: var(--success); 
        }
        .btn-success:hover {
            background: #0da271;
            box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
        }
        .btn-warning {
            background: var(--warning);
        }
        .btn-warning:hover {
            background: #d97706;
            box-shadow: 0 5px 15px rgba(245, 158, 11, 0.3);
        }
        .btn-info {
            background: var(--info);
        }
        .btn-info:hover {
            background: #2563eb;
            box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
        }
        .btn-small { 
            padding: 8px 16px; 
            font-size: 13px; 
        }
        .btn-smaller {
            padding: 5px 10px;
            font-size: 12px;
        }
        
        input, select, textarea { 
            padding: 12px 15px; 
            border: 1px solid #e2e8f0; 
            border-radius: 10px; 
            width: 100%; 
            font-size: 14px;
            transition: border 0.3s;
        }
        input:focus, select:focus, textarea:focus {
            border-color: var(--primary);
            outline: none;
            box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
        }
        table { 
            width: 100%; 
            border-collapse: collapse; 
            margin-top: 20px; 
            background: white;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }
        th, td { 
            text-align: left; 
            padding: 16px 20px; 
            border-bottom: 1px solid #f1f5f9; 
        }
        th { 
            background: #f8fafc; 
            font-size: 13px; 
            color: #64748b; 
            text-transform: uppercase; 
            letter-spacing: 0.5px;
            font-weight: 600;
        }
        tr:hover {
            background: #f8fafc;
        }

        .low-stock { 
            background: #fff1f2; 
            color: #be123c; 
            font-weight: bold; 
        }
        .critical-stock {
            background: #fef3c7;
            color: #92400e;
        }
        .return-row {
            background: #fef3c7;
        }
        .wallet-row {
            background: #f0f9ff;
        }

        /* Payment Status Badges */
        .status-badge {
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            display: inline-block;
        }
        .status-paid {
            background: #d1fae5;
            color: #065f46;
        }
        .status-pending {
            background: #fef3c7;
            color: #92400e;
        }
        .status-return {
            background: #fee2e2;
            color: #991b1b;
        }
        .status-wallet {
            background: #dbeafe;
            color: #1e40af;
        }
        .status-refunded {
            background: #f0f9ff;
            color: #0c4a6e;
        }

        /* Thermal Print Formatting (80mm) */
        @media print {
            /* Hide everything except print area */
            body * { visibility: hidden; }
            #printArea, #printArea * { visibility: visible; }
            
            /* Hide page footer when printing */
            #pageFooter { display: none !important; }
            nav.sidebar { display: none !important; }
            main { display: none !important; }
            
            /* Position print area - Enhanced for darker printing */
            #printArea { 
                position: absolute; 
                left: 0; 
                top: 0; 
                width: 80mm; 
                font-size: 14px; /* Increased from 12px for better visibility */
                background: white; 
                padding: 5mm; 
                line-height: 1.4; /* Improved readability */
                margin: 0;
                color: #000 !important; /* Force black */
                font-weight: 600 !important; /* Make all text semi-bold */
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
            }
            
            /* Ensure bold and extra dark text */
            #printArea strong,
            #printArea b,
            #printArea th,
            #printArea h1,
            #printArea h2,
            #printArea h3 {
                font-weight: 900 !important; /* Extra bold */
                color: #000 !important;
            }
            
            /* Darker table borders */
            #printArea table {
                border: 2px solid #000 !important;
            }
            
            #printArea th,
            #printArea td {
                border: 1px solid #000 !important;
                color: #000 !important;
            }
        }

        /* Header Actions */
        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 25px;
            flex-wrap: wrap;
            gap: 15px;
        }
        .page-title {
            font-size: 24px;
            color: var(--dark);
            font-weight: 700;
        }

        /* Form Groups */
        .form-group {
            margin-bottom: 20px;
        }
        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: #475569;
            font-weight: 500;
        }

        /* Alert */
        .alert {
            padding: 12px 20px;
            border-radius: 10px;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .alert-success {
            background: #d1fae5;
            color: #065f46;
            border-left: 4px solid var(--success);
        }
        .alert-danger {
            background: #fee2e2;
            color: #991b1b;
            border-left: 4px solid var(--danger);
        }
        .alert-warning {
            background: #fef3c7;
            color: #92400e;
            border-left: 4px solid var(--warning);
        }
        .alert-info {
            background: #dbeafe;
            color: #1e40af;
            border-left: 4px solid var(--info);
        }

        /* Cashier Specific Styles */
        .cashier-field {
            background: #f0f9ff;
            border: 1px solid #bae6fd;
            padding: 12px;
            border-radius: 10px;
        }
        .cashier-field label {
            color: #0369a1;
            font-weight: 600;
        }

        /* Payment Method Styles */
        .payment-methods {
            display: flex;
            gap: 10px;
            margin: 20px 0;
        }
        .payment-method {
            flex: 1;
            padding: 15px;
            border: 2px solid #e2e8f0;
            border-radius: 10px;
            cursor: pointer;
            text-align: center;
            transition: all 0.3s;
        }
        .payment-method:hover {
            border-color: var(--primary);
            background: #f0f7ff;
        }
        .payment-method.selected {
            border-color: var(--primary);
            background: #f0f7ff;
            box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
        }
        .payment-method.disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .payment-method i {
            font-size: 24px;
            margin-bottom: 10px;
            color: var(--primary);
        }

        /* Wallet Display */
        .wallet-display {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 20px;
            border-radius: 12px;
            margin-bottom: 20px;
        }
        .wallet-display h3 {
            margin: 0 0 10px 0;
            font-size: 16px;
        }
        .wallet-display .amount {
            font-size: 28px;
            font-weight: bold;
            margin: 0;
        }

        /* Customer Info Card */
        .customer-info-card {
            background: #f8fafc;
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 20px;
            border-left: 4px solid var(--primary);
        }

        /* Tabs */
        .tabs {
            display: flex;
            border-bottom: 2px solid #e2e8f0;
            margin-bottom: 20px;
        }
        .tab {
            padding: 12px 24px;
            cursor: pointer;
            border-bottom: 3px solid transparent;
            transition: all 0.3s;
            font-weight: 600;
            color: #64748b;
        }
        .tab:hover {
            color: var(--primary);
        }
        .tab.active {
            color: var(--primary);
            border-bottom-color: var(--primary);
            background: #f0f7ff;
        }

        /* Modal */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }
        .modal-content {
            background: white;
            border-radius: 16px;
            padding: 30px;
            max-width: 800px;
            width: 95%;
            max-height: 90vh;
            overflow-y: auto;
        }

        /* Bill Details */
        .bill-details {
            background: #f8fafc;
            border-radius: 10px;
            padding: 20px;
            margin-bottom: 20px;
        }

        /* Enhanced Modal Styles */
        .modal-table {
            width: 100%;
            border-collapse: collapse;
            margin: 15px 0;
        }

        .modal-table th, .modal-table td {
            padding: 12px;
            border: 1px solid #e2e8f0;
            text-align: left;
        }

        .modal-table th {
            background: #f8fafc;
            font-weight: 600;
        }

        /* Transaction Details Styles */
        .transaction-details {
            background: #f8fafc;
            border-radius: 8px;
            padding: 15px;
            margin: 10px 0;
        }

        .transaction-items {
            margin-top: 10px;
        }

        .transaction-item {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid #e2e8f0;
        }

        .transaction-item:last-child {
            border-bottom: none;
        }

        /* Tab Content Transitions */
        .tab-content {
            transition: opacity 0.3s ease;
        }

        /* Courier Section Styles */
        .courier-section {
            background: #f0f9ff;
            border: 1px solid #bae6fd;
            padding: 15px;
            border-radius: 10px;
            margin-top: 15px;
        }

        .courier-charge-display {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 10px;
            border-radius: 8px;
            text-align: center;
            margin-top: 10px;
        }

        /* State Discount Badge */
        .state-discount {
            background: #d1fae5;
            color: #065f46;
            padding: 5px 10px;
            border-radius: 15px;
            font-size: 12px;
            font-weight: bold;
            display: inline-block;
            margin-left: 10px;
        }

        /* Currency Display */
        .currency {
            font-family: 'Arial', sans-serif;
            font-weight: bold;
        }

        /* Responsive */
        @media (max-width: 1024px) {
            nav.sidebar {
                width: 80px;
            }
            .sidebar-brand span {
                display: none;
            }
            .nav-link span {
                display: none;
            }
            main {
                margin-left: 80px;
                width: calc(100% - 80px);
                padding: 20px;
            }
        }

        @media (max-width: 768px) {
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            .grid {
                grid-template-columns: 1fr;
            }
            .payment-methods {
                flex-direction: column;
            }
            .modal-content {
                width: 98%;
                padding: 20px;
            }
        }
        /* ================== SIDEBAR SCROLL FIX ================== */
.sidebar-menu-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    display: flex;
    flex-direction: column;
    /* Make sure logout stays at bottom */
    justify-content: space-between;
}

/* Custom scrollbar for the menu container */
.sidebar-menu-container::-webkit-scrollbar {
    width: 5px;
}

.sidebar-menu-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.sidebar-menu-container::-webkit-scrollbar-thumb {
    background: rgba(67, 97, 238, 0.5);
    border-radius: 10px;
}

.sidebar-menu-container::-webkit-scrollbar-thumb:hover {
    background: rgba(67, 97, 238, 0.8);
}

/* Make sure the last nav-link (logout) stays at bottom */
.sidebar-menu-container .nav-link:last-child {
    margin-top: auto;
    margin-bottom: 20px;
}
#viewModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

#viewModal .modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}
/* Add to existing CSS */
#viewBillModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

#viewBillModal .modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}
    