/* === FONT === */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

/* === PENGATURAN DASAR & TEMA (MOBILE-FIRST) === */
body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: #121212;
    color: #FFFFFF; /* Teks default sekarang putih */
}
.container {
    padding: 1em;
}
.container h1, .container h2, .container h3 {
    color: #FFFFFF; 
    border-bottom: 2px solid #1b4322;
    padding-bottom: 10px;
    margin-bottom: 1em;
}

/* === HEADER & NAVIGASI BURGER === */
.header {
    background-color: #1f1f1f;
    padding: 1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #1b4322;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header h1 {
    margin: 0;
    color: #FFFFFF; /* DIUBAH MENJADI PUTIH */
    font-size: 1.5em;
    border-bottom: none;
}
#burger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 20;
}
#burger-menu span {
    width: 2rem;
    height: 0.25rem;
    background: #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}
#burger-menu.active span:nth-child(1) { transform: rotate(45deg); }
#burger-menu.active span:nth-child(2) { opacity: 0; transform: translateX(20px); }
#burger-menu.active span:nth-child(3) { transform: rotate(-45deg); }
.nav-container .nav {
    display: none;
}
.nav-container .nav.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 75px; /* Sesuaikan jika perlu */
    left: 0;
    background-color: #1f1f1f;
    width: 100%;
    padding: 1em 0;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 10;
}
.nav a {
    padding: 15px 20px;
    color: #e0e0e0;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
}
.nav a:hover, .nav a.active {
    background-color: #1b4322;
    color: #FFFFFF;
}

/* === FORMULIR & INPUT (PERBAIKAN KESEJAJARAN) === */
.form-container, .filter-form {
    background-color: #1f1f1f;
    border-radius: 8px;
    padding: 1.5em;
    margin-bottom: 1.5em;
}
.form-container form, .filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* Jarak antar elemen */
    align-items: flex-end; /* Membuat tombol sejajar dengan bagian bawah input */
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px; /* Jarak antara label dan input */
    flex-grow: 0; /* Jangan biarkan form-group tumbuh terlalu besar */
}
input[type="date"], input[type="text"], input[type="time"], select {
    background-color: #333;
    color: #e0e0e0;
    border: 1px solid #555;
    padding: 10px;
    border-radius: 5px;
    box-sizing: border-box;
    height: 42px;
}
.btn, input[type="submit"] {
    padding: 10px 20px;
    background-color: #1b4322;
    color: #FFFFFF;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    height: 42px;
    transition: background-color 0.3s;
}
.btn:hover, input[type="submit"]:hover {
    background-color: #2a6a3b;
}

/* === TABEL RESPONSIVE === */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}
table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 1em;
}
th, td {
    padding: 12px;
    border: 1px solid #333;
    text-align: left;
}
th {
    background-color: #1b4322;
    color: #FFFFFF;
}

/* === DASBOR & KELOLA JADWAL (PERBAIKAN TATA LETAK) === */
.status-grid, .recap-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default satu kolom untuk mobile */
    gap: 20px; /* Ini yang memberi jarak */
}

.schedule-container {
    display: grid;
    grid-template-columns: 1fr; /* Default satu kolom untuk mobile */
    gap: 20px; /* Jarak antar kartu hari */
}

.day-column {
    background-color: #1f1f1f;   /* Beri setiap kolom latar belakangnya sendiri */
    border-radius: 8px;           /* Sudut yang membulat */
    padding: 1.5em;               /* Jarak di dalam kartu */
    border-left: 5px solid #40c4ff; /* Aksen warna biru */
}
.day-column h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #40c4ff; /* Samakan warna aksen */
}

.recap-box, .status-column, .day-column {
    background-color: #1f1f1f;
    border-radius: 8px;
    padding: 1.5em;
}

.status-column h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid;
}
.status-header.present { border-color: #28a745; }
.status-header.absent { border-color: #ff5252; }

/* === MODAL, SELECT2, DLL. === */
.delete-link { color: #ff5252; text-decoration: none; font-weight: bold;}
.action-btn { padding: 5px 10px; color: #121212; text-decoration: none; border-radius: 3px; cursor: pointer; border: none; font-size: 14px;}
.rfid-btn { background-color: #40c4ff; }
.finger-btn { background-color: #ffd740; }
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.7); }
.modal-content { background-color: #1f1f1f; margin: 40% auto; padding: 20px; border: 1px solid #333; width: 90%; max-width: 500px; border-radius: 8px; }
.spinner { border: 4px solid #555; border-radius: 50%; border-top: 4px solid #1b4322; width: 40px; height: 40px; animation: spin 2s linear infinite; margin: 20px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.select2-container--default .select2-selection--single { background-color: #333 !important; border: 1px solid #555 !important; border-radius: 5px !important; height: 42px !important; }
.select2-container--default .select2-selection--single .select2-selection__rendered { color: #e0e0e0 !important; line-height: 40px !important; padding-left: 10px !important; }
.select2-container--default .select2-selection--single .select2-selection__arrow b { border-color: #e0e0e0 transparent transparent transparent !important; margin-top: 4px !important; }
.select2-dropdown { background-color: #333 !important; border: 1px solid #555 !important; }
.select2-container--default .select2-search--dropdown .select2-search__field { background-color: #444 !important; color: #e0e0e0 !important; border: 1px solid #555 !important; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background-color: #1b4322 !important; color: white !important; }
.select2-results__option { color: #e0e0e0 !important; }

/* === GAYA HALAMAN LOGIN (PERBAIKAN RESPONSIVE) === */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 1em;
    box-sizing: border-box;
}
.login-container {
    width: 100%;
    max-width: 400px;
}
.login-container .form-group input {
    width: 100%; /* Membuat input mengisi kontainer */
    box-sizing: border-box;
}
.login-container input[type="submit"] {
    width: 100%; /* Tombol login mengisi lebar penuh */
}


/* === ATURAN UNTUK LAYAR YANG LEBIH BESAR (DESKTOP) === */
@media (min-width: 992px) {
    .container { padding: 2em; }
    .header { padding: 1em 2em; }
    #burger-menu { display: none; }
    .nav-container .nav {
        display: flex !important;
        flex-direction: row;
        position: static;
        width: auto;
        padding: 0;
        box-shadow: none;
    }
    .nav a { margin-left: 10px; }
    
    .filter-form form, .form-container form { flex-direction: row; align-items: flex-end; }
    
    .status-grid {
        grid-template-columns: 1fr 1fr; 
    }
    
    .schedule-container {
        grid-template-columns: repeat(5, 1fr);
    }

    .recap-grid { grid-template-columns: repeat(3, 1fr); }
}