/* ---
File: style.css (Premium SaaS Theme)
Version: 7.0 (Export Feature)
--- */

/* --- Import Font & Global Settings --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* --- Base Layout --- */
    --sidebar-width: 280px;
    --transition-speed: 0.3s;

    /* --- Light Mode Palette (Final Polishing) --- */
    --bg-primary: #f4f6f9; /* Background utama lebih modern */
    --bg-secondary: #ffffff; /* Background kartu & sidebar */
    --bg-tertiary: #e9ecef; /* Background elemen sekunder */
    --border-color: #e5e7eb; /* Border halus */
    --text-primary: #1f2937; /* Teks paling gelap */
    --text-secondary: #6b7280; /* Teks abu-abu */
    --text-tertiary: #9ca3af; /* Teks paling terang */
    --accent-primary: #4f46e5; /* Aksen Indigo */
    --accent-gradient: linear-gradient(to right, #6366f1, #8b5cf6); /* Gradient yang lebih dinamis */
    
    /* --- Sizing & Radius --- */
    --border-radius-xl: 16px;
    --border-radius-lg: 12px;
    --border-radius-md: 8px;

    /* --- Shadows (Softer & Deeper) --- */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Animasi --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- Layout & Sidebar --- */
.main-content { 
    margin-left: var(--sidebar-width); 
    padding: 3rem; 
    transition: margin-left var(--transition-speed) ease-in-out, padding var(--transition-speed) ease-in-out;
}

.sidebar {
    position: fixed; 
    top: 0; 
    left: 0; 
    height: 100vh;
    width: var(--sidebar-width); 
    padding: 2.5rem 1.5rem;
    display: flex; 
    flex-direction: column;
    background-color: var(--bg-secondary); 
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed) ease-in-out;
}

.sidebar-header {
    color: var(--text-primary); 
    margin-bottom: 2rem; 
    padding: 0 0.5rem;
    font-weight: 800; 
    font-size: 1.6rem;
    letter-spacing: -1px;
}
.sidebar-header i {
    color: var(--accent-primary);
}

.sidebar .nav-link {
    color: var(--text-secondary); 
    padding: 0.9rem 1rem; 
    margin-bottom: 0.5rem;
    border-radius: var(--border-radius-lg); 
    transition: all var(--transition-speed) ease-in-out;
    display: flex; 
    align-items: center; 
    font-weight: 600;
}

.sidebar .nav-link i {
    font-size: 1.25rem;
    margin-right: 1rem;
    color: var(--text-tertiary);
    transition: color var(--transition-speed) ease;
}

.sidebar .nav-link:hover { 
    background-color: var(--bg-tertiary); 
    color: var(--text-primary); 
    transform: translateX(8px); 
}

.sidebar .nav-link:hover i {
    color: var(--text-primary);
}

.sidebar .nav-link.active {
    background: var(--accent-gradient);
    color: #ffffff;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    transform: translateX(0);
}

.sidebar .nav-link.active i {
    color: #ffffff;
}

.sidebar .sidebar-footer { 
    margin-top: auto; 
}

.nav-link-logout {
    color: #ef4444 !important;
}

.nav-link-logout:hover {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}

.nav-link-logout:hover i {
    color: #991b1b !important;
}


/* --- Typography & Elements --- */
h1, h2, h3, h4, h5, h6 { 
    color: var(--text-primary); 
    font-weight: 800; 
    letter-spacing: -0.8px; 
}

.profile-greeting {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

/* --- Card Style --- */
.card {
    background-color: var(--bg-secondary); 
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl); 
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.5s ease-out forwards;
    animation-delay: calc(var(--stagger-index, 0) * 80ms); 
    opacity: 0;
    overflow: hidden;
    position: relative;
    transition: all 0.2s ease-in-out;
}

/* --- Kartu Statistik (Re-Imagined) --- */
.stat-card {
    position: relative; 
    overflow: hidden;
    border-left: 5px solid;
    transition: all var(--transition-speed) ease-in-out;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.stat-card:hover { 
    transform: translateY(-5px); 
    box-shadow: var(--shadow-lg); 
}

.stat-card:nth-child(1) { border-color: #10b981; } /* Aktif (hijau) */
.stat-card:nth-child(2) { border-color: #f59e0b; } /* Akan Habis (kuning) */
.stat-card:nth-child(3) { border-color: #ef4444; } /* Kedaluwarsa (merah) */
.stat-card:nth-child(4) { border-color: #64748b; } /* Bermasalah (abu-abu) */

.stat-card .card-body { 
    padding: 1.75rem; 
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 2; 
    position: relative; 
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    background-color: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.stat-icon-wrapper i {
    line-height: 1;
}

.stat-card .text-xs { 
    font-size: 0.8rem; 
    text-transform: uppercase; 
    font-weight: 700; 
    color: var(--text-secondary); 
    margin-bottom: 0.5rem; 
}

.stat-card .h2 { 
    font-size: 2.2rem; 
    font-weight: 900; 
    color: var(--text-primary); 
    line-height: 1;
}

/* --- Hapus aturan CSS yang membuat ikon besar dan transparan --- */
.stat-card .icon-bg {
    display: none;
}
/* --- END HAPUS --- */


/* --- Main Card & Table --- */
.card .card-header { 
    background-color: var(--bg-secondary); 
    border-bottom: 1px solid var(--border-color); 
    padding: 1.5rem 2rem; 
}

.card .card-header h6 { 
    color: var(--text-primary); 
    font-weight: 700; 
    font-size: 1.1rem; 
}

/* --- Tabs (Diperbarui) --- */
.nav-tabs-modern { 
    border-bottom: 2px solid var(--bg-tertiary); 
    display: flex; 
    flex-wrap: wrap; 
    margin-bottom: 1.5rem !important; 
}

.nav-tabs-modern .nav-item {
    margin-right: 0.5rem;
    margin-bottom: -2px; 
}

.nav-tabs-modern .nav-link {
    color: var(--text-secondary);
    font-weight: 600; 
    transition: all 0.2s ease;
    border-bottom: none;
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
    padding: 0.75rem 1.25rem; 
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color); 
    border-bottom-color: var(--bg-tertiary); 
}

.nav-tabs-modern .nav-link:hover { 
    color: var(--text-primary); 
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    border-bottom-color: var(--bg-secondary);
}

.nav-tabs-modern .nav-link.active {
    color: var(--accent-primary);
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    border-bottom-color: var(--bg-secondary); 
    position: relative;
    z-index: 1;
}

.nav-tabs-modern .nav-link .badge {
    font-weight: 500;
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    vertical-align: middle;
}

.nav-tabs-modern .nav-link.active .badge {
    background-color: var(--accent-primary) !important;
    color: #fff !important;
}


/* --- Table (Diperbarui) --- */
.table-responsive { 
    padding: 0; 
    border-radius: var(--border-radius-xl);
    overflow: hidden; 
}

.table { 
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--bg-tertiary); 
    color: var(--text-secondary); 
    font-weight: 700;
    text-transform: uppercase; 
    font-size: 0.75rem; 
    letter-spacing: 0.5px;
    padding: 1rem 1.5rem;
}

.table thead th:last-child,
.table tbody td:last-child {
    text-align: center;
}

.table tbody tr { 
    transition: background-color var(--transition-speed) ease-in-out, transform 0.2s ease; 
    background-color: var(--bg-secondary);
}

.table tbody tr td { 
    padding: 1.25rem 1.5rem; 
    vertical-align: middle; 
    border-top: 1px solid var(--border-color); 
    font-size: 0.95rem;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody td strong { 
    color: var(--text-primary); 
    font-weight: 700; 
}

.table-hover > tbody > tr:hover { 
    background-color: var(--bg-primary); 
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.table-hover > tbody > tr:hover td {
    border-color: transparent;
}


/* --- Buttons --- */
.btn { 
    border-radius: var(--border-radius-md); 
    transition: all var(--transition-speed) ease-in-out; 
    font-weight: 600; 
}
.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

/* Gaya khusus untuk tombol aksi tabel */
.table-responsive .btn-outline-primary {
    color: var(--text-secondary);
    border-color: var(--border-color);
}
.table-responsive .btn-outline-primary:hover {
    color: #ffffff;
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.table-responsive .btn-outline-success {
    color: #10b981;
    border-color: #10b981;
}
.table-responsive .btn-outline-success:hover {
    color: #ffffff;
    background-color: #10b981;
}

.table-responsive .btn-outline-warning {
    color: #f59e0b;
    border-color: #f59e0b;
}
.table-responsive .btn-outline-warning:hover {
    color: #ffffff;
    background-color: #f59e0b;
}

.table-responsive .btn-outline-danger {
    color: #ef4444;
    border-color: #ef4444;
}
.table-responsive .btn-outline-danger:hover {
    color: #ffffff;
    background-color: #ef4444;
}


.btn-icon {
    border-radius: 50% !important;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--text-secondary);
    border: none;
    background-color: transparent;
    transition: background-color 0.2s ease;
}
.btn-icon:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-icon-square {
    border-radius: var(--border-radius-md) !important;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.5rem;
}
.btn-icon-square i {
    color: var(--text-secondary);
}
.btn-icon-square:hover i {
    color: var(--text-primary);
}


.btn-primary {
    background: var(--accent-gradient);
    border: none;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.1);
}

.btn-secondary {
    background-color: #f3f4f6;
    border-color: #f3f4f6;
    color: #4b5563;
}
.btn-secondary:hover {
    background-color: #e5e7eb;
    border-color: #e5e7eb;
    color: #1f2937;
}

.btn-outline-success {
    color: #10b981;
    border-color: #10b981;
}
.btn-outline-success:hover {
    color: #ffffff;
    background-color: #10b981;
}

.btn-outline-primary {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}
.btn-outline-primary:hover {
    color: #ffffff;
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* --- Badge Status (Diperbarui) --- */
.badge { 
    padding: 0.5em 0.9em; 
    font-weight: 700; 
    letter-spacing: 0.2px; 
    border-radius: 50px;
}

.badge.bg-success { background-color: #d1fae5 !important; color: #065f46 !important; }
.badge.bg-warning { background-color: #fffbeb !important; color: #92400e !important; }
.badge.bg-danger { background-color: #fee2e2 !important; color: #991b1b !important; }

/* Kustomisasi badge kategori */
.badge.badge-bank { background-color: #dbeafe !important; color: #1e40af !important; }
.badge.badge-ewallet { background-color: #d1fae5 !important; color: #065f46 !important; }
.badge.badge-umum { background-color: #e5e7eb !important; color: #374151 !important; }
.badge.badge-problem { background-color: #fee2e2 !important; color: #991b1b !important; }
.badge.badge-default { background-color: #f3f4f6 !important; color: #4b5563 !important; }
.badge.badge-status { background-color: #dbeafe !important; color: #1e40af !important; }

/* --- Link "Lihat" di dalam badge Bermasalah (Diperbarui) --- */
.table td a {
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: color 0.2s ease-in-out;
}
.table td a:hover {
    color: var(--accent-primary) !important;
}


/* --- Form --- */
.form-label { 
    color: var(--text-primary); 
    margin-bottom: 0.5rem; 
    font-weight: 600; 
}

.form-control, .form-select {
    background-color: var(--bg-primary); 
    border-color: var(--border-color);
    padding: 0.75rem 1rem; 
    transition: all var(--transition-speed) ease;
}
.form-control-lg, .form-select-lg {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--border-radius-md);
    border-color: var(--border-color);
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-secondary); 
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* --- Modal --- */
.modal-content { 
    border: none; 
    border-radius: var(--border-radius-xl); 
    box-shadow: var(--shadow-lg); 
}

.modal-header { 
    border-bottom: 1px solid var(--border-color); 
    padding: 1.5rem; 
}

.modal-body { 
    padding: 1.5rem; 
}

.modal-footer { 
    border-top: 1px solid var(--border-color); 
    padding: 1rem 1.5rem; 
}


/* --- Responsive Mobile --- */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .sidebar {
        left: -100%;
    }

    .stat-card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }
    
    .stat-icon-wrapper {
        display: none;
    }

    h1 {
        font-size: 1.75rem;
    }

    .profile-greeting {
        display: none;
    }
    
    .nav-tabs-modern .nav-link {
        padding: 0.5rem 0.75rem;
    }

    .table thead th, .table tbody tr td {
        padding: 0.75rem 1rem;
    }
    .btn-icon-square {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}
