/* ============================================
   ABSENSI SMK N 1 LURUGUNG — Modern Dark Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* === CSS Custom Properties === */
:root {
    --bg-primary: #080c16;
    --bg-secondary: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.45);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);
    --border-glass: rgba(255, 255, 255, 0.07);
    --border-glass-hover: rgba(255, 255, 255, 0.15);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-amber: #f59e0b;

    --gradient-primary: linear-gradient(135deg, #06b6d4, #8b5cf6);
    --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);
    --gradient-danger: linear-gradient(135deg, #ef4444, #f59e0b);
    --gradient-info: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --gradient-bg: linear-gradient(135deg, #0a0e1a 0%, #1a1040 50%, #0a0e1a 100%);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow-cyan: 0 0 20px rgba(6, 182, 212, 0.3);
    --shadow-glow-purple: 0 0 20px rgba(139, 92, 246, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --sidebar-width: 280px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === Reset & Base === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--gradient-bg);
    background-size: 400% 400%;
    animation: bgShift 18s ease infinite;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@keyframes bgShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

a { text-decoration: none; color: inherit; transition: color var(--transition-fast); }

/* === Animated Background === */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse 600px 600px at 20% 20%, rgba(6, 182, 212, 0.08), transparent),
        radial-gradient(ellipse 500px 500px at 80% 80%, rgba(139, 92, 246, 0.08), transparent),
        radial-gradient(ellipse 400px 400px at 60% 30%, rgba(59, 130, 246, 0.05), transparent);
    pointer-events: none;
    z-index: -2;
    animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* === Sidebar === */
.admin-sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-width); height: 100vh;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    color: white; padding: 0; z-index: 100;
    display: flex; flex-direction: column;
    transition: transform var(--transition-smooth);
}

.sidebar-header {
    padding: 28px 24px 24px;
    border-bottom: 1px solid var(--border-glass);
    position: relative;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 24px; right: 24px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.sidebar-header h3 {
    font-size: 16px; font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.sidebar-header p {
    font-size: 12px; color: var(--text-muted);
    margin-top: 4px; text-transform: uppercase;
    letter-spacing: 0.08em; font-weight: 500;
}

.sidebar-menu {
    list-style: none; padding: 16px 12px;
    flex: 1; overflow-y: auto;
}

.sidebar-menu li { margin-bottom: 4px; }

.sidebar-menu a {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px; font-weight: 500;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.sidebar-menu a::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px; border-radius: 0 3px 3px 0;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform var(--transition-smooth);
}

.sidebar-menu a:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.sidebar-menu a.active {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.sidebar-menu a.active::before { transform: scaleY(1); }

.sidebar-menu a span {
    font-size: 18px;
    width: 24px; text-align: center;
    transition: transform var(--transition-bounce);
}

.sidebar-menu a:hover span { transform: scale(1.2); }

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-glass);
    display: flex; flex-direction: column; gap: 4px;
}

.sidebar-footer a {
    color: var(--text-muted); font-size: 13px;
    padding: 10px 0; font-weight: 500;
    transition: all var(--transition-fast);
    display: flex; align-items: center; gap: 8px;
}

.sidebar-footer a:hover {
    color: var(--text-primary);
    transform: translateX(4px);
}

/* Mobile hamburger */
.sidebar-toggle {
    display: none;
    position: fixed; top: 16px; left: 16px;
    z-index: 200; width: 44px; height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-size: 20px; cursor: pointer;
    align-items: center; justify-content: center;
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover { background: var(--bg-glass-hover); }

.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
    backdrop-filter: blur(4px);
}

/* === Main Content Area === */
.admin-main {
    margin-left: var(--sidebar-width);
    padding: 40px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* === Page Header === */
.page-header {
    margin-bottom: 36px;
    animation: slideDown 0.5s ease;
}

.page-header h1 {
    font-size: 32px; font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    position: relative;
    display: inline-block;
}

.page-header h1::after {
    content: '';
    position: absolute;
    bottom: -8px; left: 0;
    width: 60px; height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px;
}

.page-header p {
    color: var(--text-secondary);
    margin-top: 12px; font-size: 15px;
}

/* === Cards === */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    transition: all var(--transition-smooth);
    animation: fadeInUp 0.5s ease;
}

.card:hover {
    border-color: rgba(6, 182, 212, 0.25);
    box-shadow: 0 8px 32px 0 rgba(6, 182, 212, 0.12);
    transform: translateY(-2px);
}

.card h2 {
    font-size: 18px; font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

/* === Stats Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex; align-items: center; gap: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0.85;
    transition: opacity var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow: 0 8px 32px 0 rgba(139, 92, 246, 0.12);
}

.stat-card:hover::before { opacity: 1; }

.stat-card.stat-success::before { background: var(--gradient-success); }
.stat-card.stat-danger::before { background: var(--gradient-danger); }
.stat-card.stat-info::before { background: var(--gradient-info); }

.stat-card.stat-success:hover {
    border-color: rgba(16, 185, 129, 0.25);
    box-shadow: 0 8px 32px 0 rgba(16, 185, 129, 0.15);
}
.stat-card.stat-danger:hover {
    border-color: rgba(239, 68, 68, 0.25);
    box-shadow: 0 8px 32px 0 rgba(239, 68, 68, 0.15);
}
.stat-card.stat-info:hover {
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 8px 32px 0 rgba(59, 130, 246, 0.15);
}

.stat-icon {
    font-size: 36px;
    width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    transition: transform var(--transition-bounce);
}

.stat-card:hover .stat-icon { transform: scale(1.1) rotate(-3deg); }

.stat-number {
    font-size: 28px; font-weight: 800;
    color: var(--text-primary);
    margin-top: 4px;
    letter-spacing: -0.03em;
}

.stat-info h3 {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === Tables === */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.data-table th {
    text-align: left;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-glass);
}

.data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.data-table tr { transition: all var(--transition-fast); }

.data-table tbody tr:hover {
    background: rgba(6, 182, 212, 0.04);
}

.data-table tbody tr:hover td {
    color: var(--text-primary);
}

/* === Badges === */
.badge {
    display: inline-flex; align-items: center;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px; font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* === Alerts === */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 14px; font-weight: 500;
    backdrop-filter: blur(8px);
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* === Forms === */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex; flex-direction: column;
}

.form-group label {
    font-size: 13px; font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-smooth);
}

.form-group input::placeholder { color: var(--text-muted); }

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12), var(--shadow-glow-cyan);
    background: rgba(6, 182, 212, 0.05);
}

.form-inline {
    display: flex; gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-inline input[type="date"] {
    padding: 12px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-smooth);
}

.form-inline input[type="date"]:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);
}

.form-inline input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* === Buttons === */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px; font-weight: 600;
    cursor: pointer; border: none;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-smooth);
    position: relative; overflow: hidden;
    letter-spacing: 0.01em;
}

.btn::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::after { opacity: 1; }

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 12px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--border-glass-hover);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

/* === Modal === */
.modal {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    max-width: 640px; width: 92%;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.3s ease;
}

.modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-glass);
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.modal-header h3 {
    font-size: 18px; font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer; border: none; background: none;
    line-height: 1;
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.modal-body { padding: 28px; }
.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--border-glass);
    display: flex; justify-content: flex-end; gap: 12px;
    background: rgba(255, 255, 255, 0.02);
}

/* === Camera === */
#video {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

.camera-status {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.face-status {
    text-align: center;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-top: 12px;
    font-size: 14px;
    font-weight: 500;
}

.face-detected {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.face-not-detected {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* === Animations === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Staggered card animations */
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

/* === Login Page === */
.login-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15), transparent 70%);
    top: -100px; right: -100px;
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12), transparent 70%);
    bottom: -80px; left: -80px;
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%; max-width: 440px;
    position: relative; z-index: 1;
    animation: scaleIn 0.5s ease, borderBreath 8s infinite ease-in-out;
    box-shadow: var(--shadow-lg);
}

@keyframes borderBreath {
    0% { border-color: var(--border-glass); box-shadow: var(--shadow-lg); }
    50% { border-color: rgba(6, 182, 212, 0.25); box-shadow: 0 8px 32px 0 rgba(6, 182, 212, 0.08); }
    100% { border-color: var(--border-glass); box-shadow: var(--shadow-lg); }
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 50%; transform: translateX(-50%);
    width: 60%; height: 3px;
    background: var(--gradient-primary);
    border-radius: 0 0 3px 3px;
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo {
    width: 64px; height: 64px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-glow-cyan);
    animation: float 4s ease-in-out infinite;
}

.login-header h1 {
    font-size: 24px; font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.login-header p {
    color: var(--text-muted);
    margin-top: 8px; font-size: 14px;
}

.login-form { display: flex; flex-direction: column; gap: 20px; }

.login-input-group { position: relative; }

.login-input-group label {
    display: block;
    font-size: 13px; font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.login-input-group input {
    width: 100%; padding: 14px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-smooth);
}

.login-input-group input::placeholder { color: var(--text-muted); }

.login-input-group input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12), var(--shadow-glow-cyan);
    background: rgba(6, 182, 212, 0.05);
}

.login-btn {
    width: 100%; padding: 14px;
    background: var(--gradient-primary);
    color: white;
    border: none; border-radius: var(--radius-md);
    font-size: 15px; font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
    position: relative; overflow: hidden;
    margin-top: 4px;
    letter-spacing: 0.02em;
}

.login-btn::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(6, 182, 212, 0.4);
}

.login-btn:hover::after { opacity: 1; }
.login-btn:active { transform: translateY(0); }

.login-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px; font-weight: 500;
    text-align: center;
    animation: slideDown 0.3s ease;
}

/* === Scanner Page (public/index.php) === */
.scanner-wrapper {
    min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.scanner-header {
    text-align: center;
    margin-bottom: 32px;
    z-index: 10;
    animation: fadeInUp 0.6s ease;
}

.scanner-header h1 {
    font-size: 28px; font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.scanner-header .school-name {
    color: var(--text-secondary);
    font-size: 14px; margin-top: 4px;
    font-weight: 500;
}

.scanner-header .clock {
    color: var(--text-muted);
    font-size: 13px; margin-top: 12px;
    font-weight: 400;
}

.scanner-container {
    position: relative;
    width: 100%; max-width: 640px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 2px solid var(--border-glass);
    box-shadow: var(--shadow-lg), var(--shadow-glow-cyan);
    animation: fadeInUp 0.8s ease;
    background: #000;
}

.scanner-container::before {
    content: '';
    position: absolute; inset: -2px;
    border-radius: var(--radius-xl);
    background: var(--gradient-primary);
    z-index: -1;
    opacity: 0.5;
    animation: borderGlow 3s ease-in-out infinite alternate;
}

@keyframes borderGlow {
    0% { opacity: 0.3; }
    100% { opacity: 0.7; }
}

.scanner-video {
    width: 100%; display: block;
    background: #000;
}

.scan-line {
    position: absolute; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    box-shadow: 0 0 20px var(--accent-cyan), 0 0 40px rgba(6, 182, 212, 0.3);
    animation: scan 2.5s linear infinite;
    pointer-events: none; z-index: 2;
}

@keyframes scan {
    0% { top: 0; }
    50% { top: calc(100% - 3px); }
    100% { top: 0; }
}

.corner {
    position: absolute;
    width: 30px; height: 30px;
    border-color: var(--accent-cyan);
    border-style: solid;
    pointer-events: none; z-index: 2;
    filter: drop-shadow(0 0 6px rgba(6, 182, 212, 0.5));
}

.corner-tl { top: 16px; left: 16px; border-width: 3px 0 0 3px; border-radius: 6px 0 0 0; }
.corner-tr { top: 16px; right: 16px; border-width: 3px 3px 0 0; border-radius: 0 6px 0 0; }
.corner-bl { bottom: 16px; left: 16px; border-width: 0 0 3px 3px; border-radius: 0 0 0 6px; }
.corner-br { bottom: 16px; right: 16px; border-width: 0 3px 3px 0; border-radius: 0 0 6px 0; }

.scanner-status {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    text-align: center;
    color: white; font-size: 13px; font-weight: 500;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 40px 16px 16px;
    z-index: 3;
}

/* Result Popup */
.result-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
}

.result-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.result-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    text-align: center;
    max-width: 420px; width: 90%;
    animation: scaleIn 0.3s ease;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-success);
}

.result-icon {
    font-size: 56px; margin-bottom: 16px;
    animation: float 2s ease-in-out infinite;
}

.result-title {
    font-size: 22px; font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.result-name {
    font-size: 16px; color: var(--accent-cyan);
    font-weight: 600;
}

.result-detail {
    color: var(--text-secondary);
    font-size: 14px; margin-top: 2px;
}

.result-time {
    color: var(--text-muted);
    font-size: 13px; margin-top: 16px;
}

.result-btn {
    margin-top: 28px;
    padding: 12px 32px;
    background: var(--gradient-primary);
    color: white; border: none;
    border-radius: var(--radius-md);
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.3);
}

.result-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(6, 182, 212, 0.4);
}

/* === Utility === */
.text-center { text-align: center; }
.text-gray-500 { color: var(--text-muted); }
.py-8 { padding-top: 32px; padding-bottom: 32px; }

.two-col-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

/* === Responsive === */
@media (max-width: 768px) {
    .two-col-grid { grid-template-columns: 1fr; }
    .sidebar-toggle { display: flex; }

    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .admin-main {
        margin-left: 0;
        padding: 24px 16px;
        padding-top: 72px;
    }

    .page-header h1 { font-size: 24px; }

    .stats-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }

    .stat-card { padding: 18px; }
    .stat-number { font-size: 24px; }

    .login-card { padding: 36px 24px; }

    .scanner-header h1 { font-size: 22px; }

    .btn { padding: 10px 18px; }
    .data-table { font-size: 13px; }
    .data-table th, .data-table td { padding: 10px 12px; }
}

@media (max-width: 480px) {
    .admin-main { padding: 16px 12px; padding-top: 68px; }
    .card { padding: 20px; }
    .page-header h1 { font-size: 20px; }
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* === Selection === */
::selection {
    background: rgba(6, 182, 212, 0.3);
    color: white;
}

/* Badge Warning & Custom Select Badge */
.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.stat-card.stat-warning::before {
    background: linear-gradient(135deg, var(--accent-amber), var(--accent-red));
}
.stat-card.stat-warning:hover {
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
}

select.select-badge {
    padding-right: 24px;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%2394a3b8' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: calc(100% - 4px) 50%;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 20px;
    font-family: inherit;
    font-weight: 600;
}

select.select-badge option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* Background Glowing Orbs Container */
.bg-glow-container {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.2;
    mix-blend-mode: screen;
    animation: floatBlob 25s infinite alternate ease-in-out;
}

.blob-1 {
    width: 550px; height: 550px;
    background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
    top: -10%; left: 5%;
}

.blob-2 {
    width: 650px; height: 650px;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
    bottom: -10%; right: 5%;
    animation-delay: -7s;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(80px, 40px) scale(1.15); }
    100% { transform: translate(-40px, 80px) scale(0.9); }
}

/* Custom School Logo Styles */
.login-logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    padding: 10px;
    box-shadow: var(--shadow-glow-cyan);
    display: block;
    margin-left: auto;
    margin-right: auto;
    animation: float 4s ease-in-out infinite;
}

.sidebar-logo-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Live Activity Feed Styles */
.live-feed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

.feed-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(15px);
}

.feed-item.slide-in {
    opacity: 1;
    transform: translateY(0);
    animation: slideInFeed 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.feed-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.08);
}

.feed-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(6, 182, 212, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.feed-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feed-info {
    flex: 1;
    min-width: 0;
}

.feed-name {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-meta {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.feed-time-status {
    text-align: right;
    flex-shrink: 0;
}

.feed-time {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-cyan);
    margin-bottom: 3px;
}

@keyframes slideInFeed {
    from {
        opacity: 0;
        transform: translateY(15px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}



