body {
    font-family: 'Google Sans Flex Variable', sans-serif;
    background-color: #121212;
    color: #e0e0e0;
}

.ai-assistant-bubble {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

#map {
    width: 100%;
    border-radius: 0 0 0.375rem 0.375rem;
}

.card {
    margin-bottom: 1rem;
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-color: #333;
}

pre {
    background: #2a2a2a;
    padding: 1rem;
    border-radius: 0.375rem;
    color: #e0e0e0;
}

.table-dark {
    --bs-table-bg: #1e1e1e;
    --bs-table-color: #e0e0e0;
    --bs-table-border-color: #333;
}

.form-control, .form-select {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-color: #444;
}

.form-control:focus, .form-select:focus {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-color: #666;
    box-shadow: 0 0 0 0.2rem rgba(100, 100, 100, 0.25);
}

a {
    color: #8ab4f8;
    text-decoration: none;
}

a:hover {
    color: #aecbfa;
}

.page-link {
    background-color: #1e1e1e;
    border-color: #333;
    color: #e0e0e0;
}

.page-item.disabled .page-link {
    background-color: #1e1e1e;
    border-color: #333;
    color: #666;
}

/* Light mode overrides */
html[data-bs-theme="light"] body {
    font-family: 'Google Sans Flex Variable', sans-serif;
    background-color: #f5f5f5;
    color: #212529;
}

html[data-bs-theme="light"] .ai-assistant-bubble {
    background-color: #e9ecef;
    color: #212529;
}

html[data-bs-theme="light"] .card {
    background-color: #ffffff;
    color: #212529;
    border-color: #dee2e6;
}

html[data-bs-theme="light"] pre {
    background: #f8f9fa;
    color: #212529;
}

html[data-bs-theme="light"] .table-dark {
    --bs-table-bg: #ffffff;
    --bs-table-color: #212529;
    --bs-table-border-color: #dee2e6;
}

html[data-bs-theme="light"] .form-control,
html[data-bs-theme="light"] .form-select {
    background-color: #ffffff;
    color: #212529;
    border-color: #ced4da;
}

html[data-bs-theme="light"] .form-control:focus,
html[data-bs-theme="light"] .form-select:focus {
    background-color: #ffffff;
    color: #212529;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

html[data-bs-theme="light"] a {
    color: #0d6efd;
}

html[data-bs-theme="light"] a.btn-primary,
html[data-bs-theme="light"] a.btn-primary:hover,
html[data-bs-theme="light"] a.btn-primary:focus {
    color: #fff !important;
    text-decoration: none;
}

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

html[data-bs-theme="light"] .page-link {
    background-color: #ffffff;
    border-color: #dee2e6;
    color: #0d6efd;
}

html[data-bs-theme="light"] .page-item.disabled .page-link {
    background-color: #ffffff;
    border-color: #dee2e6;
    color: #6c757d;
}

html[data-bs-theme="light"] .text-muted {
    color: #6c757d !important;
}

html[data-bs-theme="light"] .alert-warning {
    color: #664d03;
    background-color: #fff3cd;
    border-color: #ffecb5;
}

html[data-bs-theme="light"] .alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

html[data-bs-theme="light"] .alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

html[data-bs-theme="light"] .border-secondary {
    border-color: #dee2e6 !important;
}

html[data-bs-theme="light"] .navbar-dark {
    background-color: #f8f9fa !important;
}

html[data-bs-theme="light"] .navbar-dark .navbar-brand,
html[data-bs-theme="light"] .navbar-dark .nav-link {
    color: #212529;
}

html[data-bs-theme="light"] .navbar-dark .nav-link.active {
    color: #000;
}

html[data-bs-theme="light"] .btn-outline-light {
    color: #212529;
    border-color: #212529;
}

html[data-bs-theme="light"] .btn-outline-light:hover {
    color: #fff;
    background-color: #212529;
}

html[data-bs-theme="light"] .accordion-item {
    background-color: #fff;
    border-color: rgba(0,0,0,.125);
}

html[data-bs-theme="light"] .accordion-button {
    background-color: #fff;
    color: #212529;
}

html[data-bs-theme="light"] .accordion-button:not(.collapsed) {
    background-color: #e7f1ff;
    color: #0c63e4;
}

html[data-bs-theme="light"] .accordion-body {
    background-color: #fff;
    color: #212529;
}

html[data-bs-theme="light"] .list-group-item {
    background-color: #fff;
    color: #212529;
    border-color: rgba(0,0,0,.125);
}

/* Tom Select dark mode overrides */
.ts-wrapper.single .ts-control {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-color: #444;
}
.ts-dropdown {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-color: #444;
}
.ts-dropdown .active {
    background-color: #0d6efd;
    color: #fff;
}
.ts-dropdown .option {
    color: #e0e0e0;
}
.ts-wrapper.single.input-active .ts-control {
    background-color: #1e1e1e;
}

html[data-bs-theme="light"] .ts-wrapper.single .ts-control {
    background-color: #ffffff;
    color: #212529;
    border-color: #ced4da;
}
html[data-bs-theme="light"] .ts-dropdown {
    background-color: #ffffff;
    color: #212529;
    border-color: #ced4da;
}
html[data-bs-theme="light"] .ts-dropdown .option {
    color: #212529;
}

/* Flatpickr dark mode overrides */
html[data-bs-theme="dark"] .flatpickr-calendar {
    background: #1e1e1e;
    border-color: #444;
    -webkit-box-shadow: 1px 0 0 #444, -1px 0 0 #444, 0 1px 0 #444, 0 -1px 0 #444, 0 3px 13px rgba(0,0,0,0.5);
    box-shadow: 1px 0 0 #444, -1px 0 0 #444, 0 1px 0 #444, 0 -1px 0 #444, 0 3px 13px rgba(0,0,0,0.5);
}
html[data-bs-theme="dark"] .flatpickr-months .flatpickr-month {
    background: #1e1e1e;
    color: #e0e0e0;
    fill: #e0e0e0;
}
html[data-bs-theme="dark"] .flatpickr-weekdays {
    background: #1e1e1e;
}
html[data-bs-theme="dark"] .flatpickr-weekday {
    background: #1e1e1e;
    color: #aaa;
}
html[data-bs-theme="dark"] .flatpickr-day {
    background: none;
    border-color: #333;
    color: #e0e0e0;
}
html[data-bs-theme="dark"] .flatpickr-day:hover {
    background: #333;
    border-color: #333;
}
html[data-bs-theme="dark"] .flatpickr-day.selected,
html[data-bs-theme="dark"] .flatpickr-day.startRange,
html[data-bs-theme="dark"] .flatpickr-day.endRange {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}
html[data-bs-theme="dark"] .flatpickr-time {
    background: #1e1e1e;
    border-color: #444;
}
html[data-bs-theme="dark"] .flatpickr-time input {
    background: #1e1e1e;
    color: #e0e0e0;
}
html[data-bs-theme="dark"] .flatpickr-time .flatpickr-am-pm {
    background: #1e1e1e;
    color: #e0e0e0;
}
html[data-bs-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months {
    background: #1e1e1e;
    color: #e0e0e0;
}
html[data-bs-theme="dark"] .flatpickr-current-month input.cur-year {
    background: #1e1e1e;
    color: #e0e0e0;
}

#themeToggle {
    color: inherit !important;
    border-color: currentColor !important;
    background: transparent !important;
}

html[data-bs-theme="light"] .navbar-dark #themeToggle,
html[data-bs-theme="light"] .navbar-dark .btn-outline-light {
    color: #212529;
    border-color: #212529;
}

html[data-bs-theme="light"] .navbar-dark .btn-outline-light:hover {
    color: #fff;
    background-color: #212529;
}

/* -------------------------------------------------------------------------- */
/*  PDF Print Report                                                          */
/* -------------------------------------------------------------------------- */

#printReport {
  position: absolute;
  left: -10000px;
  top: 0;
  width: 210mm;
  min-height: 297mm;
  color: #212529;
  background: #fff;
}

#printReport.d-none {
  display: none !important;
}

.pdf-header {
  text-align: center;
  border-bottom: 2px solid #0d6efd;
  padding-bottom: 15px;
  margin-bottom: 25px;
}

.pdf-header h1 {
  font-size: 26px;
  margin: 0;
  color: #0d6efd;
  font-weight: 600;
}

.pdf-header .meta {
  font-size: 11px;
  color: #666;
  margin-top: 5px;
}

.pdf-section {
  margin-bottom: 25px;
}

.pdf-section h2 {
  font-size: 16px;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 6px;
  margin-bottom: 12px;
  color: #212529;
  font-weight: 600;
}

.pdf-testinfo p {
  margin: 0 0 4px 0;
  font-size: 11px;
  line-height: 1.4;
}

.pdf-testinfo hr {
  margin: 10px 0;
  border-color: #dee2e6;
}

.pdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  margin-top: 8px;
}

.pdf-table th,
.pdf-table td {
  border: 1px solid #adb5bd;
  padding: 5px 7px;
  text-align: left;
  vertical-align: top;
}

.pdf-table th {
  background-color: #f1f3f5;
  font-weight: 600;
}

.pdf-table tr:nth-child(even) {
  background-color: #f8f9fa;
}

.pdf-table td.text-end,
.pdf-table th.text-end {
  text-align: right;
}

.pdf-chart {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  margin-bottom: 15px;
}

.pdf-page-break {
  page-break-before: always;
}

.pdf-truncated-note {
  font-size: 10px;
  color: #666;
  font-style: italic;
  margin-bottom: 8px;
}

@media print {
  @page {
    margin: 0;
  }

  body > * {
    display: none !important;
  }

  #printReport {
    display: block !important;
    position: static;
    visibility: visible;
    width: auto;
    min-height: 0;
    box-sizing: border-box;
    font-family: 'Google Sans Flex Variable', 'Helvetica Neue', Arial, sans-serif;
    color: #212529;
    background: #fff;
    padding: 15mm;
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
  }

  #printReport * {
    visibility: visible;
  }

  .pdf-section {
    page-break-inside: avoid;
  }

  .pdf-table {
    page-break-inside: auto;
  }

  .pdf-table tr {
    page-break-inside: avoid;
  }

  .pdf-chart {
    page-break-inside: avoid;
    max-height: 260px;
  }

  .pdf-testinfo p {
    margin: 0 0 4px 0;
    font-size: 10px;
    line-height: 1.4;
  }

  .pdf-testinfo hr {
    margin: 8px 0;
    border-color: #adb5bd;
  }

  #printReport a {
    color: #0d6efd;
    text-decoration: none;
  }

  .pdf-page-break {
    page-break-before: always;
  }

  .pdf-truncated-note {
    font-size: 9px;
    color: #666;
    font-style: italic;
    margin-bottom: 6px;
  }
}

/* Notification dropdown styling */
.notif-dropdown-btn {
    color: #e0e0e0 !important;
}
html[data-bs-theme="light"] .notif-dropdown-btn {
    color: #212529 !important;
}
.notif-menu .dropdown-item {
    color: inherit;
}
.notif-menu .dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
}
html[data-bs-theme="dark"] .notif-menu {
    background-color: #1e1e1e;
    border-color: #333;
}
html[data-bs-theme="dark"] .notif-menu .dropdown-item-text,
html[data-bs-theme="dark"] .notif-menu .dropdown-item {
    color: #e0e0e0;
}
html[data-bs-theme="dark"] .notif-menu .dropdown-item:hover {
    background-color: #2a2a2a;
}
html[data-bs-theme="dark"] .notif-menu .border-bottom {
    border-color: #333 !important;
}

.notif-menu {
    width: 600px;
}

@media (max-width: 768px) {
    .dropdown.d-lg-none .notif-menu {
        position: fixed !important;
        top: 3.5rem !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
    }
}

.login-logo {
    max-width: 180px;
    margin: 0 auto 1.5rem;
    display: block;
}
