html:fullscreen,
body:fullscreen,
html:-webkit-full-screen,
body:-webkit-full-screen {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
}

.monitor-body {
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
    color: var(--text-main);
    overflow: hidden;
}

.monitor-header {
    background: var(--bg-card);
    border-bottom: 2px solid var(--primary);
    padding: 12px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    flex-shrink: 0;
}

.monitor-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.monitor-clinic-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.monitor-doctor-name {
    font-size: clamp(1.15rem, 2.2vh, 1.45rem);
    font-weight: 900;
    line-height: 1.25;
}

.monitor-doctor-name span {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-muted);
}

.monitor-clock-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.clock-box {
    text-align: left;
    background: var(--bg-subtle);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.clock-box strong {
    display: block;
    font-size: clamp(1.2rem, 2.4vh, 1.5rem);
    font-weight: 900;
    color: var(--primary-dark);
    line-height: 1.15;
}

.clock-box span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.monitor-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 20px;
    padding: 16px 26px;
    align-items: stretch;
    overflow: hidden;
}

.monitor-active-room {
    background: var(--bg-card);
    border: 3px solid var(--primary);
    border-radius: 22px;
    padding: clamp(16px, 2.6vh, 30px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    position: relative;
    min-height: 0;
    overflow: hidden;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.monitor-active-room.call-flash {
    animation: monitorPulseAlert 1.1s ease-in-out 4;
}

@keyframes monitorPulseAlert {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.4);
    }
    50% {
        transform: scale(1.015);
        box-shadow: 0 0 0 18px rgba(20, 184, 166, 0);
    }
}

.room-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    border: 1.5px solid var(--primary);
    padding: 8px 18px;
    border-radius: 999px;
    font-size: clamp(0.95rem, 1.9vh, 1.12rem);
    font-weight: 800;
    align-self: flex-start;
    flex-shrink: 0;
}

.active-patient-showcase {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 8px;
}

.showcase-title-top {
    font-size: clamp(1.15rem, 2.3vh, 1.5rem);
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.giant-queue-number-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: clamp(175px, 20vw, 240px);
    min-height: clamp(115px, 20vh, 175px);
    padding: clamp(10px, 1.8vh, 16px) clamp(28px, 4vw, 48px);
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.22), rgba(2, 132, 199, 0.18));
    border: 3px solid var(--primary);
    box-shadow: 0 14px 34px rgba(13, 148, 136, 0.22);
    margin: 2px auto clamp(10px, 2vh, 18px);
}

.giant-queue-digits {
    font-size: clamp(4.2rem, 10.5vh, 6.8rem);
    font-weight: 900;
    line-height: 1;
    color: var(--primary-dark);
    text-shadow: 0 4px 18px rgba(13, 148, 136, 0.28);
}

.showcase-patient-name {
    font-size: clamp(1.75rem, 4.2vh, 2.75rem);
    font-weight: 900;
    color: var(--text-main);
    line-height: 1.3;
    margin: 2px 0 clamp(10px, 2vh, 18px);
}

.showcase-meta {
    display: inline-flex;
    gap: 20px;
    background: var(--bg-subtle);
    padding: 10px 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    font-size: clamp(0.98rem, 2vh, 1.2rem);
    flex-wrap: wrap;
    justify-content: center;
}

.showcase-meta strong {
    color: var(--primary-dark);
}

.showcase-waiting-msg strong {
    display: block;
    font-size: clamp(1.45rem, 3.2vh, 2rem);
    font-weight: 800;
    margin-bottom: 10px;
}

.showcase-waiting-msg p {
    font-size: clamp(0.98rem, 2vh, 1.15rem);
    color: var(--text-muted);
}

.room-footer-guide {
    text-align: center;
    font-size: clamp(0.84rem, 1.6vh, 0.96rem);
    color: var(--text-muted);
    border-top: 1px dashed var(--border-color);
    padding-top: 10px;
    flex-shrink: 0;
}

.monitor-queue-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: clamp(16px, 2.4vh, 24px);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    min-height: 0;
    overflow: hidden;
}

.queue-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.queue-panel-header h2 {
    font-size: clamp(1.05rem, 2.1vh, 1.25rem);
    font-weight: 800;
}

.queue-count-badge {
    background: var(--primary-soft);
    color: var(--primary-dark);
    padding: 4px 12px;
    border-radius: 99px;
    font-weight: 800;
    font-size: 0.9rem;
}

.queue-list-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.queue-list-container::-webkit-scrollbar {
    display: none;
}

.queue-row-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-subtle);
    border: 1.5px solid var(--border-color);
    padding: clamp(8px, 1.3vh, 12px) 14px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.queue-row-card.is-present {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.q-rank {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.q-info {
    flex: 1;
    min-width: 0;
}

.q-info strong {
    display: block;
    font-size: clamp(0.95rem, 1.8vh, 1.08rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.q-info small {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.q-time-col {
    text-align: left;
    flex-shrink: 0;
}

.q-time {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.q-badge {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 600;
}

.empty-queue-box {
    padding: 30px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    margin: auto 0;
}

.monitor-ticker-bar {
    background: #0f172a;
    color: #f8fafc;
    padding: 10px 26px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: clamp(0.9rem, 1.8vh, 1.02rem);
    flex-shrink: 0;
}

.ticker-label {
    background: var(--primary);
    color: #fff;
    padding: 3px 12px;
    border-radius: 8px;
    font-weight: 800;
    white-space: nowrap;
}

.ticker-content {
    font-weight: 500;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.monitor-presence-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: clamp(0.9rem, 1.8vh, 1.02rem);
    font-weight: 800;
    border: 2px solid transparent;
    transition: all 0.25s ease;
}

.monitor-presence-pill .presence-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.monitor-presence-pill.presence-present {
    background: rgba(22, 163, 74, 0.18);
    color: #4ade80;
    border-color: #22c55e;
}
.monitor-presence-pill.presence-present .presence-dot {
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e;
}

.monitor-presence-pill.presence-break {
    background: rgba(217, 119, 6, 0.2);
    color: #fbbf24;
    border-color: #f59e0b;
}
.monitor-presence-pill.presence-break .presence-dot {
    background: #f59e0b;
    box-shadow: 0 0 10px #f59e0b;
}

.monitor-presence-pill.presence-absent {
    background: rgba(220, 38, 38, 0.22);
    color: #f87171;
    border-color: #ef4444;
}
.monitor-presence-pill.presence-absent .presence-dot {
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
}

@media (max-width: 1024px) {
    .monitor-body {
        height: auto;
        max-height: none;
        overflow-y: auto;
    }
    .monitor-grid {
        grid-template-columns: 1fr;
        overflow: visible;
    }
}
