/* style.css */

/* 1. RESET DAN BASE STYLE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* KRUSIAL: Memastikan padding tidak menambah lebar elemen */
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
}

a {
    text-decoration: none;
    color: #0077b6;
}

h1,
h2,
h3 {
    color: #023e8a;
    margin-bottom: 15px;
}

/* 2. LAYOUT UTAMA & KONTEN */
#main-header {
    background-color: #023e8a;
    color: white;
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#main-header a {
    color: white;
}

/* ====================================================== */
/* --- PERBAIKAN FINAL: UPDATE PADA CONTAINER --- */
/* ====================================================== */
.container, 
.header-container, 
.dashboard-container, 
.manage-table-container {
    width: 100%; 
    max-width: 1300px; 
    margin: 0 auto !important; /* 🛡️ KUNCI RATA TENGAH: Memaksa selalu di tengah */
    padding-left: 20px !important;
    padding-right: 20px !important;
    padding-top: 15px;
    padding-bottom: 15px;
    box-sizing: border-box !important; 
    overflow-x: hidden; 
}

/* --- TAMBAHAN BARU: LAYOUT TABEL RESPONSIVE --- */
table {
    width: 100% !important; /* PAKSA tabel mengisi penuh container */
    border-collapse: collapse;
    table-layout: auto;
}

.table-responsive {
    width: 100% !important;
    overflow-x: auto;
    display: block;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-top: 15px;
}
/* ---------------------------------------------- */

/* 3. TOMBOL DAN FORM RESPONSIVE */
input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.btn,
button {
    padding: 10px 15px;
    background-color: #0077b6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.btn-logout {
    background-color: #d62828 !important;
}

/* 4. NOTIFIKASI STATUS */
#status-notification {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    color: white;
    font-weight: bold;
    border-radius: 0 0 8px 8px;
    z-index: 9999;
}

.notification.success {
    background-color: #5cb85c;
}

.notification.error {
    background-color: #d62828;
}

.notification.warning {
    background-color: #f0ad4e;
}


/* ====================================================== */
/* == STICKY FOOTER LOGIC (PERBAIKAN FINAL) == */
/* ====================================================== */

/* 1. Pastikan HTML dan Body memanjang penuh */
html, body {
    height: 100%;
    width: 100%; 
    margin: 0;
    padding: 0;
    overflow-x: hidden; 
}

/* 2. Jadikan Body sebagai Flex Container */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Minimal setinggi layar viewport */
    align-items: stretch !important; /* Paksa isi merentang penuh */
}

/* 3. Paksa tag <main> untuk mengisi ruang kosong */
/* Ini kuncinya: tag ini akan mendorong footer ke bawah */
main {
    flex: 1 0 auto; 
    width: 100%;
    min-width: 0; /* 🛡️ OBAT MUJARAB FLEXBOX: Mencegah elemen meledak/menciut saat layar di-zoom */
    display: block;
    box-sizing: border-box;
}

/* 4. Pastikan Footer tidak menyusut */
footer {
    flex-shrink: 0 !important;
    width: 100% !important;
    background-color: #f8f9fa; /* Opsional: warna background footer */
}

/* ====================================================== */


/* 5. MEDIA QUERIES GLOBAL (RESPONSIVITAS) */
@media screen and (max-width: 768px) {
    .container {
        width: 98% !important;
        padding: 10px;
    }

    /* Mengubah navigasi menjadi vertikal di mobile */
    #main-header .container {
        flex-direction: column;
        text-align: center;
    }

    .main-nav {
        margin-top: 10px;
    }

    .main-nav a {
        display: block;
        margin: 5px 0;
    }
}

/* ====================================================== */
/* ANTI ZOOM OTOMATIS & RATA TENGAH MUTLAK */
/* ====================================================== */

/* 1. Kunci ukuran font form minimal 16px (MENCEGAH AUTO-ZOOM SAAT INPUT DIKLIK) */
input, select, textarea, button, input[type="text"], input[type="password"] {
    font-size: 16px !important; 
    touch-action: manipulation !important; /* Mencegah double-tap zoom */
}

/* 2. Memastikan elemen struktural utama membentang penuh 100% tanpa menyusut */
#main-header, .role-nav {
    width: 100% !important;
    flex-shrink: 0 !important;
}

/* 3. Memaksa SEMUA variasi kotak/container dari berbagai role untuk parkir mutlak di TENGAH */
.container, 
.header-container, 
.dashboard-container, 
.manage-table-container {
    margin-left: auto !important;
    margin-right: auto !important;
}   

/* ====================================================== */
/* == KHUSUS HALAMAN LOGIN (CLEAN, SYMMETRICAL & SCROLL) == */
/* ====================================================== */

body.login-page {
    background-color: #0077b6 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-y: auto !important;
}

body.login-page main {
    flex: 1 0 auto !important;
    display: flex !important;
    width: 100% !important;
    padding: 40px 20px !important;
    box-sizing: border-box !important;
}

/* 1. Main Wrapper (Kartu Login) */
body.login-page .main-wrapper {
    display: flex;
    max-width: 1000px;
    width: 100%; 
    margin: auto !important;
    min-height: 580px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    background-color: #fff;
    flex-shrink: 0;
}

/* 2. Welcome Pane (Kiri) - DIPERLEBAR AGAR TEKS MUAT */
.welcome-pane { 
    flex: 1.5; /* Ubah dari 1.2 ke 1.5 agar lebih luas ke samping */
    background: linear-gradient(135deg, #023e8a 0%, #0077b6 100%); 
    padding: 40px; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
}

/* 🛡️ PERBAIKAN: WELCOME BACK SEJAJAR HORIZONTAL (SATU BARIS) */
.welcome-pane h1 { 
    font-size: 2.5em; /* Sedikit dikecilkan dari 2.8em agar lebih pas */
    font-weight: 800; 
    margin-bottom: 10px; 
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    white-space: nowrap !important; /* 🛡️ JURUS KUNCI: Memaksa teks tidak patah ke bawah */
    letter-spacing: -1px; /* Merapatkan sedikit antar huruf agar elegan */
}

/* 3. Login Pane (Kanan) - DISESUAIKAN FLEX-NYA */
.login-pane { 
    flex: 2; /* Sesuaikan perbandingan agar tetap simetris */
    background: white; 
    padding: 50px 60px; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
}

.login-pane .logo { align-self: center; margin-bottom: 20px; }

/* 🛡️ PERBAIKAN 2 & 3: JUDUL & AKADEMI POSISI CENTER */
.login-pane h2 { 
    color: #023e8a; 
    font-size: 1.8em; 
    margin-bottom: 5px; 
    text-align: center !important; 
    width: 100%; 
}

.akademi-name { 
    color: #777; 
    font-size: 0.95em; 
    margin-bottom: 30px; 
    text-align: center !important; 
    width: 100%; 
    display: block;
}

/* 4. Form & Input - TETAP RAPI KIRI UNTUK FIELD */
.login-pane form { 
    width: 100%; 
    max-width: 450px; /* Batasi lebar form agar tidak terlalu melebar */
    text-align: left;  /* Konten di dalam form tetap rata kiri agar profesional */
}

.form-group { 
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
    font-size: 0.9em;
    text-align: left;
}

.login-page input {
    width: 100% !important; 
    padding: 14px 16px !important; 
    border: 1px solid #ddd !important;
    border-radius: 8px !important; 
    font-size: 16px !important;
    background: #fdfdfd !important;
    box-sizing: border-box !important;
}

/* 5. Password Wrapper - IKON DI DALAM */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    padding-right: 45px !important; 
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #888;
    z-index: 10;
    font-size: 1.2em;
}

/* 6. Button - SEJAJAR */
.btn-login {
    width: 100% !important; 
    padding: 15px !important;
    background-color: #0077b6 !important;
    color: white !important;
    font-size: 1.1em !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    margin-top: 10px !important;
}

/* 7. Akun Demo Box - DIPERCANTIK */
.demo-credentials-box { 
    margin-top: 40px; 
    padding: 20px; 
    background-color: #f0f7ff; 
    border: 1px solid #c2e0ff; 
    border-radius: 12px; 
    width: 100%;
    max-width: 450px;
}

.demo-title { 
    margin-bottom: 15px; 
    font-size: 0.9em; 
    font-weight: 700; 
    color: #023e8a; 
    text-align: center; /* Center juga judul demonya */
}

.demo-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); 
    gap: 12px; 
}

.demo-item { 
    background: white; 
    padding: 10px; 
    border: 1px solid #ddecff; 
    border-radius: 8px; 
    font-size: 0.75em; 
}

.demo-item strong { color: #d62828; display: block; margin-bottom: 4px; border-bottom: 1px solid #f0f0f0; padding-bottom: 2px; }

/* Responsive Mobile */
@media screen and (max-width: 850px) {
    .main-wrapper { flex-direction: column; min-height: auto; border-radius: 0; }
    .welcome-pane { display: none; }
    .login-pane { padding: 40px 30px; }
}