/* ================================================
   Face Recognition T&A System — Premium Dark Theme
   ================================================ */

/* ---- CSS Variables (Design Tokens) ---- */
:root {
    /* Colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a1f35;
    --bg-card-hover: #1e2440;
    --bg-input: #0d1225;
    --bg-overlay: rgba(0, 0, 0, 0.7);

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

    --border-color: rgba(148, 163, 184, 0.1);
    --border-color-hover: rgba(148, 163, 184, 0.2);

    /* Accent Colors */
    --accent-blue: #3b82f6;
    --accent-blue-light: #60a5fa;
    --accent-green: #10b981;
    --accent-green-light: #34d399;
    --accent-red: #ef4444;
    --accent-red-light: #f87171;
    --accent-purple: #8b5cf6;
    --accent-purple-light: #a78bfa;
    --accent-orange: #f59e0b;
    --accent-orange-light: #fbbf24;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;

    /* Gradients */
    --gradient-blue: linear-gradient(135deg, #3b82f6, #1d4ed8);
    --gradient-green: linear-gradient(135deg, #10b981, #047857);
    --gradient-red: linear-gradient(135deg, #ef4444, #b91c1c);
    --gradient-purple: linear-gradient(135deg, #8b5cf6, #6d28d9);
    --gradient-orange: linear-gradient(135deg, #f59e0b, #d97706);
    --gradient-mesh: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-sidebar: linear-gradient(180deg, #111827 0%, #0a0e1a 100%);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.3);
    --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.3);
    --shadow-glow-red: 0 0 20px rgba(239, 68, 68, 0.3);
    --shadow-glow-purple: 0 0 20px rgba(139, 92, 246, 0.3);

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 70px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

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

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color-hover);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ================================================
   SIDEBAR
   ================================================ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--gradient-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-normal);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-mesh);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow-purple);
}

.logo-icon .material-symbols-rounded {
    font-size: 24px;
    color: white;
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #f1f5f9, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.logo-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.sidebar.collapsed .logo-text {
    display: none;
}

/* Nav Links */
.nav-links {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--gradient-mesh);
    border-radius: 0 3px 3px 0;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-purple-light);
}

.nav-link.active::before {
    opacity: 1;
}

.nav-link .material-symbols-rounded {
    font-size: 22px;
    flex-shrink: 0;
}

.sidebar.collapsed .nav-link span:last-child {
    display: none;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    animation: pulse-dot 2s infinite;
}

.status-dot.offline {
    background: var(--accent-red);
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.current-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.sidebar.collapsed .sidebar-footer span,
.sidebar.collapsed .current-time {
    display: none;
}

/* ================================================
   MAIN CONTENT
   ================================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-normal);
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed);
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 16px;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.topbar-title {
    flex: 1;
}

.topbar-title h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.page-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.date-display {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

/* Page Content */
.page-content {
    padding: 28px;
}

/* ================================================
   CARDS
   ================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-color-hover);
}

.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.card-header h3 .material-symbols-rounded {
    font-size: 20px;
    color: var(--accent-purple-light);
}

.card-body {
    padding: 22px;
}

/* ================================================
   STATS CARDS
   ================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stats-grid.small {
    margin-bottom: 20px;
}

.stat-card {
    border-radius: var(--border-radius-lg);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: default;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    opacity: 0.12;
    border-radius: inherit;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
}

.stat-card:hover {
    transform: translateY(-3px);
}

.gradient-blue {
    background: var(--gradient-blue);
    box-shadow: var(--shadow-glow-blue);
}

.gradient-green {
    background: var(--gradient-green);
    box-shadow: var(--shadow-glow-green);
}

.gradient-red {
    background: var(--gradient-red);
    box-shadow: var(--shadow-glow-red);
}

.gradient-purple {
    background: var(--gradient-purple);
    box-shadow: var(--shadow-glow-purple);
}

.gradient-orange {
    background: var(--gradient-orange);
}

.stat-icon {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.stat-icon .material-symbols-rounded {
    font-size: 26px;
    color: white;
}

.stat-info {
    position: relative;
    z-index: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
    display: block;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.stat-card.mini {
    padding: 16px 20px;
}

.stat-card.mini .stat-value {
    font-size: 1.4rem;
}

.stat-trend {
    margin-left: auto;
    position: relative;
    z-index: 1;
    opacity: 0.6;
}

.stat-trend .material-symbols-rounded {
    font-size: 28px;
    color: white;
}

/* ================================================
   DASHBOARD GRID
   ================================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.chart-card .card-body {
    padding: 16px 20px 20px;
}

.chart-body-doughnut {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 4px;
    border-radius: var(--border-radius-sm);
    transition: background var(--transition-fast);
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.activity-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gradient-mesh);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    overflow: hidden;
}

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

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

.activity-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.activity-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.activity-time {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ================================================
   BUTTONS
   ================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-family);
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn .material-symbols-rounded {
    font-size: 18px;
}

.btn-primary {
    background: var(--gradient-mesh);
    color: white;
    box-shadow: var(--shadow-glow-purple);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-color-hover);
}

.btn-success {
    background: var(--gradient-green);
    color: white;
    box-shadow: var(--shadow-glow-green);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: var(--gradient-red);
    color: white;
}

.btn-danger:hover {
    box-shadow: var(--shadow-glow-red);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.pulse-btn {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: var(--shadow-glow-green);
    }

    50% {
        box-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
    }
}

/* ================================================
   FORMS
   ================================================ */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

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

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.required {
    color: var(--accent-red);
}

.form-group input,
.form-group select {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

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

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* ================================================
   CAMERA
   ================================================ */
.camera-section {
    margin-top: 8px;
    margin-bottom: 16px;
}

.camera-section>label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 8px;
}

.camera-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 4/3;
    background: var(--bg-input);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 12px;
}

.camera-container video,
.camera-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.face-guide {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.face-oval {
    width: 160px;
    height: 200px;
    border: 2px solid rgba(139, 92, 246, 0.5);
    border-radius: 50%;
    animation: oval-pulse 3s infinite;
}

@keyframes oval-pulse {

    0%,
    100% {
        border-color: rgba(139, 92, 246, 0.5);
    }

    50% {
        border-color: rgba(139, 92, 246, 0.9);
    }
}

.face-guide span {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 12px;
    border-radius: 20px;
}

.camera-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---- Image Upload Section ---- */
.upload-drop-zone {
    position: relative;
    width: 100%;
    max-width: 480px;
    min-height: 200px;
    background: var(--bg-input);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.upload-drop-zone:hover {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.04);
}

.upload-drop-zone.drag-over {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
    transform: scale(1.01);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 20px;
    text-align: center;
}

.upload-placeholder .material-symbols-rounded {
    font-size: 48px;
    color: var(--accent-purple);
    opacity: 0.6;
}

.upload-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.upload-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.upload-drop-zone img {
    width: 100%;
    height: 100%;
    max-height: 320px;
    object-fit: contain;
    padding: 8px;
}

.upload-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

/* ---- Zoom Controls ---- */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    margin-bottom: 8px;
    max-width: 480px;
}

.zoom-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--border-color);
    border-radius: 4px;
    outline: none;
    transition: background var(--transition-fast);
}

.zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-purple);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.zoom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.6);
}

.zoom-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-purple);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

.zoom-btn {
    padding: 4px !important;
    border-radius: 50% !important;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid var(--border-color) !important;
}

.zoom-btn:hover {
    background: rgba(139, 92, 246, 0.15) !important;
    border-color: var(--accent-purple) !important;
}

.zoom-value {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-purple-light);
    min-width: 38px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ================================================
   FACE QUALITY PANEL (Enrollment)
   ================================================ */
.face-quality-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    max-width: 480px;
    margin-bottom: 10px;
}

.quality-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.quality-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease, background 0.3s ease;
}

.quality-bar-fill.quality-none {
    background: var(--border-color);
}

.quality-bar-fill.quality-fair {
    background: var(--accent-orange);
}

.quality-bar-fill.quality-good {
    background: var(--accent-blue);
}

.quality-bar-fill.quality-excellent {
    background: var(--accent-green);
}

.quality-checks {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.quality-check-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.quality-check-icon {
    font-size: 18px;
    transition: color 0.2s ease;
}

.quality-check-icon.check-pass {
    color: var(--accent-green) !important;
}

.quality-check-icon.check-fail {
    color: var(--accent-red) !important;
}

.quality-score-badge {
    margin-left: auto;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--accent-purple-light);
    background: rgba(139, 92, 246, 0.12);
    padding: 2px 10px;
    border-radius: 12px;
    font-variant-numeric: tabular-nums;
}

.quality-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    min-height: 1.2em;
}

.auto-capture-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
    overflow: hidden;
}

.auto-capture-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-green));
    border-radius: 2px;
    transition: width 0.2s linear;
}

/* Face oval state colors */
.face-oval.oval-no-face {
    border-color: rgba(239, 68, 68, 0.5);
}

.face-oval.oval-fair {
    border-color: rgba(251, 146, 60, 0.7);
    animation: facePulse 1.5s ease-in-out infinite;
}

.face-oval.oval-good {
    border-color: rgba(59, 130, 246, 0.8);
}

.face-oval.oval-excellent {
    border-color: rgba(34, 197, 94, 0.9);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

/* ================================================
   BACKGROUND ATTENDANCE CONTROLS
   ================================================ */
.bg-attendance-card .card-body {
    padding-top: 12px;
}

.bg-control-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 10px;
}

.bg-control-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bg-control-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bg-control-group select {
    padding: 6px 10px;
    font-size: 0.82rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
}

.bg-action-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-success {
    background: var(--accent-green);
    color: #fff;
    border: none;
}

.btn-success:hover {
    background: var(--accent-green-light);
    transform: translateY(-1px);
}

.bg-schedule-section {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: 4px;
}

.time-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.time-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.time-input-group label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.time-input-group input[type="time"] {
    padding: 6px 8px;
    font-size: 0.82rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.time-separator {
    font-size: 1.1rem;
    color: var(--text-muted);
    padding-bottom: 6px;
}

.bg-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.bg-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.bg-stat-item .material-symbols-rounded {
    font-size: 16px;
    color: var(--accent-purple-light);
}

.bg-stat-item strong {
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

/* Badge variants */
.badge-green {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-green-light);
}

.badge-orange {
    background: rgba(251, 146, 60, 0.2);
    color: var(--accent-orange-light);
}

/* Camera Preview (Attendance) */
.camera-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    background: var(--bg-input);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.camera-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
}

.camera-placeholder .material-symbols-rounded {
    font-size: 48px;
    opacity: 0.4;
}

.recognition-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: none;
}

.recognition-overlay.active {
    display: block;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    animation: scan 2.5s linear infinite;
    box-shadow: 0 0 15px var(--accent-cyan);
}

@keyframes scan {
    0% {
        top: 0;
    }

    100% {
        top: 100%;
    }
}

.camera-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Recognition Result */
.recognition-result {
    margin-top: 16px;
    padding: 20px;
    background: var(--bg-input);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-success {
    border-color: rgba(16, 185, 129, 0.3);
}

.result-failure {
    border-color: rgba(239, 68, 68, 0.3);
}

.result-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.result-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.result-icon.failure {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.result-icon .material-symbols-rounded {
    font-size: 30px;
}

.result-info h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.result-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.result-confidence {
    margin-left: auto;
    text-align: center;
}

.confidence-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent-green);
}

.confidence-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Attendance Controls */
.attendance-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ================================================
   TABLES
   ================================================ */
.attendance-table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 12px 16px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(148, 163, 184, 0.05);
}

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

.data-table tbody tr:hover:not(.empty-row) {
    background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.status-present {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-green-light);
}

.status-late {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-orange-light);
}

.status-absent {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red-light);
}

/* Empty State Inline */
.empty-state-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    color: var(--text-muted);
}

.empty-state-inline .material-symbols-rounded {
    font-size: 22px;
    opacity: 0.5;
}

/* ================================================
   ENROLLMENT LAYOUT
   ================================================ */
.enrollment-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

/* Enrolled Students Grid */
.students-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 600px;
    overflow-y: auto;
}

.student-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.student-card:hover {
    border-color: var(--border-color-hover);
    background: var(--bg-card-hover);
}

.student-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gradient-mesh);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

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

.student-details {
    flex: 1;
    min-width: 0;
}

.student-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.student-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.student-actions {
    display: flex;
    gap: 4px;
}

.student-actions .btn {
    padding: 6px;
    border-radius: 6px;
}

.student-actions .btn .material-symbols-rounded {
    font-size: 16px;
}

/* Badge */
.badge {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-purple-light);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-left: 4px;
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 6px 12px;
    transition: all var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.search-box .material-symbols-rounded {
    font-size: 18px;
    color: var(--text-muted);
}

.search-box input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.85rem;
    outline: none;
    width: 160px;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* ================================================
   ATTENDANCE LAYOUT
   ================================================ */
.attendance-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    align-items: start;
}

/* ================================================
   UNKNOWN FACES
   ================================================ */
.badge-red {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red-light);
}

.unknown-faces-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.unknown-face-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.unknown-face-card:hover {
    border-color: rgba(239, 68, 68, 0.3);
    background: var(--bg-card-hover);
}

.unknown-face-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(239, 68, 68, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.unknown-face-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.unknown-face-photo .material-symbols-rounded {
    font-size: 24px;
    color: var(--accent-red);
    opacity: 0.6;
}

.unknown-face-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.unknown-face-id {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.unknown-face-meta {
    font-size: 0.75rem;
    color: var(--accent-orange-light);
    font-weight: 600;
}

.unknown-face-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.unknown-face-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.unknown-face-actions .btn {
    padding: 6px;
    border-radius: 6px;
}

.unknown-face-actions .btn .material-symbols-rounded {
    font-size: 16px;
}

/* Enroll Unknown Modal */
.enroll-unknown-modal {
    max-width: 480px;
    width: 100%;
}

.enroll-modal-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 12px 0 16px;
}

.enroll-modal-id {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent-purple-light);
    background: rgba(139, 92, 246, 0.12);
    padding: 2px 12px;
    border-radius: 12px;
}

/* ================================================
   REPORTS / FILTERS
   ================================================ */
.filter-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-row .form-group {
    min-width: 140px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    flex-direction: row !important;
    align-items: center !important;
}

.record-count {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ================================================
   MODAL
   ================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.modal-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.modal-icon .material-symbols-rounded {
    font-size: 30px;
}

.modal h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ================================================
   TOAST NOTIFICATIONS
   ================================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 420px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left: 3px solid var(--accent-green);
}

.toast-error {
    border-left: 3px solid var(--accent-red);
}

.toast-warning {
    border-left: 3px solid var(--accent-orange);
}

.toast-info {
    border-left: 3px solid var(--accent-blue);
}

.toast-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    color: var(--accent-green);
}

.toast-error .toast-icon {
    color: var(--accent-red);
}

.toast-warning .toast-icon {
    color: var(--accent-orange);
}

.toast-info .toast-icon {
    color: var(--accent-blue);
}

.toast-message {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: flex;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-close .material-symbols-rounded {
    font-size: 18px;
}

/* ================================================
   LOADING
   ================================================ */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Processing overlay */
.processing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: inherit;
    z-index: 10;
}

.processing-overlay .spinner {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

.processing-overlay span {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ================================================
   REAL-TIME DETECTION & SETTINGS
   ================================================ */

/* Right Column layout */
.attendance-right-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Face Overlay Canvas */
.face-overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    display: none;
}

/* Live Detection Badge */
.live-detection-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(239, 68, 68, 0.9);
    border-radius: 20px;
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    backdrop-filter: blur(6px);
}

.live-pulse {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}

/* Auto Detect Button States */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
    border-color: #d97706 !important;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
}

.btn-auto-inactive {
    background: var(--bg-input) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

/* Settings Card */
.settings-card .card-header {
    border-bottom: 1px solid var(--border-color);
}

.settings-body {
    display: block;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-info label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.setting-info small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.setting-value {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent-purple-light);
    min-width: 38px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.setting-actions {
    justify-content: flex-end;
    padding-top: 10px;
}

/* Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 140px;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-purple);
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.4);
    transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent-purple);
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    border-radius: 26px;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(22px);
}

/* Schedule Time Range */
.schedule-time-range {
    padding: 14px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.time-input-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.time-input-group {
    flex: 1;
}

.time-input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.time-input-group input[type="time"] {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
    outline: none;
    transition: border-color var(--transition-fast);
}

.time-input-group input[type="time"]:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.time-separator {
    color: var(--text-muted);
    font-size: 1.2rem;
    padding-bottom: 8px;
}

.schedule-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.78rem;
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-muted);
}

.schedule-status .material-symbols-rounded {
    font-size: 16px;
}

.schedule-active {
    background: rgba(16, 185, 129, 0.1) !important;
    color: var(--accent-green) !important;
}

.schedule-inactive {
    background: rgba(245, 158, 11, 0.1) !important;
    color: var(--accent-orange) !important;
}

/* Detected Faces Live Panel */
.detected-faces-live {
    margin-top: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.detected-faces-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(148, 163, 184, 0.05);
    border-bottom: 1px solid var(--border-color);
}

.detected-faces-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

.detected-faces-header h4 .material-symbols-rounded {
    font-size: 18px;
}

.scan-fps {
    font-size: 0.72rem;
    font-family: 'SF Mono', 'Consolas', monospace;
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.detected-faces-list {
    padding: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.detected-face-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 4px;
    transition: background var(--transition-fast);
}

.detected-face-item:last-child {
    margin-bottom: 0;
}

.detected-face-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.detected-face-icon .material-symbols-rounded {
    font-size: 18px;
}

.face-matched .detected-face-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.face-low .detected-face-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.face-unknown .detected-face-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

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

.detected-face-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.detected-face-status {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.detected-face-confidence {
    font-size: 0.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.face-matched .detected-face-confidence {
    color: var(--accent-green);
}

.face-low .detected-face-confidence {
    color: var(--accent-orange);
}

.face-unknown .detected-face-confidence {
    color: var(--text-muted);
}

.no-faces-msg {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ================================================
   CAMERA MANAGEMENT
   ================================================ */
.cameras-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    align-items: start;
}

/* Camera Type Selector */
.camera-type-selector {
    margin-bottom: 20px;
}

.camera-type-selector>label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 10px;
}

.type-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.type-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
}

.type-option:hover {
    border-color: var(--border-color-hover);
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.type-option.active {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.08);
    color: var(--accent-purple-light);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.type-option .material-symbols-rounded {
    font-size: 26px;
}

/* RTSP Preview */
.rtsp-preview {
    margin-bottom: 20px;
}

.rtsp-preview>label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 6px;
}

.rtsp-url-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

.rtsp-url-display code {
    flex: 1;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    color: var(--accent-cyan);
    word-break: break-all;
    line-height: 1.5;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* Camera Card Items */
.cameras-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 600px;
    overflow-y: auto;
}

.camera-card-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.camera-card-item:hover {
    border-color: var(--border-color-hover);
    background: var(--bg-card-hover);
}

.camera-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-sm);
    background: rgba(6, 182, 212, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.camera-card-icon .material-symbols-rounded {
    font-size: 24px;
    color: var(--accent-cyan);
}

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

.camera-card-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.camera-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.camera-type-badge {
    display: inline-flex;
    padding: 1px 8px;
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-purple-light);
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
}

.camera-card-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.camera-card-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.camera-card-actions .btn {
    padding: 6px;
    border-radius: 6px;
}

.camera-card-actions .btn .material-symbols-rounded {
    font-size: 16px;
}

/* Camera Source Selector (Enrollment & Attendance) */
.camera-source-selector {
    margin-bottom: 4px;
}

.camera-source-selector select,
.camera-source-inline select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.88rem;
    transition: all var(--transition-fast);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.camera-source-selector select:focus,
.camera-source-inline select:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.camera-source-selector select option,
.camera-source-inline select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px;
}

.camera-source-selector select optgroup,
.camera-source-inline select optgroup {
    color: var(--text-muted);
    font-weight: 600;
    font-style: normal;
}

.camera-source-inline {
    min-width: 200px;
}

.camera-source-inline select {
    padding: 7px 12px;
    font-size: 0.82rem;
    padding-right: 28px;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1200px) {

    .enrollment-layout,
    .attendance-layout,
    .cameras-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .type-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .sidebar .logo-text,
    .sidebar .nav-link span:last-child,
    .sidebar .sidebar-footer span,
    .sidebar .current-time {
        display: none;
    }

    .main-content {
        margin-left: var(--sidebar-collapsed);
    }

    .page-content {
        padding: 16px;
    }

    .topbar {
        padding: 0 16px;
    }

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

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

    .filter-row {
        flex-direction: column;
    }

    .filter-row .form-group {
        width: 100%;
    }

    .date-display {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        width: 0;
        border: none;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar.collapsed {
        width: var(--sidebar-collapsed);
    }
}