/* ─── Site Header Base Styling ─── */
.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: 1000;
  position: relative;
}

[data-bs-theme="light"] .site-header {
  background-color: #ffffff !important;
}

[data-bs-theme="dark"] .site-header {
  background-color: #08151d !important;
  box-shadow: none;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.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: var(--bs-body-color-secondary);
  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: var(--bs-primary); */
  background-color: #00baff;

}

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

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

/* ─── Menu Toggle Button ─── */
.menu-toggle-btn {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.menu-toggle-btn:hover {
    opacity: 0.8;
}

/* ─── Dark Mode Support for Header ─── */
[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 {
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  margin: 5% auto;
  padding: 30px;
  width: 95%;
  max-width: 1200px;
  border-radius: 10px;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  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 */
.modal-with-comments .modal-main .modal-sticky-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 12px 0;
  background: var(--bs-body-bg);
  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 */
.comments-chat-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden; /* Avoid horizontal scroll due to long content */
  padding: 10px;
  background: var(--bs-body-bg);
  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: 35px;
  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 */
* {
  scrollbar-width: none; /* hide scrollbar, preserve scroll */
}
/* Legacy Edge/IE */
* {
  -ms-overflow-style: none;
}
/* WebKit (Chrome, new Edge, Safari) */
*::-webkit-scrollbar {
  width: 0;
  height: 0;
}




/* ---------------------------------------------------------------------------
   Light-mode: Uniform DataTable header style across the app
   Applies only when the page's theme is set to light via the
   `data-bs-theme="light"` attribute on the document element.
   Matches the Employees page header color: #423c3c with white text.
   ------------------------------------------------------------------------ */
html[data-bs-theme="light"] table.dataTable thead th,
html[data-bs-theme="light"] .dataTables_wrapper table.dataTable thead th,
html[data-bs-theme="light"] .modern-table-container table.dataTable thead th,
html[data-bs-theme="light"] .modern-table-container table thead th {
  color: #333333 !important;
  border-bottom: 1px solid #e7e5e5 !important;
  font-weight:700;
  font-size: 14.4px;
}

/* Target cloned/scroll headers generated by DataTables */
html[data-bs-theme="light"] .dataTables_scrollHeadInner table thead th,
html[data-bs-theme="light"] .dataTables_scrollHead table thead th {
  color: #023e96 !important;

}

/* Ensure any module-specific ID/themed header for tables also follows the same light-mode style */
html[data-bs-theme="light"] #contractTable thead th,
html[data-bs-theme="light"] #payrollTable thead th,
html[data-bs-theme="light"] #leaveTable thead th,
html[data-bs-theme="light"] #projectsTable thead th {
  background: #fbfbfb !important;
  color: #023e96 !important;

}

/* Specific override for recruitment table header (page has inline styles) */
html[data-bs-theme="light"] #recruitmentTable thead th {
  color: #023e96 !important;

}

/* Specific override for travel table header to beat page inline styles */
html[data-bs-theme="light"] #travelTable thead th,
html[data-bs-theme="light"] .modern-table-container #travelTable thead th,
html[data-bs-theme="light"] .dataTables_wrapper #travelTable thead th {
  color: #023e96 !important;

}

/* Make the travel page 'approved' badge match Employees' modern active badge */
html[data-bs-theme="light"] #travelTable .badge.bg-success,
html[data-bs-theme="light"] #travelTable .badge.status-active,
html[data-bs-theme="light"] #travelTable .badge.approved {
  display: inline-flex !important;
  align-items: center !important;
  padding: 0.25rem 0.75rem !important;
  border-radius: 9999px !important;
  font-size: 0.75rem !important;
  border: 1px solid !important;
  background: rgba(15, 139, 83, 0.30) !important;
  color: #0f8b53 !important;
  border-color: rgba(15, 139, 83, 0.9) !important;
  font-weight: 500 !important;
}

/* Dark/default mode: match Employees' dark active badge look */
#travelTable .badge.bg-success,
#travelTable .badge.status-active,
#travelTable .badge.approved {
  display: inline-flex !important;
  align-items: center !important;
  padding: 0.25rem 0.75rem !important;
  border-radius: 9999px !important;
  font-size: 0.75rem !important;
  border: 1px solid !important;
  background: rgba(34, 197, 94, 0.2) !important;
  color: #4ade80 !important;
  border-color: rgba(34, 197, 94, 0.3) !important;
  font-weight: 500 !important;
}


/* ---------------------------------------------------------------------------
   Light-mode pagination styling
   - Styles below only apply when `html[data-bs-theme="light"]` is set
   - Targets DataTables built-in pagination and the project's custom
     `.pagination-btn` used in `custom-pagination-footer`.
   - Colors chosen to match datatable header (#423c3c) and inputs (#726C6C).
---------------------------------------------------------------------------- */
/* html[data-bs-theme="light"] .dataTables_wrapper .dataTables_paginate .paginate_button {
  background: transparent !important;
  color: #423c3c !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  padding: 6px 10px !important;
  margin: 0 4px !important;
  min-width: 40px !important;
  box-shadow: none !important;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}


*/

/*

html[data-bs-theme="light"] .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html[data-bs-theme="light"] .dataTables_wrapper .dataTables_paginate .paginate_button.active {
  background: #423c3c !important;
  color: #ffffff !important;
  border-color: #423c3c !important;
}

html[data-bs-theme="light"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
html[data-bs-theme="light"] .dataTables_wrapper .dataTables_paginate .paginate_button:disabled {
  color: #9ca3af !important;
  background: transparent !important;
  border-color: #e5e7eb !important;
}

Custom pagination used in employees.js
html[data-bs-theme="light"] .custom-pagination-footer .pagination-btn {
  background: transparent !important;
  color: #423c3c !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  padding: 6px 10px !important;
  margin: 0 4px !important;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

html[data-bs-theme="light"] .custom-pagination-footer .pagination-btn:hover {
  background: #423c3c !important;
  color: #ffffff !important;
  border-color: #423c3c !important;
}

html[data-bs-theme="light"] .custom-pagination-footer .pagination-btn.active {
  background: #00baff !important;
  color: #ffffff !important;
  border-color: #00baff !important;
}

html[data-bs-theme="light"] .custom-pagination-footer .pagination-btn[disabled],
html[data-bs-theme="light"] .custom-pagination-footer .pagination-btn[disabled="disabled"] {
  color: #9ca3af !important;
  background: transparent !important;
  border-color: #e5e7eb !important;
  cursor: default;
}

Pagination info text (left side)
html[data-bs-theme="light"] .custom-pagination-footer .pagination-info,
html[data-bs-theme="light"] .dataTables_wrapper .dataTables_info {
  color: #1f2937 !important; /* dark slate for readability 
}
*/
/* Make the Previous/Next buttons visually lighter (light grey) in light mode
html[data-bs-theme="light"] .dataTables_wrapper .dataTables_paginate .paginate_button.previous,
html[data-bs-theme="light"] .dataTables_wrapper .dataTables_paginate .paginate_button.next {
  background: #4B5563 !important;
  color: #ffffff !important;
  border-color: #3f4750 !important;
}

html[data-bs-theme="light"] .custom-pagination-footer .pagination-btn:first-child,
html[data-bs-theme="light"] .custom-pagination-footer .pagination-btn:last-child {
  background: #4B5563 !important;
  color: #ffffff !important;
  border-color: #3f4750 !important;
}
 */


 

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 tr:hover {
  background-color: #e0e0e0; /* Slightly darker grey on hover */
  cursor: pointer;
  transition: background-color 0.3s ease-in-out;
}

/* Dark mode support for tabela and filter tables */
[data-bs-theme="dark"] .tabela,
[data-bs-theme="dark"] #filterTable,
[data-bs-theme="dark"] #filterTable1,
[data-bs-theme="dark"] #filterTable2,
[data-bs-theme="dark"] #filterTable3,
[data-bs-theme="dark"] #filterTable4,
[data-bs-theme="dark"] #LastNextPatients,
[data-bs-theme="dark"] #conversationTable,
[data-bs-theme="dark"] #CurrentlyAtHospital,
[data-bs-theme="dark"] #WaitingProformas {
  background-color: #1e1e1e;
  color: #e0e0e0;
}



/* Fix links in tables */
[data-bs-theme="dark"] .tabela a,
[data-bs-theme="dark"] #filterTable a,
[data-bs-theme="dark"] #filterTable1 a,
[data-bs-theme="dark"] #filterTable2 a,
[data-bs-theme="dark"] #filterTable3 a,
[data-bs-theme="dark"] #filterTable4 a,
[data-bs-theme="dark"] #LastNextPatients a,
[data-bs-theme="dark"] #conversationTable a,
[data-bs-theme="dark"] #CurrentlyAtHospital a,
[data-bs-theme="dark"] #WaitingProformas a {
  color: #9ecbff;
}

/* 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: 0.7rem;
  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;
}
.card-dark {
  border-left: 4px solid #212529;
}

/* 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 */
.badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
}
.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;
  }
}
