* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(160deg, #1a5c35 0%, #2E8B57 50%, #1a7a40 100%);
    color: #333;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

.container {
    height: 100vh;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ═══════════════════════════════
   HEADER
═══════════════════════════════ */
.header {
    background: rgba(255,255,255,0.97);
    border-radius: 12px;
    padding: 12px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    flex-shrink: 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, #1a5c35, #2E8B57);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}

.logo-section h1 {
    font-size: 1.45em;
    color: #1a5c35;
    font-weight: 800;
    line-height: 1.2;
}

.logo-section p {
    font-size: 0.78em;
    color: #c8960a;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 2px;
}

.datetime-section { text-align: right; }

.current-date {
    font-size: 0.88em;
    color: #555;
    font-weight: 500;
    margin-bottom: 2px;
}

.current-time {
    font-size: 1.85em;
    color: #1a5c35;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

/* ═══════════════════════════════
   LOKET STRIP
═══════════════════════════════ */
.loket-strip {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    flex-shrink: 0;
}

.loket-item {
    background: rgba(255,255,255,0.1);
    border: 1.5px solid rgba(255,255,255,0.18);
    border-radius: 12px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    min-height: 70px;
}

.loket-item.aktif {
    background: rgba(255,255,255,0.97);
    border-color: rgba(255,255,255,0.9);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

@keyframes callPulse {
    0%,100% { transform: scale(1); }
    50%      { transform: scale(1.012); box-shadow: 0 6px 28px rgba(39,158,88,.35); }
}

.loket-left { display: flex; flex-direction: column; gap: 3px; }

.loket-label {
    font-size: 0.68em;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
}

.loket-item.aktif .loket-label { color: #7a9485; }

.loket-status-text {
    font-size: 0.76em;
    font-weight: 600;
    color: rgba(255,255,255,0.38);
    letter-spacing: 0.3px;
}

.loket-item.aktif .loket-status-text { color: #279e58; }

.loket-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.loket-number {
    font-size: 3.6rem;
    font-weight: 800;
    line-height: 1;
    color: rgba(255,255,255,0.2);
    font-variant-numeric: tabular-nums;
    letter-spacing: 3px;
    transition: color 0.3s;
}

.loket-item.aktif .loket-number { color: #1a5c35; }

.loket-badge {
    font-size: 0.7em;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.35);
    white-space: nowrap;
    transition: all 0.3s;
}

.loket-item.aktif .loket-badge {
    background: #e8f5ee;
    color: #279e58;
}

/* ═══════════════════════════════
   POLI SECTION
═══════════════════════════════ */
.poli-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.poli-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 0 4px;
}

.poli-title {
    font-size: 0.72em;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
}

.poli-refresh-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    transition: background 0.3s;
}

.poli-refresh-dot.active {
    background: #4cdb80;
    box-shadow: 0 0 8px #4cdb80;
}

.queue-container { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.queue-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    flex: 1;
    min-height: 0;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════
   QUEUE CARD
═══════════════════════════════ */
.queue-card {
    background: rgba(255,255,255,0.97);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.card-header {
    text-align: center;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 2px solid #f0f4f1;
    flex-shrink: 0;
}

.doctor-name {
    font-size: 1.6em;
    color: #1a5c35;
    font-weight: 800;
    margin-bottom: 4px;
    line-height: 1.2;
}

.clinic-name {
    font-size: 1.08em;
    color: #c8960a;
    font-weight: 700;
}

.queue-stats {
    display: flex;
    justify-content: space-around;
    padding: 9px 8px;
    background: linear-gradient(135deg, #f4faf6, #e8f5ee);
    border-radius: 8px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.stat-item { text-align: center; }

.stat-number {
    font-size: 1.55em;
    font-weight: 800;
    color: #1a5c35;
    line-height: 1;
}

.stat-label {
    font-size: 0.72em;
    color: #7a9485;
    margin-top: 3px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.queue-table-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.queue-table-container::-webkit-scrollbar { width: 3px; }
.queue-table-container::-webkit-scrollbar-track { background: transparent; }
.queue-table-container::-webkit-scrollbar-thumb { background: #c8ddd0; border-radius: 3px; }

.queue-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84em;
}

.queue-table th {
    background: linear-gradient(135deg, #1a5c35, #2E8B57);
    color: white;
    padding: 8px 6px;
    text-align: center;
    font-weight: 700;
    font-size: 0.8em;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.queue-table td {
    padding: 7px 6px;
    text-align: center;
    border-bottom: 1px solid #eef2ef;
    font-size: 0.88em;
    color: #333;
}

.queue-table tr:nth-child(even) td { background-color: #f8faf8; }
.queue-table tr:hover td { background-color: #e8f5ee; transition: background 0.2s; }

.status-waiting {
    background: linear-gradient(135deg, #2E8B57, #4caf70);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.78em;
    font-weight: 700;
}

.no-patients {
    text-align: center;
    padding: 20px;
    color: #bbb;
    font-style: italic;
    font-size: 0.88em;
}

/* ═══════════════════════════════
   LOADING & STATES
═══════════════════════════════ */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: white;
    gap: 12px;
}

.spinner {
    width: 34px; height: 34px;
    border: 3px solid rgba(255,255,255,0.25);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.no-data {
    text-align: center;
    color: white;
    padding: 40px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.no-data h2 { font-size: 1.7em; opacity: 0.9; }
.no-data p  { font-size: 1em; opacity: 0.65; }

/* ═══════════════════════════════
   FOOTER
═══════════════════════════════ */
.footer {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    padding: 7px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.footer p {
    font-size: 0.76em;
    color: rgba(255,255,255,0.55);
    font-weight: 500;
}

.footer p:first-child {
    color: rgba(255,255,255,0.85);
    font-weight: 700;
}

/* ═══════════════════════════════
   RESPONSIVE
═══════════════════════════════ */
@media (max-width: 1024px) {
    .loket-number  { font-size: 2.8rem; }
    .doctor-name   { font-size: 1em; }
    .queue-table   { font-size: 0.78em; }
    .stat-number   { font-size: 1.35em; }
}

@media (max-width: 768px) {
    body { overflow: auto; height: auto; }
    .container { height: auto; }
    .loket-strip  { 
        grid-template-columns: 1fr; 
    }
     .loket-item {
        padding: 8px 12px;
        min-height: 54px;
    }
    .loket-number {
        font-size: 2rem;
    }
    .loket-label {
        font-size: 0.58em;
        letter-spacing: 1.5px;
    }
    .loket-status-text {
        font-size: 0.65em;
    }
    .loket-badge {
        display: none; 
    }
    .queue-grid   { grid-template-columns: 1fr; }
    .loket-number { font-size: 2.4rem; }
    .header { flex-direction: column; gap: 8px; text-align: center; }
    .datetime-section { text-align: center; }
    .footer { flex-direction: column; gap: 3px; text-align: center; }
}