:root {
    --bg-dark: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --accent-blue: #38bdf8;
    --accent-green: #22c55e;
    --accent-yellow: #eab308;
    --accent-red: #ef4444;
    --text-main: #f8fafc;
    --border-glass: rgba(255, 255, 255, 0.1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism Panel (HARUS DIAM STATIS) */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transform: none !important; /* DILarang Terpengaruh Animasi Scanner */
}

/* KIOSK LAYOUT */
.kiosk-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    height: 100vh;
}

.camera-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* WEBCAM FRAME WITH ANIMATED GLOW & LASER ONLY */
.webcam-wrapper {
    position: relative;
    width: 640px;
    height: 480px;
    border-radius: 20px;
    overflow: hidden;
    padding: 5px;
    background: #000;
}

/* Dynamic Rotating Gradient Ring on Border */
.webcam-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, var(--accent-blue), transparent 30%);
    animation: rotateGlow 4s linear infinite;
    z-index: 1;
}

.webcam-box {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    z-index: 2;
}

video, canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Scanning Laser Line Overlay */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    box-shadow: 0 0 15px var(--accent-blue);
    animation: scanAnimation 2.5s ease-in-out infinite alternate;
    z-index: 3;
    pointer-events: none;
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes scanAnimation {
    0% { top: 0%; }
    100% { top: 98%; }
}

/* KIOSK SIDEBAR INFO */
.info-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.clock-card {
    text-align: center;
}

.clock-card h1 {
    font-size: 2.8rem;
    color: var(--accent-blue);
    letter-spacing: 2px;
}

.clock-card p {
    font-size: 1rem;
    color: #94a3b8;
}

.status-card {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-indicator {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
}

/* MODAL POPUP RESULTS */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-content {
    width: 450px;
    text-align: center;
    position: relative;
}

.modal-content.hadir { border-top: 6px solid var(--accent-green); }
.modal-content.terlambat { border-top: 6px solid var(--accent-yellow); }
.modal-content.unknown { border-top: 6px solid var(--accent-red); }

.student-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 15px auto;
    border: 3px solid var(--accent-blue);
}

/* ADMIN DASHBOARD LAYOUT */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #1e293b;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-brand {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-blue);
    margin-bottom: 20px;
}

.nav-item {
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.nav-item:hover, .nav-item.active {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-blue);
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.metric-card {
    padding: 20px;
    border-radius: 12px;
    background: #1e293b;
    border: 1px solid var(--border-glass);
}

.metric-card h3 { font-size: 0.9rem; color: #94a3b8; }
.metric-card p { font-size: 2rem; font-weight: bold; margin-top: 5px; }

.table-custom {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table-custom th, .table-custom td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
}

.table-custom th {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}
.badge.hadir { background: rgba(34, 197, 94, 0.2); color: var(--accent-green); }
.badge.terlambat { background: rgba(234, 179, 8, 0.2); color: var(--accent-yellow); }

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}
.btn-primary { background: var(--accent-blue); color: #000; }
.btn-danger { background: var(--accent-red); color: #fff; }

/* KOP SURAT FORMAL UNTUK PRINT ABSENSI BULANAN */
.print-only { display: none; }

@media print {
    body { background: #fff !important; color: #000 !important; }
    .sidebar, .btn, .no-print { display: none !important; }
    .main-content { padding: 0 !important; }
    .glass-panel { border: none !important; box-shadow: none !important; background: transparent !important; color: #000 !important; }
    .table-custom th, .table-custom td { border: 1px solid #000 !important; color: #000 !important; }
    
    .print-only {
        display: block !important;
        margin-bottom: 20px;
    }
    .kop-surat {
        display: flex;
        align-items: center;
        border-bottom: 3px double #000;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }
    .kop-logo { width: 80px; height: 80px; margin-right: 20px; }
    .kop-text { text-align: center; flex: 1; }
    .kop-text h2 { font-size: 16pt; margin: 0; text-transform: uppercase; }
    .kop-text h3 { font-size: 14pt; margin: 0; text-transform: uppercase; }
    .kop-text p { font-size: 10pt; margin: 2px 0; }
}