:root {
  --gradient-primary: linear-gradient(135deg, #7367f0 0%, #9b8cf7 50%, #b4a7f8 100%);
  --gradient-secondary: linear-gradient(135deg, #808390 0%, #a0a3b0 50%, #c0c2cc 100%);
  --gradient-success: linear-gradient(135deg, #28c76f 0%, #48e08b 50%, #6ef8a5 100%);
  --gradient-info: linear-gradient(135deg, #00bad1 0%, #20d4e8 50%, #4ee8f8 100%);
  --gradient-warning: linear-gradient(135deg, #ff9f43 0%, #ffb976 50%, #ffce99 100%);
  --gradient-danger: linear-gradient(135deg, #ff4c51 0%, #ff7074 50%, #ff9497 100%);
  --gradient-dark: linear-gradient(135deg, #2f3349 0%, #4a4f6a 50%, #656b86 100%);
  --gradient-card-border: linear-gradient(135deg, #7367f0, #28c76f, #ff9f43);
  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --animation-speed: 0.5s;
}

[data-bs-theme="dark"] {
  --glass-bg: rgba(30, 30, 60, 0.5);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(115, 103, 240, 0.2); }
  50% { box-shadow: 0 0 20px rgba(115, 103, 240, 0.4); }
}
@keyframes slideDown {
  from { opacity: 0; max-height: 0; transform: translateY(-10px); }
  to { opacity: 1; max-height: 500px; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes typing {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes rippleEffect {
  to { transform: scale(4); opacity: 0; }
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes counterUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes notificationSlide {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes progressStripe {
  from { background-position: 0 0; }
  to { background-position: 1rem 0; }
}
@keyframes skeletonPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.animate-fade-in-up { animation: fadeInUp var(--animation-speed) ease forwards; }
.animate-fade-in { animation: fadeIn var(--animation-speed) ease forwards; }
.animate-fade-in-left { animation: fadeInLeft var(--animation-speed) ease forwards; }
.animate-fade-in-right { animation: fadeInRight var(--animation-speed) ease forwards; }
.animate-scale-in { animation: scaleIn var(--animation-speed) ease forwards; }
.animate-float { animation: float 4s ease-in-out infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-glow { animation: glow 2s ease-in-out infinite; }
.animate-slide-down { animation: slideDown 0.4s ease forwards; }
.animate-shimmer { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent) 0 0 / 200% 100%; animation: shimmer 2s infinite; }
.animate-typing-dot { animation: typing 1.4s ease-in-out infinite; }
.animate-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.animate-typing-dot:nth-child(3) { animation-delay: 0.4s; }
.animate-gradient-shift { background-size: 200% 200%; animation: gradientShift 4s ease infinite; }
.animate-page-enter { animation: pageEnter 0.5s ease forwards; }

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text-success { background: var(--gradient-success); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.gradient-text-warning { background: var(--gradient-warning); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.gradient-text-info { background: var(--gradient-info); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.gradient-text-danger { background: var(--gradient-danger); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.gradient-bg { background: var(--gradient-primary) !important; }
.gradient-bg-success { background: var(--gradient-success) !important; }
.gradient-bg-warning { background: var(--gradient-warning) !important; }
.gradient-bg-info { background: var(--gradient-info) !important; }
.gradient-bg-danger { background: var(--gradient-danger) !important; }

.glass {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow) !important;
}
.glass-strong {
  background: rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
}
[data-bs-theme="dark"] .glass-strong {
  background: rgba(30, 30, 60, 0.6) !important;
}

.gradient-border-card {
  position: relative;
}
.gradient-border-card::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: inherit;
  background: var(--gradient-card-border);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card-hover-lift {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.card-hover-lift:hover {
  transform: translateY(-6px) scale(1.01) !important;
  box-shadow: 0 16px 48px rgba(115, 103, 240, 0.15) !important;
}

.btn-gradient {
  background: var(--gradient-primary) !important;
  border: none !important;
  color: #fff !important;
  background-size: 200% auto !important;
  transition: all 0.4s ease !important;
}
.btn-gradient:hover {
  background-position: right center !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(115, 103, 240, 0.35) !important;
  color: #fff !important;
}
.btn-gradient-success { background: var(--gradient-success) !important; background-size: 200% auto !important; }
.btn-gradient-success:hover { background-position: right center !important; box-shadow: 0 8px 25px rgba(40, 199, 111, 0.35) !important; }
.btn-gradient-warning { background: var(--gradient-warning) !important; background-size: 200% auto !important; }
.btn-gradient-warning:hover { background-position: right center !important; box-shadow: 0 8px 25px rgba(255, 159, 67, 0.35) !important; }
.btn-gradient-danger { background: var(--gradient-danger) !important; background-size: 200% auto !important; }
.btn-gradient-danger:hover { background-position: right center !important; box-shadow: 0 8px 25px rgba(255, 76, 81, 0.35) !important; }
.btn-gradient-info { background: var(--gradient-info) !important; background-size: 200% auto !important; }
.btn-gradient-info:hover { background-position: right center !important; box-shadow: 0 8px 25px rgba(0, 186, 209, 0.35) !important; }

.ripple-btn {
  position: relative;
  overflow: hidden;
}
.ripple-btn::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  width: 100px;
  height: 100px;
  margin-top: -50px;
  margin-left: -50px;
  top: 50%;
  left: 50%;
  transform: scale(0);
  opacity: 0;
}
.ripple-btn:active::after {
  animation: rippleEffect 0.6s ease-out;
}

.layout-wrapper {
  animation: pageEnter 0.4s ease forwards;
}

.card {
  transition: all 0.3s ease !important;
}
.card:hover {
  box-shadow: 0 8px 30px rgba(115, 103, 240, 0.1) !important;
}

.table-row-hover tbody tr {
  transition: all 0.3s ease;
}
.table-row-hover tbody tr:hover {
  transform: translateX(4px);
  background: rgba(115, 103, 240, 0.03) !important;
}

.list-group .list-group-item {
  transition: all 0.3s ease;
}
.list-group .list-group-item:hover {
  transform: translateX(4px);
  background: rgba(115, 103, 240, 0.04);
}

.nav-link {
  transition: all 0.3s ease !important;
}
.nav-link:hover {
  transform: translateX(3px);
}

.menu-item .menu-link {
  transition: all 0.3s ease !important;
  position: relative;
}
.menu-item .menu-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  background: var(--gradient-primary);
  border-radius: 0 3px 3px 0;
  transition: transform 0.3s ease;
}
.menu-item.active .menu-link::before {
  transform: translateY(-50%) scaleY(1);
}
.menu-item:not(.active) .menu-link:hover::before {
  transform: translateY(-50%) scaleY(0.4);
}

.alert {
  animation: slideDown 0.4s ease forwards;
}

.modal-content {
  animation: scaleIn 0.3s ease;
}

.dropdown-menu {
  animation: fadeInUp 0.2s ease;
  transform-origin: top;
}

.progress-bar-gradient {
  background: var(--gradient-primary) !important;
  background-size: 200% 100% !important;
  animation: gradientShift 2s ease infinite;
}

.badge-gradient {
  background: var(--gradient-primary) !important;
  color: #fff !important;
  border: none !important;
}

.avatar {
  transition: all 0.3s ease;
}
.avatar:hover {
  transform: scale(1.1);
}

.timeline-item {
  transition: all 0.3s ease;
}
.timeline-item:hover {
  transform: translateX(4px);
}

.skeleton-box {
  animation: skeletonPulse 1.5s ease-in-out infinite;
  border-radius: 4px;
}

.notification-item {
  animation: notificationSlide 0.4s ease forwards;
}

.content-wrapper {
  animation: pageEnter 0.4s ease forwards;
}

.fade-in-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7367f0, #9b8cf7);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #5e50e0, #7367f0); }

* {
  scrollbar-width: thin;
  scrollbar-color: #7367f0 transparent;
}

::selection {
  background: rgba(115, 103, 240, 0.3);
}
[data-bs-theme="dark"] ::selection {
  background: rgba(115, 103, 240, 0.4);
}

[data-bs-theme="dark"] .card {
  background: linear-gradient(135deg, rgba(30, 30, 60, 0.6), rgba(20, 20, 40, 0.8));
}

[data-bs-theme="dark"] .layout-navbar {
  background: rgba(30, 30, 60, 0.7) !important;
  backdrop-filter: blur(20px) !important;
}

[data-bs-theme="dark"] .layout-menu {
  background: linear-gradient(180deg, rgba(30, 30, 60, 0.9), rgba(20, 20, 40, 0.95)) !important;
}

.floating-action-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(115, 103, 240, 0.4);
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-size: 24px;
}
.floating-action-btn:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 12px 35px rgba(115, 103, 240, 0.5);
}

.glow-border {
  position: relative;
}
.glow-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--gradient-primary);
  z-index: -1;
  opacity: 0.5;
  filter: blur(4px);
}

.pulse-ring {
  position: relative;
}
.pulse-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #7367f0;
  animation: pulseRing 2s ease-out infinite;
}
@keyframes pulseRing {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(115, 103, 240, 0.08), transparent 70%);
  border-radius: 50%;
  transition: all 0.6s ease;
}
.stat-card:hover::after {
  transform: scale(1.5);
}
