/* Reset margin/padding dasar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    font-family: Arial, sans-serif;
}

/* ============================
   Layout halaman Login
   ============================ */
.container-login {
    display: flex;
    height: 100vh;
}

/* Kiri = 2/3 */
.login-left {
    flex: 2;
    position: relative;
}
.login-left .bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Kanan = 1/3 */
.login-right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
}
.login-box {
    width: 80%;
    max-width: 320px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}
.login-box .logo-img {
    width: 120px;
    margin-bottom: 20px;
}
.login-box h2 {
    margin-bottom: 15px;
}
.login-box .form-group {
    margin-bottom: 15px;
    text-align: left;
}
.login-box label {
    display: block;
    font-size: 0.9em;
    margin-bottom: 5px;
}
.login-box input {
    width: 100%;
    padding: 8px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.btn-login {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: #fff;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.btn-login:hover {
    background-color: #0069d9;
}
.error {
    color: #ff3333;
    margin-bottom: 10px;
}

/* ============================
   Layout Dashboard Admin
   ============================ */
/* ============================
   Header Dashboard Admin
   ============================ */

/* === Reset & Base === */
body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background-color: #f4f4f4;
}

/* === Header === */
.header-admin {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;           /* dikecilkan dari 100px → 70px agar proporsional */
    display: flex;
    align-items: stretch;
    z-index: 1000;
}

.header-left {
    width: 220px;           /* sama dengan lebar sidebar */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 12px;
    background-color: #ffffff;
    box-sizing: border-box;
    flex-shrink: 0;
    gap: 10px;
}

.logo-kiri {
    height: 48px;           /* proporsional dengan header 70px */
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.text-lines {
    display: flex;
    flex-direction: column;
    font-weight: 800;
    line-height: 1.15;
    font-size: 0.72rem;     /* sedikit lebih kecil agar pas di 220px */
    white-space: nowrap;
}

.text-lines .line1,
.text-lines .line2 {
    color: #1a7c1a;
}

.text-lines .line3 {
    color: #cc0000;
}

.header-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #4CAF50;
    padding: 0 20px;
    color: white;
    box-sizing: border-box;
    gap: 12px;
}

/* Kiri dalam header-right: hamburger + info sekolah */
.school-info {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    min-width: 0;
}

/* Grup teks nama sekolah + nama guru */
.school-text-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.school-name {
    font-size: 1.05em;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.teacher-name {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.88);
    margin-top: 1px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo-kanan {
    height: 44px;           /* proporsional dengan header 70px */
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 50%;
}

/* === Layout Wrapper === */
.container-admin {
    display: flex;
    margin-top: 70px;
    min-height: calc(100vh - 70px);
}

/* === Sidebar ===
   ⚠️ PERBAIKAN: top diubah dari 0 → 100px agar tidak menutupi header.
      height diubah dari 100vh → calc(100vh - 100px) menyesuaikan.
*/
.sidebar-admin {
    width: 220px;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #2d00ff, #320082);
    color: white;
    padding: 20px;
    box-sizing: border-box;

    /* Fix: mulai di bawah header */
    position: fixed;
    top: 70px;
    left: 0;
    height: calc(100vh - 70px);
    z-index: 1050;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
}

.sidebar-admin.open {
    transform: translateX(0);
}

.sidebar-admin img {
    width: 120px;
    display: block;
    margin: 0 auto 20px auto;
}

.sidebar-admin .menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-admin .menu li {
    margin-bottom: 10px;
}

.sidebar-admin .menu a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background 0.3s;
}

.sidebar-admin .menu a.active,
.sidebar-admin .menu a:hover {
    background-color: #ff0059;
}

/* === Main Content === */
.main-content-admin {
    flex: 1;
    padding: 30px;
    background-color: #f9f9f9;
    min-height: calc(100vh - 70px);
    overflow-x: auto;
    box-sizing: border-box;
    transition: margin-left 0.28s ease;
    margin-left: 0;
}

/* === Buttons === */
.btn-primary,
.btn-download {
    display: inline-block;
    padding: 10px 15px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: white;
}

.btn-primary {
    background-color: #007bff;
}

.btn-primary:hover {
    background-color: #0069d9;
}

.btn-download {
    background-color: #28a745;
}

.btn-download:hover {
    background-color: #218838;
}

/* === Info Box === */
.info {
    background-color: #fff3cd;
    border-left: 5px solid orange;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #856404;
}

/* === Table === */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

/* ============================
   Layout Dashboard Siswa
   ============================ */
.container-student {
    display: flex;
    min-height: 100vh;
}

/* Kiri = form 1/3 */
.student-left {
    flex: 1;
    max-width: 350px;
    padding: 30px;
    background-color: #f1f1f1;
}
.student-left h2 {
    margin-bottom: 15px;
}
.student-left p {
    margin-bottom: 20px;
}
.student-left form {
    margin-bottom: 20px;
}
.student-left .btn-primary {
    margin-top: 10px;
}
.btn-logout {
    display: inline-block;
    margin-top: 20px;
    color: #fff;
    background-color: #dc3545;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
}
.btn-logout:hover {
    background-color: #c82333;
}

/* Kanan = background 2/3 */
.student-right {
    flex: 2;
    position: relative;
}
.bg-image-student {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.greeting-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255,255,255,0.8);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}
.greeting-box h2 {
    margin-bottom: 10px;
}

.teacher-name {
    font-size: 0.82rem;
    color: #f0f0f0;
    text-align: right;
    margin-top: 2px;
    letter-spacing: 0.5px;
}
.menu .menu-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #aaa;
    padding: 0.8rem 0.5rem 0.2rem;
    list-style: none;
    pointer-events: none;
}

/* ─── Nav Label di dalam sidebar ─── */
.nav-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    padding: 0.8rem 0.5rem 0.2rem;
    pointer-events: none;
}

/* ─── Hamburger Button ─────────────────────────── */
.hamburger-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 12px 0 0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    flex-shrink: 0;
}
.hamburger-btn:focus { outline: none; }

/* ─── Overlay (mobile) ─────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1040;
}
.sidebar-overlay.active { display: block; }

/* ─── Mobile ──────────────────────────────────── */
@media (max-width: 768px) {
    /* Sidebar mulai dari bawah header juga di mobile */
    .sidebar-admin {
        top: 70px;
        height: calc(100vh - 70px);
        width: 220px;
        transform: translateX(-100%);
    }
    .sidebar-admin.open {
        transform: translateX(0);
    }

    .main-content-admin {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .container-admin {
        flex-direction: column;
    }

    /* Sidebar lama (class .sidebar) jika ada */
    .sidebar {
        position: fixed;
        top: 70px;
        left: -220px;
        height: calc(100vh - 70px);
        z-index: 999;
        transition: left 0.3s ease;
        overflow-y: auto;
        width: 200px;
    }
    .content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .main { flex-direction: column; }
}
