/* ============================================
  ds Bootstrap 5 Template
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/*  CSS Variables  */
:root {
  /* Brand */
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --primary-rgb: 99, 102, 241;

  /* Accent Gradients */
  --gradient-1: linear-gradient(135deg, var(--primary), var(--primary-light));
  --gradient-2: linear-gradient(135deg, #3b82f6, #06b6d4);
  --gradient-3: linear-gradient(135deg, #10b981, #14b8a6);
  --gradient-4: linear-gradient(135deg, #f59e0b, #ef4444);
  --gradient-5: linear-gradient(135deg, #ec4899, #8b5cf6);

  /* Surfaces */
  --bg-body: #f0f2f8;
  --bg-table-header: #f0f2f8;

  /* Toast */
  --toast-success-bg: #f0fdf4;
  --toast-success-border: #bbf7d0;
  --toast-danger-bg: #fef2f2;
  --toast-danger-border: #fecaca;
  --toast-warning-bg: #fffbeb;
  --toast-warning-border: #fed7aa;
  --toast-info-bg: #eff6ff;
  --toast-info-border: #bfdbfe;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
  --bg-sidebar-active: rgba(var(--primary-rgb), 0.15);
  --bg-card: #ffffff;
  --bg-input: #f8fafc;
  --bg-navbar: rgba(255, 255, 255, 0.8);

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-sidebar: #94a3b8;
  --text-sidebar-active: #ffffff;
  --text-sidebar-heading: #475569;

  /* Borders */
  --border-color: #e2e8f0;
  --input-border-color: #e2e8f0;
  --border-light: rgba(0, 0, 0, 0.04);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 40px rgba(var(--primary-rgb), 0.15);

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 82px;
  --navbar-height: 70px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transition */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/*  Dark Theme  */
[data-theme="dark"] {
  --bg-body: #0c1222;
  --bg-table-header: #202431;
  --bg-sidebar: #111827;
  --bg-sidebar-hover: rgba(255, 255, 255, 0.05);
  --bg-card: #1e293b;
  --bg-input: #1e293b;
  --bg-navbar: rgba(15, 23, 42, 0.85);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #1f2634;
  --input-border-color: #2d3748;
  --border-light: rgba(255, 255, 255, 0.04);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.4);

  /* Toast */
  --toast-success-bg: rgba(34, 197, 94, 0.1);
  --toast-success-border: rgba(34, 197, 94, 0.25);
  --toast-danger-bg: rgba(239, 68, 68, 0.1);
  --toast-danger-border: rgba(239, 68, 68, 0.25);
  --toast-warning-bg: rgba(245, 158, 11, 0.1);
  --toast-warning-border: rgba(245, 158, 11, 0.25);
  --toast-info-bg: rgba(59, 130, 246, 0.1);
  --toast-info-border: rgba(59, 130, 246, 0.25);
}

/*  Global Reset  */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background var(--transition-base), color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/*  Scrollbar  */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: width var(--transition-base);
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

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

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px;
  height: var(--navbar-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.4);
}

.sidebar-logo .logo-icon img{
  width: 35px;
  height: 35px;
  border-radius: var(--radius-sm);
}

.sidebar-close-btn {
  background: transparent;
  border: none;
  color: var(--text-sidebar);
  font-size: 24px;
  margin-left: auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.sidebar-close-btn:hover {
  color: #fff;
}

.sidebar-logo .logo-text {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  opacity: 1;
  transition: opacity var(--transition-fast);
  letter-spacing: -0.5px;
}

.sidebar.collapsed .logo-text {
  opacity: 0;
  visibility: hidden;
  width: 0;
}

/* Nav Menu */
.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar.collapsed .sidebar-nav {
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
  width: 0;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-sidebar-heading);
  padding: 12px 14px 8px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition-fast);
}

.sidebar.collapsed .nav-section-title {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin-bottom: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-sidebar);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  transition: all var(--transition-fast);
  overflow: hidden;
}

.nav-link i {
  font-size: 20px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.nav-link span {
  opacity: 1;
  transition: opacity var(--transition-fast);
  position: relative;
  z-index: 1;
}

.sidebar.collapsed .nav-link span {
  opacity: 0;
  visibility: hidden;
  width: 0;
}

.sidebar.collapsed .nav-link {
  gap: 0 !important;
  justify-content: center;
}

.nav-link:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
}

.nav-link.active {
  background: var(--bg-sidebar-active);
  color: var(--text-sidebar-active);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--gradient-1);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

/* Nav Badge */
.nav-badge {
  margin-left: auto;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--gradient-1);
  color: #fff;
  line-height: 1.4;
}

.sidebar.collapsed .nav-badge {
  display: none;
}

/*  Submenu Arrow  */
.submenu-arrow {
  font-size: 12px !important;
  width: auto !important;
  margin-left: auto;
  transition: transform var(--transition-fast);
  opacity: 0.5;
}

.nav-item.has-submenu.open > .nav-link {
  color: #fff;
  background: var(--bg-sidebar-hover);
}

.nav-item.has-submenu.open > .nav-link .submenu-arrow {
  transform: rotate(90deg);
  opacity: 1;
}

.sidebar.collapsed .submenu-arrow {
  display: none;
}

/*  2nd Level Submenu  */
.submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding-left: 0;
}

.submenu.show {
  max-height: 500px;
}

/*  Collapsed Sidebar: Flyout Popup  */
.sidebar.collapsed .nav-item.has-submenu {
  position: static;
}

.sidebar.collapsed .submenu {
  display: block !important;
  position: fixed;
  min-width: 220px;
  max-height: none !important;
  overflow: visible;
  background: var(--bg-sidebar);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
  z-index: 1060;
}

.sidebar.collapsed .nav-item.has-submenu:hover > .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Flyout label heading */
.sidebar.collapsed .nav-item.has-submenu:hover > .submenu::before {
  content: attr(data-label);
}

/* Fix link padding in flyout */
.sidebar.collapsed .submenu .submenu-link {
  padding: 8px 14px;
}

.sidebar.collapsed .submenu .submenu-link::before {
  display: none;
}

.sidebar.collapsed .submenu .submenu-child-link {
  padding: 7px 14px 7px 28px;
}

.sidebar.collapsed .submenu .submenu-child-link::before {
  left: 14px;
}

/* Show 3rd level inside flyout normally */
.sidebar.collapsed .submenu .submenu-child {
  position: static;
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
  min-width: auto;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.sidebar.collapsed .submenu .submenu-item.has-submenu {
  position: relative;
}

.sidebar.collapsed .submenu .submenu-item.has-submenu.open > .submenu-child {
  max-height: 300px;
}

.sidebar.collapsed .submenu .submenu-item.has-submenu.open > .submenu-link .submenu-arrow-sm {
  transform: rotate(90deg);
  opacity: 1;
}

.submenu-link {
  display: flex;
  align-items: center;
  padding: 8px 14px 8px 52px;
  font-size: 13px;
  color: var(--text-sidebar);
  border-radius: 6px;
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
  cursor: pointer;
}

.submenu-link::before {
  content: '';
  position: absolute;
  left: 36px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-sidebar);
  opacity: 0.4;
  transition: all var(--transition-fast);
}

.submenu-link:hover {
  color: #fff;
  background: var(--bg-sidebar-hover);
}

.submenu-link:hover::before {
  background: #fff;
  opacity: 0.8;
}

.submenu-link.active {
  color: var(--primary-light);
}

.submenu-link.active::before {
  background: var(--primary-light);
  opacity: 1;
  box-shadow: 0 0 6px rgba(var(--primary-rgb), 0.5);
}

/*  3rd Level Arrow  */
.submenu-arrow-sm {
  font-size: 10px !important;
  margin-left: auto;
  transition: transform var(--transition-fast);
  opacity: 0.5;
}

.submenu-item.has-submenu.open > .submenu-link .submenu-arrow-sm {
  transform: rotate(90deg);
  opacity: 1;
}

/*  3rd Level Submenu  */
.submenu-child {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.submenu-child.show {
  max-height: 300px;
}

.submenu-child-link {
  display: block;
  padding: 7px 14px 7px 68px;
  font-size: 12.5px;
  color: var(--text-sidebar);
  border-radius: 6px;
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
  cursor: pointer;
}

.submenu-child-link::before {
  content: '';
  position: absolute;
  left: 54px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border: 1px solid var(--text-sidebar);
  border-radius: 50%;
  opacity: 0.4;
  transition: all var(--transition-fast);
}

.submenu-child-link:hover {
  color: #fff;
  background: var(--bg-sidebar-hover);
}

.submenu-child-link:hover::before {
  border-color: #fff;
  background: #fff;
  opacity: 0.8;
}

.submenu-child-link.active {
  color: var(--primary-light);
}

.submenu-child-link.active::before {
  border-color: var(--primary-light);
  background: var(--primary-light);
  opacity: 1;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.sidebar-user:hover {
  background: var(--bg-sidebar-hover);
}

.sidebar-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--gradient-5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

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

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

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--text-sidebar);
  white-space: nowrap;
}

/* ============================================
   USER DROPDOWN MENU
   ============================================ */
.user-dropdown-wrap {
  position: relative;
}

.user-dropdown-wrap.open .navbar-user .bi-chevron-down {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
  z-index: 1060;
}

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

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 6px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.user-dropdown-item:hover {
  background: rgba(var(--primary-rgb), 0.06);
  color: var(--primary);
}

.user-dropdown-item i {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.user-dropdown-item.logout {
  color: #ef4444;
}

.user-dropdown-item.logout:hover {
  background: rgba(239, 68, 68, 0.06);
  color: #dc2626;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left var(--transition-base);
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed);
}

/* ============================================
   TOP NAVBAR
   ============================================ */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  height: var(--navbar-height);
  background: var(--bg-navbar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  transition: background var(--transition-base), border-color var(--transition-base);
}

.nav-toggle-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 20px;
  transition: all var(--transition-fast);
}

.nav-toggle-btn:hover {
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
}

/* Search */
.navbar-search {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.navbar-search input {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 42px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.navbar-search input::placeholder {
  color: var(--text-muted);
}

.navbar-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
  background: var(--bg-card);
}

.navbar-search > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

.navbar-search .search-shortcut {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-body);
  font-family: inherit;
  transition: opacity 0.15s;
}

/* Search Results Dropdown */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  max-height: 320px;
  overflow-y: auto;
  display: none;
  padding: 6px;
}

.search-results-dropdown.visible {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-item:hover,
.search-result-item.focused {
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
}

.search-result-item i {
  position: static;
  transform: none;
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-result-item:hover i,
.search-result-item.focused i {
  color: var(--primary);
}

.search-result-item .result-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-item .result-path {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-no-results {
  padding: 16px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* Navbar Right */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.navbar-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 20px;
  transition: all var(--transition-fast);
}

.navbar-btn:hover {
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
}

.navbar-btn .badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--bg-navbar);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* Theme Toggle */
.theme-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 20px;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
}

.theme-toggle .bi-moon-fill { display: inline; }
.theme-toggle .bi-sun-fill { display: none; }
[data-theme="dark"] .theme-toggle .bi-moon-fill { display: none; }
[data-theme="dark"] .theme-toggle .bi-sun-fill { display: inline; }

/* Navbar Divider */
.navbar-divider {
  width: 1px;
  height: 28px;
  background: var(--border-color);
  margin: 0 6px;
}

/* User Menu */
.navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.navbar-user:hover {
  background: rgba(var(--primary-rgb), 0.05);
}

.navbar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--gradient-1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.navbar-user-info {
  line-height: 1.3;
}

.navbar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.navbar-user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================
   PAGE CONTENT
   ============================================ */
.page-content {
  padding: 24px;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.page-breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.page-breadcrumb a {
  color: var(--primary);
}

.page-breadcrumb a:hover {
  text-decoration: underline;
}

/* Date Range Btn */
.date-range-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.date-range-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ============================================
   STAT CARDS
   ============================================ */
.stat-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 24px;
  color: #fff;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.stat-card.gradient-1 { background: var(--gradient-1); }
.stat-card.gradient-2 { background: var(--gradient-2); }
.stat-card.gradient-3 { background: var(--gradient-3); }
.stat-card.gradient-4 { background: var(--gradient-4); }

.stat-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: -40px;
  right: 20px;
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.stat-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  backdrop-filter: blur(4px);
}

.stat-card-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.stat-card-value {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
  letter-spacing: -1px;
}

.stat-card-label {
  font-size: 13px;
  opacity: 0.85;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* ============================================
   GLASS CARD
   ============================================ */
.glass-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  overflow: hidden;
}

.glass-card:hover {
  box-shadow: var(--shadow-md);
}

.glass-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

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

.glass-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.glass-card-title .icon-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.glass-card-body {
  padding: 24px;
}

/* Card Actions */
.card-actions {
  display: flex;
  gap: 4px;
}

.card-action-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 16px;
  transition: all var(--transition-fast);
}

.card-action-btn:hover {
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
}

/* ============================================
   CHARTS
   ============================================ */
.chart-container {
  position: relative;
  width: 100%;
}

.chart-legend {
  display: flex;
  gap: 20px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================
   TABLE
   ============================================ */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  background: transparent;
}

.data-table tbody td {
  padding: 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover td {
  background: rgba(var(--primary-rgb), 0.02);
}

[data-theme="dark"] .data-table tbody tr:hover td {
  background: rgba(var(--primary-rgb), 0.05);
}

/* Table User */
.table-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

.table-user-info {
  line-height: 1.4;
}

.table-user-name {
  font-weight: 600;
  font-size: 14px;
}

.table-user-email {
  font-size: 12px;
  color: var(--text-muted);
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-badge.completed {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}
.status-badge.completed::before { background: #10b981; }

.status-badge.pending {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}
.status-badge.pending::before { background: #f59e0b; }

.status-badge.processing {
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
}
.status-badge.processing::before { background: var(--primary); }

.status-badge.cancelled {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
.status-badge.cancelled::before { background: #ef4444; }

/* ============================================
   ACTIVITY FEED
   ============================================ */
.activity-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.activity-icon.purple {
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
}

.activity-icon.green {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.activity-icon.blue {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.activity-icon.orange {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.activity-icon.pink {
  background: rgba(236, 72, 153, 0.1);
  color: #ec4899;
}

.activity-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.activity-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-custom {
  height: 6px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-custom .bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.animate-in {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }

/* ============================================
   SIDEBAR OVERLAY (Mobile)
   ============================================ */
.sidebar-overlay {
  display: none; /* stays hidden by default - only shown on mobile via media query */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1045;
  opacity: 0;
  pointer-events: none; /* never block clicks when not active */
  transition: opacity var(--transition-base);
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto; /* only intercept clicks when actually shown */
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1199.98px) {
  .stat-card-value {
    font-size: 24px;
  }
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
    box-shadow: var(--shadow-xl);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block; /* switch from none to block so it can fade in/out */
    pointer-events: none; /* but NOT clickable until .active is added */
  }

  .main-content {
    margin-left: 0 !important;
  }

  .navbar-search {
    display: none;
  }

  .navbar-user-info {
    display: none;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 575.98px) {
  .page-content {
    padding: 16px;
  }

  .top-navbar {
    padding: 0 16px;
  }

  /* Fix for small screen navbar buttons */
  .navbar-actions {
    gap: 8px; /* Reduce gap between buttons */
  }

  .navbar-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .user-dropdown-wrap .navbar-user-avatar {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .navbar-user {
    padding-left: 0; /* Remove extra padding on mobile */
  }

  .user-dropdown-menu {
    right: -16px; /* Align dropdown to screen edge on mobile */
    min-width: 220px;
  }

  .stat-card {
    padding: 20px;
  }

  .glass-card-header {
    padding: 16px;
  }

  .glass-card-body {
    padding: 16px;
  }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-gradient {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hover-lift {
  transition: transform var(--transition-fast);
}

.hover-lift:hover {
  transform: translateY(-2px);
}

/* Quick Action Buttons */
.btn-gradient {
  background: var(--gradient-1);
  border: none;
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.btn-gradient:hover {
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
  transform: translateY(-1px);
}

/* Percentage circle mini */
.percentage-ring {
  width: 48px;
  height: 48px;
}

.percentage-ring circle {
  transition: stroke-dashoffset 1s ease;
}

/* Top Products */
.product-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.product-item:last-child {
  border-bottom: none;
}

.product-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.product-info {
  flex: 1;
  min-width: 0;
}

.product-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.product-sales {
  font-size: 12px;
  color: var(--text-muted);
}

.product-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ============================================
   COMMON UTILITY CLASSES
   ============================================ */

/* - Text Colors - */
.text-primary-color   { color: var(--primary); }
.text-blue            { color: #3b82f6; }
.text-teal            { color: #06b6d4; }
.text-green           { color: #10b981; }
.text-amber           { color: #f59e0b; }
.text-rose            { color: #ef4444; }
.text-pink            { color: #ec4899; }
.text-purple          { color: #8b5cf6; }
.text-muted-color     { color: var(--text-muted); }
.text-secondary-color { color: var(--text-secondary); }

/* - Background Gradients (solid classes for elements) - */
.bg-gradient-1 { background: var(--gradient-1); }
.bg-gradient-2 { background: var(--gradient-2); }
.bg-gradient-3 { background: var(--gradient-3); }
.bg-gradient-4 { background: var(--gradient-4); }
.bg-gradient-5 { background: var(--gradient-5); }

/* - Soft Background + Color combos (for icon boxes, product icons etc.) - */
.bg-soft-primary {
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
}
.bg-soft-blue {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}
.bg-soft-green {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}
.bg-soft-amber {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}
.bg-soft-pink {
  background: rgba(236, 72, 153, 0.1);
  color: #ec4899;
}
.bg-soft-rose {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
.bg-soft-purple {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}
.bg-soft-teal {
  background: rgba(6, 182, 212, 0.1);
  color: #06b6d4;
}

/* - Chart Legend Color Dots - */
.legend-primary  { background: var(--primary); }
.legend-blue     { background: #3b82f6; }
.legend-teal     { background: #06b6d4; }
.legend-purple   { background: #8b5cf6; }
.legend-green    { background: #10b981; }
.legend-amber    { background: #f59e0b; }

/* - Typography - */
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.fs-11  { font-size: 11px; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }
.fs-14  { font-size: 14px; }
.fs-16  { font-size: 16px; }
.fs-18  { font-size: 18px; }
.fs-20  { font-size: 20px; }
.fs-24  { font-size: 24px; }

/* - Common Combo Classes - */
.order-id {
  font-weight: 600;
  color: var(--primary);
}

.table-amount {
  font-weight: 600;
}

.table-date {
  color: var(--text-muted);
  font-size: 13px;
}

/* - Small Gradient Button - */
.btn-gradient-sm {
  background: var(--gradient-1);
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.btn-gradient-sm:hover {
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
  transform: translateY(-1px);
}

/* - Change Indicator (positive/negative) - */
.change-up {
  font-size: 12px;
  font-weight: 600;
  color: #10b981;
}

.change-down {
  font-size: 12px;
  font-weight: 600;
  color: #ef4444;
}

/* - Icon Box (44x44 rounded icon container) - */
.icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* - List Row with bottom border - */
.list-row {
  border-bottom: 1px solid var(--border-color);
}

/* - Full-height card - */
.glass-card-full {
  height: 100%;
}

/* - Dropdown chevron icon - */
.dropdown-chevron {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s;
}

/* - Dropdown avatar (larger) - */
.navbar-user-avatar-lg {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--gradient-1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

/* - Page Footer - */
.page-footer {
  text-align: center;
  padding: 20px 0;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border-color);
}

.page-footer .footer-brand {
  color: var(--primary);
}

.page-footer .footer-heart {
  color: #ef4444;
}

/* - Stat Label/Value in list rows - */
.stat-row-label {
  font-size: 13px;
  color: var(--text-muted);
}

.stat-row-value {
  font-size: 18px;
  font-weight: 700;
}

/* - Browser/Progress stat label & value - */
.progress-label {
  font-size: 13px;
  font-weight: 500;
}

.progress-value {
  font-size: 13px;
  font-weight: 600;
}

/* - Country / Item name - */
.item-name {
  font-size: 14px;
  font-weight: 600;
}

.item-percent {
  font-size: 14px;
  font-weight: 700;
}

/* - Flag emoji size - */
.flag-icon {
  font-size: 24px;
}

/* - Chart box (full width with set height) - */
.chart-box {
  width: 100%;
}

.chart-box-lg {
  height: 320px;
}

.chart-box-md {
  height: 280px;
}

/* - Width 100% for tables etc. - */
.w-full {
  width: 100%;
}

/* ============================================
   BOOTSTRAP COMPONENTS OVERRIDES
   ============================================ */
/* Pagination */
.page-link {
  color: var(--text-secondary);
  border-color: var(--border-color);
  background: var(--bg-card);
  transition: all var(--transition-fast);
}

.page-link:hover {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border-color: var(--primary);
}

.page-link:focus {
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.25);
  color: var(--primary);
}

.page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.25);
}

.page-item.disabled .page-link {
  color: var(--text-muted);
  background-color: var(--bg-body);
  border-color: var(--border-color);
}

[data-theme="dark"] .page-link {
  background: var(--bg-card);
  border-color: var(--input-border-color);
}

[data-theme="dark"] .page-link:hover {
  background: rgba(var(--primary-rgb), 0.15);
}

[data-theme="dark"] .page-item.disabled .page-link {
  background-color: var(--bg-body);
}

/* Dropdowns */
.dropdown-menu {
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  box-shadow: var(--shadow-md);
  padding: 8px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
}

.dropdown-item {
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-weight: 500;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
}

.dropdown-item i {
  font-size: 16px;
  margin-top: -2px;
}

.dropdown-item:hover, .dropdown-item:focus {
  background-color: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
}

.dropdown-divider {
  border-top-color: var(--border-color);
  margin: 6px 0;
}

[data-theme="dark"] .dropdown-menu {
  background-color: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-item {
  color: var(--text-primary);
}

[data-theme="dark"] .dropdown-item:hover, [data-theme="dark"] .dropdown-item:focus {
  background-color: rgba(var(--primary-rgb), 0.15);
  color: var(--primary);
}


/* Chrome, Safari, Edge, Opera */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type=number] {
    -moz-appearance: textfield;
}