html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

/* ---- DARK MODE ---- */
:root {
  --bg-color: #ffffff;
  --text-color: #212529;
  --card-bg: #ffffff;
  --nav-bg: linear-gradient(135deg, #1e3a8a, #3b82f6);
}

[data-theme="dark"] {
  --bg-color: #1a1a2e;
  --text-color: #e0e0e0;
  --card-bg: #16213e;
  --nav-bg: linear-gradient(135deg, #0f172a, #1e3a8a);
}

[data-theme="dark"] .card {
  background-color: var(--card-bg);
  border-color: #2a2a4a;
}

[data-theme="dark"] .table {
  color: var(--text-color);
}

[data-theme="dark"] .dropdown-menu {
  background-color: var(--card-bg);
  border-color: #2a2a4a;
}

[data-theme="dark"] .dropdown-item {
  color: var(--text-color);
}

[data-theme="dark"] .dropdown-item:hover {
  background-color: #2a2a4a;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background-color: #0f172a;
  color: var(--text-color);
  border-color: #2a2a4a;
}

[data-theme="dark"] .navbar {
  background: var(--nav-bg) !important;
}

/* ---- RTL ---- */
[dir="rtl"] .me-auto {
  margin-right: auto !important;
  margin-left: 0 !important;
}

[dir="rtl"] .ms-auto {
  margin-left: auto !important;
  margin-right: 0 !important;
}

[dir="rtl"] .dropdown-menu-end {
  right: auto !important;
  left: 0 !important;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ============================================================
   PROFESSIONAL DESIGN ENHANCEMENTS
   ============================================================ */

/* ---- Smooth Theme Transition ---- */
*, *::before, *::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--primary, #3b82f6); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-hover, #2563eb); }

/* ---- Glassmorphism Cards ---- */
.glass-card {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

[data-theme="dark"] .glass-card {
  background: rgba(30, 58, 138, 0.2);
  border-color: rgba(59, 130, 246, 0.3);
}

/* ---- Hover Lift Effect ---- */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* ---- Skeleton Loading ---- */
.skeleton {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
}
[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #1a1a3e 25%, #16213e 50%, #1a1a3e 75%);
  background-size: 200% 100%;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Toast Notifications ---- */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast-notification {
  background: var(--card-bg, #fff);
  color: var(--text-color, #212529);
  border-radius: 12px;
  padding: 14px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 400px;
  animation: toast-slide-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-left: 4px solid;
}
.toast-notification.success { border-left-color: #10b981; }
.toast-notification.error { border-left-color: #ef4444; }
.toast-notification.warning { border-left-color: #f59e0b; }
.toast-notification.info { border-left-color: #3b82f6; }
.toast-notification.removing {
  animation: toast-slide-out 0.3s ease forwards;
}
@keyframes toast-slide-in {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toast-slide-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

/* ---- Radial Progress ---- */
.radial-progress {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: conic-gradient(var(--progress-color, #3b82f6) calc(var(--value, 0) * 3.6deg), #e5e7eb 0deg);
}
[data-theme="dark"] .radial-progress {
  background: conic-gradient(var(--progress-color, #3b82f6) calc(var(--value, 0) * 3.6deg), #1a1a3e 0deg);
}
.radial-progress::before {
  content: '';
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--card-bg, #fff);
}
[data-theme="dark"] .radial-progress::before {
  background: var(--card-bg, #16213e);
}
.radial-progress span {
  position: relative;
  z-index: 1;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text-color, #212529);
}

/* ---- XP Bar ---- */
.xp-bar-container {
  width: 100%;
  height: 12px;
  background: #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}
[data-theme="dark"] .xp-bar-container {
  background: #1a1a3e;
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 6px;
  width: 0%;
  transition: width 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Streak Fire ---- */
.streak-flame {
  display: inline-block;
  animation: flicker 0.5s infinite alternate;
}
@keyframes flicker {
  0% { transform: scale(1) rotate(-2deg); opacity: 1; }
  100% { transform: scale(1.15) rotate(2deg); opacity: 0.85; }
}

/* ---- Confetti Canvas ---- */
#confetti-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9998;
}

/* ---- Animated Counter ---- */
.counter-animated {
  font-variant-numeric: tabular-nums;
}

/* ---- 3D Flip Card ---- */
.flip-card {
  perspective: 1000px;
  cursor: pointer;
}
.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}
.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 12px;
}
.flip-card-back {
  transform: rotateY(180deg);
}

/* ---- Pulse Badge ---- */
.badge-pulse {
  animation: badge-pulse 2s infinite;
}
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239,68,68,0.7); }
  50% { transform: scale(1.2); box-shadow: 0 0 0 10px rgba(239,68,68,0); }
}

/* ---- Shake Animation ---- */
.shake {
  animation: shake 0.5s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ---- Smooth Section Transitions ---- */
.section-content {
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.4s ease;
}
.section-content.active {
  opacity: 1;
  transform: translateX(0);
}

/* ---- Question Navigator ---- */
.q-navigator {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 6px;
  max-width: 300px;
}
.q-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  background: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.q-nav-btn:hover { transform: scale(1.1); }
.q-nav-btn.answered { background: #10b981; color: #fff; border-color: #10b981; }
.q-nav-btn.flagged { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.q-nav-btn.current { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.3); }

/* ---- Progress Stepper ---- */
.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stepper-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #e5e7eb;
  color: #6b7280;
  transition: all 0.3s;
}
.stepper-step.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
}
.stepper-step.done {
  background: #10b981;
  color: #fff;
}
.stepper-line {
  flex: 1;
  height: 3px;
  background: #e5e7eb;
  border-radius: 2px;
  position: relative;
}
.stepper-line::after {
  content: '';
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ---- AI Tutor Typing Effect ---- */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}
.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state i {
  font-size: 4rem;
  color: #d1d5db;
  margin-bottom: 16px;
}
[data-theme="dark"] .empty-state i {
  color: #374151;
}

/* ---- Timer Critical ---- */
.timer-critical {
  animation: timer-pulse 1s infinite;
}
@keyframes timer-pulse {
  0% { color: #ef4444; }
  50% { color: #991b1b; }
  100% { color: #ef4444; }
}

/* ---- Level Up Modal ---- */
.level-up-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: var(--card-bg, #fff);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
  z-index: 10000;
  text-align: center;
  animation: level-up-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes level-up-pop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  60% { transform: translate(-50%, -50%) scale(1.1); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.level-up-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  backdrop-filter: blur(5px);
}

/* ---- Breadcrumb ---- */
.breadcrumb-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  font-size: 0.9rem;
}
.breadcrumb-custom a {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb-custom a:hover {
  color: #3b82f6;
}
.breadcrumb-custom .active {
  color: var(--text-color, #212529);
  font-weight: 600;
}

/* ---- Floating Label Enhancement ---- */
.form-floating > label {
  transition: all 0.2s ease;
}
.form-floating > input:focus + label,
.form-floating > input:not(:placeholder-shown) + label,
.form-floating > textarea:focus + label,
.form-floating > textarea:not(:placeholder-shown) + label {
  color: #3b82f6 !important;
  font-weight: 600;
}

/* ---- Media Player Waveform Placeholder ---- */
.waveform-bar {
  width: 4px;
  background: #3b82f6;
  border-radius: 2px;
  animation: waveform-dance 0.8s infinite ease-in-out alternate;
}
@keyframes waveform-dance {
  from { height: 10px; }
  to { height: 30px; }
}

/* ============================================================
   NAVBAR REDESIGN
   ============================================================ */

/* Avatar */
.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.nav-avatar-lg {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
}

/* User Dropdown Header */
.nav-user-header {
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  color: #fff;
}
.nav-user-header .text-muted {
  color: rgba(255,255,255,0.75) !important;
}
.nav-user-header .progress {
  background: rgba(255,255,255,0.2);
}

/* User Dropdown Menu */
.nav-user-menu {
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  overflow: hidden;
  border: none;
}
.nav-user-menu .dropdown-item {
  padding: 8px 16px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-user-menu .dropdown-item i {
  width: 20px;
  text-align: center;
}

/* Dark mode user header */
[data-theme="dark"] .nav-user-header {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
}
[data-theme="dark"] .nav-user-menu {
  background-color: var(--card-bg);
  border-color: #2a2a4a;
}

/* Notification badge */
.nav-notification-badge {
  font-size: 0.65rem;
  position: absolute;
  top: 2px;
  right: 2px;
}

/* Dropdown menu styling */
.navbar .dropdown-menu {
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  border: none;
  padding: 8px 0;
}
.navbar .dropdown-item {
  padding: 8px 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar .dropdown-item i {
  width: 20px;
  text-align: center;
}

/* Dark mode dropdowns */
[data-theme="dark"] .navbar .dropdown-menu {
  background-color: var(--card-bg);
  border-color: #2a2a4a;
}
[data-theme="dark"] .navbar .dropdown-item:hover {
  background-color: #2a2a4a;
}

/* Nav link hover effect */
.navbar .nav-link {
  border-radius: 8px;
  padding: 6px 12px !important;
  transition: all 0.2s ease;
}
.navbar .nav-link:hover {
  background: rgba(255,255,255,0.15);
}

/* Active nav link */
.navbar .nav-link.active {
  background: rgba(255,255,255,0.2);
  font-weight: 600;
}

/* Navbar on mobile */
@media (max-width: 991px) {
  .nav-avatar + .d-none {
    display: block !important;
  }
  .navbar .dropdown-menu {
    box-shadow: none;
    border-radius: 0;
    background: rgba(255,255,255,0.05);
  }
  .nav-user-menu {
    border-radius: 0;
  }
}

/* Admin nav compact */
.admin-nav .nav-link {
  padding: 6px 10px !important;
  font-size: 0.9rem;
}

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  animation: empty-fade-in 0.5s ease;
}
.empty-state i {
  font-size: 5rem;
  color: #d1d5db;
  display: block;
  margin-bottom: 20px;
}
.empty-state h4, .empty-state h5 {
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 8px;
}
.empty-state p {
  color: #9ca3af;
  max-width: 400px;
  margin: 0 auto 20px;
}
.empty-state .btn {
  padding: 10px 30px;
  border-radius: 12px;
  font-weight: 600;
}
@keyframes empty-fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
[data-theme="dark"] .empty-state i { color: #374151; }
[data-theme="dark"] .empty-state h4,
[data-theme="dark"] .empty-state h5 { color: #9ca3af; }

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 8px;
}
.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
  border-radius: 4px;
}
.skeleton-text-sm { height: 12px; width: 60%; }
.skeleton-text-lg { height: 20px; width: 80%; }
.skeleton-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}
.skeleton-card {
  height: 120px;
  border-radius: 16px;
}
.skeleton-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}
[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #1a1a3e 25%, #16213e 50%, #1a1a3e 75%);
  background-size: 200% 100%;
}

/* ============================================================
   MICRO-INTERACTIONS
   ============================================================ */
/* Card hover lift */
.card-hover {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12) !important;
}

/* Button interactions */
.btn-interactive {
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-interactive:hover {
  transform: scale(1.03);
}
.btn-interactive:active {
  transform: scale(0.97);
}

/* Link hover underline animation */
.link-animated {
  position: relative;
  text-decoration: none;
}
.link-animated::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s ease;
}
.link-animated:hover::after {
  width: 100%;
}

/* Fade in animation */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
}
.fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}
.fade-in-left {
  animation: fadeInLeft 0.5s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Stagger children animation */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }

/* Pulse ring animation */
.pulse-ring {
  position: relative;
}
.pulse-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  animation: pulse-ring 2s infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Loading spinner for buttons */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.8s linear infinite;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   MOBILE BOTTOM NAVIGATION
   ============================================================ */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg, #fff);
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  z-index: 1030;
  padding: 6px 0 12px;
}
.mobile-bottom-nav .nav-item {
  flex: 1;
  text-align: center;
}
.mobile-bottom-nav .nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0 !important;
  font-size: 0.7rem;
  color: #9ca3af;
  border-radius: 12px;
  margin: 0 4px;
  transition: all 0.2s ease;
}
.mobile-bottom-nav .nav-link i {
  font-size: 1.4rem;
}
.mobile-bottom-nav .nav-link.active,
.mobile-bottom-nav .nav-link:active {
  color: #3b82f6;
}
.mobile-bottom-nav .nav-link .nav-label {
  font-size: 0.65rem;
}

[data-theme="dark"] .mobile-bottom-nav {
  background: var(--card-bg, #16213e);
  border-top-color: #2a2a4a;
}

@media (max-width: 991px) {
  .mobile-bottom-nav {
    display: flex;
  }
  body {
    padding-bottom: 70px;
  }
}

/* ============================================================
   BREADCRUMB NAVIGATION
   ============================================================ */
.breadcrumb-bar {
  background: linear-gradient(90deg, rgba(59,130,246,0.05), rgba(59,130,246,0.02));
  border-bottom: 1px solid rgba(59,130,246,0.1);
  padding: 12px 0;
}
.breadcrumb-bar .breadcrumb {
  margin-bottom: 0;
  font-size: 0.85rem;
}
.breadcrumb-bar .breadcrumb-item a {
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb-bar .breadcrumb-item a:hover {
  color: #1e3a8a;
  text-decoration: underline;
}
.breadcrumb-bar .breadcrumb-item.active {
  color: #6b7280;
}
[data-theme="dark"] .breadcrumb-bar {
  background: linear-gradient(90deg, rgba(59,130,246,0.08), rgba(59,130,246,0.03));
  border-bottom-color: rgba(59,130,246,0.15);
}

/* ============================================================
   CHAT INTERFACE ENHANCEMENTS
   ============================================================ */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 500px;
  background: #f9fafb;
  border-radius: 16px;
  overflow: hidden;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-message {
  display: flex;
  gap: 10px;
  max-width: 85%;
  animation: msg-slide-in 0.3s ease;
}
.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chat-message .msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.chat-message .msg-avatar.ai {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: white;
}
.chat-message .msg-avatar.user {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: white;
}
.chat-message .msg-content {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.chat-message.user .msg-content {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e3a8a;
  border-bottom-right-radius: 4px;
}
.chat-message.ai .msg-content {
  background: white;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border-bottom-left-radius: 4px;
}
[data-theme="dark"] .chat-message.ai .msg-content {
  background: var(--card-bg, #16213e);
  border-color: #2a2a4a;
}
[data-theme="dark"] .chat-message.user .msg-content {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
}
@keyframes msg-slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-input-area {
  border-top: 1px solid #e5e7eb;
  padding: 16px;
  background: white;
}
[data-theme="dark"] .chat-input-area {
  background: var(--card-bg, #16213e);
  border-top-color: #2a2a4a;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  border-radius: 16px;
  border: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  overflow: hidden;
  position: relative;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--stat-color, #3b82f6);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12) !important;
}
.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card .stat-label {
  font-size: 0.85rem;
  color: #9ca3af;
}

/* ============================================================
   PROGRESS RING
   ============================================================ */
.progress-ring {
  position: relative;
  width: 100px;
  height: 100px;
}
.progress-ring svg {
  transform: rotate(-90deg);
}
.progress-ring-circle {
  transition: stroke-dashoffset 1s ease;
}
.progress-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  font-size: 1.2rem;
}

/* ============================================================
   BADGE PILL
   ============================================================ */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--badge-color, #3b82f6), var(--badge-color-dark, #2563eb));
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ============================================================
   ONBOARDING STEPS
   ============================================================ */
.onboarding-step {
  display: none;
  animation: fadeInUp 0.4s ease;
}
.onboarding-step.active {
  display: block;
}
.onboarding-progress {
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  overflow: hidden;
}
.onboarding-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ============================================================
   TABLE ROW HOVER
   ============================================================ */
.table-hover tbody tr {
  transition: background-color 0.2s ease;
}
.table-hover tbody tr:hover {
  background-color: rgba(59,130,246,0.05) !important;
}

/* ============================================================
   SCROLL-TO-TOP BUTTON
   ============================================================ */
.scroll-to-top {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(30,58,138,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1020;
}
.scroll-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.scroll-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(30,58,138,0.4);
}
@media (max-width: 991px) {
  .scroll-to-top {
    bottom: 90px;
  }
}

/* ===== Admin Users Page ===== */
.stat-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-left: 4px solid var(--stat-color, #3b82f6);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
}
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 8px;
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.user-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
  text-transform: uppercase;
}
.user-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.5rem;
  text-transform: uppercase;
}

#bulkToolbar {
  background: rgba(59,130,246,0.05);
  border: 1px dashed rgba(59,130,246,0.3);
  border-radius: 8px;
  padding: 8px 12px;
}

#usersTable tbody tr {
  transition: background-color 0.15s ease;
}
#usersTable tbody tr:hover {
  background-color: rgba(59,130,246,0.04);
  cursor: pointer;
}

/* Dark mode admin */
[data-bs-theme="dark"] .stat-label {
  color: #adb5bd;
}
[data-bs-theme="dark"] #bulkToolbar {
  background: rgba(59,130,246,0.1);
  border-color: rgba(59,130,246,0.4);
}
[data-bs-theme="dark"] #usersTable tbody tr:hover {
  background-color: rgba(59,130,246,0.08);
}
[data-bs-theme="dark"] .bg-light {
  background-color: #2d3748 !important;
}
[data-bs-theme="dark"] .table thead th {
  color: #e2e8f0;
}
[data-bs-theme="dark"] .table tbody td {
  color: #cbd5e1;
}
[data-bs-theme="dark"] .input-group-text.bg-white {
  background-color: #374151 !important;
  color: #e2e8f0;
  border-color: #4b5563;
}
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .form-control {
  background-color: #1f2937;
  color: #e2e8f0;
  border-color: #4b5563;
}
[data-bs-theme="dark"] .modal-content {
  background-color: #1f2937;
  color: #e2e8f0;
}
[data-bs-theme="dark"] .modal-header {
  border-bottom-color: #374151;
}
[data-bs-theme="dark"] .dropdown-menu {
  background-color: #1f2937;
  border-color: #374151;
}
[data-bs-theme="dark"] .dropdown-item {
  color: #e2e8f0;
}
[data-bs-theme="dark"] .dropdown-item:hover {
  background-color: #374151;
}
[data-bs-theme="dark"] .dropdown-divider {
  border-top-color: #374151;
}
[data-bs-theme="dark"] .page-link {
  background-color: #1f2937;
  color: #e2e8f0;
  border-color: #374151;
}
[data-bs-theme="dark"] .page-item.active .page-link {
  background-color: #3b82f6;
  border-color: #3b82f6;
}
[data-bs-theme="dark"] .page-item.disabled .page-link {
  background-color: #1f2937;
  color: #6b7280;
}