/* =========================================
   1. RESET & VARIABEL GLOBAL
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Definisi Warna (Abaikan jika editor hosting memberi tanda merah disini) */
:root {
    --primary-color: #3498db;    /* Biru Utama */
    --secondary-color: #2c3e50;  /* Biru Gelap (Sidebar) */
    --accent-color: #f1c40f;     /* Kuning */
    --danger-color: #e74c3c;     /* Merah (Sudah diperbaiki) */
    --success-color: #2ecc71;    /* Hijau */
    --bg-color: #f4f6f9;         /* Background Abu Muda */
    --white: #ffffff;
    --text-color: #333333;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* =========================================
   2. KOMPONEN UMUM (Tombol, Form, Alert)
   ========================================= */
.btn-login {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px;
    border: none;
    border-radius: 5px;
    width: 100%;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
}
.btn-login:hover { background-color: #2980b9; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; }
.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}
.form-control:focus { border-color: var(--primary-color); outline: none; }

/* Kotak Pesan Error/Sukses */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
    font-size: 14px;
}

/* =========================================
   3. LAYOUT LANDING PAGE (Halaman Depan)
   ========================================= */
.landing-body {
    background-color: var(--white);
    display: block;
    overflow-y: auto;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar .brand { font-size: 24px; font-weight: bold; color: var(--secondary-color); }
.navbar .menu a { margin-left: 20px; font-weight: 600; color: #555; }

.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 60px 5%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    min-height: 550px;
}
.hero-text { flex: 1; padding-right: 50px; }
.hero-text h1 { font-size: 42px; margin-bottom: 20px; }
.hero-text p { font-size: 18px; margin-bottom: 30px; opacity: 0.9; }

/* Kotak Login di Kanan */
.login-card {
    width: 350px;
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    color: var(--text-color);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.login-card h3 { text-align: center; margin-bottom: 20px; color: var(--secondary-color); }

.features { padding: 60px 5%; text-align: center; }
.feature-grid { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }
.feature-item {
    width: 300px;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #fff;
}

/* =========================================
   4. LAYOUT DASHBOARD (Admin/Guru/Siswa)
   ========================================= */
.dashboard-body {
    display: flex; /* Sidebar Kiri, Konten Kanan */
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-color);
}

/* Sidebar (Menu Kiri) */
.sidebar {
    width: 250px;
    background-color: var(--secondary-color);
    color: var(--white);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.sidebar .logo {
    padding: 20px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-menu { flex: 1; padding-top: 20px; overflow-y: auto; }
.sidebar-menu a {
    display: block;
    padding: 12px 20px;
    color: #ecf0f1;
    border-left: 4px solid transparent;
}
.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: rgba(255,255,255,0.1);
    border-left-color: var(--primary-color);
}
.sidebar-footer { padding: 20px; text-align: center; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer a { color: #e74c3c; font-weight: bold; }

/* Area Konten Utama (Kanan) */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Agar bisa discroll */
}

/* Header Dashboard */
.main-content header {
    background: var(--white);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.user-info { display: flex; align-items: center; gap: 10px; }
.user-info img { width: 35px; height: 35px; border-radius: 50%; object-fit: cover; }

.content { padding: 30px; }

/* Kartu Statistik */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.card {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-top: 4px solid var(--primary-color);
}
.card h3 { font-size: 28px; margin-bottom: 5px; color: var(--secondary-color); }
.card p { color: #777; font-size: 14px; text-transform: uppercase; }

/* Tabel Data */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #eee; }
th { background-color: var(--primary-color); color: var(--white); text-transform: uppercase; font-size: 12px; }
tr:hover { background-color: #f9f9f9; }

/* =========================================
   5. RESPONSIVE (Untuk HP)
   ========================================= */
@media (max-width: 768px) {
    /* Hero Section jadi tumpuk */
    .hero { flex-direction: column; text-align: center; padding: 30px; }
    .hero-text { padding: 0; margin-bottom: 30px; }
    .login-card { width: 100%; }
    
    /* Dashboard jadi tumpuk */
    .dashboard-body { flex-direction: column; overflow-y: auto; }
    .sidebar { width: 100%; height: auto; }
    .sidebar-menu { display: flex; overflow-x: auto; padding: 10px; }
    .sidebar-menu a { white-space: nowrap; padding: 10px; border-left: none; border-bottom: 3px solid transparent; }
}