/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}
.animate-fadeIn { animation: fadeIn 0.35s ease-out; }
.animate-slideUp { animation: slideUp 0.4s ease-out; }
.animate-scaleIn { animation: scaleIn 0.25s ease-out; }
.pulse-ring { animation: pulse-ring 2s infinite; }

/* ===== NAV ITEMS ===== */
.nav-item { color: rgba(255,255,255,0.65); }
.nav-item:hover { color: white; }
.nav-item.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(139,92,246,0.2));
    color: white;
    font-weight: 600;
    border: 1px solid rgba(139,92,246,0.25);
}

/* ===== STATUS BADGES ===== */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.badge-hadir { background: #d1fae5; color: #065f46; }
.badge-izin { background: #fef3c7; color: #92400e; }
.badge-sakit { background: #fef3c7; color: #92400e; }
.badge-alpa { background: #ffe4e6; color: #9f1239; }
.badge-telat { background: #dbeafe; color: #1e40af; }
.badge-bolos { background: #fce7f3; color: #9d174d; }
.badge-dispen { background: #e0f2fe; color: #0369a1; }
.row-dispen { background: #f0f9ff; }

/* ===== TABLE ROW COLORS ===== */
.row-hadir { background: #f0fdf4 !important; }
.row-izin, .row-sakit { background: #fffbeb !important; }
.row-alpa { background: #fff1f2 !important; }

/* ===== MODAL ===== */
.modal-backdrop {
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ===== TABS ===== */
.tab-btn {
    padding: 10px 20px; border-radius: 12px;
    font-weight: 600; font-size: 0.875rem;
    transition: all 0.2s; cursor: pointer;
    border: 2px solid transparent;
    background: #f1f5f9; color: #64748b;
}
.tab-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white; border-color: transparent;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.tab-btn:not(.active):hover {
    background: #e2e8f0; color: #334155;
}

/* ===== SCAN MODE BUTTONS ===== */
.mode-btn {
    padding: 10px 24px; border-radius: 12px;
    font-weight: 600; font-size: 0.875rem;
    transition: all 0.2s; cursor: pointer;
    border: 2px solid #e2e8f0; background: white;
}
.mode-btn.active-masuk {
    background: #10b981; color: white;
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}
.mode-btn.active-pulang {
    background: #f59e0b; color: white;
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245,158,11,0.3);
}

/* ===== CUSTOM SELECT ===== */
.custom-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ===== CARDS ===== */
.stat-card {
    transition: all 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== PRINT STYLES ===== */
@media print {
    body * { visibility: hidden !important; }
    #print-area, #print-area * { visibility: visible !important; }
    #print-area {
        position: fixed; left: 0; top: 0;
        width: 100%; padding: 20px;
    }
}

/* ===== TABLE RESPONSIVE ===== */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-container table {
    min-width: 600px;
}

/* ===== INPUT FOCUS ===== */
.input-field {
    transition: all 0.2s;
    border: 2px solid #e2e8f0;
}
.input-field:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
    outline: none;
}

/* ===== QR READER ===== */
#reader video {
    border-radius: 16px !important;
}
#reader {
    border-radius: 16px;
    overflow: hidden;
}

/* ===== TOAST ===== */
.toast {
    position: fixed; bottom: 24px; right: 24px;
    padding: 16px 24px; border-radius: 16px;
    color: white; font-weight: 600; z-index: 9999;
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    max-width: 400px;
}
.toast-success { background: linear-gradient(135deg, #10b981, #059669); }
.toast-error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast-info { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.toast-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }

/* ===== STUDENT CARD (PRINT) ===== */
.student-card {
    width: 350px; padding: 24px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    background: white;
    font-family: 'Inter', sans-serif;
}
.student-card-header {
    text-align: center;
    border-bottom: 2px solid #6366f1;
    padding-bottom: 12px; margin-bottom: 16px;
}

.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
