﻿/**
 * sga â€” tema escuro (Bootstrap 5.3 data-bs-theme="dark" + ajustes customizados).
 */

/* BotÃ£o alternar tema */
.sga-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid transparent;
  line-height: 1;
}

.sga-theme-toggle .bi {
  font-size: 1.05rem;
}

[data-bs-theme="light"] .sga-theme-icon-light,
[data-bs-theme="dark"] .sga-theme-icon-dark {
  display: none;
}

.sga-theme-toggle-wrap--login {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1050;
}

[data-bs-theme="dark"] .sga-theme-toggle {
  color: #f8f9fa;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="light"] .topbar .sga-theme-toggle {
  color: var(--sga-topbar-icon, #4570B4);
  border-color: rgba(69, 112, 180, 0.25);
  background: rgba(69, 112, 180, 0.08);
}

[data-bs-theme="dark"] .topbar .sga-theme-toggle {
  color: #e9ecef;
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="light"] .sga-theme-toggle-wrap--login .sga-theme-toggle {
  color: #4570B4;
  border-color: rgba(69, 112, 180, 0.3);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.12);
}

/* VariÃ¡veis da topbar no escuro (menu lateral mantÃ©m cores da empresa) */
:root {
  --sga-tv-bg: #eef1f5;
  --sga-tv-bar-bg: #ffffff;
  --sga-tv-chip-bg: #ffffff;
  --sga-tv-chip-border: #dee2e6;
  --sga-tv-chip-text: #495057;
  --sga-tv-chip-nome: #212529;
}

[data-bs-theme="dark"] {
  --sga-topbar-bg: #1e2125;
  --sga-topbar-text: #e9ecef;
  --sga-topbar-border: #343a40;
  --sga-topbar-icon: #9ec5f0;
  --sga-tv-bg: #121416;
  --sga-tv-bar-bg: #1e2125;
  --sga-tv-chip-bg: #2b3035;
  --sga-tv-chip-border: #495057;
  --sga-tv-chip-text: #ced4da;
  --sga-tv-chip-nome: #e9ecef;
  color-scheme: dark;
}

[data-bs-theme="dark"] .main {
  background-color: #121416 !important;
}

[data-bs-theme="dark"] body.sga-modo-tv,
[data-bs-theme="dark"] body.sga-modo-tv .wrapper,
[data-bs-theme="dark"] body.sga-modo-tv .main,
[data-bs-theme="dark"] body.sga-modo-tv .content,
[data-bs-theme="dark"] body.sga-modo-tv .sga-tv-screen,
[data-bs-theme="dark"] #sga-tv-screen:fullscreen,
[data-bs-theme="dark"] #sga-tv-screen:-webkit-full-screen,
[data-bs-theme="dark"] #sga-tv-screen:-moz-full-screen,
[data-bs-theme="dark"] #sga-tv-screen:-ms-fullscreen {
  background-color: var(--sga-tv-bg, #121416) !important;
}

[data-bs-theme="dark"] body.sga-modo-tv .sga-tv-bar {
  background-color: var(--sga-tv-bar-bg, #1e2125) !important;
}

[data-bs-theme="dark"] body.sga-modo-tv .card,
[data-bs-theme="dark"] body.sga-modo-tv .card-kpi {
  background: #1e2125 !important;
  border-color: #343a40 !important;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.35) !important;
  color: #e9ecef;
}

[data-bs-theme="dark"] .content .card {
  background: #1e2125;
  border-color: #343a40 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

[data-bs-theme="dark"] .content h4,
[data-bs-theme="dark"] .content h5 {
  color: #e9ecef;
}

[data-bs-theme="dark"] .content .form-label {
  color: #ced4da;
}

[data-bs-theme="dark"] .content .form-control,
[data-bs-theme="dark"] .content .form-select {
  background-color: #2b3035;
  border-color: #495057;
  color: #f8f9fa;
}

[data-bs-theme="dark"] .content .form-control:hover,
[data-bs-theme="dark"] .content .form-select:hover {
  border-color: #6c757d;
}

[data-bs-theme="dark"] .content .form-control:focus,
[data-bs-theme="dark"] .content .form-select:focus {
  background-color: #2b3035;
  border-color: #6ea8fe;
  box-shadow: 0 0 0 0.22rem rgba(110, 168, 254, 0.2);
  color: #f8f9fa;
}

[data-bs-theme="dark"] .content .form-control::placeholder {
  color: #868e96;
}

[data-bs-theme="dark"] .content input[type="file"].form-control {
  background-color: #212529;
}

[data-bs-theme="dark"] .content .form-check-label {
  color: #ced4da;
}

[data-bs-theme="dark"] .content .form-check-input {
  border-color: #6c757d;
  background-color: #2b3035;
}

[data-bs-theme="dark"] .sga-form-section {
  background: #252a30;
  border-color: #3d444b;
}

[data-bs-theme="dark"] .sga-form-section-title {
  color: #9ec5f0;
  border-bottom-color: rgba(158, 197, 240, 0.35);
}

[data-bs-theme="dark"] .content .card-filtro {
  background: #252a30;
  border-color: #3d444b !important;
}

[data-bs-theme="dark"] .content .table {
  --bs-table-bg: transparent;
  --bs-table-color: #e9ecef;
  --bs-table-border-color: #373b3e;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.04);
  --bs-table-striped-color: #e9ecef;
  --bs-table-hover-bg: #2b3035;
  --bs-table-hover-color: #e9ecef;
  --bs-table-active-bg: #343a40;
  --bs-table-active-color: #e9ecef;
}

[data-bs-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: #e9ecef;
  --bs-table-border-color: #373b3e;
  --bs-table-hover-bg: #2b3035;
  --bs-table-hover-color: #e9ecef;
}

[data-bs-theme="dark"] .table > :not(caption) > * > * {
  background-color: var(--bs-table-bg);
  color: var(--bs-table-color);
  border-bottom-color: var(--bs-table-border-color);
  box-shadow: inset 0 0 0 9999px var(--bs-table-bg-state, var(--bs-table-bg));
}

[data-bs-theme="dark"] .content .table thead th,
[data-bs-theme="dark"] .table thead th {
  background-color: #2b3035 !important;
  color: #e9ecef !important;
  border-bottom-color: #495057 !important;
}

[data-bs-theme="dark"] .table-light {
  --bs-table-bg: #2b3035;
  --bs-table-color: #e9ecef;
  --bs-table-border-color: #495057;
}

[data-bs-theme="dark"] .table-light > :not(caption) > * > * {
  --bs-table-bg-state: #2b3035;
  --bs-table-color-state: #e9ecef;
  color: #e9ecef !important;
}

[data-bs-theme="dark"] tr.table-secondary > *,
[data-bs-theme="dark"] .table-secondary > :not(caption) > * > * {
  --bs-table-bg: #343a40;
  --bs-table-bg-state: #343a40;
  --bs-table-color: #ced4da;
  --bs-table-color-state: #ced4da;
  color: #ced4da !important;
}

[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
  --bs-table-bg-state: #2b3035;
  --bs-table-color-state: #e9ecef;
  color: #e9ecef !important;
}

[data-bs-theme="dark"] .content .table-hover tbody tr:hover {
  background-color: transparent;
}

[data-bs-theme="dark"] code {
  color: #f5b8d1;
}

[data-bs-theme="dark"] pre,
[data-bs-theme="dark"] pre.bg-light {
  background-color: #1a1d21 !important;
  color: #e9ecef !important;
  border: 1px solid #495057;
}

[data-bs-theme="dark"] .border {
  border-color: #495057 !important;
}

[data-bs-theme="dark"] .bg-light .text-muted,
[data-bs-theme="dark"] .border.rounded .text-muted {
  color: #adb5bd !important;
}

[data-bs-theme="dark"] .form-check-input {
  background-color: #2b3035;
  border-color: #6c757d;
}

[data-bs-theme="dark"] .form-check-input:checked {
  background-color: #4570B4;
  border-color: #4570B4;
}

[data-bs-theme="dark"] .dropdown-menu {
  background-color: #2b3035;
  border-color: #495057;
  color: #e9ecef;
}

[data-bs-theme="dark"] .dropdown-item {
  color: #e9ecef;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
  background-color: #343a40;
  color: #fff;
}

[data-bs-theme="dark"] .modal-content {
  background-color: #1e2125;
  border-color: #495057;
  color: #e9ecef;
}

[data-bs-theme="dark"] .list-group-item {
  background-color: #1e2125;
  border-color: #495057;
  color: #e9ecef;
}

[data-bs-theme="dark"] .sga-sort-link:hover {
  color: #9ec5f0;
}

[data-bs-theme="dark"] table.sga-grid-js thead th[data-sort]:hover {
  background-color: #2b3035;
}

[data-bs-theme="dark"] .sga-grid-footer {
  border-top-color: #373b3e;
}

[data-bs-theme="dark"] .footer {
  background-color: #1a1d21;
  color: #adb5bd;
  border-top-color: #343a40 !important;
}

[data-bs-theme="dark"] .topbar-user-toggle:hover,
[data-bs-theme="dark"] .topbar-user-toggle:focus,
[data-bs-theme="dark"] .topbar-user-toggle.show {
  background: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .welcome-message h5,
[data-bs-theme="dark"] .user-info span {
  color: #e9ecef;
}

[data-bs-theme="dark"] .sidebar-minimizer {
  background-color: #2b3035;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .sidebar-minimizer .arrow-icon {
  color: #9ec5f0;
}

[data-bs-theme="dark"] .sga-apresentacao-banner {
  background: linear-gradient(90deg, #3d3418 0%, #4a3f1a 100%);
  border-bottom-color: #5c4f1f;
  color: #ffe8a1;
}

[data-bs-theme="dark"] .sga-apresentacao-banner .text-muted {
  color: #e6d9a8 !important;
}

[data-bs-theme="dark"] .sga-dash-filtros-card .card-header {
  background-color: #252a30 !important;
  border-bottom-color: #373b3e;
  color: #e9ecef;
}

[data-bs-theme="dark"] .sga-dash-filtros-resumo {
  color: #adb5bd !important;
}

/* Bootstrap utilitÃ¡rios que forÃ§am fundo claro */
[data-bs-theme="dark"] .bg-white {
  background-color: #252a30 !important;
  color: #e9ecef;
}

[data-bs-theme="dark"] .bg-light {
  background-color: #2b3035 !important;
  color: #e9ecef;
}

[data-bs-theme="dark"] .text-bg-light {
  background-color: #343a40 !important;
  color: #e9ecef !important;
}

/* Ficha do aluno (visualizar) — evita texto invisível em caixas brancas */
[data-bs-theme="dark"] .section-box {
  background: #1e2125 !important;
  color: #e9ecef !important;
  border-color: #343a40 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

[data-bs-theme="dark"] .section-box .section-title,
[data-bs-theme="dark"] .section-box h2,
[data-bs-theme="dark"] .section-box h5,
[data-bs-theme="dark"] .section-box h6,
[data-bs-theme="dark"] .section-box strong {
  color: #e9ecef !important;
}

[data-bs-theme="dark"] .section-box .text-muted {
  color: #adb5bd !important;
}

[data-bs-theme="dark"] .graduacao-card {
  background: #2b3035 !important;
  border-color: #495057 !important;
  color: #e9ecef !important;
}

[data-bs-theme="dark"] .graduacao-thumb {
  background: #1e2125 !important;
  border-color: #495057 !important;
}

[data-bs-theme="dark"] .card-header {
  background-color: #252a30;
  border-bottom-color: #373b3e;
  color: #e9ecef;
}

/* Topbar â€” reforÃ§o (empresa pode ter topbar branca no tema claro) */
[data-bs-theme="dark"] .topbar {
  background-color: var(--sga-topbar-bg, #1e2125) !important;
  border-bottom-color: var(--sga-topbar-border, #343a40) !important;
}

/* Seletor mÃºltiplo de lojas */
[data-bs-theme="dark"] .sga-lojas-multi-toggle {
  background-color: #2b3035 !important;
  border-color: #495057 !important;
  color: #f8f9fa !important;
}

[data-bs-theme="dark"] .sga-lojas-multi-chevron {
  color: #adb5bd;
}

[data-bs-theme="dark"] .sga-lojas-multi-panel {
  background: #2b3035 !important;
  border-color: #495057 !important;
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.45);
}

[data-bs-theme="dark"] .sga-lojas-multi-toolbar {
  background: #252a30 !important;
  border-bottom-color: #495057 !important;
}

[data-bs-theme="dark"] .sga-lojas-multi-toolbar .form-control {
  background-color: #1e2125;
  border-color: #495057;
  color: #f8f9fa;
}

[data-bs-theme="dark"] .sga-lojas-multi-item {
  color: #e9ecef;
}

[data-bs-theme="dark"] .sga-lojas-multi-item:hover,
[data-bs-theme="dark"] .sga-lojas-multi-item:focus-within {
  background: #343a40 !important;
}

[data-bs-theme="dark"] .sga-lojas-multi-limpar {
  color: #9ec5f0 !important;
}

[data-bs-theme="dark"] .sga-lojas-multi-vazio {
  color: #868e96 !important;
}

[data-bs-theme="dark"] .config-tema-preview {
  background: #2b3035 !important;
  border-color: #495057 !important;
}

[data-bs-theme="dark"] .dropdown-header .text-dark {
  color: #f8f9fa !important;
}

/* Login / recuperar senha / erro pÃºblico */
[data-bs-theme="dark"] body.login-page {
  background-color: #0f1216;
  background-image: linear-gradient(160deg, #0f1216 0%, #1a2332 50%, #0f1216 100%);
}

[data-bs-theme="dark"] body.login-page .login-card,
[data-bs-theme="dark"] body.login-page .sga-erro-card {
  background: #1e2125;
  border-color: #343a40;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .login-empresa-nome {
  color: #e9ecef;
}

[data-bs-theme="dark"] .login-brand-title {
  color: #9ec5f0;
}

[data-bs-theme="dark"] .rec-steps li {
  color: #6c757d;
}

[data-bs-theme="dark"] .rec-steps li::before {
  background: #495057;
  color: #adb5bd;
}

[data-bs-theme="dark"] .rec-steps li.active {
  color: #9ec5f0;
}

[data-bs-theme="dark"] .rec-steps li.active::before {
  background: #4570B4;
  color: #fff;
}

[data-bs-theme="dark"] .rec-steps li.done {
  color: #75b798;
}

[data-bs-theme="dark"] .rec-steps li.done::before {
  background: #198754;
}

[data-bs-theme="dark"] .sga-erro-wrap .sga-erro-card.border {
  border-color: #343a40 !important;
}

/* Contraste de botões no dark (Novo, Editar, Reativar, ícones de ação) */
[data-bs-theme="dark"] .btn-sga,
[data-bs-theme="dark"] .btn-primary,
[data-bs-theme="dark"] .content .btn-primary,
[data-bs-theme="dark"] .btn-sga-outline,
[data-bs-theme="dark"] .btn-outline-primary,
[data-bs-theme="dark"] .content .btn-outline-primary {
  background-color: var(--sga-menu-accent, #3B7DDD) !important;
  border-color: var(--sga-menu-accent, #3B7DDD) !important;
  color: #fff !important;
}

[data-bs-theme="dark"] .btn-sga:hover,
[data-bs-theme="dark"] .btn-primary:hover,
[data-bs-theme="dark"] .content .btn-primary:hover,
[data-bs-theme="dark"] .btn-sga-outline:hover,
[data-bs-theme="dark"] .btn-outline-primary:hover,
[data-bs-theme="dark"] .content .btn-outline-primary:hover {
  background-color: #5a8fe0 !important;
  border-color: #5a8fe0 !important;
  color: #fff !important;
}

[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] .content .btn-outline-secondary {
  background-color: #495057 !important;
  border-color: #6c757d !important;
  color: #fff !important;
}

[data-bs-theme="dark"] .btn-outline-dark,
[data-bs-theme="dark"] .content .btn-outline-dark {
  background-color: #e9ecef !important;
  border-color: #e9ecef !important;
  color: #212529 !important;
}

[data-bs-theme="dark"] .btn-outline-danger,
[data-bs-theme="dark"] .content .btn-outline-danger {
  background-color: #dc3545 !important;
  border-color: #dc3545 !important;
  color: #fff !important;
}

[data-bs-theme="dark"] .btn-success,
[data-bs-theme="dark"] .btn-outline-success,
[data-bs-theme="dark"] .content .btn-outline-success {
  color: #fff !important;
}

[data-bs-theme="dark"] .btn-link {
  color: #9ec5f0 !important;
}

[data-bs-theme="dark"] .pagination .page-link {
  background-color: #2b3035;
  border-color: #495057;
  color: #e9ecef;
}

[data-bs-theme="dark"] .pagination .page-item.active .page-link {
  background-color: var(--sga-menu-accent, #3B7DDD);
  border-color: var(--sga-menu-accent, #3B7DDD);
  color: #fff;
}

/* Bootbox / modais de confirmação no dark */
[data-bs-theme="dark"] .bootbox .modal-content {
  background-color: #1e2125;
  color: #e9ecef;
  border-color: #343a40;
}

[data-bs-theme="dark"] .bootbox .modal-header,
[data-bs-theme="dark"] .bootbox .modal-footer {
  border-color: #343a40;
}

[data-bs-theme="dark"] .bootbox .modal-title {
  color: #f1f3f5;
}

[data-bs-theme="dark"] .bootbox .btn-close {
  filter: invert(1) grayscale(100%);
  opacity: 0.7;
}

