* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

body {
    background-color: #f4f6f9;
    color: #333;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background-color: #1e293b;
    overflow-y: auto;
    z-index: 100;
    padding-top: 20px;
}

.sidebar h2 {
    font-size: 1.2rem;
    padding: 0 20px 20px;
    color: #38bdf8;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #94a3b8;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar li:hover, .sidebar li.active {
    background-color: #0f172a;
    color: #38bdf8;
    border-left: 4px solid #38bdf8;
}

.main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
    padding: 25px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

header h1 {
    font-size: 1.6rem;
    color: #0f172a;
}

header p {
    color: #64748b;
    font-size: 0.9rem;
}

.btn-refresh {
    background: #0284c7;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-refresh:hover {
    background: #0369a1;
}

.btn-primary {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}
.btn-primary:hover { background: #059669; }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    padding: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header input[type="text"],
.card-header input[type="date"],
.card-header select {
    padding: 10px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    outline: none;
}
.card-header input[type="text"]:focus,
.card-header input[type="date"]:focus,
.card-header select:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.badge {
    background: #e0f2fe;
    color: #0369a1;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;    
    min-width: 75px;
    text-align: center;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    white-space: nowrap;
}

th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
}

tr:hover {
    background-color: #f8fafc;
}

.status-msg {
    text-align: center;
    color: #64748b;
    padding: 30px !important;
}

/* Rata tengah kolom statistik absen */
#headRekap th:nth-child(n+4):nth-child(-n+10),
#bodyRekap td:nth-child(n+4):nth-child(-n+10) {
    text-align: center;
}

.hamburger-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: #0f172a;
    cursor: pointer;
    padding: 5px 10px 5px 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px 20px;
    border-bottom: 1px solid #334155;
}

.close-sidebar {
    display: none;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.3rem;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

@media screen and (max-width: 1024px) {
    .hamburger-btn {
        display: block; 
    }
    .sidebar {
        left: -280px;
        width: 280px;
        z-index: 999;
        transition: left 0.3s ease-in-out;
        box-shadow: 5px 0 15px rgba(0,0,0,0.2);
    }
    .sidebar.active {
        left: 0; 
    }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    .sidebar-header h2 {
        border-bottom: none;
        padding: 0;
    }
    .close-sidebar {
        display: block;
    }
    .sidebar-overlay.active {
        display: block;
    }
}

@media screen and (max-width: 768px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .header-right {
        display: flex;
        gap: 5px;
    }
    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .card-header > div {
        flex-direction: column;
        align-items: stretch !important;
        width: 100%;
    }
    .card-header input, 
    .card-header select, 
    .card-header button {
        width: 100% !important;
    }
    .modal-content {
        width: 95% !important;
        padding: 15px;
    }
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #68512f;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
}

.login-card {
    background: #ffffff;
    padding: 35px 30px;
    border-radius: 12px;
    width: 380px;
    max-width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.login-card h2 {
    color: #15264b;
    font-size: 1.5rem;
    margin-bottom: 8px;
    text-align: center;
}

.login-card p {
    color: #64748b;
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 25px;
}

.modal {
    display: none;
    position: fixed; 
    z-index: 9999;
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.5); 
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.modal-content h2 { 
    font-size: 1.3rem; 
    margin-bottom: 20px; 
    color: #0f172a; 
    border-bottom: 1px solid #e2e8f0; 
    padding-bottom: 10px;
}

.close { 
    position: absolute; 
    right: 20px; 
    top: 20px; 
    font-size: 24px; 
    font-weight: bold; 
    color: #94a3b8; 
    cursor: pointer; 
}

.close:hover { 
    color: #ef4444; 
}

.form-group { 
    margin-bottom: 15px; 
}

.form-group label { 
    display: block; 
    font-weight: 600; 
    font-size: 0.9rem; 
    margin-bottom: 5px; 
    color: #334155; 
}

.form-group input, 
.form-group select { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #cbd5e1; 
    border-radius: 6px; 
    outline: none; 
}

.form-group input:focus, 
.form-group select:focus { 
    border-color: #0ea5e9; 
}

.btn-icon {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    margin-right: 12px;
    transition: color 0.2s, transform 0.2s;
}
.btn-icon:hover {
    transform: scale(1.1);
}
.btn-icon.edit { color: #0ea5e9; }      
.btn-icon.edit:hover { color: #0284c7; }
.btn-icon.delete { color: #ef4444; }    
.btn-icon.delete:hover { color: #dc2626; }

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 38px !important;
    cursor: pointer;
}

select:focus {
    border-color: #0ea5e9 !important;
    outline: none;
}

select {
    color-scheme: light; 
    background-color: #ffffff;
    color: #334155;
}

select option {
    background-color: #ffffff;
    color: #334155;
    padding: 10px;
    font-size: 0.95rem;
}

select option:checked {
    background-color: #e0f2fe;
    color: #0369a1;
    font-weight: bold;
}

.choices {
    margin-bottom: 0;
    font-weight: 600;
}
.choices__inner {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 6px 15px !important;
    min-height: auto !important;
    color: #334155;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: #e0f2fe;
    color: #0369a1;
}
