/* Font keluarga utama: Inter (SaaS premium look). Body juga diberi
   antialiasing & tracking tight melalui class Tailwind di dashboard.html. */
body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.011em;
}

.countdown-banner {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(38, 197, 150, 0.2);
    background: linear-gradient(90deg, #113f36 0%, #16594a 55%, #1c7a5f 100%);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.countdown-banner .watermark {
    position: absolute;
    right: -8px;
    bottom: -40px;
    line-height: 1;
    font-size: 130px;
    color: rgba(255, 255, 255, 0.05);
    pointer-events: none;
    user-select: none;
}

.countdown-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #26c596;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.countdown-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
}

@media (min-width: 640px) {
    .countdown-title {
        font-size: 20px;
    }
}

.countdown-date {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: 4px;
}

.countdown-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.countdown-chip {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 8px 14px;
    min-width: 60px;
    text-align: center;
}

.countdown-chip .num {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

@media (min-width: 640px) {
    .countdown-chip .num {
        font-size: 24px;
    }
}

.countdown-chip .lbl {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
}

.countdown-done {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 12px 16px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

/* ============ KARTU CHART ============ */
.chart-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chart-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.chart-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.chart-card-sub {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.chart-canvas-box {
    position: relative;
    height: 256px;
    width: 100%;
}

/* Legenda dot (bar per desa) */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    column-gap: 20px;
    row-gap: 8px;
    margin-bottom: 16px;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
}

.chart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 9999px;
}

/* Doughnut kelayakan */
.doughnut-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    padding: 8px 0;
    margin-top: 16px;
}

.doughnut-box {
    position: relative;
    width: 160px;
    height: 160px;
    flex-shrink: 0;
}

.doughnut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.doughnut-center b {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
}

.doughnut-center span {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.kelayakan-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kelayakan-legend .item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kelayakan-legend .dot {
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    flex-shrink: 0;
}

.kelayakan-legend .t {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.kelayakan-legend .s {
    font-size: 12px;
    color: #9ca3af;
}

/* Item legend kelayakan kini berupa tautan ke tabel peserta (terfilter status) */
.kelayakan-legend a.item {
    text-decoration: none;
    border-radius: 8px;
    padding: 4px 8px;
    margin: -4px -8px;
    transition: background 0.15s ease;
}

.kelayakan-legend a.item:hover {
    background: #f3f7f6;
}

.kelayakan-legend a.item:hover .t {
    color: #047857;
}

/* ============ RINCIAN KATEGORI KRITIS ============ */
.kritis-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kritis-item {
    display: block;
    text-decoration: none;
    padding: 8px 10px;
    border: 1px solid #f3f4f6;
    border-radius: 10px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.kritis-item:hover {
    border-color: #d1d5db;
    background: #fafafa;
}

.kritis-row1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.kritis-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #374151;
}

.kritis-status {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.kritis-status.ok {
    color: #047857;
}

.kritis-status.warn {
    color: #b45309;
}

.kritis-status.bad {
    color: #b91c1c;
}

.kritis-track {
    height: 6px;
    border-radius: 9999px;
    background: #f3f4f6;
    overflow: hidden;
    display: flex;
}

.kritis-seg {
    height: 100%;
}

.kritis-seg.ok {
    background: #047857;
}

.kritis-seg.bad {
    background: #ef4444;
}

.kritis-seg.warn {
    background: #f59e0b;
}

/* Panah "bisa diklik" di samping nama kategori kritis */
.kritis-item .kritis-name i {
    margin-left: 4px;
    font-size: 13px;
    color: #9ca3af;
    transition: transform 0.2s ease, color 0.2s ease;
}
.kritis-item:hover .kritis-name i {
    color: #4b5563;
    transform: translate(2px, -2px);
}

/* ============ RING EFEKTIVITAS ============ */
.effect-legend {
    display: none;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

@media (min-width: 640px) {
    .effect-legend {
        display: flex;
    }
}

.effect-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.effect-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 9999px;
}

.effect-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 640px) {
    .effect-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.ring-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ring-box {
    position: relative;
    width: 144px;
    height: 144px;
}

.ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.ring-center b {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
}

.ring-title {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin-top: 12px;
}

.ring-sub {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

/* ============ TABEL KAPASITAS ============ */
.dash-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.dash-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.dash-card-sub {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.dash-card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-updated {
    font-size: 12px;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dash-reload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dash-reload-btn:hover {
    background: #f3f4f6;
}

.dash-th {
    padding: 16px 24px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    text-align: left;
    white-space: nowrap;
}

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

.dash-th-w {
    width: 12rem;
}

.dash-td {
    padding: 16px 24px;
    border-bottom: 1px solid #f9fafb;
}

.dash-row {
    cursor: pointer;
}

.dash-row:hover {
    background: #f9fafb;
}

.dash-td-title {
    display: block;
    font-weight: 700;
    color: #111827;
}

.dash-td-muted {
    font-size: 14px;
    color: #6b7280;
}

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

.dash-td-num {
    font-weight: 700;
    font-size: 18px;
    color: #1f2937;
}

.dash-slot-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

.dash-slot-row span:first-child {
    color: #6b7280;
}

.dash-slot-row span:last-child {
    color: #111827;
}

.progress-track {
    width: 100%;
    background: #f3f4f6;
    border-radius: 9999px;
    height: 8px;
}

.progress-fill {
    height: 8px;
    border-radius: 9999px;
    transition: width 0.7s ease;
}

.progress-fill.green { background: #37b891; }
.progress-fill.amber { background: #ff662e; }
.progress-fill.red   { background: #f53a66; }

/* ============ COUNTDOWN PASCA ACARA ============ */
#countdownFinished {
    display: none;
}
#countdownFinished.active {
    display: block;
}
.countdown-finished-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2); /* bg-white/20 */
    color: #ffffff;
    padding: 8px 16px;                    /* px-4 py-2 */
    border-radius: 8px;                   /* rounded-lg */
    font-weight: 500;                     /* font-medium */
    font-size: 14px;
}
