:root {
    --primary: #0f172a;
    --blue: #3b82f6;
    --green: #10b981;
    --red: #ef4444;
    --bg: #f8fafc;
}

* {
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
    background: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 420px;
}

h2 {
    text-align: center;
    color: var(--primary);
    margin-top: 0;
}

.video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #000;
    border-radius: 0.5rem;
    overflow: hidden;
    margin: 1rem 0;
    border: 3px solid #e2e8f0;
}

video,
canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

input,
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 1rem;
    outline: none;
}

input:focus {
    border-color: var(--blue);
}

.badge {
    padding: 10px;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
    transition: 0.3s;
}

.bg-warn {
    background: #fef3c7;
    color: #b45309;
}

.bg-success {
    background: #d1fae5;
    color: #047857;
}

.bg-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 0.5rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: 0.2s;
}

.btn-masuk {
    background: var(--blue);
}

.btn-pulang {
    background: var(--primary);
}

button:active {
    transform: scale(0.95);
}

#msg {
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 10px;
    border-radius: 0.5rem;
}

/* --- CSS UNTUK DASHBOARD ADMIN --- */
.dashboard-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
}

.btn-cetak {
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: bold;
}

/* Desain Tabel Native Murni */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th,
td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

th {
    background-color: #f8fafc;
    color: #0f172a;
    font-weight: 600;
    white-space: nowrap;
}

tr:hover {
    background-color: #f1f5f9;
}

.foto-absen {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
}
.btn-login-admin {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #0f172a;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: 0.3s;
}
.btn-login-admin:hover { background: #3b82f6; }
/* Sembunyikan elemen tertentu saat di-print (Ctrl+P) */
@media print {
    /* Sembunyikan elemen yang tidak perlu saat dicetak */
    .tab-menu, 
    .filter-bar, 
    .btn-login-admin, 
    footer,
    button {
        display: none !important;
    }

    /* Atur tampilan tabel saat dicetak */
    .admin-container {
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    table {
        border: 1px solid #000;
    }

    th, td {
        border: 1px solid #ddd !important;
        padding: 8px !important;
        font-size: 10pt;
    }

    /* Pastikan foto tetap muncul atau bisa disembunyikan jika ingin hemat tinta */
    .foto-absen {
        max-width: 60px;
    }
}