/* ==========================================================================
   CDN SIMRS DISPLAY KETERSEDIAAN KAMAR (GLOBAL TV SIGNAGE)
   CLEAN CLINICAL WHITE BACKGROUND WITH ODOO SLATE ACCENTS & LARGE TV TYPOGRAPHY
   ========================================================================== */

:root {
    /* Main Surfaces (f6f6f2) */
    --global-bg-page: #f6f6f2;
    --global-bg-surface: #f6f6f2;
    --global-bg-card: #f6f6f2;

    /* Odoo 16 Theme Palette */
    --odoo-slate-dark: #293a44;
    --odoo-slate-main: #395361;
    --odoo-slate-mid: #496c80;
    --odoo-slate-subtle: rgba(57, 83, 97, 0.12);

    /* Card Banner Accents (Semua Hijau -> #059669) */
    --global-header-green: #059669;
    --global-header-green-text: #ffffff;
    
    /* Semantic Bed Colors (Semua Hijau -> #059669) */
    --color-green-avail: #059669;
    --color-green-avail-light: #059669;
    --color-green-text: #059669;
    --color-green-bg: #f6f6f2;
    --color-green-border: #059669;

    --color-red-occ: #dc2626;
    --color-red-occ-light: #ef4444;
    --color-red-text: #991b1b;
    --color-red-bg: #f6f6f2;
    --color-red-border: #ef4444;

    /* Typography Colors (High Contrast) */
    --text-primary: #0f172a;
    --text-secondary: #395361;
    --text-muted: #64748b;

    --global-border: #395361;
    --global-border-subtle: #cbd5e1;
}

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

html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--global-bg-page);
    color: var(--text-primary);
    user-select: none;
    -webkit-user-select: none;
    -webkit-font-smoothing: antialiased;
}

/* Outer TV Layout Frame */
.global-tv-wrapper {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    padding: 1.5vh 1.8vw;
    background-color: var(--global-bg-page);
    position: relative;
    overflow: hidden;
    gap: 1.2vh;
}

/* ==========================================================================
   1. TOP HEADER (CLEAN WHITE HOSPITAL BANNER)
   ========================================================================== */
.global-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2vh 0 1vh 0;
    flex-shrink: 0;
    border-bottom: 2.5px solid var(--odoo-slate-main);
}

.header-emblem-left,
.header-emblem-right {
    width: 14vw;
    max-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo-img {
    max-height: 8vh;
    max-width: 100%;
    object-fit: contain;
}

.header-center-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.global-title {
    font-size: clamp(1.4rem, 2.9vh, 2.3vw);
    font-weight: 900;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1.15;
}

.global-subtitle {
    font-size: clamp(1.15rem, 2.2vh, 1.6vw);
    font-weight: 800;
    color: var(--odoo-slate-main);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    line-height: 1.2;
}

.header-clock-box {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.header-clock-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1.5rem, 3.2vh, 2.4vw);
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: 0.5px;
}

.header-clock-date {
    font-size: clamp(0.75rem, 1.45vh, 1vw);
    color: var(--text-secondary);
    font-weight: 700;
    margin-top: 4px;
    white-space: nowrap;
}

/* ==========================================================================
   2. MAIN GRID OF PAVILION CARDS (4 COLUMNS ON WHITE BACKGROUND)
   ========================================================================== */
.global-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto;
    padding: 0.6vh 0;
}

.global-main-content::-webkit-scrollbar {
    width: 7px;
}
.global-main-content::-webkit-scrollbar-thumb {
    background: var(--odoo-slate-mid);
    border-radius: 4px;
}

.global-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 18px;
    align-items: start;
}

@media (max-width: 1200px) {
    .global-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (max-width: 800px) {
    .global-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* Individual Pavilion Card */
.pavilion-card {
    background: #f6f6f2;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 2px solid var(--odoo-slate-main);
    box-shadow: 0 4px 14px rgba(57, 83, 97, 0.12);
    transition: transform 0.15s ease;
}

/* Card Header Banner (Semua Hijau -> #059669) */
.pavilion-header {
    background-color: var(--global-header-green);
    color: var(--global-header-green-text);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 2px solid var(--odoo-slate-main);
}

.pavilion-title {
    font-weight: 900;
    font-size: clamp(1.05rem, 2.1vh, 1.35vw);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.pavilion-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.badge-sub-kosong {
    background: #059669;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    padding: 2.5px 7px;
    border-radius: 5px;
    font-size: clamp(0.75rem, 1.3vh, 0.9vw);
    font-weight: 900;
    letter-spacing: 0.3px;
}

.badge-sub-terisi {
    background: #b91c1c;
    color: #ffffff;
    padding: 2.5px 7px;
    border-radius: 5px;
    font-size: clamp(0.75rem, 1.3vh, 0.9vw);
    font-weight: 900;
    letter-spacing: 0.3px;
}

/* Card Body Table */
.pavilion-body {
    background-color: #f6f6f2;
    display: flex;
    flex-direction: column;
}

/* Table Sub-Header (Judul Kolom: Tanpa Kelas, Tersedia #ffffff, Terisi #ffffff) */
.class-table-header {
    background-color: var(--odoo-slate-dark);
    display: flex;
    border-bottom: 2px solid var(--odoo-slate-main);
    font-size: clamp(0.78rem, 1.45vh, 0.98vw);
    font-weight: 900;
    letter-spacing: 0.5px;
}

.th-cell {
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.th-name {
    flex: 1;
    justify-content: flex-start;
    color: #ffffff;
    padding-left: 10px;
    border-right: 1.5px solid var(--odoo-slate-mid);
}

.th-kosong {
    width: 29%;
    min-width: 54px;
    color: #ffffff;
    border-right: 1.5px solid var(--odoo-slate-mid);
}

.th-terisi {
    width: 29%;
    min-width: 54px;
    color: #ffffff;
}

/* Table Row per Kelas (TALL & CRISP) */
.class-row {
    display: flex;
    border-bottom: 1.5px solid var(--global-border-subtle);
    min-height: 44px;
}

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

/* Left Cell: Nama Kelas */
.class-cell-name {
    flex: 1;
    background-color: #f6f6f2;
    color: var(--text-primary);
    font-weight: 800;
    font-size: clamp(0.95rem, 1.8vh, 1.2vw);
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-right: 1.5px solid var(--global-border-subtle);
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Center & Right Value Cells (GIANT NUMBERS) */
.class-cell-val {
    width: 29%;
    min-width: 54px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 900;
    font-size: clamp(1.4rem, 2.7vh, 1.85vw);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
    line-height: 1;
    border-right: 1.5px solid var(--global-border-subtle);
}

.class-cell-val:last-child {
    border-right: none;
}

/* TERSEDIA VALUES: */
.val-kosong-avail {
    background-color: #059669;
    color: #ffffff;
}

.val-kosong-zero {
    background-color: #f6f6f2;
    color: #94a3b8;
}

/* TERISI VALUES: */
.val-terisi-occ {
    background-color: var(--color-red-occ);
    color: #ffffff;
}

.val-terisi-zero {
    background-color: #f6f6f2;
    color: #94a3b8;
}

/* ==========================================================================
   3. BOTTOM SUMMARY METRICS STRIP (TOTALAN DI BAWAH)
   ========================================================================== */
.global-footer-box {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-top: 2.5px solid var(--odoo-slate-main);
    padding-top: 1vh;
}

.global-summary-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.8vw;
    flex-shrink: 0;
}

.strip-item {
    background: #f6f6f2;
    border: 2px solid var(--odoo-slate-main);
    border-radius: 10px;
    padding: 1.1vh 1.6vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(57, 83, 97, 0.1);
}

.strip-label {
    font-size: clamp(0.85rem, 1.6vh, 1.12vw);
    font-weight: 800;
    color: var(--odoo-slate-main);
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.strip-value-wrap {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.strip-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1.8rem, 3.8vh, 2.8vw);
    font-weight: 900;
    line-height: 1;
    color: var(--text-primary);
}

.strip-unit {
    font-size: clamp(0.9rem, 1.6vh, 1.15vw);
    font-weight: 800;
    color: #64748b;
}

/* Strip Semantic Highlights */
.strip-kosong {
    background: #f6f6f2;
    border-color: #059669;
}
.label-green {
    color: #059669;
}
.val-green {
    color: #059669;
}
.unit-green {
    color: #059669;
}

.strip-terisi {
    background: #f6f6f2;
    border-color: var(--color-red-border);
}
.label-red {
    color: var(--color-red-text);
}
.val-red {
    color: var(--color-red-occ);
}
.unit-red {
    color: #b91c1c;
}

/* Loading & Empty State */
.loading-box, .empty-box {
    text-align: center;
    padding: 8vh 20px;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #cbd5e1;
    border-top-color: var(--odoo-slate-main);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
