/* assets/css/style.css */

/* VARIABEL WARNA (Bisa Diubah-ubah) */
:root {
    /* Warna Utama Sistem (Silakan ganti kode hex ini untuk mengubah tema warna) */
    --primary-color: #22c55e;        /* Hijau seperti contoh gambar */
    --primary-hover: #16a34a;
    --grad-start: #15803d;           /* Gradasi Panel Kiri */
    --grad-end: #0f172a;

    /* Mode Terang (Light Mode Default) */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-title: #0f172a;
    --text-body: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --input-bg: #f8fafc;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Skema Dark Mode */
body.dark-mode {
    --bg-body: #090d16;
    --bg-card: #1e293b;
    --text-title: #f8fafc;
    --text-body: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    --input-bg: #151f32;
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background-color 0.3s;
}

/* Saat dark mode aktif, logo akan sedikit lebih terang agar teks terlihat */
body.dark-mode .sidebar-brand img {
    filter: brightness(0) invert(1); /* Ini akan membuat logo hitam menjadi putih */
}

/* Outer Wrapper (Kotak Utama) */
.login-wrapper {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 960px;
    min-height: 560px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    display: flex;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s, border-color 0.3s;
}

/* =========================================
   PANEL KIRI (Branding & Gradasi Warna)
   ========================================= */
.brand-panel {
    flex: 1;
    background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #ffffff;
    position: relative;
}

.brand-content {
    text-align: center;
    max-width: 340px;
}

.brand-logo {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #ffffff;
    opacity: 0.95;
}

.brand-panel h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.brand-panel p {
    font-size: 0.95rem;
    opacity: 0.8;
    line-height: 1.6;
}

/* =========================================
   PANEL KANAN (Formulir Login)
   ========================================= */
.form-panel {
    flex: 1.1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
    background-color: var(--bg-card);
}

.form-content {
    width: 100%;
    max-width: 380px;
}

.form-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-title);
    margin-bottom: 8px;
}

.form-subtitle {
    font-size: 0.95rem;
    color: var(--text-body);
    margin-bottom: 30px;
}

/* Form Groups & Inputs */
.form-group {
    margin-bottom: 20px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-body);
    margin-bottom: 8px;
    display: block;
}

.input-box {
    position: relative;
    display: flex;
    align-items: center;
}

.input-box input {
    width: 100%;
    padding: 12px 40px;
    font-size: 0.95rem;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-title);
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
}

.input-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.toggle-password {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}

.forgot-link {
    font-size: 0.8rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Tombol Submit */
.btn-submit {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 25px;
    transition: background-color 0.2s;
}

.btn-submit:hover {
    background-color: var(--primary-hover);
}

/* Footer Tautan Registrasi */
.register-footer {
    text-align: center;
    margin-top: 30px;
    font-size: 0.9rem;
    color: var(--text-body);
}

.register-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.register-footer a:hover {
    text-decoration: underline;
}

/* Alerts */
.alert-success, .alert-danger {
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    text-align: center;
}
.alert-success { background-color: rgba(34, 197, 94, 0.1); color: #16a34a; }
.alert-danger { background-color: rgba(239, 68, 68, 0.1); color: #dc2626; }

/* LAYOUT UTAMA DASBOR INTERNAL */
.app-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
    align-items: stretch;
}

/* SIDEBAR STYLING */
.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 25px 20px;
    transition: all 0.3s;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    margin-bottom: 20px;
}

/* Membatasi agar logo tidak keluar dari sidebar */
.sidebar-brand img {
    width: 100%;
    max-width: 150px; /* Sesuaikan ukuran ini agar pas */
    height: auto;
    object-fit: contain;
    display: block;
}
.user-profile-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 25px;
}
.user-profile-summary .avatar { font-size: 2.2rem; color: var(--text-muted); }
.user-info { display: flex; flex-direction: column; }
.user-info .username { font-weight: 600; font-size: 0.95rem; }
.user-info .badge-role { font-size: 0.75rem; color: var(--primary-color); font-weight: bold; }

.sidebar-menu { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-body);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.menu-item:hover, .menu-item.active {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--primary-color);
}
.menu-item.logout:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* THEME TOGGLE BUTTON */
.btn-theme-toggle {
    width: 100%;
    padding: 12px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-body);
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
}
body.dark-mode .icon-light { display: inline-block; }
body.dark-mode .icon-dark { display: none; }
body:not(.dark-mode) .icon-light { display: none; }
body:not(.dark-mode) .icon-dark { display: inline-block; }

/* KONTEN UTAMA */
.main-content { flex: 1; padding: 40px; background-color: var(--bg-body); overflow-y: auto; }
.topbar { margin-bottom: 35px; }
.topbar h2 { font-size: 1.75rem; color: var(--text-title); margin-bottom: 5px; }
.topbar p { text-align: left; margin-top: 0; }

/* GRID STATISTIK */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 25px; margin-bottom: 35px; }
.stat-card {
    background-color: var(--bg-card);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
}
.stat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; justify-content: center; align-items: center; font-size: 1.4rem; }
.bg-success-light { background-color: rgba(34, 197, 94, 0.1); }
.bg-primary-light { background-color: rgba(79, 70, 229, 0.1); }
.bg-warning-light { background-color: rgba(245, 158, 11, 0.1); }
.stat-data h3 { font-size: 1.5rem; color: var(--text-title); }
.stat-data p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

/* TABEL DATA */
.data-card { background-color: var(--bg-card); border-radius: 16px; border: 1px solid var(--border-color); padding: 25px; box-shadow: var(--shadow); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card-header h4 { font-size: 1.1rem; color: var(--text-title); display: flex; align-items: center; gap: 8px; }
.btn-link { color: var(--primary-color); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; }
.data-table th { color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; }
.badge-project { background-color: var(--input-bg); padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border-color); font-size: 0.8rem; font-weight: 500; }
.muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* Pastikan teks di dalam tabel mengikuti variabel warna sistem */
.data-table td {
    color: var(--text-body) !important;
}

/* Pastikan list (bullet/numbering) juga terlihat jelas */
.data-table td ul, 
.data-table td ol {
    color: var(--text-body) !important;
    padding-left: 20px;
    margin: 5px 0;
}

/* Mengatur warna placeholder Quill agar terlihat jelas di Dark Mode */
.dark-mode .ql-editor.ql-blank::before {
    color: #9ca3af !important; /* Warna abu-abu terang yang kontras di latar gelap */
    font-style: italic;       /* Opsional: agar terlihat seperti placeholder */
    opacity: 1 !important;    /* Menghilangkan transparansi bawaan browser */
}

/* Jika Anda ingin memastikan placeholder tetap terlihat normal di Light Mode */
.ql-editor.ql-blank::before {
    color: #6b7280; /* Warna untuk Light Mode */
    opacity: 1 !important;
}

/* Styling Slider */
.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(16px);
}

/* Memastikan checkbox tercentang otomatis sesuai status tema saat load */

body.dark-mode {
    background-color: #121212;
    color: #ffffff;
}
/* Pastikan warna teks tabel juga mengikuti */
body.dark-mode .data-table td {
    color: var(--text-body);
}

/* Responsive untuk layar HP */
@media (max-width: 768px) {
    .login-wrapper {
        flex-direction: column;
        max-width: 450px;
    }
    .brand-panel {
        padding: 30px;
    }
    .form-panel {
        padding: 40px 30px;
    }
}