:root {
    --primary: #0d6efd;
    --sidebar-width: 250px;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f4f6f9;
}

.main-content {
    margin-top: 56px;
    flex: 1;
    padding-bottom: 20px;
}

/* Cards */
.stat-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
.stat-card .icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

/* Scan page */
#reader {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
}
#reader video {
    border-radius: 12px;
}

.scan-result {
    min-height: 120px;
}

.student-card-preview {
    max-width: 350px;
    border: 2px solid #0d6efd;
    border-radius: 12px;
    overflow: hidden;
}

/* ID Card */
.id-card {
    width: 85.6mm; /* standard CR80 */
    height: 54mm;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3a5f 0%, #0d6efd 100%);
    color: white;
    position: relative;
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.id-card .card-header {
    background: rgba(255,255,255,0.15);
    padding: 4px 10px;
    font-size: 10px;
    text-align: center;
    font-weight: 600;
}
.id-card .card-body {
    display: flex;
    padding: 8px;
    gap: 8px;
}
.id-card .photo {
    width: 70px;
    height: 85px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid white;
    background: #fff;
}
.id-card .info {
    flex: 1;
    font-size: 11px;
}
.id-card .info h5 {
    margin: 0 0 4px 0;
    font-size: 13px;
    font-weight: 700;
}
.id-card .qr {
    position: absolute;
    bottom: 6px;
    right: 8px;
    background: white;
    padding: 3px;
    border-radius: 4px;
}
.id-card .qr img, .id-card .qr canvas {
    width: 50px;
    height: 50px;
}

/* Print styles for ID cards */
@media print {
    body * {
        visibility: hidden;
    }
    .print-area, .print-area * {
        visibility: visible;
    }
    .print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .no-print {
        display: none !important;
    }
    .id-card {
        page-break-inside: avoid;
        margin: 5mm;
        box-shadow: none;
    }
}

/* Tables */
.table th {
    white-space: nowrap;
    font-size: 0.85rem;
}
.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d6efd 0%, #1e3a5f 100%);
}
.login-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

/* Avatar */
.avatar-sm {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
}
.avatar-md {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
}

/* Status colors */
.bg-hadir { background-color: #198754 !important; }
.bg-terlambat { background-color: #ffc107 !important; color: #000 !important; }
.bg-izin { background-color: #0dcaf0 !important; }
.bg-sakit { background-color: #0d6efd !important; }
.bg-alpha { background-color: #dc3545 !important; }

/* Responsive */
@media (max-width: 768px) {
    .stat-card .icon {
        font-size: 1.8rem;
    }
}
