:root {
    --primary: #0047BB;
    --primary-light: #0066FF;
    --primary-hover: #003599;
    --secondary: #00BFFF;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --gray: #64748b;
    --light: #f8fafc;
    --border: #dbeafe;
    --gradient-primary: linear-gradient(135deg, #0066FF 0%, #0047BB 100%);
    --shadow-sm: 0 1px 3px 0 rgba(0, 71, 187, 0.08);
    --shadow-md: 0 10px 25px -5px rgba(0, 71, 187, 0.15), 0 8px 10px -6px rgba(0, 71, 187, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 71, 187, 0.2), 0 10px 10px -5px rgba(0, 71, 187, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f1f5f9;
    color: var(--dark);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   AUTH PAGES (LOGIN/REGISTER)
   ========================================= */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
    position: relative;
    overflow: hidden;
    padding: 24px;
    z-index: 1;
}

/* Dekorasi Lingkaran Garis Latar Belakang (Outline Glowing Circles) */
.auth-wrapper::before,
.auth-wrapper::after,
.auth-wrapper .bg-circle-3 {
    content: '';
    position: absolute;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    background: transparent;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    will-change: transform;
}

/* Lingkaran Garis 1 (Kiri Atas) */
.auth-wrapper::before {
    width: 500px;
    height: 500px;
    border: 2px solid rgba(0, 71, 187, 0.25);
    top: -150px;
    left: -150px;
    animation: rotateSlow 30s linear infinite;
}

/* Lingkaran Garis 2 (Kanan Bawah) */
.auth-wrapper::after {
    width: 420px;
    height: 420px;
    border: 1.5px solid rgba(0, 191, 255, 0.3);
    bottom: -120px;
    right: -120px;
    animation: rotateSlow 35s linear infinite reverse;
}

/* Lingkaran Garis 3 (Kanan Atas - Putus-putus) */
.auth-wrapper .bg-circle-3 {
    width: 280px;
    height: 280px;
    border: 2px dashed rgba(0, 102, 255, 0.35);
    top: 12%;
    right: 12%;
    animation: rotateSlow 25s linear infinite;
}

/* Animasi Putar Perlahan */
@keyframes rotateSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto 24px;
    box-shadow: 0 10px 20px rgba(0, 71, 187, 0.3);
}

.auth-logo i { width: 32px; height: 32px; }
.auth-title { text-align: center; font-size: 26px; font-weight: 800; color: var(--dark); margin-bottom: 6px; letter-spacing: -0.025em; }
.auth-subtitle { text-align: center; font-size: 14px; color: var(--gray); margin-bottom: 32px; font-weight: 500; }

.form-floating-custom { position: relative; margin-bottom: 20px; }

.form-floating-custom .form-control {
    padding: 14px 16px 14px 48px;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    font-size: 14px;
    transition: all 0.25s ease;
    background: #f8fafc;
    color: var(--dark);
}

.form-floating-custom .form-control:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 71, 187, 0.12);
    outline: none;
}

.form-floating-custom .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--gray);
    pointer-events: none;
    transition: color 0.2s;
}

.form-floating-custom .form-control:focus ~ .input-icon { color: var(--primary); }

.btn-gradient {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 8px 20px rgba(0, 71, 187, 0.25);
    width: 100%;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-hover) 100%);
    box-shadow: 0 12px 24px rgba(0, 71, 187, 0.35);
    color: white;
}

/* =========================================
   LAYOUT: SIDEBAR & TOPBAR
   ========================================= */
.app-sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand-icon {
    width: 42px;
    height: 42px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 71, 187, 0.25);
}

.sidebar-brand-text { font-size: 20px; font-weight: 800; color: var(--primary); letter-spacing: -0.025em; margin: 0; }
.sidebar-brand-sub { font-size: 11px; color: var(--gray); font-weight: 600; margin-top: -2px; }

.sidebar-user {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name { font-size: 13px; font-weight: 700; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: var(--gray); text-transform: capitalize; font-weight: 500; }

.sidebar-menu { flex: 1; overflow-y: auto; padding: 16px 12px; list-style: none; margin: 0; }
.sidebar-menu-label { font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; padding: 12px 12px 6px; margin: 0; }
.sidebar-menu-item { margin-bottom: 4px; }

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--gray);
    text-decoration: none;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-menu-link:hover { background: #f1f5f9; color: var(--primary); }
.sidebar-menu-link.active { background: rgba(0, 71, 187, 0.08); color: var(--primary); font-weight: 600; }
.sidebar-menu-link i { width: 18px; height: 18px; stroke-width: 2; }

.sidebar-footer { padding: 16px 12px; border-top: 1px solid var(--border); }

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--danger);
    text-decoration: none;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.2s;
}

.sidebar-logout:hover { background: rgba(239, 68, 68, 0.08); }

.main-content { margin-left: 260px; padding: 32px 24px; min-height: 100vh; transition: all 0.3s ease; }

.topbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

/* =========================================
   DASHBOARD COMPONENTS
   ========================================= */
.stat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(0, 71, 187, 0.2); }

.stat-card-icon {
    width: 52px; height: 52px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 18px; background: rgba(0, 71, 187, 0.1); color: var(--primary);
}

.stat-card-icon svg { width: 26px; height: 26px; }
.stat-card.success .stat-card-icon { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-card.warning .stat-card-icon { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-card.danger .stat-card-icon { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.stat-card-label { font-size: 11px; color: var(--gray); font-weight: 700; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card-value { font-size: 30px; font-weight: 800; color: var(--dark); line-height: 1.1; letter-spacing: -0.02em; }

/* --- CARDS & TABLES --- */
.card-custom {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.card-custom:hover { box-shadow: var(--shadow-md); }

.card-custom-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
}

.card-custom-header h5 {
    font-size: 17px; font-weight: 700; color: var(--dark); margin: 0;
    display: flex; align-items: center; gap: 10px; letter-spacing: -0.01em;
}

.card-custom-body { padding: 24px; }

.table-custom { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-custom thead th {
    background: #f8fafc; color: var(--gray); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em; padding: 14px 20px;
    text-align: left; border-bottom: 1px solid var(--border);
}

.table-custom tbody td {
    padding: 16px 20px; font-size: 13.5px; color: var(--dark);
    border-bottom: 1px solid #f1f5f9; vertical-align: middle;
}

.table-custom tbody tr { transition: background-color 0.15s ease; }
.table-custom tbody tr:hover { background: rgba(0, 71, 187, 0.02); }
.table-custom tbody tr:last-child td { border-bottom: none; }

/* --- BADGES & BUTTONS --- */
.badge-custom {
    padding: 6px 12px; border-radius: 8px; font-size: 11px; font-weight: 700;
    display: inline-flex; align-items: center; gap: 6px; letter-spacing: 0.025em;
}

.badge-primary { background: rgba(0, 71, 187, 0.1); color: var(--primary); }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-compact { padding: 4px 10px; font-size: 10px; }

.btn-primary-custom {
    background: var(--gradient-primary); color: white; border: none;
    padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 13.5px;
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    transition: all 0.2s ease; text-decoration: none; box-shadow: 0 4px 12px rgba(0, 71, 187, 0.2);
}

.btn-primary-custom:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 71, 187, 0.3); color: white; }

.btn-icon {
    width: 36px; height: 36px; border-radius: 10px; display: inline-flex;
    align-items: center; justify-content: center; border: none; background: transparent;
    transition: all 0.2s ease; cursor: pointer;
}

.btn-icon svg { width: 18px; height: 18px; }
.btn-icon-primary { color: var(--primary); }
.btn-icon-primary:hover { background: rgba(0, 71, 187, 0.1); }
.btn-icon-success { color: var(--success); }
.btn-icon-success:hover { background: rgba(16, 185, 129, 0.1); }
.btn-icon-warning { color: var(--warning); }
.btn-icon-warning:hover { background: rgba(245, 158, 11, 0.1); }
.btn-icon-danger { color: var(--danger); }
.btn-icon-danger:hover { background: rgba(239, 68, 68, 0.1); }
.btn-icon-compact { width: 30px; height: 30px; }
.btn-icon-compact svg { width: 15px; height: 15px; }

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 991px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.show { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .main-content { margin-left: 0; padding: 16px; }
}

@media (max-width: 768px) {
    .auth-card { padding: 28px 20px; }
    .stat-card-value { font-size: 26px; }
    .topbar { padding: 12px 16px; }
}

/* =========================================
   DATATABLES PAGINATION (COMPACT VERSION)
   ========================================= */

/* Info Text */
.dataTables_wrapper .dataTables_info {
    color: var(--gray) !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    padding-top: 14px !important;
}
.dataTables_wrapper .dataTables_info strong {
    color: var(--primary);
    font-weight: 700;
}

/* Length Menu & Search */
.dataTables_wrapper .dataTables_length, 
.dataTables_wrapper .dataTables_filter {
    color: var(--gray) !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    margin-bottom: 12px;
}
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 1.5px solid var(--border) !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    font-size: 12.5px !important;
    color: var(--dark) !important;
    background: #ffffff !important;
    transition: all 0.25s ease !important;
}
.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 71, 187, 0.1) !important;
    outline: none !important;
}

/* Pagination Container */
.dataTables_wrapper .dataTables_paginate {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
    padding-top: 12px;
}

/* Tombol Pagination - SIZE KECIL */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px !important;
    color: var(--gray) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    min-width: 28px !important;
    height: 28px !important;
    padding: 0 8px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
}

/* Hover */
.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) {
    background: rgba(0, 71, 187, 0.05) !important;
    color: var(--primary) !important;
    border-color: rgba(0, 71, 187, 0.2) !important;
}

/* Active / Current */
.dataTables_wrapper .dataTables_paginate .paginate_button.current, 
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--gradient-primary) !important; 
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px rgba(0, 71, 187, 0.2) !important;
}

/* Disabled */
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled, 
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    background: #f8fafc !important;
    color: #cbd5e1 !important;
    border-color: #f1f5f9 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Responsif */
@media (max-width: 768px) {
    .dataTables_wrapper .dataTables_length, 
    .dataTables_wrapper .dataTables_filter {
        width: 100%;
        margin-bottom: 10px;
    }
    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
    }
    .dataTables_wrapper .dataTables_paginate {
        justify-content: center;
        width: 100%;
    }
}