/* ==========================================
   1. DEFINISI VARIABEL & TEMA DASAR
   ========================================== */
:root {
    --font-body: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-display: 'Arial Black', Gadget, sans-serif;
    --primary-color: #e9273f; /* Warna aksen utama */
    --text-dark: #171a1f;
}

/* Container Dashboard */
.data-dashboard {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 15px;
    box-sizing: border-box;
}

.data-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 70vh;
}

/* Kontrol Dropdown & Tombol Sortir */
.select-control {
    background: #f8f9fa;
    border: 2px solid var(--primary-color);
    color: var(--text-dark);
    font-size: 15px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(233, 39, 63, 0.1);
}

.select-control:focus {
    box-shadow: 0 0 0 3px rgba(233, 39, 63, 0.25);
    background: #fff;
}

.sort-btn {
    border: 2px solid #e2e8f0;
    background: #fdfdfd;
    box-shadow: none;
    font-family: var(--font-body), sans-serif;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-btn:hover {
    border-color: var(--primary-color);
    background: #fff;
    color: var(--text-dark);
    cursor: pointer;
}

.sort-btn strong {
    color: var(--primary-color);
}

.info-text {
    font-family: var(--font-body), sans-serif;
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 20px;
    font-weight: 500;
}

/* ==========================================
   2. STRUKTUR TABEL & SCROLLBAR CONTAINER
   ========================================== */
.table-scroll-container {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 600px; 
    border-radius: 12px;
    border: 1px solid #e9ecef;
    background: #ffffff;
    position: relative;
}

/* Scrollbar Minimalis */
.table-scroll-container::-webkit-scrollbar { width: 6px; }
.table-scroll-container::-webkit-scrollbar-track { background: #f1f3f5; }
.table-scroll-container::-webkit-scrollbar-thumb { background: #ced4da; border-radius: 10px; }
.table-scroll-container::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

.tabel-data {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-family: var(--font-body), sans-serif;
}

.tabel-data th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    padding: 16px 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #495057;
    border-bottom: 3px solid var(--primary-color);
    z-index: 10;
}

.tabel-data td {
    padding: 14px 12px;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 1px solid #edf2f7;
    color: #2d3748;
}

.tabel-data tr {
    transition: opacity 0.25s ease;
}

.tabel-data tr:hover td {
    background: rgba(233, 39, 63, 0.03);
}

.col-date { width: 40%; }
.col-day { width: 30%; }

.day-badge {
    background: #f1f3f5;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    display: inline-block;
}

.col-result {
    width: 30%;
    font-size: 18px !important;
    font-weight: 800 !important;
    color: var(--primary-color) !important;
    letter-spacing: 2px;
}

.status-message { padding: 30px !important; color: #6c757d; font-size: 15px; }
.status-error { color: var(--primary-color) !important; font-weight: 600; }

/* ==========================================
   3. FITUR PENCARIAN & FLOATING COUNTER
   ========================================== */
.search-box-container {
    width: 100%;
    margin-bottom: 15px;
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input-field {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    box-sizing: border-box;
    font-family: var(--font-body), sans-serif;
    transition: all 0.3s ease;
    background: #fdfdfd;
}

.search-input-field:focus {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(233, 39, 63, 0.08);
    background: #fff;
}

.floating-search-counter {
    position: fixed;
    right: -150px; 
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b; 
    color: #ffffff;
    padding: 15px 18px;
    border-radius: 12px 0 0 12px;
    box-shadow: -4px 4px 20px rgba(0, 0, 0, 0.25);
    font-family: var(--font-body), sans-serif;
    font-size: 12px;
    font-weight: 700;
    z-index: 999;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 4px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: center;
}

.floating-search-counter.show-counter {
    right: 0; 
}

.counter-number-big {
    font-size: 22px;
    color: var(--primary-color);
    display: block;
    line-height: 1;
    margin-top: 2px;
    font-weight: 800;
}

.counter-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

.row-fade-out {
    opacity: 0.25;
}

.highlight-match {
    background-color: #fef08a !important; 
    color: #000000 !important;
    position: relative;
    font-weight: 800 !important;
}

.col-result.highlight-match {
    color: #b91c1c !important; 
}

/* Penyesuaian Responsif */
@media (max-width: 576px) {
    .search-box-container {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px !important;
    }
    .sort-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .floating-search-counter {
        top: auto;
        bottom: 20px;
        transform: none;
        right: -200px;
        border-radius: 12px;
        flex-direction: row;
        gap: 12px;
        align-items: center;
        padding: 10px 15px;
        border-left: none;
        border-bottom: 4px solid var(--primary-color);
    }
    .floating-search-counter.show-counter {
        right: 20px;
    }
    .counter-divider { width: 1px; height: 20px; margin: 0; }
}