:root {
    --primary-color: #0B1F38; /* Deep Royal Navy */
    --secondary-color: #D4AF37; /* Classic Gold */
    --dark-color: #1a1a1a;
    --light-color: #fcfbf8;
    --danger-color: #c0392b;
    --success-color: #D4AF37; /* Re-mapped Success to Gold for Sales */
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    --card-bg: rgba(255, 255, 255, 0.98);
    --glass-shadow: 0 10px 40px -10px rgba(11, 31, 56, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--dark-color);
    display: flex;
}

/* Sidebar Navbar */
.sidebar {
    width: 250px;
    background: var(--primary-color);
    backdrop-filter: blur(10px);
    height: 100vh;
    padding: 2rem 1rem;
    box-shadow: 5px 0 25px rgba(0,0,0,0.2);
    position: fixed;
    z-index: 999;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-weight: 800;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 1rem;
}

.sidebar ul li a {
    text-decoration: none;
    color: #e2e8f0;
    display: block;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar ul li a:hover, .sidebar ul li a.active {
    background: var(--secondary-color);
    color: var(--primary-color);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    font-weight: 700;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    padding: 2.5rem;
    width: calc(100% - 250px);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    margin-bottom: 1.5rem; border: 1px solid rgba(255,255,255,0.18);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.05);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 700px;
}

table th, table td {
    padding: 1rem 1.2rem;
    text-align: left;
    border-bottom: 1px solid #edf2f7;
    white-space: nowrap;
}

table th {
    background-color: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

table tr:hover {
    background-color: #fcfcfc;
}

table td {
    font-size: 0.95rem;
    color: #4a5568;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: #153359; }
.btn-success { background: var(--secondary-color); color: var(--primary-color); }
.btn-success:hover { background: #C5A059; }
.btn-danger { background: var(--danger-color); color: white; border: 1px solid #a93226;}
.btn-danger:hover { background: #a93226; }

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: var(--primary-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
    z-index: 1000;
}
.modal.active { display: flex; }
.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Receipt Styles - hidden on screen, shown on print */
#receipt-container { display: none; }

@media print {
    body * { visibility: hidden; }
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 0; width: 100%; }
    
    #receipt-container, #receipt-container * {
        visibility: visible;
    }
    #receipt-container {
        display: block;
        position: absolute;
        left: 0; top: 0;
        width: 100%;
    }
    .receipt-box {
        max-width: 800px; margin: auto; padding: 30px;
        border: 1px solid #eee;
        box-shadow: none; font-size: 16px; line-height: 24px; font-family: 'Helvetica Neue', 'Helvetica', sans-serif;
        color: #555;
    }
    .receipt-box table { width: 100%; line-height: inherit; text-align: left; }
    .receipt-box table td { padding: 5px; vertical-align: top; }
    .receipt-box .heading td { background: #eee; border-bottom: 1px solid #ddd; font-weight: bold; }
    .receipt-box .item td { border-bottom: 1px solid #eee; }
    .receipt-box .total td { border-top: 2px solid #eee; font-weight: bold; }
    .print-hide { display: none !important; }
}

/* Mobile Navigation Header */
.mobile-header {
    display: none;
    background: var(--primary-color);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 998;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    align-items: center;
}

.mobile-header .menu-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
    margin-right: 1.5rem;
}

.mobile-header .mobile-logo {
    font-weight: 800;
    color: var(--secondary-color);
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }
    
    .mobile-header {
        display: flex;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .header h2 {
        font-size: 1.5rem;
    }
    
    .glass-card {
        padding: 1rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-success { background: rgba(42, 157, 143, 0.1); color: #2A9D8F; }
.badge-cancelled { background: rgba(192, 57, 43, 0.1); color: #C0392B; }

.row-cancelled {
    opacity: 0.6;
    background-color: #f8f8f8 !important;
}

/* DataTables Styling Overrides */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 5px 10px;
    margin-bottom: 10px;
    outline: none;
}
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--secondary-color);
}
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 3px;
    outline: none;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current, 
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--secondary-color) !important;
    border: 1px solid var(--secondary-color) !important;
    color: var(--primary-color) !important;
    font-weight: 700 !important;
    border-radius: 8px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary-color) !important;
    color: white !important;
    border-radius: 8px;
    border: 1px solid var(--primary-color) !important;
}
.dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_paginate {
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--primary-color) !important;
}
table.dataTable thead th {
    border-bottom: none !important;
    background-color: var(--primary-color) !important;
    color: white !important;
}
table.dataTable.no-footer {
    border-bottom: 1px solid #edf2f7 !important;
}
.dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_length {
    color: var(--primary-color) !important;
    font-weight: 500;
}
