/* v56 — revisão global de legibilidade claro/escuro */

/* Área pública: tema + login sempre no mesmo eixo */
.topo-marca .topo-marca-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:nowrap;
}
.topo-marca .topo-marca-actions .theme-toggle{
  position:static;
  top:auto;right:auto;
  z-index:auto;
  margin:0;
  box-shadow:none;
  white-space:nowrap;
}
.topo-marca .topo-marca-actions .btn-area-equipe{white-space:nowrap}
@media(max-width:640px){
  .topo-marca{gap:12px}
  .topo-marca .topo-marca-actions{gap:6px}
  .topo-marca .topo-marca-actions .theme-toggle{padding:8px 10px}
  .topo-marca .topo-marca-actions .theme-toggle .theme-label{display:none}
}

/* Componentes de formulário compartilhados */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .sa-input,
html[data-theme="dark"] .sa-select,
html[data-theme="dark"] .sa-textarea,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{
  background:#111625 !important;
  color:#eef2ff !important;
  border-color:#3b465f !important;
}
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] .sa-input:focus,
html[data-theme="dark"] .sa-select:focus,
html[data-theme="dark"] .sa-textarea:focus{
  background:#131a2c !important;
  color:#fff !important;
  border-color:#6b84ff !important;
  box-shadow:0 0 0 3px rgba(91,116,255,.18) !important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder,
html[data-theme="dark"] .form-control::placeholder{
  color:#8995ad !important;
  opacity:1 !important;
}
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .sa-label,
html[data-theme="dark"] label{color:#dbe3f7 !important}
html[data-theme="dark"] .sa-help,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] small{color:#aeb8cc !important}

/* Cards e componentes presentes nas telas de cadastro */
html[data-theme="dark"] .cardx,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .rule,
html[data-theme="dark"] .rule-card,
html[data-theme="dark"] .calendar-box,
html[data-theme="dark"] .segment-box,
html[data-theme="dark"] .picker,
html[data-theme="dark"] .picker-box,
html[data-theme="dark"] .teacher-row,
html[data-theme="dark"] .school-event-row,
html[data-theme="dark"] .school-item,
html[data-theme="dark"] .screen-card,
html[data-theme="dark"] .screen-link,
html[data-theme="dark"] .slot-row,
html[data-theme="dark"] .tour-card,
html[data-theme="dark"] .tour-confirm-card,
html[data-theme="dark"] .tour-confirm-item,
html[data-theme="dark"] .child-row,
html[data-theme="dark"] .report-list,
html[data-theme="dark"] .report-table-wrap,
html[data-theme="dark"] .sa-panel,
html[data-theme="dark"] .sa-card{
  background:#151a2a !important;
  color:#eef2ff !important;
  border-color:#2f3a52 !important;
}

/* Textos internos que tinham cores fixas claras */
html[data-theme="dark"] .rule strong,
html[data-theme="dark"] .rule-card strong,
html[data-theme="dark"] .metric strong,
html[data-theme="dark"] .segment-head strong,
html[data-theme="dark"] .teacher-row strong,
html[data-theme="dark"] .tour-head h1,
html[data-theme="dark"] .tour-confirm-head h1,
html[data-theme="dark"] .tour-confirm-value,
html[data-theme="dark"] .report-page h1,
html[data-theme="dark"] .report-page h2,
html[data-theme="dark"] .report-page h3{
  color:#f4f7ff !important;
}
html[data-theme="dark"] .rule small,
html[data-theme="dark"] .rule-card small,
html[data-theme="dark"] .metric small,
html[data-theme="dark"] .segment-box small,
html[data-theme="dark"] .teacher-row small,
html[data-theme="dark"] .report-contact,
html[data-theme="dark"] .report-wa{
  color:#aeb8cc !important;
}

/* Escolinhas */
html[data-theme="dark"] .pill-day,
html[data-theme="dark"] .day-check span{
  background:#1a2340 !important;
  color:#e8edff !important;
  border-color:#3a4661 !important;
}
html[data-theme="dark"] .day-check input:checked + span{
  background:#314aab !important;
  color:#fff !important;
  border-color:#617dff !important;
}
html[data-theme="dark"] .exception-card{background:#191c2b !important;border-left-color:#ff5575 !important}

/* Tours: estados e seleção */
html[data-theme="dark"] .tour-slot,
html[data-theme="dark"] .tour-day-item,
html[data-theme="dark"] .tour-cta{
  background:#151a2a !important;
  color:#eef2ff !important;
  border-color:#33405e !important;
}
html[data-theme="dark"] .tour-empty{background:#111625 !important;color:#9eabc2 !important;border-color:#33405e !important}
html[data-theme="dark"] .tour-slot.is-selected,
html[data-theme="dark"] .tour-day-item.is-selected{background:#1b2f67 !important;border-color:#5c78ff !important;color:#fff !important}

/* Relatórios */
html[data-theme="dark"] .report-tabs a,
html[data-theme="dark"] .report-pill{
  background:#151b2b !important;
  color:#dbe3ff !important;
  border-color:#33405e !important;
}
html[data-theme="dark"] .report-tabs a.active,
html[data-theme="dark"] .report-pill.is-active{
  background:#243b84 !important;
  color:#fff !important;
  border-color:#5573e8 !important;
}
html[data-theme="dark"] .report-table,
html[data-theme="dark"] .report-table thead,
html[data-theme="dark"] .report-table tbody,
html[data-theme="dark"] .report-table th,
html[data-theme="dark"] .report-table td{
  background:#151a2a !important;
  color:#eef2ff !important;
  border-color:#2f3a52 !important;
}
html[data-theme="dark"] .report-table th{background:#111625 !important;color:#bfc9dc !important}

/* Elementos Bootstrap que ainda usam variáveis claras */
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .popover-body,
html[data-theme="dark"] .tooltip-inner{background:#151a2a !important;color:#eef2ff !important}
html[data-theme="dark"] .dropdown-item:hover{background:#202941 !important;color:#fff !important}
html[data-theme="dark"] .form-check-label{color:#dbe3f7 !important}
html[data-theme="dark"] .form-check-input{background-color:#111625 !important;border-color:#4a5670 !important}
html[data-theme="dark"] .form-check-input:checked{background-color:#2f5dff !important;border-color:#2f5dff !important}

/* Light mode: padronização discreta sem alterar a identidade atual */
html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select,
html[data-theme="light"] .sa-input,
html[data-theme="light"] .sa-select,
html[data-theme="light"] .sa-textarea{
  color:#172033;
  background:#fff;
  border-color:#dfe4ef;
}
html[data-theme="light"] .form-control:focus,
html[data-theme="light"] .form-select:focus,
html[data-theme="light"] .sa-input:focus,
html[data-theme="light"] .sa-select:focus,
html[data-theme="light"] .sa-textarea:focus{
  border-color:#2f5dff;
  box-shadow:0 0 0 3px rgba(47,93,255,.10);
}

/* Compatibilidade com telas públicas que usam .sa-dark legado */
html[data-theme="dark"] .tour-card,
html[data-theme="dark"] .tour-head,
html[data-theme="dark"] .tour-body,
html[data-theme="dark"] .tour-confirm-card,
html[data-theme="dark"] .tour-confirm-head,
html[data-theme="dark"] .tour-confirm-item{
  background:#151a2a !important;
  color:#eef2ff !important;
  border-color:#33405e !important;
}
html[data-theme="dark"] .tour-head h1,
html[data-theme="dark"] .tour-section-title,
html[data-theme="dark"] .tour-body .form-label,
html[data-theme="dark"] .tour-confirm-head h1,
html[data-theme="dark"] .tour-confirm-value{color:#f4f7ff !important}
html[data-theme="dark"] .tour-body .sa-input,
html[data-theme="dark"] .tour-body .sa-select,
html[data-theme="dark"] .tour-body .sa-textarea,
html[data-theme="dark"] .child-row,
html[data-theme="dark"] .tour-slot{
  background:#111827 !important;
  color:#eef2ff !important;
  border-color:#3a4661 !important;
}
html[data-theme="dark"] .tour-empty,
html[data-theme="dark"] .tour-add-btn{background:#111827 !important;color:#b9c2d6 !important;border-color:#43506b !important}

/* Administração: cartões e modais legados com background fixo */
html[data-theme="dark"] .sa-admin-card,
html[data-theme="dark"] .sa-admin-stat,
html[data-theme="dark"] .sa-quick-actions a,
html[data-theme="dark"] .sa-content-counts div,
html[data-theme="dark"] .sa-home-module,
html[data-theme="dark"] .sa-slider-content-box,
html[data-theme="dark"] .sa-slider-fit-help,
html[data-theme="dark"] .sa-media-picker__preview img{
  background:#151a2a !important;
  color:#eef2ff !important;
  border-color:#33405e !important;
}
html[data-theme="dark"] .sa-admin-card h1,
html[data-theme="dark"] .sa-admin-card h2,
html[data-theme="dark"] .sa-admin-stat strong,
html[data-theme="dark"] .sa-home-module strong,
html[data-theme="dark"] .sa-setting-field span,
html[data-theme="dark"] .sa-slider-admin-intro strong,
html[data-theme="dark"] .sa-slider-fit-help strong{color:#eef2ff !important}
html[data-theme="dark"] .sa-admin-stat span,
html[data-theme="dark"] .sa-admin-stat small,
html[data-theme="dark"] .sa-content-counts span,
html[data-theme="dark"] .sa-meta-grid,
html[data-theme="dark"] .sa-setting-field{color:#aeb8cc}
html[data-theme="dark"] .sa-admin-hero{color:#fff}

/* Navegação pública: botão de tema e login visualmente equivalentes */
html[data-theme="dark"] .topo-marca .btn-area-equipe{
  background:#1b2a55 !important;
  color:#eef2ff !important;
  border-color:#3b4b73 !important;
}
html[data-theme="dark"] .topo-marca .btn-area-equipe:hover{background:#24386c !important}
.topo-marca .theme-slot{display:inline-flex;align-items:center}


/* =====================================================================
   SIDEBAR INSTITUCIONAL — paleta alinhada ao rodapé Salesianas
   ===================================================================== */
body.sa-app .sa-sidebar {
    background: #050F49 !important;
    border-right-color: #273064 !important;
    color: #fff !important;
    box-shadow: 10px 0 30px rgba(5,15,73,.14);
}
body.sa-app .sa-sidebar .sa-brand {
    border-bottom: 1px solid #273064;
}
body.sa-app .sa-sidebar .sa-brand strong {
    color: #fff !important;
}
body.sa-app .sa-sidebar .sa-brand small {
    color: #b8bed9 !important;
}
body.sa-app .sa-sidebar .sa-side-label {
    color: #b8bed9 !important;
}
body.sa-app .sa-sidebar a {
    color: #b8bed9 !important;
    background: transparent !important;
}
body.sa-app .sa-sidebar a span {
    color: inherit !important;
}
body.sa-app .sa-sidebar a:hover {
    background: rgba(255,255,255,.08) !important;
    color: #fff !important;
}
body.sa-app .sa-sidebar a.active,
body.sa-app .sa-sidebar a[aria-current="page"] {
    position: relative;
    background: rgba(255,255,255,.12) !important;
    color: #fff !important;
}
body.sa-app .sa-sidebar a.active::before,
body.sa-app .sa-sidebar a[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 24px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: #F61C44;
}
@media (max-width: 800px) {
    body.sa-app .sa-sidebar {
        border-right-color: #273064 !important;
        box-shadow: 18px 0 42px rgba(0,0,0,.32);
    }
    body.sa-app .sa-mobile-menu-toggle {
        background: #050F49 !important;
        border-color: #273064 !important;
        color: #fff !important;
    }
    body.sa-app .sa-mobile-menu-toggle[aria-expanded="true"] {
        background: #F61C44 !important;
        border-color: #F61C44 !important;
    }
}
