/* Dark Theme Styles */
[data-bs-theme='dark'] {
  color-scheme: dark;
}

[data-bs-theme='dark'] body,
.dark-style body {
  background-color: #233446;
  color: #c7d0dd;
}

[data-bs-theme='dark'] .layout-wrapper,
.dark-style .layout-wrapper {
  background-color: #233446;
}

[data-bs-theme='dark'] .content-wrapper,
.dark-style .content-wrapper {
  background-color: #233446;
}

[data-bs-theme='dark'] .card,
.dark-style .card {
  background-color: #2f3c4e;
  border-color: #3d4d5f;
  color: #c7d0dd;
}

[data-bs-theme='dark'] .card-header,
.dark-style .card-header {
  background-color: #2a3847;
  border-bottom-color: #3d4d5f;
  color: #c7d0dd;
}

[data-bs-theme='dark'] .table,
.dark-style .table {
  color: #c7d0dd;
  border-color: #3d4d5f;
}

[data-bs-theme='dark'] .table > :not(caption) > * > *,
.dark-style .table > :not(caption) > * > * {
  background-color: transparent;
  border-bottom-color: #3d4d5f;
  color: #c7d0dd;
}

[data-bs-theme='dark'] .table-hover > tbody > tr:hover > *,
.dark-style .table-hover > tbody > tr:hover > * {
  background-color: #3d4d5f;
}

[data-bs-theme='dark'] .form-control,
[data-bs-theme='dark'] .form-select,
.dark-style .form-control,
.dark-style .form-select {
  background-color: #2a3847;
  border-color: #3d4d5f;
  color: #c7d0dd;
}

[data-bs-theme='dark'] .form-control:focus,
[data-bs-theme='dark'] .form-select:focus,
.dark-style .form-control:focus,
.dark-style .form-select:focus {
  background-color: #2a3847;
  border-color: #5a6c7d;
  color: #c7d0dd;
  box-shadow: 0 0 0 0.25rem rgba(90, 108, 125, 0.25);
}

[data-bs-theme='dark'] .form-select option,
.dark-style .form-select option {
  background-color: #2f3c4e;
  color: #c7d0dd;
}

[data-bs-theme='dark'] .dropdown-menu,
.dark-style .dropdown-menu {
  background-color: #2f3c4e;
  border-color: #3d4d5f;
}

[data-bs-theme='dark'] .dropdown-item,
.dark-style .dropdown-item {
  color: #c7d0dd;
}

[data-bs-theme='dark'] .dropdown-item:hover,
[data-bs-theme='dark'] .dropdown-item:focus,
.dark-style .dropdown-item:hover,
.dark-style .dropdown-item:focus {
  background-color: #3d4d5f;
  color: #fff;
}

[data-bs-theme='dark'] .modal-content,
.dark-style .modal-content {
  background-color: #2f3c4e;
  border-color: #3d4d5f;
  color: #c7d0dd;
}

[data-bs-theme='dark'] .modal-header,
[data-bs-theme='dark'] .modal-footer,
.dark-style .modal-header,
.dark-style .modal-footer {
  border-color: #3d4d5f;
}

[data-bs-theme='dark'] .btn-close,
.dark-style .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

[data-bs-theme='dark'] .text-muted,
.dark-style .text-muted {
  color: #8e9baa !important;
}

[data-bs-theme='dark'] .text-heading,
.dark-style .text-heading {
  color: #c7d0dd !important;
}

[data-bs-theme='dark'] .bg-body,
.dark-style .bg-body {
  background-color: #233446 !important;
}

[data-bs-theme='dark'] .border,
.dark-style .border {
  border-color: #3d4d5f !important;
}

/* Menu Styles */
[data-bs-theme='dark'] .layout-menu,
.dark-style .layout-menu {
  background-color: #2f3c4e;
}

[data-bs-theme='dark'] .menu-inner > .menu-item.active > .menu-link,
.dark-style .menu-inner > .menu-item.active > .menu-link {
  background-color: rgba(105, 108, 255, 0.16);
}

[data-bs-theme='dark'] .menu-link,
.dark-style .menu-link {
  color: #c7d0dd;
}

[data-bs-theme='dark'] .menu-link:hover,
[data-bs-theme='dark'] .menu-link:focus,
.dark-style .menu-link:hover,
.dark-style .menu-link:focus {
  background-color: rgba(195, 208, 221, 0.08) !important;
  color: #c7d0dd !important;
}

[data-bs-theme='dark'] .menu-sub .menu-link:hover,
.dark-style .menu-sub .menu-link:hover {
  background-color: rgba(195, 208, 221, 0.06) !important;
}

/* Navbar */
[data-bs-theme='dark'] .navbar,
.dark-style .navbar {
  background-color: #2f3c4e;
  color: #c7d0dd;
}

[data-bs-theme='dark'] .navbar .navbar-nav .nav-link,
.dark-style .navbar .navbar-nav .nav-link {
  color: #c7d0dd;
}

/* Badges */
[data-bs-theme='dark'] .badge,
.dark-style .badge {
  background-color: #3d4d5f;
  color: #c7d0dd;
}

/* Alerts */
[data-bs-theme='dark'] .alert-success,
.dark-style .alert-success {
  background-color: #1a3a2a;
  border-color: #2a5a3a;
  color: #9fe7c1;
}

[data-bs-theme='dark'] .alert-danger,
.dark-style .alert-danger {
  background-color: #3a1a1a;
  border-color: #5a2a2a;
  color: #ff9b9b;
}

[data-bs-theme='dark'] .alert-warning,
.dark-style .alert-warning {
  background-color: #3a331a;
  border-color: #5a4a2a;
  color: #ffd99b;
}

[data-bs-theme='dark'] .alert-info,
.dark-style .alert-info {
  background-color: #1a2a3a;
  border-color: #2a3a5a;
  color: #9bc9ff;
}

/* List Groups */
[data-bs-theme='dark'] .list-group-item,
.dark-style .list-group-item {
  background-color: #2f3c4e;
  border-color: #3d4d5f;
  color: #c7d0dd;
}

/* Pagination */
[data-bs-theme='dark'] .page-link,
.dark-style .page-link {
  background-color: #2f3c4e;
  border-color: #3d4d5f;
  color: #c7d0dd;
}

[data-bs-theme='dark'] .page-link:hover,
.dark-style .page-link:hover {
  background-color: #3d4d5f;
  border-color: #4d5d6f;
  color: #fff;
}

[data-bs-theme='dark'] .page-item.active .page-link,
.dark-style .page-item.active .page-link {
  background-color: #696cff;
  border-color: #696cff;
}

/* FullCalendar Dark Theme */
[data-bs-theme='dark'] .fc .fc-col-header-cell,
[data-bs-theme='dark'] .fc .fc-col-header-cell-cushion,
.dark-style .fc .fc-col-header-cell,
.dark-style .fc .fc-col-header-cell-cushion {
  color: #8e9baa !important;
  font-weight: 500 !important;
}

[data-bs-theme='dark'] .fc-theme-standard .fc-scrollgrid,
.dark-style .fc-theme-standard .fc-scrollgrid {
  border-color: #3d4d5f !important;
}

[data-bs-theme='dark'] .fc-theme-standard td,
[data-bs-theme='dark'] .fc-theme-standard th,
.dark-style .fc-theme-standard td,
.dark-style .fc-theme-standard th {
  border-color: #3d4d5f !important;
}

[data-bs-theme='dark'] .fc-daygrid-day-number,
.dark-style .fc-daygrid-day-number {
  color: #c7d0dd !important;
}

[data-bs-theme='dark'] .fc .fc-daygrid-day.fc-day-today,
.dark-style .fc .fc-daygrid-day.fc-day-today {
  background-color: rgba(105, 108, 255, 0.08) !important;
}

[data-bs-theme='dark'] .fc .fc-button,
.dark-style .fc .fc-button {
  background-color: #2f3c4e !important;
  border-color: #3d4d5f !important;
  color: #c7d0dd !important;
}

[data-bs-theme='dark'] .fc .fc-button:hover,
.dark-style .fc .fc-button:hover {
  background-color: #3d4d5f !important;
  border-color: #4d5d6f !important;
}

[data-bs-theme='dark'] .fc .fc-button-active,
.dark-style .fc .fc-button-active {
  background-color: #696cff !important;
  border-color: #696cff !important;
}

/* Select2 Dark Theme - Padronização Total */
/* Dropdown principal */
.dark-style .select2-dropdown,
.dark-style .select2-container--bootstrap-5 .select2-dropdown,
[data-bs-theme='dark'] .select2-dropdown,
[data-bs-theme='dark'] .select2-container--bootstrap-5 .select2-dropdown,
.select2-dropdown[data-bs-theme='dark'],
body[data-theme='dark'] .select2-dropdown {
  background-color: #2a3847 !important;
  border: 1px solid #3d4d5f !important;
  color: #c7d0dd !important;
}

/* Campo de seleção (input) */
.dark-style .select2-selection,
.dark-style .select2-container .select2-selection,
.dark-style .select2-container--bootstrap-5 .select2-selection,
[data-bs-theme='dark'] .select2-selection,
[data-bs-theme='dark'] .select2-container .select2-selection,
[data-bs-theme='dark'] .select2-container--bootstrap-5 .select2-selection,
body[data-theme='dark'] .select2-selection {
  background-color: #2a3847 !important;
  border: 1px solid #3d4d5f !important;
  color: #c7d0dd !important;
}

/* Texto renderizado no select */
.dark-style .select2-selection__rendered,
.dark-style .select2-container .select2-selection__rendered,
[data-bs-theme='dark'] .select2-selection__rendered,
[data-bs-theme='dark'] .select2-container .select2-selection__rendered,
body[data-theme='dark'] .select2-selection__rendered {
  color: #c7d0dd !important;
  background-color: transparent !important;
}

/* Opções da lista */
.dark-style .select2-results__option,
.dark-style .select2-container--bootstrap-5 .select2-results__option,
[data-bs-theme='dark'] .select2-results__option,
[data-bs-theme='dark'] .select2-container--bootstrap-5 .select2-results__option,
body[data-theme='dark'] .select2-results__option {
  background-color: #2a3847 !important;
  color: #c7d0dd !important;
  padding: 6px 12px !important;
}

/* Opção destacada (hover) */
.dark-style .select2-results__option--highlighted,
.dark-style .select2-results__option--highlighted[aria-selected],
.dark-style .select2-container--bootstrap-5 .select2-results__option--highlighted,
[data-bs-theme='dark'] .select2-results__option--highlighted,
[data-bs-theme='dark'] .select2-results__option--highlighted[aria-selected],
[data-bs-theme='dark'] .select2-container--bootstrap-5 .select2-results__option--highlighted,
body[data-theme='dark'] .select2-results__option--highlighted {
  background-color: #3d4d5f !important;
  color: #fff !important;
}

/* Opção selecionada */
.dark-style .select2-results__option[aria-selected='true'],
.dark-style .select2-results__option--selected,
[data-bs-theme='dark'] .select2-results__option[aria-selected='true'],
[data-bs-theme='dark'] .select2-results__option--selected,
body[data-theme='dark'] .select2-results__option[aria-selected='true'] {
  background-color: #2a3847 !important;
  color: #c7d0dd !important;
}

/* Estado focus/aberto */
.dark-style .select2-container--focus .select2-selection,
.dark-style .select2-container--open .select2-selection,
[data-bs-theme='dark'] .select2-container--focus .select2-selection,
[data-bs-theme='dark'] .select2-container--open .select2-selection,
body[data-theme='dark'] .select2-container--focus .select2-selection,
body[data-theme='dark'] .select2-container--open .select2-selection {
  background-color: #2a3847 !important;
  border-color: #5a6c7d !important;
  box-shadow: 0 0 0 0.25rem rgba(90, 108, 125, 0.25) !important;
}

/* Campo de busca dentro do dropdown */
.dark-style .select2-search--dropdown .select2-search__field,
[data-bs-theme='dark'] .select2-search--dropdown .select2-search__field,
body[data-theme='dark'] .select2-search--dropdown .select2-search__field {
  background-color: #2a3847 !important;
  border: 1px solid #3d4d5f !important;
  color: #c7d0dd !important;
}

/* Container de resultados */
.dark-style .select2-results__options,
[data-bs-theme='dark'] .select2-results__options,
body[data-theme='dark'] .select2-results__options {
  background-color: #2a3847 !important;
}

/* Setas e ícones */
.dark-style .select2-selection__arrow,
[data-bs-theme='dark'] .select2-selection__arrow,
body[data-theme='dark'] .select2-selection__arrow {
  background-color: transparent !important;
}

.dark-style .select2-selection__arrow b,
[data-bs-theme='dark'] .select2-selection__arrow b,
body[data-theme='dark'] .select2-selection__arrow b {
  border-color: #c7d0dd transparent transparent transparent !important;
}

.dark-style .select2-container--open .select2-selection__arrow b,
[data-bs-theme='dark'] .select2-container--open .select2-selection__arrow b,
body[data-theme='dark'] .select2-container--open .select2-selection__arrow b {
  border-color: transparent transparent #c7d0dd transparent !important;
}

/* Placeholder */
.dark-style .select2-selection__placeholder,
[data-bs-theme='dark'] .select2-selection__placeholder,
body[data-theme='dark'] .select2-selection__placeholder {
  color: #8e9baa !important;
}

/* Tags múltiplas */
.dark-style .select2-selection--multiple .select2-selection__choice,
[data-bs-theme='dark'] .select2-selection--multiple .select2-selection__choice,
body[data-theme='dark'] .select2-selection--multiple .select2-selection__choice {
  background-color: #3d4d5f !important;
  border: 1px solid #4d5d6f !important;
  color: #c7d0dd !important;
}

/* Remover cores do bootstrap-5 theme */
.dark-style .select2-container--bootstrap-5 .select2-dropdown .select2-results__options,
[data-bs-theme='dark'] .select2-container--bootstrap-5 .select2-dropdown .select2-results__options {
  background-color: #2a3847 !important;
}

/* Garantir que nenhum elemento filho herde cores indesejadas */
.dark-style .select2-container *,
[data-bs-theme='dark'] .select2-container *,
body[data-theme='dark'] .select2-container * {
  border-color: inherit;
}

/* Texto em todos os elementos do select2 */
.dark-style .select2-container--bootstrap-5 .select2-selection,
.dark-style .select2-container--bootstrap-5 .select2-dropdown,
.dark-style .select2-container--bootstrap-5 .select2-results__option,
[data-bs-theme='dark'] .select2-container--bootstrap-5 .select2-selection,
[data-bs-theme='dark'] .select2-container--bootstrap-5 .select2-dropdown,
[data-bs-theme='dark'] .select2-container--bootstrap-5 .select2-results__option {
  font-size: inherit;
  font-family: inherit;
}
