:root {
  --bs-body-font-size: 0.875rem;

  /* ============================================ */
  /* MODERN TYPOGRAPHY SYSTEM */
  /* ============================================ */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.6;
  --line-height-loose: 1.75;

  /* Letter Spacing */
  --letter-spacing-tight: -0.02em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.025em;
  --letter-spacing-wider: 0.05em;
  --letter-spacing-widest: 0.1em;

  /* ============================================ */
  /* ENHANCED COLOR PALETTE - PROFESSIONAL INDIGO/SLATE */
  /* ============================================ */

  /* Primary Brand Colors - Deep Indigo */
  --color-primary: #1e1b4b;
  --color-primary-light: #312e81;
  --color-primary-dark: #1e3a8a;
  --color-primary-50: #eef2ff;
  --color-primary-100: #e0e7ff;
  --color-primary-200: #c7d2fe;
  --color-primary-300: #a5b4fc;
  --color-primary-400: #818cf8;
  --color-primary-500: #6366f1;
  --color-primary-600: #4f46e5;
  --color-primary-700: #4338ca;
  --color-primary-800: #3730a3;
  --color-primary-900: #312e81;

  /* Accent Colors - Electric Violet */
  --color-accent: #4f46e5;
  --color-accent-hover: #4338ca;
  --color-accent-light: #6366f1;
  --color-accent-lighter: #818cf8;
  --color-accent-dark: #3730a3;

  /* Comprehensive Slate Scale */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Background Colors */
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-secondary: #f1f5f9;
  --bg-elevated: #ffffff;

  /* Border Colors */
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-dark: #94a3b8;

  /* Text Colors */
  --text-heading: #0f172a;
  --text-body: #475569;
  --text-muted: #64748b;
  --text-disabled: #94a3b8;
  --text-inverse: #ffffff;

  /* Status Colors - Success (Emerald) */
  --color-success: #10b981;
  --color-success-light: #34d399;
  --color-success-lighter: #6ee7b7;
  --color-success-dark: #059669;
  --color-success-bg: #ecfdf5;
  --color-success-border: #a7f3d0;

  /* Status Colors - Warning (Amber) */
  --color-warning: #f59e0b;
  --color-warning-light: #fbbf24;
  --color-warning-lighter: #fcd34d;
  --color-warning-dark: #d97706;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;

  /* Status Colors - Error (Red) */
  --color-error: #ef4444;
  --color-error-light: #f87171;
  --color-error-lighter: #fca5a5;
  --color-error-dark: #dc2626;
  --color-error-bg: #fef2f2;
  --color-error-border: #fecaca;

  /* Status Colors - Info (Blue) */
  --color-info: #3b82f6;
  --color-info-light: #60a5fa;
  --color-info-lighter: #93c5fd;
  --color-info-dark: #2563eb;
  --color-info-bg: #eff6ff;
  --color-info-border: #bfdbfe;

  /* Shadow System */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-default: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

  /* Border Radius System */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
}

[data-bs-theme=dark] {
  --bs-body-bg: #212121;
  --bs-body-color: #dddddd;

  /* Dark Mode: Adjusted Primary Colors (lighter for visibility) */
  --color-primary: #6366f1;
  --color-primary-light: #818cf8;
  --color-primary-dark: #4f46e5;

  /* Dark Mode: Adjusted Accent Colors */
  --color-accent: #818cf8;
  --color-accent-hover: #a5b4fc;
  --color-accent-light: #c7d2fe;
  --color-accent-lighter: #e0e7ff;
  --color-accent-dark: #6366f1;

  /* Dark Mode: Background Colors (using darker slates) */
  --color-bg-primary: #0f172a;
  --color-bg-secondary: #1e293b;
  --color-bg-surface: #1e293b;
  --color-bg-elevated: #334155;
  --color-bg-hover: #334155;

  /* Dark Mode: Border Colors */
  --color-border-light: #334155;
  --color-border-default: #475569;
  --color-border-strong: #64748b;

  /* Dark Mode: Text Colors (lighter for readability) */
  --color-text-primary: #f8fafc;
  --color-text-secondary: #cbd5e1;
  --color-text-tertiary: #94a3b8;
  --color-text-muted: #64748b;

  /* Dark Mode: Status Colors (adjusted for dark backgrounds) */
  --color-success: #34d399;
  --color-success-light: #6ee7b7;
  --color-success-dark: #10b981;
  --color-success-bg: #064e3b;
  --color-success-border: #065f46;

  --color-warning: #fbbf24;
  --color-warning-light: #fcd34d;
  --color-warning-dark: #f59e0b;
  --color-warning-bg: #78350f;
  --color-warning-border: #92400e;

  --color-error: #f87171;
  --color-error-light: #fca5a5;
  --color-error-dark: #ef4444;
  --color-error-bg: #7f1d1d;
  --color-error-border: #991b1b;

  --color-info: #60a5fa;
  --color-info-light: #93c5fd;
  --color-info-dark: #3b82f6;
  --color-info-bg: #1e3a8a;
  --color-info-border: #1e40af;

  /* Dark Mode: Enhanced Shadows (stronger for depth) */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-default: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.6);
}

body {
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-relaxed);
  background-color: #f0f5f8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

[data-bs-theme="dark"] body {
  background-color: #18191A;
}

/* ============================================ */
/* MODERN TYPOGRAPHY HIERARCHY */
/* ============================================ */

/* Headings - Modern & Clean */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: #0f172a;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6,
[data-bs-theme="dark"] .h1,
[data-bs-theme="dark"] .h2,
[data-bs-theme="dark"] .h3,
[data-bs-theme="dark"] .h4,
[data-bs-theme="dark"] .h5,
[data-bs-theme="dark"] .h6 {
  color: #f8fafc;
}

/* H1 - Hero Headlines */
h1, .h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

/* H2 - Section Headings */
h2, .h2 {
  font-size: clamp(1.625rem, 4vw, 2.125rem);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  line-height: 1.2;
  margin-bottom: 1rem;
}

/* H3 - Subsection Headings */
h3, .h3 {
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-normal);
  line-height: 1.25;
  margin-bottom: 0.875rem;
}

/* H4 - Component Headings */
h4, .h4 {
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-normal);
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

/* H5 - Small Headings */
h5, .h5 {
  font-size: clamp(1rem, 2vw, 1.125rem);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-normal);
  line-height: 1.35;
  margin-bottom: 0.625rem;
}

/* H6 - Micro Headings */
h6, .h6 {
  font-size: 1rem;
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-wide);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  color: #475569;
}

[data-bs-theme="dark"] h6,
[data-bs-theme="dark"] .h6 {
  color: #cbd5e1;
}

/* Body Text */
p {
  font-size: 1rem;
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-relaxed);
  color: #475569;
  margin-top: 0;
  margin-bottom: 1rem;
}

[data-bs-theme="dark"] p {
  color: #cbd5e1;
}

/* Lead Text */
.lead {
  font-size: 1.125rem;
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-loose);
  color: #64748b;
  margin-bottom: 1.5rem;
}

[data-bs-theme="dark"] .lead {
  color: #94a3b8;
}

/* Small Text */
small, .small {
  font-size: 0.875rem;
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: #64748b;
}

[data-bs-theme="dark"] small,
[data-bs-theme="dark"] .small {
  color: #94a3b8;
}

/* Text Utilities */
.text-emphasis {
  font-weight: var(--font-weight-semibold);
  color: #1e293b;
}

[data-bs-theme="dark"] .text-emphasis {
  color: #f1f5f9;
}

/* Font Weight Utilities */
.fw-light { font-weight: var(--font-weight-light) !important; }
.fw-regular { font-weight: var(--font-weight-regular) !important; }
.fw-medium { font-weight: var(--font-weight-medium) !important; }
.fw-semibold { font-weight: var(--font-weight-semibold) !important; }
.fw-bold { font-weight: var(--font-weight-bold) !important; }
.fw-extrabold { font-weight: var(--font-weight-extrabold) !important; }

/* Letter Spacing Utilities */
.tracking-tight { letter-spacing: var(--letter-spacing-tight) !important; }
.tracking-normal { letter-spacing: var(--letter-spacing-normal) !important; }
.tracking-wide { letter-spacing: var(--letter-spacing-wide) !important; }
.tracking-wider { letter-spacing: var(--letter-spacing-wider) !important; }
.tracking-widest { letter-spacing: var(--letter-spacing-widest) !important; }

/* Line Height Utilities */
.leading-tight { line-height: var(--line-height-tight) !important; }
.leading-normal { line-height: var(--line-height-normal) !important; }
.leading-relaxed { line-height: var(--line-height-relaxed) !important; }
.leading-loose { line-height: var(--line-height-loose) !important; }

/* ============================================ */
/* END TYPOGRAPHY SYSTEM */
/* ============================================ */

/* ============================================ */
/* COLOR UTILITY CLASSES */
/* ============================================ */

/* Background Color Utilities */
.bg-primary { background-color: var(--color-primary) !important; }
.bg-primary-light { background-color: var(--color-primary-light) !important; }
.bg-primary-dark { background-color: var(--color-primary-dark) !important; }
.bg-accent { background-color: var(--color-accent) !important; }
.bg-surface { background-color: var(--color-bg-surface) !important; }
.bg-elevated { background-color: var(--color-bg-elevated) !important; }

/* Slate Background Utilities */
.bg-slate-50 { background-color: var(--slate-50) !important; }
.bg-slate-100 { background-color: var(--slate-100) !important; }
.bg-slate-200 { background-color: var(--slate-200) !important; }
.bg-slate-300 { background-color: var(--slate-300) !important; }
.bg-slate-400 { background-color: var(--slate-400) !important; }
.bg-slate-500 { background-color: var(--slate-500) !important; }
.bg-slate-600 { background-color: var(--slate-600) !important; }
.bg-slate-700 { background-color: var(--slate-700) !important; }
.bg-slate-800 { background-color: var(--slate-800) !important; }
.bg-slate-900 { background-color: var(--slate-900) !important; }

/* Status Background Utilities */
.bg-success { background-color: var(--color-success) !important; }
.bg-success-light { background-color: var(--color-success-bg) !important; }
.bg-warning { background-color: var(--color-warning) !important; }
.bg-warning-light { background-color: var(--color-warning-bg) !important; }
.bg-error { background-color: var(--color-error) !important; }
.bg-error-light { background-color: var(--color-error-bg) !important; }
.bg-info { background-color: var(--color-info) !important; }
.bg-info-light { background-color: var(--color-info-bg) !important; }

/* Text Color Utilities */
.text-primary { color: var(--color-primary) !important; }
.text-accent { color: var(--color-accent) !important; }
.text-muted { color: var(--color-text-muted) !important; }
.text-secondary { color: var(--color-text-secondary) !important; }
.text-tertiary { color: var(--color-text-tertiary) !important; }

/* Slate Text Utilities */
.text-slate-50 { color: var(--slate-50) !important; }
.text-slate-100 { color: var(--slate-100) !important; }
.text-slate-200 { color: var(--slate-200) !important; }
.text-slate-300 { color: var(--slate-300) !important; }
.text-slate-400 { color: var(--slate-400) !important; }
.text-slate-500 { color: var(--slate-500) !important; }
.text-slate-600 { color: var(--slate-600) !important; }
.text-slate-700 { color: var(--slate-700) !important; }
.text-slate-800 { color: var(--slate-800) !important; }
.text-slate-900 { color: var(--slate-900) !important; }

/* Status Text Utilities */
.text-success { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-error { color: var(--color-error) !important; }
.text-info { color: var(--color-info) !important; }

/* Border Color Utilities */
.border-light { border-color: var(--color-border-light) !important; }
.border-default { border-color: var(--color-border-default) !important; }
.border-strong { border-color: var(--color-border-strong) !important; }
.border-primary { border-color: var(--color-primary) !important; }
.border-accent { border-color: var(--color-accent) !important; }

/* Status Border Utilities */
.border-success { border-color: var(--color-success-border) !important; }
.border-warning { border-color: var(--color-warning-border) !important; }
.border-error { border-color: var(--color-error-border) !important; }
.border-info { border-color: var(--color-info-border) !important; }

/* Shadow Utilities */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow-default) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }
.shadow-2xl { box-shadow: var(--shadow-2xl) !important; }
.shadow-none { box-shadow: none !important; }

/* Border Radius Utilities */
.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded { border-radius: var(--radius-md) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-2xl { border-radius: var(--radius-2xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }
.rounded-none { border-radius: 0 !important; }

/* Hover State Utilities */
.hover-bg-primary:hover { background-color: var(--color-primary) !important; }
.hover-bg-accent:hover { background-color: var(--color-accent-hover) !important; }
.hover-text-primary:hover { color: var(--color-primary) !important; }
.hover-text-accent:hover { color: var(--color-accent) !important; }

/* Interactive Background with Transition */
.bg-hover {
  background-color: var(--color-bg-surface);
  transition: background-color 0.2s ease;
}
.bg-hover:hover {
  background-color: var(--color-bg-hover);
}

/* ============================================ */
/* END COLOR UTILITY CLASSES */
/* ============================================ */

.navbar {
  height: 65px;
  background-color: #f0f5f8;
  border-bottom: 1px solid rgba(70, 70, 70, 0.1);
}

[data-bs-theme=dark] .navbar {
  background-color: #18191A;
  border-bottom: 1px solid rgba(218, 218, 218, 0.1);
}

.navbar .nav-link {
  color: #34303d;
  font-weight: 600;
  border-radius: 5px;
  margin-left: .25rem;
  margin-right: .25rem;
  padding-left: .75rem;
  padding-right: .75rem;
  transition: all .2s ease-in-out;
}

[data-bs-theme=dark] .navbar .nav-link {
  color: #c6cace;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  background-color: rgba(181, 172, 233, 0.1);
}

[data-bs-theme=dark] .navbar .nav-link:hover,
[data-bs-theme=dark] .navbar .nav-link.active {
  color: #c6cace;
  background-color: rgba(137, 130, 173, 0.1);
}

.navbar-dark {
  color: #dddada;
  background-color: #131414 !important;
}

.navbar-dark .nav-link {
  color: #dddada;
}

.navbar-toggler {
  padding: 0;
  box-shadow: none !important;
  border: 0 !important;
}

.navbar-brand {
  padding: 0;
  margin: 0;
  font-weight: 700;
  font-size: 1.5rem;
}

.site-logo {
  width: auto;
  height: 32px;
  outline: 0;
}

[data-bs-theme=auto] .logo-light,
[data-bs-theme=light] .logo-light {
  display: none;
}

[data-bs-theme=dark] .logo-dark {
  display: none;
}

/* Main and Sidebar */
main {
  padding-top: 65px;
}

.main {
  padding-top: 1rem;
  margin-bottom: 1rem;
}

.sidebar-menu .nav-link {
  display: flex;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  margin-bottom: 5px;
  color: #5a6376;
  text-decoration: none;
  border-radius: 0.375rem;
  transition: all .1s ease-in-out;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-bs-theme=dark] .sidebar-menu .nav-link {
  color: #bbc0c5;
}

.sidebar-menu .nav-link span {
  color: #252d3d;
}

[data-bs-theme=dark] .sidebar-menu .nav-link span {
  color: #bbc0c5;
}

.sidebar-menu .nav-link:hover {
  background-color: rgba(181, 172, 233, 0.1);
}

[data-bs-theme=dark] .sidebar-menu .nav-link:hover {
  background-color: rgba(137, 130, 173, 0.1);
}

.sidebar-menu .nav-link.actived {
  background-color: rgba(137, 130, 173, 0.1);
}

[data-bs-theme=dark] .sidebar-menu .nav-link.actived,
[data-bs-theme=dark] .sidebar-menu .nav-link.actived span {
  color: #dee2e6;
}

.sidebar-menu .nav-link svg {
  margin-bottom: 2px;
}

.sidebar-menu .divider {
  margin: 10px 15px;
  position: relative;
  overflow: hidden;
}

.sidebar-menu .divider:after {
  content: '';
  position: absolute;
  width: 100%;
  top: 50%;
  margin-left: 10px;
  margin-top: 2px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

[data-bs-theme=dark] .sidebar-menu .divider:after {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Form and Button */

.btn-primary {
  --bs-btn-color: #ffffff;
  --bs-btn-bg: #281f56;
  --bs-btn-border-color: #211850;
  --bs-btn-hover-bg: #3c3174;
  --bs-btn-hover-border-color: #281f56;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #251b5a;
  --bs-btn-active-border-color: #281f56;
  --bs-btn-disabled-color: #ffffff;
  --bs-btn-disabled-bg: #423777;
  --bs-btn-disabled-border-color: #423777;
}

.btn-primary:hover {
  color: #ffffff;
}

.btn {
  font-size: 0.875rem;
}

.btn-close {
  opacity: 0.7;
}

.btn-close:hover {
  opacity: 0.95;
}

.btn-border {
  border: 1px solid #e1e1e1;
}

[data-bs-theme="dark"] .border {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.form-control:hover,
.form-select:hover,
.form-control:focus,
.form-select:focus,
.btn-close:focus {
  box-shadow: none;
  border-color: rgba(136, 66, 228, 0.5);
}

[data-bs-theme="dark"] .btn-light {
  color: #bbc0c5;
  background-color: var(--bs-body-bg);
  border-color: #464646;
}

[data-bs-theme="dark"] a.text-dark {
  color: #cecece !important;
}

.form-select {
  cursor: pointer;
}

.form-label {
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
  color: #334155;
  margin-bottom: 0.5rem;
  display: block;
  text-transform: uppercase;
}

[data-bs-theme="dark"] .form-label {
  color: #cbd5e1;
}

.form-check-label {
  font-family: var(--font-primary);
  font-size: 0.9375rem;
  font-weight: var(--font-weight-medium);
  color: #475569;
  line-height: var(--line-height-normal);
  cursor: pointer;
  transition: color 0.2s ease;
}

[data-bs-theme="dark"] .form-check-label {
  color: #cbd5e1;
}

.form-check-label:hover {
  color: #1e293b;
}

[data-bs-theme="dark"] .form-check-label:hover {
  color: #f1f5f9;
}

.form .form-select,
.form .form-control,
.form .form-control:focus,
.form .note-editor {
  background-color: #edf2f7;
}

[data-bs-theme="dark"] .form .form-select,
[data-bs-theme="dark"] .form .form-control,
[data-bs-theme="dark"] .form .form-control:focus,
[data-bs-theme="dark"] .form .note-editor {
  background-color: #1a1b1b;
}

form .form-select,
form .form-control {
  padding: 0.55rem 0.875rem;
}

.post-form .form-select,
.post-form .form-control,
.post-form .form-control:focus {
  background-color: #edf2f7;
}

[data-bs-theme="dark"] .post-form .form-select,
[data-bs-theme="dark"] .post-form .form-control,
[data-bs-theme="dark"] .post-form .form-control:focus {
  background-color: #1a1b1b;
}

.post-form .form-label {
  font-size: 0.875rem;
  font-weight: 600;
}

.hover-blue:hover,
a.hover-blue:hover {
  color: #254ef1 !important;
}

.hover-dark:hover {
  color: #717171 !important;
}

.hover-border:hover {
  border: 1px solid rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .hover-border:hover {
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.dropdown-menu {
  --bs-dropdown-link-active-color: #000000;
  --bs-dropdown-link-active-bg: rgba(137, 130, 173, 0.1);
  --bs-dropdown-min-width: 15rem;
  --bs-dropdown-padding-x: 0.875rem;
  --bs-dropdown-font-size: 0.838rem;
  --bs-dropdown-item-padding-y: 0.5rem;
  -webkit-animation-name: slideIn;
  animation-name: slideIn;
  animation-duration: 0.2s;
  -webkit-animation-duration: 0.2s;
  animation-fill-mode: both;
  -webkit-animation-fill-mode: both;
}

[data-bs-theme="dark"] .dropdown-menu {
  --bs-dropdown-link-active-color: #ffffff;
}

.dropdown-item {
  font-weight: 600;
  margin: 0.5rem 0;
  border-radius: 0.5rem;
}

.svg-icon-box {
  width: 56px;
  height: 56px;
  color: #000000;
  border: 1px solid #d3d3d3;
  border-radius: 50%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.svg-icon-box svg {
  width: 24px;
  height: 24px;
}

#pricing-tab.nav-pills .nav-link,
#pricing-tab.nav-pills .nav-link.active {
  border-radius: 0;
}

table th {
  font-weight: 600;
}

.card {
  border: 0;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 9%), 0 1px 2px 0 rgb(0 0 0 / 5%);
}

[data-bs-theme="dark"] .card-header.bg-white {
  background-color: var(--bs-body-bg) !important;
}

a.card:hover {
  box-shadow: 0 0.3rem 0.7rem rgba(0, 0, 0, 0.15) !important;
}

#template-group .nav-link {
  color: #6b6c77;
  transition: all .1s ease-in-out;
}

[data-bs-theme="dark"] #template-group .nav-link {
  color: #b9bac2;
}

#template-group .nav-link.active {
  border-radius: 1rem;
  padding: 0.5rem 0.75rem !important;
  background-color: rgba(174, 163, 235, 0.1);
}

.footer a {
  color: #1a1a1a;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline !important;
}

[data-bs-theme="dark"] .footer a {
  color: #d6d6d6;
  text-decoration: none;
}

.zoom {
  transition: all .2s ease-in-out;
}

.zoom:hover {
  transform: scale(1.05);
}

#pricing .nav-link {
  color: #000000;
  font-weight: 600;
}

[data-bs-theme="dark"] #pricing .nav-link {
  color: #ffffff;
}

#pricing .nav-link.active {
  color: #ffffff;
  background-color: #281f56;
}

.article {
  font-size: 1rem;
}

.article h1,
.article h2,
.article h3,
.article h4 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.article h1 {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.article h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.article h3 {
  font-size: 1.2rem;
}

/* Editor */
.editor {
  background-color: #ffffff;
}

[data-bs-theme="dark"] .editor {
  background-color: #131414;
}

.raitor-sidebar {
  width: 100%;
  position: relative;
  background-color: #ffffff !important;
  overflow: hidden;
}

.templateItem a {
  box-shadow: none;
  transition: all .2s ease-in-out;
}

.templateItem a:hover {
  border-color: rgba(146, 146, 146, 0.7) !important;
}

[data-bs-theme="dark"] .raitor-sidebar {
  background-color: #131414 !important;
}

.raitor-editor .ql-editor {
  font-size: 1rem;
  font-weight: 400;
  width: 100%;
  min-height: 400px;
}

.raitor-editor .ql-toolbar.ql-snow,
.raitor-editor .ql-container.ql-snow {
  border: 0px;
}

.raitor-editor .ql-toolbar.ql-snow {
  background-color: #ffffff;
  border-bottom: 1px solid rgba(53, 53, 53, 0.1);
  position: -webkit-sticky;
  position: sticky;
  top: 64px;
  text-align: center;
  z-index: 1020;
}

[data-bs-theme="dark"] .raitor-editor .ql-toolbar.ql-snow {
  background-color: #131414;
  border-bottom: 1px solid rgba(156, 156, 156, 0.1);
}

[data-bs-theme="dark"] .ql-toolbar .ql-stroke {
  fill: none;
  stroke: #a0a4a8;
}

[data-bs-theme="dark"] .ql-toolbar .ql-fill {
  fill: #a0a4a8;
  stroke: none;
}

[data-bs-theme="dark"] .ql-toolbar .ql-picker {
  color: #a0a4a8;
}

.ql-snow .ql-editor {
  font-size: 1rem;
  line-height: 1.8;
  font-weight: 400;
}

.ql-snow .ql-editor h1 {
  font-size: calc(1.325rem + 0.8vw);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.ql-snow .ql-editor h2 {
  font-size: calc(1.3rem + 0.5vw);
  margin-bottom: 0.375rem;
}

.ql-snow .ql-editor h3 {
  font-size: calc(1.275rem + 0.3vw);
  margin-bottom: 0.375rem;
}

.ql-snow .ql-editor h4 {
  font-size: 1.25rem;
  margin-bottom: 0.375rem;
}

.ql-snow .ql-editor h5 {
  font-size: 1rem;
  margin-bottom: 0.375rem;
}

.ql-snow .ql-editor h6 {
  font-size: 1rem;
  margin-bottom: 0.375rem;
}

.ql-snow .ql-editor p,
.ql-snow .ql-editor ul,
.ql-snow .ql-editor ol,
.ql-snow .ql-editor pre {
  margin-top: 0;
  margin-bottom: 1rem;
}

.border-0 .ql-container.ql-snow,
.border-0 .ql-snow .ql-tooltip,
.border-0 .ql-toolbar.ql-snow {
  border: 0px;
  text-align: center;
}

.border-0 .ql-snow .ql-editor h1:first-child {
  margin-bottom: 1.5rem;
}

.form-control-error {
  border-color: #fa8080;
}

.note-toolbar {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 62px !important;
  z-index: 9;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  background-color: #ffffff !important;
}

[data-bs-theme="dark"] .note-toolbar {
  background-color: #242424 !important;
}

.list-group-item.radio:hover {
  background-color: #f7f7f7;
  cursor: pointer;
}

/* Images */

.modal.lightbox {
  background-color: rgba(0, 0, 0, 0.9);
}

.modal.lightbox .modal-dialog .modal-content {
  max-width: auto !important;
}

.lightbox-carousel .ratio {
  background-color: transparent !important;
}

.lightbox-carousel .lightbox-caption {
  font-size: 18px;
}

.lightbox-gallery {
  position: relative;
  transition: all .3s ease-in-out;
  cursor: pointer;
}

.lightbox-gallery:hover {
  box-shadow: 0 0.3rem 0.7rem rgba(0, 0, 0, 0.15);
}

.lightbox-gallery .card-overlay {
  position: absolute;
  display: none;
  justify-content: center;
  align-items: center;
  color: #ffffff;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
}

.lightbox-gallery:hover .card-overlay {
  display: block;
}

/* Responsive */

@media (min-width: 768px) {
  .alert-error {
    color: #842029;
    background-color: #ffcaca;
    border-color: #f5c2c7;
  }

  .border-md {
    border: 1px solid #e1e1e1;
  }

  .shadow-md {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  }

  .navbar,
  .main {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .col-md-auto {
    flex: 1 0 0%;
  }
}

@media (min-width: 992px) {
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .footer {
    padding: 2rem;
    margin-top: auto;
    margin-left: 265px;
  }

  .container-full .sidebar {
    display: none;
  }

  .sidebar {
    position: fixed;
    width: 250px;
    height: calc(100% - 65px);
    display: block;
  }

  .sidebar .offcanvas {
    visibility: visible !important;
    display: inline !important;
    position: relative !important;
    top: 0px;
  }

  .main {
    padding-top: 2rem;
    margin-left: 265px;
  }

  .navbar,
  .main {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .raitor-sidebar {
    width: 380px;
    height: calc(100% - 65px);
    position: fixed;
    overflow-y: auto;
    border-left: 0px;
    border-right: 1px solid rgba(34, 34, 34, 0.1);
  }

  .raitor-sidebar-right {
    right: 0;
    border-right: 0px;
    border-left: 1px solid rgba(34, 34, 34, 0.1);
  }

  [data-bs-theme="dark"] .raitor-sidebar {
    border-right: 1px solid rgba(156, 156, 156, 0.1);
  }

  [data-bs-theme="dark"] .raitor-sidebar-right {
    border-left: 1px solid rgba(156, 156, 156, 0.1);
  }

  .raitor-editor {
    margin-left: 380px;
    position: fixed;
    width: calc(100% - 380px);
    height: calc(100% - 65px);
    overflow-y: hidden;
  }

  .raitor-editor .ql-editor {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    padding: 2rem 1rem;
    height: calc(100% - 42px);
    overflow-y: auto;
  }

  .raitor-editor .ql-editor::before {
    padding: 0 3rem;
  }

  .raitor-editor .ql-toolbar.ql-snow {
    top: 0px;
  }

  .form-control,
  .form-select {
    font-size: 0.875rem;
  }

  .post-form .btn {
    padding: 0.55rem 1rem;
  }

  .col-lg-auto {
    flex: 1 0 0%;
  }
}

@media (min-width: 1200px) {

  .navbar,
  .main {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .sidebar {
    margin: auto 1rem;
  }

  .masthead {
    padding: 14rem 0;
  }

  .col-xl-auto {
    flex: 1 0 0%;
  }
}

@media (min-width: 1200px) {
  .raitor-editor .ql-editor {
    padding: 2rem 3rem;
  }

  .raitor-editor .ql-editor::before {
    padding: 0 3rem;
  }
}

/* chat */
.chat-area {
  display: flex;
  flex-direction: column;
  position: relative;
  margin: 0 auto;
  width: 100%;
  height: calc(100vh - 100px);
  overflow: hidden;
}

.chat-body {
  width: 100%;
  max-width: 100%;
  height: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-bottom: 1rem;
  overflow-y: auto;
}

.chat-user {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  display: flex;
  text-align: center;
  align-items: center;
  justify-content: center;
}

.user-message,
.response-message {
  margin-bottom: 1rem;
  overflow-x: hidden;
}

.chat-body .ai-content {
  font-size: 0.938rem;
  line-height: 1.75;
}

.chat-body .ai-content p:not(:last-child) {
  margin-bottom: 1.5rem;
}

.chat-content {
  width: calc(100% - 48px);
}

.chat-action {
  display: flex;
}

.chat-scroll {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

.chat-footer textarea {
  border: 0;
  border-radius: 26px;
  resize: none;
  font-size: 1rem;
  padding: 1rem 0.75rem;
  height: 56px;
  max-height: 250px;
  overflow-x: hidden !important;
}

.chat-footer textarea::-webkit-scrollbar {
  width: 8px;
}

.chat-footer textarea::-webkit-scrollbar-thumb {
  background-color: #e2e2e2;
  border-radius: 5px;
}

.chat-footer textarea::-webkit-scrollbar-track {
  border-radius: 5px;
}

[data-bs-theme=dark] .chat-footer textarea::-webkit-scrollbar-thumb {
  background-color: #2e2e2e;
}

.chat-footer textarea::-webkit-scrollbar-thumb:hover {
  cursor: auto;
}

.chat-footer .chatbox {
  border-radius: 26px;
  background-color: #ffffff;
  border: 0;
}

[data-bs-theme=dark] .chat-footer .chatbox {
  background-color: #212121;
}

.chat-footer button {
  width: 32px;
  height: 32px;
  margin: 10px;
  padding: 0;
  border-radius: 50%;
}

.chat-footer button[type=submit] {
  color: #ffffff;
  background-color: #212121;
}

.chat-footer button[type=submit]:hover {
  background-color: #4b4b4b;
}

.chat-footer button[type=submit]:disabled {
  background-color: #a8a8a8;
}

[data-bs-theme=dark] .chat-footer button[type=submit] {
  color: #000000;
  background-color: #eeeeee;
}

[data-bs-theme=dark] .chat-footer button[type=submit]:hover {
  background-color: #b9b9b9;
}

[data-bs-theme=dark] .chat-footer button[type=submit]:disabled {
  background-color: #585858;
}

.chat-footer {
  width: 100%;
  border-bottom-right-radius: 8px;
  border-bottom-left-radius: 8px;
}

.chat-history {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 100px);
  overflow: hidden;
}

.chat-history-body {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.chat-history-body .nav-link {
  color: #252d3d;
  border-radius: 5px;
}

[data-bs-theme=dark] .chat-history-body .nav-link {
  color: #e4e4e4;
}

.chat-history-body .nav-link:hover,
.chat-history-body .nav-link.active {
  background-color: rgba(181, 172, 233, 0.1);
}

.chat-history-body .nav-item:hover .dropdown {
  display: inline !important;
}

.chat-history-body .nav-item:hover .nav-link span {
  margin-right: 1.5rem;
}

.chat-history-body .dropdown:hover {
  background-color: rgba(181, 172, 233, 0.1);
  border-radius: 10px;
}

/* ===== AI Thinking Animation - Sleek Minimal Style with Color Wave ===== */
.result-thinking {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
}

.result-thinking .thinking-text {
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7, #6366f1);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: color-wave 2s ease-in-out infinite;
}

.result-thinking .dot {
  width: 5px;
  height: 5px;
  margin: 0 2px;
  border-radius: 50%;
  display: inline-block;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7);
  background-size: 200% 100%;
  animation: dot-wave 2s ease-in-out infinite, dot-pulse 1.4s ease-in-out infinite;
}

.result-thinking .dot:nth-child(2) {
  animation-delay: 0.15s, 0.15s;
}

.result-thinking .dot:nth-child(3) {
  animation-delay: 0.3s, 0.3s;
}

.result-thinking .dot:nth-child(4) {
  animation-delay: 0.45s, 0.45s;
}

@keyframes color-wave {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes dot-wave {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes dot-pulse {
  0%, 60%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  30% {
    opacity: 1;
    transform: scale(1.3);
  }
}

/* Dark mode */
[data-bs-theme="dark"] .result-thinking .thinking-text {
  background: linear-gradient(90deg, #818cf8, #a78bfa, #c084fc, #818cf8);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: color-wave 2s ease-in-out infinite;
}

[data-bs-theme="dark"] .result-thinking .dot {
  background: linear-gradient(90deg, #818cf8, #a78bfa, #c084fc);
  background-size: 200% 100%;
}

.result-streaming> :not(ol):not(ul):not(pre):last-child::after,
.result-streaming>pre:last-child code::after {
  -webkit-font-smoothing: subpixel-antialiased;
  -webkit-animation: pulseSize 1.25s ease-in-out infinite;
  animation: pulseSize 1.25s ease-in-out infinite;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background-color: #535563;
  border-radius: 50%;
  line-height: normal;
  margin: 0 0.25rem;
  vertical-align: baseline;
  box-sizing: border-box;
  content: " ";
  display: inline-block;
  width: 12px;
  height: 12px;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-transform-origin: center;
  transform-origin: center;
  will-change: transform;
}

.result-processing {
  width: 30px;
  height: 30px;
  position: relative;
}

.result-processing svg {
  transform: rotate(-90deg);
}

.result-processing circle {
  fill: none;
  stroke-width: 2px;
  stroke: #ab68ff;
  stroke-dasharray: 66.68;
  stroke-dashoffset: 66.68;
  animation: load 10s linear forwards;
}

.result-processing circle.background {
  stroke: rgba(105, 105, 105, 0.1);
  stroke-width: 2px;
  stroke-dasharray: 0;
  stroke-dashoffset: 0;
}

@keyframes load {
  to {
    stroke-dashoffset: 0;
  }
}

@-webkit-keyframes pulseSize {

  0%,
  to {
    -webkit-transform: scaleX(1);
    transform: scaleX(1)
  }

  50% {
    -webkit-transform: scale3d(1.25, 1.25, 1);
    transform: scale3d(1.25, 1.25, 1)
  }
}

@keyframes pulseSize {

  0%,
  to {
    -webkit-transform: scaleX(1);
    transform: scaleX(1)
  }

  50% {
    -webkit-transform: scale3d(1.25, 1.25, 1);
    transform: scale3d(1.25, 1.25, 1)
  }
}

.chat-sidebar {
  width: 320px;
  top: 0;
  right: 0;
  transform: translateX(100%);
  margin-left: auto;
}

.collapse-chat-sidebar {
  position: fixed;
  right: 0;
  z-index: 1;
  border: 0;
  border-radius: 1rem;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  transition: all .2s ease-in-out;
}

.collapse-chat-sidebar:hover svg {
  transform: scale(1.3);
}

@media (min-width: 992px) {
  .chat-area {
    width: 770px;
    height: calc(100vh - 110px);
  }

  .chat-action {
    visibility: hidden;
    transition: all .5s ease-in-out;
  }

  .user-message:hover .chat-action,
  .response-message:hover .chat-action {
    visibility: visible;
  }
}

@media (min-width: 992px) and (max-width: 1400px) {
  .chat-scroll {
    left: 60%;
  }
}

@media (min-width: 1400px) {
  .chat-sidebar {
    position: static;
    z-index: auto;
    flex-grow: 1;
    height: auto !important;
    visibility: visible !important;
    background-color: transparent !important;
    border: 0 !important;
    transform: none !important;
    transition: none;
    top: auto;
    right: auto;
    transform: none;
    margin-left: 0;
    overflow: hidden;
  }

  .chat-sidebar .offcanvas-header {
    display: none;
  }

  .collapse-chat-sidebar {
    display: none;
  }

  .chat-history {
    height: calc(100vh - 165px);
  }
}

@keyframes slideIn {
  0% {
    transform: translateY(1rem);
    opacity: 0;
  }

  100% {
    transform: translateY(0rem);
    opacity: 1;
  }

  0% {
    transform: translateY(1rem);
    opacity: 0;
  }
}

@-webkit-keyframes slideIn {
  0% {
    -webkit-transform: transform;
    -webkit-opacity: 0;
  }

  100% {
    -webkit-transform: translateY(0);
    -webkit-opacity: 1;
  }

  0% {
    -webkit-transform: translateY(1rem);
    -webkit-opacity: 0;
  }
}

/* Treeview */
.tree ul,
.tree ul ul {
  margin: 0;
  padding: 0;
  list-style: none
}

.tree ul ul {
  margin-left: 1rem;
  position: relative
}

.simplebar-scrollbar::before {
  background: #cccccc;
}

.simplebar-scrollbar:hover::before {
  background: #c4c4c4;
}

[data-bs-theme=dark] .simplebar-scrollbar::before {
  background: #333333;
}

[data-bs-theme=dark] .simplebar-scrollbar:hover::before {
  background: #424242;
}

#fileList .card:hover .delete-button {
  display: block !important;
}

/* RTL */
html[dir=rtl] .bi-arrow-right,
html[dir=rtl] svg.bi.bi-arrow-right-short,
html[dir=rtl] .pagination .page-item.previous,
html[dir=rtl] .pagination .page-item.next,
html[dir=rtl] .collapse-chat-sidebar svg {
  transform: rotate(180deg);
}

html[dir=rtl] .pagination .page-item a {
  border-radius: 0;
}

html[dir=rtl] .ql-editor {
  direction: rtl;
  text-align: right;
}

@media (min-width: 992px) {
  html[dir=rtl] .main {
    margin-left: 0;
    margin-right: 265px;
  }

  html[dir=rtl] .raitor-editor {
    margin-left: 0;
    margin-right: 380px;
  }

  html[dir=rtl] .raitor-sidebar {
    border-left: 1px solid rgba(34, 34, 34, 0.1);
  }
}

  /* ============================================ */
  /* ADVANCED SIDEBAR NAVIGATION (Scoped & Non-breaking)
     - Safe: augments existing .sidebar-menu and .nav-link rules
     - Applies to .modern-sidebar or .advanced-sidebar (backwards-compatible)
  */

  /* Desktop fixed width and vertical layout */
  .modern-sidebar, .advanced-sidebar {
    --sidebar-width: 280px;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
    border-right: 1px solid rgba(0,0,0,0.04);
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s cubic-bezier(0.4,0,0.2,1), box-shadow 0.22s;
  }

  [data-bs-theme="dark"] .modern-sidebar,
  [data-bs-theme="dark"] .advanced-sidebar {
    background: linear-gradient(180deg, rgba(15,23,42,0.9), rgba(30,41,59,0.9));
    border-right: 1px solid rgba(255,255,255,0.04);
  }

  /* Mobile overlay (slide-over) */
  .mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12,12,20,0.45);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  .mobile-sidebar.open + .mobile-sidebar-overlay,
  .mobile-sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  /* Credits section: gradient + compact progress */
  .modern-sidebar .credits-section,
  .advanced-sidebar .credits-section {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, rgba(79,70,229,0.08), rgba(99,102,241,0.03));
  }

  [data-bs-theme="dark"] .modern-sidebar .credits-section,
  [data-bs-theme="dark"] .advanced-sidebar .credits-section {
    background: linear-gradient(135deg, rgba(79,70,229,0.06), rgba(31,41,55,0.2));
  }

  /* Stronger active state while staying compatible with .sidebar-menu .nav-link */
  .modern-sidebar .sidebar-menu .nav-link.active,
  .advanced-sidebar .sidebar-menu .nav-link.active {
    background: linear-gradient(90deg, rgba(99,102,241,0.12), rgba(79,70,229,0.08));
    color: var(--text-heading);
    box-shadow: var(--shadow-sm);
  }

  [data-bs-theme="dark"] .modern-sidebar .sidebar-menu .nav-link.active,
  [data-bs-theme="dark"] .advanced-sidebar .sidebar-menu .nav-link.active {
    background: linear-gradient(90deg, rgba(99,102,241,0.06), rgba(79,70,229,0.06));
    color: #f8fafc;
  }

  /* Hover affordance: subtle slide + background change */
  .modern-sidebar .sidebar-menu .nav-link:hover,
  .advanced-sidebar .sidebar-menu .nav-link:hover {
    transform: translateX(4px);
    background-color: rgba(181,172,233,0.06);
  }

  [data-bs-theme="dark"] .modern-sidebar .sidebar-menu .nav-link:hover,
  [data-bs-theme="dark"] .advanced-sidebar .sidebar-menu .nav-link:hover {
    background-color: rgba(137,130,173,0.06);
  }

  /* Icon alignment and spacing — preserve existing ms-3 spacing */
  .modern-sidebar .sidebar-menu .nav-link svg,
  .advanced-sidebar .sidebar-menu .nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  /* Focus accessibility */
  .modern-sidebar .sidebar-menu .nav-link:focus,
  .advanced-sidebar .sidebar-menu .nav-link:focus {
    outline: 3px solid rgba(99,102,241,0.12);
    outline-offset: 2px;
  }

  /* Responsive: keep mobile slide-over width capped */
  @media (max-width: 991.98px) {
    .modern-sidebar,
    .advanced-sidebar {
      width: min(92vw, 340px);
      position: fixed;
      top: 0;
      left: 0;
      height: 100vh;
      transform: translateX(-100%);
      z-index: 1050;
    }

    .modern-sidebar.open,
    .advanced-sidebar.open {
      transform: translateX(0);
    }

    .mobile-sidebar-overlay {
      z-index: 1045;
    }
  }

  /* Small visual polish for footer call-to-action */
  .modern-sidebar .sidebar-footer .feedback-btn,
  .advanced-sidebar .sidebar-footer .feedback-btn {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
  }

  /* End Advanced Sidebar Navigation */
  /* ============================================ */