/* Well Coletas — paleta Light/Dark (espelho FlutterFlow)
 * Override Bootstrap via CSS variables — não editar styles.css
 */

:root {
  color-scheme: light;
  --well-tertiary: #00897B;
  --well-alternate: #E8F5E9;
  --well-nav-bg: #1B5E20;
  --well-nav-footer: #144015;
  --well-focus-ring: rgba(46, 125, 50, 0.25);

  --bs-primary: #2E7D32;
  --bs-primary-rgb: 46, 125, 50;
  --bs-secondary: #1B5E20;
  --bs-secondary-rgb: 27, 94, 32;
  --bs-success: #00875A;
  --bs-success-rgb: 0, 135, 90;
  --bs-danger: #D32F2F;
  --bs-danger-rgb: 211, 47, 47;
  --bs-warning: #E65100;
  --bs-warning-rgb: 230, 81, 0;
  --bs-info: #0288D1;
  --bs-info-rgb: 2, 136, 209;

  --bs-body-color: #1A241B;
  --bs-body-color-rgb: 26, 36, 27;
  --bs-body-bg: #F8FAF8;
  --bs-body-bg-rgb: 248, 250, 248;
  --bs-emphasis-color: #1A241B;
  --bs-emphasis-color-rgb: 26, 36, 27;
  --bs-secondary-color: #5F6D61;
  --bs-secondary-color-rgb: 95, 109, 97;
  --bs-tertiary-color: #5F6D61;
  --bs-tertiary-bg: #E8F5E9;
  --bs-tertiary-bg-rgb: 232, 245, 233;
  --bs-heading-color: #1A241B;
  --bs-border-color: #E0E6E1;
  --bs-border-color-translucent: rgba(26, 36, 27, 0.08);
  --bs-link-color: #2E7D32;
  --bs-link-hover-color: #1B5E20;

  --painel-surface: #FFFFFF;
  --painel-surface-2: #F8FAF8;
  --painel-text: #1A241B;
  --painel-text-muted: #5F6D61;
}

html[data-bs-theme="light"] body.sb-nav-fixed,
body.sb-nav-fixed {
  background-color: var(--bs-body-bg);
  color: var(--painel-text);
}

html[data-bs-theme="dark"] {
  color-scheme: dark;
  --well-tertiary: #4DB6AC;
  --well-alternate: #263328;
  --well-nav-bg: #1E2620;
  --well-nav-footer: #121814;
  --well-focus-ring: rgba(102, 187, 106, 0.25);

  --bs-primary: #66BB6A;
  --bs-primary-rgb: 102, 187, 106;
  --bs-secondary: #388E3C;
  --bs-secondary-rgb: 56, 142, 60;
  --bs-success: #57D9A3;
  --bs-success-rgb: 87, 217, 163;
  --bs-danger: #FF6B6B;
  --bs-danger-rgb: 255, 107, 107;
  --bs-warning: #FF9800;
  --bs-warning-rgb: 255, 152, 0;
  --bs-info: #29B6F6;
  --bs-info-rgb: 41, 182, 246;

  --bs-body-color: #E8F5E9;
  --bs-body-color-rgb: 232, 245, 233;
  --bs-body-bg: #121814;
  --bs-body-bg-rgb: 18, 24, 20;
  --bs-emphasis-color: #E8F5E9;
  --bs-emphasis-color-rgb: 232, 245, 233;
  --bs-secondary-color: #A3B8A5;
  --bs-secondary-color-rgb: 163, 184, 165;
  --bs-tertiary-color: #A3B8A5;
  --bs-tertiary-bg: #263328;
  --bs-tertiary-bg-rgb: 38, 51, 40;
  --bs-heading-color: #E8F5E9;
  --bs-border-color: #2C352E;
  --bs-border-color-translucent: rgba(255, 255, 255, 0.1);
  --bs-link-color: #66BB6A;
  --bs-link-hover-color: #81C784;

  --painel-surface: #1E2620;
  --painel-surface-2: #263328;
  --painel-text: #E8F5E9;
  --painel-text-muted: #A3B8A5;
}

html[data-bs-theme="dark"] body.sb-nav-fixed {
  background-color: var(--bs-body-bg);
  color: var(--painel-text);
}

html[data-bs-theme="dark"] #layoutSidenav_content,
html[data-bs-theme="dark"] #layoutSidenav_content main {
  background-color: var(--bs-body-bg);
  color: var(--painel-text);
}

html[data-bs-theme="dark"] h1,
html[data-bs-theme="dark"] h2,
html[data-bs-theme="dark"] h3,
html[data-bs-theme="dark"] h4,
html[data-bs-theme="dark"] h5,
html[data-bs-theme="dark"] h6,
html[data-bs-theme="dark"] .h1,
html[data-bs-theme="dark"] .h2,
html[data-bs-theme="dark"] .h3,
html[data-bs-theme="dark"] .h4,
html[data-bs-theme="dark"] .h5,
html[data-bs-theme="dark"] .h6 {
  color: var(--bs-heading-color);
}

html[data-bs-theme="dark"] .breadcrumb {
  background: transparent;
}

html[data-bs-theme="dark"] .breadcrumb-item,
html[data-bs-theme="dark"] .breadcrumb-item a {
  color: var(--painel-text-muted);
}

html[data-bs-theme="dark"] .breadcrumb-item.active {
  color: var(--painel-text);
}

html[data-bs-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
  color: #6c757d;
}

html[data-bs-theme="dark"] .card {
  background-color: var(--painel-surface);
  border-color: var(--bs-border-color);
  color: var(--painel-text);
}

html[data-bs-theme="dark"] .card-header,
html[data-bs-theme="dark"] .card-footer {
  background-color: var(--painel-surface-2);
  border-color: var(--bs-border-color);
  color: var(--painel-text);
}

html[data-bs-theme="dark"] .card-title,
html[data-bs-theme="dark"] .card-subtitle,
html[data-bs-theme="dark"] .card-text {
  color: var(--painel-text);
}

/* Utilitários que forçavam texto quase invisível no fundo escuro */
html[data-bs-theme="dark"] .text-dark,
html[data-bs-theme="dark"] .text-black,
html[data-bs-theme="dark"] .text-body {
  color: var(--painel-text) !important;
}

html[data-bs-theme="dark"] .text-muted,
html[data-bs-theme="dark"] .text-secondary,
html[data-bs-theme="dark"] .small.text-muted {
  color: var(--painel-text-muted) !important;
}

html[data-bs-theme="dark"] .text-black-50 {
  color: rgba(232, 236, 241, 0.55) !important;
}

/* Badges / fundos claros: manter texto escuro legível */
html[data-bs-theme="dark"] .bg-warning,
html[data-bs-theme="dark"] .bg-warning.text-dark,
html[data-bs-theme="dark"] .badge.bg-warning,
html[data-bs-theme="dark"] .badge.bg-info,
html[data-bs-theme="dark"] .badge.bg-light,
html[data-bs-theme="dark"] .bg-info.text-dark,
html[data-bs-theme="dark"] .bg-light.text-dark {
  color: #212529 !important;
}

html[data-bs-theme="dark"] .bg-white,
html[data-bs-theme="dark"] .bg-light {
  background-color: var(--painel-surface) !important;
  color: var(--painel-text) !important;
}

html[data-bs-theme="dark"] .form-label,
html[data-bs-theme="dark"] label {
  color: var(--painel-text);
}

/* ——— Dashboard (cores hardcoded no home) ——— */
html[data-bs-theme="dark"] .dash-section-title {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-bs-theme="dark"] .dash-section-title h5 {
  color: #d5dbe3 !important;
}

html[data-bs-theme="dark"] .dash-label {
  color: #a8b0bd !important;
}

html[data-bs-theme="dark"] .dash-value {
  color: #f3f5f7 !important;
}

html[data-bs-theme="dark"] .dash-sub {
  color: var(--painel-text-muted) !important;
}

html[data-bs-theme="dark"] .card.border-left-primary,
html[data-bs-theme="dark"] .card.border-left-success,
html[data-bs-theme="dark"] .card.border-left-info,
html[data-bs-theme="dark"] .card.border-left-warning,
html[data-bs-theme="dark"] .card.border-left-danger,
html[data-bs-theme="dark"] .dash-card {
  background-color: var(--painel-surface);
}

/* ——— Tabelas ——— */
html[data-bs-theme="dark"] .table {
  --bs-table-bg: var(--painel-surface);
  --bs-table-color: var(--painel-text);
  --bs-table-border-color: var(--bs-border-color);
  --bs-table-striped-bg: var(--painel-surface-2);
  --bs-table-striped-color: var(--painel-text);
  --bs-table-hover-bg: #2c352e;
  --bs-table-hover-color: #ffffff;
  --bs-table-active-bg: #2a3140;
  --bs-table-active-color: #ffffff;
  color: var(--painel-text);
  border-color: var(--bs-border-color);
}

html[data-bs-theme="dark"] .table > :not(caption) > * > *,
html[data-bs-theme="dark"] .table td,
html[data-bs-theme="dark"] .table th,
html[data-bs-theme="dark"] .table thead th,
html[data-bs-theme="dark"] .table tbody td {
  color: var(--painel-text) !important;
  border-color: var(--bs-border-color);
}

html[data-bs-theme="dark"] .table-light,
html[data-bs-theme="dark"] .table > :not(caption) > * > .table-light,
html[data-bs-theme="dark"] thead.table-light th {
  --bs-table-bg: var(--painel-surface-2);
  --bs-table-color: var(--painel-text);
  color: var(--painel-text) !important;
  background-color: var(--painel-surface-2) !important;
}

html[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  color: var(--painel-text) !important;
}

/* Diário de classe — aula em andamento, presença aguardando */
.table-striped > tbody > tr.diario-row-pendente > * {
  --bs-table-bg: rgba(255, 193, 7, 0.16);
  --bs-table-color: inherit;
  box-shadow: inset 3px 0 0 var(--bs-warning);
}

html[data-bs-theme="dark"] .table-striped > tbody > tr.diario-row-pendente > * {
  --bs-table-bg: rgba(230, 168, 0, 0.12);
  --bs-table-color: var(--painel-text);
  color: var(--painel-text) !important;
  box-shadow: inset 3px 0 0 var(--bs-warning);
}

html[data-bs-theme="dark"] .table-striped > tbody > tr.diario-row-pendente .form-select,
html[data-bs-theme="dark"] .table-striped > tbody > tr.diario-row-pendente .form-control {
  background-color: var(--painel-surface-2);
  color: var(--painel-text);
  border-color: var(--bs-border-color);
}

html[data-bs-theme="dark"] .list-group-item {
  background-color: var(--painel-surface);
  border-color: var(--bs-border-color);
  color: var(--painel-text);
}

html[data-bs-theme="dark"] .list-group-item-action:hover,
html[data-bs-theme="dark"] .list-group-item-action:focus {
  background-color: #2a3140;
  color: #fff;
}

/* ——— Forms ——— */
html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select,
html[data-bs-theme="dark"] .form-floating > .form-control,
html[data-bs-theme="dark"] .form-floating > .form-select {
  background-color: var(--bs-body-bg);
  border-color: var(--bs-border-color);
  color: var(--painel-text);
}

html[data-bs-theme="dark"] .form-control:focus,
html[data-bs-theme="dark"] .form-select:focus {
  background-color: var(--bs-body-bg);
  border-color: var(--bs-primary);
  color: var(--painel-text);
  box-shadow: 0 0 0 0.2rem var(--well-focus-ring);
}

html[data-bs-theme="dark"] .form-control::placeholder,
html[data-bs-theme="dark"] .form-control::-webkit-input-placeholder {
  color: #8b95a5;
  opacity: 1;
}

html[data-bs-theme="dark"] .form-control:disabled,
html[data-bs-theme="dark"] .form-select:disabled {
  background-color: var(--painel-surface-2);
  color: var(--painel-text-muted);
}

html[data-bs-theme="dark"] .form-floating > label {
  color: var(--painel-text-muted);
}

html[data-bs-theme="dark"] .form-check-label {
  color: var(--painel-text);
}

html[data-bs-theme="dark"] .input-group-text {
  background-color: var(--painel-surface-2);
  border-color: var(--bs-border-color);
  color: var(--painel-text-muted);
}

/* ——— Modals / dropdowns / nav ——— */
html[data-bs-theme="dark"] .modal-content {
  background-color: var(--painel-surface);
  color: var(--painel-text);
  border-color: var(--bs-border-color);
}

html[data-bs-theme="dark"] .modal-header,
html[data-bs-theme="dark"] .modal-footer {
  border-color: var(--bs-border-color);
}

html[data-bs-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%);
  opacity: 0.75;
}

/* SweetAlert2 — mesmo contraste dos modals Bootstrap */
html[data-bs-theme="dark"] .swal2-popup {
  background-color: var(--painel-surface);
  color: var(--painel-text);
  border: 1px solid var(--bs-border-color);
}

html[data-bs-theme="dark"] .swal2-title {
  color: var(--bs-heading-color);
}

html[data-bs-theme="dark"] .swal2-html-container,
html[data-bs-theme="dark"] .swal2-content {
  color: var(--painel-text);
}

html[data-bs-theme="dark"] .swal2-popup .form-label,
html[data-bs-theme="dark"] .swal2-popup label:not(.form-check-label) {
  color: var(--painel-text);
}

html[data-bs-theme="dark"] .swal2-popup .form-control,
html[data-bs-theme="dark"] .swal2-popup .form-select,
html[data-bs-theme="dark"] .swal2-popup textarea.form-control,
html[data-bs-theme="dark"] .swal2-input,
html[data-bs-theme="dark"] .swal2-textarea,
html[data-bs-theme="dark"] .swal2-select {
  background-color: var(--painel-surface-2);
  color: var(--painel-text);
  border-color: var(--bs-border-color);
}

html[data-bs-theme="dark"] .swal2-popup .form-control:focus,
html[data-bs-theme="dark"] .swal2-popup .form-select:focus,
html[data-bs-theme="dark"] .swal2-input:focus,
html[data-bs-theme="dark"] .swal2-textarea:focus,
html[data-bs-theme="dark"] .swal2-select:focus {
  background-color: var(--painel-surface-2);
  color: var(--painel-text);
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem var(--well-focus-ring);
}

html[data-bs-theme="dark"] .swal2-popup .form-control::placeholder,
html[data-bs-theme="dark"] .swal2-input::placeholder,
html[data-bs-theme="dark"] .swal2-textarea::placeholder {
  color: #8b95a5;
}

html[data-bs-theme="dark"] .swal2-popup .text-muted,
html[data-bs-theme="dark"] .swal2-popup .text-secondary {
  color: var(--painel-text-muted) !important;
}

html[data-bs-theme="dark"] .swal2-popup strong {
  color: var(--bs-heading-color);
}

html[data-bs-theme="dark"] .swal2-validation-message {
  background-color: #3d2020;
  color: #f8d7da;
}

html[data-bs-theme="dark"] .swal2-close {
  color: var(--painel-text-muted);
}

html[data-bs-theme="dark"] .swal2-close:hover {
  color: var(--painel-text);
}

html[data-bs-theme="dark"] .swal2-footer {
  border-top-color: var(--bs-border-color);
  color: var(--painel-text-muted);
}

html[data-bs-theme="dark"] .dropdown-menu {
  background-color: var(--painel-surface);
  border-color: var(--bs-border-color);
}

html[data-bs-theme="dark"] .dropdown-item {
  color: var(--painel-text);
}

html[data-bs-theme="dark"] .dropdown-item:hover,
html[data-bs-theme="dark"] .dropdown-item:focus {
  background-color: #2a3140;
  color: #fff;
}

html[data-bs-theme="dark"] .dropdown-divider {
  border-color: var(--bs-border-color);
}

html[data-bs-theme="dark"] .nav-tabs {
  border-color: var(--bs-border-color);
}

html[data-bs-theme="dark"] .nav-tabs .nav-link {
  color: var(--painel-text-muted);
}

html[data-bs-theme="dark"] .nav-tabs .nav-link.active {
  background-color: var(--painel-surface);
  border-color: var(--bs-border-color) var(--bs-border-color) var(--painel-surface);
  color: #fff;
}

html[data-bs-theme="dark"] .nav-link:not(.navbar-dark .nav-link):not(.sb-sidenav .nav-link) {
  color: var(--painel-text-muted);
}

html[data-bs-theme="dark"] .alert-secondary,
html[data-bs-theme="dark"] .alert-light {
  background-color: var(--painel-surface-2);
  border-color: var(--bs-border-color);
  color: #ced4da;
}

html[data-bs-theme="dark"] .border,
html[data-bs-theme="dark"] .border-bottom,
html[data-bs-theme="dark"] .border-top,
html[data-bs-theme="dark"] .border-start,
html[data-bs-theme="dark"] .border-end {
  border-color: var(--bs-border-color) !important;
}

html[data-bs-theme="dark"] .shadow,
html[data-bs-theme="dark"] .shadow-sm {
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.45) !important;
}

html[data-bs-theme="dark"] .page-link {
  background-color: var(--painel-surface);
  border-color: var(--bs-border-color);
  color: #adb5bd;
}

html[data-bs-theme="dark"] .page-item.active .page-link {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
}

html[data-bs-theme="dark"] .page-item.disabled .page-link {
  background-color: #1e2430;
  color: #6c757d;
}

/* ——— CRM Kanban: cards claros herdavam texto do .card escuro ——— */
html[data-bs-theme="dark"] .kanban-card {
  background: var(--painel-surface-2) !important;
  border-color: #3a4250 !important;
  color: var(--painel-text) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html[data-bs-theme="dark"] .kanban-card.lead-esquecido {
  background: #2a1f22 !important;
  border-left-color: #dc3545 !important;
}

html[data-bs-theme="dark"] .kanban-card .lead-nome {
  color: #f3f5f7 !important;
}

html[data-bs-theme="dark"] .kanban-card .lead-meta {
  color: var(--painel-text-muted) !important;
}

html[data-bs-theme="dark"] .kanban-card .lead-valor {
  color: #75b798 !important;
}

html[data-bs-theme="dark"] .kanban-ghost {
  background: #2a3140 !important;
}

/* ——— CRM histórico (timeline): cards claros herdavam texto claro ——— */
html[data-bs-theme="dark"] .timeline-list::before {
  background: #3a4250;
}

html[data-bs-theme="dark"] .timeline-icon {
  background: var(--painel-surface-2) !important;
  border-color: #3a4250 !important;
  color: var(--painel-text-muted) !important;
}

html[data-bs-theme="dark"] .timeline-content {
  background: var(--painel-surface-2) !important;
  border-color: #3a4250 !important;
  color: var(--painel-text) !important;
}

html[data-bs-theme="dark"] .timeline-content strong,
html[data-bs-theme="dark"] .timeline-content p {
  color: var(--painel-text) !important;
}

html[data-bs-theme="dark"] .timeline-content .text-muted {
  color: var(--painel-text-muted) !important;
}

/* ——— CRM Tarefas (Trello): colunas/cards claros herdavam texto claro ——— */
html[data-bs-theme="dark"] .trello-coluna {
  background: #1e2430 !important;
  color: var(--painel-text) !important;
}

html[data-bs-theme="dark"] .trello-coluna-titulo,
html[data-bs-theme="dark"] .trello-coluna-titulo:focus {
  color: #f3f5f7 !important;
  background: transparent !important;
}

html[data-bs-theme="dark"] .trello-coluna-titulo:focus {
  background: rgba(255, 255, 255, 0.06) !important;
}

html[data-bs-theme="dark"] .trello-card {
  background: var(--painel-surface-2) !important;
  border-color: #3a4250 !important;
  color: var(--painel-text) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html[data-bs-theme="dark"] .trello-card-titulo {
  color: #f3f5f7 !important;
}

html[data-bs-theme="dark"] .trello-card-meta {
  color: var(--painel-text-muted) !important;
}

html[data-bs-theme="dark"] .trello-card-badge {
  color: #75b798 !important;
  background: rgba(25, 135, 84, 0.2) !important;
}

html[data-bs-theme="dark"] .trello-btn-add-card {
  color: var(--painel-text-muted) !important;
}

html[data-bs-theme="dark"] .trello-btn-add-card:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--painel-text) !important;
}

html[data-bs-theme="dark"] .trello-ghost {
  background: #2a3140 !important;
}

html[data-bs-theme="dark"] .tarefa-sidebar {
  background: var(--painel-surface) !important;
  border-color: #3a4250 !important;
  color: var(--painel-text) !important;
}

html[data-bs-theme="dark"] .tarefa-comentario-item {
  background: var(--painel-surface-2) !important;
  border-color: #3a4250 !important;
  color: var(--painel-text) !important;
}

html[data-bs-theme="dark"] .checklist-item {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-bs-theme="dark"] .checklist-item label {
  color: var(--painel-text) !important;
}

html[data-bs-theme="dark"] .checklist-item.concluido label {
  color: var(--painel-text-muted) !important;
}

/* Links genéricos no conteúdo */
html[data-bs-theme="dark"] main a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.navbar-brand) {
  color: var(--bs-link-color);
}

html[data-bs-theme="dark"] main a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):hover {
  color: var(--bs-link-hover-color);
}

/* Notificações staff (navbar) */
.staff-notif-menu {
  min-width: 300px;
  max-width: 380px;
  max-height: min(70vh, 420px);
  overflow: hidden;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.15);
}
.staff-notif-lista {
  max-height: min(60vh, 360px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.staff-notif-item {
  white-space: normal;
}
.staff-notif-item .staff-notif-titulo,
.staff-notif-item .staff-notif-msg {
  word-break: break-word;
  overflow-wrap: anywhere;
}
.staff-notif-item.staff-notif-unread {
  background: rgba(var(--bs-primary-rgb), 0.08);
}
html[data-bs-theme="dark"] .staff-notif-item.staff-notif-unread {
  background: rgba(var(--bs-primary-rgb), 0.15);
}
#nav-notif-wrap .nav-link {
  color: rgba(255, 255, 255, 0.85);
}
.staff-notif-badge {
  font-size: 10px;
  min-width: 18px;
  line-height: 1.2;
  padding: 2px 5px;
}

/* Mobile: painel fixo, largura total, sem corte */
.staff-notif-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(0, 0, 0, 0.45);
}
@media (max-width: 767.98px) {
  .sb-nav-fixed .sb-topnav {
    overflow: visible !important;
  }
  #nav-notif-wrap .staff-notif-menu {
    position: fixed !important;
    inset: auto 8px auto 8px !important;
    top: calc(56px + env(safe-area-inset-top, 0px)) !important;
    transform: none !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: calc(100vh - 72px - env(safe-area-inset-top, 0px)) !important;
    margin: 0 !important;
    z-index: 1055 !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  }
  .staff-notif-lista {
    max-height: calc(100vh - 140px - env(safe-area-inset-top, 0px));
  }
  .staff-notif-marcar-btn {
    font-size: 0.875rem;
  }
}

/* Banner instalar PWA */
.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1080;
  background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%);
  color: #fff;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
  padding: 12px 16px;
}
.pwa-install-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
@media (max-width: 575.98px) {
  .pwa-install-inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}

/* ── Navbar / sidebar / footer (marca Well) ── */
.sb-topnav.navbar-dark.bg-dark,
footer.bg-dark {
  background-color: var(--well-nav-bg) !important;
}

.sb-sidenav-dark {
  background-color: var(--well-nav-bg) !important;
  color: rgba(255, 255, 255, 0.75);
}

.sb-sidenav-dark .sb-sidenav-menu .nav-link.active {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sb-sidenav-dark .sb-sidenav-footer {
  background-color: var(--well-nav-footer) !important;
}

html[data-bs-theme="light"] .page-item.active .page-link {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

html[data-bs-theme="light"] .form-control:focus,
html[data-bs-theme="light"] .form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem var(--well-focus-ring);
}

html[data-bs-theme="light"] .card {
  background-color: var(--painel-surface);
  border-color: var(--bs-border-color);
}

html[data-bs-theme="light"] .alert-info {
  --bs-alert-color: #01579b;
  --bs-alert-bg: #e1f5fe;
  --bs-alert-border-color: #b3e5fc;
}

/* Login — foto ecológica (--well-login-bg-image definido nas views de login) */
body.well-login-page,
body.well-login-page #layoutAuthentication {
  background-color: #1b5e20 !important;
  background-image: linear-gradient(
    135deg,
    rgba(27, 94, 32, 0.55) 0%,
    rgba(46, 125, 50, 0.45) 50%,
    rgba(0, 105, 92, 0.5) 100%
  ), var(--well-login-bg-image) !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}

html:has(body.well-login-page),
body.well-login-page {
  min-height: 100%;
}

body.well-login-page #layoutAuthentication {
  min-height: 100vh;
}

body.well-login-page #layoutAuthentication_content,
body.well-login-page #layoutAuthentication_content main {
  background: transparent !important;
}

body.well-login-page #layoutAuthentication .card.well-login-card {
  border: 0;
  box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.22);
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

body.well-login-page #layoutAuthentication .well-login-card .login-brand {
  padding: 0.75rem 1rem 0;
}

body.well-login-page #layoutAuthentication .well-login-card .card-header {
  padding: 0.5rem 1rem;
  background: transparent;
  border-bottom: 0;
}

body.well-login-page #layoutAuthentication .well-login-card .card-header h3 {
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0;
}

body.well-login-page #layoutAuthentication .well-login-card .card-body {
  padding: 0.75rem 1.25rem 1.25rem;
}

body.well-login-page #layoutAuthentication .well-login-card .form-floating {
  margin-bottom: 0.65rem !important;
}

body.well-login-page #layoutAuthentication .well-login-card .form-floating > .form-control {
  min-height: calc(2.75rem + 2px);
  padding-top: 1rem;
  padding-bottom: 0.35rem;
}

body.well-login-page #layoutAuthentication .well-login-card .btn-primary {
  padding: 0.35rem 1rem;
  font-size: 0.9rem;
}

body.well-login-page #layoutAuthentication_footer footer {
  background: rgba(18, 24, 20, 0.85) !important;
  backdrop-filter: blur(4px);
}

/* ── Marca Well ── */
.login-logo {
  max-width: 160px;
  width: 100%;
  height: auto;
}

body.well-login-page .login-logo {
  max-width: 108px;
}

/* Marca no topbar (alinha com largura do menu lateral — padrão SB Admin) */
.sb-topnav .navbar-brand.well-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  white-space: nowrap;
}

.sb-topnav .navbar-brand .well-brand-logo {
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.sb-topnav .navbar-brand .well-brand-text {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  color: #fff;
}

.sb-sidenav-toggled .sb-topnav .navbar-brand .well-brand-text {
  display: none;
}

.sb-sidenav-toggled .sb-topnav .navbar-brand.well-brand {
  justify-content: center;
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
}

/* Paginação compacta */
.crud-pagination-nav {
  margin-top: 1rem;
  overflow-x: auto;
}

.crud-pagination-nav .pagination {
  margin-bottom: 0;
}

.crud-filters-row .form-select,
.crud-filters-row .form-control {
  min-width: 140px;
}

.card-header .btn-primary.btn-sm {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Dashboard — KPIs clicáveis */
.dashboard-kpi-card {
  cursor: pointer;
  border-radius: var(--bs-border-radius, 0.375rem);
}

.dashboard-kpi-card--static {
  cursor: default;
}

.dashboard-kpi-card--static .dashboard-kpi-hint {
  display: none;
}

.dashboard-kpi-card .card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-kpi-card:hover .card,
.dashboard-kpi-card:focus-visible .card {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12) !important;
}

.dashboard-kpi-card--static .card:hover {
  transform: none;
  box-shadow: var(--bs-box-shadow-sm) !important;
}

.dashboard-kpi-card:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

.dashboard-kpi-hint {
  margin-top: 0.25rem;
  opacity: 0.85;
}

.dashboard-kpi-card:hover .dashboard-kpi-hint {
  color: var(--bs-primary) !important;
}
