:root {
    --primary-color: #5e35b1; /* Spiritual Violet */
    --primary-light: #d1c4e9;
    --accent-color: #ffca28; /* Golden Light */
    --text-dark: #2c3e50;
    --text-light: #546e7a;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --white-glass: rgba(255, 255, 255, 0.85);
    --shadow-soft: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    
    /* Status Colors */
    --color-male: #fff3e0; /* Soft Orange */
    --color-male-border: #ffb74d;
    --color-female: #fce4ec; /* Soft Pink */
    --color-female-border: #f06292;
    --color-maintenance: #eceff1;
    --color-maintenance-text: #78909c;
    --color-full: #ffebee;
}

* { box-sizing: border-box; }

body {
    font-family: 'Outfit', sans-serif;
    margin: 0;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-dark);
}

.main-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: white;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 20px rgba(0,0,0,0.05);
    z-index: 10;
}

.logo-area {
    text-align: center;
    margin-bottom: 3rem;
}
.logo-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.logo-area h2 { margin: 0; color: var(--primary-color); letter-spacing: 1px; font-weight: 600; }

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-light);
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
}
.nav-menu a.active, .nav-menu a:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(94, 53, 177, 0.3);
}
.nav-menu .icon { margin-right: 12px; font-size: 1.2rem; }

.quote-card {
    margin-top: auto;
    background: #f3e5f5;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    font-style: italic;
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    padding: 1.5rem 2rem;
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-bar h1 { margin: 0; font-size: 1.5rem; color: var(--text-dark); }
.user-profile { display: flex; align-items: center; gap: 1rem; font-weight: 500; }
.avatar { 
    width: 40px; height: 40px; background: var(--primary-color); color: white; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
}

.scrollable-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

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

.floor-panel {
    background: var(--white-glass);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
}
.floor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 0.5rem;
}
.floor-header h3 { margin: 0; color: var(--primary-color); }
.room-count { background: #eee; padding: 4px 8px; border-radius: 20px; font-size: 0.8rem; }

.rooms-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

/* Modern Table - Refined & Fixed */
/* Modern Table - Refined & Spaced */
.modern-table {
    width: 100%;
    border-collapse: separate; 
    border-spacing: 0;
    background: transparent;
    margin-bottom: 0;
    table-layout: fixed;
}
.modern-table thead {
    background: #f9fafb;
}
.modern-table th {
    padding: 20px 25px;
    text-align: left;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    border-bottom: 2px solid #edf2f7;
}
.modern-table th:first-child { border-top-left-radius: 12px; padding-left: 30px; }
.modern-table th:last-child { border-top-right-radius: 12px; padding-right: 30px; }

.modern-table td {
    padding: 24px 25px;
    border-bottom: 1px solid #f1f3f5;
    vertical-align: middle;
    color: #444;
}
.modern-table td:first-child { padding-left: 30px; }
.modern-table td:last-child { padding-right: 30px; }

.modern-table tr:last-child td { border-bottom: none; }
.modern-table tr:hover td { background-color: #f8f9fa; transition: background 0.2s; }

/* Center Align Helpers */
.text-center { text-align: center; }
.empty-state-cell { 
    text-align: center !important; 
    padding: 60px 20px !important; 
    background: #fff;
}

/* Table Content Styling */
.td-guest-name { font-weight: 600; font-size: 1.05rem; display: block; margin-bottom: 4px; color: #2c3e50; }
.td-sub-text { font-size: 0.85rem; color: #888; display: block; line-height: 1.4; }
.td-date-label { color: #888; font-size: 0.8rem; margin-right: 5px; }
.td-date-val { font-weight: 500; font-size: 0.95rem; }

/* Status Badges - Refined */
/* Status Badges - Refined */
.status-badge {
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    margin-left: 5px;
}

/* Lowercase classes - High Specificity */
.status-badge.pending, .modern-table .status-badge.pending { 
    background-color: #fff8e1 !important; 
    color: #f57f17 !important; 
    border: 1px solid #ffe082 !important; 
}
.status-badge.approved, .modern-table .status-badge.approved { 
    background-color: #e8f5e9 !important; 
    color: #2e7d32 !important; 
    border: 1px solid #c8e6c9 !important; 
}
.status-badge.rejected, .modern-table .status-badge.rejected { 
    background-color: #ffebee !important; 
    color: #c62828 !important; 
    border: 1px solid #ffcdd2 !important; 
}

/* Room Status Badges */
.status-badge.available { 
    background-color: #e8f5e9 !important; 
    color: #2e7d32 !important; 
    border: 1px solid #c8e6c9 !important; 
}
.status-badge.full { 
    background-color: #ffebee !important; 
    color: #c62828 !important; 
    border: 1px solid #ffcdd2 !important; 
}
.status-badge.maintenance { 
    background-color: #eceff1 !important; 
    color: #78909c !important; 
    border: 1px solid #cfd8dc !important; 
}
.status-badge.male { 
    background-color: #fff3e0 !important; 
    color: #ef6c00 !important; 
    border: 1px solid #ffe0b2 !important; 
}
.status-badge.female { 
    background-color: #fce4ec !important; 
    color: #ec407a !important; 
    border: 1px solid #f8bbd0 !important; 
}

/* Title Case Support - Just in case */
.status-badge.Pending { background-color: #fff8e1 !important; color: #f57f17 !important; border: 1px solid #ffe082 !important; }
.status-badge.Approved { background-color: #e8f5e9 !important; color: #2e7d32 !important; border: 1px solid #c8e6c9 !important; }
.status-badge.Rejected { background-color: #ffebee !important; color: #c62828 !important; border: 1px solid #ffcdd2 !important; }

/* Room Allocation Badge */
.room-badge {
    background: #e3f2fd;
    color: #1565c0;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
    border: 1px solid #bbdefb;
    font-size: 0.9rem;
}

/* Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.6); 
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s forwards;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 40px;
    border-radius: 16px;
    width: 90%; 
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    position: relative;
    text-align: center;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #ccc;
    font-size: 24px;
    transition: color 0.2s;
}
.close:hover { color: #333; }

/* Success Animation */
.checkmark-wrapper { margin-bottom: 20px; }
.checkmark-circle {
    width: 60px; height: 60px; border-radius: 50%; background: #4caf50;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 20px rgba(76, 175, 80, 0.3);
}
.checkmark {
    width: 30px;
    height: 15px;
    border-left: 4px solid white;
    border-bottom: 4px solid white;
    transform: rotate(-45deg) translate(2px, -2px);
}


@media print {
    body * { visibility: hidden; }
    .slip-card, .slip-card * { visibility: visible; }
    .slip-card { position: absolute; left: 0; top: 0; width: 100%; border: none; box-shadow: none; }
    .no-print { display: none; }
}
/* Mobile Responsiveness */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    background: #f0f0f0;
    width: 40px; height: 40px;
    border-radius: 8px;
    align-items: center; justify-content: center;
}

.sidebar-overlay {
    display: none;
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 9;
    backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .desktop-only { display: none; }
    
    .sidebar {
        position: fixed;
        left: -280px; top: 0; bottom: 0;
        width: 260px;
        transition: left 0.3s ease;
        z-index: 20;
    }
    .sidebar.active { left: 0; }
    
    .sidebar-overlay.active { display: block; }
    
    .top-bar { padding: 1rem; }
    .top-bar h1 { font-size: 1.2rem; }
    
    .dashboard-grid { grid-template-columns: 1fr; }
    
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    
    .booking-card { padding: 1.5rem; border-radius: 0; height: 100vh; overflow-y: auto; max-width: 100%;}
    .booking-header h2 { font-size: 1.5rem; }
    
    /* Modal adjustment */
    .glass-modal { width: 95%; padding: 1.5rem; }
    .guest-list-container { max-height: 300px; }
    
    /* Always show quick book button on mobile */
    .quick-book-btn { 
        opacity: 1 !important; 
        transform: scale(1) !important;
        width: 32px; height: 32px; bottom: 10px; right: 10px; 
    }
    
    /* Ensure profile is visible */
    .user-profile { gap: 0.5rem; }
    .avatar { width: 32px; height: 32px; font-size: 0.9rem; }
}
/* Booking Form Wrapper to fix vertical stacking */
.booking-wrapper { 
    display: flex; 
    justify-content: center; 
    flex-direction: column; 
    align-items: center; 
    padding: 2rem 0; 
}
.booking-card {
    background: white; width: 100%; max-width: 800px;
    border-radius: 20px; padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}
.booking-header { text-align: center; margin-bottom: 2rem; border-bottom: 2px solid #f0f0f0; padding-bottom: 1rem; }
.booking-header h2 { font-size: 2rem; margin: 0; color: var(--primary-color); }

.form-section { margin-bottom: 2rem; }
.form-section h3 { font-size: 1rem; text-transform: uppercase; color: var(--text-light); letter-spacing: 1px; margin-bottom: 1rem; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.9rem; }
input, select {
    width: 100%; padding: 12px; border: 1px solid #e0e0e0;
    border-radius: 8px; font-size: 1rem; transition: border 0.3s;
    background: #f9f9f9;
}
input:focus, select:focus { border-color: var(--primary-color); outline: none; background: white; }

.btn-primary {
    background: var(--primary-color); color: white; border: none;
    padding: 12px 24px; border-radius: 8px; cursor: pointer;
    font-size: 1rem; font-weight: 600; transition: transform 0.1s;
}
.btn-primary.btn-lg { width: 100%; padding: 16px; font-size: 1.1rem; margin-top: 1rem; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    background: #f5f5f5; color: #333; border: 1px solid #ddd;
    padding: 12px 24px; border-radius: 8px; cursor: pointer;
    font-size: 1rem; font-weight: 500; transition: all 0.2s;
    display: inline-block;
}
.btn-secondary:hover { background: #e0e0e0; border-color: #ccc; }


/* --- RESTORED ROOM CARD STYLES --- */

.room-card-modern {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
}
.room-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: var(--primary-light);
}

/* Status Variations */
.room-card-modern.selected { ring: 2px solid var(--primary-color); }
.room-card-modern.maintenance { background: #fdfdfd; border-color: #eee; opacity: 0.8; }
.room-card-modern.restricted { background: #fafafa; opacity: 0.6; }

/* Gender Specific Borders/Accents */
.room-card-modern.male { border-left: 4px solid var(--color-male-border); background: linear-gradient(to right bottom, #fff, #fffbf7); }
.room-card-modern.female { border-left: 4px solid var(--color-female-border); background: linear-gradient(to right bottom, #fff, #fff5f8); }

.card-top { display: flex; justify-content: space-between; align-items: start; margin-bottom: 10px; }
.room-num { font-size: 1.2rem; font-weight: 700; color: var(--text-dark); }

.card-mid { margin-top: auto; }
.occupancy-bar {
    display: flex; gap: 4px; margin-bottom: 6px;
}
.dot {
    height: 6px; flex: 1; background: #eee; border-radius: 3px;
    transition: background 0.3s;
}
.dot.filled { background: var(--primary-color); }
.room-card-modern.male .dot.filled { background: var(--color-male-border); }
.room-card-modern.female .dot.filled { background: var(--color-female-border); }

.capacity-text { font-size: 0.8rem; color: #888; font-weight: 500; }

.guests-preview {
    display: flex; gap: -5px; margin-top: 10px;
    padding-top: 8px; border-top: 1px solid rgba(0,0,0,0.03);
}
.guest-dot {
    width: 24px; height: 24px; border-radius: 50%;
    background: #e0e0e0; color: #555;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: bold;
    border: 2px solid white;
    margin-right: -8px;
}

.quick-book-btn {
    position: absolute; bottom: 10px; right: 10px;
    width: 28px; height: 28px;
    background: var(--primary-color); color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    font-size: 1.2rem; line-height: 1;
    opacity: 0; transform: scale(0.8);
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(94, 53, 177, 0.3);
}
.room-card-modern:hover .quick-book-btn { opacity: 1; transform: scale(1); }

/* Modal Glass Fix */
.glass-modal {
    background: #ffffff;
    margin: auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%; 
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    position: relative;
    animation: slideUp 0.4s;
}

/* --- PRINT / SLIP LAYOUTS --- */
.print-layout {
    display: flex;
    justify-content: center;
    align-items: center; /* Center vertically if height allows */
    min-height: calc(100vh - 100px); /* Adjust for header */
    padding: 2rem;
    background: transparent; /* Main bg shows through */
}

.slip-card {
    background: #ffffff;
    width: 100%;
    max-width: 380px; /* Standard Receipt Width */
    padding: 2.5rem 2rem;
    border-radius: 1px; /* Slight roundness or 0 for thermal look */
    box-shadow: 0 15px 35px rgba(0,0,0,0.1), 0 5px 15px rgba(0,0,0,0.05);
    position: relative;
    border-top: 5px solid var(--primary-color);
    margin: 0 auto;
}
/* Jagged edge effect or simple border */
.slip-card::after {
    content: "";
    display: block;
    height: 10px;
    background: radial-gradient(circle, transparent 70%, white 75%) 50% 0/10px 10px;
    /* Optional decorative effect for bottom of receipt */
}

.room-list-card {
    background: #ffffff;
    width: 100%;
    max-width: 700px;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    border-top: 5px solid var(--primary-color);
    margin: 0 auto;
}

.slip-top { text-align: center; margin-bottom: 2rem; }
.org-info h1 { margin: 0; font-size: 1.5rem; color: var(--primary-color); font-weight: 700; }
.org-info p { margin: 5px 0 0; color: #888; font-size: 0.9rem; letter-spacing: 0.5px; text-transform: uppercase; }

.slip-divider {
    height: 1px;
    background: #eee;
    margin: 1.5rem 0;
    border-bottom: 1px dashed #ddd; /* Dashed line for receipt feel */
    background: none;
}

/* Booking Meta in Slip */
.booking-meta {
    display: flex; justify-content: space-between;
    color: #999; font-size: 0.85rem; font-family: monospace;
    margin-bottom: 1.5rem;
}

/* Room Highlight in Slip */
.room-highlight {
    text-align: center; margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #e0e0e0;
}
.room-highlight .big-number { font-size: 3.5rem; font-weight: 800; color: var(--text-dark); line-height: 1; margin-bottom: 0.5rem; }
.room-highlight .sub-text { color: #666; font-weight: 500; font-size: 0.95rem; }

/* Guest Table / Key-Value Grid */
.guest-table {
    display: flex; flex-direction: column; gap: 0.8rem;
}
.guest-table .row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.95rem;
}
.guest-table .lbl { color: #888; font-weight: 500; }
.guest-table .val { color: #000; font-weight: 600; text-align: right; }

.spiritual-quote {
    text-align: center;
    font-style: italic;
    color: var(--primary-color);
    margin: 2rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.actions {
    display: flex; justify-content: center; gap: 1rem; margin-top: 2rem; align-items: center;
}

/* Room List Specifics */
.room-header-large { text-align: center; margin: 1rem 0; }
.room-header-large .label { display: block; font-size: 0.9rem; color: #888; text-transform: uppercase; letter-spacing: 1px; }
.room-header-large .number { font-size: 4rem; font-weight: 800; color: var(--primary-color); line-height: 1; margin: 5px 0; }
.room-header-large .meta { font-size: 1rem; color: #555; background: #f5f5f5; display: inline-block; padding: 5px 15px; border-radius: 20px; }

.simple-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin-top: 1rem; }
.simple-table th { text-align: left; color: #888; font-weight: 600; padding: 12px 8px; border-bottom: 2px solid #eee; text-transform: uppercase; font-size: 0.8rem; }
.simple-table td { padding: 12px 8px; border-bottom: 1px solid #f9f9f9; color: #333; }
.simple-table tr:last-child td { border-bottom: none; }

/* --- PRINT STYLES --- */
@media print {
    @page { 
        margin: 0; 
        size: auto; 
    }
    
    body { 
        margin: 0; 
        padding: 0; 
        background: white; 
        -webkit-print-color-adjust: exact; 
        print-color-adjust: exact;
    }

    /* Hide standard UI elements */
    .sidebar, .top-bar, .actions, .no-print, .btn-primary, .btn-text, .close, .main-layout > .sidebar-overlay, .menu-toggle {
        display: none !important;
    }
    
    .main-layout {
        display: block !important;
        margin: 0;
        padding: 0;
        height: auto;
        overflow: visible;
    }
    
    .scrollable-content {
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    /* Ensure print layout is visible */
    .print-layout {
        display: flex !important;
        align-items: flex-start;
        justify-content: center;
        background: white;
        width: 100%;
        height: auto;
        position: relative;
    }

    .slip-card, .room-list-card {
        border: 1px solid #ddd !important;
        /* Allow width to stay as defined in main CSS or max-width */
        margin: 20px auto !important; /* Center it */
        padding: 30px !important;
        visibility: visible !important;
        background: white !important;
    }
    
    .room-list-card {
        width: 600px !important; /* Force the list card width */
        max-width: 95% !important;
    }
    
    .slip-card {
        width: 350px !important; /* Force slip width */
    }
    
    /* Reveal content inside */
    .slip-card *, .room-list-card * {
        visibility: visible !important;
    }
    
    .spiritual-quote {
        border-top: 1px solid #eee;
        padding-top: 10px;
    }
    
    /* Ensure table borders print */
    .simple-table th, .simple-table td {
        border-bottom: 1px solid #ccc !important;
    }
}
