/* =========================================================
   TOP.CSS - DESAIN MODERN & ELEGAN UNTUK STATISTIK
   ========================================================= */

/* --- VARIABEL WARNA & TEMA --- */
:root {
    --primary-color: #2563eb;       /* Royal Blue */
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --accent-gold: #f59e0b;         /* Gold untuk Juara 1 */
    --accent-silver: #94a3b8;       /* Silver untuk Juara 2 */
    --accent-bronze: #d97706;       /* Bronze untuk Juara 3 */
    --bg-main: #f8fafc;             /* Light Slate BG */
    --card-bg: #ffffff;
    --text-main: #0f172a;           /* Dark Slate Text */
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* --- RESET & BASIC STYLES --- */
body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding-bottom: 30px;
    -webkit-font-smoothing: antialiased;
}

/* Container khusus aplikasi seluler/web */
.container-app {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px;
}

/* --- HEADER UNTUK STATISTIK --- */
.app-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    padding: 24px 0 20px 0;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-content a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.header-content a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-2px);
}

.header-content h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
}

.header-content p {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
}

/* --- NAV TAB MODERN --- */
.nav-pills {
    background: #e2e8f0;
    padding: 4px;
    border-radius: 14px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
}

.nav-pills .nav-link {
    color: var(--text-muted) !important;
    font-weight: 600;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.875rem;
    background: transparent;
    border: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nav-pills .nav-link.active {
    background-color: var(--card-bg) !important;
    color: var(--primary-color) !important;
    box-shadow: var(--shadow-sm);
}

/* --- JUDUL HALAMAN & FILTER --- */
.page-title h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.page-title small, .page-title p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Custom Input Date Filter */
#filterTanggalLimit {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
    outline: none;
    transition: border-color 0.2s ease;
}

#filterTanggalLimit:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* --- KARTU TABEL (APP-CARD) --- */
.app-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
}

/* --- STYLING TABEL ELEGAN --- */
.table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: #f1f5f9;
}

.table tbody td {
    padding: 14px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* --- DESAIN BADGE & MEDALI PERINGKAT --- */
.badge {
    padding: 6px 10px;
    font-weight: 600;
    border-radius: 8px;
    font-size: 0.75rem;
}

/* Peringkat Juara */
.badge.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

.badge.bg-light {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 6px rgba(148, 163, 184, 0.4);
}

.badge.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.badge.bg-secondary {
    background-color: #e2e8f0 !important;
    color: #475569 !important;
}

/* --- EMPTY & LOADING STATE --- */
.empty-state {
    padding: 40px 16px !important;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}