.site-header {
  background-color: #ffffff;
  padding: 1.5rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* optional soft shadow */
  z-index: 1040 !important; /* below modals (1050+) but above content */
  position: sticky; /* stay visible at top while scrolling */
  top: 0;
  transition: filter 0.3s ease;
}

/* Partners-matching page canvas (theme toggle; CRM still defaults via crm-theme.js) */
[data-bs-theme="dark"] body {
  background: #08151d !important;
}
[data-bs-theme="light"] body {
  background: #ffffff !important;
}

/* Partners global.css: force text-muted to white in dark mode (critical for notifications) */
[data-bs-theme="dark"] .text-muted {
  color: #ffffff !important;
}

/* Blur header when modal is open */
.site-header.modal-open-blur {
  filter: blur(3px);
  pointer-events: none;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Make header layout consistent across zoom/very wide screens:
     prevent Bootstrap .container from centering and increasing the left/right gaps. */
  max-width: 100% !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.site-header .header-right {
  flex: 0 0 auto;
}
#siteLogo {
  margin-left: 6rem !important;
}

body > div > header > div > div.header-right.d-flex.align-items-center.gap-2 {
    margin-right: 6rem !important;
}



.site-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--bs-body-color);
  margin: 0;
}

/* ─── Base Nav Link Layout ─── */
.nav-icons {
  gap: 2rem;
}

.nav-icons .nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1rem;
  color: var(--bs-body-color-secondary);
  padding: 0.75rem 0;
  transition: color 0.2s;
}

.nav-icons .nav-link .bi {
  font-size: 1.6rem;
  margin-bottom: 0.3rem;
}

.nav-icons .nav-link.active {
  color: var(--bs-primary);
  font-weight: 600;
}

.nav-icons .nav-link.active .bi {
  color: var(--bs-primary);
}

.nav-icons .nav-link.active::after {
  content: "";
  display: block;
  width: 1.75rem;
  height: 3px;
  background: var(--bs-primary);
  margin-top: 0.3rem;
  border-radius: 2px;
}

/* Logout Icon Consistency */
.user-icon {
  padding: 0.25rem;
  margin-left: 0.5rem;
}

.user-icon i {
  font-size: 1.5rem;
  color: #dc3545;
}

.site-header,
.navbar,
.site-header .container {
  border-bottom: none !important;
  box-shadow: none !important;
}

/* ─── Dark Mode Toggle Switch Styling ─── */
.theme-toggle input#themeToggle {
  display: none;
}

#themeToggle + .toggle-track {
  position: relative;
  width: 62px;
  height: 29px;
  background: var(--bs-border-color);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  cursor: pointer;
  transition: background 0.3s;
}

#themeToggle + .toggle-track .bi {
  color: #000;
  font-size: 1rem;
}

#themeToggle + .toggle-track .toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: var(--bs-body-bg);
  border-radius: 50%;
  transition: transform 0.3s;
}

#themeToggle:checked + .toggle-track {
  background: #00baff !important; 
}

#themeToggle:checked + .toggle-track .bi {
  color: #fff;
}

#themeToggle:checked + .toggle-track .toggle-thumb {
  transform: translateX(32px);
}

/* ─── Dark Mode Support for Header ─── */
[data-bs-theme="dark"] .site-header {
  /* background-color: var(--bs-body-bg) !important; */
  background-color: #08151d !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

[data-bs-theme="dark"] .site-title {
  color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .nav-icons .nav-link {
  color: var(--bs-body-color-secondary) !important;
}

[data-bs-theme="dark"] .nav-icons .nav-link.active,
[data-bs-theme="dark"] .nav-icons .nav-link.active .bi {
  color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .user-icon i {
  color: #f87171 !important; /* lighter red for dark bg */
}

.modal {
  display: none;
  position: fixed;
  z-index: 1055;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  /* background-color: rgba(0, 0, 0, 0.5); */
}

.modal-content {
  margin: 5% auto;
  padding: 30px;
  width: 95%;
  max-width: 1200px;
  border-radius: 10px;
  position: relative;
  box-shadow:rgba(0, 0, 0, 0.08) !important;
  animation: fadeIn 0.3s ease;
  /* Prevent any horizontal overflow inside modals */
  overflow-x: hidden;
}

[data-bs-theme="dark"] .modal-content {
  background-color: #08151d !important;
  margin: 5% auto;
  padding: 30px;
  width: 95%;
  max-width: 1200px;
  border-radius: 10px;
  position: relative;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6) !important;
  animation: fadeIn 0.3s ease;
  /* Prevent any horizontal overflow inside modals */
  overflow-x: hidden;

}

/* Two-column layout for modals with comments */
.modal-with-comments {
  display: flex;
  flex-direction: row;
  gap: 15px;
  height: 80vh;
  overflow: hidden; /* Prevent horizontal scroll */
}

.modal-with-comments .modal-main {
  flex: 1 1 55%;
  overflow-y: auto;
  max-height: 80vh;
  height: 80vh; /* Fill column so footer can anchor at bottom even with short content */
  min-width: 0; /* Allow flex item to shrink below content size */
  /* Avoid horizontal scrollbars in the left pane */
  overflow-x: hidden;
}

/* Make forms inside the left pane a flex column so the footer can push down */
.modal-with-comments .modal-main form {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Sticky action bar inside scrollable modal panes */
[data-bs-theme="light"] .modal-with-comments .modal-main .modal-sticky-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 12px 0;
  background: #08151d;
  border-top: 1px;
  margin-top: auto; /* push to bottom when content is short */
}


[data-bs-theme="light"] .modal-with-comments .modal-main .modal-sticky-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 12px 0;
  background: #f0f0f0;
  border-top: 1px;
  margin-top: auto; /* push to bottom when content is short */
}












.modal-with-comments .modal-comments {
  flex: 1 1 35%;
  border-left: 1px solid var(--bs-border-color);
  padding-left: 15px;
  display: flex;
  flex-direction: column;
  height: 80vh;
  min-width: 0; /* Allow flex item to shrink below content size */
}

/* Chat-like comments container */
[data-bs-theme="dark"] .comments-chat-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden; /* Avoid horizontal scroll due to long content */
  padding: 10px;
  background: #08151d;
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  margin-bottom: 15px;
}


[data-bs-theme="light"] {
    flex: 1;
  overflow-y: auto;
  overflow-x: hidden; /* Avoid horizontal scroll due to long content */
  background: #fbfbfb;  
    border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  margin-bottom: 15px;
}





















.comment-item {
  margin-bottom: 15px;
  padding: 10px;
  background: var(--bs-secondary-bg);
  border-radius: 8px;
  border: 1px solid var(--bs-border-color);
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
}

.comment-item .comment-text {
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  max-width: 100%;
}

.comment-item .comment-actions {
  text-align: right;
  margin-top: 8px;
}

.comment-item .comment-actions .btn {
  padding: 4px 8px;
  margin-left: 5px;
  border: none;
  background: transparent;
  font-size: 14px;
}

.comment-item .comment-actions .btn:hover {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

/* Highlight @mentions */
.comment-item .comment-text .mention {
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 500;
}

.comment-item.own-comment {
  background: var(--bs-primary-bg-subtle);
  border-color: var(--bs-primary-border-subtle);
}

.comment-input-section {
  flex-shrink: 0;
}

/* Mention suggestions dropdown */
.mention-suggestions {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 4px;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  max-height: 150px;
  overflow-y: auto;
  z-index: 1000;
  margin-bottom: 5px;
}

.mention-suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--bs-border-color);
}

.mention-suggestion-item:hover,
.mention-suggestion-item.active {
  background: var(--bs-primary-bg-subtle);
}

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

.modal .close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 22px;
  cursor: pointer;
}

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

/* ──────────────────────────────────────────────────────────────────────────────
   Global: Hide scrollbars (keep scrolling functional)
   Applies broadly so vertical scrollbars are not visible across the app.
   Cross-browser support: WebKit, Firefox, Legacy Edge/IE.
────────────────────────────────────────────────────────────────────────────── */
/* Firefox */

.close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 4rem;
  font-weight: bold;
  color: #000;
  cursor: pointer;
  z-index: 9999;
  padding: 10px;
}
.close:hover {
  color: #dc3545;
  transform: scale(1.1);
  transition: all 0.2s ease-in-out;
}

/* Make table headers and background adapt to dark mode */
[data-bs-theme="dark"] .table thead {
  /* background-color: var(--bs-gray-800); */
  background-color: #08151d !important;
  color: var(--bs-gray-100);
}






select.country-flag-select option {
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 20px 15px;
  padding-left: 26px;
}

select.country-flag-select option[data-flag] {
  background-image: none; /* Remove fallback */
}

.select2-results__option[data-flag]::before,
.select2-selection__rendered[data-flag]::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 15px;
  background-size: cover;
  background-repeat: no-repeat;
  margin-right: 8px;
  vertical-align: middle;
}

/* Global table styles - used across multiple modules */
/* .tabela {
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
  border: 1px solid #ddd;
}

.tabela a {
  color: black;
}

.tabela th,
.tabela td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: left;
}

.tabela th {
  background-color: #f4f4f4;
  white-space: nowrap;
}


.tabela tr:hover {
  background-color: #e0e0e0;
  cursor: pointer;
  transition: background-color 0.3s ease-in-out;
} */


/* Global dropdown submenu styles - used in multiple headers */
.nav-tabs .dropdown-menu {
  position: absolute !important;
}

.dropdown-submenu {
  position: relative;
}

.dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -1px;
  display: none;
  position: absolute;
  z-index: 1050;
}

.dropdown-submenu:hover > .dropdown-menu {
  display: block;
}

/* Global DataTables dark mode styles - used across modules */
body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button {
  background-color: #333 !important;
  color: #fff !important;
  border: 1px solid #666;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background-color: #444 !important;
}

body.dark-mode
  .dataTables_wrapper
  .dataTables_paginate
  .paginate_button.current {
  background-color: #007bff !important;
  border-color: #007bff;
}

body.dark-mode
  .dataTables_wrapper
  .dataTables_paginate
  .paginate_button.disabled {
  background-color: #555 !important;
  color: #999 !important;
  border-color: #555;
}

/* Global utility classes - used across multiple modules */
.status-badge {
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
}

.attachment-list {
  max-height: 200px;
  overflow-y: auto;
}

.file-row {
  padding: 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.audit-filter {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* Cross-cutting project styles used by multiple modules */

/* Project specific cards - used across modules */
.card-blue {
  border-left: 4px solid #0d6efd;
}
.card-green {
  border-left: 4px solid #198754;
}
.card-orange {
  border-left: 4px solid #fd7e14;
}
.card-lightblue {
  border-left: 4px solid #0dcaf0;
}


/* Theme toggle - used across modules */
.theme-toggle {
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: 50%;
}
.toggle-track {
  width: 40px;
  height: 20px;
  background: #6c757d;
  border-radius: 10px;
  position: relative;
}
.toggle-thumb {
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease;
}

/* Generic utility classes used across modules.
   Leave Bootstrap semantic badge colors alone so notification "New"/danger badges match Partners.
   Leave status-* pills (Wait-list, etc.) to their page CSS. */
.badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
}
.badge:not(.bg-primary):not(.bg-danger):not(.bg-success):not(.bg-warning):not(.bg-info):not(.bg-secondary):not(.notification-count):not([class*="status-"]) {
  background-color: #4a5a6e !important;
  color: white !important;
}
.badge-priority {
  text-transform: uppercase;
  font-weight: 600;
}
.avatar-lg {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

/* Generic button styles used across modules */
.deleteEmployeeBtn,
.editEmployeeBtn,
.editContractBtn,
.edit-task,
.delete-task {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
  text-decoration: none;
  margin: 0 0.25rem;
}

.deleteEmployeeBtn,
.delete-task {
  background: #dc3545;
  color: white;
}
.editEmployeeBtn,
.editContractBtn,
.edit-task {
  background: #0d6efd;
  color: white;
}

/* File handling used across modules */
.file-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Close button used across modules */
.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Responsive utilities for shared components */
@media (max-width: 768px) {
  .avatar-lg {
    width: 48px;
    height: 48px;
  }
  .card-blue,
  .card-green,
  .card-orange,
  .card-lightblue,
  .card-dark {
    border-left-width: 2px;
  }
}


/* 
.sidebar-toggle {
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: 0.25s ease;
  color: var(--text-primary);
  margin-left: 10rem;
  margin-top: 1.3rem;
} */








.sidebar-toggle:hover {
  background: rgba(0, 0, 0, 0.08); /* light mode */
}

:root[data-bs-theme="dark"] .sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.08); /* dark mode */
  background-color: #08151d !important;
  
}

/* ──────────── SIDEBAR ──────────── */



.sidebar {
  position: fixed;
  top: 0;
  left: -260px;
  width: 260px;
  height: 100%;
  background: var(--bs-body-bg);
  box-shadow: 2px 0 8px rgba(0,0,0,0.15);
  padding-top: 100px;
  transition: 0.3s ease;
  z-index: 2000;
}

.sidebar.open {
  left: 0;
}

.sidebar ul {
  list-style: none;
  padding-left: 20px;
}

.sidebar ul li {
  margin: 20px 0;
}

.sidebar ul li a {
  color: var(--bs-body-color);
  font-size: 1.1rem;
  text-decoration: none;
  display: flex;
  gap: 10px;
  align-items: center;
}

.sidebar ul li a:hover {
  color: var(--bs-primary);
}

/* Overlay dim background */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
  z-index: 1500;
}

.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Ensure overlay covers page when sidebar opens and darkens body
   Use the user's preferred color and make it block interactions.
*/
body.sidebar-open .sidebar-overlay {
  display: block;
  opacity: 1;
  visibility: visible;
  background: rgba(0, 0, 0, 0.5) !important; /* user-provided color */
  z-index: 1990; /* below .sidebar  (2000) but above page content */
  pointer-events: auto; /* block interactions with the page while open */
  transition: opacity 200ms ease-in-out;
  background: 200ms ease-in-out;
}

/* Disable pseudo-element overlay to avoid stacking two overlays */
body.sidebar-open::before { opacity: 0 !important; pointer-events: none !important; }


/* ────────────────────────────────────────────────
   FANCY TABLE SIDEBAR (250px)
──────────────────────────────────────────────── */
/* ────────────────────────────────────────────────
   UPGRADED SUPER CLEAN MINI-SIDEBAR DROPDOWN
──────────────────────────────────────────────── */
.sidebar-table {
  position: absolute;
  top: 100px; /* directly under icon */
  left: 0;
  width: 260px;

  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.05);

  padding: 6px 0;
  pointer-events: auto;
  z-index: 999999;

  /* Hidden state */
  display: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: 
      opacity .25s ease,
      transform .25s ease;
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);

  animation: dropdownFadeIn .3s ease forwards;
}

.sidebar-table.show {
  display: block !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Inner table reset */
.sidebar-table table {
  width: 100%;
  border-collapse: collapse;
}

.sidebar-table td {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

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

/* Row hover */
.sidebar-table tr:hover {
  background: rgba(0,0,0,0.04);
}

/* Link styles */
.sidebar-table a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 500;
  color: #111;
  transition: color .2s ease, transform .2s ease;
}

.sidebar-table a:hover {
  color: var(--bs-primary);
  transform: translateX(4px);
}

/* Icons inside sidebar */
.sidebar-table i {
  font-size: 1.3rem;
  opacity: .85;
  transition: opacity .2s ease;
}

.sidebar-table a:hover i {
  opacity: 1;
}

/* Dark mode version */
[data-bs-theme="dark"] .sidebar-table {
  background: rgba(30, 30, 30, 0.70);
  border-color: rgba(255,255,255,0.07);
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
}



[data-bs-theme="dark"] .sidebar-table tr:hover {
  background: rgba(255,255,255,0.06);
}

[data-bs-theme="dark"] .sidebar-table a {
  color: #e6e6e6;
}

[data-bs-theme="dark"] .sidebar-table a:hover {
  color: var(--bs-primary);
}

/* Fade animation */
@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.sidebar-table:not(.show) {
  pointer-events: none;
}




.sidebar-table {
    pointer-events: none;
}

.sidebar-table.show {
    pointer-events: auto;
    z-index: 99999;
}




/* Submenu container */
.submenu-row {
  display: none;
  background: var(--bs-body-bg);
}

.submenu-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.submenu-list li {
  padding: 10px 20px;
  /* border-bottom: 1px solid var(--bs-border-color); */
}

.submenu-list li a {
  text-decoration: none;
  font-size: 0.95rem;
  display: block;
  color: var(--bs-body-color);
}

.submenu-list li a:hover {
  color: var(--bs-primary);
}

/* Patients Row toggle icon */
.submenu-header a {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.submenu-arrow {
  transition: transform 0.25s ease;
}

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





/* FULL HEIGHT SIDEBAR */
.sidebar-vertical {
  position: fixed;
  top: 0;
  left: -20rem;      /* hidden initially */
  width: calc(268px + 8px); /* same outer width as the clinic sidebar, including its scrollbar */
  height: 100vh;
  background: #fbfbfb;
  border-right: 1px solid var(--bs-border-color);
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  transition: left 0.3s ease;
  z-index: 3000;     /* above all content */
}

[data-bs-theme="dark"] .sidebar-vertical {
  background: #08151d;
}

/* When sidebar is open */
.sidebar-vertical.open {
  left: 0;
}

.sidebar-vertical .menu {
  list-style: none;
  padding: 0;
  margin: 0;
}


.menu-link,
.menu-item > a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: var(--bs-body-color);
  text-decoration: none;
  cursor: pointer;
  font-weight: bold;
  color:white
}

.menu-link:hover,
.menu-item > a:hover {
  background: var(--bs-secondary-bg);
  color: var(--bs-primary);
  color:white;
  font-weight: bolder;
}

/* Submenu */
.submenu {
  display: none;
  background: var(--bs-body-bg); 

      

.submenu li a {
  display: block;
  padding: 10px 40px;
  color: var(--bs-body-color);
 
}
}

.submenu li a:hover {
  color: var(--bs-primary);
  color:white !important;
}

/* Submenu arrow animation */
.arrow {
  margin-left: auto;
  transition: transform .2s ease;
}

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








/* ADDED */


/* SIDEBAR TOGGLE ALWAYS ON TOP */
/* .sidebar-toggle {
    position: fixed !important;
    top: 24px !important;      /* adjust perfect position */
    /* left: 24px !important; */
    /* z-index: 999999 !important;  MUST BE ABOVE SIDEBAR */
    /* background: var(--bs-body-bg); */
    /* border-radius: 8px;
    padding: 6px; 
} */



.sidebar-vertical {
    z-index: 3000 !important; /* Sidebar lower */
}


/* 
#siteLogo{
  margin-left: 5rem;
} */



/* Make submenu style match main sidebar links */
.submenu {
    list-style: none !important;   /* No bullets */
    padding: 0 !important;
    margin: 0 !important;
    background: var(--bs-body-bg);
    border-top: none;
}

/* .submenu li {
    border-bottom: 1px solid var(--bs-border-color);
} */

/* Style submenu items EXACTLY like main menu items */
.submenu li a {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 14px 18px !important;
    font-size: 1.05rem;
    text-decoration: none;
    color: var(--bs-body-color);
    background: var(--bs-body-bg);
    transition: background 0.25s ease, color 0.25s ease;
}

/* Hover identical to main items */
.submenu li a:hover {
    background: var(--bs-secondary-bg);
    color: var(--bs-primary);
}

/* Remove any leftover indentation */
.menu-item.has-submenu .submenu li a {
    padding-left: 50px !important; /* Same indentation style as CRM sidebar */
    padding: 0.5rem 1.25rem 0.5rem 3rem !important;
}

/* Dark mode support */
[data-bs-theme="dark"] .submenu li a {
    background: #08151d;
    color: #8B949E;
    font-size: 14.4px;
}

[data-bs-theme="dark"] .submenu li a:hover {
    background: #08151daa !important;
    color: var(--bs-primary);
}











/* ALWAYS VISIBLE & ABOVE SIDEBAR */
.sidebar-toggle {
  /* default fallback if used outside header */
  position: fixed !important;
  top: 24px;
  left: 0; /* pinned to very left edge of the page */
  z-index: 999999 !important; /* stays above sidebar */
  color: var(--bs-body-color);
  background: var(--bs-body-bg);
  padding: 10px 12px;
  border-radius: 10px;
  transition: transform .25s ease, font-size .25s ease;
}

/* When sidebar is CLOSED */
.sidebar-toggle i {
    font-size: 2rem;          /* bigger */
    transform: rotate(180deg); /* reversed */
}

/* When the toggle lives inside the header, position it there so it doesn't scroll
   Uses a more specific selector to override the fixed rule above. */
.site-header .sidebar-toggle {
  position: absolute !important;
  left: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 2010 !important; /* sit above header content but below sidebar if needed */
  background: transparent !important;
  padding: 6px 8px !important;
}

/* When sidebar is OPEN */
.sidebar-open .sidebar-toggle i {
    font-size: 1.4rem;         /* smaller */
    transform: rotate(180deg);   /* normal */
}

/* Hover (optional) */
.sidebar-toggle:hover {
    background: var(--bs-secondary-bg);
}







/* 

header.site-header,
.site-header .container,
.header-left {
    position: static !important; /* REMOVE stacking context 
    z-index: auto !important;
}
*/


/*
.sidebar-toggle {
    position: fixed !important;
    top: 20px !important;
    left: 20px !important;
    z-index: 999999 !important;
} */




.sidebar-vertical .sidebar-header {
  position: relative;
  overflow: visible;
  padding-right: 0 !important;
}

#sidebarClose {
  position: relative;
  z-index: 10;
  margin-left: auto;
  flex-shrink: 0;
}

[data-bs-theme="dark"] #sidebarToggle i {
  font-size: 32px; 
  margin-left: 0; 
  color: var(--bs-link-color, #6ea8fe);
}

[data-bs-theme="light"] #sidebarToggle i {
  font-size: 32px; 
  margin-left: 0; 
  color: #979ca6;
}



[data-bs-theme="dark"] #sidebarToggle:hover i {
  color: var(--bs-link-hover-color, #8bb9fe);
}

[data-bs-theme="light"] #sidebarToggle:hover i {
  color: #0a58ca;
}




[data-bs-theme="dark"]{
  color:white;

}

[data-bs-theme="light"]{
  color:black !important;

}

#sidebarClose i{
  font-size: 24px;
}




/* When user clicks a header item */
.nav-icons .nav-link.active-clicked {
    color: #4da3ff !important;
    background: rgba(77, 163, 255, 0.18);
    border-radius: 10px;
    padding: 6px 12px;
}

/* Icon color */
.nav-icons .nav-link.active-clicked i {
    color: #4da3ff !important;
}






/* Main Finance submenu items */
.sidebar-vertical .submenu > li > a {
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #868b92; /* light gray */
    
}

/* Submenu headers (Partners, Invoices, Reports) */
.sidebar-vertical .submenu > li.has-submenu > .menu-link {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #7f848b !important;

}

[data-bs-theme="dark"] .sidebar-vertical .submenu > li.has-submenu > .menu-link {

    background-color: #08151d;

}









/* Hover effect (optional) */
.sidebar-vertical .submenu a:hover,
.sidebar-vertical .submenu .menu-link:hover {
    color: #58a6ff !important;  /* blue hover */
}


/* Finance submenu container */
.sidebar-vertical .menu-item .submenu > li > a,
.sidebar-vertical .menu-item .submenu > li > .menu-link {
    padding-left: 40px !important;  /* aligns all 5 main items */
    display: flex;
    align-items: center;
    gap: 8px;
}





/* Finance Level 3 */
.sidebar-vertical .submenu .submenu > li > a,
.sidebar-vertical .submenu .submenu > li > .menu-link {
    padding-left: 65px !important;
}




/* Highlight active menu item */
.sidebar-vertical .menu a.active,
.sidebar-vertical .menu-link.active {
    background-color: #0d355a !important;
    color: #ffffff !important;
    border-radius: 4px;
}

/* Active text color inside submenu */
.sidebar-vertical .submenu a.active {
    color: #ffffff !important;
}

/* Light-theme: highlight open/active menu-item background */
[data-bs-theme="light"] .sidebar-vertical .menu-item.open > .menu-link,
[data-bs-theme="light"] .sidebar-vertical .menu-item.open > a,
[data-bs-theme="light"] .sidebar-vertical .menu-item > .submenu a.active {
  background-color: #eff6ff !important;
  color: #023e96 !important;
}

[data-bs-theme="light"] .sidebar-vertical .menu-item.open > .menu-link .bi,
[data-bs-theme="light"] .sidebar-vertical .menu-item.open > a .bi,
[data-bs-theme="light"] .sidebar-vertical .menu-item > .submenu a.active .bi {
  color: #023e96 !important;
}

/* Dark-theme: selected/open sidebar dropdown */
[data-bs-theme="dark"] .sidebar-vertical .menu-item.open > .menu-link,
[data-bs-theme="dark"] .sidebar-vertical .menu-item.open > a,
[data-bs-theme="dark"] .sidebar-vertical .menu-item > .submenu a.active {
  background-color: #0d2840 !important;
  color: #58a6ff !important;
}

[data-bs-theme="dark"] .sidebar-vertical .menu-item.open > .menu-link .bi,
[data-bs-theme="dark"] .sidebar-vertical .menu-item.open > a .bi,
[data-bs-theme="dark"] .sidebar-vertical .menu-item > .submenu a.active .bi {
  color: #58a6ff !important;
}

/* Dark-theme: sidebar item hover */
[data-bs-theme="dark"] .menu .menu-link:hover,
[data-bs-theme="dark"] .menu a:hover,
[data-bs-theme="dark"] .menu .submenu a:hover,
[data-bs-theme="dark"] .sidebar-vertical .menu-link:hover,
[data-bs-theme="dark"] .sidebar-vertical .menu-item > a:hover {
  background-color: #172635 !important;
  color: #58a6ff !important;
}

[data-bs-theme="dark"] .menu .menu-link:hover .bi,
[data-bs-theme="dark"] .menu a:hover .bi,
[data-bs-theme="dark"] .menu .submenu a:hover .bi,
[data-bs-theme="dark"] .sidebar-vertical .menu-link:hover .bi,
[data-bs-theme="dark"] .sidebar-vertical .menu-item > a:hover .bi {
  color: #58a6ff !important;
}







/* Open submenu when a child is active */
.submenu a.active {
    display: block;
}

.submenu a.active {
    background-color: #0d355a !important;
}

/* Light theme overrides for header and sidebar clickable elements */
[data-bs-theme="light"] .site-header {
  background: #ffffff !important;
  color: #0b1220 !important;
  border-bottom: 1px solid #e5e7eb !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

[data-bs-theme="light"] .sidebar-vertical,
[data-bs-theme="light"] #sidebar.sidebar-vertical {
  background: #fbfbfb !important;
  background-color: #fbfbfb !important;
  color: #0b1220 !important;
  color-scheme: light;
  border-bottom: 1px solid #e5e7eb !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  scrollbar-color: rgba(2, 62, 150, 0.38) #fbfbfb;
}

[data-bs-theme="light"] .sidebar-vertical .menu,
[data-bs-theme="light"] .sidebar-vertical .sidebar-header,
[data-bs-theme="light"] .sidebar-vertical .submenu,
[data-bs-theme="light"] .sidebar-vertical .submenu li a {
  background: #fbfbfb !important;
  background-color: #fbfbfb !important;
}

#sidebar.sidebar-vertical {
  --crm-sb-bg: #fbfbfb;
  --crm-sb-text: #2d3748;
  --crm-sb-muted: #979ca6;
  --crm-sb-accent: #023e96;
  --crm-sb-border: rgba(2, 62, 150, 0.18);
  --crm-sb-hover: #eff6ff;
  --crm-sb-scroll-size: 8px;
  --crm-sb-scroll-track: #fbfbfb;
  --crm-sb-scroll-thumb: rgba(2, 62, 150, 0.38);
  --crm-sb-scroll-thumb-hover: rgba(2, 62, 150, 0.58);
  overflow-x: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--crm-sb-scroll-thumb) var(--crm-sb-scroll-track);
}

[data-bs-theme="dark"] #sidebar.sidebar-vertical {
  --crm-sb-bg: #08151d;
  --crm-sb-text: #e6edf3;
  --crm-sb-muted: #8b949e;
  --crm-sb-accent: #58a6ff;
  --crm-sb-border: rgba(88, 166, 255, 0.28);
  --crm-sb-hover: #172635;
  --crm-sb-scroll-track: #08151d;
  --crm-sb-scroll-thumb: rgba(88, 166, 255, 0.5);
  --crm-sb-scroll-thumb-hover: rgba(88, 166, 255, 0.75);
  scrollbar-color: var(--crm-sb-scroll-thumb) var(--crm-sb-scroll-track);
}

#sidebar.sidebar-vertical::-webkit-scrollbar {
  width: var(--crm-sb-scroll-size, 8px);
  height: var(--crm-sb-scroll-size, 8px);
}

#sidebar.sidebar-vertical::-webkit-scrollbar-track,
#sidebar.sidebar-vertical::-webkit-scrollbar-corner {
  background: var(--crm-sb-scroll-track, #fbfbfb);
  border-radius: 999px;
}

#sidebar.sidebar-vertical::-webkit-scrollbar-thumb {
  background: var(--crm-sb-scroll-thumb, rgba(2, 62, 150, 0.38));
  border-radius: 999px;
  border: 0;
}

#sidebar.sidebar-vertical::-webkit-scrollbar-thumb:hover {
  background: var(--crm-sb-scroll-thumb-hover, rgba(2, 62, 150, 0.58));
}

#sidebar.sidebar-vertical::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.sidebar-menu-tools {
  padding: 0 1rem 0.35rem;
}

.sidebar-search {
  margin: 0 0 0.75rem;
}

.sidebar-search-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--crm-sb-border, rgba(2, 62, 150, 0.18));
  border-radius: 0.7rem;
  background: var(--crm-sb-hover, #eff6ff);
  color: var(--crm-sb-accent, #023e96);
}

.sidebar-search-field:focus-within {
  border-color: var(--crm-sb-accent, #023e96);
}

.sidebar-search-field > .bi {
  font-size: 0.95rem;
  flex-shrink: 0;
  color: var(--crm-sb-accent, #023e96);
}

.sidebar-search-field input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0 !important;
  padding: 0;
  background: transparent !important;
  background-color: transparent !important;
  color: var(--crm-sb-text, #2d3748) !important;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  outline: none;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}

.sidebar-search-field input::placeholder {
  color: var(--crm-sb-muted, #979ca6);
  font-weight: 500;
  opacity: 1;
}

.sidebar-search-empty {
  margin: 0.2rem 0.15rem 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--crm-sb-muted, #979ca6);
}

.sidebar-filter-hidden {
  display: none !important;
}

.sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin: 0 0.1rem 0.35rem 0.15rem;
}

.sidebar-section-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--crm-sb-muted, #979ca6);
}

.sidebar-fold {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
}

.sidebar-fold-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--crm-sb-accent, #023e96);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.sidebar-fold-btn:hover,
.sidebar-fold-btn:focus-visible,
.sidebar-fold-btn.is-on {
  background: var(--crm-sb-hover, #eff6ff);
  color: var(--crm-sb-accent, #023e96);
  outline: none;
}

.sidebar-drag-handle {
  display: none;
}

#sidebar.sidebar-arranging #sidebarMenu > li.menu-item {
  position: relative;
}

#sidebar.sidebar-arranging #sidebarMenu > li.menu-item > .sidebar-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 0.2rem;
  top: 0.55rem;
  z-index: 2;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--crm-sb-accent, #023e96);
  cursor: grab;
}

#sidebar.sidebar-arranging #sidebarMenu > li.menu-item > a,
#sidebar.sidebar-arranging #sidebarMenu > li.menu-item > .menu-link {
  padding-left: 1.85rem;
}

#sidebar.sidebar-arranging #sidebarMenu > li.menu-item.is-dragging {
  opacity: 0.45;
}

#sidebar .sidebar-drag-handle,
#sidebar .sidebar-drag-handle .bi {
  color: var(--crm-sb-accent, #023e96) !important;
}


[data-bs-theme="light"] .site-header a.nav-link,
[data-bs-theme="light"] .site-header .nav-link,
[data-bs-theme="light"] .site-header .user-icon,
[data-bs-theme="light"] .menu .menu-link,
[data-bs-theme="light"] .menu a,
[data-bs-theme="light"] .menu .submenu a {
  color: inherit !important;
}

/* Hover background for clickable header/sidebar elements */
[data-bs-theme="light"] .site-header .nav-link:hover,
[data-bs-theme="light"] .site-header .nav-link:focus,
[data-bs-theme="light"] .menu .menu-link:hover,
[data-bs-theme="light"] .menu a:hover,
[data-bs-theme="light"] .menu .submenu a:hover,
[data-bs-theme="light"] .menu .submenu .menu-link:hover {
  background-color: #f9fbfd !important;
  transition: background-color 120ms ease-in-out;
}

/* Ensure toggle remains visible on light */
[data-bs-theme="light"] .toggle-track {
  background-color: dde3e9;
}

/* More specific light-theme sidebar/icon colors */
[data-bs-theme="light"] #sidebar .bi,
[data-bs-theme="light"] .menu .bi {
  color: #979ca6 !important; /* sidebar icons black */
}

#sidebar .sidebar-search-field > .bi,
#sidebar .sidebar-fold-btn,
#sidebar .sidebar-fold-btn .bi {
  color: var(--crm-sb-accent, #023e96) !important;
}

/* Sidebar item and subitem colors */
[data-bs-theme="light"] .menu > .menu-item > .menu-link,
[data-bs-theme="light"] .menu > li > a {
  color: #2d3748 !important; /* top-level items */
}

[data-bs-theme="light"] .menu .submenu a {
  color: #979ca6 !important; /* subitems */
}

/* Hover behavior for sidebar clickable elements */
[data-bs-theme="light"] .menu .menu-link:hover,
[data-bs-theme="light"] .menu a:hover,
[data-bs-theme="light"] .menu .submenu a:hover {
  background-color: #e5e7eb !important; /* hover bg */
  color: #023e96 !important; /* hover text/icon color */
}

[data-bs-theme="light"] .menu .menu-link:hover .bi,
[data-bs-theme="light"] .menu a:hover .bi,
[data-bs-theme="light"] .menu .submenu a:hover .bi {
  color: #023e96 !important; /* ensure icons match hover color */
}

/* Selected / active sidebar item in light theme */
[data-bs-theme="light"] .menu .menu-link.active,
[data-bs-theme="light"] .menu a.active,
[data-bs-theme="light"] .menu .submenu a.active {
  background-color: #eff6ff !important;
  color: #023e96 !important;
}

[data-bs-theme="light"] .menu .menu-link.active .bi,
[data-bs-theme="light"] .menu a.active .bi,
[data-bs-theme="light"] .menu .submenu a.active .bi {
  color: #023e96 !important;
}

/* Responsive header rules - keep existing styles, only add adaptive overrides */
/* These rules ensure header elements rearrange and scale reasonably across sizes */
@media (max-width: 1200px) {
  .site-header .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  /* override large inline margin on logo and allow it to shrink */
  .header-logo {
    margin-right: 1rem !important;
    display: flex;
    align-items: center;
  }
  #siteLogo {
    max-width: 180px;
    height: auto;
    width: auto;
  }
  .nav-icons {
    gap: 1rem;
  }
}

@media (max-width: 992px) {
  .site-header .container {
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
  }
  .header-left {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.25rem;
  }
  /* keep logo and toggle aligned on the left */
  .header-logo {
    margin-right: 0 !important;
  }
  .nav-icons {
    width: 100%;
    order: 3;
    justify-content: flex-start;
    gap: 0.6rem;
    padding: 0.25rem 0;
    overflow-x: auto;
  }
  .nav-icons .nav-link {
    padding: 0.45rem 0.5rem;
  }
  .theme-toggle,
  .user-icon {
    order: 4;
    margin-left: 0.25rem;
  }
}

@media (max-width: 768px) {
  /* slightly smaller logo and icons for narrow screens */
  #siteLogo {
    max-width: 150px;
  }
  .nav-icons .nav-link .bi {
    font-size: 1.2rem;
  }
  .menu-link,
  .menu-item > a {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
  /* make theme toggle compact */
  .toggle-track { width: 46px; height: 24px; }
  .toggle-thumb { width: 18px; height: 18px; }
}

@media (max-width: 480px) {
  /* stack header controls and reduce logo footprint */
  .header-left { justify-content: flex-start; gap: 0.5rem; }
  #siteLogo { max-width: 120px; }
  .nav-icons { gap: 0.4rem; }
  .nav-icons .nav-link { font-size: 0.9rem; }
  .nav-icons .nav-link .bi { font-size: 1.05rem; margin-bottom: 0; }
  /* ensure sidebar toggle fits */
  .sidebar-toggle { padding: 6px 8px; }
}

/* Ensure header elements remain horizontally aligned and readable on all sizes */
.site-header .container,
.header-left,
.nav-icons,
.theme-toggle,
.user-icon {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Preserve header layout across all viewport sizes
   Keep element positions identical to desktop by preventing wrapping
   and allowing horizontal scroll when viewport is narrower than layout. */
.site-header .container {
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}
.site-header .container::-webkit-scrollbar {
  height: 6px;
}
.header-left,
.nav-icons,
.theme-toggle,
.user-icon {
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
}
.nav-icons {
  white-space: nowrap;
}
/* keep logo spacing identical; allow it to scale down but preserve layout */
.header-logo {
  display: inline-flex;
  align-items: center;
}
#siteLogo {
  height: 65px; /* match requested size */
  width: 196.25px;
  max-width: none;
}

/* Treatment invoice payment-request attention (nav) */
.ti-pr-nav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ti-pr-nav-icon-wrap > i {
  margin-right: 0;
}

.ti-pr-icon-dot {
  position: absolute;
  top: -2px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffc107;
  border: 1.5px solid #212529;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

[data-bs-theme="dark"] .ti-pr-icon-dot {
  border-color: #0d1117;
}

.ti-pr-sidebar-badge {
  display: inline-flex !important;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.1;
  padding: 0.2em 0.5em;
  white-space: nowrap;
  background-color: #ffc107 !important;
  color: #212529 !important;
}

.ti-pr-sidebar-badge .bi-exclamation-triangle-fill,
.ti-pr-sidebar-badge .ti-pr-sidebar-count {
  color: #212529 !important;
}

.ti-pr-sidebar-badge .bi-exclamation-triangle-fill {
  font-size: 0.72rem;
  line-height: 1;
}

.menu-link .ti-pr-sidebar-badge,
.submenu li a .ti-pr-sidebar-badge {
  color: #212529 !important;
}

.menu-link.submenu-toggle .ti-pr-nav-icon-wrap {
  flex: 0 0 auto;
}

.menu-link.submenu-toggle .ti-pr-nav-label,
.submenu li a .ti-pr-nav-label {
  flex: 1 1 auto;
  min-width: 0;
}

.menu-link.submenu-toggle .ti-pr-sidebar-badge {
  margin-left: auto;
  margin-right: 0.2rem;
}

.sidebar-vertical .submenu li a {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
}

.submenu li a .ti-pr-sidebar-badge {
  margin-left: auto;
  flex-shrink: 0;
}

.ti-row-attention {
  display: inline-flex;
  align-items: center;
  color: #ffc107;
  text-decoration: none;
  vertical-align: middle;
}

.ti-row-attention:hover {
  color: #e0a800;
}

tr.ti-row-needs-attention td:first-child,
.ti-row-needs-attention td.ti-invoice-no {
  border-left: 3px solid #ffc107;
}

.ti-payment-request-alert {
  border-left: 4px solid #ffc107;
}

/* ─── Header Profile Section (avatar + settings) ─── */
/* Stable layout across light/dark — theme only changes colors, not geometry */
html {
  scrollbar-gutter: stable;
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 0 0 auto;
  position: relative;
}

.header-profile-img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--bs-border-color);
  box-sizing: border-box;
}

.header-profile .header-profile-avatar,
.header-profile .profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007bff, #0056b3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid var(--bs-border-color);
  box-sizing: border-box;
  flex-shrink: 0;
}

.header-profile .profile-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  margin-right: 0.5rem;
  min-width: 0;
}

.header-profile .profile-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--bs-body-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-profile .profile-role {
  font-size: 0.8rem;
  text-transform: capitalize;
  color: var(--bs-secondary-color);
}

.header-profile .settings-btn {
  color: var(--bs-body-color);
  transition: color 0.2s ease;
  margin: 0;
  margin-left: 0.25rem;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  text-decoration: none !important;
  box-shadow: none !important;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
  flex-shrink: 0;
  position: relative;
}

.header-profile .settings-btn .bi-gear {
  font-size: 1.6rem;
  line-height: 1;
  width: 1.6rem;
  height: 1.6rem;
  display: block;
}

.header-profile .settings-btn:hover,
.header-profile .settings-btn:focus,
.header-profile .settings-btn:active {
  color: var(--bs-primary);
  box-shadow: none !important;
}

/* Report + attendance header icons — match Partners .notification-btn styling */
.site-header .header-right > .notification-btn.btn-link,
.site-header .header-right > .notification-btn.btn-link .bi {
  color: var(--bs-body-color) !important;
  text-decoration: none !important;
  box-shadow: none !important;
  transition: color 0.2s ease;
}

.site-header .header-right > .notification-btn.btn-link:hover,
.site-header .header-right > .notification-btn.btn-link:focus,
.site-header .header-right > .notification-btn.btn-link:active,
.site-header .header-right > .notification-btn.btn-link:hover .bi,
.site-header .header-right > .notification-btn.btn-link:focus .bi,
.site-header .header-right > .notification-btn.btn-link:active .bi {
  color: var(--bs-primary) !important;
}

/* Static CSS positioning — identical in light and dark (no Popper inset styles) */
.header-profile .dropdown {
  position: relative;
  flex-shrink: 0;
}

.header-profile .dropdown-menu,
.header-profile .dropdown-menu.dropdown-menu-end,
.header-profile .dropdown-menu.show {
  position: absolute !important;
  top: calc(100% + 0.75rem) !important;
  right: 0 !important;
  left: auto !important;
  bottom: auto !important;
  inset: auto auto auto auto !important;
  transform: none !important;
  margin: 0 !important;
  min-width: 140px !important;
  width: 140px !important;
  padding: 0.5rem 0 !important;
  box-sizing: border-box;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075), 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
  z-index: 1080 !important;
}

.header-profile .dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.4rem 1rem;
  line-height: 1.25;
  white-space: nowrap;
  box-sizing: border-box;
}

.header-profile .dropdown-menu .dropdown-divider {
  margin: 0.35rem 0;
}

.header-profile .dropdown-menu::before {
  content: '';
  position: absolute;
  top: -0.9rem;
  right: 0.55rem;
  width: 0;
  height: 0;
  border-left: 0.7rem solid transparent;
  border-right: 0.7rem solid transparent;
  border-bottom: 0.9rem solid var(--bs-dropdown-bg, #fff);
  pointer-events: none;
}

/* Header overflow-x:auto otherwise clips the dropdown — open state must allow it through */
.site-header .header-right,
.site-header .header-profile {
  overflow: visible;
}

.site-header:has(.header-profile .dropdown-menu.show) .container,
.site-header:has(#notificationDropdownMenu.show) .container {
  overflow: visible !important;
}

#themeToggleMenuContainer {
  box-sizing: border-box;
  width: 140px;
  max-width: 140px;
  padding: 0.5rem 0.75rem !important;
}

#themeToggleMenuContainer .theme-toggle {
  display: flex;
  justify-content: flex-start;
  width: 105px;
  margin: 0 !important;
  padding: 0 !important;
}

#themeToggleMenuContainer .toggle-track,
#themeToggleMenuContainer #themeToggle + .toggle-track {
  width: 105px !important;
  height: 29px !important;
  box-sizing: border-box;
  flex-shrink: 0;
}

#themeToggleMenuContainer #themeToggle:checked + .toggle-track .toggle-thumb {
  transform: translateX(75px) !important;
}

.header-profile .dropdown-menu .dropdown-item.logout {
  color: #dc3545;
}

.header-profile .dropdown-menu .dropdown-item.logout:hover,
.header-profile .dropdown-menu .dropdown-item.logout:focus {
  background-color: #dc3545;
  color: #ffffff;
}

[data-bs-theme="dark"] .header-profile .profile-name {
  color: #ffffff;
}

[data-bs-theme="dark"] .header-profile .settings-btn {
  color: #e6edf3;
}

[data-bs-theme="dark"] .header-profile .settings-btn:hover,
[data-bs-theme="dark"] .header-profile .settings-btn:focus {
  color: #58a6ff;
}

[data-bs-theme="light"] .header-profile .dropdown-menu,
[data-bs-theme="dark"] .header-profile .dropdown-menu {
  /* geometry locked above; only colors differ by theme */
  top: calc(100% + 0.75rem) !important;
  right: 0 !important;
  left: auto !important;
  width: 140px !important;
  min-width: 140px !important;
}

[data-bs-theme="dark"] .header-profile .dropdown-menu {
  background-color: #08151d !important;
  border-color: #21262d !important;
}

[data-bs-theme="dark"] .header-profile .dropdown-menu::before {
  border-bottom-color: #08151d;
}

[data-bs-theme="dark"] .header-profile .dropdown-menu .dropdown-item {
  color: #e6edf3 !important;
}

[data-bs-theme="dark"] .header-profile .dropdown-menu .dropdown-item:hover,
[data-bs-theme="dark"] .header-profile .dropdown-menu .dropdown-item:focus {
  background-color: #161b22 !important;
  color: #58a6ff !important;
}

[data-bs-theme="dark"] .header-profile .dropdown-menu .dropdown-divider {
  border-color: #21262d !important;
}

[data-bs-theme="dark"] .header-profile .dropdown-menu .dropdown-item.logout {
  color: #dc3545 !important;
}

[data-bs-theme="dark"] .header-profile .dropdown-menu .dropdown-item.logout:hover,
[data-bs-theme="dark"] .header-profile .dropdown-menu .dropdown-item.logout:focus {
  background-color: #dc3545 !important;
  color: #ffffff !important;
}
