/* Konfigurasi Warna Tema Gelap */
:root {
    --bg-dark: #0f1225;
    --bg-card: #1a1d36;
    --text-main: #f8f9fa;
    --text-muted: #aeb5ce; /* DIPERBARUI: Warna abu-abu dibuat jauh lebih terang */
    --primary-color: #6a4bff;
    --primary-hover: #583be8;
    --sidebar-width: 250px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

/* ---------------------------------------------------
   OVERRIDE BOOTSTRAP (PERBAIKAN KONTRAS TEKS)
----------------------------------------------------- */
/* Memaksa class text-muted Bootstrap agar menggunakan warna terang kita */
.text-muted {
    color: var(--text-muted) !important;
}

/* Memastikan teks tabel terbaca dengan jelas */
.table {
    color: var(--text-main) !important;
}
.table-dark {
    --bs-table-color: var(--text-main);
    --bs-table-bg: transparent;
    --bs-table-border-color: rgba(255,255,255,0.1);
}
.table-hover > tbody > tr:hover > * {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* ---------------------------------------------------
   AUTH PAGES (LOGIN & REGISTER)
----------------------------------------------------- */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-dark);
    padding: 20px;
}

.auth-card {
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 450px;
}

.auth-card h3 {
    color: var(--text-main);
    font-weight: 600;
}

.auth-card .form-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-card .form-control {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.auth-card .form-control:focus {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    color: var(--text-main);
    box-shadow: 0 0 0 0.25rem rgba(106, 75, 255, 0.25);
}

.auth-card a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-card a:hover {
    color: var(--primary-hover);
}

.btn-primary-custom {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-primary-custom:hover {
    background-color: var(--primary-hover);
    color: #fff;
}

/* ---------------------------------------------------
   SIDEBAR STYLING
----------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background-color: var(--bg-card);
    border-right: 1px solid rgba(255,255,255,0.05);
    padding: 20px 0;
    z-index: 1000;
}

.sidebar-brand {
    padding: 0 20px 30px;
    font-size: 1.25rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand .icon-box {
    background: var(--primary-color);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    padding: 5px 20px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.sidebar-nav a:hover {
    color: var(--text-main);
    background-color: rgba(255,255,255,0.05);
}

.sidebar-nav a.active {
    background-color: rgba(106, 75, 255, 0.15);
    color: var(--primary-color);
    font-weight: 500;
}

.logout-section {
    position: absolute;
    bottom: 20px;
    width: 100%;
    padding: 0 20px;
}

/* ---------------------------------------------------
   MAIN CONTENT AREA
----------------------------------------------------- */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: 100vh;
}

.page-header h4 {
    font-weight: 600;
    margin-bottom: 5px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---------------------------------------------------
   CARD STYLING
----------------------------------------------------- */
.stat-card {
    background-color: var(--bg-card);
    border: none;
    border-radius: 12px;
    padding: 20px;
    height: 100%;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.stat-icon.purple { background-color: rgba(168, 85, 247, 0.2); color: #a855f7; }
.stat-icon.blue { background-color: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.stat-icon.green { background-color: rgba(34, 197, 94, 0.2); color: #22c55e; }
.stat-icon.orange { background-color: rgba(249, 115, 22, 0.2); color: #f97316; }

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.trend-up { color: #22c55e; font-size: 0.8rem; }
.trend-down { color: #ef4444; font-size: 0.8rem; }

.chart-card {
    background-color: var(--bg-card);
    border: none;
    border-radius: 12px;
}
.chart-card .card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-main);
    font-weight: 600;
    padding: 15px 20px;
}

/* ---------------------------------------------------
   MODAL STYLING
----------------------------------------------------- */
.modal-content .form-label {
    color: var(--text-main);
    font-weight: 500;
}
.modal-content .form-control, 
.modal-content .form-select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}
.modal-content .form-control:focus,
.modal-content .form-select:focus {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    color: var(--text-main);
    box-shadow: 0 0 0 0.25rem rgba(106, 75, 255, 0.25);
}
.modal-content .form-text {
    color: var(--text-muted) !important;
}
/* Perbaikan Warna pada Menu Pilihan (Dropdown Options) */
select.form-select option,
select.form-control option {
    background-color: var(--bg-card);
    color: var(--text-main);
}
/* Perbaikan Warna Teks Panduan (Placeholder) di dalam Form */
.form-control::placeholder,
.form-select::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.7 !important;
}