/* ============================================
   Admin Panel - Custom Styles
   Overrides & extends Bootstrap 5.3
   ============================================ */

:root {
    --sidebar-width: 270px;
    --sidebar-bg: #0A1628;
    --sidebar-hover: rgba(255,255,255,0.06);
    --sidebar-active: rgba(37,99,235,0.15);
    --sidebar-text: rgba(255,255,255,0.55);
    --sidebar-text-active: #fff;
    --accent: #2563EB;
    --accent-light: #3B82F6;
}

body, html {
    font-family: 'Inter', system-ui, sans-serif;
    background: #F1F5F9;
    min-height: 100vh;
}

h1,h2,h3,h4,h5,h6,.fw-heading {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* --- Sidebar --- */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
}

.sidebar-logo h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.sidebar-logo span {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    font-weight: 500;
}

/* --- Sidebar Nav --- */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.25);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.875rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.nav-link:hover {
    color: #fff;
    background: var(--sidebar-hover);
}

.nav-link.active {
    color: var(--sidebar-text-active);
    background: var(--sidebar-active);
    font-weight: 600;
}

.nav-link.active i {
    color: var(--accent-light);
}

.nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
}

/* --- Sidebar Footer --- */
.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.user-role {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
    margin: 0;
}

/* --- Sidebar Overlay (Mobile) --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1039;
}

/* --- Main Content --- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    overflow-x: hidden;
}

/* --- Top Navbar --- */
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid #E2E8F0;
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #1E293B;
    margin: 0;
}

.topbar-breadcrumb {
    font-size: 0.8rem;
    color: #94A3B8;
}

.btn-toggle-sidebar {
    display: none;
    border: none;
    background: none;
    font-size: 1.25rem;
    color: #475569;
    cursor: pointer;
    padding: 0.25rem;
}

/* --- Stat Cards --- */
.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    border: 1px solid #E2E8F0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.stat-card .stat-icon.blue { background: #DBEAFE; color: #2563EB; }
.stat-card .stat-icon.green { background: #D1FAE5; color: #059669; }
.stat-card .stat-icon.amber { background: #FEF3C7; color: #D97706; }
.stat-card .stat-icon.gray { background: #F1F5F9; color: #64748B; }
.stat-card .stat-icon.purple { background: #EDE9FE; color: #7C3AED; }
.stat-card .stat-icon.rose { background: #FFE4E6; color: #E11D48; }

.stat-card .stat-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: #0F172A;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #94A3B8;
    font-weight: 500;
}

/* --- Data Table --- */
.table-container {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #E2E8F0;
    overflow: hidden;
}

.table-container .table {
    margin: 0;
    font-size: 0.85rem;
}

.table-container .table thead th {
    background: #F8FAFC;
    border-bottom: 2px solid #E2E8F0;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    padding: 0.875rem 1rem;
    white-space: nowrap;
}

.table-container .table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    color: #334155;
    border-bottom: 1px solid #F1F5F9;
}

.table-container .table tbody tr:hover {
    background: #F8FAFC;
}

/* --- Status Badges --- */
.badge-status {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    white-space: nowrap;
}

.badge-belum { background: #F1F5F9; color: #64748B; }
.badge-perlu { background: #FEF3C7; color: #92400E; }
.badge-terverifikasi { background: #D1FAE5; color: #065F46; }

/* --- Action Buttons --- */
.btn-action {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* --- Page Content Padding --- */
.page-content {
    padding: 1.5rem;
    overflow-x: hidden;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 25px rgba(0,0,0,0.15);
    }
    .sidebar-overlay.active {
        display: block;
    }
    .main-content {
        margin-left: 0;
    }
    .admin-topbar {
        padding: 0.75rem 1rem;
    }
    .admin-topbar > div {
        display: flex;
        align-items: center;
    }
    .btn-toggle-sidebar {
        display: block;
        padding: 0.25rem 0.5rem;
        font-size: 1.5rem;
    }
    .topbar-breadcrumb {
        display: none; /* Sembunyikan breadcrumb di mobile agar lega */
    }
    .page-content {
        padding: 1rem;
    }
    .stat-card {
        padding: 1.25rem;
    }
    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    .fw-heading {
        font-size: 1.25rem;
    }
    .table-container {
        border-radius: 10px;
    }
    .table-container .table thead th {
        padding: 0.75rem;
    }
    .table-container .table tbody td {
        padding: 0.75rem;
    }
    
    /* Fix DataTables layout on mobile */
    .dataTables_wrapper .row {
        flex-direction: column;
    }
    .dataTables_wrapper .col-sm-12.col-md-6 {
        width: 100%;
        margin-bottom: 0.75rem;
        text-align: left !important;
    }
    .dataTables_wrapper .dataTables_filter {
        text-align: left !important;
        margin-top: 0.5rem;
    }
    .dataTables_wrapper .dataTables_paginate {
        margin-top: 1rem;
        justify-content: center !important;
    }
}

/* --- DataTables Override --- */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 0.3rem 0.5rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--accent) !important;
    color: #fff !important;
    border-color: var(--accent) !important;
    border-radius: 8px;
}

/* --- Export Buttons --- */
.btn-export {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
