/* ============================================================
   LEADERS ACADEMIA LMS — app.css
   Main Application Stylesheet
   ============================================================ */

/* ============================================================
   1. CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Brand Colors */
  --primary:        #2563EB;
  --primary-dark:   #1D4ED8;
  --primary-light:  #3B82F6;
  --secondary:      #0F172A;
  --accent:         #06B6D4;
  --accent-dark:    #0891B2;
  --accent-light:   #67E8F9;

  /* UI Colors */
  --bg:             #F8FAFC;
  --text:           #0F172A;
  --text-muted:     #64748B;
  --text-light:     #94A3B8;
  --dark:           #0F172A;
  --light:          #E2E8F0;
  --white:          #FFFFFF;
  --border:         #CBD5E1;
  --border-light:   #E2E8F0;

  /* Status Colors */
  --error:          #EF4444;
  --error-bg:       #FEF2F2;
  --success:        #22C55E;
  --success-bg:     #F0FDF4;
  --warning:        #F59E0B;
  --warning-bg:     #FFFBEB;
  --info:           #3B82F6;
  --info-bg:        #EFF6FF;

  /* Spacing Scale */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Border Radius */
  --radius-sm:   0.25rem;
  --radius:      0.5rem;
  --radius-md:   0.75rem;
  --radius-lg:   1.125rem;
  --radius-xl:   1.5rem;
  --radius-2xl:  2rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs:  0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm:  0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow:     0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-md:  0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-lg:  0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-xl:  0 25px 50px -12px rgb(0 0 0 / 0.25);
  --shadow-primary: 0 4px 15px rgb(37 99 235 / 0.3);
  --shadow-accent:  0 4px 15px rgb(6 182 212 / 0.3);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition:        250ms ease;
  --transition-slow:   400ms ease;
  --transition-bounce: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Typography */
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-arabic:'Amiri', 'Traditional Arabic', 'Arabic Typesetting', serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;

  --font-normal:   400;
  --font-medium:   500;
  --font-semibold: 600;
  --font-bold:     700;
  --font-extrabold:800;

  --leading-tight:  1.25;
  --leading-snug:   1.375;
  --leading-normal: 1.5;
  --leading-relaxed:1.625;
  --leading-loose:  2;

  /* Layout */
  --container-sm:  640px;
  --container-md:  768px;
  --container-lg:  1024px;
  --container-xl:  1280px;
  --container-2xl: 1536px;

  --sidebar-width:         260px;
  --sidebar-collapsed-width: 72px;
  --topbar-height:         64px;
  --navbar-height:         70px;

  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky:   1020;
  --z-fixed:    1030;
  --z-modal-backdrop: 1040;
  --z-modal:    1050;
  --z-toast:    1060;
  --z-tooltip:  1070;
}

/* ============================================================
   2. RESET & BASE STYLES
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--dark);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  line-height: var(--leading-relaxed);
  color: var(--text-muted);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--primary-dark); }

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

ul, ol { list-style: none; }

table { border-collapse: collapse; }

hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: var(--space-6) 0;
}

::selection {
  background-color: var(--primary);
  color: var(--white);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================================
   3. ANIMATIONS / KEYFRAMES
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

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

@keyframes scaleIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

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

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
}

@keyframes shimmer {
  0%   { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

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

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

@keyframes bounce {
  0%, 100% { transform: translateY(0); animation-timing-function: cubic-bezier(0.8,0,1,1); }
  50%       { transform: translateY(-20px); animation-timing-function: cubic-bezier(0,0,0.2,1); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50%       { transform: rotate(3deg); }
}

@keyframes progressBar {
  from { width: 0; }
}

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

@keyframes toastSlideIn {
  from { transform: translateX(calc(100% + 24px)); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(calc(100% + 24px)); opacity: 0; }
}

/* ============================================================
   4. DECORATIVE GEOMETRIC DESIGN ELEMENTS
   ============================================================ */
.geo-pattern {
  position: relative;
  overflow: hidden;
}

.geo-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(37, 99, 235, 0.04) 0px,
      rgba(37, 99, 235, 0.04) 1px,
      transparent 1px,
      transparent 12px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(37, 99, 235, 0.04) 0px,
      rgba(37, 99, 235, 0.04) 1px,
      transparent 1px,
      transparent 12px
    );
  pointer-events: none;
  z-index: 0;
}

.geometric-overlay {
  position: relative;
}

.geometric-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpolygon points='40,5 75,25 75,55 40,75 5,55 5,25' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='1'/%3E%3Cpolygon points='40,15 65,30 65,50 40,65 15,50 15,30' fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.bismillah-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-8) 0;
  color: var(--primary);
  font-family: var(--font-arabic);
  font-size: var(--text-xl);
}

.bismillah-divider::before,
.bismillah-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
}

.geo-border {
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
}

.geo-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--primary), var(--accent), var(--primary-light), var(--accent));
  border-radius: inherit;
  z-index: -1;
}

.star-pattern {
  background-color: var(--dark);
  background-image:
    radial-gradient(ellipse at 25% 25%, rgba(37,99,235,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 75%, rgba(6,182,212,0.1) 0%, transparent 50%);
}

/* ============================================================
   5. UTILITY CLASSES
   ============================================================ */

/* Container */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container-sm  { max-width: var(--container-sm); }
.container-md  { max-width: var(--container-md); }
.container-lg  { max-width: var(--container-lg); }
.container-2xl { max-width: var(--container-2xl); }


/* Flex utilities */
.flex-col   { flex-direction: column; }
.flex-wrap  { flex-wrap: wrap; }
.items-start  { align-items: flex-start; }
.items-center { align-items: center; }
.items-end    { align-items: flex-end; }
.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around  { justify-content: space-around; }
.flex-1  { flex: 1; }
.flex-none { flex: none; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid utilities */
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Text alignment */
.text-left    { text-align: left; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-justify { text-align: justify; }

/* Text size */
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }
.text-4xl  { font-size: var(--text-4xl); }

/* Font weight */
.font-normal   { font-weight: var(--font-normal); }
.font-medium   { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold     { font-weight: var(--font-bold); }

/* Text colors */
.text-primary   { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-accent    { color: var(--accent) !important; }
.text-dark      { color: var(--dark) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-light-c   { color: var(--text-light) !important; }
.text-white     { color: var(--white) !important; }
.text-error     { color: var(--error) !important; }
.text-success   { color: var(--success) !important; }
.text-warning   { color: var(--warning) !important; }

/* Background colors */
.bg-primary   { background-color: var(--primary) !important; }
.bg-secondary { background-color: var(--secondary) !important; }
.bg-accent    { background-color: var(--accent) !important; }
.bg-dark      { background-color: var(--dark) !important; }
.bg-light     { background-color: var(--light) !important; }
.bg-white     { background-color: var(--white) !important; }
.bg-bg        { background-color: var(--bg) !important; }
.bg-error     { background-color: var(--error) !important; }
.bg-success   { background-color: var(--success) !important; }

/* Spacing */
.m-0  { margin: 0 !important; }
.mt-auto { margin-top: auto !important; }
.mx-auto { margin-inline: auto !important; }
.p-0  { padding: 0 !important; }
.p-4  { padding: var(--space-4) !important; }
.p-6  { padding: var(--space-6) !important; }
.p-8  { padding: var(--space-8) !important; }
.py-4 { padding-block: var(--space-4) !important; }
.py-6 { padding-block: var(--space-6) !important; }
.py-8 { padding-block: var(--space-8) !important; }
.px-4 { padding-inline: var(--space-4) !important; }
.px-6 { padding-inline: var(--space-6) !important; }

/* Border radius */
.rounded-sm   { border-radius: var(--radius-sm); }
.rounded      { border-radius: var(--radius); }
.rounded-md   { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-xl   { border-radius: var(--radius-xl); }
.rounded-2xl  { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Width / Height */
.w-full    { width: 100%; }
.w-auto    { width: auto; }
.h-full    { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }
.inset-0  { inset: 0; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* Shadow */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow    { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Transition */
.transition { transition: all var(--transition); }

/* Animations */
.animate-fadeIn    { animation: fadeIn 0.5s ease; }
.animate-fadeInUp  { animation: fadeInUp 0.6s ease; }
.animate-float     { animation: float 3s ease-in-out infinite; }
.animate-pulse     { animation: pulse 2s ease-in-out infinite; }
.animate-spin      { animation: spin 1s linear infinite; }

/* ============================================================
   6. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem 1.25rem;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: 1.25;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  vertical-align: middle;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
}

.btn:hover::after  { background: rgba(255,255,255,0.08); }
.btn:active::after { background: rgba(0,0,0,0.08); }

.btn:disabled,
.btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary */
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.4);
}

.btn-primary:active { transform: translateY(0); }

/* Secondary */
.btn-secondary {
  background: var(--secondary);
  color: var(--white);
  border-color: var(--secondary);
}

.btn-secondary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  transform: translateY(-1px);
}

/* Accent */
.btn-accent {
  background: var(--accent);
  color: var(--dark);
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}

.btn-accent:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: var(--dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6,182,212,0.4);
}

/* Outline */
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-outline-accent {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline-accent:hover {
  background: var(--accent);
  color: var(--dark);
}

.btn-outline-white {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.6);
}

.btn-outline-white:hover {
  background: var(--white);
  color: var(--primary);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--light);
  color: var(--dark);
}

/* Danger */
.btn-danger {
  background: var(--error);
  color: var(--white);
  border-color: var(--error);
}

.btn-danger:hover {
  background: #DC2626;
  border-color: #DC2626;
  color: var(--white);
}

/* Sizes */
.btn-xs {
  padding: 0.25rem 0.625rem;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn-sm {
  padding: 0.438rem 0.875rem;
  font-size: var(--text-sm);
}

.btn-lg {
  padding: 0.75rem 1.75rem;
  font-size: var(--text-base);
  border-radius: var(--radius-md);
}

.btn-xl {
  padding: 1rem 2.25rem;
  font-size: var(--text-lg);
  border-radius: var(--radius-md);
}

.btn-block { width: 100%; }

/* Icon button */
.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.btn-icon.btn-sm { width: 30px; height: 30px; }
.btn-icon.btn-lg { width: 46px; height: 46px; }

/* Loading state */
.btn.loading {
  pointer-events: none;
  opacity: 0.75;
}

.btn.loading .btn-text { opacity: 0; }

.btn.loading::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ============================================================
   7. CARDS
   ============================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.card-hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.card-body { padding: var(--space-6); }

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--dark);
  margin: 0;
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* Glass Card */
.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.glass-card-dark {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  color: var(--white);
}

/* Gradient Card */
.card-gradient-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  border: none;
}

.card-gradient-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: var(--dark);
  border: none;
}

/* Course Card */
.course-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.course-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.course-card-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.course-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.course-card:hover .course-card-thumbnail img {
  transform: scale(1.05);
}

.course-card-thumbnail-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.6) 100%);
}

.course-card-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
}

.course-card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,0.9);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--transition);
  backdrop-filter: blur(4px);
}

.course-card:hover .course-card-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.course-card-body {
  padding: var(--space-5);
}

.course-card-category {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: var(--space-2);
}

.course-card-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--dark);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-card-instructor {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.course-card-instructor img {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.course-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-light);
  margin-bottom: var(--space-4);
}

.course-card-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.course-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-light);
}

.course-card-price {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--primary);
}

.course-card-price-old {
  font-size: var(--text-sm);
  color: var(--text-light);
  text-decoration: line-through;
  margin-left: var(--space-2);
}

/* Stat Card */
.stat-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  transition: all var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.stat-card-icon.primary   { background: rgba(37,99,235,0.1);  color: var(--primary); }
.stat-card-icon.secondary { background: rgba(15,23,42,0.1);  color: var(--secondary); }
.stat-card-icon.accent    { background: rgba(6,182,212,0.1);  color: var(--accent); }
.stat-card-icon.error     { background: rgba(239,68,68,0.1);   color: var(--error); }
.stat-card-icon.success   { background: rgba(16,185,129,0.1);  color: var(--success); }
.stat-card-icon.info      { background: rgba(59,130,246,0.1);  color: var(--info); }

.stat-card-content { flex: 1; }

.stat-card-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: var(--font-medium);
  margin-bottom: var(--space-1);
}

.stat-card-value {
  font-size: var(--text-3xl);
  font-weight: var(--font-extrabold);
  color: var(--dark);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-card-trend {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.stat-card-trend.up   { background: var(--success-bg); color: var(--success); }
.stat-card-trend.down { background: var(--error-bg);   color: var(--error); }
.stat-card-trend.neutral { background: var(--light); color: var(--text-muted); }

/* ============================================================
   8. FORMS
   ============================================================ */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--dark);
  margin-bottom: var(--space-2);
}

.form-label .required {
  color: var(--error);
  margin-left: var(--space-1);
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: var(--text-sm);
  font-family: inherit;
  line-height: 1.5;
  color: var(--text);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  appearance: none;
}

.form-control:hover { border-color: var(--primary-light); }

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

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

.form-control:disabled,
.form-control[readonly] {
  background: var(--bg);
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-control.is-valid {
  border-color: var(--success);
}

.form-control.is-valid:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-control.is-invalid {
  border-color: var(--error);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-control-lg {
  padding: 0.75rem 1rem;
  font-size: var(--text-base);
  border-radius: var(--radius-md);
}

.form-control-sm {
  padding: 0.375rem 0.625rem;
  font-size: var(--text-xs);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.valid-feedback {
  font-size: var(--text-xs);
  color: var(--success);
  margin-top: var(--space-1);
  display: none;
}

.invalid-feedback {
  font-size: var(--text-xs);
  color: var(--error);
  margin-top: var(--space-1);
  display: none;
}

.is-valid ~ .valid-feedback,
.is-invalid ~ .invalid-feedback {
  display: block;
}

/* Input Group */
.input-group {
  display: flex;
  position: relative;
}

.input-group .form-control {
  flex: 1;
}

.input-group-prepend,
.input-group-append {
  display: flex;
  align-items: center;
}

.input-group-text {
  padding: 0.625rem 0.875rem;
  font-size: var(--text-sm);
  color: var(--text-muted);
  background: var(--bg);
  border: 1.5px solid var(--border);
}

.input-group-prepend .input-group-text {
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
}

.input-group-prepend + .form-control {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.input-group-append .input-group-text {
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.input-group .form-control:not(:last-child) {
  border-radius: var(--radius) 0 0 var(--radius);
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  cursor: pointer;
}

.form-check-input {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  appearance: none;
  background: var(--white);
  transition: all var(--transition-fast);
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
}

.form-check-input:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.form-check-input:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.form-check-input[type="radio"] {
  border-radius: var(--radius-full);
}

.form-check-input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: var(--radius-full);
  border: none;
  transform: none;
}

.form-check-label {
  font-size: var(--text-sm);
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

/* File Upload */
.file-upload {
  position: relative;
  display: block;
  width: 100%;
}

.file-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-10) var(--space-6);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.file-upload:hover .file-upload-label,
.file-upload.dragover .file-upload-label {
  border-color: var(--primary);
  background: rgba(37,99,235,0.04);
}

.file-upload-icon {
  font-size: 2.5rem;
  color: var(--primary-light);
}

.file-upload-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--dark);
}

.file-upload-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Character counter */
.char-counter {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: right;
  margin-top: var(--space-1);
}

.char-counter.warning { color: var(--warning); }
.char-counter.error   { color: var(--error); }

/* ============================================================
   9. BADGES / PILLS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.2rem 0.625rem;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  line-height: 1.4;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-primary   { background: rgba(37,99,235,0.12);  color: var(--primary); }
.badge-secondary { background: rgba(15,23,42,0.12);  color: var(--secondary); }
.badge-accent    { background: rgba(6,182,212,0.15);  color: #155E75; }
.badge-success   { background: rgba(16,185,129,0.12);  color: #065F46; }
.badge-error     { background: rgba(239,68,68,0.12);   color: #991B1B; }
.badge-warning   { background: rgba(245,158,11,0.12);  color: #92400E; }
.badge-info      { background: rgba(59,130,246,0.12);  color: #1E40AF; }
.badge-dark      { background: var(--dark);             color: var(--white); }
.badge-light     { background: var(--light);            color: var(--text-muted); }

/* Semantic status aliases — reuse the color set above, named for what
   dashboard tables/cards actually display (status columns, not raw colors). */
.badge-active,
.badge-published,
.badge-completed,
.badge-paid,
.badge-approved,
.badge-passed      { background: rgba(16,185,129,0.12); color: #065F46; }

.badge-pending,
.badge-reviewing,
.badge-in-progress { background: rgba(245,158,11,0.12); color: #92400E; }

.badge-suspended,
.badge-failed,
.badge-unpaid,
.badge-rejected,
.badge-cancelled,
.badge-overdue     { background: rgba(239,68,68,0.12);  color: #991B1B; }

.badge-draft,
.badge-inactive,
.badge-archived    { background: rgba(100,116,139,0.12); color: #475569; }

.badge-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.badge-new {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  animation: pulse 2s infinite;
}

.badge-dot {
  padding-left: var(--space-2);
}

.badge-dot::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
  margin-right: var(--space-1);
}

/* ============================================================
   10. ALERTS / NOTIFICATIONS
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid;
  font-size: var(--text-sm);
  animation: fadeInDown 0.3s ease;
}

.alert-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-content { flex: 1; }
.alert-title   { font-weight: var(--font-semibold); margin-bottom: var(--space-1); }

.alert-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 0;
  line-height: 1;
  transition: opacity var(--transition-fast);
}

.alert-close:hover { opacity: 1; }

.alert-success {
  background: var(--success-bg);
  border-color: rgba(16,185,129,0.3);
  color: #065F46;
}

.alert-error {
  background: var(--error-bg);
  border-color: rgba(239,68,68,0.3);
  color: #991B1B;
}

.alert-warning {
  background: var(--warning-bg);
  border-color: rgba(245,158,11,0.3);
  color: #92400E;
}

.alert-info {
  background: var(--info-bg);
  border-color: rgba(59,130,246,0.3);
  color: #1E40AF;
}

/* ============================================================
   11. NAVIGATION / NAVBAR
   ============================================================ */
.navbar {
  height: var(--navbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding-inline: var(--space-6);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  transition: all var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
  border-bottom-color: transparent;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--primary);
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-brand img {
  height: 40px;
  width: auto;
}

.navbar-brand-text {
  line-height: 1.1;
}

.navbar-brand-sub {
  font-size: var(--text-xs);
  font-weight: var(--font-normal);
  color: var(--text-muted);
  display: block;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.navbar-nav .nav-link:hover {
  color: var(--primary);
  background: rgba(37,99,235,0.06);
}

.navbar-nav .nav-link.active {
  color: var(--primary);
  background: rgba(37,99,235,0.08);
  font-weight: var(--font-semibold);
}

.navbar-toggler {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  transition: background var(--transition-fast);
}

.navbar-toggler:hover { background: var(--light); }

.navbar-toggler-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: all var(--transition);
}

.navbar-toggler.active .navbar-toggler-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.navbar-toggler.active .navbar-toggler-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.navbar-toggler.active .navbar-toggler-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Dropdown in navbar */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.nav-dropdown-item:hover {
  background: rgba(37,99,235,0.06);
  color: var(--primary);
}

/* ============================================================
   12. SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--dark);
  color: var(--white);
  display: flex;
  flex-direction: column;
  transition: width var(--transition), transform var(--transition);
  z-index: var(--z-fixed);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-width); }

.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  transition: opacity var(--transition);
}

.sidebar.collapsed .sidebar-title { opacity: 0; width: 0; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-4) var(--space-3);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-section-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  padding: var(--space-4) var(--space-3) var(--space-2);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}

.sidebar.collapsed .sidebar-section-label { opacity: 0; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: all var(--transition-fast);
  margin-bottom: 2px;
  white-space: nowrap;
  position: relative;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.08);
  color: var(--white);
}

.sidebar-link.active {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
}

.sidebar-link .sidebar-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.sidebar-link-text {
  overflow: hidden;
  opacity: 1;
  transition: opacity var(--transition);
}

.sidebar.collapsed .sidebar-link-text { opacity: 0; width: 0; overflow: hidden; }

.sidebar-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--dark);
  font-size: 10px;
  font-weight: var(--font-bold);
  padding: 1px 7px;
  border-radius: var(--radius-full);
  transition: opacity var(--transition);
}

.sidebar.collapsed .sidebar-badge { opacity: 0; }

.sidebar-tooltip {
  position: absolute;
  left: calc(100% + 12px);
  background: var(--dark);
  color: var(--white);
  font-size: var(--text-xs);
  padding: 4px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  box-shadow: var(--shadow-md);
}

.sidebar.collapsed .sidebar-link:hover .sidebar-tooltip { opacity: 1; }

.sidebar-footer {
  padding: var(--space-4) var(--space-3);
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.sidebar-user:hover { background: rgba(255,255,255,0.08); }

.sidebar-user-info {
  overflow: hidden;
  transition: opacity var(--transition);
}

.sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; overflow: hidden; }

.sidebar-user-name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--white);
  white-space: nowrap;
}

.sidebar-user-role {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}

/* ============================================================
   13. TABLES
   ============================================================ */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table thead tr {
  background: var(--bg);
  border-bottom: 2px solid var(--border-light);
}

.table thead th {
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
}

.table thead th.sortable { cursor: pointer; user-select: none; }
.table thead th.sortable:hover { color: var(--primary); }

.table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}

.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: rgba(37,99,235,0.03); }

.table tbody td {
  padding: var(--space-4) var(--space-5);
  color: var(--text);
  vertical-align: middle;
}

.table-striped tbody tr:nth-child(even) {
  background: var(--bg);
}

.table-striped tbody tr:nth-child(even):hover {
  background: rgba(37,99,235,0.03);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ============================================================
   14. PROGRESS BARS
   ============================================================ */
.progress {
  width: 100%;
  height: 8px;
  background: var(--light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-sm  { height: 4px; }
.progress-md  { height: 10px; }
.progress-lg  { height: 14px; }

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-full);
  animation: progressBar 0.8s ease;
  transition: width 0.6s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

.progress-bar-success { background: linear-gradient(90deg, var(--success), #34D399); }
.progress-bar-accent  { background: linear-gradient(90deg, var(--accent), var(--accent-light)); }
.progress-bar-error   { background: linear-gradient(90deg, var(--error), #F87171); }
.progress-bar-info    { background: linear-gradient(90deg, var(--info), #60A5FA); }

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

/* ============================================================
   15. AVATARS
   ============================================================ */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--primary);
  color: var(--white);
  font-weight: var(--font-semibold);
  flex-shrink: 0;
}

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

.avatar-xs  { width: 24px;  height: 24px;  font-size: 10px; }
.avatar-sm  { width: 32px;  height: 32px;  font-size: var(--text-xs); }
.avatar     { width: 40px;  height: 40px;  font-size: var(--text-sm); }
.avatar-md  { width: 48px;  height: 48px;  font-size: var(--text-base); }
.avatar-lg  { width: 64px;  height: 64px;  font-size: var(--text-xl); }
.avatar-xl  { width: 80px;  height: 80px;  font-size: var(--text-2xl); }
.avatar-2xl { width: 96px;  height: 96px;  font-size: var(--text-3xl); }

.avatar-square { border-radius: var(--radius-md); }

.avatar-group {
  display: flex;
}

.avatar-group .avatar {
  border: 2px solid var(--white);
  margin-left: -8px;
}

.avatar-group .avatar:first-child { margin-left: 0; }

/* Online indicator */
.avatar-wrapper {
  position: relative;
  display: inline-flex;
}

.avatar-status {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  border: 2px solid var(--white);
}

.avatar-status.online  { background: var(--success); animation: pulseDot 2s infinite; }
.avatar-status.offline { background: var(--text-light); }
.avatar-status.busy    { background: var(--error); }
.avatar-status.away    { background: var(--warning); }

/* ============================================================
   16. PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-item .page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  background: var(--white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  user-select: none;
}

.page-item .page-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(37,99,235,0.05);
}

.page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-primary);
}

.page-item.disabled .page-link {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   17. MODALS
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.25s ease;
  position: relative;
  overflow: hidden;
}

.modal-sm  { max-width: 400px; }
.modal-md  { max-width: 560px; }
.modal-lg  { max-width: 720px; }
.modal-xl  { max-width: 960px; }
.modal-full { max-width: 95vw; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--dark);
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.25rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--light);
  color: var(--dark);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

/* ============================================================
   18. DROPDOWNS
   ============================================================ */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu.left { right: auto; left: 0; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: rgba(37,99,235,0.06);
  color: var(--primary);
}

.dropdown-item.danger:hover {
  background: var(--error-bg);
  color: var(--error);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-2) 0;
}

.dropdown-header {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* ============================================================
   19. TABS
   ============================================================ */
.tabs {
  display: flex;
  flex-direction: column;
}

.tabs-nav {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-nav::-webkit-scrollbar { display: none; }

.tab-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--transition-fast);
  text-decoration: none;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

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

.tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: var(--font-semibold);
}

.tabs-content { padding-top: var(--space-6); }

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease;
}

.tab-pane.active { display: block; }

/* Pills tabs variant */
.tabs-pills .tabs-nav {
  border-bottom: none;
  gap: var(--space-2);
  background: var(--bg);
  padding: var(--space-2);
  border-radius: var(--radius-lg);
}

.tabs-pills .tab-item {
  border-bottom: none;
  border-radius: var(--radius);
  margin-bottom: 0;
  padding: var(--space-2) var(--space-4);
}

.tabs-pills .tab-item.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   20. TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 300px;
  max-width: 420px;
  padding: var(--space-4) var(--space-5);
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid;
  pointer-events: all;
  animation: toastSlideIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1);
}

.toast.hiding { animation: toastSlideOut 0.3s ease forwards; }

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

.toast-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error   .toast-icon { color: var(--error); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info    .toast-icon { color: var(--info); }

.toast-body { flex: 1; }

.toast-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--dark);
  margin-bottom: 2px;
}

.toast-message {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
}

.toast-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.toast-close:hover { color: var(--dark); }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.3;
  animation: progressBar 5s linear forwards;
  border-radius: 0 0 0 var(--radius-xl);
}

/* ============================================================
   21. LOADING / SKELETON
   ============================================================ */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(37,99,235,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 36px; height: 36px; border-width: 4px; }
.spinner-xl { width: 48px; height: 48px; border-width: 4px; }

.spinner-white {
  border-color: rgba(255,255,255,0.3);
  border-top-color: white;
}

.skeleton {
  background: linear-gradient(90deg, var(--light) 25%, #f1f5f9 50%, var(--light) 75%);
  background-size: 1000px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius);
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-2);
}

.skeleton-text.w-3-4 { width: 75%; }
.skeleton-text.w-1-2 { width: 50%; }
.skeleton-text.w-1-4 { width: 25%; }

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

.skeleton-card {
  height: 200px;
  border-radius: var(--radius-lg);
}

.skeleton-btn {
  height: 38px;
  width: 100px;
  border-radius: var(--radius);
}

/* Full page loader */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  z-index: 9999;
}

.page-loader-logo {
  width: 64px;
  height: 64px;
  animation: float 2s ease-in-out infinite;
}

/* ============================================================
   22. RATING STARS
   ============================================================ */
.rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.rating-star {
  font-size: 0.875rem;
  line-height: 1;
  color: var(--light);
}

.rating-star.filled { color: var(--accent); }
.rating-star.half   {
  position: relative;
  color: var(--light);
}

.rating-star.half::before {
  content: attr(data-icon);
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  overflow: hidden;
  color: var(--accent);
}

.rating-value {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--dark);
  margin-left: var(--space-1);
}

.rating-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-left: 2px;
}

/* Interactive rating */
.rating-input {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 2px;
}

.rating-input input { display: none; }

.rating-input label {
  font-size: 1.25rem;
  color: var(--light);
  cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.rating-input label:hover,
.rating-input label:hover ~ label,
.rating-input input:checked ~ label {
  color: var(--accent);
}

.rating-input label:hover { transform: scale(1.2); }

/* ============================================================
   23. TIMELINE / ACTIVITY FEED
   ============================================================ */
.timeline {
  position: relative;
  padding-left: var(--space-8);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border-light);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-6);
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: calc(-1 * var(--space-8) + 8px);
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  border: 3px solid var(--white);
  box-shadow: 0 0 0 2px var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-dot.primary { background: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.2); }
.timeline-dot.success { background: var(--success); box-shadow: 0 0 0 2px rgba(16,185,129,0.2); }
.timeline-dot.warning { background: var(--warning); box-shadow: 0 0 0 2px rgba(245,158,11,0.2); }
.timeline-dot.error   { background: var(--error);   box-shadow: 0 0 0 2px rgba(239,68,68,0.2); }

.timeline-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.timeline-content {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.timeline-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--dark);
  margin-bottom: var(--space-1);
}

.timeline-body {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ============================================================
   24. SCROLL TO TOP
   ============================================================ */
.scroll-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all var(--transition);
  z-index: var(--z-fixed);
  font-size: 1rem;
}

.scroll-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.scroll-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
}

/* ============================================================
   25. RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (max-width: 1280px) {
  :root { --container-xl: 1120px; }
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

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

  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
}

@media (max-width: 768px) {
  :root {
    --navbar-height: 60px;
    --topbar-height: 56px;
  }

  .container { padding-inline: var(--space-4); }

  .navbar-nav { display: none; }
  .navbar-nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-4);
    gap: var(--space-1);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-sticky);
    animation: slideInDown 0.25s ease;
  }

  .navbar-toggler { display: flex; }

  .grid-cols-4,
  .grid-cols-3,
  .grid-cols-2 { grid-template-columns: 1fr; }

  .modal-backdrop { padding: var(--space-3); align-items: flex-end; }
  .modal { border-radius: var(--radius-2xl) var(--radius-2xl) 0 0; max-height: 92vh; }

  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
    top: auto;
    bottom: var(--space-4);
  }

  .toast { min-width: unset; max-width: 100%; }

  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }

  .d-md-none { display: none !important; }
}

@media (max-width: 480px) {
  .btn-xl { padding: 0.75rem 1.5rem; font-size: var(--text-base); }
  .stat-card { flex-direction: column; }
  .tabs-nav { gap: 0; }
  .tab-item { padding: var(--space-3) var(--space-3); font-size: var(--text-xs); }
}

/* ============================================================
   26. DARK MODE UTILITIES
   ============================================================ */
.dark-bg {
  background: var(--dark);
  color: var(--white);
}

.dark-bg .card {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}

/* ============================================================
   27. SPECIAL EFFECTS
   ============================================================ */
.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-gold {
  background: linear-gradient(135deg, #F59E0B 0%, #FCD34D 50%, #D97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glow-primary {
  box-shadow: 0 0 20px rgba(37,99,235,0.4), 0 0 40px rgba(37,99,235,0.2);
}

.glow-accent {
  box-shadow: 0 0 20px rgba(6,182,212,0.4), 0 0 40px rgba(6,182,212,0.2);
}

.blur-bg {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Hover card lift effect */
.lift {
  transition: transform var(--transition), box-shadow var(--transition);
}

.lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}

/* Section padding */
.section-padding {
  padding-block: var(--space-20);
}

.section-padding-sm {
  padding-block: var(--space-12);
}
