/* Modern & Premium Design System for Sistem Absensi 229 */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #e0e7ff;
    --secondary: #0ea5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
    --bg-body: #f8fafc;
    --card-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
    --card-shadow-hover: 0 20px 30px -10px rgba(15, 23, 42, 0.1);
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: #334155;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: #0f172a;
    color: #94a3b8;
    min-height: 100vh;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar .brand-logo {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .nav-link {
    color: #94a3b8;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    margin: 0.2rem 0.75rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.sidebar .nav-link i {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(3px);
}

.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.35);
}

/* Topbar Header */
.topbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

/* Cards & Glassmorphism */
.card-custom {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid #edf2f7;
    box-shadow: var(--card-shadow);
    transition: all 0.25s ease;
}

.card-custom:hover {
    box-shadow: var(--card-shadow-hover);
}

.stat-card {
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
    overflow: hidden;
    background: #fff;
}

.stat-card .icon-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-card.stat-primary .icon-box { background: #eef2ff; color: #4f46e5; }
.stat-card.stat-success .icon-box { background: #ecfdf5; color: #10b981; }
.stat-card.stat-warning .icon-box { background: #fffbeb; color: #f59e0b; }
.stat-card.stat-danger .icon-box { background: #fef2f2; color: #ef4444; }
.stat-card.stat-info .icon-box { background: #f0f9ff; color: #0ea5e9; }

/* Scanner Interactive UI */
.scanner-viewport {
    background: #090d16;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    border: 2px solid #312e81;
}

#reader {
    width: 100%;
    min-height: 320px;
}

#reader video {
    border-radius: 12px;
    object-fit: cover;
}

.scan-laser-line {
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #22d3ee, #6366f1, transparent);
    box-shadow: 0 0 15px #22d3ee;
    animation: laserScan 2s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 10;
}

@keyframes laserScan {
    0% { top: 15%; opacity: 0.8; }
    100% { top: 85%; opacity: 1; }
}

.digital-clock-display {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: #38bdf8;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.digital-clock-display .time {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

/* Badges */
.badge-hadir { background-color: #dcfce7; color: #15803d; font-weight: 600; }
.badge-terlambat { background-color: #fef3c7; color: #b45309; font-weight: 600; }
.badge-izin { background-color: #e0f2fe; color: #0369a1; font-weight: 600; }
.badge-sakit { background-color: #f3e8ff; color: #7e22ce; font-weight: 600; }
.badge-alpa { background-color: #fee2e2; color: #b91c1c; font-weight: 600; }

/* Custom Buttons */
.btn-primary-gradient {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
    border: none;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    transition: all 0.2s ease;
}

.btn-primary-gradient:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

/* Table Styling */
.table-custom {
    vertical-align: middle;
}

.table-custom thead th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.9rem 1rem;
}

.table-custom tbody td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

/* Modal Popup Scan Success Animation */
.scan-result-popup {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ID Card / Barcode Badge for Printing */
.id-card-badge {
    width: 320px;
    height: 480px;
    background: #ffffff;
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    margin: 10px;
    page-break-inside: avoid;
}

.id-card-badge .header-bar {
    width: 100%;
    background: linear-gradient(135deg, #312e81 0%, #4f46e5 100%);
    color: #fff;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
}

.id-card-badge .photo-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid #4f46e5;
    object-fit: cover;
    margin: 0.5rem 0;
}

/* Print CSS */
@media print {
    body {
        background: #fff !important;
    }
    .sidebar, .topbar, .no-print, .btn, nav {
        display: none !important;
    }
    .content-wrapper {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    .id-card-container {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    .id-card-badge {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}
