
/* Gestão Clínica v2.6.9 - modo noturno global */
html[data-theme="dark"] { color-scheme: dark; }

html[data-theme="dark"] body,
body.dark-mode {
  background: #0f172a !important;
  color: #e5e7eb !important;
}

html[data-theme="dark"] .principal {
  background: #0f172a !important;
}

html[data-theme="dark"] .navbar-relatorio {
  background: #111827 !important;
  border-bottom-color: #263244 !important;
  box-shadow: 0 4px 22px rgba(0,0,0,.32) !important;
}

html[data-theme="dark"] .navbar-relatorio .navbar-brand span,
html[data-theme="dark"] .navbar-relatorio .nav-link,
html[data-theme="dark"] .navbar-relatorio .btn-link,
html[data-theme="dark"] .navbar-relatorio .disabled {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .navbar-relatorio .nav-link:hover,
html[data-theme="dark"] .navbar-relatorio .nav-link.active {
  color: #7dd3fc !important;
}

html[data-theme="dark"] .navbar-toggler-icon {
  filter: invert(1) !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .popover,
html[data-theme="dark"] .paciente-resumo,
html[data-theme="dark"] .acao-paciente-card,
html[data-theme="dark"] .reagendar-box,
html[data-theme="dark"] .historico-modal-item,
html[data-theme="dark"] .agenda-dia-card,
html[data-theme="dark"] .agenda-item,
html[data-theme="dark"] .calendar-card,
html[data-theme="dark"] .auto-card {
  background: #172033 !important;
  color: #e5e7eb !important;
  border-color: #2c3a50 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.22) !important;
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .modal-header:not(.bg-primary):not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info),
html[data-theme="dark"] .accordion-button,
html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .dropdown-item-text {
  background: #172033 !important;
  color: #e5e7eb !important;
  border-color: #2c3a50 !important;
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus,
html[data-theme="dark"] .dropdown-item.active,
html[data-theme="dark"] .dropdown-item:active {
  background: #243047 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] textarea,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-theme="dark"] select {
  background-color: #111827 !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] textarea::placeholder,
html[data-theme="dark"] input::placeholder {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus {
  background-color: #111827 !important;
  color: #fff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 .2rem rgba(56,189,248,.16) !important;
}

html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-control[readonly],
html[data-theme="dark"] .form-select:disabled,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-white {
  background-color: #1e293b !important;
  color: #dbeafe !important;
}

html[data-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: #e5e7eb;
  --bs-table-border-color: #334155;
  --bs-table-striped-bg: #1b2639;
  --bs-table-striped-color: #e5e7eb;
  --bs-table-hover-bg: #243047;
  --bs-table-hover-color: #fff;
  color: #e5e7eb !important;
}

html[data-theme="dark"] .table tbody tr {
  background: #172033 !important;
  color: #e5e7eb !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.16) !important;
}

html[data-theme="dark"] table td,
html[data-theme="dark"] table th,
html[data-theme="dark"] .table td,
html[data-theme="dark"] .table th {
  color: #e5e7eb;
  border-color: #334155 !important;
}

html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .text-black,
html[data-theme="dark"] [style*="color:black"],
html[data-theme="dark"] [style*="color: black"] {
  color: #e5e7eb !important;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] small.text-muted,
html[data-theme="dark"] .form-text {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .border,
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-start,
html[data-theme="dark"] .border-end {
  border-color: #334155 !important;
}

html[data-theme="dark"] hr,
html[data-theme="dark"] .dropdown-divider {
  border-color: #475569 !important;
  opacity: .55;
}

html[data-theme="dark"] .nav-tabs {
  border-color: #334155 !important;
}

html[data-theme="dark"] .nav-tabs .nav-link {
  color: #94a3b8;
}

html[data-theme="dark"] .nav-tabs .nav-link.active {
  background: #172033 !important;
  color: #7dd3fc !important;
  border-color: #334155 #334155 #172033 !important;
}

html[data-theme="dark"] .btn-light,
html[data-theme="dark"] .btn-outline-secondary {
  background: #243047 !important;
  color: #e5e7eb !important;
  border-color: #475569 !important;
}

html[data-theme="dark"] .btn-light:hover,
html[data-theme="dark"] .btn-outline-secondary:hover {
  background: #334155 !important;
  color: #fff !important;
}

html[data-theme="dark"] .alert-light {
  background: #172033 !important;
  color: #e5e7eb !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .agenda-item-livre {
  background: #13251f !important;
  border-color: #285542 !important;
}

html[data-theme="dark"] .agenda-paciente-nome,
html[data-theme="dark"] .agenda-hora-box,
html[data-theme="dark"] .agenda-dia-info strong,
html[data-theme="dark"] .acao-paciente-card {
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .calendar-day,
html[data-theme="dark"] .day {
  color: #e5e7eb !important;
}

html[data-theme="dark"] .calendar-day:hover,
html[data-theme="dark"] table td:hover {
  background: #243047 !important;
}

html[data-theme="dark"] .footer-sistema {
  background: linear-gradient(180deg,#111827,#0b1220) !important;
  color: #94a3b8 !important;
}

html[data-theme="dark"] .modal-backdrop.show {
  opacity: .72;
}

.theme-toggle-nav {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border-radius: 999px !important;
  padding-left: .7rem !important;
  padding-right: .7rem !important;
}

@media (max-width: 991.98px) {
  .theme-toggle-nav {
    justify-content: flex-start;
    width: 100%;
    border-radius: .65rem !important;
  }
}


/* Compatibilidade com páginas antigas que usam cores inline. */
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:white"],
html[data-theme="dark"] [style*="background: white"],
html[data-theme="dark"] [style*="background-color:#fff"],
html[data-theme="dark"] [style*="background-color: #fff"],
html[data-theme="dark"] [style*="background-color:white"],
html[data-theme="dark"] [style*="background-color: white"],
html[data-theme="dark"] [style*="background:#f8fafc"],
html[data-theme="dark"] [style*="background: #f8fafc"],
html[data-theme="dark"] [style*="background:#f4f6f9"],
html[data-theme="dark"] [style*="background: #f4f6f9"] {
  background: #172033 !important;
  background-color: #172033 !important;
}

html[data-theme="dark"] [style*="color:#212529"],
html[data-theme="dark"] [style*="color: #212529"],
html[data-theme="dark"] [style*="color:#0f172a"],
html[data-theme="dark"] [style*="color: #0f172a"],
html[data-theme="dark"] [style*="color:#111827"],
html[data-theme="dark"] [style*="color: #111827"] {
  color: #e5e7eb !important;
}
