:root {
    /* Color Palette */
    --bg-primary: #fcfcfc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f5f6f8;
    
    --accent-saffron: #f39c12;      /* Warm Saffron */
    --accent-saffron-hover: #e67e22; 
    --accent-basil: #2ecc71;        /* Fresh Basil Green */
    --accent-terracotta: #d35400;   /* Rich Terracotta */
    
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #ecf0f1;
    
    /* Shadows */
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 30px rgba(243, 156, 18, 0.15);
    
    /* Typography */
    --font-family: 'Poppins', sans-serif;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--accent-saffron);
    background: rgba(243, 156, 18, 0.1);
    padding: 10px;
    border-radius: var(--radius-md);
}

.sidebar-nav {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(243, 156, 18, 0.08);
    color: var(--accent-saffron);
}

.nav-item.active {
    background-color: var(--accent-saffron);
    color: white;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
}

.topbar {
    height: 70px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-saffron);
}

.content-views {
    padding: 32px;
    flex: 1;
}

.view-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.view-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.view-header p {
    color: var(--text-muted);
}

/* Cards & Containers */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(243, 156, 18, 0.2);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(243, 156, 18, 0.1);
    color: var(--accent-saffron);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-details h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Typography & Utilities */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--accent-saffron);
    color: white;
    box-shadow: 0 4px 10px rgba(243, 156, 18, 0.3);
}

.btn-primary:hover {
    background-color: var(--accent-saffron-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(243, 156, 18, 0.4);
}

.btn-secondary {
    background-color: var(--accent-basil);
    color: white;
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3);
}

.btn-secondary:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.4);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid #dcdde1;
}

.btn-outline:hover {
    border-color: var(--accent-saffron);
    color: var(--accent-saffron);
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

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

.data-table th, .data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background-color: var(--bg-tertiary);
}

.data-table img {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

/* Forms */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.form-row .form-group {
    margin-bottom: 0;
}

label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 8px;
}

input, select, textarea {
    padding: 12px 16px;
    border: 1px solid #dcdde1;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: #fcfcfc;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-saffron);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
    background-color: #fff;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: translateY(20px) scale(0.95);
    transition: var(--transition);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-lg {
    max-width: 800px;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--accent-terracotta);
}

.modal-body {
    padding: 24px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.category-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(243, 156, 18, 0.2);
}

.category-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.category-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.category-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: var(--transition);
    display: flex;
    gap: 5px;
}

.category-card:hover .category-actions {
    opacity: 1;
}

.icon-btn {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-main);
}

.icon-btn.delete:hover {
    color: var(--accent-terracotta);
    border-color: var(--accent-terracotta);
}

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    min-height: 120px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Quotation Builder */
.quotation-builder {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
}

.quote-summary {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-top: 20px;
}

.quote-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
}

.quote-row:last-child {
    border-bottom: none;
}

.quote-row.total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-terracotta);
    padding-top: 15px;
}

/* Menu Selection Grid */
.menu-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.menu-select-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.menu-select-item:hover {
    background: var(--bg-tertiary);
}

.menu-select-item.selected {
    border-color: var(--accent-saffron);
    background: rgba(243, 156, 18, 0.05);
}

.menu-select-item img {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.menu-select-info h4 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.menu-select-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Status Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-pending {
    background: rgba(243, 156, 18, 0.1);
    color: var(--accent-saffron);
}

.badge-confirmed {
    background: rgba(46, 204, 113, 0.1);
    color: var(--accent-basil);
}

.badge-completed {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

/* Responsive */
@media (max-width: 992px) {
    .quotation-builder {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .topbar {
        padding: 0 20px;
    }
    
    .content-views {
        padding: 20px;
    }
}

/* Dashboard Calendar */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 10px; }
.calendar-day { background: #fff; border: 1px solid var(--border-color); border-radius: 6px; padding: 10px; text-align: center; cursor: pointer; min-height: 60px; display: flex; align-items: center; justify-content: center; font-weight: 500; transition: all 0.2s ease; }
.calendar-day:hover:not(.empty) { background: #fdf3e7; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.calendar-day.empty { background: transparent; border: none; cursor: default; }
.calendar-day.today { border: 2px solid var(--accent-basil); font-weight: bold; }
.calendar-day.has-booking { background-color: var(--accent-saffron); color: white; border: none; box-shadow: 0 4px 10px rgba(243, 156, 18, 0.2); }
.calendar-day.has-booking:hover { background-color: #d68910; }
.calendar-day.selected { border: 3px solid var(--accent-basil); transform: scale(1.05); z-index: 10; }
.calendar-controls h4 { color: var(--text-dark); }

/* --- CSS Utility Classes & Layout Helper Tokens --- */
.d-flex { display: flex !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.text-center { text-align: center !important; }
.text-muted { color: var(--text-muted) !important; }
.w-100 { width: 100% !important; }

/* Spacing Helpers */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.p-3 { padding: 24px !important; }

/* Button & Badge Sizing */
.btn-sm { padding: 6px 12px !important; font-size: 0.85rem !important; }
.badge { display: inline-block; padding: 6px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 500; }
.text-success { color: #2ecc71 !important; }
.text-muted { color: #7f8c8d !important; }

/* Custom Tab Controls */
.tab-controls { display: flex; gap: 10px; }
.tab-controls .btn.active {
    background-color: var(--accent-saffron);
    color: white !important;
    border-color: var(--accent-saffron);
    box-shadow: 0 4px 10px rgba(243, 156, 18, 0.3);
}

/* Pagination Spacers */
.pagination-info {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

/* --- Premium Modal Filter Bar & Grid Alignments --- */
.modal-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.filter-group, .search-group {
    display: flex;
    align-items: center;
    position: relative;
    flex: 1;
}

.filter-group {
    max-width: 220px;
}

.search-group {
    max-width: 320px;
}

.filter-icon, .search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 5;
}

.filter-select, .filter-search {
    width: 100%;
    padding: 8px 12px 8px 36px !important;
    border: 1px solid #dcdde1;
    border-radius: var(--radius-sm);
    font-size: 0.9rem !important;
    height: 38px;
    transition: var(--transition);
    background: var(--bg-secondary);
}

.filter-select:focus, .filter-search:focus {
    border-color: var(--accent-saffron);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
    outline: none;
    background: #fff;
}

@media (max-width: 576px) {
    .modal-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group, .search-group {
        max-width: 100%;
    }
}

/* --- Print-Ready Styling for Booking Invoice & Receipts --- */
@media print {
    body * {
        visibility: hidden;
    }
    
    #order-details-modal, #order-details-modal * {
        visibility: visible;
    }
    
    #order-details-modal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        background: none !important;
        backdrop-filter: none !important;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    #order-details-modal .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        box-shadow: none !important;
        transform: none !important;
        margin: 0 !important;
        padding: 20px !important;
        border: none !important;
        background: #fff !important;
        color: #000 !important;
    }
    
    #order-details-modal .modal-header h3 {
        font-size: 1.8rem !important;
        font-weight: 700 !important;
        border-bottom: 2px solid #333 !important;
        padding-bottom: 10px !important;
        margin-bottom: 20px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    #order-details-modal .modal-actions, 
    #order-details-modal .close-btn {
        display: none !important;
    }
    
    /* Clean layout formatting for print tables and cards */
    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        background: #fff !important;
        page-break-inside: avoid !important;
        margin-top: 15px !important;
        padding: 15px !important;
    }
    
    .badge {
        border: 1px solid #333 !important;
        background: none !important;
        color: #000 !important;
        padding: 3px 8px !important;
    }
}
