:root {
    --primary-green: #0f5132;
    --accent-green: #198754;
    --light-green: #d1e7dd;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}



/* Custom Utilities */
.text-primary-green { 
    color: var(--primary-green) !important;
}
.bg-primary-green { 
    background-color: var(--primary-green) !important; 
}
.btn-primary-green { 
    background-color: var(--primary-green) !important; 
    color: white; 
    transition: 0.3s ease; 
}
.btn-primary-green:hover { 
    background-color: var(--accent-green) !important;
    color: white; 
}

/* ============================================== */
/* GAYA BARU: WELCOME PAGE & LOGIN MODERN         */
/* ============================================== */

/* Wrapper Utama dengan Background Sekolah */
.welcome-wrapper {
    position: relative;
    min-height: 100vh;
    background: url('../assets/img/latarsekolah.jpeg') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Overlay Putih-Kehijauan Transparan */
.welcome-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(242, 250, 247, 0.95) 0%, rgba(231, 247, 239, 0.90) 100%);
    z-index: 1;
}

.welcome-container, .login-form-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    min-height: 90vh;
}

/* Header Branding */
.welcome-header {
    display: flex;
    align-items: center;
    gap: 15px;
}
.welcome-logo {
    width: 50px;
    height: auto;
}
.brand-title {
    font-size: 20px;
    font-weight: 800;
    color: #075E50;
    margin: 0;
}
.brand-subtitle {
    font-size: 12px;
    color: #6B8179;
    margin: 0;
    font-weight: 600;
}

/* Hero Section */
.welcome-hero {
    margin: 60px 0 40px;
}
.hero-title {
    font-size: 40px;
    font-weight: 800;
    color: #075E50;
    margin-bottom: 15px;
    line-height: 1.25;
}
.hero-subtitle {
    font-size: 16px;
    color: #006B50;
    font-weight: 500;
    margin-bottom: 25px;
}
.hero-instruction {
    font-size: 13px;
    color: #075E50;
    font-weight: 700;
    border: 1px solid #DCE9E3;
}

/* Kartu Role (Desktop & Mobile) */
.role-cards-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}
.role-card {
    background: #FFFFFF;
    border: 2px solid #E7F7EF;
    border-radius: 18px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 143, 90, 0.04);
}
.role-card:hover, .role-card:focus {
    transform: translateY(-6px);
    border-color: #008F5A;
    box-shadow: 0 15px 25px rgba(0, 143, 90, 0.1);
    outline: none;
}
.role-icon-wrapper {
    width: 50px;
    height: 50px;
    background: #E7F7EF;
    color: #008F5A;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 20px;
    transition: all 0.25s ease;
}
.role-card:hover .role-icon-wrapper {
    background: #008F5A;
    color: #FFFFFF;
}
.role-text h3 {
    font-size: 17px;
    font-weight: 700;
    color: #17352E;
    margin-bottom: 6px;
}
.role-text p {
    font-size: 13px;
    color: #6B8179;
    margin: 0;
    line-height: 1.4;
}
.role-arrow {
    margin-top: 15px;
    align-self: flex-end;
    color: #A3C4B6;
    font-size: 14px;
    transition: color 0.2s ease;
}
.role-card:hover .role-arrow {
    color: #008F5A;
}

/* Form Login View */
.btn-back {
    background: none;
    border: none;
    color: #075E50;
    font-weight: 600;
    font-size: 14px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}
.btn-back:hover {
    color: #006B50;
}
.login-card-modern {
    width: 100%;
    max-width: 440px;
    border: 1px solid #DCE9E3 !important;
}
.selected-role-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px;
    background: #F2FAF7;
    border-radius: 14px;
    border: 1px solid #DCE9E3;
}
.selected-role-icon {
    width: 45px;
    height: 45px;
    background: #E7F7EF;
    color: #008F5A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Custom Input Styles */
.input-group-modern .form-label {
    color: #17352E;
    font-size: 13px;
    margin-bottom: 8px;
}
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-wrapper .input-icon {
    position: absolute;
    left: 16px;
    color: #6B8179;
    font-size: 14px;
}
.input-wrapper .form-control {
    padding-left: 44px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid #DCE9E3;
    font-size: 14px;
    color: #17352E;
}
.input-wrapper .form-control:focus {
    border-color: #008F5A;
    box-shadow: 0 0 0 3px rgba(0, 143, 90, 0.15);
}
.btn-toggle-pass {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: #6B8179;
    cursor: pointer;
    padding: 5px;
}
.btn-login-modern {
    background: #008F5A;
    color: white;
    height: 50px;
    border-radius: 12px;
    font-size: 15px;
    transition: background 0.2s;
}
.btn-login-modern:hover {
    background: #006B50;
    color: white;
}

/* Footer */
.welcome-footer {
    text-align: center;
    font-size: 12px;
    color: #6B8179;
    font-weight: 600;
    padding: 20px 0;
}

/* Animasi */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOutDown {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(15px); }
}

/* Responsivitas Layar Kecil (Mobile) */
@media (max-width: 991px) {
    .role-cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .hero-title {
        font-size: 28px;
    }
    .hero-subtitle {
        font-size: 14px;
    }
    /* Mengubah Card Role menjadi Horizontal-List pada layar HP */
    .role-cards-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .role-card {
        flex-direction: row;
        align-items: center;
        padding: 16px 20px;
        border-radius: 16px;
    }
    .role-icon-wrapper {
        margin-bottom: 0;
        margin-right: 16px;
        width: 45px;
        height: 45px;
        flex-shrink: 0;
    }
    .role-text h3 {
        font-size: 15px;
        margin-bottom: 2px;
    }
    .role-text p {
        font-size: 12px;
    }
    .role-arrow {
        margin-top: 0;
        margin-left: auto; /* Mendorong panah ke paling kanan */
    }
}

/* Custom Login Card Width */
.login-card {
    width: 100%;
    max-width: 450px;
    border-radius: 1.2rem !important;
}

/* Input Focus Glow Customization */
.form-control:focus, .form-select:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}

/* Fix for single page app hidden class */
.d-none { 
    display: none !important;
}

/* Custom Sidebar Admin */
.custom-sidebar .nav-link {
    color: #475569;
    transition: all 0.3s ease;
}
.custom-sidebar .nav-link:hover {
    background-color: var(--light-green);
    color: var(--primary-green);
}
.custom-sidebar .nav-link.active {
    background-color: var(--primary-green) !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(15, 81, 50, 0.2);
}
.border-dashed {
    border-style: dashed !important;
    border-width: 2px !important;
}

/* ========================================================== */
/* PENGATURAN MODE GELAP ELEGANT (GLASSMORPHISM & SOFT)       */
/* ========================================================== */
body.dark-mode {
    --bg-body: #07090e;       /* Hitam kebiruan yang sangat dalam & lembut */
    --bg-card: rgba(22, 30, 49, 0.75); /* Semi-transparan untuk efek kaca */
    --text-main: #e2e8f0;     /* Putih soft / keperakan (tidak silau) */
    --text-muted: #94a3b8;    /* Abu-abu lembut */
    --border-color: rgba(255, 255, 255, 0.08); /* Garis tepi sangat tipis */
    --table-head: #1e293b;
    --input-bg: rgba(17, 24, 39, 0.8);
    --input-text: #ffffff;
}

/* Terapkan warna dasar body */
body.dark-mode {
    background-color: var(--bg-body) !important;
    color: var(--text-main) !important;
}

/* Header Aplikasi (Gradasi lembut senada) */
body.dark-mode .app-header {
    background: linear-gradient(135deg, #131c31 0%, #07090e 100%) !important;
    border-bottom: 1px solid var(--border-color);
}

/* Efek Transparansi Elegan (Glassmorphism) pada Card & Modal */
body.dark-mode .card,
body.dark-mode .modal-content,
body.dark-mode #bottomNavBar,
body.dark-mode .bg-white { /* Ini mengunci agar elemen yang tadinya bg-white ikut transparan */
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    backdrop-filter: blur(12px); /* Efek kaca buram */
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

/* Penyesuaian khusus untuk Smart Alert agar teks dan ikonnya kontras tapi lembut */
body.dark-mode #smartAlert {
    background-color: rgba(22, 30, 49, 0.85) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important; /* Sentuhan garis merah tipis elegan */
}

body.dark-mode #smartAlert h6 {
    color: #f87171 !important; /* Warna merah soft */
}

body.dark-mode #smartAlert small {
    color: var(--text-muted) !important;
}

/* Warna Teks Judul */
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, 
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6,
body.dark-mode .text-dark {
    color: #f1f5f9 !important;
}

body.dark-mode .text-muted {
    color: var(--text-muted) !important;
}

/* Tabel dan Form Input */
body.dark-mode .table {
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .table-light,
body.dark-mode thead.table-light th {
    background-color: rgba(30, 41, 59, 0.9) !important;
    color: #ffffff !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .form-control, 
body.dark-mode .form-select {
    background-color: var(--input-bg) !important;
    color: var(--input-text) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .form-control::placeholder {
    color: #64748b !important;
}

body.dark-mode .bg-light {
    background-color: rgba(30, 41, 59, 0.6) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}




/* Mengecilkan font dasar aplikasi */
body, .card-body {
    font-size: 0.85rem; 
}

/* Merapikan tabel untuk mode mobile */
.table {
    font-size: 0.85rem;
}

.table th {
    font-size: 0.8rem;
    white-space: nowrap; /* Mencegah teks judul tabel turun ke baris baru */
    vertical-align: middle;
}

.table td {
    vertical-align: middle;
}

/* Mengecilkan label/badge (Guru, Wali Kelas, dll) */
.badge {
    font-size: 0.7rem;
    padding: 0.4em 0.6em;
    font-weight: 500;
}

/* Mengecilkan tombol aksi (Edit, Hapus, Tambah Data) */
.btn {
    font-size: 0.8rem;
}

.btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Menyesuaikan judul halaman */
h4, h5, .modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* ========================================================
   SIDEBAR KHUSUS DESKTOP (TAMPILAN LAPTOP)
   ======================================================== */
.desktop-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 260px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e0e0e0;
    z-index: 1050;
    overflow-y: auto;
    padding-bottom: 20px;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    margin: 4px 15px;
    border-radius: 8px;
    color: #495057;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.95rem;
}
.sidebar-menu-item:hover { background: #f8f9fa; color: #198754; }
.sidebar-menu-item.active { background: #e6f4ea; color: #198754; font-weight: 700; }
.sidebar-menu-item i { width: 35px; font-size: 1.1rem; text-align: center; }

@media (min-width: 992px) {
    /* 1. Sembunyikan Navigasi Bawah HP (#bottomNavBar) di Laptop */
    #bottomNavBar { display: none !important; }
    
    /* 2. SEMBUNYIKAN MENU GELEMBUNG DI TENGAH LAYAR */
    .menu-icon-box { display: none !important; }
    
    /* 3. Geser area utama (Dashboard) ke kanan agar tidak tertutup sidebar */
    body { padding-left: 260px !important; }

    /* ========================================================== */
    /* FIX: TARIK HALAMAN LOGIN KE TENGAH MENGAKALI PADDING BODY  */
    /* ========================================================== */
    .welcome-wrapper {
        margin-left: -260px;
        width: calc(100% + 260px);
    }
}

@media (max-width: 991px) {
    /* Sembunyikan Sidebar Desktop ini jika dibuka di HP */
    .desktop-sidebar { display: none !important; }
}

#uiPoinTabelData tr { border-bottom: 1px solid #f3f4f6; transition: background-color 0.2s; }
    #uiPoinTabelData tr:hover { background-color: #fafdfb; }
    #uiPoinTabelData tr:last-child { border-bottom: none; }
    .badge-soft-danger { background-color: #fee2e2; color: #dc2626; padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: 0.85rem; }


    #navPaginasiGuru .page-link { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: #495057; background-color: #fff; border: 1px solid #dee2e6; border-radius: 8px !important; transition: all 0.2s; }
    #navPaginasiGuru .page-link:hover { background-color: #e9ecef; }
    #navPaginasiGuru .page-item.active .page-link { background-color: #0d6efd; color: #fff; border-color: #0d6efd; box-shadow: 0 2px 6px rgba(13,110,253,0.3); }
    #navPaginasiGuru .page-item.disabled .page-link { color: #adb5bd; background-color: #f8f9fa; border-color: #dee2e6; cursor: not-allowed; }