
/* === Global Scrollbar theming === */
html.dark {
  /* Firefox */
  scrollbar-color: #2a2a2a #1a1a1a;
}

html.dark ::-webkit-scrollbar {
  background-color: #1a1a1a;
}

html.dark ::-webkit-scrollbar-track {
  background-color: #1a1a1a;
}

html.dark ::-webkit-scrollbar-thumb {
  background-color: #2a2a2a;
  border-radius: 999px;
  border: 2px solid #1a1a1a;
}

html.dark ::-webkit-scrollbar-thumb:hover {
  background-color: #64748b;
}
/* Global font */
html {
  color-scheme: light;
}

html.dark {
  color-scheme: dark;
}
html, body {
  font-family: "Sora", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Make inputs/buttons also use it */
input, textarea, select, button {
  font-family: inherit;
}
/* ========== STRIPE-STYLE SIDEBAR ========== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 240px;
  background: #ffffff;

  display: flex;
  flex-direction: column;
  z-index: 1100;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}






/* Desktop: sidebar NEVER collapses */
@media (min-width: 768px) {
  .sidebar {
    transform: translateX(0) !important;
  }
}

/* ========== MOBILE IMPROVEMENTS ========== */

/* Fix topbar scrollbar clipping */
#topBar {
  right: 0;
  padding-right: 16px;
  left: 0;
  margin-left: 0;
}

@media (min-width: 768px) {
  #topBar {
    left: 240px;
    margin-left: 16px;
  }
}

/* Hide desktop sidebar completely on mobile */
@media (max-width: 767px) {
  .sidebar {
    display: none !important;
  }

  .sidebar-collapse-wrapper,
  .sidebar-expand-wrapper {
    display: none !important;
  }

  #layoutWrapper {
    padding-left: 0 !important;
  }

  #topBar {
    left: 0 !important;
  }
}

/* ========== STRIPE-STYLE MOBILE MENU ========== */



/* Mobile menu overlay */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile menu panel */
.mobile-menu-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: #ffffff;
  z-index: 2100;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.dark .mobile-menu-panel {
  background: #1a1a1a;
}

.mobile-menu-overlay.active .mobile-menu-panel {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: none; /* Remove border */
  min-height: 64px;
}

.mobile-menu-company {
  padding: 0; /* Remove padding */
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #e5e7eb; /* Keep bottom border only */
}

.dark .mobile-menu-company {
  border-bottom-color: #374151;
}
.mobile-menu-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.mobile-menu-close:hover {
  background: #f3f4f6;
}

.dark .mobile-menu-close:hover {
  background: #374151;
}

.mobile-menu-close i {
  font-size: 18px;
  color: #6b7280;
}

.dark .mobile-menu-close i {
  color: #9ca3af;
}

/* Fix topbar on mobile - hamburger and search side by side */
@media (max-width: 767px) {
  #topBar {
    padding-left: 12px;
    padding-right: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
  }

  /* Left section with hamburger + search */
  #topBar > .flex.items-center.gap-4 {
    gap: 12px !important;
    flex: 1;
    display: flex;
    align-items: center;
  }

  /* Hamburger button */
  #sidebarToggleTopbar {
    flex-shrink: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
  }



  /* Search container */
  #searchContainer {
    flex: 1;
    display: flex;
    align-items: center;
  }

  #searchContainer > .relative {
    width: 100%;
    display: flex;
    align-items: center;
  }

  /* Make search input smaller on mobile */
  #globalSearchInput {
    width: 100% !important;
    max-width: none !important;
    font-size: 15px;
    height: 36px !important;
  }

  /* Hide settings and help from topbar on mobile */
  #topBar .flex.items-center.gap-1 > div:has([data-tooltip="Help & Support"]),
  #topBar .flex.items-center.gap-1 > div:has([data-tooltip="Settings"]) {
    display: none !important;
  }

  /* Right section - keep notification centered */
  #topBar > .flex.items-center.gap-1 {
    display: flex;
    align-items: center;
  }
}

/* Add padding to mobile page content - FIXED */
@media (max-width: 767px) {
  /* Remove any horizontal padding from main wrappers */
  #mainContent {
    padding-left: 0;
    padding-right: 0;
    width: 100%;
    overflow-x: hidden;
  }

  #pageContainer {
    padding-left: 0;
    padding-right: 0;
    width: 100%;
    overflow-x: hidden;
  }

  #innerPageContent {
    width: 100%;
    padding: 25px;
    box-sizing: border-box;
  }
}
/* Fix mobile menu scrollbar visibility */
.mobile-menu-panel {
  overflow: hidden;
}

.mobile-menu-content {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu-content::-webkit-scrollbar {
  width: 4px;
}

.mobile-menu-content::-webkit-scrollbar-track {
  background: transparent;
}

.mobile-menu-content::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 2px;
}

.dark .mobile-menu-content::-webkit-scrollbar-thumb {
  background: #374151;
}

.mobile-menu-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  background: #f3f4f6;
  padding: 6px;
  display: none; /* Hide logo in mobile menu */
}

.dark .mobile-menu-logo {
  background: #374151;
}

.mobile-menu-company-name {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  text-align: center;
}

.dark .mobile-menu-company-name {
  color: #f9fafb;
}

/* Mobile menu content */
.mobile-menu-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

/* Mobile menu sections */
.mobile-menu-section {
  margin-bottom: 24px;
}

.mobile-menu-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 12px;
  margin-bottom: 4px;
}

.dark .mobile-menu-section-title {
  color: #6b7280;
}

/* Mobile menu links */
.mobile-menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: #6b7280;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.dark .mobile-menu-link {
  color: #9ca3af;
}

.mobile-menu-link i {
  width: 20px;
  font-size: 16px;
  text-align: center;
  opacity: 0.9;
}

.mobile-menu-link:hover {
  background: #f3f4f6;
  color: #1a1a1a;
}

.dark .mobile-menu-link:hover {
  background: #374151;
  color: #ffffff;
}

.mobile-menu-link.active {
  color: #2563eb;
  font-weight: 600;
}

.dark .mobile-menu-link.active {
  color: #3b82f6;
}

/* Mobile menu footer */
.mobile-menu-footer {
  padding: 12px 8px;
  border-top: 1px solid #e5e7eb;
}

.dark .mobile-menu-footer {
  border-top-color: #374151;
}

.mobile-menu-footer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: #6b7280;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.dark .mobile-menu-footer-link {
  color: #9ca3af;
}

.mobile-menu-footer-link i,
.mobile-menu-footer-link svg {
  width: 20px;
  font-size: 16px;
  text-align: center;
}

.mobile-menu-footer-link svg {
  stroke: currentColor;
}

.mobile-menu-footer-link:hover {
  background: #f3f4f6;
  color: #1a1a1a;
}

.dark .mobile-menu-footer-link:hover {
  background: #374151;
  color: #ffffff;
}

.mobile-menu-logout {
  color: #ef4444 !important;
}

.mobile-menu-logout:hover {
  background: rgba(239, 68, 68, 0.1) !important;
}

/* Smooth transitions between breakpoints */
@media (max-width: 1024px) {
  #layoutWrapper {
    transition: padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* Prevent content shift - mobile kicks in earlier */
@media (max-width: 900px) {
  .sidebar {
    width: 240px;
  }
}
/* Mobile Menu Profile Button */
.mobile-menu-profile-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  transition: background 0.15s;
}

.dark .mobile-menu-profile-btn {
  border-bottom-color: #374151;
}
.mobile-menu-profile-btn:active {
  background: #f3f4f6;
}
.mobile-menu-profile-btn:active {
  background: #f9fafb;
}

.dark .mobile-menu-profile-btn:active {
  background: #242424;
}

.mobile-profile-pic {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.mobile-profile-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.mobile-profile-name {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dark .mobile-profile-name {
  color: #f9fafb;
}

.mobile-profile-email {
  font-size: 13px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.dark .mobile-profile-email {
  color: #9ca3af;
}

.mobile-profile-chevron {
  font-size: 12px;
  color: #9ca3af;
  flex-shrink: 0;
}

.dark .mobile-profile-chevron {
  color: #6b7280;
}

/* Mobile Account Modal (Fullscreen) */
.mobile-account-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-account-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-account-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.dark .mobile-account-panel {
  background: #1a1a1a;
}

.mobile-account-modal.active .mobile-account-panel {
  transform: translateY(0);
}

/* Header */
.mobile-account-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.dark .mobile-account-header {
  border-bottom-color: #374151;
}

.mobile-account-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.mobile-account-close:active {
  background: #f3f4f6;
}

.dark .mobile-account-close:active {
  background: #374151;
}

.mobile-account-close i {
  font-size: 18px;
  color: #6b7280;
}

.dark .mobile-account-close i {
  color: #9ca3af;
}

.mobile-account-header-title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
}

.dark .mobile-account-header-title {
  color: #f9fafb;
}

/* Profile Section */
.mobile-account-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 16px;
}

.mobile-account-pic {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

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

.mobile-account-name {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dark .mobile-account-name {
  color: #f9fafb;
}

.mobile-account-email {
  font-size: 15px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}

.dark .mobile-account-email {
  color: #9ca3af;
}

/* Options */
.mobile-account-options {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 24px;
}

.mobile-account-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: transparent;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 8px;
}

.mobile-account-option:active {
  background: #f3f4f6;
}

.dark .mobile-account-option:active {
  background: #242424;
}

.mobile-account-option-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  stroke: #6b7280;
}

.dark .mobile-account-option-icon {
  stroke: #9ca3af;
}

.mobile-account-option span {
  flex: 1;
  text-align: left;
  font-size: 17px;
  font-weight: 500;
  color: #1a1a1a;
}

.dark .mobile-account-option span {
  color: #f9fafb;
}

.mobile-account-option-arrow {
  font-size: 14px;
  color: #9ca3af;
  flex-shrink: 0;
}

.dark .mobile-account-option-arrow {
  color: #6b7280;
}

/* Dark Mode Toggle */
.mobile-account-toggle {
  display: flex;
  align-items: center;
}

.mobile-account-toggle-input {
  display: none;
}

.mobile-account-toggle-label {
  width: 51px;
  height: 31px;
  background: #e5e7eb;
  border-radius: 16px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}

.mobile-account-toggle-label::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.mobile-account-toggle-input:checked + .mobile-account-toggle-label {
  background: #3b82f6;
}

.mobile-account-toggle-input:checked + .mobile-account-toggle-label::after {
  transform: translateX(20px);
}

.dark .mobile-account-toggle-label {
  background: #4b5563;
}

.dark .mobile-account-toggle-label::after {
  background: #1f2937;
}

/* Logout Option */
.mobile-account-logout span {
  color: #ef4444 !important;
}

.mobile-account-logout .mobile-account-option-icon {
  stroke: #ef4444 !important;
}

.mobile-account-logout:active {
  background: rgba(239, 68, 68, 0.1) !important;
}
/* Header */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px;
  min-height: 64px;
}

/* Account Switcher Button (like Stripe) */
.sidebar-account-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-account-btn:hover {
  background: #f3f4f6;
}

.sidebar-account-btn.open {
  background: #e5e7eb;
}

.sidebar-account-pic {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-account-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.sidebar-account-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-account-sub {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-account-chevron {
  font-size: 8px;
  color: #9ca3af;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-account-btn.open .sidebar-account-chevron {
  transform: rotate(180deg);
}

.account-modal {
  position: absolute;
  top: 76px;
  left: 8px;
  right: auto;
  width: 320px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
    padding-bottom: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  z-index: 9999 !important;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s;
  pointer-events: none;
  visibility: hidden;
}

.account-modal:not(.hidden) {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

.account-modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  text-align: center;
}
.account-modal-pic {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.account-modal-info {
  width: 100%;
}

.account-modal-name {
  font-size: 14px;
  font-weight: 600;
  color: #242424;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-modal-email {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.account-modal-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 0;
}

.account-modal-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  margin: 0 8px;
  width: calc(100% - 16px);
  background: transparent;
  border: none;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}



/* SVG Icons */
.account-modal-icon {
  width: 16px;
  height: 16px;
  color: #9ca3af;
  flex-shrink: 0;
  stroke-width: 2;
}

.account-modal-item:hover .account-modal-icon {
  color: #242424;
}
/* ✅ HOVER BACKGROUND ON ALL ITEMS */
.account-modal-item:hover {
  background: #f3f4f6 !important;
  color: #242424;
}
/* User Profile Item with Role Tooltip */
.account-modal-user {
  position: relative;
}

/* Info icon - hidden by default, shows on row hover */
.account-modal-info-icon {
  margin-left: auto;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.15s ease;
  position: relative;
  flex-shrink: 0;
}

.account-modal-info-icon svg {
  width: 14px;
  height: 14px;
  color: #9ca3af;
  stroke-width: 2;
}

.account-modal-user:hover .account-modal-info-icon {
  opacity: 1;
}

/* Tooltip appears when hovering the info icon */
.account-modal-role-tooltip {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 8px;
  background: #1f2937;
  color: white;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 1000;
}

.account-modal-info-icon:hover .account-modal-role-tooltip {
  opacity: 1;
}

.account-modal-role-tooltip::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: #1f2937;
}

.account-modal-logout {
  color: #6b7280;
}

.account-modal-logout .account-modal-icon {
  color: #9ca3af;
}

.account-modal-logout:hover {
  background: #fef2f2 !important;
  color: #ef4444;
}

.account-modal-logout:hover .account-modal-icon {
  color: #ef4444;
}
.sidebar-toggle-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #a1a1aa;
  font-size: 16px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
/* Dark mode for SVG icons and tooltips */
html.dark .account-modal-icon {
  color: #9ca3af;
}

html.dark .account-modal-item:hover .account-modal-icon {
  color: #ffffff;
}

html.dark .account-modal-logout .account-modal-icon {
  color: #9ca3af;
}

html.dark .account-modal-logout:hover .account-modal-icon {
  color: #ef4444;
}

html.dark .account-modal-info-icon svg {
  color: #9ca3af;
}

html.dark .account-modal-role-tooltip {
  background: #374151;
}

html.dark .account-modal-role-tooltip::after {
  border-left-color: #374151;
}

/* Group Toggle Headers */
.sidebar-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
  margin-bottom: 4px;
}

.sidebar-group-title {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-group-toggle:hover {
  background: #f9fafb;
}

.sidebar-group-toggle:hover .sidebar-group-title {
  color: #6b7280;
}

.sidebar-group-toggle i,
.sidebar-group-toggle .fa-chevron-down {
  font-size: 10px !important;
  color: #9ca3af !important;
  transition: transform 0.12s cubic-bezier(0.25, 0.46, 0.45, 0.94), color 0.12s ease;
  width: auto !important;
  min-width: auto !important;
}

.sidebar-group-toggle:hover i,
.sidebar-group-toggle:hover .fa-chevron-down {
  color: #6b7280 !important;
}

.sidebar-group-toggle.open i,
.sidebar-group-toggle.open .fa-chevron-down {
  transform: rotate(180deg) !important;
}
.sidebar-account-chevron {
  font-size: 10px;
  color: #9ca3af;
  flex-shrink: 0;
  transition: transform 0.12s cubic-bezier(0.25, 0.46, 0.45, 0.94), color 0.12s ease;
}
.sidebar-account-btn:hover .sidebar-account-chevron {
  color: #6b7280;
}

.sidebar-account-btn.open .sidebar-account-chevron {
  transform: rotate(180deg);
}

/* Group Content (slides open/closed) */
.sidebar-group-content {
  max-height: 0;
  overflow: hidden;
  transform: translateY(-8px);
  opacity: 0;
  transition: max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s ease;
}

.sidebar-group-content.open {
  max-height: 400px;
  margin-bottom: 4px;
  transform: translateY(0);
  opacity: 1;
}
.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.sidebar-logo {
  height: 24px;
  width: auto;
  object-fit: contain;
}

/* Content */
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 8px 12px 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-content::-webkit-scrollbar {
  display: none;
}

/* Divider */
.sidebar-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 8px 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
  transition: none;
  margin-bottom: 1px;
  line-height: 1.4;
}

.sidebar-link i {
  width: 16px;
  font-size: 15px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.9;
}

.sidebar-link span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Hover - works on ALL links */
.sidebar-link:hover {
  background: #f3f4f6;
  color: #1a1a1a;
}

.sidebar-link:hover i {
  color: #1a1a1a;
}

/* Active - only text/icon color (no background) */
.sidebar-link.active {
  background: transparent;
  color: #2563eb;
  font-weight: 600;
}
.sidebar-link.active:hover {
  background: #f3f4f6;
}
.sidebar-link.active i {
  color: #2563eb;
  opacity: 1;
}

/* Spacer */
.sidebar-spacer {
  flex: 1;
  min-height: 16px;
}

/* Logout */
.logout-link {
  color: #ef4444 !important;
  margin-top: 8px;
}

.logout-link:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #f87171 !important;
}

/* Lab dot indicator */
.nav-bullet {
  position: relative;
}

.nav-bullet::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.nav-bullet.is-on::after {
  opacity: 1;
}

/* ========== SIDEBAR DARK MODE ========== */
html.dark .sidebar {
  background: #1a1a1a !important;
  border-right: none !important; /* Remove this border - we use ::after instead */
}

html.dark .sidebar-header {
  background: #1a1a1a !important;
  border-bottom: none !important;
}

/* Account button */
html.dark .sidebar-account-btn {
  background: transparent !important;
}

html.dark .sidebar-account-btn:hover {
  background: #242424 !important;
}

html.dark .sidebar-account-name {
  color: #e5e7eb !important;
}

html.dark .sidebar-account-sub {
  color: #9ca3af !important;
}

html.dark .sidebar-account-chevron {
  color: #9ca3af !important;
}

/* Sidebar links - normal state */
html.dark .sidebar-link {
  color: #9ca3af !important;
  background: transparent !important;
}

html.dark .sidebar-link i {
  color: #9ca3af !important;
}

/* Sidebar links - hover (ONLY when expanded) */
html.dark .sidebar:not(.sidebar-collapsed) .sidebar-link:hover {
  background: #242424 !important;
  color: #ffffff !important;
}

html.dark .sidebar:not(.sidebar-collapsed) .sidebar-link:hover i {
  color: #ffffff !important;
}

html.dark .sidebar:not(.sidebar-collapsed) .sidebar-link.active:hover {
  background: #242424 !important;
}
/* Sidebar links - active (only text/icon color) */
html.dark .sidebar-link.active {
  background: transparent !important;
  color: #ffffff !important;
  font-weight: 600;
}

html.dark .sidebar-link.active i {
  color: #ffffff !important;
}

/* Group titles */
html.dark .sidebar-group-title {
  color: #6b7280 !important;
}

/* Group toggle buttons */
html.dark .sidebar-group-toggle {
  color: #6b7280 !important;
}

html.dark .sidebar-group-toggle:hover {
  background: #242424 !important;
  color: #9ca3af !important;
}

/* Dividers */
html.dark .sidebar-divider {
  background: #2a2a2a !important;
}

/* Account modal */
html.dark .account-modal {
  background: #1a1a1a !important;
  border: 1px solid #2a2a2a !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8) !important;
}

html.dark .account-modal-name {
  color: #e5e7eb !important;
}

html.dark .account-modal-email {
  color: #9ca3af !important;
}

html.dark .account-modal-divider {
  background: #2a2a2a !important;
}

html.dark .account-modal-item {
  color: #e5e7eb !important;
}

html.dark .account-modal-item:hover {
  background: #242424 !important;
}

html.dark .account-modal-logout:hover {
  background: rgba(239, 68, 68, 0.15) !important;
}

html.dark .account-modal-item i {
  color: #9ca3af !important;
}

html.dark .account-modal-item:hover i {
  color: #ffffff !important;
}

/* Logout link */
html.dark .logout-link {
  color: #9ca3af !important;
}

html.dark .logout-link:hover {
  background: #242424 !important;
  color: #ef4444 !important;
}

html.dark .logout-link:hover i {
  color: #ef4444 !important;
}
/* Dark Mode Toggle Switch */
.account-modal-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.account-modal-toggle-input {
  display: none;
}

.account-modal-toggle-label {
  width: 36px;
  height: 20px;
  background: #e5e7eb;
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}

.account-modal-toggle-label::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.account-modal-toggle-input:checked + .account-modal-toggle-label {
  background: #3b82f6;
}

.account-modal-toggle-input:checked + .account-modal-toggle-label::after {
  transform: translateX(16px);
}

/* Dark mode */
html.dark .account-modal-toggle-label {
  background: #4b5563;
}

html.dark .account-modal-toggle-label::after {
  background: #1f2937;
}
/* Dark Mode item - better alignment */
#modalDarkMode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px !important; /* ✅ Reset to normal padding */
}

#modalDarkMode span {
  flex: 1;
}

/* ===== SIDEBAR PROFILE SHIMMER ===== */
.sidebar-account-shimmer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.sidebar-account-shimmer.hidden {
  display: none;
}

.shimmer-pic {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(
    110deg,
    #e5e7eb 0%,
    #e5e7eb 40%,
    #f3f4f6 50%,
    #e5e7eb 60%,
    #e5e7eb 100%
  );
  background-size: 200% 100%;
  animation: shimmer-wave 2s ease-in-out infinite; /* ✅ ADDED */
}

.shimmer-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shimmer-line {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(
    110deg,
    #e5e7eb 0%,
    #e5e7eb 40%,
    #f3f4f6 50%,
    #e5e7eb 60%,
    #e5e7eb 100%
  );
  background-size: 200% 100%;
  animation: shimmer-wave 2s ease-in-out infinite; /* ✅ ADDED */
}

.shimmer-line-long {
  width: 80px;
  animation-delay: 0.1s; /* ✅ Slight delay for stagger effect */
}

.shimmer-line-short {
  width: 50px;
  animation-delay: 0.2s; /* ✅ More delay for stagger effect */
}

/* Dark mode shimmer */
html.dark .shimmer-pic,
html.dark .shimmer-line {
  background: linear-gradient(
    110deg,
    #1a1a1a 0%,
    #1a1a1a 40%,
    #2a2a2a 50%,
    #1a1a1a 60%,
    #1a1a1a 100%
  );
  background-size: 200% 100%;
}

/* ✅ SHIMMER ANIMATION */
@keyframes shimmer-wave {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Real button - hidden while loading */
.sidebar-account-btn.loading {
  opacity: 0;
  pointer-events: none;
}

.sidebar-account-btn {
  transition: opacity 0.3s ease;
}

/* ===== STRIPE-STYLE SIDEBAR COLLAPSE ===== */

/* Wrapper positioned outside sidebar */
.sidebar-collapse-wrapper {
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1300;
}

/* Collapse button */
.sidebar-collapse-btn {
  width: 24px;
  height: 48px;
  background: transparent;
  cursor: pointer;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.2s ease;
}

/* ✅ HOVER: Line moves LEFT to show collapse direction */
.sidebar-collapse-btn:hover {
  transform: translateX(-3px);
}

/* Create chevron using pseudo-elements */
.sidebar-collapse-btn::before,
.sidebar-collapse-btn::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 8px;
  background: #6b7280;
  left: 50%;
  top: 50%;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* DEFAULT STATE: Stacked to form vertical line */
.sidebar-collapse-btn::before {
  transform: translate(-50%, -8px);
  transform-origin: center bottom;
}

.sidebar-collapse-btn::after {
  transform: translate(-50%, 0px);
  transform-origin: center top;
}

/* HOVER STATE: Rotate to form < chevron */
.sidebar-collapse-btn:hover::before {
  transform: translate(-50%, -4px) rotate(45deg);
}

.sidebar-collapse-btn:hover::after {
  transform: translate(-50%, 4px) rotate(-45deg);
}

/* Tooltip */
.sidebar-collapse-tooltip {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 12px;
  padding: 6px 12px;
  background: #1f2937;
  color: white;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 9999;
}

.sidebar-collapse-wrapper:hover .sidebar-collapse-tooltip {
  opacity: 1;
}

/* Dark mode */
html.dark .sidebar-collapse-btn::before,
html.dark .sidebar-collapse-btn::after {
  background: #9ca3af;
}

html.dark .sidebar-collapse-tooltip {
  background: #374151;
}

/* ===== EXPAND BUTTON (when collapsed) ===== */

/* Wrapper positioned outside collapsed sidebar */
.sidebar-expand-wrapper {
  position: fixed;
  left: 55px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sidebar-expand-wrapper.show {
  opacity: 1;
  pointer-events: auto;
}

/* Expand button */
.sidebar-expand-btn {
  width: 24px;
  height: 48px;
  background: transparent;
  cursor: pointer;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.2s ease;
}


/* Create chevron using pseudo-elements */
.sidebar-expand-btn::before,
.sidebar-expand-btn::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 8px;
  background: #6b7280;
  left: 50%;
  top: 50%;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* DEFAULT: Stacked to form vertical line */
.sidebar-expand-btn::before {
  transform: translate(-50%, -8px);
  transform-origin: center bottom;
}

.sidebar-expand-btn::after {
  transform: translate(-50%, 0px);
  transform-origin: center top;
}

/* HOVER: Rotate to form > chevron AND move right - trigger on wrapper hover */
.sidebar-expand-wrapper:hover .sidebar-expand-btn::before {
  transform: translate(calc(-50% + 20px), -4px) rotate(-45deg);
}

.sidebar-expand-wrapper:hover .sidebar-expand-btn::after {
  transform: translate(calc(-50% + 20px), 4px) rotate(45deg);
}

/* Tooltip */
.sidebar-expand-tooltip {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 12px;
  padding: 6px 12px;
  background: #1f2937;
  color: white;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 9999;
}

.sidebar-expand-wrapper:hover .sidebar-expand-tooltip {
  opacity: 1;
}

/* Dark mode */
html.dark .sidebar-expand-btn::before,
html.dark .sidebar-expand-btn::after {
  background: #9ca3af;
}

html.dark .sidebar-expand-tooltip {
  background: #374151;
}
/* ✅ Animated right border for sidebar */
.sidebar::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #e5e7eb;
  transition: transform 0.2s ease;
  z-index: 1;
}

html.dark .sidebar::after {
  background: #2a2a2a;
}

/* When hovering collapse: right border shifts LEFT */
.sidebar:has(.sidebar-collapse-wrapper:hover)::after {
  transform: translateX(-6px);
}

/* Collapsed sidebar border - needs JS class for expand hover */
.sidebar.sidebar-collapsed::after {
  transform: translateX(0);
}

.sidebar.sidebar-collapsed.expand-hover::after {
  transform: translateX(6px);
}
/* ===== COLLAPSED SIDEBAR ===== */
.sidebar.sidebar-collapsed {
  width: 64px !important;
  transform: translateX(0) !important;
}

.sidebar.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding: 0;
}

.sidebar.sidebar-collapsed .sidebar-toggle-btn,
.sidebar.sidebar-collapsed .sidebar-account-btn,
.sidebar.sidebar-collapsed .sidebar-account-shimmer {
  display: none;
}

.sidebar.sidebar-collapsed .sidebar-content {
  padding: 0;
}

/* Hide most group toggles when collapsed, but keep SUBSCRIPTION */
.sidebar.sidebar-collapsed .sidebar-group-toggle:not([data-section="subscription"]),
.sidebar.sidebar-collapsed .sidebar-divider,
.sidebar.sidebar-collapsed .sidebar-spacer {
  display: none !important;
}

/* Style subscription toggle when collapsed */
.sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"] {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  margin: 4px auto;
  padding: 0 !important;
  border-radius: 8px;
  background: transparent !important;
  transition: none !important; /* ✅ KILL ALL transitions when collapsed */
  cursor: pointer;
  position: relative;
}
.sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"]:hover {
  background: #f3f4f6 !important;
}

html.dark .sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"]:hover {
  background: #242424 !important;
}

/* Hide the text and chevron, only show icon */
.sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"] .sidebar-group-title,
.sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"] .fa-chevron-down {
  display: none !important;
}

/* ✅ Icon ALWAYS absolutely centered - never in flex flow */
.sidebar-group-toggle[data-section="subscription"] .fa-credit-card {
  position: absolute !important;
  top: 50%;
  left: 16px; /* When expanded, icon sits 16px from left */
  transform: translateY(-50%);
  font-size: 15px !important;
  margin: 0 !important;
  width: 16px !important;
  color: #6b7280 !important;
  transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When EXPANDED: icon is in normal flex flow */
.sidebar-group-toggle[data-section="subscription"] .fa-credit-card {
  position: relative;
  font-size: 15px !important;
  margin-right: 10px !important; /* Normal spacing from text */
  width: 16px !important;
  color: #6b7280 !important;
  transition: color 0.2s ease;
}
/* Dark mode - white icon when expanded */
html.dark .sidebar-group-toggle[data-section="subscription"] .fa-credit-card {
  color: #ffffff !important;
}
/* Hide the text and chevron, only show icon */
.sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"] .sidebar-group-title,
.sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"] .fa-chevron-down {
  display: none !important;
}

/* When EXPANDED: icon stays in normal flex flow - override inline styles */
.sidebar-group-toggle[data-section="subscription"] .fa-credit-card {
  position: static !important; /* ✅ NOT absolute when expanded */
  transform: none !important;
  margin-right: 10px !important;
  font-size: 15px !important;
  width: 16px !important;
  color: #6b7280 !important;
  opacity: 0.9 !important;
}

/* When COLLAPSED: icon becomes absolutely centered */
.sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"] .fa-credit-card {
  position: absolute !important;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  transition: none !important;
}

/* Disable active states for Billing link when collapsed */
.sidebar.sidebar-collapsed #subscriptionGroup .sidebar-link.active {
  background: transparent !important;
  color: #6b7280 !important;
  transform: none !important;
  pointer-events: none !important;
}

.sidebar.sidebar-collapsed #subscriptionGroup .sidebar-link.active i {
  color: #6b7280 !important;
}

html.dark .sidebar.sidebar-collapsed #subscriptionGroup .sidebar-link.active {
  background: transparent !important;
  color: #9ca3af !important;
}

html.dark .sidebar.sidebar-collapsed #subscriptionGroup .sidebar-link.active i {
  color: #9ca3af !important;
}

/* Show group content when collapsed, but hide ONLY the subscription dropdown */
.sidebar.sidebar-collapsed #subscriptionGroup {
  display: none !important;  /* Only hide the subscription dropdown */
}

/* All OTHER group contents should be visible and show icons */
.sidebar.sidebar-collapsed .sidebar-group-content:not(#subscriptionGroup) {
  display: block !important;
  max-height: none !important;
  opacity: 1 !important;
  transform: none !important;
},
.sidebar.sidebar-collapsed .sidebar-group-content {
  display: block !important;
  overflow: visible !important; /* ✅ ADD THIS LINE */
  max-height: none !important;
  opacity: 1 !important;
  transform: none !important;
}

.sidebar.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 12px 0;
}

.sidebar.sidebar-collapsed .sidebar-link span {
  display: none;
}

.sidebar.sidebar-collapsed .sidebar-link i {
  margin: 0;
  font-size: 18px;
}

/* Hide collapse wrapper when sidebar is collapsed */
.sidebar.sidebar-collapsed .sidebar-collapse-wrapper {
  display: none !important;
}

/* ===== LAYOUT ===== */
@media (min-width: 768px) {
  #layoutWrapper.sidebar-collapsed {
    padding-left: 64px !important;
  }

  #layoutWrapper.sidebar-collapsed #topBar {
    left: 90px !important;
  }
}

/* Hide on mobile */
@media (max-width: 767px) {
  .sidebar-collapse-wrapper,
  .sidebar-expand-wrapper {
    display: none !important;
  }
}
/* ========== TOPBAR ========== */



html.dark #topBar {
  background: #18181b;
  border-bottom: none !important;
}
#topBar {
  border-bottom: none !important;
}
/* ========== PAGE CONTAINER ========== */
#pageContainer {
  flex: 1;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 80px !important;
  padding-bottom: max(24px, env(safe-area-inset-bottom)) !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin: 0 !important;
}
/* ========== INNER PAGE CONTENT ========== */
#innerPageContent {
  width: 100%;
  max-width: 100%;
  padding: 0 !important;  /* No padding - pages handle their own */
}

html.dark #pageContainer {
  background: #1a1a1a;
}

/* ========== MOBILE ========== */

@media (max-width: 639px) {
  .sidebar {
    width: 280px;
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
  }

  #mainContent {
    margin-left: 0 !important;
  }

  #topBar {
    left: 0 !important;
  }

  .sidebar-toggle-btn {
    display: flex !important;
  }
}

/* Mobile overlay - ALWAYS STARTS HIDDEN */
#mobileOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1050;
  transition: opacity 0.25s ease;
  opacity: 0 !important;  /* ← FORCE HIDDEN BY DEFAULT */
  pointer-events: none !important;
}

/* Only visible when explicitly shown (when .show class added) */
#mobileOverlay:not(.hidden) {
  opacity: 1 !important;
  pointer-events: auto !important;
}


/* -------------------------------------------------- */
/* 🔴 Required-field helper styles (light & dark mode) */
/* -------------------------------------------------- */
.inventory-field-error,
.inventory-field-error:focus {
  border-color: #ef4444 !important;        /* red-500 */
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.45);
}

.inventory-field-error .ts-control {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.45);
}

.inventory-field-error-text {
  color: #ef4444;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

html.dark .inventory-field-error,
html.dark .inventory-field-error:focus {
  border-color: #f87171 !important;        /* red-400 */
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.5);
}

html.dark .inventory-field-error .ts-control {
  border-color: #f87171 !important;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.5);
}

html.dark .inventory-field-error-text {
  color: #fca5a5;
}




/* === General Fixes === */



#mainView {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.card-hover {
  transition: all 0.3s ease;
}
.card-hover:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}
.card-hover:active {
  transform: scale(0.98);
}




/* Shared modal overlay behaviour */
.modal-overlay {
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(0px);
  transition: opacity 200ms ease, backdrop-filter 200ms ease;
}

.modal-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(2px);
}


#supplierModalOverlay,
#packageModalOverlay {
  background: rgba(15, 23, 42, 0.45);
}

.dark #supplierModalOverlay,
.dark #packageModalOverlay {
  background: rgba(255, 255, 255, 0.12);
}




/* Patients Modals (copy of inventory style) */

/* Overlay */
#patientModalOverlay, #profileModalOverlay {
  background: rgba(0, 0, 0, 0.3);
  transition: opacity 200ms ease;
}

/* Content */
#patientModalContent, #profileModalContent {
  transition: transform 200ms ease, opacity 200ms ease;
  transform: scale(1);
}

/* Hidden modal */
#patientModal.opacity-0, #profileModal.opacity-0 {
  opacity: 0;
  pointer-events: none;
}

/* Visible modal */
#patientModal.show, #profileModal.show {
  opacity: 1;
  pointer-events: auto;
}

/* Zoom on show */
#patientModal.show #patientModalContent, #profileModal.show #profileModalContent {
  transform: scale(1);
}

#patientModal.opacity-0 #patientModalContent, #profileModal.opacity-0 #profileModalContent {
  transform: scale(0.98);
}


/* Optional: only if you're not using Tailwind plugins for animation */
#aiSuggestionModal.show {
  opacity: 1 !important;
  pointer-events: auto;
}

#aiSuggestionBox.show {
  opacity: 1;
  transform: scale(1);
}
.loader {
  border: 2px solid #f3f3f3;
  border-top: 2px solid white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  vertical-align: middle;
  display: none; /* ✅ start hidden */
}

/* Add spin only when needed */
.loader-spin {
  display: inline-block;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.appointment-block {
  z-index: 10;
}


/* TOM*/

/* Wrapper ensures full width */
.ts-wrapper {
  width: 100%;
}

/* Control input styling */
.ts-control {
  padding: 0.5rem 0.75rem;           /* Tailwind: px-3 py-2 */
  font-size: 0.875rem;               /* Tailwind: text-sm */
  border: 1px solid #d1d5db;         /* Tailwind: border-gray-300 */
  border-radius: 0.5rem;             /* Tailwind: rounded-lg */
  background-color: #ffffff;         /* Tailwind: bg-white */
  color: #2a2a2a;                    /* Tailwind: text-gray-800 */
  box-shadow: 0 1px 2px rgba(0,0,0,0.05); /* Tailwind: shadow-sm */
}

/* Dropdown menu */
.ts-dropdown {
  border: 1px solid #d1d5db;         /* border-gray-300 */
  border-radius: 0.5rem;             /* rounded-lg */
  box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* shadow-md */
  background-color: #ffffff;
  font-size: 0.875rem;               /* text-sm */
  margin-top: 0.25rem;               /* mt-1 */
}

/* Dropdown items */
.ts-dropdown .option {
  padding: 0.5rem 0.75rem;           /* px-3 py-2 */
  cursor: pointer;
  transition: background-color 0.2s;
}

/* Hover & active item styling */
.ts-dropdown .option:hover,
.ts-dropdown .active {
  background-color: #e0f2fe;         /* Tailwind: bg-blue-100 */
  color:#1a1a1a;                    /* Tailwind-ish: text-slate-900 */
}


#branchSelector + .ts-wrapper {
  width: 20rem !important;  /* Adjust as needed */
  max-width: 100%;
}

.dropdown-up {
  transform-origin: bottom right;
}

#substituteModalContent {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fade-in 0.3s ease-out forwards;
}


.rotate-180 {
  transform: rotate(180deg);
}

.ts-dropdown {
  z-index: 10000 !important;
}

/*loading for graph*/

@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.shimmer {
  background: linear-gradient(to right, #f3f3f3 8%, #e2e2e2 18%, #f3f3f3 33%);
  background-size: 800px 104px;
  animation: shimmer 1.2s linear infinite;
}


/*fade for invoice table*/
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

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

/* 🌀 Modern smooth dual-ring spinner */
.modern-spinner {
  border: 4px solid #e5e7eb; /* gray-200 */
  border-top: 4px solid #3b82f6; /* blue-500 */
  border-radius: 50%;
  width: 32px;
  height: 32px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


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







html.dark .dropdown-menu {
  background-color: #2a2a2a !important; /* gray-800 */
  color: #f3f4f6 !important; /* light text */
  border-color: #242424 !important;
}

/* Force all dropdown items to be visible in dark mode */
html.dark .dropdown-item {
  color: #f3f4f6 !important;
  opacity: 1 !important;
}

html.dark .dropdown-item i {
  color: inherit !important;
  opacity: 1 !important;
}

html.dark #profileDropdown {
  background-color: #2a2a2a !important;
  color: #f3f4f6 !important;
  border-color: #242424 !important;
}


html.dark .dropdown-item:hover {
  background-color: #242424 !important; /* hover background */
}

#superDashboardPage, #superDashboardPage * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
html.dark .bg-white {
  background-color: #1a1a1a !important; /* slate-800 */
}

.card, .chart-container {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  color: #1a1a1a;
}

html.dark .card,
html.dark .chart-container {
  background-color: #1a1a1a !important;
  border-color: #2a2a2a !important;
  box-shadow: 0 6px 16px rgba(0,0,0,.40);
  color: #f8fafc;
}


html.dark .card :is(.text-slate-900, .text-slate-800, .text-gray-900, .text-gray-800),
html.dark .chart-container :is(.text-slate-900, .text-slate-800, .text-gray-900, .text-gray-800) {
  color: #f8fafc !important;
}

html.dark .card :is(.text-slate-700, .text-slate-600, .text-gray-700, .text-gray-600),
html.dark .chart-container :is(.text-slate-700, .text-slate-600, .text-gray-700, .text-gray-600) {
  color: #cbd5f5 !important;
}

html.dark .card :is(.text-slate-500, .text-gray-500),
html.dark .chart-container :is(.text-slate-500, .text-gray-500) {
  color: #94a3b8 !important;
}

#superDashboardPage {
  transition: background-color 0.3s ease, color 0.3s ease;
  padding: 1.5rem; /* match p-6 */
}
html.dark .border-gray-100 {
  border-color: #1a1a1a !important; /* Tailwind slate-800 (almost blends) */
}

/*  timer for patient list on emr page */
.timer-badge {
  @apply text-xs font-medium px-2 py-1 rounded-full border transition duration-200;
}
.timer-green {
  @apply bg-green-100 border-green-500 text-green-800;
}
.timer-yellow {
  @apply bg-yellow-100 border-yellow-500 text-yellow-800;
}
.timer-red {
  @apply bg-red-100 border-red-500 text-red-800 animate-pulse;
}


/* don't eat taps unless explicitly opened */
#mobileOverlay { pointer-events: none; }
#mobileOverlay.hidden,
#mobileOverlay[hidden],
#mobileOverlay[aria-hidden="true"] {
  pointer-events: none !important;
  opacity: 0 !important;
}
/* when you actually show it, JS already removes .hidden */
/* default: inert */
#mobileOverlay { pointer-events: none; }

/* when shown (no .hidden), allow clicks to close */
#mobileOverlay:not(.hidden) { pointer-events: auto; }




/* Default dropdown (opens down) */
.actionDropdown {
  top: 2.5rem; /* same as top-10 */
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  max-height: 24rem;
  overflow: hidden;
  pointer-events: auto;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    max-height 0.2s ease,
    visibility 0.2s ease;
}


/* Animate close/open for table ellipsis action menus */
.actionDropdown.hidden {
  display: block !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
  max-height: 0;
}


.actionDropdown.drop-up.hidden {
  transform: translateY(10px);
}





/* When there's not enough space below */
.actionDropdown.drop-up {
  top: auto !important;
  bottom: 2.5rem; /* pull it upward */
}


#commandModal .command-group {
  padding: 8px 16px;
  font-weight: 600;
  color: #4b5563;
  font-size: 0.75rem;
  text-transform: uppercase;
  border-top: 1px solid #e5e7eb;
}

#commandModal .command-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

#commandModal .command-item:hover {
  background-color: #f9fafb;
}

#commandModal .command-icon {
  width: 20px;
  margin-right: 12px;
  text-align: center;
}

#commandModal .command-label {
  flex: 1;
}
#commandOverlay,
#commandModal {
  cursor: default !important;
}


.lab-tab {
  position: relative;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563; /* gray-600 */
  background-color: transparent;
  transition: all 0.2s ease;
}

.lab-tab:hover {
  background-color: #f3f4f6; /* gray-100 */
}


.count-badge {
  background-color: #2563eb; /* blue */
  color: white;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 9999px;
  margin-left: 6px;
}
canvas {
  image-rendering: auto;
  max-width: 100%;
  height: auto;
}


.loader-spin {
  width: 18px; height: 18px;
  border: 2px solid #e5e7eb;      /* gray-200 */
  border-top-color: #2563eb;      /* blue-600 */
  border-radius: 9999px;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


html.overlay-open, body.overlay-open { overflow: hidden; overscroll-behavior: contain; }

/* hide scrollbars on mobile tab row */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Mobile height (collapsible opens to 60vh via JS; base is 45vh) */
#patientListViewport { height: 45vh; }

/* Desktop: keep EXACT original fixed height */
@media (min-width: 768px) {
  #patientListViewport { height: 2450px; }
}
/* --- Sidebar toggle icon (uses your PNGs) --- */
.btn-sidebar-toggle {
  position: relative;
  overflow: hidden;                       /* for the fill effect */
  height: 36px;
  width: 36px;
  display: grid;
  place-items: center;
  border-radius: 0.375rem;                /* rounded-md */
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

/* the icon itself — default image */
.btn-sidebar-icon{
  width:22px; height:22px;
  background: center / contain no-repeat url("../img/sidebar.png?v=2");
}

.btn-sidebar-toggle:hover .btn-sidebar-icon{
  background-image: url("../img/sidebar2.png?v=2");
}

/* Optional: make PNG visible in dark mode if needed */
.dark .btn-sidebar-icon {
  filter: brightness(0) invert(1);        /* comment out if your PNGs already look good */
}



/* Direction logic: set on the layout wrapper */
#layoutWrapper[data-collapsed="false"] .btn-sidebar-toggle::before {
  transform-origin: right;                /* expanded -> fill from RIGHT (collapsing) */
}
#layoutWrapper[data-collapsed="true"] .btn-sidebar-toggle::before {
  transform-origin: left;                 /* collapsed -> fill from LEFT (expanding) */
}

/* Softer, more diffused card shadow */
.shadow-soft {
  box-shadow:
    0 16px 48px -20px rgba(0, 0, 0, 0.25),
    0 10px 30px -24px rgba(0, 0, 0, 0.18);
}

/* Ensure insights containers don't clip shadows */
#tabInsightsRoot,
#tabContent,
#innerPageContent {
  overflow: visible !important;
}
/* Chrome, Safari, Edge */
.scrollbar-none::-webkit-scrollbar {
  display: none;
}

/* Firefox */
.scrollbar-none {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;     /* Firefox */
}



/* Global blue ring – exclude TomSelect */
input[type="text"]:focus:not(.ts-wrapper *),
input[type="search"]:focus:not(.ts-wrapper *),
input[type="number"]:focus:not(.ts-wrapper *),
input[type="date"]:focus:not(.ts-wrapper *),
select:focus:not(.ts-hidden-select),
textarea:focus:not(.ts-wrapper *) {
  outline: none !important;
  border-color: transparent !important;
  box-shadow: 0 0 0 2px #3b82f6 !important;
}


/* Tiny dot on sidebar link */
.nav-bullet { position: relative; }
.nav-bullet::after{
  content:"";
  position:absolute;
  right:12px; top:50%; transform:translateY(-50%);
  width:8px; height:8px; border-radius:9999px;
  background:#ef4444; box-shadow:0 0 0 2px #fff;
  opacity:0; transition:opacity .15s ease; pointer-events:none;
}
.nav-bullet.is-on::after{ opacity:1; }
/* Make z-index work reliably inside the panel (mobile browsers) */
#patientPanelBody { position: relative; isolation: isolate; }

/* Desktop never clips */
@media (min-width:768px){
  #patientPanelBody { overflow: visible !important; }
}


  /* All buttons: no wrapping */
  button {
    white-space: nowrap;
  }

  /* On very small phones */
  @media (max-width: 420px) {
    button {
      font-size: 0.75rem;   /* Tailwind ~ text-xs */
      padding: 0.35rem 0.6rem;  /* smaller height & width */
    }
  }


/* --- Exempt TomSelect from the global blue ring --- */
/* Kill the ring on the TomSelect control itself and its inner input */
.ts-wrapper .ts-control,
.ts-wrapper .ts-control input[type="text"]:focus {
  outline: none !important;
  border-color: #d1d5db !important;       /* normal gray border */
  box-shadow: none !important;            /* remove blue focus ring */
}

/* Keep a subtle focus style for TomSelect only (optional) */
.ts-wrapper.focus .ts-control {
  border-color: #94a3b8 !important;       /* slate-400 */
  box-shadow: 0 0 0 1px rgba(148,163,184,.35) !important; /* soft ring */
}

html.dark body.theme-dark-enabled .ts-wrapper .ts-control,
html.dark body.theme-dark-enabled .ts-wrapper .ts-control input[type="text"]:focus {
  border-color: #2a2a2a !important;
  box-shadow: none !important;
}

html.dark body.theme-dark-enabled .ts-wrapper.focus .ts-control {
  border-color: rgba(148,163,184,.5) !important;
  box-shadow: 0 0 0 1px rgba(59,130,246,.25) !important;
}

/* Make sure the hidden native select never gets styled */
select.ts-hidden-select:focus {
  outline: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
}


.sketch-text{
  position:absolute; min-width:80px; min-height:28px;
  padding:2px 6px; outline:0; border:1px dashed transparent;
  background:transparent; pointer-events:auto; cursor:move;
  user-select:text; white-space:pre-wrap;
}
.sketch-text:focus,.sketch-text:hover{ border-color:#9ca3af; }
/* highlight selected text box */
.sketch-text.selected{
  border-color:#3b82f6;              /* blue-500 */
  background:rgba(59,130,246,0.06);  /* faint */
}
  .menu-item{ display:flex; align-items:center; gap:.5rem; padding:.5rem .75rem; cursor:pointer; }
  .menu-item:hover{ background:rgb(249 250 251); }
  .chip{ display:inline-flex; align-items:center; gap:.25rem; background:rgb(238 242 255);
         color:rgb(30 64 175); border-radius:9999px; padding:.125rem .5rem; font-size:.75rem; }
  .chip button{ line-height:1; }



@supports (min-height: 100dvh) {
  .min-h-mobile { min-height: 100dvh; }
}
@supports not (min-height: 100dvh) {
  /* Fallback for older iOS */
  .min-h-mobile { min-height: -webkit-fill-available; }
}

/* Optional utility if you want a class instead of Tailwind arbitrary value */
.pb-safe { padding-bottom: env(safe-area-inset-bottom); }


/* ===== Settings & Dark Theme Enhancements ===== */
.settings-shell {
  backdrop-filter: blur(0);
  transition: background .35s ease, color .35s ease;
  background: transparent;
}

.settings-card {
  position: relative;
  border-radius: 1.25rem;
  border: 1px solid rgba(226,232,240,.95);
  background: linear-gradient(140deg,#ffffff 0%,#f8fafc 100%);
  box-shadow: 0 16px 32px rgba(26,26,26,.08);
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease, background .25s ease;
}

.settings-card:hover {
  border-color: rgba(79,70,229,.28);
  box-shadow: 0 22px 44px rgba(79,70,229,.18);
  /* ✅ REMOVED transform to prevent stacking context issues with dropdowns */
}
/* ✅ FIX: Dropdown z-index management */
.fancy-dd__wrap {
  position: relative;
  z-index: 1;
}

.fancy-dd__wrap[data-open="true"] {
  z-index: 10001 !important;
}
.settings-tab-rail {
  background: rgba(241,245,249,.85);
  border: 1px solid rgba(226,232,240,.75);
  box-shadow: 0 12px 28px rgba(26,26,26,.08);
  backdrop-filter: blur(18px);
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.settings-tab-rail .tabBtn {
  border-radius: 9999px;
  font-weight: 500;
  transition: color .2s ease, background .2s ease;
}

.settings-tab-rail .tabBtn.active {
  color: #1d4ed8;
}

.settings-card input,
.settings-card select,
.settings-card textarea {
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}

.settings-card label {
  transition: color .25s ease;
}

html.dark body.theme-dark-enabled .settings-shell {
  background: transparent;
}

html.dark body.theme-dark-enabled .settings-card {
  background: linear-gradient(145deg,rgba(26,26,26,.95),rgba(30,41,59,.9));
  border-color: rgba(148,163,184,.25);
  box-shadow: 0 18px 38px rgba(8,13,26,.55);
}

html.dark body.theme-dark-enabled .settings-card:hover {
  border-color: rgba(129,140,248,.55);
  box-shadow: 0 26px 52px rgba(129,140,248,.25);
  /* ✅ REMOVED transform to prevent stacking context issues */
}
/* ✅ FIX: Tax summary box in dark mode */
html.dark body.theme-dark-enabled #taxRuleSummary {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #93c5fd !important;
  border-color: rgba(96, 165, 250, 0.3) !important;
}
html.dark body.theme-dark-enabled .settings-tab-rail {
  background: rgba(26,26,26,.88);
  border-color: rgba(148,163,184,.28);
  box-shadow: 0 20px 40px rgba(8,13,26,.55);
}

html.dark body.theme-dark-enabled .settings-tab-rail .tabBtn {
  color: #cbd5f5;
}

html.dark body.theme-dark-enabled .settings-tab-rail .tabBtn.active {
  color: #f8fafc;
}

html.dark body.theme-dark-enabled .settings-card input,
html.dark body.theme-dark-enabled .settings-card select,
html.dark body.theme-dark-enabled .settings-card textarea {
  background: rgba(26,26,26,.72);
  color: #f8fafc;
  border-color: rgba(148,163,184,.35);
}

html.dark body.theme-dark-enabled .settings-card input::placeholder,
html.dark body.theme-dark-enabled .settings-card textarea::placeholder {
  color: #94a3b8;
}

html.dark body.theme-dark-enabled .settings-card input:disabled,
html.dark body.theme-dark-enabled .settings-card textarea:disabled,
html.dark body.theme-dark-enabled .settings-card select:disabled {
  background: rgba(26,26,26,.55);
  color: #c7d2fe;
}

html.dark body.theme-dark-enabled .settings-card label {
  color: #a5b4fc;
}

html.dark body.theme-dark-enabled .settings-card h2,
html.dark body.theme-dark-enabled .settings-card h3 {
  color: #f8fafc;
}

html.dark body.theme-dark-enabled .settings-card .text-gray-500 {
  color: #94a3b8 !important;
}

html.dark body.theme-dark-enabled .settings-card .text-gray-600 {
  color: #c7d2fe !important;
}

html.dark body.theme-dark-enabled .settings-card .text-gray-700,
html.dark body.theme-dark-enabled .settings-card .text-gray-800,
html.dark body.theme-dark-enabled .settings-card .text-gray-900 {
  color: #f8fafc !important;
}

html.dark body.theme-dark-enabled .text-gray-500 {
  color: #94a3b8 !important;
}

html.dark body.theme-dark-enabled .text-gray-600 {
  color: #c7d2fe !important;
}

html.dark body.theme-dark-enabled .text-gray-700 {
  color: #e2e8f0 !important;
}

html.dark body.theme-dark-enabled .text-gray-800,
html.dark body.theme-dark-enabled .text-gray-900 {
  color: #f8fafc !important;
}

html.dark body.theme-dark-enabled .bg-white {
  background: rgba(26,26,26,.9) !important;
  color: #e2e8f0;
}

html.dark body.theme-dark-enabled .border {
  border-color: rgba(148,163,184,.28) !important;
}

html.dark body.theme-dark-enabled .shadow,
html.dark body.theme-dark-enabled .shadow-sm,
html.dark body.theme-dark-enabled .shadow-md,
html.dark body.theme-dark-enabled .shadow-lg,
html.dark body.theme-dark-enabled .shadow-xl,
html.dark body.theme-dark-enabled .shadow-2xl {
  box-shadow: 0 8px 20px rgba(0,0,0,.45) !important;
}


html.dark body.theme-dark-enabled .template-option {
  background: rgba(26,26,26,.78);
  border-color: rgba(148,163,184,.28);
  color: #e2e8f0;
}

html.dark body.theme-dark-enabled .bg-gray-50,
html.dark body.theme-dark-enabled .bg-gray-100,
html.dark body.theme-dark-enabled .bg-gray-200 {
  background: rgba(26,26,26,.82) !important;
  color: #e2e8f0;
}

html.dark body.theme-dark-enabled #invoicePreview {
  background: rgba(26,26,26,.75);
  color: #94a3b8;
  border-color: rgba(148,163,184,.28);
}

html.dark body.theme-dark-enabled .fancy-dd__btn,
html.dark body.theme-dark-enabled .fancy-dd__menu {
  background: #1a1a1a;
  color: #e2e8f0;
  border-color: #2a2a2a;
}
html.dark body.theme-dark-enabled .fancy-dd__item {
  color: #e2e8f0;
}
html.dark body.theme-dark-enabled .fancy-dd__item:hover,
html.dark body.theme-dark-enabled .fancy-dd__item[aria-selected="true"] {
  background: #2a2a2a;
  color: #f8fafc;
}

html.dark body.theme-dark-enabled .ts-control {
  background: #1a1a1a;
  border-color: #2a2a2a;
  color: #e2e8f0;
  box-shadow: 0 1px 2px rgba(2,6,23,.6);
}

html.dark body.theme-dark-enabled .ts-control .item,
html.dark body.theme-dark-enabled .ts-control .placeholder {
  background: transparent !important;
  color: #cbd5f5 !important;
}

html.dark body.theme-dark-enabled .ts-control input {
  color: #cbd5f5 !important;
}
html.dark body.theme-dark-enabled .ts-dropdown {
  background: #1a1a1a;
  border-color: #2a2a2a;
  color: #e2e8f0;
  box-shadow: 0 6px 14px rgba(0,0,0,.45);
}


html.dark body.theme-dark-enabled .ts-dropdown .option {
  background: transparent;
}

html.dark body.theme-dark-enabled .ts-dropdown .option {
  color: #e2e8f0;
}

html.dark body.theme-dark-enabled .ts-dropdown .option:hover,
html.dark body.theme-dark-enabled .ts-dropdown .active {
  background: #2a2a2a;
  color: #f8fafc;
}



html.dark body.theme-dark-enabled :is(.bg-white\/55, .bg-white\/60) {
  background-color: rgba(26, 26, 26, 0.82) !important;
}

html.dark body.theme-dark-enabled :is(.bg-white\/70, .bg-white\/80, .bg-white\/90) {
  background-color: #1a1a1a !important;
}

html.dark body.theme-dark-enabled :is(.bg-slate-50\/80, .bg-slate-100\/80) {
  background-color: rgba(26, 26, 26, 0.78) !important;
}
html.dark body.theme-dark-enabled :is(.border, .border-t, .border-b, .border-l, .border-r) {
  border-color: rgba(71, 85, 105, 0.38) !important;
}

html.dark body.theme-dark-enabled [id$="ModalOverlay"],
html.dark body.theme-dark-enabled .modal-overlay {
  background-color: rgba(0, 0, 0, 0.55) !important;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}


html.dark body.theme-dark-enabled [id$="ModalContent"],
html.dark body.theme-dark-enabled .modal-content,
html.dark body.theme-dark-enabled .bg-white {
  background-color: #1a1a1a !important;
  border-color: #2a2a2a !important;
}

html.dark body.theme-dark-enabled .tabBtn {
  color: #cbd5f5 !important;
}

html.dark body.theme-dark-enabled .tabBtn:hover,
html.dark body.theme-dark-enabled .tabBtn:focus {
  color: #f8fafc !important;
}

html.dark body.theme-dark-enabled .shimmer {
  background: linear-gradient(to right, #1a1a1a 8%, #1a1a1a 18%, #1a1a1a 33%);
}

html.dark body.theme-dark-enabled .visit-card {
  background: rgba(26,26,26,.9) !important;
  border-color: rgba(148,163,184,.28) !important;
  box-shadow: 0 20px 42px rgba(2,6,23,.45);
}

html.dark body.theme-dark-enabled .visit-card :is(.text-gray-800, .text-gray-700) {
  color: #e2e8f0 !important;
}

html.dark body.theme-dark-enabled .visit-card :is(.text-gray-600, .text-gray-500, .text-gray-400) {
  color: #cbd5f5 !important;
}

html.dark body.theme-dark-enabled .visit-card .actionDropdown {
  background: rgba(26,26,26,.96) !important;
  border-color: rgba(148,163,184,.28) !important;
  box-shadow: 0 14px 32px rgba(2,6,23,.55);
}

html.dark body.theme-dark-enabled .visit-card .dropdownAction:hover {
  background: #242424 !important;
}
/* Dark mode heading fix */
html.dark body.theme-dark-enabled h2.text-gray-900 {
  color: #f8fafc !important;
}

html.dark body.theme-dark-enabled .text-blue-500 {
  color: #60a5fa !important;
}
/* === Dark Mode Form Controls === */
html.dark body.theme-dark-enabled :is(
  input[type="text"],
  input[type="search"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="url"],
  input[type="date"],
  input[type="time"],
  input[type="datetime-local"],
  textarea,
  select
) {
  background-color: #1a1a1a;
  border-color: #2a2a2a;
  color: #e2e8f0;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.4);
}

html.dark body.theme-dark-enabled :is(textarea, select, input)::placeholder {
  color: rgba(226, 232, 240, 0.55);
}

html.dark body.theme-dark-enabled :is(
  input[type="text"], input[type="search"], input[type="number"],
  input[type="email"], input[type="password"], input[type="tel"],
  input[type="url"], input[type="date"], input[type="time"],
  input[type="datetime-local"], textarea, select
):focus {
  border-color: rgba(59,130,246,.35);
  box-shadow: 0 0 0 1px rgba(59,130,246,.25);
  outline: none;
}


html.dark body.theme-dark-enabled select option {
  background-color: #1a1a1a;
  color: #e2e8f0;
}

html.dark body.theme-dark-enabled :is(
  input[type="text"],
  input[type="search"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="url"],
  input[type="date"],
  input[type="time"],
  input[type="datetime-local"],
  textarea,
  select
):disabled {
  background-color: #1a253a;
  border-color: #2a2a2a;
  color: rgba(148, 163, 184, 0.75);
}

html.dark body.theme-dark-enabled {
  color: #e2e8f0;
  background: #1a1a1a; /* flatter, no glow */
}


html.dark body.theme-dark-enabled #pageContainer {
  background: #1a1a1a; /* ✅ Solid dark gray - no blue tint */
}
html.dark body.theme-dark-enabled #innerPageContent {
  background: transparent;
  color: inherit;
}

html.dark body.theme-dark-enabled table {
  background: #1a1a1a;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #2a2a2a;
}

html.dark body.theme-dark-enabled thead {
  background: #1a1a1a;
  color: #e2e8f0;
}

html.dark body.theme-dark-enabled thead th {
  border-color: #2a2a2a !important;
}

html.dark body.theme-dark-enabled tbody tr {
  background-color: #1a1a1a;
  border-color: #2a2a2a !important;
}

html.dark body.theme-dark-enabled tbody tr:hover {
  background: #2a2a2a !important;
}

html.dark body.theme-dark-enabled .divide-y > * + * {
  border-color: #2a2a2a !important;
}

html.dark body.theme-dark-enabled .bg-slate-50,
html.dark body.theme-dark-enabled .bg-slate-100,
html.dark body.theme-dark-enabled .bg-slate-200 {
  background: rgba(26,26,26,.82) !important;
  color: inherit;
}

html.dark body.theme-dark-enabled .border-slate-200,
html.dark body.theme-dark-enabled .border-slate-300 {
  border-color: rgba(71,85,105,.45) !important;
}

html.dark body.theme-dark-enabled .text-slate-500,
html.dark body.theme-dark-enabled .text-slate-600,
html.dark body.theme-dark-enabled .text-slate-700,
html.dark body.theme-dark-enabled .text-slate-800 {
  color: #cbd5f5 !important;
}


html.dark body.theme-dark-enabled .text-slate-700 { color: #cbd5f5 !important; }

html.dark body.theme-dark-enabled .bg-purple-50 {
  background: rgba(88,28,135,.28) !important;
  border-color: rgba(168,85,247,.32) !important;
}

html.dark body.theme-dark-enabled .bg-blue-50 {
  background: rgba(37,99,235,.24) !important;
  border-color: rgba(59,130,246,.32) !important;
}

html.dark body.theme-dark-enabled .bg-green-100 {
  background: rgba(22,101,52,.32) !important;
}

html.dark body.theme-dark-enabled .bg-gray-200 {
  background: rgba(148,163,184,.22) !important;
}

html.dark body.theme-dark-enabled .bg-amber-100 {
  background: rgba(120,53,15,.28) !important;
  border-color: rgba(251,191,36,.28) !important;
}

html.dark body.theme-dark-enabled .bg-slate-100 {
  background: rgba(51,65,85,.42) !important;
  border-color: rgba(71,85,105,.38) !important;
}

html.dark body.theme-dark-enabled .hover\:bg-gray-50:hover,
html.dark body.theme-dark-enabled .hover\:bg-slate-50:hover {
  background: rgba(148,163,184,.18) !important;
}

html.dark body.theme-dark-enabled .hover\:text-slate-700:hover {
  color: #f8fafc !important;
}

/* ===== Supplier Modal ===== */
#supplierModal { pointer-events: none; }
#supplierModal.show { pointer-events: auto; }

#supplierModalOverlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.40);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 280ms ease;
  z-index: 10;
}
#supplierModal.show #supplierModalOverlay { opacity: 1; }
#supplierModalContent {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 20;
  width: 100%;
  max-width: 100%;
  border-radius: 1.25rem 1.25rem 0 0;
  transform: translateY(100%);
  transition: transform 300ms cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}
#supplierModal.show #supplierModalContent {
  transform: translateY(0);
}
@media (min-width: 640px) {
  #supplierModalContent {
    position: relative;
    bottom: auto; left: auto; right: auto;
    width: min(720px, 94vw);
    max-width: min(720px, 94vw);
    border-radius: 1rem;
    opacity: 0;
    transform: translateY(28px);
    transition: transform 300ms cubic-bezier(.22,.61,.36,1), opacity 300ms ease;
  }
  #supplierModal.show #supplierModalContent {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Package Modal ===== */
#packageModal { pointer-events: none; }
#packageModal.show { pointer-events: auto; }

#packageModalOverlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.40);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 280ms ease;
  z-index: 10;
}
#packageModal.show #packageModalOverlay { opacity: 1; }

#packageModalContent {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 20;
  width: 100%;
  max-width: 100%;
  border-radius: 1.25rem 1.25rem 0 0;
  transform: translateY(100%);
  transition: transform 300ms cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}
#packageModal.show #packageModalContent {
  transform: translateY(0);
}
@media (min-width: 640px) {
  #packageModalContent {
    position: relative;
    bottom: auto; left: auto; right: auto;
    width: min(1280px, 96vw);
    max-width: min(1280px, 96vw);
    border-radius: 1rem;
    opacity: 0;
    transform: translateY(28px);
    transition: transform 300ms cubic-bezier(.22,.61,.36,1), opacity 300ms ease;
  }
  #packageModal.show #packageModalContent {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ===== Inventory Modal (match supplier/package behavior) ===== */
#inventoryModal{
  /* no opacity animation on the parent */
  pointer-events: none;
}

#inventoryModal.show{
  pointer-events: auto;
}

/* Overlay — fade only */
#inventoryModalOverlay{
  background: rgba(0,0,0,.40);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 200ms ease;
  z-index: 10;
}
#inventoryModal.show #inventoryModalOverlay{ opacity: 1; }

/* Panel — slide + fade */
#inventoryModalContent{
  position: relative; z-index: 20;
  opacity: 0;
  transform: translateY(28px);
  transition: transform 300ms cubic-bezier(.22,.61,.36,1), opacity 300ms ease;
  will-change: transform, opacity;
}
#inventoryModal.show #inventoryModalContent{
  opacity: 1;
  transform: translateY(0);
}
/* === Inventory row dropdown — light grey (dark mode) === */
html.dark .actionDropdown {
  background-color: #242424 !important;   /* gray-700 (light grey against dark UI) */
  color: #f3f4f6 !important;              /* text-gray-100 */
  border-color: #4b5563 !important;       /* gray-600 border */
  box-shadow: 0 10px 24px rgba(0,0,0,.45) !important;
}

/* Items + icons */
html.dark .actionDropdown .dropdownAction {
  color: inherit !important;
}
html.dark .actionDropdown .dropdownAction svg {
  color: inherit !important;              /* stroke=currentColor SVGs */
}

/* Light mode delete hover */
.actionDropdown .dropdownAction[data-action="delete"]:hover {
  background-color: #fef2f2 !important;  /* red-50 */
}

/* Exception: delete button gets red hover */
html.dark .actionDropdown .dropdownAction[data-action="delete"]:hover {
  background-color: rgba(239, 68, 68, 0.1) !important;  /* red-500/10 */
}
html.dark .ellipsisBtn:hover {
  background-color: #374151 !important;
  color: #f3f4f6 !important;
}



/* ===== Fancy Select – DARK MODE (keep panel dark; faint hover) ===== */
html.dark body.theme-dark-enabled .fancy-dd__btn {
  background:#1a1a1a;
  color: #e2e8f0;
  border-color: #2a2a2a;
  box-shadow: 0 1px 2px rgba(2,6,23,.6);
}

html.dark body.theme-dark-enabled .fancy-dd__menu {
  background: #1a1a1a !important;   /* keep same dark color */
  color: #e2e8f0 !important;
  border-color: #2a2a2a !important;
  box-shadow: 0 12px 28px rgba(0,0,0,.45) !important;
}

html.dark body.theme-dark-enabled .fancy-dd__item {
  color: #e2e8f0 !important;
}

/* faint light-grey hover */
html.dark body.theme-dark-enabled .fancy-dd__item:hover {
  background: rgba(148,163,184,0.12) !important;  /* slate-400 @ ~12% */
}

/* slightly stronger when selected */
html.dark body.theme-dark-enabled .fancy-dd__item[aria-selected="true"] {
  background: rgba(148,163,184,0.18) !important;
  color: #f8fafc !important;
  font-weight: 500;
}

html.dark body.theme-dark-enabled .fancy-dd__btn svg { color: #cbd5f5; }

/* keep menu above tables/cards */
.fancy-dd__menu { z-index: 10010; }
/* === Unified tab rail (Inventory + EMR) ================================ */
.tab-rail{
  position: relative;
  display: inline-flex;
  gap: .25rem;                 /* gap-1 */
  padding: .25rem;             /* p-1 */
  border-radius: 1rem;         /* rounded-2xl */
  border: 1px solid #e2e8f0;   /* border-slate-200 */
  background: rgba(248,250,252,.8); /* bg-slate-50/80 */
  box-shadow: 0 1px 2px rgba(0,0,0,.05); /* shadow-sm */
  white-space: nowrap;
}

.tab-rail .tabBtn{
  position: relative;
  z-index: 10;
  border-radius: .75rem;       /* rounded-xl */
  padding: .5rem 1rem;         /* py-2 px-4 */
  font-size: .875rem;          /* text-sm */
  font-weight: 500;
  color: #2a2a2a;              /* text-slate-600 */
  background: transparent;
  transition: none;            /* no animation */
}
.tab-rail .tabBtn:hover{ color:#1a1a1a; } /* hover:text-slate-900 */

.tab-rail .tabBtn.active,
.tab-rail .tabBtn[aria-selected="true"]{
  color: #fff;                 /* white text on blue pill */
}

/* Blue pill itself */
.tab-indicator{
  position: absolute;
  inset: .25rem auto .25rem .25rem; /* top/bottom 4px, left default */
  height: calc(100% - .5rem);
  border-radius: .75rem;       /* rounded-xl */
  background: #2563eb;         /* blue-600 */
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  width: 0;                    /* JS will size it */
  transform: translateX(0);
  transition: none;            /* no animation */
  z-index: 0;
}

/* --- Dark mode tweaks (keep look consistent) --- */
html.dark .tab-rail{
  background: rgba(26,26,26,.88);
  border-color: rgba(148,163,184,.28);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
}
html.dark .tab-rail .tabBtn{ color:#cbd5f5; }            /* slate-200 */
html.dark .tab-rail .tabBtn:hover{ color:#e2e8f0; }      /* slate-100 */
html.dark .tab-indicator{ background:#2563eb; }          /* same blue */

/* === Kill hover/focus backgrounds on every tab button site-wide === */
:is(.tab-rail .tabBtn, .settings-tab-rail .tabBtn, .tabBtn):hover,
:is(.tab-rail .tabBtn, .settings-tab-rail .tabBtn, .tabBtn):focus,
:is(.tab-rail .tabBtn, .settings-tab-rail .tabBtn, .tabBtn):focus-visible{
  background: transparent !important;
  box-shadow: none !important;
  /* uncomment next line if you also want ZERO color change on hover */
  /* color: inherit !important; */
}

/* If you also use .lab-tab anywhere, stop its hover fill too */
.lab-tab:hover{ background: transparent !important; }

/* Keep active state readable (blue pill handles bg) */
.tab-rail .tabBtn.active,
.tab-rail .tabBtn[aria-selected="true"]{
  color: #fff !important;
}

/* Dark mode – no hover fill either (kept for safety) */
html.dark :is(.tab-rail .tabBtn, .settings-tab-rail .tabBtn, .tabBtn):hover{
  background: transparent !important;
}

/* === Patients toolbar popovers (Sort + Filters) ======================== */
.patients-popover {                        /* light mode keeps current look */
  border-color: #e5e7eb; /* gray-200 */
}

/* Dark mode shell */
html.dark .patients-popover {
  background-color: #1a1a1a !important;    /* slate-900-ish */
  color: #e2e8f0 !important;               /* text-slate-200 */
  border-color: #2a2a2a !important;        /* gray-800 border */
  box-shadow: 0 12px 28px rgba(0,0,0,.45) !important;
}

/* Section headers inside panel (“Name”, “Last visit”, etc.) */
html.dark .patients-popover .text-gray-400 {
  color: #94a3b8 !important;               /* slate-400 */
}

/* Divider lines (mobile header border, etc.) */
html.dark .patients-popover :is(.border, .border-b, .border-t) {
  border-color: #2a2a2a !important;
}

/* Option rows */
html.dark .patients-popover .sortItem {
  color: #e2e8f0 !important;
}
html.dark .patients-popover .sortItem:hover {
  background-color: #2a2a2a !important;    /* slate-700 hover */
}

/* Footer bar (Reset / Cancel / Apply) */
html.dark .patients-popover__footer {
  background-color: #1a1a1a !important;    /* gray-900 strip */
  border-top-color: #2a2a2a !important;
}

/* Mobile grabber pill */
html.dark #sortGrabber,
html.dark #filterGrabber {
  background-color: #2a2a2a !important;    /* slate-600 */
}

/* Make “hover:bg-gray-50” from utility classes look right in dark mode */
html.dark .patients-popover :is(.hover\:bg-gray-50:hover, .hover\:bg-white:hover) {
  background-color: #2a2a2a !important;
  color: #e2e8f0 !important;
}

/* Ensure native inputs inside use dark fields (just in case) */
html.dark .patients-popover :is(input[type="date"], select) {
  background-color: #1a1a1a !important;
  border-color: #2a2a2a !important;
  color: #e2e8f0 !important;
}
/* Force Sort/Filters sheets dark even if bg-white/bg-gray-50 are present */
html.dark #sortMenu,
html.dark #filterPopover{
  background: #1a1a1a!important;   /* panel body */
  color: #e2e8f0 !important;
  border-color: #2a2a2a !important;
  box-shadow: 0 12px 28px rgba(0,0,0,.45) !important;
}



/* Section labels + dividers */
html.dark #sortMenu .text-gray-400,
html.dark #filterPopover .text-gray-400{ color:#94a3b8 !important; }
html.dark #sortMenu :is(.border,.border-b,.border-t),
html.dark #filterPopover :is(.border,.border-b,.border-t){ border-color:#2a2a2a !important; }

/* Option rows / hover */
html.dark #sortMenu .sortItem,
html.dark #filterPopover .sortItem{ color:#e2e8f0 !important; }
html.dark #sortMenu .sortItem:hover,
html.dark #filterPopover .sortItem:hover{ background:#2a2a2a !important; }

/* Footer strip */
html.dark #sortMenu .patients-popover__footer,
html.dark #filterPopover .patients-popover__footer{
  background:#1a1a1a !important;
  border-top-color:#2a2a2a !important;
}

/* Inputs inside */
html.dark #filterPopover :is(select,input[type="date"]){
  background:#1a1a1a !important;
  border-color:#2a2a2a !important;
  color:#e2e8f0 !important;
}

/* Mobile grabbers */
html.dark #sortGrabber, html.dark #filterGrabber{ background:#2a2a2a !important; }

/* ===== Compare Modal (fast overlay fade + blur, smooth panel) ===== */
#compareBranchesModal {
  pointer-events: none;                     /* parent never animates opacity */
  position: fixed; inset: 0; z-index: 1000; /* typical modal stack */
}

#compareBranchesModal.show { pointer-events: auto; }

/* Overlay: fades immediately and carries the blur */
#compareModalOverlay{
  position: absolute; inset: 0;
  background: rgba(0,0,0,.40);              /* low-opacity black */
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 200ms ease;           /* quick fade */
  z-index: 10;
}
#compareBranchesModal.show #compareModalOverlay{ opacity: 1; }

/* Panel: smooth pop (slide + subtle scale) */
#compareModalContent{
  position: relative; z-index: 20;
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: transform 300ms cubic-bezier(.22,.61,.36,1), opacity 300ms ease;
  will-change: transform, opacity;
}
#compareBranchesModal.show #compareModalContent{
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Optional dark-mode overlay tint (matches your other modals) */
html.dark #compareModalOverlay{
  background: rgba(255,255,255,0.12);
}

/* Patients table – keep rounded corners in dark mode */
html.dark body.theme-dark-enabled table {
  border-collapse: separate;   /* you already set this */
  border-spacing: 0;
  border: 1px solid #2a2a2a;   /* you already set this */
  background: #1a1a1a;         /* you already set this */
  border-radius: 0.75rem;      /* keep rounded corners */
  background-clip: padding-box;/* keep background inside radius without clipping dropdowns */
  overflow: visible;           /* allow action menus to float over pagination */
}

/* Optional: ensure last row corners look clean */
html.dark body.theme-dark-enabled thead th:first-child { border-top-left-radius: .75rem; }
html.dark body.theme-dark-enabled thead th:last-child  { border-top-right-radius: .75rem; }

/* ===== Command Palette – Dark Mode polish ===== */

/* trigger button (topbar fake input) */
html.dark #openCommandPalette{
  background-color:#1a1a1a !important;         /* gray-900-ish */
  border-color:#242424 !important;             /* gray-700 */
  color:#e5e7eb !important;
}
html.dark #openCommandPalette i,
html.dark #openCommandPalette span,
html.dark #openCommandPalette kbd{
  color:#cbd5f5 !important;                    /* slate-200 */
  border-color:#4b5563 !important;             /* kbd border */
  background-color:transparent !important;     /* keep kbd subtle */
}
html.dark #openCommandPalette:hover{
  border-color:#4b5563 !important;             /* gray-600 hover */
}

/* modal shell already has dark:bg-gray-800; just refine borders/shadows */
html.dark #commandModal .rounded-lg{
  border-color:#242424 !important;             /* gray-700 */
  box-shadow: 0 20px 40px rgba(0,0,0,.5) !important;
}

/* search row */
html.dark #commandModal .relative.border{
  border-color:#3b82f6 !important;             /* keep your blue ring box */
}
html.dark #globalSearchInput{
  background:#1a1a1a !important;               /* slate-900 */
  color:#e2e8f0 !important;
}
html.dark #globalSearchInput::placeholder{
  color:#94a3b8 !important;                    /* slate-400 */
}

/* left search icon + right clear button */
html.dark #commandModal .absolute .fa-search{ color:#94a3b8 !important; }
html.dark #clearSearchInput{
  background:#242424 !important;               /* gray-700 */
  color:#e5e7eb !important;
  border: 1px solid #4b5563 !important;
}
html.dark #clearSearchInput:hover{ background:#2a2a2a !important; }

/* results list */
html.dark #searchResultsDropdown{
  background:transparent !important;
  color:#e2e8f0 !important;
}

/* group headers (“PAGES”, “ACTIONS”, etc.) */
html.dark #commandModal .command-group{
  color:#94a3b8 !important;                    /* slate-400 */
  border-top-color:#2a2a2a !important;         /* gray-800 divider */
}

/* rows */
html.dark #commandModal .command-item{
  color:#e2e8f0 !important;
}
html.dark #commandModal .command-item:hover{
  background:#2a2a2a !important;               /* gray-800 hover */
}

/* tiny: make scrollbars subtle inside results on dark */
html.dark #searchResultsDropdown::-webkit-scrollbar{ width:8px; }
html.dark #searchResultsDropdown::-webkit-scrollbar-thumb{
  background:#2a2a2a; border-radius:8px;
}
html.dark #searchResultsDropdown{ scrollbar-color:#2a2a2a transparent; }

/* ── TomSelect DARK: dropdown option highlight ─────────────────────────── */
html.dark body.theme-dark-enabled .ts-dropdown .option.selected,
html.dark body.theme-dark-enabled .ts-dropdown .option.active,
html.dark body.theme-dark-enabled .ts-dropdown .option.selected:hover,
html.dark body.theme-dark-enabled .ts-dropdown .option.active:hover {
  background-color: #2a2a2a !important; /* gray-800 */
  color: #f8fafc !important;            /* slate-50 */
}

/* ── TomSelect DARK: single-select display (the chosen item) ──────────── */
html.dark body.theme-dark-enabled .ts-wrapper.single .ts-control,
html.dark body.theme-dark-enabled .ts-wrapper.single .ts-control .item {
  background-color: #1a1a1a !important; /* slate-900-ish */
  color: #e2e8f0 !important;            /* slate-200 */
}

/* ── TomSelect DARK: multi-select tags/pills ──────────────────────────── */
html.dark body.theme-dark-enabled .ts-wrapper.multi .ts-control .item {
  background-color: #2a2a2a !important; /* slate-700 tag */
  border-color: #2a2a2a !important;     /* slate-600 */
  color: #e2e8f0 !important;
}
html.dark body.theme-dark-enabled .ts-wrapper.multi .ts-control .item.active {
  background-color: #3b4253 !important; /* a touch brighter on focus */
}
html.dark body.theme-dark-enabled .ts-wrapper.multi .ts-control .item .remove {
  border-left-color: #2a2a2a !important;
}

/* (Optional) make placeholder and input match dark theme */
html.dark body.theme-dark-enabled .ts-control .placeholder { color: #94a3b8 !important; }
html.dark body.theme-dark-enabled .ts-control input { color: #cbd5f5 !important; }
/* ===== Appointments-only month control ===== */
#appointmentsPage input[type="month"]{
  /* light mode */
  background:#ffffff;
  color:#1a1a1a;                 /* gray-900 */
  border:1px solid #d1d5db;      /* gray-300 */
  border-radius:.5rem;
  height:2.25rem;                /* h-9 */
  padding:0 .75rem;              /* px-3 */
  color-scheme: light;           /* avoid UA dark-black in light */
}
.dark #appointmentsPage input[type="month"]{
  /* dark mode */
  background:#1a1a1a;            /* slate-900 */
  color:#e2e8f0;                 /* slate-200 */
  border-color:#2a2a2a;          /* slate-700 */
  color-scheme: dark;            /* keep dark popover */
}
#appointmentsPage input[type="month"]::-webkit-calendar-picker-indicator{
  cursor:pointer;
}
.dark #appointmentsPage input[type="month"]::-webkit-calendar-picker-indicator{
  filter: invert(1) brightness(1.15) contrast(1.05);
  opacity:.9;
}

/* If your agenda month is a faux button instead of a real input */
#appointmentsPage #agendaMonthBtn{
  background:#ffffff; color:#242424; border:1px solid #d1d5db; border-radius:.5rem;
}
.dark #appointmentsPage #agendaMonthBtn{
  background:#1a1a1a; color:#e2e8f0; border-color:#2a2a2a;
}
#appointmentsPage #agendaMonthBtn:hover{ background:#f3f4f6; }
.dark #appointmentsPage #agendaMonthBtn:hover{ background:#2a2a2a; } /* slate-800 */

/* Keep the icon colorful in both themes */
#expenseCards .expense-card .icon-wrap{
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(148,163,184,.18);
}
.dark #expenseCards .expense-card .icon-wrap{
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}

/* The icon itself uses the category color pushed via --cat on the card */
#expenseCards .expense-card .icon-cat{
  color: var(--cat) !important;   /* win over generic slate color overrides */
}

#dentalFileDrop:hover svg {
  transform: translateY(-2px);
  transition: 0.2s ease;
}
#dentalFileDrop:hover p {
  color: #2563eb;   /* blue-600 */
}



:root{
  --sidebar-w: 240px;
  --topbar-h: 64px;
    --content-gutter: 20px;
}

@media (min-width: 768px){
  #layoutWrapper{ padding-left: var(--sidebar-w); }
}

#mainContent{
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  margin-left: 0 !important;
  width: auto !important;
}

#topBar{
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: var(--topbar-h);
  z-index: 1200;
  padding-right: 16px; /* Space for scrollbar */
}
@media (min-width: 768px){
  #topBar{
    left: var(--sidebar-w);
    right: 16px; /* Don't cover scrollbar */
  }
}

#pageContainer{
  padding-top: calc(var(--topbar-h) + 16px) !important;
  margin-left: 0 !important;
  width: auto !important;
}
/* ✅ Desktop breathing room from the sidebar */
@media (min-width: 768px){
  #pageContainer{
    padding-left: var(--content-gutter) !important;
    padding-right: var(--content-gutter) !important; /* optional but nice */
  }
}
/* Hide the sidebar's own hamburger on desktop (keep only mobile topbar toggle) */
@media (min-width: 768px){
  #sidebarToggleSidebar{
    display: none !important;
  }
}

/* ========== TOPBAR - Original Background ========== */
#topBar {
  left: 0;
}

@media (min-width: 768px) {
  #topBar {
    left: var(--sidebar-w);
  }
}

/* Topbar Icon Buttons */
.topbar-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topbar-icon-btn:hover {
  background: #f3f4f6;
  color: #1a1a1a;
}

html.dark .topbar-icon-btn:hover {
  background: #242424;
  color: #f9fafb;
}

.topbar-icon-btn i {
  font-size: 18px;
}

/* Tooltips */
.topbar-tooltip {
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: #2a2a2a;
  color: white;
  font-size: 12px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 100;
}

.topbar-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-bottom-color: #2a2a2a;
}

.group:hover .topbar-tooltip {
  opacity: 1;
}

/* Search Bar Animations */
#searchTrigger {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#expandedSearch {
  animation: searchFadeIn 0.2s ease-out;
}



@keyframes searchFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}



#searchResultsDropdown {
  animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Search Bar Container */
#searchContainer {
  position: relative;
  width: 240px;
  contain: layout;
}

#searchTrigger {
  transition: opacity 0.15s ease;
}

#expandedSearch {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 100;
  display: none; /* Start hidden */
}

#globalSearchInput {
  transition: width 0.25s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
  will-change: width;
    /* ✅ ADD THESE 3 LINES */
  transform: translateZ(0); /* Force GPU layer */
  backface-visibility: hidden; /* Prevent flickering */
  perspective: 1000px; /* Smooth 3D rendering */
}

#globalSearchInput[data-expanded="true"] {
  width: 480px !important;
}

html.dark #expandedSearch input {
  background: #242424 !important;
}

#expandedSearch input:focus {
  background: #f3f4f6 !important;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

html.dark #expandedSearch input:focus {
  background: #242424 !important;
}

/* Dropdown animation */
#searchResultsDropdown {
  animation: dropdownSlide 0.2s ease-out;
}

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

/* ========== SEARCH BAR STYLES ========== */

/* Remove blue border on focus */
#globalSearchInput {
  outline: none !important;
  box-shadow: none !important;
}

#globalSearchInput:focus {
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* Styled kbd box - same grey as unhovered search bar */
.search-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 2px 6px;
  background: #f3f4f6 !important;
  border: 1px solid #d1d5db !important;
  border-radius: 4px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  font-size: 11px;
  font-weight: 600;
  color: #242424 !important;
  font-family: ui-monospace, monospace;
}

/* Dark mode kbd styling */
html.dark .search-kbd {
  background: #2a2a2a !important;
  border-color: #4b5563 !important;
  color: #e5e7eb !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Search kbd hint - show on container hover when collapsed */
#searchContainer:hover #searchKbd {
  opacity: 1 !important;
}

/* When search is expanded, force hide the kbd */
#globalSearchInput[data-expanded="true"] ~ #searchKbd {
  opacity: 0 !important;
}

/* Also hide kbd when input is focused (expanded) */
#globalSearchInput:focus ~ #searchKbd {
  opacity: 0 !important;
}

/* Make sure hover works in dark mode too - but not when expanded */
html.dark #searchContainer:hover #searchKbd {
  opacity: 1 !important;
}

/* Force hide kbd in dark mode when expanded */
html.dark #globalSearchInput[data-expanded="true"] ~ #searchKbd,
html.dark #globalSearchInput:focus ~ #searchKbd {
  opacity: 0 !important;
}

/* Dropdown animation */
#searchResultsDropdown {
  animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ========== SEARCH BAR DARK MODE FIX ========== */

/* Search input - default state */
html.dark #globalSearchInput {
  background: #242424 !important;
  color: #e2e8f0 !important;
  border: 1px solid #3f3f3f !important;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  will-change: width;
}

/* Placeholder in dark mode */
html.dark #globalSearchInput::placeholder {
  color: #6b7280 !important;
}

/* Hover state */
html.dark #globalSearchInput:hover {
  background: #2a2a2a !important;
  border-color: #4b5563 !important;
}

/* Focus/expanded state */
html.dark #globalSearchInput:focus,
html.dark #globalSearchInput[data-expanded="true"] {
  background: #1a1a1a !important;
  border-color: #3b82f6 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Search icon in dark mode */
html.dark #searchContainer .fa-search {
  color: #9ca3af !important;
}

/* Kbd hint in dark mode */
html.dark .search-kbd {
  background: #2a2a2a !important;
  border-color: #4b5563 !important;
  color: #e5e7eb !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Command palette dropdown in dark mode */
html.dark #searchResultsDropdown {
  background: #1a1a1a !important;
  border-color: #2a2a2a !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8) !important;
  color: #e2e8f0 !important;
}

/* Group headers in dropdown */
html.dark #searchResultsDropdown > div {
  color: #9ca3af !important;
  border-color: #2a2a2a !important;
}

/* Command items */
html.dark #searchResultsDropdown button {
  color: #e2e8f0 !important;
}

html.dark #searchResultsDropdown button:hover {
  background: #242424 !important;
  color: #f9fafb !important;
}

/* Icons in command palette */
html.dark #searchResultsDropdown i {
  color: #9ca3af !important;
}
/* ========== MOBILE SEARCH - FULL SCREEN OVERLAY ========== */
@media (max-width: 767px) {
  /* Hide desktop search input on mobile */
  #searchContainer {
    display: none !important;
  }

  /* Mobile search trigger button */
  #mobileSearchTrigger {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  #mobileSearchTrigger:hover {
    background: #f3f4f6;
    color: #1a1a1a;
  }

  html.dark #mobileSearchTrigger:hover {
    background: #0a0a0a;
    color: #ffffff;
  }

  /* Full-screen search overlay */
  #mobileSearchOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  #mobileSearchOverlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* Search panel - slides up from bottom */
  #mobileSearchPanel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    max-height: 85vh;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  html.dark #mobileSearchPanel {
    background: #000000;
  }

  #mobileSearchOverlay.active #mobileSearchPanel {
    transform: translateY(0);
  }

  /* Grabber pill */
  #mobileSearchGrabber {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 0 auto 16px;
  }

  html.dark #mobileSearchGrabber {
    background: #242424;
  }

  /* Search input in mobile */
  #mobileSearchInput {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 48px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    font-size: 16px;
    color: #1a1a1a;
    outline: none;
  }

  html.dark #mobileSearchInput {
    background: #0a0a0a;
    border-color: #1a1a1a;
    color: #ffffff;
  }

  #mobileSearchInput::placeholder {
    color: #9ca3af;
  }

/* Search icon in mobile input */
  #mobileSearchIcon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 18px;
    pointer-events: none;
  }

  /* Close button */
  #mobileSearchClose {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 18px;
    cursor: pointer;
  }
  #mobileSearchClose:active {
    background: #f3f4f6;
  }

  html.dark #mobileSearchClose:active {
    background: #0a0a0a;
  }

  /* Results container */
  #mobileSearchResults {
    flex: 1;
    overflow-y: auto;
    margin-top: 16px;
    -webkit-overflow-scrolling: touch;
  }

  /* Result items */
  .mobile-result-group {
    margin-bottom: 16px;
  }

  .mobile-result-header {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    padding: 0 4px;
  }

  html.dark .mobile-result-header {
    color: #9ca3af;
  }

  .mobile-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
  }

  .mobile-result-item:active {
    background: #f3f4f6;
  }

  html.dark .mobile-result-item:active {
    background: #0a0a0a;
  }

  .mobile-result-item i {
    width: 20px;
    font-size: 18px;
    color: #9ca3af;
  }

  html.dark .mobile-result-item i {
    color: #6b7280;
  }

  .mobile-result-item span {
    flex: 1;
    font-size: 15px;
    color: #1a1a1a;
  }

  html.dark .mobile-result-item span {
    color: #e5e7eb;
  }

  /* Empty state */
  .mobile-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 14px;
  }

  html.dark .mobile-empty {
    color: #6b7280;
  }

  /* Hide kbd hint on mobile */
  .search-kbd {
    display: none !important;
  }

  /* Hide desktop dropdown on mobile */
  #searchResultsDropdown {
    display: none !important;
  }
}

/* Desktop: hide mobile search elements */
@media (min-width: 768px) {
  #mobileSearchTrigger {
    display: none !important;
  }

  #mobileSearchOverlay {
    display: none !important;
  }
}
/* ===== MOBILE SEARCH - REDESIGNED ===== */
.ms-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 16px;
  text-align: center;
}
.ms-empty-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.ms-empty-icon--grey { background: #f3f4f6; }
.ms-empty-icon--grey i { color: #9ca3af !important; }
.ms-empty-icon i { color: #fff !important; font-size: 20px; }
.ms-empty-title {
  font-size: 16px; font-weight: 600;
  color: #111827; margin-bottom: 4px;
}
.dark .ms-empty-title { color: #f9fafb; }
.ms-empty-sub { font-size: 13px; color: #6b7280; }
.dark .ms-empty-sub { color: #9ca3af; }

.ms-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 32px; color: #3b82f6; font-size: 20px;
}

.ms-suggestions { padding: 0 4px 8px; }

.ms-section-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: #9ca3af; padding: 12px 12px 6px;
}
.dark .ms-section-label { color: #6b7280; }

.ms-group { margin-bottom: 8px; }

.ms-item {
  width: 100%; display: flex; align-items: center;
  gap: 12px; padding: 11px 12px;
  background: transparent; border: none;
  border-radius: 10px; cursor: pointer;
  transition: background .15s;
  text-align: left;
}
.ms-item:active, .ms-item:hover { background: #f3f4f6; }
.dark .ms-item:active, .dark .ms-item:hover { background: #1a1a1a; }

.ms-item-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  background: #f3f4f6; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.dark .ms-item-icon { background: #1a1a1a; }
.ms-item-icon i { font-size: 14px; color: #6b7280; }
.dark .ms-item-icon i { color: #9ca3af; }

.ms-item-label {
  flex: 1; font-size: 14px; font-weight: 500;
  color: #111827; display: flex; align-items: center; gap: 6px;
}
.dark .ms-item-label { color: #f3f4f6; }

.ms-bc { color: #d1d5db; font-size: 13px; }
.dark .ms-bc { color: #4b5563; }

.ms-hi {
  background: rgba(59,130,246,.12); color: #2563eb;
  font-weight: 600; border-radius: 2px; padding: 0 1px;
}
.dark .ms-hi { color: #60a5fa; background: rgba(96,165,250,.15); }

.ms-item-arrow {
  font-size: 11px; color: #d1d5db; flex-shrink: 0;
}
.dark .ms-item-arrow { color: #374151; }

/* Mobile search results: reuse desktop palette classes */
#mobileSearchResults .search-group-header {
  padding: 10px 16px 6px;
}
#mobileSearchResults .search-item {
  padding: 10px 16px;
}
#mobileSearchResults {
  padding-bottom: 16px;
}
/* ========================================
   STRIPE-STYLE NOTIFICATION PANEL
   ======================================== */

.notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 420px;
  max-height: 580px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
 transition: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-panel.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dark .notification-panel {
  background: #1f2937;
  border-color: #374151;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

/* Header */
.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f3f4f6;
}

.dark .notification-header {
  border-bottom-color: #374151;
}

.notification-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.dark .notification-title {
  color: #f9fafb;
}

.notification-clear-btn {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #3b82f6;
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  transition: all 200ms;
}

.notification-clear-btn:hover {
  background: #eff6ff;
  border-color: #3b82f6;
}

.dark .notification-clear-btn {
  color: #60a5fa;
  border-color: #374151;
}

.dark .notification-clear-btn:hover {
  background: #1e3a8a;
  border-color: #3b82f6;
}

/* List */
.notification-list {
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
}

.notification-list::-webkit-scrollbar {
  width: 6px;
}

.notification-list::-webkit-scrollbar-track {
  background: transparent;
}

.notification-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.dark .notification-list::-webkit-scrollbar-thumb {
  background: #4b5563;
}

.notification-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
}

/* Notification Item */
.notification-item {
  width: 100%;
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 200ms;
  border-bottom: 1px solid #f9fafb;
}

.notification-item:hover {
  background: #f9fafb;
}

.dark .notification-item {
  border-bottom-color: #374151;
}

.dark .notification-item:hover {
  background: #374151;
}

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

.notification-item-icon {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  border-radius: 8px;
  color: #3b82f6;
  font-size: 14px;
}

.dark .notification-item-icon {
  background: #1e3a8a;
  color: #60a5fa;
}

.notification-unread-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border-radius: 50%;
  border: 2px solid white;
}

.dark .notification-unread-dot {
  border-color: #1f2937;
}

.notification-item-content {
  flex: 1;
  min-width: 0;
}

.notification-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.notification-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
}

.dark .notification-item-title {
  color: #f9fafb;
}

.notification-item-time {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
  flex-shrink: 0;
}

.dark .notification-item-time {
  color: #6b7280;
}

.notification-item-message {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dark .notification-item-message {
  color: #9ca3af;
}

/* Footer */
.notification-footer {
  padding: 12px 20px;
  border-top: 1px solid #f3f4f6;
}

.dark .notification-footer {
  border-top-color: #374151;
}

.notification-view-all {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #3b82f6;
  background: #eff6ff;
  border: none;
  border-radius: 8px;
  transition: all 200ms;
}

.notification-view-all:hover {
  background: #dbeafe;
  color: #2563eb;
}

.dark .notification-view-all {
  background: #1e3a8a;
  color: #60a5fa;
}

.dark .notification-view-all:hover {
  background: #1e40af;
  color: #93c5fd;
}

/* Badge Styling */
#notificationBadge {
  background: #3b82f6 !important;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .notification-panel {
    width: calc(100vw - 32px);
    max-width: 420px;
    right: -12px;
  }
}
/* ===== CONSISTENT PAGE PADDING ===== */
#pageContainer {
  padding: 24px;
}

/* Override for dashboard's internal container */
#dashboardPage .max-w-\[1600px\] {
  margin: 0 auto;
}

/* ===== COLLAPSED SIDEBAR IMPROVEMENTS ===== */

.sidebar.sidebar-collapsed .sidebar-account-btn {
  display: flex !important;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 4px auto;
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  flex: 0 0 40px !important;
  height: 40px;
  border-radius: 8px;
  background: transparent !important;
  transition: background 0.15s ease;
}

.sidebar.sidebar-collapsed .sidebar-account-btn:hover {
  background: #f3f4f6 !important;
}

html.dark .sidebar.sidebar-collapsed .sidebar-account-btn:hover {
  background: #242424 !important;
}

.sidebar.sidebar-collapsed .sidebar-account-pic {
  display: block !important;
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.sidebar.sidebar-collapsed .sidebar-account-info,
.sidebar.sidebar-collapsed .sidebar-account-chevron {
  display: none;
}

/* ===== COLLAPSED SIDEBAR LINKS ===== */

/* Base link styling when collapsed */
.sidebar.sidebar-collapsed .sidebar-link {
  position: relative;
  justify-content: center;
  padding: 0;
  margin: 4px auto;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  background: transparent !important;
  transition: none !important;
}

/* Icon always on top */
.sidebar.sidebar-collapsed .sidebar-link i {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 15px;
  transition: color 0.15s ease;
}
/* ===== NON-ACTIVE LINKS - Icon color on hover ===== */
.sidebar.sidebar-collapsed .sidebar-link:not(.active):hover i {
  color: #1a1a1a !important;
}

html.dark .sidebar.sidebar-collapsed .sidebar-link:not(.active):hover i {
  color: #ffffff !important;
}
/* ===== NON-ACTIVE LINKS ===== */

/* Pseudo-element for background animation */
.sidebar.sidebar-collapsed .sidebar-link:not(.active)::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  background: transparent;
  border-radius: 8px;
  z-index: -1;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Non-active hover - expand to 40px with grey */
.sidebar.sidebar-collapsed .sidebar-link:not(.active):hover::before {
  width: 40px;
  height: 40px;
  background: #f3f4f6;
}

/* Dark mode non-active hover */
html.dark .sidebar.sidebar-collapsed .sidebar-link:not(.active):hover::before {
  width: 40px;
  height: 40px;
  background: #242424;
}

/* ===== ACTIVE LINKS ===== */

/* Active state - starts at 28px */
.sidebar.sidebar-collapsed .sidebar-link.active {
  background: transparent !important;
}

.sidebar.sidebar-collapsed .sidebar-link.active::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  background: #dbeafe;
  border-radius: 8px;
  z-index: -1;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.sidebar-collapsed .sidebar-link.active i {
  color: #2563eb !important;
  font-size: 15px !important;
}

/* Active hover - expand to 40px with lighter blue */
.sidebar.sidebar-collapsed .sidebar-link.active:hover::before {
  width: 40px;
  height: 40px;
  background: #bfdbfe;
}

/* Dark mode - active state starts at 28px */
html.dark .sidebar.sidebar-collapsed .sidebar-link.active::before {
  background: #1e3a8a;
}

html.dark .sidebar.sidebar-collapsed .sidebar-link.active i {
  color: #60a5fa !important;
}

/* Dark mode - active hover expands to 40px with slightly lighter blue */
html.dark .sidebar.sidebar-collapsed .sidebar-link.active:hover::before {
  width: 40px;
  height: 40px;
  background: #1e40af !important;
}

html.dark .sidebar.sidebar-collapsed .sidebar-link.active:hover i {
  color: #60a5fa !important;
}

/* ===== SUBSCRIPTION ICON (COLLAPSED) - Same behavior ===== */

/* Subscription toggle - background square using ::before */
.sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"] {
  position: relative;
}

.sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"].active {
  background: transparent !important;
}

.sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"].active::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  background: #dbeafe;
  border-radius: 8px;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"].active .fa-credit-card {
  color: #2563eb !important;
  font-size: 15px !important;
  position: relative;
  z-index: 1;
}

/* Subscription on hover - only ::before expands */
.sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"].active:hover::before {
  width: 40px;
  height: 40px;
  background: #bfdbfe;
}

.sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"].active:hover .fa-credit-card {
  font-size: 15px !important;
  /* No movement */
}

/* Dark mode subscription - background square */
html.dark .sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"].active::before {
  background: #1e3a8a;
}

html.dark .sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"].active .fa-credit-card {
  color: #ffffff !important; /* ✅ White icon in dark mode */
  font-size: 15px !important;
}



html.dark .sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"].active:hover .fa-credit-card {
  font-size: 15px !important;
}
/* ===== SIDEBAR LINK TOOLTIPS (COLLAPSED) - FIXED SOLUTION ===== */

/* Keep sidebar content scrollable, but allow horizontal overflow */
.sidebar.sidebar-collapsed .sidebar-content {
  overflow-y: auto !important;
  overflow-x: visible !important;
}

/* Critical: sidebar itself must allow overflow */
.sidebar.sidebar-collapsed {
  overflow: visible !important;
}

/* Sidebar link wrapper */
.sidebar-link {
  position: relative;
}

/* Tooltip - use fixed positioning to escape all containers */
.sidebar-link-tooltip {
  position: fixed; /* ✅ This escapes ALL parent clipping */
  padding: 6px 12px;
  background: #1f2937;
  color: white;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 99999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

  /* Position to the right of collapsed sidebar */
  left: 76px; /* 64px sidebar + 12px gap */
  margin-top: -10px; /* Rough centering - will be slightly off but visible */
}

/* Arrow pointing left */
.sidebar-link-tooltip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: #1f2937;
}

/* Show on hover when collapsed */
.sidebar.sidebar-collapsed .sidebar-link:hover .sidebar-link-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Hide when NOT collapsed */
.sidebar:not(.sidebar-collapsed) .sidebar-link-tooltip {
  display: none;
}

/* Dark mode */
html.dark .sidebar-link-tooltip {
  background: #374151;
}

html.dark .sidebar-link-tooltip::before {
  border-right-color: #374151;
}

/* ===== SUBSCRIPTION HOVER MENU (COLLAPSED SIDEBAR) ===== */

/* Hover menu container */
.subscription-hover-menu {
  position: fixed;
  left: 76px; /* 64px sidebar + 12px gap */
  top: auto; /* We'll position it dynamically with JS */
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 99999;
  min-width: 200px;
}

/* Show menu on hover - both button AND menu itself */
.sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"]:hover .subscription-hover-menu,
.sidebar.sidebar-collapsed .subscription-hover-menu:hover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Keep menu visible when hovering near it */
.sidebar.sidebar-collapsed .sidebar-group-toggle[data-section="subscription"]:hover ~ .subscription-hover-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Hide when sidebar is expanded */
.sidebar:not(.sidebar-collapsed) .subscription-hover-menu {
  display: none;
}

/* Menu title */
.subscription-hover-title {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 12px 4px;
  margin-bottom: 4px;
}

/* Menu items */
.subscription-hover-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.15s ease;
  white-space: nowrap;
  margin-bottom: 2px;
}

.subscription-hover-item:hover {
  background: #f3f4f6;
  color: #1a1a1a;
}

.subscription-hover-item.active {
  color: #2563eb;
  background: #eff6ff;
  font-weight: 600;
}

/* Dark mode */
html.dark .subscription-hover-menu {
  background: #1a1a1a;
  border-color: #2a2a2a;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
}

html.dark .subscription-hover-title {
  color: #6b7280;
}

html.dark .subscription-hover-item {
  color: #9ca3af;
}

html.dark .subscription-hover-item:hover {
  background: #242424;
  color: #ffffff;
}

html.dark .subscription-hover-item.active {
  color: #ffffff !important; /* ✅ White text in dark mode too */
  background: #2563eb !important; /* ✅ Same blue as light mode */
}
/* ===== SUBSCRIPTION COLLAPSE/EXPAND BEHAVIOR ===== */

/* Kill transitions ONLY on dropdown content when collapsed, NOT on the button */
.sidebar.sidebar-collapsed #subscriptionGroup,
.sidebar.sidebar-collapsed #subscriptionGroup * {
  transition: none !important;
  animation: none !important;
  transform: none !important;
}

/* When collapsed, instantly hide dropdown */
.sidebar.sidebar-collapsed #subscriptionGroup {
  display: none !important;
  opacity: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
}

/* When EXPANDED sidebar: only the DROPDOWN gets animation (not the toggle button) */
.sidebar:not(.sidebar-collapsed) #subscriptionGroup {
  transition: max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s ease !important;
}

/* But keep toggle button instant even when expanded (no transform on it) */
.sidebar:not(.sidebar-collapsed) .sidebar-group-toggle[data-section="subscription"] {
  transition: background 0.15s ease !important; /* Only hover background */
  transform: none !important;
}

/* Only chevron rotates smoothly */
.sidebar:not(.sidebar-collapsed) .sidebar-group-toggle[data-section="subscription"] .fa-chevron-down {
  transition: transform 0.12s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* ===== MOBILE MENU - SUBSCRIPTION TOGGLE ===== */
.mobile-subscription-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
  text-align: left;
}

.mobile-subscription-toggle:active {
  background: #f3f4f6;
}

.dark .mobile-subscription-toggle:active {
  background: #374151;
}

.mobile-subscription-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.mobile-subscription-left i {
  width: 20px;
  font-size: 16px;
  text-align: center;
  color: #6b7280;
  opacity: 0.9;
}

.dark .mobile-subscription-left i {
  color: #9ca3af;
}

.mobile-subscription-title {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dark .mobile-subscription-title {
  color: #6b7280;
}

.mobile-subscription-chevron {
  font-size: 10px;
  color: #9ca3af;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark .mobile-subscription-chevron {
  color: #6b7280;
}

.mobile-subscription-toggle.open .mobile-subscription-chevron {
  transform: rotate(180deg);
}

/* Mobile subscription group content */
.mobile-subscription-group {
  max-height: 0;
  overflow: hidden;
  transform: translateY(-8px);
  opacity: 0;
  transition: max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s ease;
}

.mobile-subscription-group.open {
  max-height: 300px;
  margin-bottom: 8px;
  transform: translateY(0);
  opacity: 1;
}

/* Sub-items inside subscription */
.mobile-subscription-group .mobile-menu-link {
  padding-left: 44px; /* Indent sub-items */
  font-size: 14px;
}
/* No icons for subscription sub-items - just text */
.mobile-subscription-group .mobile-menu-link {
  padding-left: 44px; /* Indent from left */
  font-size: 14px;
  gap: 0; /* No gap needed since no icon */
}

.mobile-subscription-group .mobile-menu-link span {
  width: 100%;
}

/* Profile picture shimmer wrapper */
.sidebar-account-pic-wrapper {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

/* Shimmer overlay for profile pic */
.sidebar-pic-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 50%;
  z-index: 1;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.dark .sidebar-pic-shimmer {
  background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
  background-size: 200% 100%;
}

/* Hide shimmer when loaded */
.sidebar-account-pic-wrapper.loaded .sidebar-pic-shimmer {
  opacity: 0;
  pointer-events: none;
}

/* Profile pic sits behind shimmer initially */
.sidebar-account-pic {
  position: relative;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

/* Show pic when loaded */
.sidebar-account-pic-wrapper.loaded .sidebar-account-pic {
  opacity: 1 !important;
}


/* ===== COMMAND PALETTE — MOBILE ===== */

/* On mobile: results dropdown = full-width, fixed below navbar */
@media (max-width: 767px) {
  #searchResultsDropdown {
    position: fixed !important;
    top: 64px !important;   /* height of your navbar */
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: calc(100dvh - 64px) !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12) !important;
    overflow-y: auto;
    z-index: 9999 !important;
  }

  /* Search input: goes full width when open on mobile */
  #globalSearchInput[data-expanded="true"] {
    width: 100% !important;
    max-width: 100% !important;
  }
}
button.btn-loading { position: relative; }
button.btn-loading .btnText { opacity: 0 !important; }
button.btn-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1rem;
  height: 1rem;
  margin-left: -0.5rem;
  margin-top: -0.5rem;
  border-radius: 9999px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin .7s linear infinite;
  pointer-events: none;
}

/* Remove ALL table row hover in dark mode */
html.dark body.theme-dark-enabled tbody tr:hover,
html.dark body.theme-dark-enabled tbody tr:hover td,
html.dark body.theme-dark-enabled table tr:hover,
html.dark body.theme-dark-enabled table tr:hover td,
html.dark tbody tr:hover,
html.dark tbody tr:hover td {
  background-color: transparent !important;
  background: transparent !important;
}
/* Kill Tailwind hover utility classes on rows in dark mode */
html.dark body.theme-dark-enabled tr.hover\:bg-gray-50:hover,
html.dark body.theme-dark-enabled tr.hover\:bg-gray-100:hover,
html.dark body.theme-dark-enabled tr.hover\:bg-white:hover,
html.dark body.theme-dark-enabled tr.hover\:bg-slate-50:hover {
  background-color: transparent !important;
}

/* Global square hover for all close/X buttons */
button:has(> svg path[d*="M6 6l12 12"]),
button:has(> svg path[d*="M6 18L18 6"]),
button:has(> svg path[d*="M18 6L6 18"]),
button[aria-label="Close"],
button[id*="close"],
button[id*="Close"] {
  border-radius: 8px !important;
  transition: background-color 150ms ease, color 150ms ease !important;
}

button:has(> svg path[d*="M6 6l12 12"]):hover,
button:has(> svg path[d*="M6 18L18 6"]):hover,
button:has(> svg path[d*="M18 6L6 18"]):hover,
button[aria-label="Close"]:hover,
button[id*="close"]:hover,
button[id*="Close"]:hover {
  background-color: #f3f4f6 !important;
}

/* Dark mode */
.dark button:has(> svg path[d*="M6 6l12 12"]):hover,
.dark button:has(> svg path[d*="M6 18L18 6"]):hover,
.dark button:has(> svg path[d*="M18 6L6 18"]):hover,
.dark button[aria-label="Close"]:hover,
.dark button[id*="close"]:hover,
.dark button[id*="Close"]:hover {
  background-color: #1e293b !important;
}
.notification-empty.hidden {
  display: none !important;
}

