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

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

/* ===== NAVBAR ===== */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-weight: 500;
}

.btn-logout {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.875rem;
}

.btn-logout:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ===== STATISTICS CARDS ===== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
}

.stat-total {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-available {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-occupied {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-content h3 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* ===== ROOMS SECTION ===== */
.rooms-section {
    animation: fadeIn 0.5s ease;
}

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

.floor-section {
    margin-bottom: 2rem;
}

.floor-title {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-color);
    display: inline-block;
}

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

/* ===== ROOM CARD ===== */
.room-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border-left: 5px solid #d1d5db;
}

.room-kosong {
    border-left-color: var(--success-color);
}

.room-terpakai {
    border-left-color: var(--warning-color);
}

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

.room-header {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-header h3 {
    font-size: 1.125rem;
    color: var(--dark-color);
}

.room-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-kosong {
    background-color: #d1fae5;
    color: #065f46;
}

.status-terpakai {
    background-color: #fed7aa;
    color: #92400e;
}

.room-info {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    min-height: 60px;
}

.room-info p {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.room-user,
.room-time {
    color: var(--dark-color);
}

.room-actions {
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background-color: #4f46e5;
}

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

.btn-success:hover {
    background-color: #059669;
}

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

.btn-warning:hover {
    background-color: #d97706;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-update {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 1rem;
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease;
}

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

.login-logo {
    text-align: center;
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.login-box h1 {
    text-align: center;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.login-form {
    margin: 2rem 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.login-footer {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.text-center {
    text-align: center;
}

.small {
    font-size: 0.8rem;
    color: #6b7280;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

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

    /* Statistik tetap 3 kolom di mobile agar hemat ruang */
    .stats-container {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .65rem;
        margin-bottom: 1.25rem;
    }

    .stat-card {
        min-width: 0;
        padding: .8rem .45rem;
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: .45rem;
        border-radius: .65rem;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
        border-radius: .6rem;
        font-size: 1.25rem;
        flex-shrink: 0;
    }

    .stat-content h3 {
        font-size: 1.45rem;
        line-height: 1.1;
        margin-bottom: .2rem;
    }

    .stat-content p {
        font-size: .68rem;
        line-height: 1.2;
        white-space: normal;
    }

    .container {
        padding: 1rem;
    }

    .floor-title {
        font-size: 1.25rem;
    }

    .room-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .room-status {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    /* Tiga kartu tetap sejajar pada layar HP kecil */
    .stats-container {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .5rem;
    }

    .stat-card {
        padding: .65rem .3rem;
        gap: .35rem;
        border-radius: .55rem;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1.05rem;
        border-radius: .5rem;
    }

    .stat-content h3 {
        font-size: 1.25rem;
    }

    .stat-content p {
        font-size: .6rem;
        line-height: 1.15;
    }

    .container {
        padding-left: .75rem;
        padding-right: .75rem;
    }

    .rooms-grid {
        grid-template-columns: 1fr;
    }

    .login-box {
        padding: 1.5rem;
    }
}

/* ===== LOADING STATE ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ===== SUCCESS NOTIFICATION ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.375rem;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    z-index: 2000;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== PUBLIC VIEW ===== */
.public-badge {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.95;
}
.public-hero {
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    padding: 2.5rem 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.public-hero h1 { margin-bottom: .5rem; font-size: 2rem; }
.public-hero p { color: #6b7280; max-width: 760px; }
.public-refresh { margin-top: .75rem; font-size: .85rem; color: #6b7280; }
.public-notice {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #3730a3;
    padding: 1rem 1.25rem;
    border-radius: .75rem;
    margin-bottom: 2rem;
}
.public-room-actions { justify-content: center; color: #6b7280; font-size: .8rem; }
.public-available { color: #047857 !important; }
.back-public { color: var(--primary-color); text-decoration: none; font-weight: 600; }
.back-public:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .navbar-container { padding: .8rem 1rem; }
    .navbar-logo { font-size: 1.1rem; }
    .public-badge { display: none; }
    .public-hero { padding: 1.75rem 0 1rem; }
    .public-hero h1 { font-size: 1.5rem; }
    .rooms-grid { grid-template-columns: 1fr; }
}

/* ===== MANAGE ACCOUNTS ===== */
.manage-grid { display:grid; grid-template-columns:minmax(320px, .8fr) minmax(500px, 1.2fr); gap:1.5rem; }
.manage-card { background:#fff; border-radius:.75rem; padding:1.5rem; box-shadow:var(--shadow); }
.manage-card h2 { margin-bottom:.5rem; }
.alert-success { background:#d1fae5; color:#065f46; border-left:4px solid #10b981; padding:1rem; border-radius:.375rem; margin:1rem 0; }
.form-group select { width:100%; padding:.75rem; border:1px solid var(--border-color); border-radius:.375rem; background:#fff; font-size:1rem; }
.table-wrap { overflow-x:auto; margin-top:1rem; }
.account-table { width:100%; border-collapse:collapse; font-size:.9rem; }
.account-table th,.account-table td { padding:.75rem; border-bottom:1px solid var(--border-color); text-align:left; white-space:nowrap; }
.account-table th { background:#f3f4f6; }
.role-badge { padding:.2rem .55rem; border-radius:999px; background:#eef2ff; color:#3730a3; font-size:.72rem; font-weight:700; }
@media(max-width:900px){.manage-grid{grid-template-columns:1fr;}}

/* ===== PASSWORD MANAGEMENT ===== */
.btn-small { display:inline-block; padding:.45rem .7rem; font-size:.8rem; text-decoration:none; }
.alert-info { background:#e0f2fe; color:#075985; border-left:4px solid #0284c7; padding:.9rem 1rem; border-radius:.375rem; margin:1rem 0; }
.password-admin-note { font-size:.85rem; }
.password-box { max-width:460px; }

/* ===== MOBILE NAVBAR - RAPI & SEMUA MENU TERLIHAT ===== */
@media (max-width: 768px) {
    .navbar-container {
        width: 100%;
        padding: .8rem .75rem 1rem;
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        gap: .65rem;
    }

    .navbar-logo {
        justify-content: center;
        font-size: 1.25rem;
        gap: .45rem;
        line-height: 1.2;
    }

    .navbar-user {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem;
        align-items: stretch;
    }

    .navbar-user .user-name {
        grid-column: 1 / -1;
        text-align: center;
        font-size: .82rem;
        line-height: 1.25;
        padding: .15rem .25rem .1rem;
        overflow-wrap: anywhere;
    }

    .navbar-user .btn-logout {
        width: 100%;
        min-width: 0;
        min-height: 46px;
        padding: .55rem .4rem;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: .78rem;
        line-height: 1.2;
        white-space: normal;
    }
}

@media (max-width: 380px) {
    .navbar-container {
        padding-left: .55rem;
        padding-right: .55rem;
    }

    .navbar-logo {
        font-size: 1.1rem;
    }

    .navbar-user {
        gap: .4rem;
    }

    .navbar-user .btn-logout {
        min-height: 44px;
        font-size: .72rem;
        padding: .45rem .25rem;
    }
}

/* ===== TARGETED MOBILE FIXES =====
   Hanya berlaku untuk halaman publik (index) dan kelola akun.
*/
@media (max-width: 768px) {
    /* INDEX SAJA: tombol Login Dosen di sisi kanan */
    .public-navbar .navbar-user {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    .public-navbar .navbar-user .btn-logout {
        width: auto;
        min-width: 150px;
    }

    /* KELOLA ADMIN/DOSEN SAJA: cegah navbar melebar ke samping */
    .manage-navbar .navbar-container {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: .75rem .7rem;
        gap: .65rem;
        overflow: hidden;
    }

    .manage-navbar .navbar-logo {
        min-width: 0;
        max-width: 100%;
        font-size: 1.15rem;
        line-height: 1.2;
    }

    .manage-navbar .navbar-logo span {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .manage-navbar .navbar-user {
        width: 100%;
        min-width: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .45rem;
    }

    .manage-navbar .navbar-user .btn-logout {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        min-height: 42px;
        padding: .45rem .3rem;
        font-size: .76rem;
        line-height: 1.15;
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        white-space: normal;
    }
}

@media (max-width: 380px) {
    .public-navbar .navbar-user .btn-logout {
        min-width: 135px;
    }

    .manage-navbar .navbar-logo {
        font-size: 1.05rem;
    }

    .manage-navbar .navbar-user .btn-logout {
        font-size: .7rem;
        min-height: 40px;
    }
}
.booking-layout{display:grid;grid-template-columns:minmax(320px,.8fr) minmax(520px,1.2fr);gap:1.5rem;margin-top:1.5rem}.booking-page{padding-bottom:3rem}.check-row{display:flex;gap:.55rem;align-items:center;margin:.8rem 0;font-weight:600}.check-row input{width:auto}.recurring-box{padding:1rem;background:#f5f7fb;border:1px solid var(--border-color);border-radius:.6rem;margin-bottom:1rem}.recurring-box small{display:block;color:#6b7280;margin-top:.3rem}.alert{padding:.8rem 1rem;border-radius:.5rem;margin-bottom:1rem}.alert-success{background:#ecfdf3;color:#166534}.alert-danger{background:#fef2f2;color:#991b1b}.small{color:#6b7280;font-size:.9rem}.room-actions{flex-wrap:wrap}.btn-small{cursor:pointer;border:0}.btn-small a{text-decoration:none}@media(max-width:1000px){.booking-layout{grid-template-columns:1fr}}@media(max-width:700px){.account-table{font-size:.78rem}.account-table th,.account-table td{padding:.55rem}.booking-layout{gap:1rem}}


/* Tombol pengelolaan jadwal rutin */
.btn-danger {
    background: #dc3545;
    color: #fff;
    border: 1px solid #dc3545;
}
.btn-danger:hover {
    background: #b02a37;
    border-color: #b02a37;
    color: #fff;
}
#booking-table td:last-child {
    white-space: nowrap;
}
#booking-table .btn-small {
    margin: 2px;
}

/* ===== BOOKING LIST RINGKAS ===== */
.booking-list-help{margin-bottom:.8rem}
.booking-table-wrap{margin-top:.5rem}
.compact-booking-table{font-size:.86rem}
.compact-booking-table th,.compact-booking-table td{padding:.55rem .65rem;vertical-align:middle}
.compact-booking-table th{white-space:nowrap}
.compact-booking-table td:not(:last-child){white-space:nowrap}
.booking-date{color:var(--dark-color);line-height:1.3}
.booking-time{font-size:.8rem;color:#6b7280;margin-top:.15rem}
.booking-type-badge{display:inline-flex;align-items:center;padding:.2rem .5rem;border-radius:999px;font-size:.72rem;font-weight:700}
.booking-type-badge.once{background:#eef2ff;color:#3730a3}
.booking-type-badge.routine{background:#ecfdf5;color:#047857}
.booking-actions-cell{white-space:normal!important;min-width:145px;vertical-align:top!important;padding-top:.65rem!important}
.compact-booking-table .routine-summary-row>td{vertical-align:top!important}
.compact-booking-table .routine-summary-row .booking-actions-cell{vertical-align:top!important;align-self:start}
.booking-actions-cell .btn-small{font-size:.75rem;padding:.4rem .55rem;margin:2px 0}
.routine-details{margin-top:.35rem;font-size:.75rem;white-space:normal}
.routine-details summary{cursor:pointer;color:var(--primary-color);font-weight:600;display:inline-block}
.routine-occurrences{margin-top:.45rem;padding:.35rem .5rem;background:#f8fafc;border:1px solid var(--border-color);border-radius:.45rem;min-width:290px;max-height:240px;overflow:auto}
.routine-occurrence{display:flex;justify-content:space-between;align-items:center;gap:.6rem;padding:.38rem 0;border-bottom:1px solid #e5e7eb}
.routine-occurrence:last-child{border-bottom:0}
.routine-occurrence>div:first-child{display:flex;flex-direction:column;gap:1px}
.routine-occurrence-actions{white-space:nowrap}
.routine-occurrence-actions .btn-small{font-size:.7rem;padding:.32rem .45rem}
@media(max-width:700px){
    .compact-booking-table{font-size:.78rem}
    .compact-booking-table th,.compact-booking-table td{padding:.45rem .5rem}
    .booking-actions-cell{min-width:125px}
    .routine-occurrences{min-width:245px}
    .routine-occurrence{align-items:flex-start;flex-direction:column}
}

/* ===== DASHBOARD ROOM SCHEDULE ===== */
.schedule-panel {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 2rem;
}
.schedule-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.schedule-panel-header h2 { margin-bottom: .25rem; color: var(--dark-color); }
.schedule-panel-header p { color: #6b7280; font-size: .9rem; }
.schedule-date-form { display:flex; align-items:end; gap:.5rem; flex-wrap:wrap; }
.schedule-date-form label { display:block; font-size:.78rem; font-weight:600; color:#6b7280; width:100%; }
.schedule-date-form input[type=date] { border:1px solid var(--border-color); border-radius:.375rem; padding:.55rem .7rem; font:inherit; color:var(--dark-color); }
.schedule-legend { display:flex; gap:1rem; flex-wrap:wrap; margin-top:1rem; font-size:.82rem; color:#4b5563; }
.legend-dot { width:10px; height:10px; display:inline-block; border-radius:50%; margin-right:.35rem; }
.legend-dot.free { background:var(--success-color); }
.legend-dot.booked { background:var(--danger-color); }
.schedule-room-list { display:grid; gap:1rem; }
.schedule-room-card { background:#fff; border:1px solid var(--border-color); border-radius:.75rem; overflow:hidden; box-shadow:0 2px 5px rgba(0,0,0,.05); }
.schedule-room-header { padding:1rem 1.1rem; background:#f8fafc; border-bottom:1px solid var(--border-color); display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.schedule-room-header h3 { font-size:1.05rem; margin:0; color:var(--dark-color); }
.schedule-room-header span { color:#6b7280; font-size:.8rem; }
.schedule-timeline { padding:.75rem 1rem; display:grid; gap:.5rem; }
.schedule-slot { display:grid; grid-template-columns:145px 1fr; align-items:center; gap:1rem; border-radius:.5rem; padding:.7rem .8rem; min-height:52px; }
.schedule-free { background:#ecfdf5; border:1px solid #a7f3d0; }
.schedule-booked { background:#fef2f2; border:1px solid #fecaca; }
.slot-time { font-weight:700; font-size:.9rem; white-space:nowrap; color:var(--dark-color); }
.slot-content { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.slot-content strong { font-size:.9rem; color:var(--dark-color); }
.slot-content span { font-size:.8rem; color:#6b7280; }
.btn-small { padding:.5rem .75rem; font-size:.78rem; }
@media (max-width: 700px) {
    .schedule-panel-header, .schedule-room-header { align-items:stretch; flex-direction:column; }
    .schedule-date-form { align-items:center; }
    .schedule-date-form label { width:auto; }
    .schedule-room-header .btn { width:100%; text-align:center; }
    .schedule-slot { grid-template-columns:1fr; gap:.2rem; }
    .slot-content { align-items:flex-start; flex-direction:column; gap:.1rem; }
}

/* =========================================================
   MOBILE PUBLIC ROOM MAP - INDEX ONLY
   Desktop layout is intentionally left unchanged.
   ========================================================= */
@media (max-width: 640px) {
    /* Keep the public index compact and map-like on phones. */
    body:has(.public-navbar) {
        background: #f7f8fa;
    }

    .public-navbar .navbar-container {
        min-height: 58px;
    }

    .public-navbar .navbar-logo {
        width: 100%;
        justify-content: center;
        font-size: .98rem;
        line-height: 1.2;
    }

    .public-navbar .navbar-user {
        width: 100%;
        justify-content: center;
    }

    .public-navbar .btn-logout {
        padding: .5rem 1.25rem;
        border-radius: .6rem;
        font-size: .82rem;
    }

    .public-hero {
        padding: 1.05rem 0 .85rem;
        text-align: center;
    }

    .public-hero p {
        font-size: .78rem;
        line-height: 1.45;
        max-width: 330px;
        margin: 0 auto;
    }

    .public-refresh {
        margin-top: .45rem;
        font-size: .68rem;
    }

    .public-navbar + .public-hero + .container {
        padding-top: .8rem;
    }

    /* Statistics remain compact, but with less visual weight. */
    .stats-container {
        gap: .45rem;
        margin-bottom: 1rem;
    }

    .stat-card {
        background: #fff;
        border: 1px solid #edf0f2;
        box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
    }

    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: .95rem;
    }

    .stat-content h3 {
        font-size: 1.05rem;
    }

    .stat-content p {
        font-size: .56rem;
        color: #7b8491;
    }

    .floor-section {
        margin-bottom: 1.25rem;
    }

    /* Floor heading becomes a clean section label. */
    .floor-title {
        display: flex;
        align-items: center;
        width: 100%;
        margin: 0 0 .65rem;
        padding: 0 0 .5rem;
        border-bottom: 1px solid #dfe4e8;
        font-size: 1rem;
        font-weight: 700;
        color: #202938;
    }

    /* EXACTLY TWO COLUMNS: 301|302, 303|304, ... */
    .rooms-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .55rem;
        align-items: stretch;
    }

    /* Minimal room-map blocks instead of large information cards. */
    .rooms-grid .room-card {
        min-width: 0;
        min-height: 0;
        height: 58px;
        border: 1px solid #e2e7eb;
        border-left: 3px solid var(--success-color);
        border-radius: .65rem;
        background: #fff;
        box-shadow: 0 2px 7px rgba(15, 23, 42, .045);
        overflow: hidden;
        transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    }

    .rooms-grid .room-card.room-terpakai {
        border-left-color: var(--warning-color);
    }

    .rooms-grid .room-card:hover {
        transform: none;
        box-shadow: 0 3px 10px rgba(15, 23, 42, .08);
    }

    .rooms-grid .room-header {
        height: 100%;
        padding: .45rem .55rem .45rem .7rem;
        background: #fff;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: .35rem;
    }

    .rooms-grid .room-header h3 {
        margin: 0;
        font-size: .9rem;
        line-height: 1.1;
        font-weight: 700;
        color: #263244;
        white-space: nowrap;
    }

    .rooms-grid .room-status {
        flex: 0 0 auto;
        padding: .22rem .42rem;
        border-radius: 999px;
        font-size: .52rem;
        line-height: 1;
        letter-spacing: .02em;
    }

    /* The map only needs room number + availability state. */
    .rooms-grid .room-info,
    .rooms-grid .room-actions {
        display: none;
    }

    /* Give the final room on an odd-sized floor the same visual rhythm. */
    .rooms-grid .room-card:last-child:nth-child(odd) {
        grid-column: 1;
    }

    /* Slightly more breathing room on very small phones. */
    .container {
        padding-left: .7rem;
        padding-right: .7rem;
    }
}

@media (max-width: 380px) {
    .rooms-grid {
        gap: .45rem;
    }

    .rooms-grid .room-card {
        height: 54px;
    }

    .rooms-grid .room-header {
        padding-left: .6rem;
        padding-right: .45rem;
    }

    .rooms-grid .room-header h3 {
        font-size: .82rem;
    }

    .rooms-grid .room-status {
        font-size: .47rem;
        padding: .2rem .34rem;
    }
}

/* =========================================================
   MOBILE PUBLIC ROOM INFO OVERRIDE
   Keep room position minimal, but always show the lecturer
   and current booking time when a room is occupied.
   Desktop is intentionally untouched.
   ========================================================= */
@media (max-width: 640px) {
    .rooms-grid .room-card {
        height: auto;
        min-height: 88px;
    }

    .rooms-grid .room-header {
        height: auto;
        min-height: 43px;
        padding: .5rem .55rem .25rem .7rem;
        align-items: center;
    }

    .rooms-grid .room-header h3 {
        max-width: 62%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .rooms-grid .room-info {
        display: block;
        padding: .05rem .7rem .55rem;
        min-height: 38px;
        border-bottom: 0;
    }

    .rooms-grid .room-info p {
        margin: 0;
        font-size: .63rem;
        line-height: 1.35;
        color: #667085;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .rooms-grid .room-info p + p {
        margin-top: .12rem;
    }

    .rooms-grid .room-info strong {
        color: #344054;
        font-weight: 700;
    }

    .rooms-grid .room-info .room-user {
        color: #344054;
    }

    .rooms-grid .room-info .room-time {
        color: #667085;
    }

    .rooms-grid .room-info .public-available {
        color: #087a5a;
        font-weight: 600;
        padding-top: .18rem;
    }

    .rooms-grid .room-actions {
        display: none;
    }
}

@media (max-width: 380px) {
    .rooms-grid .room-card {
        min-height: 84px;
    }

    .rooms-grid .room-header {
        min-height: 40px;
        padding-left: .6rem;
    }

    .rooms-grid .room-header h3 {
        font-size: .8rem;
    }

    .rooms-grid .room-info {
        padding-left: .6rem;
        padding-right: .45rem;
    }

    .rooms-grid .room-info p {
        font-size: .58rem;
    }
}
