:root {
    --primary: #1a237e;
    --primary-light: #3949ab;
    --primary-dark: #0d1642;
    --accent: #ff6f00;
    --accent-light: #ffa040;
    --success: #2e7d32;
    --warning: #f57f17;
    --danger: #c62828;
    --info: #0277bd;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    --font-sans: 'Sarabun', 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: var(--font-sans);
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    padding-top: 80px;
}

/* Navbar */
.navbar {
    background: transparent !important;
    transition: all 0.3s ease;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar.scrolled {
    background: white !important;
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
}

.navbar.scrolled .nav-link {
    color: var(--gray-800) !important;
}

.navbar.scrolled .navbar-brand {
    color: var(--primary) !important;
}

.navbar .nav-link {
    color: white !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
    position: relative;
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.navbar .nav-link:hover::after {
    width: 60%;
}

.navbar.scrolled .nav-link::after {
    background: var(--primary);
}

.navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
    color: white !important;
    transition: color 0.3s ease;
}

.navbar-brand i {
    color: var(--accent);
}

.navbar.scrolled .navbar-brand i {
    color: var(--accent);
}

.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white !important;
    padding: 0.4rem 0.65rem;
    font-size: 1.1rem;
    background: transparent;
}

.navbar.scrolled .navbar-toggler {
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: var(--gray-800) !important;
}

.navbar-logo {
    height: 36px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.navbar.scrolled .navbar-logo {
    height: 32px;
}

@media (max-width: 991.98px) {
    .navbar .navbar-collapse {
        background: white;
        border-radius: 8px;
        margin-top: 0.75rem;
        padding: 0.75rem 1rem;
        box-shadow: var(--shadow-md);
    }

    .navbar .navbar-collapse .nav-link {
        color: var(--gray-800) !important;
    }

    .navbar .navbar-collapse .nav-link::after {
        background: var(--primary);
    }

    .navbar.scrolled .navbar-collapse .nav-link,
    .navbar:not(.scrolled) .navbar-collapse.show .nav-link,
    .navbar:not(.scrolled) .navbar-collapse.collapsing .nav-link {
        color: var(--gray-800) !important;
    }
}

/* Banner Popup */
.banner-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.banner-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.banner-popup-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.banner-popup-overlay.show .banner-popup-content {
    transform: scale(1);
}

.banner-popup-content img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.banner-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.banner-popup-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.profile-dropdown .dropdown-toggle::after {
    display: none;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: white;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
    margin-top: -80px;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.05)" d="M0,96L48,112C96,128,192,160,288,186.7C384,213,480,235,576,213.3C672,192,768,128,864,128C960,128,1056,192,1152,208C1248,224,1344,192,1392,176L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    position: relative;
}

/* Search Section */
.search-section {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-top: -40px;
    position: relative;
    z-index: 10;
}

/* Room Cards */
.room-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
}

.room-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.room-card .room-image {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.room-card .room-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(26, 35, 126, 0.9);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.room-card .room-capacity {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    backdrop-filter: blur(4px);
}

.room-card .room-body {
    padding: 1.25rem;
}

.room-card .room-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.room-card .room-department {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
}

.room-card .room-facilities {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.room-card .facility-tag {
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* Seat Layout */
.seat-container {
    display: grid;
    gap: 4px;
    padding: 1rem;
    position: relative;
}

.seat-item {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.seat-item.available {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.seat-item.available:hover {
    background: #4caf50;
    color: white;
}

.seat-item.available.selected {
    background: #1a237e;
    border-color: #1a237e;
    color: white;
}

.seat-item.reserved {
    background: #fff3e0;
    border-color: #ff9800;
    color: #e65100;
    cursor: not-allowed;
}

.seat-item.occupied {
    background: #fce4ec;
    border-color: #f44336;
    color: #c62828;
    cursor: not-allowed;
}

.seat-item.disabled {
    background: #f5f5f5;
    border-color: #9e9e9e;
    color: #9e9e9e;
    cursor: not-allowed;
}

.seat-item.maintenance {
    background: #fff8e1;
    border-color: #ffc107;
    color: #f57f17;
    cursor: not-allowed;
}

/* Cinema Layout */
.cinema-screen {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: 4px;
}

/* Calendar Customization */
.fc {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
}

.fc .fc-toolbar-title {
    font-size: 1.2rem !important;
    font-weight: 600;
}

.fc .fc-button-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
    background: var(--primary-dark) !important;
}

.fc .fc-daygrid-event {
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 0.8rem;
}

.fc-event {
    border-width: 0 !important;
    transition: opacity 0.2s ease;
}
.fc-event:hover {
    opacity: 0.5;
}
.fc-daygrid-dot-event {
    color: #fff !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    margin-bottom: 2px !important;
    transition: opacity 0.2s ease;
    border-width: 0 !important;
}
.fc-daygrid-dot-event:hover {
    opacity: 0.5;
}
.fc-daygrid-dot-event .fc-event-title {
    font-weight: 500;
    color: #fff;
}
.fc-daygrid-dot-event .fc-event-time {
    display: none !important;
}
.fc-daygrid-dot-event .fc-daygrid-event-dot {
    display: none;
}
.fc-daygrid-event {
    color: #fff !important;
    transition: opacity 0.2s ease;
    border-width: 0 !important;
}
.fc-daygrid-event:hover {
    opacity: 0.5;
}
.fc-daygrid-event .fc-event-title {
    color: #fff;
}
.fc-daygrid-event .fc-event-time {
    display: none !important;
}

/* FC Event popup tooltip */
.fc-event-popup {
    position: fixed;
    z-index: 99999;
    width: 260px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}
.fc-event-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.fc-event-popup .popup-header {
    padding: 10px 14px;
    color: #fff;
    font-size: 0.9rem;
}
.fc-event-popup .popup-body {
    padding: 10px 14px;
}
.fc-event-popup .popup-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 0.82rem;
}
.fc-event-popup .popup-label {
    color: #888;
    font-size: 0.78rem;
    min-width: 50px;
}

/* Dashboard Cards */
.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-card .stat-label {
    font-size: 0.9rem;
    color: var(--gray-600);
}

/* Forms */
.form-control, .form-select {
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
    padding: 0.6rem 1rem;
    font-family: var(--font-sans);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(26, 35, 126, 0.1);
}

.input-group-text {
    border-radius: var(--radius);
}

/* Tables */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-700);
    padding: 1rem;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

/* Buttons */
.btn {
    border-radius: var(--radius);
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: #e65100;
    border-color: #e65100;
    color: white;
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

/* Badge */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.card-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--radius);
}

/* Authentication Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 2rem;
}

.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
}

.auth-card .auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card .auth-logo img {
    height: 60px;
}

.auth-card .auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-card .auth-subtitle {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 2rem;
}

/* Sidebar - Modern Design */
.sidebar {
    background: linear-gradient(180deg, #0d1642 0%, #1a237e 50%, #283593 100%);
    color: white;
    height: 100vh;
    width: 270px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 900;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 20px rgba(0,0,0,0.15);
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.sidebar .sidebar-brand {
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1;
    backdrop-filter: blur(8px);
}

.sidebar .sidebar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.sidebar .sidebar-profile {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar .sidebar-profile .avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.2);
}

.sidebar .sidebar-profile .info .name {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.sidebar .sidebar-profile .info .role {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
}

.sidebar .sidebar-section {
    padding: 1rem 1.25rem 0.35rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.3);
    font-weight: 600;
}

.sidebar .sidebar-nav {
    padding: 0.25rem 0.75rem;
    flex: 1;
}

.sidebar .sidebar-nav .nav-item {
    list-style: none;
    margin-bottom: 1px;
}

.sidebar .sidebar-nav .nav-link {
    color: rgba(255,255,255,0.65);
    padding: 0.65rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.25s ease;
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.88rem;
    position: relative;
}

.sidebar .sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar .sidebar-nav .nav-link.active {
    background: rgba(255,255,255,0.12);
    color: white;
    font-weight: 500;
}

.sidebar .sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: -0.65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.sidebar .sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sidebar .sidebar-nav .nav-link .link-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    background: rgba(255,255,255,0.08);
}

.sidebar .sidebar-nav .nav-link:hover .link-icon {
    background: rgba(255,255,255,0.15);
}

.sidebar .sidebar-nav .nav-link.active .link-icon {
    background: rgba(255,255,255,0.18);
}

.sidebar .sidebar-nav .nav-link .arrow {
    margin-left: auto;
    font-size: 0.6rem;
    transition: transform 0.3s ease;
    opacity: 0.5;
}

.sidebar .sidebar-nav .nav-link[aria-expanded="true"] .arrow {
    transform: rotate(90deg);
}

.sidebar .sidebar-nav .nav-link .badge-count {
    margin-left: auto;
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    font-weight: 600;
}

/* Sub-menu (nested) */
.sidebar .sub-nav {
    padding-left: 2.75rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease;
    opacity: 0;
}

.sidebar .sub-nav.open {
    max-height: 500px;
    opacity: 1;
}

.sidebar .sub-nav .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.83rem;
    color: rgba(255,255,255,0.5);
    gap: 0.6rem;
}

.sidebar .sub-nav .nav-link:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.06);
}

.sidebar .sub-nav .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.08);
}

.sidebar .sub-nav .nav-link .sub-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    flex-shrink: 0;
}

.sidebar .sub-nav .nav-link.active .sub-dot {
    background: var(--accent);
}

/* Sidebar footer */
.sidebar .sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: auto;
    position: sticky;
    bottom: 0;
    background: rgba(13,22,66,0.95);
    backdrop-filter: blur(8px);
}

.sidebar .sidebar-footer .nav-link {
    padding: 0.6rem 0.75rem;
    font-size: 0.83rem;
    color: rgba(255,255,255,0.5);
    border-radius: 8px;
}

.sidebar .sidebar-footer .nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.08);
}

/* Main content with sidebar */
.main-content {
    margin-left: 270px;
    padding: 2rem;
    min-height: 100vh;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .search-section {
        margin-top: -20px;
        padding: 1rem;
    }
    
    .sidebar {
        transform: translateX(-100%);
        z-index: 999;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 998;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    body {
        padding-top: 60px;
    }

    /* FullCalendar responsive — tablet */
    .fc {
        padding: 0.5rem;
    }
    .fc .fc-toolbar-title {
        font-size: 1rem !important;
    }
    .fc .fc-toolbar {
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .fc .fc-toolbar > * {
        flex: 0 0 auto;
    }
    .fc .fc-header-toolbar {
        flex-direction: column;
        align-items: center;
    }
    .fc .fc-header-toolbar .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    .fc .fc-button {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
    }
    .fc .fc-daygrid-day-frame {
        min-height: 60px;
    }
    .fc .fc-daygrid-day-number {
        font-size: 0.75rem;
    }
    .fc .fc-daygrid-event {
        font-size: 0.65rem;
        padding: 1px 3px;
    }
    .fc-daygrid-dot-event {
        padding: 1px 4px !important;
        font-size: 0.65rem;
    }
    .fc-event-popup {
        position: fixed;
        left: 50% !important;
        top: auto !important;
        bottom: 10px;
        transform: translateX(-50%) translateY(4px);
        width: calc(100% - 20px);
        max-width: 320px;
    }
    .fc-event-popup.show {
        transform: translateX(-50%) translateY(0);
    }
}

@media (max-width: 576px) {
    .fc {
        padding: 0.25rem;
    }
    .fc .fc-toolbar-title {
        font-size: 0.85rem !important;
    }
    .fc .fc-button {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.4rem !important;
    }
    .fc .fc-daygrid-day-frame {
        min-height: 45px;
    }
    .fc .fc-daygrid-day-number {
        font-size: 0.65rem;
    }
    .fc .fc-daygrid-event {
        font-size: 0.55rem;
        padding: 1px 2px;
    }
    .fc-daygrid-dot-event {
        font-size: 0.55rem;
        padding: 1px 3px !important;
    }
    .fc .fc-daygrid-more-link {
        font-size: 0.55rem;
    }
    /* Filter badges wrap */
    .container .d-flex.align-items-end .d-flex.gap-2 {
        flex-wrap: wrap;
    }
    .container .d-flex.align-items-end .d-flex.gap-2 .badge {
        font-size: 0.65rem;
    }
    /* Calendar page filter row */
    .row.g-3.mb-3 .col-md-4 {
        width: 100%;
    }
    .row.g-3.mb-3 .form-label {
        font-size: 0.75rem;
        margin-bottom: 0.15rem;
    }

    /* Booking workflow steps wrap */
    .booking-steps {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .booking-step {
        font-size: 0.8rem;
    }
    .booking-step .step-number {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    /* Room gallery responsive */
    .room-gallery-main {
        height: 220px;
    }
    .room-gallery-thumbs img {
        width: 60px;
        height: 45px;
    }

    /* Room grid for small screens */
    .room-grid {
        grid-template-columns: 1fr;
    }

    /* Stat cards row fix */
    .row.g-3.mb-4 .col-md-3,
    .row.g-3.mb-4 .col-md-4 {
        width: 50%;
    }

    /* Nav tabs scrollable on mobile */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    .nav-tabs .nav-item {
        flex-shrink: 0;
    }

    /* Hero CTA buttons */
    .hero-section .d-flex.gap-3 {
        flex-direction: column;
    }
    .hero-section .d-flex.gap-3 .btn {
        width: 100%;
    }

    /* Calendar filter row full width */
    .row.g-3.align-items-end .col-md-4 {
        width: 100%;
    }
}

/* Utilities */
.text-primary { color: var(--primary) !important; }
.bg-primary { background: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.bg-accent { background: var(--accent) !important; }

.cursor-pointer { cursor: pointer; }

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: rgba(255,255,255,0.7);
    padding: 3rem 0 1.5rem;
}

.footer h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: white;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid white;
    transform: translateX(-5px);
}

/* QR Code */
.qr-container {
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
    display: inline-block;
}

/* Department Selector */
.dept-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.dept-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dept-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.dept-card.active {
    border-color: var(--primary);
    background: rgba(26, 35, 126, 0.05);
}

.dept-card .dept-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

.dept-card .dept-name {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Department filter on homepage */
.department-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.department-filter-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.department-filter-card:hover,
.department-filter-card.active {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    background: rgba(26,35,126,0.03);
}

.department-filter-card .dept-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.department-filter-card .dept-name {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Room grid for homepage */
.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.room-card .room-image-wrapper {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: var(--gray-100);
}

.room-card .room-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.room-card .room-type-icon {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(26,35,126,0.9);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    backdrop-filter: blur(4px);
}

.room-card .room-dept-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    backdrop-filter: blur(4px);
}

/* Time slot radio buttons */
.time-slot-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    user-select: none;
}
.time-slot-btn:hover {
    border-color: var(--primary);
    background: rgba(26,35,126,0.05);
}
.time-slot-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.time-slot-btn.disabled {
    background: var(--gray-100);
    color: var(--gray-400);
    border-color: var(--gray-200);
    cursor: not-allowed;
    opacity: 0.7;
}
.time-slot-btn.disabled input {
    pointer-events: none;
}
.time-slot-btn input {
    display: none;
}

/* Time slots */
.time-slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.time-slot {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.time-slot:hover {
    border-color: var(--primary);
    background: rgba(26,35,126,0.05);
}

.time-slot.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.time-slot.booked {
    background: var(--gray-100);
    color: var(--gray-400);
    cursor: not-allowed;
}

/* Room gallery */
.room-gallery-main {
    width: 100%;
    height: 420px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    transition: opacity 0.3s ease;
}
.room-gallery-thumbs {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}
.room-gallery-thumbs img {
    width: 90px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.2s ease, opacity 0.2s ease;
    flex-shrink: 0;
}
.room-gallery-thumbs img:hover {
    opacity: 0.85;
}
.room-gallery-thumbs img.active {
    border-color: var(--primary);
    opacity: 1;
}

/* Booking workflow steps */
.booking-steps {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.booking-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-400);
    font-size: 0.9rem;
}

.booking-step .step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.booking-step.active {
    color: var(--primary);
}

.booking-step.active .step-number {
    background: var(--primary);
    color: white;
}

.booking-step.completed {
    color: var(--success);
}

.booking-step.completed .step-number {
    background: var(--success);
    color: white;
}
