/* =====================
   RESET DASAR
===================== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* =====================
   BACKGROUND
===================== */
.login-bg {
    background: linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)),
    url("FOTO/melihat-lebih-dekat-sekolah-rakyat-di-sentra-handayani-jaktim-1751179722558_169.jpeg");
    background-size: cover;
    background-position: center;
    height: 100vh;
}

.staff-bg {
    background-color: #f4f6f9;
    min-height: 100vh;
}

/* =====================
   NAVBAR
===================== */
.navbar {
    background: linear-gradient(90deg, #1a252f, #2c3e50);
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.navbar-brand i {
    font-size: 22px;
    color: #3498db;
}

.navbar-brand span {
    color: white;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 5px;
}

.navbar-menu a {
    color: #bdc3c7;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.navbar-menu a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.navbar-menu a.active {
    background: #3498db;
    color: white;
}

.navbar-logout {
    color: #e74c3c !important;
    border: 1px solid rgba(231,76,60,0.3) !important;
}

.navbar-logout:hover {
    background: #e74c3c !important;
    color: white !important;
}

/* Burger button - disembunyikan di desktop */
.navbar-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
}

.navbar-burger:hover {
    background: rgba(255,255,255,0.1);
}

.navbar-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #bdc3c7;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Animasi X saat burger aktif */
.navbar-burger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.navbar-burger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.navbar-burger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .navbar {
        position: sticky;
        top: 0;
        flex-direction: row;
        height: 56px;
        padding: 0 16px;
    }

    /* Tampilkan burger di mobile */
    .navbar-burger {
        display: flex;
    }

    /* Menu tersembunyi secara default di mobile */
    .navbar-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 56px;
        right: 0;
        width: 220px;
        background: linear-gradient(180deg, #1a252f, #2c3e50);
        box-shadow: 0 8px 20px rgba(0,0,0,0.3);
        border-radius: 0 0 0 12px;
        padding: 8px 0;
        z-index: 998;
    }

    /* Menu muncul saat .open */
    .navbar-menu.open {
        display: flex;
    }

    .navbar-menu a {
        padding: 12px 20px;
        border-radius: 0;
        font-size: 14px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .navbar-menu a:last-child {
        border-bottom: none;
    }

    .navbar-logout {
        border: none !important;
        border-top: 1px solid rgba(231,76,60,0.2) !important;
        margin-top: 4px;
    }
}

/* =====================
   LOGIN
===================== */
.login-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 40px 35px;
    border-radius: 16px;
    width: 320px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.login-card h2 {
    color: white;
    text-align: center;
    margin-bottom: 8px;
    font-size: 22px;
}

.login-subtitle {
    color: rgba(255,255,255,0.6);
    text-align: center;
    font-size: 13px;
    margin-bottom: 28px;
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo i {
    font-size: 48px;
    color: white;
    opacity: 0.9;
}

.input-group {
    position: relative;
    margin-bottom: 16px;
}

.input-group i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.5);
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: 0.2s;
}

.input-group input::placeholder {
    color: rgba(255,255,255,0.4);
}

.input-group input:focus {
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.15);
}

.login-btn {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    letter-spacing: 0.5px;
}

.login-btn:hover {
    background: linear-gradient(135deg, #5f4dd0, #9088f0);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(108,92,231,0.4);
}

/* =====================
   CONTAINER
===================== */
.container {
    width: 85%;
    margin: auto;
    margin-top: 40px;
}

@media (max-width: 600px) {
    .container { width: 95%; }
}

/* =====================
   DASHBOARD MENU
===================== */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 992px) {
    .menu-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .menu-grid { grid-template-columns: 1fr; }
}

.menu-card {
    display: block;
    padding: 25px;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    transition: 0.3s;
    color: white;
    text-decoration: none;
}

.menu-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 12px 25px rgba(0,0,0,0.2);
}

.menu-card i {
    font-size: 30px;
    margin-bottom: 10px;
}

.menu-card span {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

.menu-card:nth-child(1) { background: #3498db; }
.menu-card:nth-child(2) { background: #2ecc71; }
.menu-card:nth-child(3) { background: #e67e22; }

/* =====================
   FORM
===================== */
.form-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    width: 400px;
    margin: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

.btn {
    background: #3498db;
    color: white;
    padding: 10px;
    border: none;
    width: 100%;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn:hover { background: #2980b9; }

/* =====================
   TABEL
===================== */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

thead {
    background: linear-gradient(90deg, #2c3e50, #34495e);
    color: white;
}

thead th {
    padding: 15px;
    text-align: left;
    font-size: 14px;
    letter-spacing: 0.5px;
}

tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

tbody tr:hover { background: #f4f6f9; }

tbody td {
    padding: 13px 15px;
    font-size: 14px;
    color: #333;
}

@media (max-width: 600px) {
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    tbody td {
        display: flex;
        justify-content: space-between;
        padding: 10px 15px;
        border-bottom: 1px solid #eee;
    }
    tbody td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #555;
    }
    tbody tr {
        margin-bottom: 15px;
        border-radius: 10px;
        box-shadow: 0 3px 10px rgba(0,0,0,0.08);
        background: white;
    }
}

/* =====================
   BADGE
===================== */
.badge-id {
    background: #eaf4ff;
    color: #3498db;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 13px;
}

.badge-mapel {
    background: #eafaf1;
    color: #2ecc71;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
}

.badge-hari {
    background: #fef9e7;
    color: #e67e22;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
}

.badge-jam {
    background: #f4f6f9;
    color: #2c3e50;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
}

.badge-jam i { margin-right: 4px; }

/* =====================
   TOMBOL AKSI
===================== */
.btn-edit {
    background: #f39c12;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    margin-right: 5px;
}

.btn-edit:hover { background: #e67e22; }

.btn-hapus {
    background: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e74c3c;
}

.btn-hapus:hover {
    background: #e74c3c;
    color: white;
}

.btn-tambah {
    background: #3498db;
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
}

.btn-tambah:hover { background: #2980b9; }

/* =====================
   MISC
===================== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.alert-success {
    background: #2ecc71;
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #aaa;
}

.empty-state i {
    font-size: 50px;
    margin-bottom: 15px;
    display: block;
}

h2 { margin-bottom: 10px; }
h3 { margin-top: 30px; margin-bottom: 15px; }
/* =====================
   PERBAIKAN MOBILE
   (viewport meta sudah
   ditambahkan ke semua PHP)
===================== */

/* Form card: fixed width 400px tidak muat di HP */
@media (max-width: 600px) {
    .form-card {
        width: 100%;
        box-sizing: border-box;
        padding: 20px 16px;
        border-radius: 10px;
    }

    /* Judul halaman lebih kecil */
    h2 {
        font-size: 18px;
    }

    /* Top bar: tumpuk vertikal kalau sempit */
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Tombol aksi lebih besar, mudah diklik */
    .btn-edit,
    .btn-hapus {
        padding: 8px 14px;
        font-size: 13px;
    }

    .btn-tambah {
        width: 100%;
        text-align: center;
        padding: 12px;
        font-size: 15px;
    }

    /* Login card: biar tidak kepotong pinggir */
    .login-card {
        width: 90%;
        padding: 30px 20px;
        box-sizing: border-box;
    }

    /* Input field lebih besar, nyaman diketik */
    .form-group input,
    .form-group select,
    .input-group input {
        font-size: 16px; /* Cegah zoom otomatis di iOS */
        padding: 12px 12px 12px 40px;
    }

    .form-group input,
    .form-group select {
        padding: 12px;
    }

    /* Tombol submit lebih tinggi */
    .btn {
        padding: 13px;
        font-size: 15px;
    }

    /* Alert */
    .alert-success {
        font-size: 14px;
        padding: 10px 14px;
    }

    /* Margin atas container */
    .container {
        margin-top: 20px;
        margin-bottom: 30px;
    }

    /* Badge agar tidak overflow */
    .badge-id, .badge-mapel, .badge-hari, .badge-jam {
        font-size: 12px;
        padding: 3px 8px;
    }
}
