/* ==========================================================
   DASHBOARD BED - RS FATIMA MAKALE (MOBILE FRIENDLY)
========================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    background: #edf2f7;
    color: #222;
}

/* Di layar besar tetap pertahankan full viewport height, di mobile biarkan mengalir */
@media (min-width: 992px) {
    html, body {
        height: 100vh;
        overflow: hidden;
    }
}

/* ==========================================================
   CONTAINER UTAMA
========================================================== */
.dashboard-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    gap: 10px;
    background: #edf2f7;
}

@media (min-width: 992px) {
    .dashboard-container {
        height: 100vh;
        width: 100vw;
        overflow: hidden;
        padding: 12px 16px;
    }
}

/* ==========================================================
   HEADER
========================================================== */
.dashboard-header {
    min-height: 65px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    gap: 8px;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-rs {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.hospital-name {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.header-center {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: #0f172a;
    text-transform: uppercase;
    width: 100%;
    order: 3;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
}

.header-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

.header-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    font-weight: 800;
    color: #16a34a;
    line-height: 1;
}

/* Tablet & Desktop Header Adjustments */
@media (min-width: 768px) {
    .logo-rs { width: 50px; height: 50px; }
    .hospital-name { font-size: 22px; }
    .header-center { font-size: 24px; order: unset; width: auto; }
    .header-date { font-size: 15px; }
    .header-time { font-size: 22px; }
}

@media (min-width: 1200px) {
    .header-center { font-size: 28px; }
}

/* ==========================================================
   ROOM SECTION
========================================================== */
.room-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
    overflow: hidden;
}

.room-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.room-column {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Header Tabel */
.table-header-fixed {
    height: 42px;
    background: #1e40af;
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
    line-height: 42px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .table-header-fixed {
        height: 48px;
        font-size: 20px;
        line-height: 48px;
    }
}

/* Container Area Scroll */
.content-scroll-wrapper {
    flex: 1;
    overflow-y: auto;
    position: relative;
    scroll-behavior: auto !important; 
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.content-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.table-room {
    width: 100%;
    border-collapse: collapse;
}

.table-room tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: 0.25s;
}

.table-room tbody tr:last-child {
    border-bottom: none;
}

.table-room tbody td {
    width: 100%;
    padding: 12px 14px;
    background: #ffffff;
}

@media (min-width: 768px) {
    .table-room tbody td {
        padding: 14px 20px;
    }
}

.room-row-container {
    display: flex;
    flex-direction: column; /* Default mobile: Atur susunan jadi vertikal ke bawah */
    width: 100%;
    gap: 12px;
}

@media (min-width: 992px) {
    .room-row-container {
        flex-direction: row; /* Layar besar kembali ke samping */
        justify-content: space-between;
        align-items: center;
        gap: 20px;
    }
}

/* Side Kiri */
.room-left-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.room-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 2px;
}

.room-name {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .room-name { font-size: 26px; }
}

.room-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.room-subtitle i {
    color: #0284c7;
}

.room-classes {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}

.class-chip {
    display: inline-flex;
    align-items: center;
    background: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

@media (min-width: 768px) {
    .class-chip {
        padding: 6px 14px;
        font-size: 16px;
        border-radius: 8px;
    }
}

.class-chip.available {
    background: #f0fdf4;
    border-color: #4ade80;
}

.class-chip.empty-zero {
    background: #f8fafc;
    border-color: #e2e8f0;
    opacity: 0.45;
}

.class-chip .class-name {
    font-weight: 700;
    color: #334155;
    margin-right: 4px;
}

.class-chip .class-count {
    font-weight: 900;
    font-size: 15px;
    color: #16a34a;
}

@media (min-width: 768px) {
    .class-chip .class-count { font-size: 18px; }
}

/* Panel Kanan (Rincian Kamar Kosong) */
.room-right-side {
    width: 100%;
    background: #f8fafc;
    border-left: none;
    border-top: 3px solid #3b82f6; /* Di mobile garis pemisah dipindah ke atas */
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (min-width: 992px) {
    .room-right-side {
        width: auto;
        min-width: 350px;
        max-width: 750px;
        flex-shrink: 0;
        border-top: none;
        border-left: 3px solid #3b82f6;
        padding: 8px 14px;
    }
}

.empty-detail-title {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.empty-detail-columns {
    display: flex;
    flex-direction: column; /* Di mobile disusun ke bawah */
    gap: 6px;
}

@media (min-width: 768px) {
    .empty-detail-columns {
        flex-direction: row; /* Di layar besar menjadi kolom ke samping */
        gap: 12px;
        align-items: flex-start;
    }
}

.empty-detail-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

@media (min-width: 768px) {
    .empty-detail-col {
        min-width: 300px;
    }
}

.empty-detail-item {
    font-size: 13px;
    color: #1e293b;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.gender-tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
    white-space: nowrap;
}

.gender-tag.laki-laki {
    background: #e0f2fe;
    color: #0369a1;
}

.gender-tag.perempuan {
    background: #fce7f3;
    color: #be185d;
}

.gender-tag.anak {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.gender-tag.umum,
.gender-tag.campur {
    background: #f1f5f9;
    color: #475569;
}

.badge {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #ffffff;
}

@media (min-width: 768px) {
    .badge { padding: 4px 12px; border-radius: 12px; font-size: 13px; }
}

.badge-success { background: #16a34a; }
.badge-warning { background: #f59e0b; }
.badge-danger  { background: #dc2626; }

/* ==========================================================
   FOOTER
========================================================== */
.dashboard-footer {
    min-height: 38px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    flex-shrink: 0;
}

.footer-info {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

@media (min-width: 768px) {
    .footer-info { font-size: 12px; }
}

.footer-info i {
    color: #1976d2;
    margin-right: 4px;
}

.footer-center {
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-label {
    font-size: 11px;
    color: #64748b;
}

.footer-value {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-refresh {
    font-size: 11px;
    color: #475569;
    font-weight: 600;
}

.footer-refresh span {
    margin-left: 2px;
    font-size: 12px;
    color: #1976d2;
    font-weight: 800;
}

#connectionStatus {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
}

#connectionStatus i {
    font-size: 7px;
}

.online { color: #16a34a; }
.offline { color: #dc2626; }