:root {
  /* New EyesClear Color Palette */
  --primary-blue: #23395B;
  --accent-blue: #65B5F6;
  --menu-bar-bg: #E8EFF8;
  --page-bg: #F5F7FA;
  
  --text-main: #1F2937;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;
  --text-on-dark: #FFFFFF;
  --alert-text: #D97706;
  
  /* Legacy color mappings */
  --old-navy: #11184d;
  --old-cyan: #19bdd0;
  --old-green: #19A69C;
  --old-purple: #952899;
  --old-border: #00557a;

  --new-menu-bg:#f6f8fb;
}

/* Hide duplicate Portal text - will be handled by JavaScript */
.hide-duplicate-portal {
  display: none !important;
}

/* Background Updates */
.content, .content-header, .content-wrapper {
  background-color: var(--new-menu-bg) !important;
}

body {
  font-family: 'Fira Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--new-menu-bg) !important;
  color: var(--primary-blue) !important;
}


/* Sidebar - Force 80px width from the start */
.main-sidebar,
.skin-blue .main-sidebar,
.sidebar-mini .main-sidebar,
.sidebar-mini.sidebar-collapse .main-sidebar,
body.sidebar-mini .main-sidebar,
body.sidebar-collapse .main-sidebar {
  width: 80px !important;
}

.skin-blue .wrapper, .skin-blue .main-sidebar, .skin-blue .left-side {
  background-color: var(--new-menu-bg) !important;
  border-right: 1.5px solid #ccd7e9 !important;
}

/* Expanded sidebar background */
body.sidebar-expanded .skin-blue .wrapper,
body.sidebar-expanded .skin-blue .main-sidebar, 
body.sidebar-expanded .skin-blue .left-side,
body.sidebar-expanded .sidebar,
body.sidebar-expanded .sidebar-menu,
body.sidebar-expanded .sidebar-logo {
  background-color: #eef1f5 !important;
}

.skin-blue .sidebar-menu > li.header {
  color: var(--text-muted);
  background: rgba(0,0,0,0.1) !important;
}

.skin-blue .sidebar-menu > li > a {
  color: var(--primary-blue) !important;
  font-weight: bold !important;
  text-align: center;
}

.skin-blue .sidebar-menu > li > a > i {
  color: var(--primary-blue) !important;
}

.skin-blue .sidebar-menu > li:hover > a, 
.skin-blue .sidebar-menu > li.active > a,
.skin-blue .sidebar-menu > li.menu-open > a {
  color: var(--text-main) !important;
  background: #d9dde7 !important;
  border-radius: 4px !important;
  margin: 0 8px !important;
}

.skin-blue .sidebar-menu > li > .treeview-menu {
  margin: 0 1px;
  background: #eef1f5 !important;
}

/* Submenu items styling */
.skin-blue .sidebar-menu .treeview-menu > li > a {
  color: var(--primary-blue) !important;
  padding: 8px 15px 8px 25px !important;
  margin: 1px 8px !important;
  border-radius: 4px !important;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  font-size: 13px !important;
}

.skin-blue .sidebar-menu .treeview-menu > li > a:hover {
  background: rgba(35, 57, 91, 0.05) !important;
  color: var(--primary-blue) !important;
  border-radius: 6px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}

.skin-blue .sidebar-menu .treeview-menu > li.active > a {
  background: rgba(35, 57, 91, 0.08) !important;
  color: var(--primary-blue) !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
  position: relative !important;
}

.skin-blue .sidebar-menu .treeview-menu > li.active > a::before {
  content: "•" !important;
  position: absolute !important;
  left: 15px !important;
  color: var(--accent-blue) !important;
  font-weight: bold !important;
}

/* Typography and Text Colors */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-blue) !important;
}

/* Content text colors to match menu icon blue.
   NOT on span/div — they break badges, buttons, toggles and colored components.
   Those inherit from body or their parent. */
p, td, th, label, .form-control {
  color: var(--primary-blue);
}

/* Ensure text in boxes and content areas use blue color */
.box-body, .content-wrapper, .content {
  color: var(--primary-blue) !important;
}

.dark-bg {
  background: var(--primary-blue) !important;
  color: var(--text-on-dark) !important;
}

.light-bg {
  background: white !important;
  color: var(--text-main) !important;
}

/* Boxes and Cards */
.box {
  background: var(--new-menu-bg) !important;
  border-top-color: var(--accent-blue) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06) !important;
}

.box-header {
  color: var(--primary-blue) !important;
  background: rgba(0,0,0,0.02) !important;
  border-bottom: 1px solid rgba(0,0,0,0.08) !important;
}

.box-title {
  color: var(--primary-blue) !important;
}

/* Buttons */
.btn-primary {
  background-color: #3c8dbc !important;
  border-color: #3c8dbc !important;
  color: var(--text-on-dark) !important;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus {
  background-color: rgb(50, 120, 160) !important;
  border-color: rgb(50, 120, 160) !important;
}

.btn-default {
  background-color: var(--new-menu-bg) !important;
  border-color: #ddd !important;
  color: var(--primary-blue) !important;
}

.btn-success {
  background-color: #10B981 !important;
  border-color: #10B981 !important;
}

.btn-danger {
  background-color: #EF4444 !important;
  border-color: #EF4444 !important;
}

.btn-warning {
  background-color: var(--alert-text) !important;
  border-color: var(--alert-text) !important;
}

/* Tables */
table {
  border-top: 4px solid var(--accent-blue) !important;
}

td, th {
  border-color: rgba(0,0,0,0.08) !important;
  color: var(--primary-blue) !important;
}

tr:hover {
  background: rgba(101, 181, 246, 0.1) !important;
}

/* Forms and Inputs */
.form-control {
  background-color: var(--new-menu-bg);
  border-color: #ccd7e9;
  color: var(--primary-blue);
}

.form-control:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 0.2rem rgba(101, 181, 246, 0.25);
}

.has-error .form-control {
  border-color: red;
  box-shadow: 0 0 5px rgba(255, 0, 0, 0.3);
}

input.error, select.error, textarea.error {
  border-color: red;
  box-shadow: 0 0 5px rgba(255, 0, 0, 0.3);
}

.has-error label.error {
  color: #a94442 !important;
}

/* Select2 Updates */
.select2-container--default .select2-selection--single {
  background-color: white !important;
  border-color: #ddd !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--primary-blue) !important;
}

/* Labels and Badges */
.label-primary {
  background-color: var(--primary-blue) !important;
}

.label-success {
  background-color: #10B981 !important;
}

.label-warning {
  background-color: var(--alert-text) !important;
}

.label-danger {
  background-color: #EF4444 !important;
}


.volume {
  color: #10B981 !important;
}

.value {
  color: var(--accent-blue) !important;
}

.chart-label {
  color: var(--accent-blue) !important;
  opacity: 1 !important;
}

/* Enhanced Modal Styles */
.modal-content {
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  border: 1px solid #dee2e6;
  background: #ffffff;
}

.modal-header {
  background: linear-gradient(135deg, #f4f4f4 0%, #e8e8e8 100%);
  border-bottom: 1px solid #ddd;
  color: #2c3e50;
  border-radius: 8px 8px 0 0;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px 20px;
  position: relative;
}

.modal-header .modal-title {
  margin: 0;
  color: #2c3e50;
  font-weight: bold;
  text-align: center;
  flex: 1;
}

.modal-header .close {
  color: #dc3545;
  opacity: 0.8;
  font-size: 24px;
  font-weight: bold;
  text-shadow: none;
  transition: all 0.3s ease;
}

.modal-header .close:hover {
  color: #c82333;
  opacity: 1;
  transform: scale(1.1);
}

.modal-body {
  background: #ffffff;
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-top: 1px solid #dee2e6;
  border-radius: 0 0 8px 8px;
  padding: 15px 20px;
}

.modal-footer .btn {
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  height: 38px;
  border: 1px solid;
}

.modal-footer .btn-primary,
.modal-footer .btn-success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
  color: #155724 !important;
  border-color: #c3e6cb !important;
}

.modal-footer .btn-primary i,
.modal-footer .btn-primary span,
.modal-footer .btn-success i,
.modal-footer .btn-success span {
  color: inherit !important;
}

.modal-footer .btn-primary:hover,
.modal-footer .btn-success:hover {
  background: linear-gradient(135deg, #c3e6cb 0%, #b8dfbf 100%) !important;
  color: #0d4018 !important;
  border-color: #b8dfbf !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.modal-footer .btn-default {
  background: linear-gradient(135deg, #f8d7da 0%, #f1c2c7 100%) !important;
  color: #721c24 !important;
  border-color: #f1c2c7 !important;
}

.modal-footer .btn-default i,
.modal-footer .btn-default span {
  color: inherit !important;
}

.modal-footer .btn-default:hover {
  background: linear-gradient(135deg, #f1c2c7 0%, #e8a9b0 100%) !important;
  color: #491217 !important;
  border-color: #e8a9b0 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.modal-footer .btn-danger {
  background: linear-gradient(135deg, #f8d7da 0%, #f1c2c7 100%) !important;
  color: #721c24 !important;
  border-color: #f1c2c7 !important;
}

.modal-footer .btn-danger i,
.modal-footer .btn-danger span {
  color: inherit !important;
}

.modal-footer .btn-danger:hover {
  background: linear-gradient(135deg, #f1c2c7 0%, #e8a9b0 100%) !important;
  color: #491217 !important;
  border-color: #e8a9b0 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.modal-footer .btn-warning {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%) !important;
  color: #856404 !important;
  border-color: #ffeeba !important;
}

.modal-footer .btn-warning i,
.modal-footer .btn-warning span {
  color: inherit !important;
}

.modal-footer .btn-warning:hover {
  background: linear-gradient(135deg, #ffeeba 0%, #ffe8a1 100%) !important;
  color: #6d5204 !important;
  border-color: #ffe8a1 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Footer */
.main-footer {
  background: var(--new-menu-bg) !important;
  color: var(--primary-blue) !important;
  border-top: 1px solid rgba(0,0,0,0.08) !important;
}

/* Sidebar Layout Updates */
.main-sidebar {
  padding-top: 0 !important;
  height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  z-index: 1040 !important;
  overflow: visible !important;
  transition: width 0.6s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
}

/* Allow overflow for submenus in collapsed state */
body:not(.sidebar-expanded) .sidebar {
  overflow: visible !important;
}

body:not(.sidebar-expanded) .sidebar-menu {
  overflow: visible !important;
}

body:not(.sidebar-expanded) .sidebar-menu .treeview {
  overflow: visible !important;
}

/* Expanded sidebar state */
body.sidebar-expanded .main-sidebar {
  width: 250px !important;
  background-color: #eef1f5 !important;
}

/* Ensure all sidebar components get the expanded background */
body.sidebar-expanded .sidebar,
body.sidebar-expanded .sidebar-bottom,
body.sidebar-expanded .sidebar-section {
  background-color: #eef1f5 !important;
}

.sidebar {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  padding-top: 0 !important;
}

/* Logo Section */
.sidebar-logo {
  padding: 20px 15px;
  text-align: center;
  transition: all 0.3s ease;
}

.sidebar-logo .logo-link {
  display: block;
}

.sidebar-logo .logo-img {
  height: auto;
  filter: brightness(0) invert(1);
  transition: all 0.3s ease;
}

/* Logo section */
.sidebar-logo {
  padding: 15px 5px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
}

/* Default collapsed state - show small logo */
.sidebar-logo .logo-full {
  display: none !important;
}

.sidebar-logo .logo-collapsed {
  max-width: 30px;
  display: block !important;
  filter: brightness(0) invert(1) !important;
}

/* EyesClear text logo transitions */
.eyesclear-text-logo {
  opacity: 0 !important;
  transform: translateX(-20px) !important;
  transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  pointer-events: none !important;
}

/* Show EyesClear text logo when menu is expanded */
body.sidebar-expanded .eyesclear-text-logo {
  opacity: 1 !important;
  transform: translateX(0) !important;
  transition-delay: 0.25s !important;
  pointer-events: auto !important;
}

/* Sidebar toggle icon states */
.sidebar-toggle-icon {
  color: #21b7aa !important;
  font-size: 18px !important;
  transition: all 0.3s ease !important;
}

.sidebar-toggle-arrow,
.sidebar-logo .fa-stack .fa {
  color: var(--primary-blue) !important;
  transition: all 0.3s ease !important;
}

/* Change icon direction based on sidebar state */
body:not(.sidebar-expanded) .sidebar-toggle-icon:before {
  content: "\f2f6" !important; /* fa-arrow-right-to-bracket */
}

body.sidebar-expanded .sidebar-toggle-icon:before {
  content: "\f2f5" !important; /* fa-arrow-left-to-bracket */
}

/* Sidebar toggle button (hamburger menu) - ensure it's visible and clickable on all devices */
.sidebar-toggle {
  display: inline-block !important;
  cursor: pointer !important;
  position: relative !important;
  padding: 15px !important;
  background-color: transparent !important;
  border: none !important;
  transition: background-color 0.3s ease !important;
}

.sidebar-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Ensure the hamburger icon bars are visible */
.sidebar-toggle .icon-bar {
  display: block !important;
  width: 22px !important;
  height: 2px !important;
  background-color: #fff !important;
  border-radius: 1px !important;
  margin: 4px 0 !important;
}

/* Mobile menu toggle button - floating hamburger button */
.mobile-menu-toggle {
  display: none !important; /* Hidden on desktop */
  position: fixed !important;
  top: 15px !important;
  left: 15px !important;
  z-index: 1060 !important;
  background-color: var(--primary-blue) !important;
  border: none !important;
  border-radius: 4px !important;
  padding: 10px 12px !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  transition: all 0.3s ease !important;
}

.mobile-menu-toggle:hover {
  background-color: #1a2d4a !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.mobile-menu-toggle:active {
  transform: scale(0.95) !important;
}

.mobile-menu-toggle .icon-bar {
  display: block !important;
  width: 22px !important;
  height: 2px !important;
  background-color: #fff !important;
  border-radius: 1px !important;
  margin: 4px 0 !important;
  transition: all 0.3s ease !important;
}

/* Animate hamburger to X when sidebar is open */
body.sidebar-expanded .mobile-menu-toggle .icon-bar:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px) !important;
}

body.sidebar-expanded .mobile-menu-toggle .icon-bar:nth-child(2) {
  opacity: 0 !important;
}

body.sidebar-expanded .mobile-menu-toggle .icon-bar:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px) !important;
}

/* Mobile-specific styles for sidebar toggle */
@media (max-width: 767px) {
  /* Show mobile toggle button on mobile */
  .mobile-menu-toggle {
    display: block !important;
  }

  .sidebar-toggle {
    display: inline-block !important;
    z-index: 1050 !important;
  }

  /* Ensure sidebar overlays content on mobile */
  .main-sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 250px !important;
    z-index: 1050 !important;
    transform: translateX(-250px) !important;
    transition: transform 0.3s ease !important;
  }

  body.sidebar-expanded .main-sidebar {
    width: 250px !important;
    transform: translateX(0) !important;
  }

  /* Add overlay when sidebar is open on mobile */
  body.sidebar-expanded::before {
    content: '' !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    z-index: 1045 !important;
  }

  /* Ensure content doesn't shift on mobile */
  .content-wrapper {
    margin-left: 0 !important;
  }
}

/* Expanded state - show full logo */
body.sidebar-expanded .sidebar-logo {
}

body.sidebar-expanded .sidebar-logo .logo-full {
  display: block !important;
  max-width: 180px !important;
  filter: none !important;
}

body.sidebar-expanded .sidebar-logo .logo-collapsed {
  display: none !important;
}

/* Logo hover effects */
.sidebar-logo .logo-link:hover .logo-img {
  transform: scale(1.05);
  filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(101, 181, 246, 0.6));
}

/* Main menu should grow to fill space */
.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 180px); /* Account for logo and bottom sections */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) transparent;
}

/* Hide slimScrollBar elements completely */
.slimScrollBar, 
.slimScrollRail,
div[style*="slimScrollBar"],
div[style*="slimScrollRail"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Hide slimScrollBar elements */
.slimScrollBar {
  display: none !important;
}

.slimScrollRail {
  display: none !important;
}

/* Hide scrollbar completely while keeping scroll functionality */
.sidebar-menu::-webkit-scrollbar {
  display: none !important;
}

/* For Firefox */
.sidebar-menu {
  scrollbar-width: none !important;
}

/* But in collapsed mode, allow overflow for submenus */
body:not(.sidebar-expanded) .sidebar-menu {
  overflow: visible !important;
}

/* In expanded mode, ensure scrolling works properly */
body.sidebar-expanded .sidebar-menu {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  max-height: calc(100vh - 180px) !important;
}

/* Bottom section styling */
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 10px 0;
}

.sidebar-section {
  padding: 10px 15px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-section:last-child {
  border-bottom: none;
}

.sidebar-bottom-link {
  display: flex;
  align-items: center;
  color: var(--text-on-dark) !important;
  padding: 8px 0;
  text-decoration: none !important;
}

.sidebar-bottom-link:hover {
  color: var(--accent-blue) !important;
}

.sidebar-bottom-link i {
  margin-right: 10px;
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.sidebar-bottom-link .label {
  margin-left: auto;
}

/* User section specific */
.user-section .user-link {
  display: flex;
  align-items: center;
}

.user-section .user-image {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 10px;
}

.user-section .user-name {
  flex: 1;
}

/* Dropdown adjustments for sidebar */
.sidebar .dropdown-menu {
  position: absolute !important;
  bottom: 100% !important;
  left: 100% !important;
  top: auto !important;
  margin-bottom: 5px;
  margin-left: 0;
}

.sidebar .dropdown-menu-top {
  box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
}

/* User actions in dropdown */
.user-actions {
  padding: 10px;
}

.user-actions .btn {
  margin-bottom: 5px;
}

.user-actions .btn:last-child {
  margin-bottom: 0;
}

/* Content area adjustment without header */
.content-wrapper {
  margin-left: 80px !important;
  margin-top: 30px !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  position: relative !important;
}

.content {
  padding: 0 !important;
}

/* Sidebar toggle button - REMOVED */
/* Overlay when sidebar is open - REMOVED */

/* Remove header completely */
.main-header {
  display: none !important;
  position: static !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Ensure no sticky positioning */
.navbar-static-top {
  position: static !important;
}

/* Override any header positioning */
header, .main-header, .navbar {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
}

/* Ensure wrapper takes full width and doesn't move */
.wrapper {
  width: 100% !important;
  position: static !important;
  margin-left: 0 !important;
}

/* Override AdminLTE sidebar classes to prevent content movement */
.sidebar-mini.sidebar-collapse .content-wrapper,
.sidebar-mini.sidebar-collapse .main-footer {
  margin-left: 0 !important;
}

.sidebar-mini .content-wrapper,
.sidebar-mini .main-footer {
  margin-left: 0 !important;
}

/* Improved sidebar animation with smooth easing */
.main-sidebar {
  transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
              transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* Ensure content stays in place regardless of sidebar state */
body.sidebar-mini .content-wrapper,
body.sidebar-mini .main-footer,
body.sidebar-collapse .content-wrapper,
body.sidebar-collapse .main-footer {
  margin-left: 80px !important;
  transition: margin-left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* Smooth text fade animations */
.sidebar .nav > li > a > span,
.sidebar .eyesclear-text-logo {
  transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* Hide text with smooth fade when collapsed */
body:not(.sidebar-expanded) .sidebar .nav > li > a > span,
body:not(.sidebar-expanded) .sidebar .eyesclear-text-logo {
  opacity: 0 !important;
  transform: translateX(-10px) !important;
}

/* Show text with smooth fade when expanded */
body.sidebar-expanded .sidebar .nav > li > a > span,
body.sidebar-expanded .sidebar .eyesclear-text-logo {
  opacity: 1 !important;
  transform: translateX(0) !important;
}

/* Custom sidebar search component - match menu item styling exactly */
.eyesclear-sidebar-search {
  display: flex !important;
  position: relative !important;
  padding: 10px 5px !important;
  margin: 0 !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.eyesclear-sidebar-search .search-input {
  transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* In collapsed mode, show only icon */
body:not(.sidebar-expanded) .eyesclear-sidebar-search .search-input {
  display: none !important;
}

body:not(.sidebar-expanded) .eyesclear-sidebar-search .search-icon {
  margin-right: 0 !important;
  width: 100% !important;
  text-align: center !important;
  cursor: pointer !important;
  transition: color 0.2s ease !important;
}

body:not(.sidebar-expanded) .eyesclear-sidebar-search .search-icon:hover {
  color: var(--accent-blue) !important;
}

/* Prevent layout shifts during search icon expansion */
body.sidebar-expanding .main-sidebar {
  overflow: hidden !important;
}

body.sidebar-expanding .eyesclear-sidebar-search {
  overflow: hidden !important;
}

/* Show full search when expanded - match menu item padding */
body.sidebar-expanded .eyesclear-sidebar-search {
  justify-content: flex-start !important;
  padding: 10px 15px !important;
}

body.sidebar-expanded .eyesclear-sidebar-search .search-input {
  display: block !important;
}

.eyesclear-sidebar-search .search-icon {
  color: var(--primary-blue) !important;
  font-size: 16px !important;
  margin-right: 10px !important;
  flex-shrink: 0 !important;
  width: 16px !important;
  text-align: center !important;
}

.eyesclear-sidebar-search .search-input {
  border: 1px solid #ccd7e9 !important;
  border-radius: 4px !important;
  background-color: white !important;
  color: var(--primary-blue) !important;
  padding: 6px 10px !important;
  font-size: 14px !important;
  height: 32px !important;
  flex: 1 !important;
  margin: 0 !important;
  outline: none !important;
  opacity: 0 !important;
  transform: translateX(-10px) !important;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  pointer-events: none !important;
}

/* Show search input when expanded */
body.sidebar-expanded .eyesclear-sidebar-search .search-input {
  opacity: 1 !important;
  transform: translateX(0) !important;
  transition-delay: 0.2s !important;
  pointer-events: auto !important;
}

.eyesclear-sidebar-search .search-input:focus {
  border-color: var(--accent-blue) !important;
  box-shadow: 0 0 0 2px rgba(101, 181, 246, 0.15) !important;
}

.eyesclear-sidebar-search .search-input::placeholder {
  color: var(--text-muted) !important;
}

/* Collapsed sidebar menu styling */
.sidebar-menu > li > a {
  padding: 10px 5px !important;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.sidebar-menu > li > a > span {
  display: none !important;
  transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  opacity: 0 !important;
  transform: translateX(-10px) !important;
}

.sidebar-menu > li > a > i {
  margin-right: 0 !important;
  font-size: 16px !important;
  width: 100% !important;
  text-align: center !important;
  transition: margin-right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              text-align 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* Hide menu arrows completely */
.sidebar-menu .pull-right-container {
  display: none !important;
}

/* Expanded state - show full menu */
body.sidebar-expanded .sidebar-menu > li > a {
  padding: 10px 15px !important;
  text-align: left !important;
}

/* Allow long menu labels (e.g. Dynamic Forms names) to wrap to a second line;
   th:title attribute on these spans still surfaces the full text as a tooltip. */
.menu-label-text {
  display: inline-block !important;
  white-space: normal !important;
  word-break: break-word !important;
  max-width: 170px !important;
  vertical-align: middle !important;
  line-height: 1.3 !important;
}

body.sidebar-expanded .sidebar-menu > li > a > span {
  display: inline-block !important;
  opacity: 1 !important;
  transform: translateX(0) !important;
  transition-delay: 0.15s !important;
}

body.sidebar-expanded .sidebar-menu > li > a > i {
  margin-right: 10px !important;
  width: auto !important;
  text-align: left !important;
}

body.sidebar-expanded .sidebar-menu .pull-right-container {
  display: none !important;
}

body.sidebar-expanded .eyesclear-sidebar-search {
  display: flex !important;
}

/* Hide original sidebar-form */
body.sidebar-expanded .sidebar-form {
  display: none !important;
}

/* Collapsed sidebar bottom section */
.sidebar-bottom {
  padding: 5px 0 !important;
  transition: all 0.3s ease !important;
}

.sidebar-section {
  padding: 5px !important;
  transition: all 0.3s ease !important;
}

.sidebar-bottom-link span {
  display: none !important;
  transition: all 0.3s ease !important;
}

.sidebar-bottom-link i {
  margin: 0 auto !important;
  font-size: 16px !important;
  transition: all 0.3s ease !important;
}

.sidebar-bottom-link {
  justify-content: center !important;
  padding: 8px 0 !important;
  transition: all 0.3s ease !important;
}

/* Collapsed user image */
.user-section .user-image {
  width: 24px !important;
  height: 24px !important;
  margin: 0 !important;
  transition: all 0.3s ease !important;
}

/* Expanded state - bottom section */
body.sidebar-expanded .sidebar-bottom {
  padding: 10px 0 !important;
}

body.sidebar-expanded .sidebar-section {
  padding: 10px 15px !important;
}

body.sidebar-expanded .sidebar-bottom-link {
  justify-content: flex-start !important;
}

body.sidebar-expanded .sidebar-bottom-link span {
  display: inline-block !important;
}

body.sidebar-expanded .sidebar-bottom-link i {
  margin-right: 10px !important;
  margin-left: 0 !important;
}

body.sidebar-expanded .user-section .user-image {
  width: 30px !important;
  height: 30px !important;
  margin-right: 10px !important;
}

/* Sidebar menus on hover - expand to show content (only in collapsed state) */
body.sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > span,
body.sidebar-mini.sidebar-collapse .sidebar-bottom-link:hover span {
  display: inline-block !important;
  position: absolute !important;
  left: 50px !important;
  background: var(--primary-blue) !important;
  color: var(--text-on-dark) !important;
  padding: 5px 10px !important;
  border-radius: 4px !important;
  white-space: nowrap !important;
  z-index: 1050 !important;
}

/* Make sure dropdowns work properly */
.sidebar .dropdown {
  position: relative;
}

/* Notification badge styling */
.sidebar-bottom .label-warning {
  background-color: var(--alert-text) !important;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
}

/* Menu accordion styling - only hide in expanded mode */
body.sidebar-expanded .sidebar-menu .treeview-menu:not(.menu-open):not(.hover-visible) {
  overflow: hidden;
  display: none; /* Hidden by default in expanded mode */
}

/* Show menu when open in expanded state */
body.sidebar-expanded .sidebar-menu .treeview.menu-open > .treeview-menu {
  display: block !important;
}

/* Also handle direct CSS display from JS */
.sidebar-menu .treeview.menu-open > .treeview-menu[style*="display: block"] {
  display: block !important;
}

.sidebar-menu .menu-arrow {
  transition: transform 0.3s ease;
}

body.sidebar-expanded .sidebar-menu .treeview.menu-open > a .menu-arrow {
  transform: rotate(90deg);
}

.sidebar-menu .treeview > a:hover {
  background-color: rgba(255,255,255,0.1) !important;
}

.sidebar-menu .treeview > a {
  transition: background-color 0.3s ease;
}

/* Note: Submenu hiding is now handled by more specific hover rules below */

body.sidebar-mini.sidebar-collapse .sidebar-menu .treeview {
  position: relative !important;
  overflow: visible !important;
}

body.sidebar-mini.sidebar-collapse .sidebar-menu > li {
  position: relative !important;
  overflow: visible !important;
}

/* Submenu items in collapsed state */
body.sidebar-mini.sidebar-collapse .sidebar-menu .treeview-menu li a {
  padding: 8px 15px !important;
  display: block !important;
  color: var(--primary-blue) !important;
  margin: 1px 4px !important;
  border-radius: 4px !important;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

body.sidebar-mini.sidebar-collapse .sidebar-menu .treeview-menu li a:hover {
  background-color: rgba(35, 57, 91, 0.05) !important;
  border-radius: 6px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
  color: var(--primary-blue) !important;
}

body.sidebar-mini.sidebar-collapse .sidebar-menu .treeview-menu li a span {
  display: inline-block !important;
  opacity: 1 !important;
  position: static !important;
}

body.sidebar-mini.sidebar-collapse .sidebar-menu .treeview-menu li a i {
  margin-right: 8px !important;
  width: auto !important;
  text-align: left !important;
  color: var(--primary-blue) !important;
}

/* Disable all hover-based sidebar expansion */
.main-sidebar:hover {
  /* Force disable hover behavior */
}

/* Override AdminLTE hover styles completely */
body.sidebar-mini.sidebar-collapse .main-sidebar:hover {
  /* Prevent hover expansion */
}

/* Ensure sidebar-expanded-on-hover class has no effect */
body.sidebar-expanded-on-hover .main-sidebar {
  width: 50px !important;
}

body.sidebar-expanded-on-hover .sidebar-menu > li > a > span,
body.sidebar-expanded-on-hover .sidebar-bottom-link span {
  display: none !important;
}

/* Smooth transitions for menu items */
.sidebar-menu li {
  transition: all 0.3s ease;
}

/* Search page styling to match background */
body[id*="search"] .box,
.search-page .box {
  background: var(--new-menu-bg) !important;
}

body[id*="search"] .box-body,
.search-page .box-body {
  background: var(--new-menu-bg) !important;
}

/* Remove white backgrounds from search forms and containers */
body[id*="search"] .content-wrapper,
.search-page .content-wrapper {
  background: var(--new-menu-bg) !important;
}

body[id*="search"] .content,
.search-page .content {
  background: var(--new-menu-bg) !important;
}

/* Style search form elements */
body[id*="search"] .form-horizontal,
.search-page .form-horizontal {
  background: transparent !important;
}

/* Ensure search inputs and selects have proper styling */
body[id*="search"] .form-control,
.search-page .form-control {
  background-color: var(--new-menu-bg) !important;
  border: 1px solid #ddd !important;
  color: var(--primary-blue) !important;
}

body[id*="search"] .form-control:focus,
.search-page .form-control:focus {
  border-color: var(--accent-blue) !important;
  box-shadow: 0 0 0 0.2rem rgba(101, 181, 246, 0.25) !important;
}

/* Additional search page selectors */
body[id*="message"] .box,
body[id*="Message"] .box {
  background: var(--new-menu-bg) !important;
}

body[id*="message"] .box-body,
body[id*="Message"] .box-body {
  background: var(--new-menu-bg) !important;
}

/* DataTables on search pages */
body[id*="search"] .dataTables_wrapper,
body[id*="message"] .dataTables_wrapper,
.search-page .dataTables_wrapper {
  background: var(--new-menu-bg) !important;
}

/* Search result tables */
body[id*="search"] table.dataTable,
body[id*="message"] table.dataTable,
.search-page table.dataTable {
  background: var(--new-menu-bg) !important;
}

/* Modal backgrounds for search pages */
body[id*="search"] .modal-content,
body[id*="message"] .modal-content,
.search-page .modal-content {
  background: var(--new-menu-bg) !important;
  color: var(--primary-blue) !important;
}

/* Dashboard Specific */
#dashboard .dashTitle {
  color: var(--primary-blue) !important;
}

.key-figure h2,
.key-figure h3,
.key-figure p {
  color: var(--primary-blue) !important;
}

.key-figure span {
  color: var(--primary-blue) !important;
}

/* Alert Notifications */
.alert-warning {
  background-color: #FEF3C7 !important;
  border-color: #F59E0B !important;
  color: #92400E !important;
}

.alert-danger {
  background-color: #FEE2E2 !important;
  border-color: #EF4444 !important;
  color: #991B1B !important;
}

.alert-success {
  background-color: #D1FAE5 !important;
  border-color: #10B981 !important;
  color: #065F46 !important;
}

.alert-info {
  background-color: #DBEAFE !important;
  border-color: #3B82F6 !important;
  color: #1E40AF !important;
}

/* Bucket Monitoring Updates */
.bucket-tile {
  background: white !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06) !important;
}

.bucket-label {
  background: var(--primary-blue) !important;
  color: var(--text-on-dark) !important;
}

.bucket {
  border-color: rgba(0,0,0,0.08) !important;
}
/* DataTables */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  color: var(--primary-blue) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--primary-blue) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--accent-blue) !important;
  color: var(--text-on-dark) !important;
  border-color: var(--accent-blue) !important;
}

/* Hover Submenu Functionality for Collapsed Sidebar */
/* Ensure parent li has relative positioning for hover menus */
body:not(.sidebar-expanded) .sidebar-menu .treeview {
  position: relative !important;
}

/* Custom hover functionality for collapsed sidebar menus */
body:not(.sidebar-expanded) .sidebar-menu .treeview-menu.hover-visible {
  background: var(--new-menu-bg) !important;
  border: 1.5px solid #ccd7e9 !important;
  border-radius: 0 8px 8px 0 !important;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15) !important;
  z-index: 99999 !important;
  width: 250px !important;
  padding: 8px 0 !important;
  animation: slideIn 0.2s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
  pointer-events: auto !important;
  min-height: 40px !important;
  max-height: 80vh !important;
  overflow-y: auto !important;
}

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

/* Style the submenu items */
.sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse .sidebar-menu .treeview-menu > li {
  margin: 0 !important;
  border-bottom: none !important;
}

.sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse .sidebar-menu .treeview-menu > li > a {
  padding: 10px 20px !important;
  color: var(--primary-blue) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border-radius: 0 !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
}

.sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse .sidebar-menu .treeview-menu > li > a:hover {
  background: rgba(35, 57, 91, 0.08) !important;
  color: var(--primary-blue) !important;
  padding-left: 25px !important;
}

.sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse .sidebar-menu .treeview-menu > li > a > i {
  margin-right: 10px !important;
  font-size: 14px !important;
  color: #6c7b8a !important;
  width: 16px !important;
  text-align: center !important;
}

/* Style 3rd level menus in hover mode */
.sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse .sidebar-menu .treeview-menu .third-level-menu {
  display: block !important;
  position: relative !important;
  left: 0 !important;
  background: #f8fafc !important;
  border: none !important;
  border-left: 3px solid #e2e8f0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 5px 0 0 15px !important;
  padding: 5px 0 !important;
  width: auto !important;
}

.sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse .sidebar-menu .treeview-menu .third-level-item > a {
  padding: 8px 15px 8px 25px !important;
  font-size: 12px !important;
  color: #64748b !important;
  font-weight: 400 !important;
}

.sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse .sidebar-menu .treeview-menu .third-level-item > a:hover {
  background: rgba(35, 57, 91, 0.05) !important;
  color: var(--primary-blue) !important;
  padding-left: 30px !important;
}

/* Add an indicator for items with submenus */
.sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse .sidebar-menu > li.treeview > a::after {
  content: '' !important;
  position: absolute !important;
  right: 8px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 0 !important;
  height: 0 !important;
  border: 4px solid transparent !important;
  border-left-color: #6c7b8a !important;
  transition: all 0.2s ease !important;
}

.sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse .sidebar-menu > li.treeview:hover > a::after {
  border-left-color: var(--primary-blue) !important;
}

/* Hide arrows in collapsed mode as requested */
.sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse .sidebar-menu > li.treeview > a > .pull-right-container {
  display: none !important;
}

/* Custom 3-Level Menu Styling - Override AdminLTE defaults */
.third-level-menu {
  display: block !important;
  background: #f6f8fb !important;
  margin: 0 !important;
  padding: 0 !important;
  border-left: 2px solid #ccd7e9 !important;
  margin-left: 15px !important;
  border-radius: 0 0 4px 4px !important;
}

.third-level-item {
  display: list-item !important;
  padding-left: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

.third-level-item > a {
  display: block !important;
  padding: 6px 15px 6px 20px !important;
  color: #8aa4af !important;
  font-size: 12px !important;
  text-decoration: none !important;
  transition: all 0.3s ease !important;
  border-radius: 0 !important;
}

.third-level-item > a:hover {
  background-color: rgba(35, 57, 91, 0.05) !important;
  color: var(--primary-blue) !important;
  padding-left: 22px !important;
}

.third-level-item > a > i {
  margin-right: 6px !important;
  font-size: 11px !important;
  color: #a0aec0 !important;
}

.third-level-item > a > span {
  font-size: 12px !important;
  color: inherit !important;
}

/* Scrollbar Styling */
::-webkit-scrollbar-track {
  background-color: var(--page-bg) !important;
}

::-webkit-scrollbar-thumb {
  background-color: var(--text-muted) !important;
  border-radius: 4px !important;
}

/* Notification Dropdown */
.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a {
  color: var(--primary-blue) !important;
}

.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a:hover {
  background: var(--new-menu-bg) !important;
}

/* User Panel in Sidebar */
.user-panel {
  background: rgba(0,0,0,0.1) !important;
}

.user-panel > .info {
  color: var(--text-on-dark) !important;
}

/* Small Box Widget */
.small-box {
  background: var(--new-menu-bg) !important;
  color: var(--primary-blue) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06) !important;
  border: none !important;
}

.small-box .icon {
  color: rgba(0,0,0,0.1) !important;
}

.small-box:hover {
  /* Hover movement effect disabled */
}

/* Progress Bars */
.progress {
  background-color: var(--new-menu-bg) !important;
}

.progress-bar-primary {
  background-color: var(--primary-blue) !important;
}

.progress-bar-success {
  background-color: #10B981 !important;
}

.progress-bar-warning {
  background-color: var(--alert-text) !important;
}

.progress-bar-danger {
  background-color: #EF4444 !important;
}

/* Query Builder Warning Icon */
.glyphicon-warning-sign {
  color: red !important;
}

/* Remove bullet markers from notification dropdown */
.dropdown-menu .menu {
  list-style: none !important;
  padding-left: 10px !important;
}

.dropdown-menu .menu li {
  list-style: none !important;
  list-style-type: none !important;
}

/* Scenario table specific column widths - only affects tables with Scenario Channel header */
table:has(th[aria-label*="Scenario Channel"]) th:nth-child(1),
table:has(th[aria-label*="Scenario Channel"]) td:nth-child(1) {
  width: 0% !important;
  max-width: 0% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

table:has(th[aria-label*="Scenario Channel"]) th:nth-child(2),
table:has(th[aria-label*="Scenario Channel"]) td:nth-child(2) {
  width: 5% !important;
  max-width: 5% !important;
}

table:has(th[aria-label*="Scenario Channel"]) th:nth-child(3),
table:has(th[aria-label*="Scenario Channel"]) td:nth-child(3) {
  width: 10% !important;
  max-width: 10% !important;
}

table:has(th[aria-label*="Scenario Channel"]) th:nth-child(4),
table:has(th[aria-label*="Scenario Channel"]) td:nth-child(4) {
  width: 30% !important;
  max-width: 30% !important;
}

table:has(th[aria-label*="Scenario Channel"]) th:nth-child(5),
table:has(th[aria-label*="Scenario Channel"]) td:nth-child(5) {
  width: 5% !important;
  max-width: 5% !important;
}

/* DataTables header-to-row alignment fixes for Scenario Channel tables */
table:has(th[aria-label*="Scenario Channel"]) {
  table-layout: fixed !important;
  width: 100% !important;
}

/* DataTables scroll container fixes for header alignment */
.dataTables_wrapper table:has(th[aria-label*="Scenario Channel"]) {
  table-layout: fixed !important;
}

.dt-scroll-head table:has(th[aria-label*="Scenario Channel"]) {
  table-layout: fixed !important;
  width: 100% !important;
}

.dt-scroll-body table:has(th[aria-label*="Scenario Channel"]) {
  table-layout: fixed !important;
  width: 100% !important;
}

/* Enable horizontal scrolling for DataTables headers */
.dataTables_wrapper .dt-scroll-head {
  overflow: auto !important;
}

/* Sync header and body scroll positions */
.dataTables_wrapper .dt-scroll-head {
  scrollbar-width: thin !important;
}

/* Force header cells to maintain consistent sizing */
table:has(th[aria-label*="Scenario Channel"]) th {
  padding: 8px !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  min-width: auto !important;
}

table:has(th[aria-label*="Scenario Channel"]) td {
  padding: 8px !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  min-width: auto !important;
}

/* Additional DataTables alignment fixes - only for Scenario Channel tables */
.dataTables_wrapper:has(table:has(th[aria-label*="Scenario Channel"])) .dt-scroll-headInner,
.dataTables_wrapper:has(table:has(th[aria-label*="Scenario Channel"])) .dt-scroll-headInner table {
  width: 100% !important;
}

/* Ensure consistent header-body width synchronization - only for Scenario Channel tables */
.dataTables_wrapper:has(table:has(th[aria-label*="Scenario Channel"])) .dt-scroll-head table thead th {
  border-right: 1px solid #ddd !important;
}

.dataTables_wrapper:has(table:has(th[aria-label*="Scenario Channel"])) .dt-scroll-body table tbody td {
  border-right: 1px solid #ddd !important;
}

/* Bucket profile table specific column widths - only affects tables with Time Frame header */
/* Column 1: Empty header */
table:has(th[aria-label*="Time Frame"]) th:nth-child(1),
table:has(th[aria-label*="Time Frame"]) td:nth-child(1) {
  width: 2% !important;
  max-width: 2% !important;
  min-width: 2% !important;
}

/* Column 2: Id */
table:has(th[aria-label*="Time Frame"]) th:nth-child(2),
table:has(th[aria-label*="Time Frame"]) td:nth-child(2) {
  width: 3% !important;
  max-width: 3% !important;
  min-width: 3% !important;
}

/* Column 3: Profile Name */
table:has(th[aria-label*="Time Frame"]) th:nth-child(3),
table:has(th[aria-label*="Time Frame"]) td:nth-child(3) {
  width: 12% !important;
  max-width: 12% !important;
  min-width: 12% !important;
}

/* Column 4: Flow Guard Profile Refresh Period */
table:has(th[aria-label*="Time Frame"]) th:nth-child(4),
table:has(th[aria-label*="Time Frame"]) td:nth-child(4) {
  width: 10% !important;
  max-width: 10% !important;
  min-width: 10% !important;
}

/* Column 5: Volume Threshold */
table:has(th[aria-label*="Time Frame"]) th:nth-child(5),
table:has(th[aria-label*="Time Frame"]) td:nth-child(5) {
  width: 8% !important;
  max-width: 8% !important;
  min-width: 8% !important;
}

/* Column 6: Amount Threshold */
table:has(th[aria-label*="Time Frame"]) th:nth-child(6),
table:has(th[aria-label*="Time Frame"]) td:nth-child(6) {
  width: 8% !important;
  max-width: 8% !important;
  min-width: 8% !important;
}

/* Column 7: Lower Threshold */
table:has(th[aria-label*="Time Frame"]) th:nth-child(7),
table:has(th[aria-label*="Time Frame"]) td:nth-child(7) {
  width: 8% !important;
  max-width: 8% !important;
  min-width: 8% !important;
}

/* Column 8: Query Script */
table:has(th[aria-label*="Time Frame"]) th:nth-child(8),
table:has(th[aria-label*="Time Frame"]) td:nth-child(8) {
  width: 15% !important;
  max-width: 15% !important;
  min-width: 15% !important;
}

/* Column 9: Time Frame */
table:has(th[aria-label*="Time Frame"]) th:nth-child(9),
table:has(th[aria-label*="Time Frame"]) td:nth-child(9) {
  width: 4% !important;
  max-width: 4% !important;
  min-width: 4% !important;
}

/* Column 10: Message Type */
table:has(th[aria-label*="Time Frame"]) th:nth-child(10),
table:has(th[aria-label*="Time Frame"]) td:nth-child(10) {
  width: 8% !important;
  max-width: 8% !important;
  min-width: 8% !important;
}

/* Column 11: Flow Guard Profile Type */
table:has(th[aria-label*="Time Frame"]) th:nth-child(11),
table:has(th[aria-label*="Time Frame"]) td:nth-child(11) {
  width: 9% !important;
  max-width: 9% !important;
  min-width: 9% !important;
}

/* Column 12: Status */
table:has(th[aria-label*="Time Frame"]) th:nth-child(12),
table:has(th[aria-label*="Time Frame"]) td:nth-child(12) {
  width: 6% !important;
  max-width: 6% !important;
  min-width: 6% !important;
}

/* Column 13: Running Schedule */
table:has(th[aria-label*="Time Frame"]) th:nth-child(13),
table:has(th[aria-label*="Time Frame"]) td:nth-child(13) {
  width: 9% !important;
  max-width: 9% !important;
  min-width: 9% !important;
}

/* Column 14: Actions (empty header) */
table:has(th[aria-label*="Time Frame"]) th:nth-child(14),
table:has(th[aria-label*="Time Frame"]) td:nth-child(14) {
  width: 7% !important;
  max-width: 7% !important;
  min-width: 7% !important;
}

/* DataTables header-to-row alignment fixes for Time Frame tables */
table:has(th[aria-label*="Time Frame"]) {
  table-layout: fixed !important;
  width: 100% !important;
}

/* DataTables scroll container fixes for header alignment */
.dataTables_wrapper table:has(th[aria-label*="Time Frame"]) {
  table-layout: fixed !important;
}

.dt-scroll-head table:has(th[aria-label*="Time Frame"]) {
  table-layout: fixed !important;
  width: 100% !important;
}

.dt-scroll-body table:has(th[aria-label*="Time Frame"]) {
  table-layout: fixed !important;
  width: 100% !important;
}

/* Force header cells to maintain consistent sizing */
table:has(th[aria-label*="Time Frame"]) th {
  padding: 8px !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  min-width: auto !important;
}

table:has(th[aria-label*="Time Frame"]) td {
  padding: 8px !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  min-width: auto !important;
}

/* Additional DataTables alignment fixes - only for Time Frame tables */
.dataTables_wrapper:has(table:has(th[aria-label*="Time Frame"])) .dt-scroll-headInner,
.dataTables_wrapper:has(table:has(th[aria-label*="Time Frame"])) .dt-scroll-headInner table {
  width: 100% !important;
}

/* Ensure consistent header-body width synchronization - only for Time Frame tables */
.dataTables_wrapper:has(table:has(th[aria-label*="Time Frame"])) .dt-scroll-head table thead th {
  border-right: 1px solid #ddd !important;
}

.dataTables_wrapper:has(table:has(th[aria-label*="Time Frame"])) .dt-scroll-body table tbody td {
  border-right: 1px solid #ddd !important;
}

/* Screen-specific Select2 dropdown width fix for bucket profile and report template pages */
/* Make Select2 dropdown match the width of userDepartment select (bucket profile) or departments select (report template) */
body:has(#bucketProfileForm) .select2-dropdown,
body:has(#bucketProfileForm) .select2-container--open .select2-dropdown,
body:has(#reportTemplateForm) .select2-dropdown,
body:has(#reportTemplateForm) .select2-container--open .select2-dropdown {
  width: var(--departments-width, 100%) !important;
  min-width: var(--departments-width, 100%) !important;
}

/* Make Related Messages column minimum width to fit header text in flow_analytics.html and fund_analytics.html */
/* Target tables with id="example" that have Related Messages as first column (both analytics pages use this) */
table#example th:first-child {
  width: 1% !important;
  white-space: normal !important;
  min-width: 55px !important;
  max-width: 55px !important;
  word-wrap: break-word !important;
  line-height: 1.2 !important;
}

table#example td:first-child {
  width: 1% !important;
  white-space: nowrap !important;
  min-width: 55px !important;
  max-width: 55px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Apply table layout to ensure consistent column widths */
table#example {
  table-layout: auto !important;
}

/* Override table layout for data integration source page only */
body:has(script[src*="data_integration_source"]) table#example {
  table-layout: fixed !important;
  width: 100% !important;
}

/* Data Integration Source table column widths for data_integration_source.html */
/* Use page-specific targeting to avoid conflicts with other tables */
/* Note: ID column (1st) is hidden via DataTables JavaScript, so visible columns are 2-7 in HTML but 1-6 in CSS nth-child */

/* Table Name column (1st visible = nth-child(1)) */
body:has(script[src*="data_integration_source"]) table#example th:nth-child(1),
body:has(script[src*="data_integration_source"]) table#example td:nth-child(1) {
  width: 24% !important;
  min-width: 120px !important;
  max-width: none !important;
  white-space: normal !important;
  text-align: left !important;
}

/* Merging Field column (2nd visible = nth-child(2)) */
body:has(script[src*="data_integration_source"]) table#example th:nth-child(2),
body:has(script[src*="data_integration_source"]) table#example td:nth-child(2) {
  width: 21% !important;
  min-width: 90px !important;
  white-space: normal !important;
  text-align: left !important;
}

/* Indexed Field column (3rd visible = nth-child(3)) */
body:has(script[src*="data_integration_source"]) table#example th:nth-child(3),
body:has(script[src*="data_integration_source"]) table#example td:nth-child(3) {
  width: 21% !important;
  min-width: 90px !important;
  white-space: normal !important;
  text-align: left !important;
}

/* FCT column (4th visible = nth-child(4)) */
body:has(script[src*="data_integration_source"]) table#example th:nth-child(4),
body:has(script[src*="data_integration_source"]) table#example td:nth-child(4) {
  width: 8% !important;
  min-width: 50px !important;
  max-width: 70px !important;
  white-space: nowrap !important;
  text-align: center !important;
}

/* Index Management column (5th visible = nth-child(5)) */
body:has(script[src*="data_integration_source"]) table#example th:nth-child(5),
body:has(script[src*="data_integration_source"]) table#example td:nth-child(5) {
  width: 12% !important;
  min-width: 80px !important;
  max-width: 100px !important;
  white-space: nowrap !important;
  text-align: center !important;
}

/* Actions column (6th visible = nth-child(6)) */
body:has(script[src*="data_integration_source"]) table#example th:nth-child(6),
body:has(script[src*="data_integration_source"]) table#example td:nth-child(6) {
  width: 12% !important;
  min-width: 220px !important;
  max-width: 300px !important;
  white-space: nowrap !important;
  text-align: center !important;
}


/* ===== CODEMIRROR THEME INTEGRATION ===== */

/* CodeMirror placeholder styling */
.CodeMirror-placeholder {
  color: rgba(128, 128, 128, 0.99) !important;
  font-style: italic !important;
}

/* Enhanced CodeMirror styling */
.CodeMirror {
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  line-height: 1.5;
  height: auto;
  min-height: 200px;
}

.CodeMirror:hover {
  border-color: var(--primary-blue);
  transition: border-color 0.2s ease;
}

.CodeMirror-focused {
  border-color: var(--primary-blue) !important;
  box-shadow: 0 0 0 0.2rem rgba(35, 57, 91, 0.25);
}

/* Active line highlighting */
.CodeMirror-activeline-background {
  background: rgba(35, 57, 91, 0.1);
}

/* Line number styling */
.CodeMirror-linenumber {
  color: var(--text-muted);
}

.CodeMirror-gutters {
  background: var(--page-bg);
  border-right: 1px solid #ddd;
}

/* Bracket matching */
.CodeMirror-matchingbracket {
  background: rgba(35, 57, 91, 0.3);
  color: inherit !important;
}

/* Modern SQL Syntax Highlighting - Optimized for Readability */
.CodeMirror .cm-keyword, .CodeMirror.cm-s-default .cm-keyword { 
  color: #5e72e4 !important;  /* Vibrant purple-blue for SQL keywords */
  font-weight: 600 !important; 
}
.CodeMirror .cm-atom, .CodeMirror.cm-s-default .cm-atom { 
  color: #f5365c !important;  /* Bright red for TRUE/FALSE/NULL */
}
.CodeMirror .cm-number, .CodeMirror.cm-s-default .cm-number { 
  color: #fb6340 !important;  /* Warm orange for numbers */
  font-weight: 500 !important;
}
.CodeMirror .cm-def, .CodeMirror.cm-s-default .cm-def { 
  color: #e86a0f !important;  /* Cyan for function definitions */
  font-weight: 600 !important; 
}
.CodeMirror .cm-variable, .CodeMirror.cm-s-default .cm-variable { 
  color: #32325d !important;  /* Dark gray for variables */
}
.CodeMirror .cm-variable-2, .CodeMirror.cm-s-default .cm-variable-2 { 
  color: #8965e0 !important;  /* Purple for table/column references */
}
.CodeMirror .cm-variable-3, .CodeMirror.cm-s-default .cm-variable-3 { 
  color: #2dce89 !important;  /* Green for special variables */
}
.CodeMirror .cm-comment, .CodeMirror.cm-s-default .cm-comment { 
  color: #8898aa !important;  /* Muted gray for comments */
  font-style: italic !important;
  opacity: 0.8 !important;
}
.CodeMirror .cm-string, .CodeMirror.cm-s-default .cm-string { 
  color: #8b5a3c !important;  /* Warm brown for string literals - easy on eyes */
}
.CodeMirror .cm-string-2, .CodeMirror.cm-s-default .cm-string-2 { 
  color: #d68910 !important;  /* Darker orange for special strings */
}
.CodeMirror .cm-builtin, .CodeMirror.cm-s-default .cm-builtin { 
  color: #11cdef !important;  /* Cyan for built-in functions */
  font-weight: 500 !important; 
}
/* Rainbow parentheses - matching pairs get same color, nested pairs get different colors */
.CodeMirror .cm-bracket {
  font-weight: normal !important;
  font-size: 1em !important;
}

/* Level 1 parentheses - outermost */
.CodeMirror .cm-bracket-level-0 {
  color: #e74c3c !important; /* Red */
}

/* Level 2 parentheses */  
.CodeMirror .cm-bracket-level-1 {
  color: #f39c12 !important; /* Orange */
}

/* Level 3 parentheses */
.CodeMirror .cm-bracket-level-2 {
  color: #27ae60 !important; /* Green */
}

/* Level 4 parentheses */
.CodeMirror .cm-bracket-level-3 {
  color: #3498db !important; /* Blue */
}

/* Level 5 parentheses */
.CodeMirror .cm-bracket-level-4 {
  color: #9b59b6 !important; /* Purple */
}

/* Level 6+ parentheses - cycles back to red */
.CodeMirror .cm-bracket-level-5 {
  color: #e67e22 !important; /* Dark orange */
}

/* Fallback for any brackets without specific level classes */
.CodeMirror .cm-bracket,
.CodeMirror.cm-s-default .cm-bracket,
.CodeMirror-line .cm-bracket,
.CodeMirror span.cm-bracket {
  color: #e74c3c !important; /* Default red */
  font-weight: normal !important;
  font-size: 1em !important;
}

/* Enhanced bracket matching highlighting */
.CodeMirror-matchingbracket {
  background-color: rgba(231, 76, 60, 0.2) !important;
  color: inherit !important;
  border: 1px solid rgba(231, 76, 60, 0.5) !important;
  border-radius: 2px !important;
}

.CodeMirror-nonmatchingbracket {
  background-color: rgba(231, 76, 60, 0.3) !important;
  color: #e74c3c !important;
  border: 1px solid #e74c3c !important;
  border-radius: 2px !important;
}
.CodeMirror .cm-operator, .CodeMirror.cm-s-default .cm-operator { 
  color: #5e72e4 !important;  /* Purple-blue for operators */
  font-weight: 500 !important;
}
.CodeMirror .cm-meta, .CodeMirror.cm-s-default .cm-meta { 
  color: #f5365c !important;  /* Red for metadata */
}
.CodeMirror .cm-qualifier, .CodeMirror.cm-s-default .cm-qualifier {
  color: #8965e0 !important;  /* Purple for qualifiers */
}

/* ============================================================
   Filter Bar Theme (global)
   Shared "quick-card" filter bar used by cases/manage,
   list_notification, case_dashboard, and any new screen.
   Markup contract per category:
     .filter-select-wrapper[data-category]
       > label
       > .filter-search-box > i.fa-search + input.filter-search-input
       > select#<cat>Filter (hidden, source of truth)
       > .filter-quick-cards#<cat>QuickCards > .filter-quick-card[.<color>][.active]
   Screens may override per-screen bits locally (e.g. label colour,
   .filter-quick-cards max-height). See docs/filter-theme-guide.md.
   ============================================================ */

/* --- Column wrapper --- */
.filter-select-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    min-width: 0;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 8px 10px;
    border: 1px solid #e9ecef;
}
.filter-select-wrapper > label:first-child { margin-bottom: 6px; }

/* --- Per-column search box (magnifier inside) --- */
.filter-search-box { position: relative; display: flex; align-items: center; }
.filter-search-box > i.fa-search {
    position: absolute; left: 8px; color: #999; font-size: 11px; pointer-events: none;
}
.filter-search-input {
    width: 100%;
    border: 1px solid #d2d6de;
    border-radius: 4px;
    padding: 6px 8px 6px 26px;
    font-size: 11px;
    background: #fff;
    outline: none;
}
.filter-search-input:focus { border-color: #3c8dbc; box-shadow: 0 0 3px rgba(60,141,188,0.2); }
.filter-search-input::placeholder { color: #aaa; }

/* --- Plain text input variant (no icon): free-text search / date range --- */
.filter-text-input {
    width: 100%; border: 1px solid #d2d6de; border-radius: 4px;
    padding: 4px 8px; font-size: 11px; background: #fff; outline: none; margin-bottom: 3px;
}
.filter-text-input:focus { border-color: #3c8dbc; box-shadow: 0 0 3px rgba(60,141,188,0.2); }
.filter-text-input::placeholder { color: #aaa; }

/* --- Stacked quick-filter cards container --- */
.filter-quick-cards {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #dee2e6;
    max-height: 150px;
    overflow-y: auto;
}
.filter-quick-cards::-webkit-scrollbar { width: 4px; }
.filter-quick-cards::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* --- Individual pill --- */
.filter-quick-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 10px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    background: #f0f0f0;
    color: #555;
    width: 100%;
    box-sizing: border-box;
}
.filter-quick-card:hover { box-shadow: 0 1px 3px rgba(0,0,0,0.1); filter: brightness(0.95); }
.filter-quick-card.active {
    border: 2px solid currentColor;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}
.filter-quick-card.active .selected-check { margin-right: 4px; font-size: 9px; }
.filter-quick-card .card-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-quick-card .count-badge {
    background: rgba(0,0,0,0.1);
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 9px;
    flex-shrink: 0;
}

/* --- Neutral pill (default for categories with no semantic colour) --- */
.filter-quick-card.neutral { background: #f3f4f6; color: #374151; }
.filter-quick-card.neutral.active { background: #dbeafe; color: #1e40af; border-color: #3b82f6; }

/* --- Status colours --- */
.filter-quick-card.status-NEW,
.filter-quick-card.status-OPEN,
.filter-quick-card.status-REOPENED { background: #c8e6d0; color: #2d5a3d; }
.filter-quick-card.status-IN_TRIAGE { background: #c5d9f0; color: #2a4a70; }
.filter-quick-card.status-UNDER_INVESTIGATION { background: #f5ebb8; color: #6a5a20; }
.filter-quick-card.status-ESCALATED { background: #f5d8b8; color: #7a4a20; }
.filter-quick-card.status-PENDING_INFO { background: #e0d0f0; color: #5a3a7a; }
.filter-quick-card.status-QA_REVIEW { background: #b8e8e0; color: #2a5a55; }
.filter-quick-card.status-SAR_DRAFTING { background: #c5d9f0; color: #2a4a70; }
.filter-quick-card.status-SAR_PENDING_APPROVAL { background: #c8c5f0; color: #3a3a7a; }
.filter-quick-card.status-SAR_FILED { background: #d0d0f0; color: #3a3a6a; }
.filter-quick-card.status-CLOSED,
.filter-quick-card.status-DISMISSED,
.filter-quick-card.status-FINAL { background: #d86060; color: #5a1010; }
.filter-quick-card.status-CLOSED_TRUE_POSITIVE { background: #d86868; color: #5a1010; }
.filter-quick-card.status-CLOSED_TRUE_POSITIVE .card-label,
.filter-quick-card.status-CLOSED_TRUE_POSITIVE .count-badge { color: #5a1010 !important; }
.filter-quick-card.status-CLOSED_FALSE_POSITIVE { background: #e08888; color: #6a1818; }
.filter-quick-card.status-CLOSED_INCONCLUSIVE { background: #d87070; color: #5a1414; }
.filter-quick-card.status-CLOSED_AUTO_CLOSED { background: #d47878; color: #5a1818; }

/* --- Risk band colours (case list and case dashboard) --- */
.filter-quick-card.risk-band-Prohibited { background: #fecaca; color: #991b1b !important; }
.filter-quick-card.risk-band-Prohibited .count-badge { background: rgba(153,27,27,0.15); }
.filter-quick-card.risk-band-Prohibited span { color: #991b1b !important; }
.filter-quick-card.risk-band-High { background: #fed7aa; color: #9a3412 !important; }
.filter-quick-card.risk-band-High span { color: #9a3412 !important; }
.filter-quick-card.risk-band-Medium { background: #fef08a; color: #854d0e !important; }
.filter-quick-card.risk-band-Medium span { color: #854d0e !important; }
.filter-quick-card.risk-band-Low { background: #bbf7d0; color: #166534 !important; }
.filter-quick-card.risk-band-Low span { color: #166534 !important; }
.filter-quick-card.risk-band-Unscored { background: #f3f4f6; color: #6b7280; }
/* The AI score tiers, coloured like the AI badges in the case list */
.filter-quick-card.llm-red { background: #fecaca; color: #991b1b !important; }
.filter-quick-card.llm-red span { color: #991b1b !important; }
.filter-quick-card.llm-amber { background: #fef08a; color: #854d0e !important; }
.filter-quick-card.llm-amber span { color: #854d0e !important; }
.filter-quick-card.llm-green { background: #bbf7d0; color: #166534 !important; }
.filter-quick-card.llm-green span { color: #166534 !important; }

/* The Risk Studio bands, most severe first, with their full names: they wrap onto a second line rather
   than being cut to "Pr…"/"H…" in a narrow filter column; fired rules follow below */
.risk-band-row { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
.risk-band-row .risk-band-chip { flex: 1 1 calc(50% - 4px); min-width: 0; justify-content: center; padding: 4px 8px; }
.risk-band-row .risk-band-chip .card-label { flex: 0 0 auto; font-weight: 600; white-space: nowrap; }
.risk-llm-row .risk-band-chip { flex: 0 0 auto; padding: 4px 10px; }
.filter-quick-card.risk-band-empty { opacity: 0.4; cursor: default; box-shadow: none; filter: none; }
.risk-rules-caption { width: 100%; margin: 4px 0 0; font-size: 10px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.03em; }
.risk-band-badge { font-size: 11px; padding: 3px 8px; border-radius: 3px; font-weight: 600; display: inline-block; }
.risk-band-badge.risk-band-Prohibited { background: #fecaca; color: #991b1b; }
.risk-band-badge.risk-band-High { background: #fed7aa; color: #9a3412; }
.risk-band-badge.risk-band-Medium { background: #fef08a; color: #854d0e; }
.risk-band-badge.risk-band-Low { background: #bbf7d0; color: #166534; }

/* --- Workflow colours (cycled by index in JS) --- */
.filter-quick-card.workflow-color-1 { background: #c5d9f0; color: #2a4a70; }
.filter-quick-card.workflow-color-1.active { background: #a3c4e8; color: #1d3a5c; border-color: #4a90d9; }
.filter-quick-card.workflow-color-2 { background: #e0d0f0; color: #5a3a7a; }
.filter-quick-card.workflow-color-2.active { background: #cbb8e6; color: #4a2a6a; border-color: #9b6dd7; }
.filter-quick-card.workflow-color-3 { background: #b8e8e0; color: #2a5a55; }
.filter-quick-card.workflow-color-3.active { background: #96ddd2; color: #1f4a45; border-color: #4dbfb0; }
.filter-quick-card.workflow-color-4 { background: #f5d8b8; color: #7a4a20; }
.filter-quick-card.workflow-color-4.active { background: #f0c49a; color: #6a3a15; border-color: #e0a060; }
.filter-quick-card.workflow-color-5 { background: #f0c8c8; color: #7a3a3a; }
.filter-quick-card.workflow-color-5.active { background: #e8aeae; color: #6a2a2a; border-color: #d97070; }
.filter-quick-card.workflow-color-6 { background: #c8e6d0; color: #2d5a3d; }
.filter-quick-card.workflow-color-6.active { background: #a8d8b8; color: #1f4a2d; border-color: #5cb87a; }
/* ===== end Filter Bar Theme ===== */