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

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-dark: #312e81;
  --primary-glow: rgba(79, 70, 229, 0.28);
  
  --secondary: #06b6d4;
  --secondary-hover: #0891b2;
  --secondary-light: #ecfeff;

  --accent: #8b5cf6;
  --accent-light: #f5f3ff;
  --accent-glow: rgba(139, 92, 246, 0.25);

  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;

  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;

  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;

  --bg-main: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.92);
  --border-color: #e2e8f0;
  --border-focus: #818cf8;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.08), 0 6px 16px -4px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 25px rgba(79, 70, 229, 0.18);

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(139, 92, 246, 0.05) 0px, transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
  position: relative;
}

/* Subtle Animated Ambient Gradient Orbs */
body::before {
  content: '';
  position: fixed;
  top: -120px;
  right: -100px;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.12) 0%, rgba(6, 182, 212, 0.02) 70%, transparent 100%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  bottom: -150px;
  left: -120px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, rgba(16, 185, 129, 0.02) 70%, transparent 100%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  animation: floatOrb 22s ease-in-out infinite alternate-reverse;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
  100% { transform: translate(-20px, 40px) scale(0.95); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.85rem 1.75rem;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.brand-logo:hover {
  transform: scale(1.02);
}

.brand-logo-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(2, 132, 199, 0.25));
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-logo:hover .brand-logo-icon {
  transform: rotate(4deg) scale(1.06);
}

.brand-name-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name-main {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.4px;
}

.brand-name-accent {
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-name-sub {
  font-size: 0.64rem;
  font-weight: 700;
  color: #0284c7;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.brand-badge {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.15);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.85rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.user-profile-badge:hover {
  border-color: var(--border-focus);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary);
  overflow: hidden;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-xs);
}

/* Modern Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  user-select: none;
  letter-spacing: -0.01em;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: skewX(-20deg);
  transition: 0.6s ease;
}

.btn:hover::before {
  left: 150%;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  box-shadow: 0 4px 14px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff;
  border-color: var(--border-color);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--bg-main);
  border-color: #cbd5e1;
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

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

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  border-radius: var(--radius-xs);
}

.btn-lg {
  padding: 0.75rem 1.6rem;
  font-size: 0.98rem;
  border-radius: var(--radius-md);
  font-weight: 600;
}

/* Main Container */
.main-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Sleek Glass Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  position: relative;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.card.interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -6px rgba(79, 70, 229, 0.1), var(--shadow-md);
  border-color: rgba(79, 70, 229, 0.25);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

/* Metric Cards Grid - Sleek SaaS Style */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.metric-card:hover .metric-icon {
  transform: scale(1.06);
}

.metric-value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
}

.metric-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Badges - Subtle, Crisp */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-primary { background: var(--primary-light); color: var(--primary); border: 1px solid #c7d2fe; }
.badge-success { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
.badge-danger  { background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-border); }
.badge-secondary { background: #f1f5f9; color: var(--text-muted); border: 1px solid #e2e8f0; }

/* Radar Ping Indicator */
.radar-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.radar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  position: relative;
}

.radar-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--success);
  opacity: 0.6;
  animation: radarPing 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes radarPing {
  0% { transform: scale(0.9); opacity: 0.8; }
  80% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Tables - Sleek & High-Density */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #ffffff;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.custom-table th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
  vertical-align: middle;
  transition: background 0.15s ease;
}

.custom-table tbody tr:hover td {
  background: rgba(248, 250, 252, 0.95);
}

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

/* Form Controls - Crisp & Modern */
.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.62rem 0.9rem;
  font-size: 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  font-family: var(--font-sans);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* Modals with Smooth Spring Animation */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  animation: modalScaleIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 1.35rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 10;
}

.modal-body {
  padding: 1.75rem;
}

.modal-footer {
  padding: 1.15rem 1.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #f8fafc;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.close-btn {
  background: #f1f5f9;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.close-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
  transform: rotate(90deg);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text-main);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.16), 0 4px 8px -2px rgba(0, 0, 0, 0.06);
  border-left: 4px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 320px;
  max-width: 480px;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 600;
  font-size: 0.92rem;
  border-top: 1px solid rgba(255,255,255,0.8);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Camera Viewfinder & Cyberpunk Scanner HUD */
.camera-box {
  width: 100%;
  aspect-ratio: 4/3;
  background: #0f172a;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  border: 2px solid rgba(79, 70, 229, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.7), 0 8px 24px rgba(0,0,0,0.2);
}

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

/* High-tech Viewfinder Overlay Reticle */
.viewfinder-hud {
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  pointer-events: none;
  z-index: 5;
}

.viewfinder-hud::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px;
  width: 28px; height: 28px;
  border-top: 3px solid var(--secondary);
  border-left: 3px solid var(--secondary);
}

.viewfinder-hud::after {
  content: '';
  position: absolute;
  bottom: -2px; right: -2px;
  width: 28px; height: 28px;
  border-bottom: 3px solid var(--secondary);
  border-right: 3px solid var(--secondary);
}

.viewfinder-corner-tr {
  position: absolute;
  top: -2px; right: -2px;
  width: 28px; height: 28px;
  border-top: 3px solid var(--secondary);
  border-right: 3px solid var(--secondary);
}

.viewfinder-corner-bl {
  position: absolute;
  bottom: -2px; left: -2px;
  width: 28px; height: 28px;
  border-bottom: 3px solid var(--secondary);
  border-left: 3px solid var(--secondary);
}

/* High-tech Scanning Laser */
.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #06b6d4, #3b82f6, #06b6d4, transparent);
  box-shadow: 0 0 18px #06b6d4, 0 0 8px #3b82f6;
  animation: laserScan 2.4s infinite ease-in-out;
  pointer-events: none;
  z-index: 10;
}

@keyframes laserScan {
  0% { top: 6%; opacity: 0.3; }
  50% { top: 92%; opacity: 1; }
  100% { top: 6%; opacity: 0.3; }
}

/* Shutter Flash Animation */
.shutter-flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
}

.flash-active {
  animation: flashAnim 0.35s ease-out;
}

@keyframes flashAnim {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

/* Interactive Leaflet Map Container */
#adminAttendanceMap, #gpsPunchMiniMap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}

.map-custom-marker {
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-radar-pin {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  position: relative;
}

.map-radar-pin::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.5;
  animation: radarPing 2s infinite;
}

/* QR Code Preview Box */
.qr-preview-box {
  background: #ffffff;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 2px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

/* SVG Circular Countdown Ring */
.svg-countdown-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.svg-countdown-circle {
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 1s linear;
}

/* Side-by-side Profile Diff Highlight */
.diff-badge-old {
  background: #fef2f2;
  color: #991b1b;
  text-decoration: line-through;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
}

.diff-badge-new {
  background: #ecfdf5;
  color: #065f46;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
}

/* Canvas Confetti Layer */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10000;
}

/* Official Printable Payslip Voucher */
.payslip-container {
  padding: 2.5rem;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  max-width: 800px;
  margin: 0 auto;
}

.payslip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
}

.payslip-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.payslip-table th, .payslip-table td {
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  font-size: 0.9rem;
}

.payslip-table th {
  background: #f8fafc;
  font-weight: 700;
}

.payslip-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 5rem;
  font-weight: 900;
  color: rgba(79, 70, 229, 0.04);
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 10px;
}

/* Print Stylesheet */
@media print {
  body {
    background: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
  }
  body::before, body::after, .navbar, .btn, #navUserArea, #toast-container, .modal-footer, .nav-menu, #confettiCanvas {
    display: none !important;
  }
  .main-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .modal-overlay {
    position: static !important;
    display: block !important;
    background: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
  }
  .modal-content {
    box-shadow: none !important;
    max-width: 100% !important;
    border: none !important;
  }
  .payslip-container {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }
}

/* Premium Segmented Control & Role Switcher */
.role-segmented-control {
  display: flex;
  background: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 0.25rem;
  gap: 0.25rem;
  margin-bottom: 1.35rem;
  border: 1px solid rgba(226, 232, 240, 0.85);
  position: relative;
}

.role-segment-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.role-segment-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.6);
}

.role-segment-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
}

.role-segment-btn.active.admin-mode {
  color: #4f46e5;
}

.role-segment-btn.active.employee-mode {
  color: #059669;
}

/* Password Input Group with Toggle */
.password-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-group .form-control {
  padding-right: 2.5rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.65rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  transition: color 0.15s ease;
}

.password-toggle-btn:hover {
  color: var(--primary);
}

/* Quick Credential Chips */
.quick-cred-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.quick-cred-chip:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.08);
}

.quick-cred-chip:active {
  transform: translateY(0);
}

/* Modern Feature & Module Cards */
.feature-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: var(--radius-lg);
  padding: 1.65rem 1.6rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, linear-gradient(90deg, var(--primary), var(--secondary)));
  border-radius: 999px 999px 0 0;
  transition: height 0.25s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -6px rgba(15, 23, 42, 0.08), 0 4px 10px rgba(0, 0, 0, 0.03);
  border-color: rgba(99, 102, 241, 0.3);
}

.feature-card:hover::before {
  height: 4px;
}

.feature-icon-wrapper {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.15rem;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.feature-card:hover .feature-icon-wrapper {
  transform: scale(1.08) rotate(2deg);
}

.module-onboarding { --card-accent: linear-gradient(90deg, #4f46e5, #818cf8); }
.module-qr         { --card-accent: linear-gradient(90deg, #10b981, #34d399); }
.module-gps        { --card-accent: linear-gradient(90deg, #f59e0b, #fbbf24); }
.module-leave      { --card-accent: linear-gradient(90deg, #8b5cf6, #c084fc); }
.module-payroll    { --card-accent: linear-gradient(90deg, #ef4444, #f87171); }
.module-admin      { --card-accent: linear-gradient(90deg, #06b6d4, #38bdf8); }

/* Entrance & Micro-Animations System */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -25px) scale(1.05); }
  100% { transform: translate(-15px, 25px) scale(0.97); }
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.animate-fade-in {
  animation: fadeInUp 0.36s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-scale-in {
  animation: fadeInScale 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stagger-1, .delay-1 { animation-delay: 0.04s; }
.stagger-2, .delay-2 { animation-delay: 0.08s; }
.stagger-3, .delay-3 { animation-delay: 0.12s; }
.stagger-4, .delay-4 { animation-delay: 0.16s; }
.stagger-5           { animation-delay: 0.20s; }
.stagger-6           { animation-delay: 0.24s; }

/* Subtle Glow Hero Pill */
.hero-radar-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1.15rem;
  background: rgba(238, 242, 255, 0.85);
  color: var(--primary);
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(199, 210, 254, 0.85);
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.hero-radar-pill:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.14);
}

@media (max-width: 768px) {
  .nav-menu { display: none; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .main-container { padding: 1.25rem 1rem; }
}

