/**
 * Modern Mobile-First Stylesheet
 * Professional Attendance Management System
 */

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #e0e7ff;
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --info: #0ea5e9;
  --info-light: #e0f2fe;
  
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --sidebar-bg: #1e1b4b;
  --sidebar-text: #e0e7ff;
  --sidebar-active: #4f46e5;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

.card, .modal-content, .btn, .badge, .app-sidebar {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Container & Layout */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  background-color: var(--bg-main);
  min-height: 100vh;
  padding-bottom: 0;
}

/* Sidebar Desktop */
.app-sidebar {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: none;
  flex-direction: column;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  z-index: 1040;
  height: 100vh;
  max-height: 100vh;
}

@media (min-width: 992px) {
  .app-sidebar {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
  }
  .main-content {
    margin-left: 260px !important;
    width: calc(100% - 260px) !important;
    max-width: calc(100% - 260px) !important;
    padding-bottom: 30px;
  }
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
}

.sidebar-brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 0.75rem;
  color: #a5b4fc;
  margin: 0;
}

.sidebar-menu {
  list-style: none;
  padding: 15px 10px;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-menu::-webkit-scrollbar {
  width: 5px;
}

.sidebar-menu::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

.sidebar-menu .menu-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #818cf8;
  padding: 12px 15px 4px 15px;
  letter-spacing: 0.5px;
}

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

.sidebar-menu .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #c7d2fe;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.92rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-menu .nav-link i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.sidebar-menu .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(3px);
}

.sidebar-menu .nav-link.active {
  background: var(--sidebar-active);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

/* Top Navigation Bar */
.top-navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.user-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-light);
}

/* Modern Cards */
.card-modern {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.card-modern:hover {
  box-shadow: var(--shadow-md);
}

.card-header-clean {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

/* Stat Cards */
.stat-card {
  padding: 20px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.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-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 4px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Active Attendance Action Card (Student) */
.live-attendance-card {
  background: linear-gradient(135deg, #4f46e5 0%, #312e81 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.25);
}

.live-attendance-card::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.btn-mark-attendance {
  background: #10b981;
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 14px 28px;
  border-radius: 50px;
  border: none;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-mark-attendance:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.5);
  color: #ffffff;
}

.btn-mark-attendance:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-mark-attendance:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

/* Live Timer Pulse */
.pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  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); }
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 62px;
  padding-top: 7px;
  padding-bottom: calc(7px + env(safe-area-inset-bottom, 6px));
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1040;
  box-shadow: 0 -4px 25px rgba(15, 23, 42, 0.08);
}

@media (min-width: 992px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

@media (max-width: 991.98px) {
  body {
    padding-bottom: 0 !important;
  }
  body:has(.mobile-bottom-nav),
  body.has-bottom-nav {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 8px)) !important;
  }
  .main-content {
    padding-bottom: 0 !important;
  }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
  flex: 1;
  padding: 3px 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 3px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item i {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.2s ease, color 0.2s ease;
}

.bottom-nav-item:active i {
  transform: scale(0.9);
}

.bottom-nav-item:hover {
  color: var(--primary);
}

.bottom-nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

.bottom-nav-item.active i {
  transform: translateY(-1px);
}

.bottom-nav-item.active.text-warning {
  color: #d97706 !important;
}

.bottom-nav-item.text-danger:hover,
.bottom-nav-item.text-danger.active {
  color: #ef4444 !important;
}

/* Responsive Tables */
.table-responsive-custom {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
}

.table-custom {
  width: 100%;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.table-custom th {
  background-color: #f1f5f9;
  color: #475569;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.table-custom td {
  padding: 14px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.table-custom tbody tr:hover {
  background-color: #f8fafc;
}

/* Custom Badges */
.badge-status-present {
  background-color: var(--success-light);
  color: #065f46;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-status-absent {
  background-color: var(--danger-light);
  color: #991b1b;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Modern Form Controls */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  padding: 10px 14px;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.form-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: #334155;
  margin-bottom: 6px;
}

/* Primary Button */
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

/* Circular Progress Ring for Attendance % */
.progress-ring-container {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-percentage-text {
  position: absolute;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Custom Interactive "I'm not a robot" reCAPTCHA Widget (Exact Image Match) */
.custom-captcha-card {
  background-color: #ffffff;
  border: 1.5px solid #d0d7de;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  max-width: 320px;
  width: 100%;
  margin: 15px auto;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-captcha-card:hover:not(.verified) {
  border-color: #94a3b8;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.custom-captcha-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Default Box */
.captcha-check-box {
  width: 28px;
  height: 28px;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  position: relative;
  flex-shrink: 0;
}

.captcha-check-box .check-icon {
  display: none;
}

.captcha-spinner {
  display: none;
  width: 26px;
  height: 26px;
  border: 3px solid #e2e8f0;
  border-left-color: #2563eb;
  border-radius: 50%;
  animation: captchaSpin 0.75s linear infinite;
  flex-shrink: 0;
}

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

.captcha-text-label {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1;
  transition: color 0.25s ease;
}

/* 1. Verifying State (Matches Screenshot 1) */
.custom-captcha-card.verifying {
  border-color: #93c5fd;
  cursor: wait;
}

.custom-captcha-card.verifying .captcha-check-box {
  display: none;
}

.custom-captcha-card.verifying .captcha-spinner {
  display: block;
}

.custom-captcha-card.verifying .captcha-text-label {
  color: #2563eb;
}

/* 2. Verified State (Matches Screenshot 2) */
.custom-captcha-card.verified {
  background-color: #f0fdf4 !important;
  border-color: #86efac !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.08);
  cursor: default;
}

.custom-captcha-card.verified .captcha-spinner {
  display: none;
}

.custom-captcha-card.verified .captcha-check-box {
  display: flex;
  width: 28px;
  height: 28px;
  background-color: transparent;
  border: 2.5px solid #10b981;
  border-radius: 50%;
}

.custom-captcha-card.verified .captcha-check-box .check-icon {
  display: block;
  color: #10b981;
  font-size: 14px;
  font-weight: 900;
  animation: checkPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes checkPop {
  0% { transform: scale(0.3); opacity: 0; }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.custom-captcha-card.verified .captcha-text-label {
  color: #059669;
  font-weight: 700;
  font-size: 16px;
}

/* Right Section */
.custom-captcha-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-left: 16px;
  border-left: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.captcha-shield-icon {
  font-size: 20px;
  color: #1e293b;
  margin-bottom: 2px;
}

.captcha-brand-title {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #334155;
  line-height: 1.1;
  text-align: center;
}

.captcha-brand-subtitle {
  font-size: 8px;
  color: #94a3b8;
  text-align: center;
}

/* Modal and layout transitions */
.modal-content {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 18px 24px;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 16px 24px;
}

/* Checking info animated dots */
.checking-dots {
  display: inline-block;
  animation: checkingDotsBlink 1.4s infinite steps(4, start);
  font-weight: 800;
  letter-spacing: 1.5px;
}

@keyframes checkingDotsBlink {
  0% { opacity: 0.2; }
  50% { opacity: 1; }
  100% { opacity: 0.2; }
}

/* =========================================
   LIVE EXAM / MIDTERM FLIP CLOCK WIDGET
   ========================================= */
.countdown-box-wrapper {
  background: linear-gradient(135deg, #090d16 0%, #1e1b4b 50%, #090d16 100%) !important;
  color: #ffffff !important;
  border-radius: 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.35) !important;
  position: relative !important;
  overflow: hidden !important;
}

.countdown-box-wrapper h2,
.countdown-box-wrapper h3,
.countdown-box-wrapper h4,
.countdown-box-wrapper span,
.countdown-box-wrapper p {
  color: #ffffff;
}

.countdown-box-wrapper::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 60%);
  pointer-events: none;
}

.flip-unit-card {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 14px !important;
  padding: 14px 6px !important;
  text-align: center !important;
  position: relative !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

.flip-unit-card:hover {
  transform: translateY(-3px) !important;
  border-color: rgba(99, 102, 241, 0.6) !important;
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.4) !important;
}

.flip-digit {
  font-family: 'Courier New', Courier, monospace, system-ui !important;
  font-size: 2.2rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  color: #ffffff !important;
  letter-spacing: -1px !important;
  text-shadow: 0 2px 12px rgba(99, 102, 241, 0.6) !important;
}

.flip-label {
  font-size: 0.72rem !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
  color: #cbd5e1 !important;
  margin-top: 6px !important;
}

@media (max-width: 768px) {
  .countdown-box-wrapper {
    border-radius: 16px !important;
    padding: 18px 14px !important;
  }
  .flip-digit {
    font-size: 1.55rem !important;
  }
  .flip-unit-card {
    padding: 10px 4px !important;
    border-radius: 10px !important;
  }
  .flip-label {
    font-size: 0.65rem !important;
    letter-spacing: 0.5px !important;
    margin-top: 4px !important;
  }
}

@media (max-width: 400px) {
  .flip-digit {
    font-size: 1.35rem !important;
  }
  .flip-unit-card {
    padding: 8px 2px !important;
  }
  .flip-label {
    font-size: 0.6rem !important;
  }
}

.radar-sweep-dot.live-now {
  width: 9px;
  height: 9px;
  background-color: #ef4444;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: radarPulse 1.8s infinite;
}

@keyframes radarPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Live Student IP Topbar Radar Badge */
.student-live-ip-badge {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
}
.student-live-ip-badge:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.radar-live-pulse {
  width: 10px;
  height: 10px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: liveRadarPulse 2s infinite;
  flex-shrink: 0;
}

@keyframes liveRadarPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.animate-pulse {
  animation: pulseBadge 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseBadge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Security Radar Futuristic Glass KPI Cards */
.radar-kpi-card {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  padding: 1rem !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s ease-in-out;
}
.radar-kpi-card:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.4);
}
.radar-kpi-card .radar-kpi-label {
  color: #94a3b8 !important;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.radar-kpi-card .radar-kpi-val {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
}


/* ==========================================================
   WEB PUSH NOTIFICATION & PHONE MOCKUP STYLES
   ========================================================== */
.push-phone-mockup {
  width: 290px;
  min-height: 480px;
  background: linear-gradient(135deg, #1e1e38 0%, #0f172a 100%);
  border-radius: 38px;
  border: 8px solid #334155;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 14px 20px 14px;
}

.phone-camera-notch {
  width: 70px;
  height: 18px;
  background-color: #0f172a;
  border-radius: 0 0 12px 12px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.phone-speaker-bar {
  width: 40px;
  height: 4px;
  background-color: #475569;
  border-radius: 4px;
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
}

.phone-lock-time {
  margin-top: 36px;
  margin-bottom: 24px;
  color: #ffffff;
}

.phone-lock-time .lock-clock {
  font-weight: 300;
  letter-spacing: -1px;
}

.push-notification-banner {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
  animation: slideInNotification 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInNotification {
  from {
    opacity: 0;
    transform: translateY(-15px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.phone-bottom-home-bar {
  width: 100px;
  height: 4px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  margin: 20px auto 4px auto;
}

.push-nav-bell {
  transition: all 0.2s ease-in-out;
}
.push-nav-bell:hover {
  background-color: rgba(99, 102, 241, 0.12) !important;
  color: #4f46e5 !important;
  transform: scale(1.05);
}

/* ==========================================================
   PWA AUTO INSTALL PROMPT POPUP BANNER
   ========================================================== */
.pwa-install-banner-wrapper {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 99999;
  width: calc(100% - 32px);
  max-width: 440px;
  background: #0f172a;
  color: #ffffff;
  border-radius: 20px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.pwa-install-banner-wrapper.show {
  transform: translateX(-50%) translateY(0);
}

.pwa-install-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

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

.pwa-install-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.pwa-install-desc {
  font-size: 0.76rem;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-btn-install {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pwa-btn-install:hover {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
  transform: scale(1.03);
}

.pwa-btn-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.pwa-btn-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Only show PWA Install Popup on Mobile Devices */
@media (min-width: 769px) {
  .pwa-install-banner-wrapper {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .pwa-install-banner-wrapper {
    bottom: 75px;
  }
}

/* Admin App Animated Glow Button */
.admin-app-glow-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  animation: adminBtnPulse 2.4s infinite;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-app-glow-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5) !important;
  color: #ffffff !important;
}

@keyframes adminBtnPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.5);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(124, 58, 237, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0);
  }
}

.animate-bounce-custom {
  display: inline-block;
  animation: bounceCustom 1.8s infinite;
}

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

/* Push Notification UI Components */
.push-permission-banner-card {
  position: relative;
  border-radius: 16px;
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.25), 0 8px 10px -6px rgba(79, 70, 229, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.push-permission-banner-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(79, 70, 229, 0.35);
}

.push-nav-bell {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.push-nav-bell:hover {
  background-color: #f1f5f9;
  color: #4f46e5 !important;
}

.push-nav-bell.active {
  color: #f59e0b !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  background-color: rgba(245, 158, 11, 0.1) !important;
}

/* ==========================================================================
   Universal High-Contrast Button & Badge Visibility Fixes
   ========================================================================== */
.btn-outline-light {
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  background-color: rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn-outline-light:hover,
.btn-outline-light:focus,
.btn-outline-light:active {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
}
.btn-outline-light:hover *,
.btn-outline-light:focus *,
.btn-outline-light:active * {
  color: #0f172a !important;
}

.btn-light {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}
.btn-light:hover,
.btn-light:focus,
.btn-light:active {
  background-color: #ffffff !important;
  color: #000000 !important;
  border-color: #94a3b8 !important;
}

.badge.bg-white,
.badge.bg-light {
  color: #0f172a !important;
}

