/* ============================================
   Face Attendance System — Premium Dark Theme
   ============================================ */

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

/* ── CSS Variables ── */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-gradient: linear-gradient(135deg, #8b5cf6, #06b6d4);
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --accent-blue: #3b82f6;
  --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Animated background gradient */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
              radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.04) 0%, transparent 50%);
  animation: bgFloat 20s ease-in-out infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes bgFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(2%, -2%) rotate(1deg); }
  66% { transform: translate(-1%, 1%) rotate(-1deg); }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--accent-purple);
  border-radius: 3px;
}

/* ── Navigation ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 1000;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.navbar-brand .logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.navbar-brand h1 {
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-brand .subtitle {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.nav-links a.active {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.15);
}

.nav-links a.active::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: 3px;
}

.nav-links a .nav-icon {
  font-size: 1.1rem;
}

/* Mobile menu button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
}

/* ── Main Content ── */
.main-content {
  margin-top: 70px;
  padding: 2rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Page Sections ── */
.page-section {
  display: none;
  animation: fadeSlideIn 0.4s ease-out;
}

.page-section.active {
  display: block;
}

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

/* ── Page Header ── */
.page-header {
  margin-bottom: 2rem;
}

.page-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ── Glass Card ── */
.glass-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: 1.5rem;
  transition: var(--transition);
}

.glass-card:hover {
  border-color: rgba(139, 92, 246, 0.2);
  box-shadow: var(--shadow-glow);
}

/* ── Stats Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 4px 0 0 4px;
}

.stat-card.purple::before { background: var(--accent-purple); }
.stat-card.cyan::before { background: var(--accent-cyan); }
.stat-card.green::before { background: var(--accent-green); }
.stat-card.amber::before { background: var(--accent-amber); }

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.2);
  box-shadow: var(--shadow-glow);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.stat-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }

.stat-info h3 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 2px;
}

.stat-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

/* ── Camera Section ── */
.camera-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.camera-feed {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-secondary);
  aspect-ratio: 4/3;
  border: 1px solid var(--border-glass);
}

.camera-feed video,
.camera-feed canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-feed .overlay-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.camera-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--text-muted);
}

.camera-placeholder .cam-icon {
  font-size: 3rem;
  opacity: 0.5;
}

.camera-placeholder p {
  font-size: 0.9rem;
}

/* Camera status badge */
.camera-status {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
}

.camera-status.active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.camera-status.inactive {
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-muted);
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.camera-status.active .status-dot {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* ── Recognition Result Panel ── */
.recognition-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
}

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

.result-card.error {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

.result-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.result-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

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

.result-card .confidence-bar {
  margin-top: 1rem;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.result-card .confidence-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Recent attendance list in sidebar */
.recent-list {
  flex: 1;
  overflow-y: auto;
  max-height: 300px;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  transition: var(--transition);
}

.recent-item:hover {
  background: var(--bg-glass);
}

.recent-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.recent-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

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

.recent-time {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

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

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(139, 92, 246, 0.3);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  background: rgba(16, 185, 129, 0.25);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
}

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

.btn-block {
  width: 100%;
  justify-content: center;
}

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

.btn-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ── Forms ── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

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

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

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ── Registration Section ── */
.register-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.capture-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 1rem;
}

.capture-slot {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}

.capture-slot.filled {
  border-style: solid;
  border-color: var(--accent-green);
}

.capture-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.capture-slot .slot-number {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.capture-progress {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  min-width: 40px;
}

/* ── Table ── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
}

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

.data-table th {
  text-align: left;
  padding: 14px 16px;
  background: rgba(139, 92, 246, 0.08);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-glass);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 0.9rem;
}

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

.data-table tbody tr:hover {
  background: rgba(139, 92, 246, 0.05);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ── User Cards Grid ── */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.user-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.user-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.2);
  box-shadow: var(--shadow-glow);
}

.user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.3);
}

.user-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.user-card .user-id {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.user-card .user-dept {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-purple);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.user-card .user-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-bar .form-control {
  max-width: 250px;
}

.filter-bar .btn {
  margin-left: auto;
}

/* ── Settings ── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

.setting-label h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.setting-label p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Range slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 160px;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-purple);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  top: 85px;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  min-width: 300px;
  max-width: 450px;
  animation: toastIn 0.4s ease-out;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.toast.removing {
  animation: toastOut 0.3s ease-in forwards;
}

.toast-success { border-left: 4px solid var(--accent-green); }
.toast-error { border-left: 4px solid var(--accent-red); }
.toast-info { border-left: 4px solid var(--accent-blue); }
.toast-warning { border-left: 4px solid var(--accent-amber); }

.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-message { font-size: 0.88rem; font-weight: 500; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(50px); }
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  transform: scale(0.9) translateY(20px);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
}

/* ── Loading Spinner ── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  z-index: 99999;
  transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

.loading-progress {
  width: 200px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 2px;
  animation: loadingProgress 2s ease-in-out infinite;
}

@keyframes loadingProgress {
  0% { width: 0%; margin-left: 0; }
  50% { width: 60%; margin-left: 20%; }
  100% { width: 0%; margin-left: 100%; }
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
}

.empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Home Page ── */
.home-hero {
  text-align: center;
  padding: 3rem 0;
}

.home-hero h2 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: var(--shadow-glow);
}

.feature-card .feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.feature-card .feature-icon.purple { background: rgba(139, 92, 246, 0.15); }
.feature-card .feature-icon.cyan { background: rgba(6, 182, 212, 0.15); }
.feature-card .feature-icon.green { background: rgba(16, 185, 129, 0.15); }
.feature-card .feature-icon.amber { background: rgba(245, 158, 11, 0.15); }

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .camera-container {
    grid-template-columns: 1fr;
  }
  .register-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0 1rem;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border-glass);
    transform: translateY(-100%);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-links a {
    padding: 14px 16px;
  }

  .main-content {
    padding: 1.25rem;
  }

  .home-hero h2 {
    font-size: 1.8rem;
  }

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

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar .form-control {
    max-width: 100%;
  }

  .filter-bar .btn {
    margin-left: 0;
  }

  .capture-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

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

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