/* style.css (Versi Final: Layout Dashboard Sejajar 4 & Rekapitulasi Rapi) */

/* ========================================= */
/* 1. GAYA DASAR & LAYOUT UTAMA              */
/* ========================================= */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

/* Kontainer Utama Aplikasi */
.container {
    max-width: 95%;
    margin: 20px auto;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    padding: 0;
}

/* === Banner === */
.app-banner {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    background-color: #eee;
}

/* === Navigasi Tab === */
.tabs {
    display: flex;
    background-color: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.tab-link {
    padding: 14px 22px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 16px;
    color: #495057;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    text-decoration: none;
}

.tab-link:hover {
    background-color: #f8f9fa;
    color: #0056b3;
}

.tab-link.active {
    background-color: #ffffff;
    color: #007bff;
    border-bottom: 3px solid #007bff;
    font-weight: 600;
}

/* === Konten Tab === */
.tab-content {
    display: none; /* Sembunyi default */
    padding: 30px; /* Padding konten */
}

.tab-content.active {
    display: flex; 
    flex-direction: column; 
}

/* Layout Khusus Tab Banner & Stok (Agar tidak flex column/terpotong) */
#tabGantiBanner.active,
#tabStok.active {
    display: block;
    height: auto;
    overflow-y: auto;
}

/* === Layout dalam Tab (Form & Tabel) === */
.content-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.form-container {
    flex: 1;
    min-width: 380px;
}

/* Kontainer Tabel (tanpa scroll) */
.table-container {
    flex: 2;
    min-width: 450px;
    display: flex;
    flex-direction: column;
    height: 100%; 
}

/* Pembungkus tabel (DENGAN scroll) */
.table-scroll-wrapper {
    max-height: 70vh; 
    overflow-y: auto;
    overflow-x: auto; 
    border: 1px solid #e9ecef;
    border-top: none;
    min-height: 400px; 
}

h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #343a40;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* ========================================= */
/* 2. ELEMEN FORM                            */
/* ========================================= */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

/* Style untuk input teks (TANPA PANAH) */
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="password"],
.form-group input.flatpickr-input {
    width: 100%; 
    padding: 12px 15px; 
    border: 1px solid #ced4da; 
    border-radius: 4px;
    font-size: 15px; 
    box-sizing: border-box; 
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
    -webkit-appearance: none; 
    -moz-appearance: none;
    appearance: none;
    background-image: none;
}

/* Style untuk <select> (DENGAN PANAH) */
.form-group .input-selection {
    width: 100%; 
    padding: 12px 15px; 
    border: 1px solid #ced4da; 
    border-radius: 4px;
    font-size: 15px; 
    box-sizing: border-box; 
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff; 
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 1em 1em;
}

/* Style :focus untuk SEMUA input dan select */
.form-group input:focus,
.form-group input.flatpickr-input:focus,
.form-group input[type="password"]:focus,
.form-group .input-selection:focus {
    border-color: #80bdff; 
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); 
}

/* Khusus untuk input date biasa (tanpa flatpickr) */
.form-group input[type="date"] {
    background-image: none; 
    -webkit-appearance: auto; 
    -moz-appearance: auto;
    appearance: auto;
}

input[readonly] {
    background-color: #e9ecef; 
    cursor: not-allowed; 
    color: #6c757d; 
}

/* Input dengan Tombol (Cari Kode) */
.input-button-wrapper {
    display: flex; 
    width: 100%;
}
.input-button-wrapper input[type="text"] {
    flex-grow: 1; 
    border-top-right-radius: 0; 
    border-bottom-right-radius: 0;
    width: auto; 
}
.btn-cari {
    padding: 12px 18px;
    font-size: 14px;
    border: 1px solid #007bff;
    border-left: none;
    border-top-left-radius: 0; 
    border-bottom-left-radius: 0;
    flex-shrink: 0; 
    height: auto;
    box-sizing: border-box;
    background-color: #007bff; 
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}
.btn-cari:hover {
    background-color: #0056b3; 
}
.btn-cari:disabled {
    background-color: #6c757d; 
    border-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.65;
}

/* === Kontainer Tombol Form (Simpan, Batal, dll) === */
.form-button-container {
    margin-top: 30px;
    display: flex;
    justify-content: space-between; 
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    gap: 10px; 
}
.form-buttons-right {
    display: flex;
    justify-content: flex-end; 
    gap: 10px; 
}
.form-button-container button {
    padding: 10px 18px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.3s, box-shadow 0.3s;
}

/* Tombol Barang Baru */
.btn-new-item { background-color: #17a2b8; color: white; }
.btn-new-item:hover { background-color: #138496; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

/* Tombol Batal Input */
.btn-batal-input { background-color: #ffc107; color: #212529; }
.btn-batal-input:hover { background-color: #e0a800; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

/* Tombol Batal Edit */
.btn-batal-edit { background-color: #6c757d; color: white; display: none; }
.btn-batal-edit:hover { background-color: #5a6268; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

/* Tombol Submit/Update */
#submitMasuk, #submitKeluar, #btnSimpanPegawai { background-color: #007bff; color: white; }
#submitMasuk:hover, #submitKeluar:hover, #btnSimpanPegawai:hover { background-color: #0056b3; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

/* Tombol Cancel */
.btn-cancel { background-color: #6c757d; color: white; }
.btn-cancel:hover { background-color: #5a6268; }

/* ========================================= */
/* 3. TABEL DATA & STICKY HEADER             */
/* ========================================= */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th,
.data-table td {
    border: 1px solid #e9ecef; 
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle; 
}

/* Header tabel 'sticky' (Default untuk tabel 1 baris) */
.data-table th {
    background-color: #f8f9fa; 
    font-weight: 600;
    color: #495057;
    position: sticky; 
    top: 0; 
    z-index: 1; 
    border-top: none; 
}

/* --- PERBAIKAN STICKY HEADER 2 BARIS (Untuk Rekapitulasi) --- */
/* Baris 1 (Judul Kolom Utama) */
.data-table thead tr:nth-child(1) th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 20; 
    
    height: 40px; /* Pastikan tinggi baris 1 fix */
    box-sizing: border-box;
    
    border-top: none;
    border-bottom: 1px solid #000 !important;
    border-right: 1px solid #ccc;
}

/* Baris 2 (Sub-kolom L/P) */
.data-table thead tr:nth-child(2) th {
    background-color: #f8f9fa;
    font-weight: 600;
    position: sticky;
    
    top: 40px; /* Nilai ini SAMA dengan height baris 1 */
    
    z-index: 15; 
    box-shadow: 0 2px 2px -1px rgba(0,0,0,0.1); 
    
    border-top: none !important; 
    border-bottom: 2px solid #000 !important; 
    border-right: 1px solid #ccc;
}

/* Perbaikan khusus untuk kolom rowspan */
.data-table thead tr:nth-child(1) th[rowspan="2"] {
    border-bottom: 2px solid #000 !important;
    z-index: 21; 
}

.data-table tbody tr:nth-child(even) {
    background-color: #f8f9fa; 
}
.data-table tbody tr:hover {
    background-color: #e9ecef;
}

/* === Tombol Aksi di Tabel === */
.btn-aksi {
    padding: 6px 10px;
    margin: 0 3px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s ease, transform 0.1s ease; 
}
.btn-aksi:hover { transform: translateY(-1px); }
.btn-edit { background-color: #ffc107; color: black; }
.btn-edit:hover { background-color: #e0a800; }
.btn-delete { background-color: #dc3545; color: white; }
.btn-delete:hover { background-color: #c82333; }
.btn-reactivate { background-color: #28a745; color: white; }
.btn-reactivate:hover { background-color: #218838; }

/* === Pencarian === */
.search-container {
    margin-bottom: 15px;
}
.search-container input[type="text"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}
.search-container input:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* === Tombol Aksi Atas Tabel === */
.action-buttons-container {
    margin-top: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap; 
    gap: 10px; 
}
.action-buttons-container button {
    padding: 9px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: white;
    transition: background-color 0.3s ease;
}
.btn-format { background-color: #fd7e14; }
.btn-format:hover { background-color: #e36a04; }
.btn-download { background-color: #198754; }
.btn-download:hover { background-color: #157347; }
.btn-upload { background-color: #0d6efd; }
.btn-upload:hover { background-color: #0b5ed7; }
#refreshStok { background-color: #0dcaf0; color: #000; }
#refreshStok:hover { background-color: #0aa3bf; }
#btnDownloadStok { background-color: #0d6efd; }
#btnDownloadStok:hover { background-color: #0b5ed7; }
#btnDownloadSemua { background-color: #6f42c1; }
#btnDownloadSemua:hover { background-color: #5a2a9e; }

/* === Rata Kanan Kolom Angka === */
#tabelBarangMasuk th:nth-child(5), #tabelBarangMasuk td:nth-child(5),
#tabelBarangMasuk th:nth-child(6), #tabelBarangMasuk td:nth-child(6),
#tabelBarangMasuk th:nth-child(7), #tabelBarangMasuk td:nth-child(7),
#tabelBarangKeluar th:nth-child(5), #tabelBarangKeluar td:nth-child(5),
#tabelStok th:nth-child(4), #tabelStok td:nth-child(4),
#tabelStok th:nth-child(5), #tabelStok td:nth-child(5),
#tabelStok th:nth-child(6), #tabelStok td:nth-child(6) {
    text-align: right;
    padding-right: 15px; 
}
/* Override kolom non-angka rata kiri */
#tabelBarangMasuk th:nth-child(8), #tabelBarangMasuk td:nth-child(8),
#tabelBarangKeluar th:nth-child(6), #tabelBarangKeluar td:nth-child(6),
#tabelBarangKeluar th:nth-child(7), #tabelBarangKeluar td:nth-child(7),
#tabelStok th:nth-child(7), #tabelStok td:nth-child(7) {
    text-align: left;
    padding-right: 12px; 
}
.data-table td[colspan] {
    text-align: center;
    font-style: italic;
    color: #6c757d;
    padding: 20px;
}

/* === Tab Ganti Banner === */
#tabGantiBanner .form-group label {
    margin-bottom: 10px;
}
#tabGantiBanner input[type="file"] {
    display: block;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #f8f9fa;
    max-width: 400px; 
}
#simpanBannerButton { background-color: #28a745; color: white; }
#simpanBannerButton:hover { background-color: #218838; }
#resetBannerButton { background-color: #dc3545; color: white; }
#resetBannerButton:hover { background-color: #c82333; }

/* === Footer Total === */
.data-table tfoot tr {
    background-color: #f8f9fa; 
    border-top: 2px solid #dee2e6; 
}
.data-table tfoot td {
    font-size: 15px;
    font-weight: bold; 
    color: #212529; 
}

/* === Checkbox Hapus Massal === */
.checkbox-col {
    width: 20px; 
    text-align: center;
    padding-left: 15px;
    padding-right: 15px;
}
.checkbox-col input[type="checkbox"] {
    width: 16px; 
    height: 16px;
    cursor: pointer;
}
.btn-delete-selected { background-color: #dc3545; }
.btn-delete-selected:hover { background-color: #c82333; }
.btn-delete-selected:disabled { background-color: #6c757d; opacity: 0.65; cursor: not-allowed; }
.data-table tbody tr.selected-row { background-color: #f8d7da !important; }
.data-table tbody tr.selected-row:hover { background-color: #f1c6c9 !important; }

/* === Modal Kustom === */
.modal-overlay {
    position: fixed; 
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6); 
    display: flex; 
    justify-content: center;
    align-items: center;
    z-index: 1000; 
    backdrop-filter: blur(2px); 
}
.modal-content {
    background-color: #fff;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 350px;
    max-width: 90%;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    overflow: hidden;
}
.modal-content h3#modalTitle {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    color: #333;
    font-weight: 600;
}
.modal-content p#modalMessage {
    font-size: 15px;
    line-height: 1.5;
    color: #555;
    margin-bottom: 25px;
}
.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}
.btn-modal {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 90px;
}
.btn-modal.btn-danger {
    background-color: #dc3545; 
    color: white;
}
.btn-modal.btn-danger:hover {
    background-color: #c82333;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}
.btn-modal.btn-secondary {
    background-color: #6c757d; 
    color: white;
}
.btn-modal.btn-secondary:hover {
    background-color: #5a6268;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}
.btn-modal.btn-success {
    background-color: #28a745; 
    color: white;
}
.btn-modal.btn-success:hover {
    background-color: #218838;
}

/* Modal Variations */
.modal-content::before {
    content: '⚠️'; 
    font-size: 40px;
    color: #ffc107; 
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.1;
    pointer-events: none;
}
.modal-content.modal-success { background-color: #e7f3fe; }
.modal-content.modal-success h3#modalTitle { color: #004a99; }
.modal-content.modal-success::before {
    content: '✓'; 
    color: #007bff; 
    opacity: 0.15; 
    font-size: 60px;
}
.modal-content.modal-error h3#modalTitle { color: #dc3545; }
.modal-content.modal-warning h3#modalTitle { color: #ffc107; }

/* === Halaman Login === */
body.login-body {
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    background-image: url('/images/gambar_latar_belakang_login.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f4f7f6; 
    padding: 20px; 
    box-sizing: border-box;
}
body.login-pegawai { background-image: url('/images/loginkepegawaian.jpg'); }
body.login-absensi { background-image: url('/images/loginabsensi.jpg'); }

.login-container {
    background-color: #ffffff; 
    padding: 40px; 
    border-radius: 8px; 
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1); 
    width: 100%; 
    max-width: 400px;
    text-align: center; 
}
.login-container h1 {
    margin-top: 0; 
    margin-bottom: 25px; 
    color: #343a40; 
}
.login-container .form-group {
    margin-bottom: 20px; 
    text-align: left; 
}
.login-container .form-group input[type="text"],
.login-container .form-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.login-container .form-group input:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
.password-wrapper {
    position: relative; 
    width: 100%;
}
.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    padding-right: 45px !important; 
    box-sizing: border-box;
    width: 100%;
}
.password-toggle-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d; 
    user-select: none; 
    font-style: normal;
    font-size: 20px; 
}
.login-container button[type="submit"] {
    width: 100%; 
    padding: 12px 15px; 
    background-color: #007bff; 
    color: white;
    border: none;
    border-radius: 4px; 
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px; 
}
.login-container button[type="submit"]:hover {
    background-color: #0056b3; 
}
#errorMessage {
    color: #dc3545; 
    margin-top: 15px;
    font-size: 14px;
    min-height: 1.5em; 
    text-align: center;
}
.g-recaptcha {
    display: inline-block;
    margin-bottom: 20px;
}

/* === Dashboard (Portal) === */
body.dashboard-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: url('/images/bannerpertama.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f4f7f6; 
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
}

.dashboard-container {
    /* [PERBAIKAN 1] Lebarkan agar muat 4 kartu ke samping */
    max-width: 1200px; 
    width: 100%;
}

.dashboard-grid {
    display: grid;
    gap: 20px;
    margin-top: 40px;
    
    /* [PERBAIKAN 2] Default: Responsif (HP/Tablet) */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* [PERBAIKAN 3] KHUSUS DESKTOP: Paksa jadi 4 Kolom Sejajar */
@media (min-width: 992px) { 
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.dashboard-card {
    background-color: #ffffff;
    padding: 30px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: #333;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 150px; /* Tinggi seragam */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.dashboard-card h3 { 
    margin-top: 0; 
    margin-bottom: 10px;
    font-size: 1.3rem; /* Ukuran font pas */
    font-weight: 600;
}

.dashboard-card p { 
    font-size: 14px; 
    margin: 0;
    opacity: 0.95;
}

/* Judul Halaman (Kembali Standar) */
.dashboard-container h1 {
    color: #333; 
    margin-bottom: 10px;
    text-shadow: none;
}
.dashboard-container p {
    color: #555; 
    text-shadow: none;
}

/* Tombol Logout */
.dashboard-logout {
    display: inline-block;
    margin-top: 50px;
    color: #dc3545;
    text-decoration: none;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px 25px;
    border-radius: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Warna Kartu Dashboard */
a.dashboard-card[href="/loginbarang"] { background-color: #28a745; }
a.dashboard-card[href="/loginbarang"]:hover { background-color: #218838; }

a.dashboard-card[href="/loginpegawai"] { background-color: #007bff; }
a.dashboard-card[href="/loginpegawai"]:hover { background-color: #0056b3; }

a.dashboard-card[href="/loginabsensi"] { background-color: #6f42c1; }
a.dashboard-card[href="/loginabsensi"]:hover { background-color: #5a2a9e; }

a.dashboard-card[href="/absen"] { background-color: #17a2b8; }
a.dashboard-card[href="/absen"]:hover { background-color: #138496; }

/* Pastikan Teks dalam Kartu Berwarna Putih */
a.dashboard-card[href="/loginbarang"] h3, a.dashboard-card[href="/loginbarang"] p,
a.dashboard-card[href="/loginpegawai"] h3, a.dashboard-card[href="/loginpegawai"] p,
a.dashboard-card[href="/loginabsensi"] h3, a.dashboard-card[href="/loginabsensi"] p,
a.dashboard-card[href="/absen"] h3, a.dashboard-card[href="/absen"] p {
    color: #ffffff !important; 
}

/* === Header Form Sticky (Kepegawaian) === */
.form-header-fixed { 
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
    background-color: #ffffff;
    position: sticky;
    top: -30px; 
    z-index: 10; 
    padding-top: 30px;
    margin: -30px -30px 0px -30px; 
    padding-left: 30px; 
    padding-right: 30px;
}
.form-header-fixed h2 {
    margin-top: 0;
    margin-bottom: 15px; 
    color: #343a40; 
    font-weight: 600;
    border-bottom: none; 
    padding-bottom: 0;
}
.form-header-fixed .form-button-container {
    margin-top: 0; 
    margin-bottom: 0;
}

/* === Wrapper Form Scrollable === */
.form-content-scrollable {
    overflow-y: auto; 
    height: calc(100vh - 120px - 40px - 52px - 110px); 
}
.form-content-scrollable .form-container {
    padding-top: 20px; 
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 25px; 
}

/* === Foto Pegawai === */
.photo-preview-container {
    width: 100%;
    max-width: 300px; 
    height: 300px;
    border: 2px dashed #ced4da;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    overflow: hidden;
    margin-top: 10px;
    position: relative; 
}
#pegawaiFotoPreview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none; 
}
#pegawaiFotoPreview.has-image { display: block; }
#pegawaiFotoPlaceholder {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 10px;
}
#pegawaiFotoPreview.has-image + #pegawaiFotoPlaceholder { display: none; }
#pegawaiFoto {
    display: block;
    width: 100%;
    max-width: 300px;
    box-sizing: border-box;
}
.tabel-foto-pegawai {
    width: 40px;
    height: 40px;
    border-radius: 50%; 
    object-fit: cover;
    background-color: #eee; 
    vertical-align: middle;
}

/* === List Pegawai Modal Non-aktifkan === */
.list-pegawai-modal {
    list-style-type: none;
    padding: 0;
    margin: 15px 0 0 0;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.list-pegawai-modal li {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}
.list-pegawai-modal li:last-child { border-bottom: none; }
.list-pegawai-modal li:hover { background-color: #f4f7f6; }
.list-pegawai-modal li strong { color: #0056b3; }
.list-pegawai-modal li span { font-size: 13px; color: #555; margin-left: 10px; }

/* === Baris Pensiun (Merah & Kuning) === */
.data-table tbody tr.row-pensiun-lewat {
    background-color: #f8d7da !important; 
    font-weight: 500;
}
.data-table tbody tr.row-pensiun-segera {
    background-color: #fff3cd !important; 
}
.data-table tbody tr.row-pensiun-lewat:hover { background-color: #f1c6c9 !important; }
.data-table tbody tr.row-pensiun-segera:hover { background-color: #ffe69c !important; }

/* === Tabel Data Lengkap === */
.data-table th.col-lengkap,
.data-table td.col-lengkap {
    display: none;
}
.data-table.tabel-lengkap-aktif th.col-lengkap,
.data-table.tabel-lengkap-aktif td.col-lengkap {
    display: table-cell;
}

/* ========================================= */
/* 7. ANIMASI LOADING                        */
/* ========================================= */
#globalLoader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5); 
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 9999; 
    backdrop-filter: blur(0.5px);
}
.loader-box {
    background-color: #28a745; 
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
    height: 120px;
    justify-content: center;
}
.loader-text {
    color: white;
    margin-top: 15px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 1px;
}
.loader-animation {
    display: inline-block;
    position: relative;
    width: 64px;
    height: 64px;
    transform: rotate(45deg);
    transform-origin: 32px 32px;
}
.loader-animation div {
    top: 26px; 
    left: 10px;
    position: absolute;
    width: 26px;
    height: 26px;
    background: #fff; 
    animation: loader-spin 1.2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
    border-radius: 3px;
}
.loader-animation div:nth-child(1) { top: 26px; left: 10px; animation-delay: 0s; }
.loader-animation div:nth-child(2) { top: 26px; left: 10px; animation-delay: -0.1s; }
.loader-animation div:nth-child(3) { top: 26px; left: 10px; animation-delay: -0.2s; }
.loader-animation div:nth-child(4) { top: 26px; left: 10px; animation-delay: -0.3s; }
@keyframes loader-spin {
    0% { transform: scale(0.5); background: #fff; }
    25% { transform: scale(0.5) translate(-35px, -35px); }
    50% { transform: scale(0.5) translate(0, -70px); }
    75% { transform: scale(0.5) translate(35px, -35px); }
    100% { transform: scale(0.5); background: #fff; }
}

/* ================================================================= */
/* [UPDATE] PERBAIKAN TAMPILAN TABEL REKAP (WARNA & ALIGNMENT)       */
/* ================================================================= */

/* 1. Reset Dasar Tabel */
.table-rekap {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-bottom: 30px;
    font-size: 11px;
}

/* 2. Sel & Header Umum (Tinggi Dikurangi) */
.table-rekap th, 
.table-rekap td {
    border: 1px solid #333;
    padding: 4px 2px !important; /* Padding diperkecil */
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 25px; /* Tinggi baris diperkecil (sebelumnya 35px) */
    line-height: 1.2;
}

/* 3. Kolom Nomor */
.table-rekap th:first-child,
.table-rekap td:first-child {
    width: 30px;
    text-align: center;
}

/* 1. Header Tabel Rata Tengah */
.table-rekap thead th {
    text-align: center !important;
    vertical-align: middle !important;
}

/* 2. Kolom L (Laki-laki) -> Biru Muda & Tengah */
.th-l, .td-l {
    background-color: #e6f7ff !important; /* Biru Muda */
    text-align: center !important;
    vertical-align: middle !important;
    color: #000;
}

/* 3. Kolom P (Perempuan) -> Merah Muda & Tengah */
.th-p, .td-p {
    background-color: #ffe6e6 !important; /* Merah Muda */
    text-align: center !important;
    vertical-align: middle !important;
    color: #000;
}

/* 4. Kolom JUMLAH (Lebar & Tebal) */
.col-jumlah {
    min-width: 80px !important; /* Melebarkan kolom */
    font-weight: bold;
    text-align: center !important;
    vertical-align: middle !important;
    background-color: #fff5cc !important; /* Kuning Muda */
}

/* 4. Kolom JABATAN / GOLONGAN */
.table-rekap th:nth-child(2),
.table-rekap td:nth-child(2) {
    width: 250px;
    text-align: left;
    padding-left: 8px !important;
    font-weight: 600;
}

/* 6. Baris Total di Footer */
.row-total-rekap td {
    background-color: #FFFF00 !important; /* Kuning Terang */
    font-weight: bold;
    text-align: center !important;
    border-top: 2px solid #000 !important;
}

/* --- WARNA HEADER (BIRU) --- */
/* Override semua warna header lama menjadi Nuansa Biru */
.bg-yellow, .bg-pink, .bg-cyan, .bg-green, .bg-green-dark, .bg-orange {
    background-color: #007bff !important; /* Biru Utama */
    color: #fff !important; /* Teks Putih */
}

/* Sub-Header (L & P) diberi warna biru lebih muda agar ada hierarki */
.table-rekap thead tr:nth-child(2) th {
    background-color: #4da3ff !important; /* Biru Muda */
    color: #fff !important;
}

/* --- BARIS TOTAL (HIJAU) --- */
.row-total-rekap td {
    background-color: #28a745 !important; /* Hijau Sukses */
    color: #fff !important; /* Teks Putih agar kontras */
    font-weight: bold;
    border-top: 2px solid #000;
}

/* Efek Hover Baris */
.table-rekap tbody tr:hover td {
    background-color: #f1f1f1 !important; /* Abu sangat muda */
}

/* --- STYLE TAMBAHAN MODUL ABSENSI --- */

/* Badge Status Kehadiran */
.status-badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

.status-hadir { background-color: #28a745; } /* Hijau */
.status-pulang { background-color: #17a2b8; } /* Biru Muda (Opsional jika ingin beda) */
.status-sakit { background-color: #ffc107; color: #333; } /* Kuning */
.status-izin { background-color: #fd7e14; } /* Oranye */
.status-cuti { background-color: #6f42c1; } /* Ungu */
.status-dinas { background-color: #007bff; } /* Biru */
.status-alpa { background-color: #dc3545; } /* Merah */
.status-belum { background-color: #6c757d; } /* Abu-abu */

/* Style untuk Jam */
.jam-text {
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: bold;
    color: #333;
    background-color: #f1f1f1;
    padding: 2px 6px;
    border-radius: 4px;
}