:root {
  --tblr-primary: #0c2a4d;
  --tblr-body-bg: #f8f9fc;
  --color-pengolahan: #1f5fbf;
  --color-pembinaan: #e28b13;
  --color-pemeliharaan: #1e8a54;
  --color-muted-card: #f3f5f8;
  --card-surface: #ffffff;
  --card-border: #e4e7ec;
  --text-muted-strong: #667085;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  
  /* Modern Gradient Colors */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-pengolahan: linear-gradient(135deg, #1f5fbf 0%, #4e8cff 100%);
  --gradient-pembinaan: linear-gradient(135deg, #e28b13 0%, #ffb347 100%);
  --gradient-pemeliharaan: linear-gradient(135deg, #1e8a54 0%, #2ecc71 100%);
  
  /* Glass Morphism */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.18);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.18);
  
  /* Dark Mode Variables */
  --dark-bg: #1a1d2e;
  --dark-card: #22283a;
  --dark-text: #e8eaed;
  --dark-border: #2d3548;
}

/* Dark Mode */
[data-theme="dark"] {
  --tblr-body-bg: #1a1d2e;
  --card-surface: #22283a;
  --card-border: #2d3548;
  --text-muted-strong: #9ca3af;
  --glass-bg: rgba(34, 40, 58, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] body {
  color: #e8eaed !important;
}

[data-theme="dark"] .navbar-vertical {
  background: #22283a;
  border-right-color: #2d3548;
}

[data-theme="dark"] .sidebar-pill .nav-link {
  color: #e8eaed;
}

[data-theme="dark"] .sidebar-pill .nav-link.active,
[data-theme="dark"] .sidebar-pill .nav-link:hover {
  background: #2d3548;
  border-color: #3d4558;
}

[data-theme="dark"] .table thead th {
  background: #2d3548;
  color: #e8eaed;
}

[data-theme="dark"] .table tbody tr {
  border-color: #2d3548;
}

[data-theme="dark"] .table tbody tr:hover {
  background: #2d3548;
}

body {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif !important;
  background: var(--tblr-body-bg) !important;
  color: #1f2937;
  transition: background 0.3s ease, color 0.3s ease;
}

.page {
  background: var(--tblr-body-bg);
  transition: background 0.3s ease;
}

.page-wrapper {
  background: var(--tblr-body-bg);
  padding-left: 0;
  transition: background 0.3s ease;
}

/* Animated Background Pattern */
.page-wrapper::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(79, 172, 254, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

.navbar-vertical {
  background: #f3f3f3;
  border-right: 1px solid #e6e6e6;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform 200ms ease, opacity 200ms ease, box-shadow 200ms ease;
}

.navbar-vertical .nav-link-title,
.navbar-vertical .navbar-brand {
  color: #1b1f23;
}

.navbar-vertical .nav-link {
  font-weight: 600;
  color: #111827;
  transition: background 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.card {
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  background: var(--card-surface);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(102, 126, 234, 0.3);
}

.card-body {
  position: relative;
  z-index: 1;
}

.brand-text {
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.stat-card {
  border: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--card-surface);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.stat-card:hover::after {
  opacity: 0.05;
}

.stat-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.stat-card .card-body {
  position: relative;
  z-index: 1;
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  animation: iconFloat 3s ease-in-out infinite;
}

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

.stat-card:hover .stat-icon {
  transform: rotate(5deg) scale(1.1);
  box-shadow: var(--shadow-lg);
}

.stat-number {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.1;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: numberPulse 2s ease-in-out infinite;
}

@keyframes numberPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.stat-label {
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #7a869a;
  text-transform: uppercase;
  font-weight: 700;
}

.badge-seksi {
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.badge-pengolahan {
  background: linear-gradient(135deg, rgba(31, 95, 191, 0.15) 0%, rgba(78, 140, 255, 0.15) 100%);
  color: #1f5fbf;
  border-color: rgba(31, 95, 191, 0.2);
}

.badge-pengolahan:hover {
  background: var(--gradient-pengolahan);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(31, 95, 191, 0.3);
}

.badge-pembinaan {
  background: linear-gradient(135deg, rgba(226, 139, 19, 0.15) 0%, rgba(255, 179, 71, 0.15) 100%);
  color: #b36b0f;
  border-color: rgba(226, 139, 19, 0.2);
}

.badge-pembinaan:hover {
  background: var(--gradient-pembinaan);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(226, 139, 19, 0.3);
}

.badge-pemeliharaan {
  background: linear-gradient(135deg, rgba(30, 138, 84, 0.15) 0%, rgba(46, 204, 113, 0.15) 100%);
  color: #1e8a54;
  border-color: rgba(30, 138, 84, 0.2);
}

.badge-pemeliharaan:hover {
  background: var(--gradient-pemeliharaan);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(30, 138, 84, 0.3);
}

.table thead th {
  background: #eef1f4;
  border-bottom: none;
  font-weight: 700;
  color: #3b4a5a;
  position: sticky;
  top: 0;
  z-index: 2;
}

.table tbody tr {
  border-bottom: 1px solid #edf0f5;
}

.table tbody tr:hover {
  background: #f7f9fc;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: #fafbfc;
}

.calendar-cell {
  min-width: 150px;
  height: 120px;
  vertical-align: top;
}

.calendar-date {
  font-weight: 700;
}

.event-pill {
  display: block;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 12px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  text-decoration: none;
}

.no-event {
  background: #e9f6ed;
  color: #1e915a;
  border: 1px dashed #2ecc71;
  padding: 12px;
  border-radius: 10px;
  text-align: center;
}

.app-shell {
  padding: 22px;
}

.topbar {
  background: #f6f6f6;
  border-radius: 22px;
  border: 1px solid #e6e6e6;
  padding: 16px 22px;
}

.topbar-title {
  font-size: 26px;
  font-weight: 700;
}

.search-pill {
  border-radius: 999px;
  border: 1px solid #e1e4e8;
  background: #ffffff;
  padding: 10px 14px;
  min-width: 280px;
  box-shadow: 0 10px 22px -22px rgba(0, 0, 0, 0.45);
}

.pill-button {
  border-radius: 999px;
  padding: 10px 24px;
  border: none;
  background: var(--gradient-primary);
  color: #ffffff;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.pill-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.pill-button:hover::before {
  width: 300px;
  height: 300px;
}

.pill-button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-xl);
}

.pill-button:active {
  transform: translateY(0) scale(0.98);
}

.side-card {
  background: #f8f8f8;
  border: 1px solid #e9e9e9;
}

.sidebar-pill .nav-link {
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 6px;
  color: #2c2c2c;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.sidebar-pill .nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: var(--gradient-primary);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.sidebar-pill .nav-link:hover::before,
.sidebar-pill .nav-link.active::before {
  transform: translateX(0);
}

.sidebar-pill .nav-link.active,
.sidebar-pill .nav-link:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(102, 126, 234, 0.2);
  transform: translateX(4px);
}

.sidebar-pill .nav-link .nav-link-title {
  transition: all 0.3s ease;
}

.sidebar-pill .nav-link:hover .nav-link-title {
  color: #667eea;
}

.muted-strong {
  color: var(--text-muted-strong);
}

.chart-card {
  padding: 6px 0 4px;
}

.filter-chip {
  border-radius: 999px;
  border: 1px solid #e1e4e8;
  background: #f8f9fb;
  padding: 6px 10px;
  font-weight: 600;
  color: #1f2937;
  text-decoration: none;
}

.filter-chip:hover {
  background: #ffffff;
  box-shadow: 0 8px 14px -12px rgba(0, 0, 0, 0.25);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.dot-plan { background: #0d6efd; }
.dot-run { background: #f39c12; }
.dot-done { background: #1e8a54; }

.today-highlight {
  border: 1px solid #0c2a4d;
  box-shadow: inset 0 0 0 1px #0c2a4d;
  border-radius: 12px;
}

@media (max-width: 991.98px) {
  .navbar-vertical {
    position: fixed;
    z-index: 1030;
    height: auto;
    max-height: 70vh;
    border-radius: 12px;
    margin: 10px;
    box-shadow: 0 14px 30px -20px rgba(0, 0, 0, 0.28);
    transform: translateY(-8px);
    opacity: 0;
  }

  .page {
    padding-left: 0;
  }

  .page-body .container-xl {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  .topbar-title {
    font-size: 18px;
  }

  .search-pill {
    display: none;
  }

  .navbar-vertical.show {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 575.98px) {
  .stat-number {
    font-size: 32px;
  }

  .card {
    border-radius: 12px;
  }
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.dark-mode-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.dark-mode-toggle .icon-sun,
.dark-mode-toggle .icon-moon {
  position: absolute;
  transition: all 0.3s ease;
}

.dark-mode-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.dark-mode-toggle .icon-moon {
  opacity: 0;
  transform: rotate(180deg) scale(0);
}

[data-theme="dark"] .dark-mode-toggle .icon-sun {
  opacity: 0;
  transform: rotate(-180deg) scale(0);
}

[data-theme="dark"] .dark-mode-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-theme="dark"] .dark-mode-toggle {
  background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
}

/* Enhanced Search Pill */
.search-pill {
  border-radius: 999px;
  border: 2px solid transparent;
  background: linear-gradient(white, white) padding-box,
              var(--gradient-primary) border-box;
  padding: 10px 18px;
  min-width: 280px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  cursor: pointer;
  font-weight: 600;
}

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

/* Animated Container */
.container-xl {
  position: relative;
  z-index: 1;
}

/* Enhanced Table */
.table {
  border-collapse: separate;
  border-spacing: 0 8px;
}

.table tbody tr {
  background: var(--card-surface);
  transition: all 0.3s ease;
}

.table tbody tr:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.table tbody tr td:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.table tbody tr td:last-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* Progress Bar Animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.loading-shimmer {
  animation: shimmer 2s infinite;
  background: linear-gradient(to right, #eff1f3 4%, #e2e2e2 25%, #eff1f3 36%);
  background-size: 1000px 100%;
}

/* Enhanced Dropdown */
.dropdown-menu {
  border-radius: 16px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  animation: dropdownSlideIn 0.3s ease;
}

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

.dropdown-item {
  border-radius: 10px;
  padding: 10px 16px;
  transition: all 0.2s ease;
  font-weight: 600;
}

.dropdown-item:hover {
  background: var(--gradient-primary);
  color: white !important;
  transform: translateX(4px);
}

/* Improved Form Controls */
.form-control,
.form-select {
  border-radius: 12px;
  border: 2px solid var(--card-border);
  padding: 12px 16px;
  transition: all 0.3s ease;
  font-weight: 600;
}

.form-control:focus,
.form-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

/* Button Enhancements */
.btn {
  border-radius: 12px;
  padding: 10px 20px;
  font-weight: 700;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

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

.btn-primary {
  background: var(--gradient-primary);
  border: none;
}

.btn-success {
  background: var(--gradient-success);
  border: none;
}

/* Card Header Enhancement */
.card-header {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border-bottom: 2px solid var(--card-border);
  padding: 20px 24px;
  border-radius: 16px 16px 0 0;
}

/* Tooltip Enhancement */
[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1d2e;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Status Badge Enhancement */
.badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.badge:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-sm);
}

/* List Group Enhancement */
.list-group-item {
  border-radius: 12px !important;
  margin-bottom: 8px;
  border: 1px solid var(--card-border);
  transition: all 0.3s ease;
}

.list-group-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--tblr-body-bg);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5568d3 0%, #6640a5 100%);
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  .dark-mode-toggle {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .pill-button {
    padding: 8px 16px;
    font-size: 14px;
  }
  
  .stat-icon {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
  
  .stat-number {
    font-size: 36px;
  }
}

/* Glassmorphism Utility Class */
.glass-effect {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}

/* Gradient Text Utility */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Pulse Animation for Important Elements */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
  }
}

.pulse-effect {
  animation: pulse 2s infinite;
}

/* ========================================
   MINI DRAWER SIDEBAR
   ======================================== */

/* Sidebar Header with Toggle Button */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  background: var(--card-surface);
}

.sidebar-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 20px;
  box-shadow: var(--shadow-sm);
}

.sidebar-toggle-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.sidebar-toggle-btn .toggle-icon {
  transition: transform 0.3s ease;
}

/* Mini Sidebar Styles */
.mini-sidebar {
  width: 260px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 1000;
  background: var(--card-surface);
  border-right: 1px solid var(--card-border);
  overflow-x: hidden;
}

.mini-sidebar.collapsed {
  width: 80px;
}

.mini-sidebar.collapsed .sidebar-toggle-btn .toggle-icon {
  transform: rotate(180deg);
}

.mini-sidebar.collapsed .navbar-brand {
  opacity: 0;
  pointer-events: none;
}

.mini-sidebar.collapsed .nav-link-title {
  opacity: 0;
  pointer-events: none;
  width: 0;
}

.mini-sidebar.collapsed .dropdown-toggle::after {
  display: none;
}

/* Sidebar Navigation */
.mini-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  margin: 4px 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.mini-sidebar .nav-link-icon {
  font-size: 20px;
  min-width: 24px;
  text-align: center;
  transition: transform 0.3s ease;
}

.mini-sidebar .nav-link-title {
  font-weight: 600;
  transition: all 0.3s ease;
  flex: 1;
}

.mini-sidebar .nav-link:hover .nav-link-icon {
  transform: scale(1.2);
}

/* Navbar Brand */
.mini-sidebar .navbar-brand {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.mini-sidebar .brand-text {
  display: inline-block;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Dropdown Menu Positioning */
.mini-sidebar.collapsed .dropdown-menu {
  position: fixed;
  left: 80px;
  margin-top: -40px;
}

.mini-sidebar .dropdown-menu {
  border-radius: 12px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  margin-left: 8px;
}

/* Main Content Adjustment */
.page-wrapper {
  margin-left: 260px;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-wrapper.sidebar-collapsed {
  margin-left: 80px;
}

/* Mobile Toggle Button */
.mobile-toggle {
  background: var(--gradient-primary);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-sm);
}

.mobile-toggle:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
  .mini-sidebar {
    width: 260px;
    transform: translateX(-100%);
    box-shadow: none;
  }
  
  .mini-sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  
  .mini-sidebar.collapsed {
    width: 260px;
  }
  
  .page-wrapper {
    margin-left: 0;
  }
  
  .page-wrapper.sidebar-collapsed {
    margin-left: 0;
  }
  
  .sidebar-toggle-btn:not(.mobile-toggle) {
    display: none;
  }
}

@media (min-width: 992px) {
  .mobile-toggle {
    display: none;
  }
}

/* Dark Mode Sidebar */
[data-theme="dark"] .mini-sidebar {
  background: var(--dark-card);
  border-right-color: var(--dark-border);
}

[data-theme="dark"] .sidebar-header {
  background: var(--dark-card);
  border-bottom-color: var(--dark-border);
}

/* Sidebar Scrollbar */
.mini-sidebar::-webkit-scrollbar {
  width: 6px;
}

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

.mini-sidebar::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: 10px;
}

/* Tooltip for collapsed sidebar items */
.mini-sidebar.collapsed .nav-link {
  position: relative;
}

.mini-sidebar.collapsed .nav-link::after {
  content: attr(title);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: var(--dark-bg);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  margin-left: 10px;
  z-index: 1001;
  box-shadow: var(--shadow-lg);
}

.mini-sidebar.collapsed .nav-link:hover::after {
  opacity: 1;
}

/* Animation for sidebar items */
.mini-sidebar .nav-item {
  animation: slideInLeft 0.3s ease-out backwards;
}

.mini-sidebar .nav-item:nth-child(1) { animation-delay: 0.05s; }
.mini-sidebar .nav-item:nth-child(2) { animation-delay: 0.1s; }
.mini-sidebar .nav-item:nth-child(3) { animation-delay: 0.15s; }
.mini-sidebar .nav-item:nth-child(4) { animation-delay: 0.2s; }

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

/* Override sidebar-pill styles for mini sidebar */
.mini-sidebar .sidebar-pill .nav-link::before {
  display: none;
}

.mini-sidebar .sidebar-pill .nav-link.active,
.mini-sidebar .sidebar-pill .nav-link:hover {
  transform: none;
}


/* ========================================
   FIX: Override conflicting sidebar styles
   ======================================== */

/* Reset conflicting sidebar-pill styles for mini-sidebar */
.mini-sidebar .sidebar-pill .nav-link {
  border-radius: 12px;
  padding: 12px 16px;
  margin: 4px 8px;
  color: #2c2c2c;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: visible;
  white-space: nowrap;
  border: 1px solid transparent;
}

.mini-sidebar .sidebar-pill .nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: var(--gradient-primary);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  border-radius: 12px 0 0 12px;
}

.mini-sidebar .sidebar-pill .nav-link:hover::before,
.mini-sidebar .sidebar-pill .nav-link.active::before {
  transform: translateX(0);
}

.mini-sidebar .sidebar-pill .nav-link.active,
.mini-sidebar .sidebar-pill .nav-link:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(102, 126, 234, 0.2);
  transform: translateX(0);
}

.mini-sidebar .sidebar-pill .nav-link:hover .nav-link-title {
  color: #667eea;
}

/* Ensure nav-link-icon and title are visible */
.mini-sidebar .nav-link-icon {
  display: inline-flex;
  font-size: 20px;
  min-width: 24px;
  text-align: center;
  transition: transform 0.3s ease;
}

.mini-sidebar .nav-link-title {
  display: inline-block;
  font-weight: 600;
  transition: all 0.3s ease;
  flex: 1;
  opacity: 1;
}

/* Collapsed state */
.mini-sidebar.collapsed .nav-link-title {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.mini-sidebar.collapsed .navbar-brand .brand-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* Dropdown arrow hide when collapsed */
.mini-sidebar.collapsed .dropdown-toggle::after {
  display: none;
}

/* Fix page-wrapper margin */
.page-wrapper {
  margin-left: 260px;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: auto;
}

.page-wrapper.sidebar-collapsed {
  margin-left: 80px;
}

/* Dark mode text color */
[data-theme="dark"] .mini-sidebar .nav-link {
  color: #e8eaed;
}

[data-theme="dark"] .mini-sidebar .navbar-brand .brand-text {
  color: #e8eaed;
}

/* Dropdown positioning fix */
.mini-sidebar .dropdown-menu {
  position: absolute;
  left: 100%;
  top: 0;
  margin-left: 8px;
  min-width: 200px;
}

.mini-sidebar.collapsed .dropdown-menu {
  position: fixed;
  left: 80px;
  margin-top: 0;
}

/* Mobile responsive override */
@media (max-width: 991.98px) {
  .page-wrapper {
    margin-left: 0 !important;
  }
  
  .page-wrapper.sidebar-collapsed {
    margin-left: 0 !important;
  }
  
  .mini-sidebar {
    transform: translateX(-100%);
  }
  
  .mini-sidebar.mobile-open {
    transform: translateX(0);
  }
}

