/* File: assets/css/style.css */
:root {
    --primary-color: #0ea5e9; /* Sky Blue Modern */
    --primary-dark: #0284c7;  /* Darker Blue for Hover */
    --secondary-color: #ffffff;
    --bg-color: #f0f9ff;      /* Very light blue background */
    --text-color: #334155;    /* Slate Gray text */
    --sidebar-width: 260px;
    --header-height: 60px;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 15px;
    overflow-x: hidden; /* Mencegah scroll samping body */
}

/* --- Layout Wrapper --- */
.wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    width: 100%;
}

/* --- Sidebar Styling --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--secondary-color);
    border-right: 1px solid #e2e8f0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: all 0.3s ease; /* Animasi halus saat geser */
}

.sidebar-header {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- Navigation Links --- */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    color: #64748b;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-link:hover, .nav-link.active {
    background-color: #f0f9ff;
    color: var(--primary-color);
}

.nav-link span {
    margin-left: 10px;
}

/* --- Main Content Area --- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem;
    width: 100%;
    transition: all 0.3s ease;
}

/* --- Components: Card, Button, Form --- */
.card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    width: 100%;
}

.btn-primary {
    display: inline-block;
    padding: 0.7rem 1.2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s;
    text-align: center;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* --- Table Responsive Wrapper (PENTING BUAT HP) --- */
.table-responsive {
    overflow-x: auto; /* Scroll samping jika tabel kepanjangan */
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap; /* Mencegah teks turun baris maksa */
}

.table th, .table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.table th {
    background-color: #f8fafc;
    color: var(--text-color);
}

/* --- Mobile Menu Toggle Button (Hanya muncul di HP) --- */
.menu-toggle {
    display: none; /* Sembunyi di Desktop */
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    margin-bottom: 1rem;
}

/* =========================================
   MEDIA QUERIES (RESPONSIVE RULES)
   ========================================= */

/* Tablet & Mobile (Layar dibawah 768px) */
@media (max-width: 768px) {
    /* 1. Sidebar Sembunyi ke Kiri */
    .sidebar {
        left: -280px; /* Geser keluar layar */
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }

    /* 2. Jika Sidebar Aktif (Diklik Toggle) */
    .sidebar.active {
        left: 0; /* Munculkan kembali */
    }

    /* 3. Konten Utama Full Width */
    .main-content {
        margin-left: 0;
        padding: 1rem; /* Padding lebih kecil di HP */
    }

    /* 4. Munculkan Tombol Menu */
    .menu-toggle {
        display: inline-block;
    }

    /* 5. Font Size menyesuaikan */
    body {
        font-size: 14px;
    }

    h2 {
        font-size: 1.5rem;
    }
    
    /* 6. Form Group di HP jadi 1 kolom (stack) */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    /* 7. Overlay Gelap saat sidebar muncul */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    .sidebar-overlay.active {
        display: block;
    }
}

/* =========================================
   TAMBAHAN WAJIB: STYLE HALAMAN LOGIN
   (Letakkan di paling bawah file style.css)
   ========================================= */

.login-container {
    display: flex; /* Kunci agar posisi bisa ditengah */
    justify-content: center; /* Tengah secara Horizontal */
    align-items: center; /* Tengah secara Vertikal */
    min-height: 100vh; /* Tinggi minimal seukuran layar penuh */
    background: linear-gradient(135deg, #f0f9ff 0%, #cbebff 100%); /* Background Biru Langit */
    padding: 20px;
}

.login-card {
    background: white;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px; /* Membatasi lebar agar tidak full screen */
    border-radius: 12px; /* Sudut melengkung */
    box-shadow: 0 10px 25px rgba(14, 165, 233, 0.15); /* Bayangan estetik */
    text-align: center;
    border: 1px solid #e2e8f0;
    position: relative;
}

/* Style untuk Header Login (Logo & Judul) */
.login-header {
    margin-bottom: 2rem;
}

.login-logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: block;
}

.login-header h2 {
    color: #0ea5e9; /* Warna Primary */
    margin-bottom: 5px;
    font-weight: bold;
}

/* Style untuk Pesan Error / Sukses */
.alert-error {
    background-color: #fef2f2;
    color: #ef4444;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #fecaca;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Footer Login */
.login-footer {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Memastikan Input Group Rapi */
.input-group {
    width: 100%;
}