/* As fontes agora são carregadas por <link> no <head> do admin.html, em
   paralelo com este arquivo. O @import que ficava aqui só disparava o
   download depois que o CSS inteiro chegava, atrasando o texto na tela.
   Fallbacks reais estão declarados nas próprias regras (ver KK UI v2). */

:root {
  /* As cores e as fontes da imobiliaria (navy, gold, neutros, accent, status, escalas --kk2-navy/gold/ring)
     ficam em marca.css, carregado logo depois deste arquivo (T-0220). */

  /* Aliases de compatibilidade — mantêm estilos inline legados coerentes
     com os tokens oficiais e com o Dark Mode (evita fundos transparentes
     e bordas currentcolor de variáveis inexistentes). */
  --border-color: var(--border);
  --bg-card: var(--surface);
  --bg-main: var(--bg-admin);
  --gold-dark: var(--gold-hover);
  --text-secondary: var(--text-muted);

  /* Mais aliases usados em estilos inline dinâmicos (evita cair no fallback branco) */
  --card-bg: var(--surface);
  --table-head-bg: var(--surface-hover);
  --surface-2: var(--surface-hover);
  --bg-hover: var(--surface-hover);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --warning: #d97706;
  --info: #2563eb;

  /* --- Escala compartilhada de botões (consolidação) --- */
  --btn-radius: 8px;
  --btn-radius-sm: 6px;
  --btn-transition: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-admin);
  color: var(--text-main);
  min-height: 100vh;
}

/* Navbar */
.navbar {
  background: var(--navy);
  color: #ffffff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-brand img {
  height: 38px;
  width: auto;
}

.nav-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.nav-badge {
  background: var(--gold);
  color: #ffffff;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-logout {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: var(--btn-radius);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--btn-transition);
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Layout Principal */
.main-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* Cabeçalho do Dashboard */
.dash-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .dash-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.dash-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.dash-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.dash-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-buttons .btn-primary,
.dash-buttons .btn-gold,
.dash-buttons .btn-icon,
.dash-buttons .btn-action-header {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 8px;
  line-height: 1;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.btn-gold {
  background: var(--gold);
  color: #ffffff;
  border: 1px solid var(--gold);
  padding: 0 18px;
  height: 38px;
  border-radius: var(--btn-radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  line-height: 1;
  box-sizing: border-box;
  transition: var(--btn-transition);
}

.btn-gold:hover {
  background: var(--gold-hover);
}

.btn-icon-plus {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Cards de Resumo */

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--navy);
  margin-top: 4px;
}

/* Filtros e Busca */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .filter-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

.search-input {
  flex: 1 1 220px;
  min-width: 180px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--navy);
}

.status-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  background: #ffffff;
  outline: none;
  cursor: pointer;
}

/* Tabela de Credenciais */
.table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: var(--surface-hover);
}

.badge-code {
  font-family: 'Outfit', monospace;
  font-weight: 700;
  color: var(--navy);
  background: #f1f5f9;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
}

/* Tags de Status */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.status-pill.ativa {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.status-pill.treinamento {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.status-pill.inativa {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.status-pill.extravio {
  background: #450a0a;
  color: #fca5a5;
  border: 1px solid #7f1d1d;
}

.status-pill.substituida {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* Ações na Tabela */
.table-actions {
  display: flex;
  gap: 6px;
}

.btn-icon {
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--btn-radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  gap: 4px;
  transition: var(--btn-transition);
  text-decoration: none;
}

.btn-icon:hover {
  background: #e2e8f0;
}

.btn-icon.gold {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.btn-icon.gold:hover {
  background: #fde68a;
}

/* Modais */

.modal-box {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
}

.modal-footer {
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  outline: none;
  font-family: 'Inter', sans-serif;
}

/* Campo com valor inválido (ex.: telefone fora do padrão BR) — PN Fase 0.5 */
input.input-invalido,
.form-group input.input-invalido {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.06);
}

/* QR Code Preview */
.qr-preview-wrap {
  text-align: center;
  padding: 16px;
}

.qr-preview-wrap img {
  max-width: 220px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
}

.qr-link-text {
  font-size: 0.85rem;
  color: var(--navy);
  font-weight: 600;
  word-break: break-all;
  margin-top: 10px;
}

/* ------------------------------------------------------------- */
/* ABAS DE NAVEGAÇÃO PRINCIPAL */
/* ------------------------------------------------------------- */
.tabs-bar {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 18px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  white-space: nowrap;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: var(--navy);
}

.tab-btn.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Nav User Badge */
.nav-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Foto Upload Direto */
.photo-upload-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface-hover);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-top: 6px;
}

.photo-preview-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
  background: var(--surface);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.photo-preview-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ------------------------------------------------------------- */
/* ABAS DO MODAL DE EDIÇÃO & CUSTOMIZAÇÃO DO TEXTO DOURADO       */
/* ------------------------------------------------------------- */
.edit-tabs-nav {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 5px;
  border-radius: 10px;
  margin: 0 24px 16px 24px;
}

.edit-tab-btn {
  flex: 1;
  padding: 9px 14px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: #64748b;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.edit-tab-btn:hover {
  color: #142e4f;
  background: rgba(255, 255, 255, 0.6);
}

.edit-tab-btn.active {
  background: #ffffff;
  color: #142e4f;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.info-callout-gold {
  background: #fdfaf3;
  border: 1px solid #ebd9c0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.info-callout-title {
  font-weight: 700;
  color: #142e4f;
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.info-callout-desc {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.45;
  margin: 0;
}

.quick-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 16px;
}

.btn-sm-chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--btn-radius-sm);
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: var(--btn-transition);
}

.btn-sm-chip:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-sm-chip.danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.btn-sm-chip.danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.edit-badge-preview-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
  margin-top: 10px;
}

.preview-box-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.badge-preview-banner {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 14px 12px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.prev-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #142e4f;
  line-height: 1.2;
}

.prev-cargo {
  font-size: 0.8rem;
  color: #142e4f;
  font-weight: 500;
  margin-top: 3px;
}

.prev-gold {
  font-size: 0.74rem;
  font-weight: 700;
  color: #b09874;
  margin-top: 4px;
  letter-spacing: 0.4px;
}

.prev-gold.empty {
  color: #94a3b8;
  font-style: italic;
  font-weight: normal;
  font-size: 0.7rem;
}

/* Badges de Usuários & RBAC */
.badge-role {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-role.master {
  background: #142e4f;
  color: #ffffff;
}

.badge-role.diretoria {
  background: #b09874;
  color: #ffffff;
}

.badge-role.personalizado {
  background: #e2e8f0;
  color: #334155;
}

.badge-2fa {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-2fa.on {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-2fa.off {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

/* Grid de Permissões */
.perm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-top: 6px;
}

.perm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-main);
  cursor: pointer;
}

.perm-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* 2FA Modal Styles */
.totp-qr-wrap {
  text-align: center;
  margin-bottom: 16px;
}

.totp-qr-wrap img {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.totp-secret-box {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'Outfit', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--navy);
  text-align: center;
  user-select: all;
  margin-bottom: 16px;
}

/* ============================================================= */
/* ALERTA DE DIAS EM TREINAMENTO (> 60 DIAS)                     */
/* ============================================================= */
.status-pill.treinamento.alerta-longo {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  animation: pulseTreinamento 2.2s infinite ease-in-out;
}

@keyframes pulseTreinamento {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.25);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(225, 29, 72, 0.4);
  }
}

/* ============================================================= */
/* CRACHÁ CORPORATIVO PVC 85x54mm (PADRÃO KELLY KEITH)           */
/* ============================================================= */
.print-modal-body {
  background: #0b1523;
  padding: 30px;
  border-radius: 0 0 16px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: auto;
}

.pvc-container {
  display: flex;
  gap: 28px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* ============================================================= */
/* MODAL & CRACHÁ CORPORATIVO OFICIAL PVC (PADRÃO KELLY KEITH .AI) */
/* ============================================================= */
.print-modal-box {
  max-width: 780px !important;
  width: 95% !important;
  max-height: 94vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.print-modal-body {
  background: #0b1523;
  padding: 24px 20px;
  border-radius: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto !important;
  max-height: calc(94vh - 130px) !important;
  flex: 1;
}

.pvc-container {
  display: flex;
  gap: 28px;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
}

@media (max-width: 740px) {
  .pvc-container {
    flex-direction: column;
    flex-wrap: wrap;
  }
}

/* Cartão PVC Padrão Internacional CR80 Vertical (54 x 85.6 mm) */
.pvc-card {
  width: 290px;
  height: 448px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
}

/* ------------------------------------------------------------- */
/* FRENTE: 100% FIEL AO ARQUIVO VETORIAL DA AGÊNCIA (.AI)        */
/* ------------------------------------------------------------- */
.pvc-official-front {
  background: #142e4f;
  position: relative;
}

/* Imagem de Fundo Oficial (Navy + K Gigante Dourado + Logo Oficial) */
.pvc-bg-art {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  z-index: 1;
}

/* Encaixe Perfeito da Foto no Círculo do Gabarito Oficial (Geometria Exata sem CSS Transform) */
.pvc-official-photo-wrap {
  position: absolute;
  left: 62.5px;
  top: 123px;
  width: 165px;
  height: 165px;
  border-radius: 50%;
  overflow: hidden;
  z-index: 2;
  background: #cfd2d6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pvc-official-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.pvc-official-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: #64748b;
  border-radius: 50%;
}

/* Faixa Inferior Branca de Dados Nominais (20% inferior) */
.pvc-official-footer-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 19.57%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 14px 6px;
  box-sizing: border-box;
  text-align: center;
}

.pvc-official-name {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #142e4f;
  line-height: 1.2;
  letter-spacing: -0.2px;
  text-transform: capitalize;
}

.pvc-official-cargo {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: #142e4f;
  line-height: 1.25;
  margin-top: 2px;
}

.pvc-official-creci {
  font-size: 0.7rem;
  font-weight: 700;
  color: #b09874;
  margin-top: 2px;
}

/* ------------------------------------------------------------- */
/* VERSO: VALIDAÇÃO ELETRÔNICA & QR CODE OFICIAL                 */
/* ------------------------------------------------------------- */
.pvc-official-back {
  background: #ffffff;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pvc-back-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.pvc-back-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #142e4f;
  padding-bottom: 8px;
}

.pvc-back-logo {
  height: 24px;
  width: auto;
}

.pvc-back-creci-pj {
  font-size: 0.68rem;
  font-weight: 700;
  color: #b09874;
  letter-spacing: 0.5px;
}

.pvc-back-code-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  background: #f8fafc;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.pvc-back-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
}

.pvc-back-code {
  font-family: 'Outfit', monospace;
  font-size: 0.85rem;
  font-weight: 800;
  color: #142e4f;
}

.pvc-qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
  text-align: center;
}

.pvc-qr-img {
  width: 140px;
  height: 140px;
  padding: 6px;
  box-sizing: border-box;
  display: block;
  object-fit: contain;
  border: 1.5px solid #142e4f;
  border-radius: 10px;
  background: #ffffff;
}

.pvc-qr-instruction {
  font-size: 0.66rem;
  color: #475569;
  line-height: 1.35;
  max-width: 230px;
}

.pvc-disclaimer {
  font-size: 0.6rem;
  line-height: 1.35;
  color: #64748b;
  background: #f8fafc;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px dashed #cbd5e1;
  text-align: justify;
}

.pvc-back-footer {
  font-size: 0.58rem;
  color: #94a3b8;
  text-align: center;
  line-height: 1.4;
  border-top: 1px solid #f1f5f9;
  padding-top: 6px;
}

.print-guide-header {
  display: none;
}

/* ============================================================= */
/* REGRAS DE IMPRESSÃO (@media print)                           */
/* ============================================================= */
@media print {
  @page {
    size: A4 portrait;
    margin: 15mm 12mm;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
    box-sizing: border-box !important;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Oculta tudo exceto o modal do crachá durante a impressão */
  body > *:not(#modalPrintBadge),
  .navbar,
  .main-wrapper,
  .tabs-bar,
  .tab-content,
  .dash-header,
  .stats-grid,
  .filter-bar,
  .table-card,
  .modal-overlay:not(#modalPrintBadge),
  .modal-header,
  .modal-footer {
    display: none !important;
  }

  #modalPrintBadge {
    position: static !important;
    display: block !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .print-modal-box {
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    max-width: 100% !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    animation: none !important;
  }

  .print-modal-body {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  .print-guide-header {
    display: block !important;
    text-align: center !important;
    margin: 0 auto 20px auto !important;
    border-bottom: 1.5px dashed #94a3b8 !important;
    padding-bottom: 12px !important;
    max-width: 180mm !important;
  }

  .print-guide-header h4 {
    margin: 0 0 5px 0 !important;
    font-size: 14pt !important;
    font-weight: 700 !important;
    color: #142e4f !important;
  }

  .print-guide-header p {
    margin: 0 !important;
    font-size: 9pt !important;
    color: #475569 !important;
  }

  .pvc-container {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: flex-start !important;
    gap: 16mm !important;
    margin: 0 auto !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .pvc-card {
    width: 54mm !important;
    height: 85.6mm !important;
    min-width: 54mm !important;
    max-width: 54mm !important;
    min-height: 85.6mm !important;
    max-height: 85.6mm !important;
    border-radius: 3.18mm !important;
    border: 0.4pt solid #94a3b8 !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    overflow: hidden !important;
    position: relative !important;
    display: block !important;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .pvc-official-front {
    background: #142e4f !important;
  }

  .pvc-bg-art {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: fill !important;
    display: block !important;
  }

  .pvc-official-photo-wrap {
    position: absolute !important;
    left: 11.64mm !important;
    top: 22.9mm !important;
    width: 30.72mm !important;
    height: 30.72mm !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    background: #cfd2d6 !important;
    display: block !important;
  }

  .pvc-official-photo {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 50% !important;
  }

  .pvc-official-placeholder {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 22pt !important;
    font-weight: 700 !important;
    color: #64748b !important;
  }

  .pvc-official-footer-banner {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 19.57% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1mm 2mm 2mm !important;
    text-align: center !important;
    background: #ffffff !important;
  }

  .pvc-official-name {
    font-size: 9pt !important;
    font-weight: 700 !important;
    color: #142e4f !important;
    line-height: 1.15 !important;
  }

  .pvc-official-cargo {
    font-size: 6.5pt !important;
    font-weight: 500 !important;
    color: #142e4f !important;
    margin-top: 0.5mm !important;
  }

  .pvc-official-creci {
    font-size: 6pt !important;
    font-weight: 700 !important;
    color: #b09874 !important;
    margin-top: 0.5mm !important;
  }

  .pvc-official-back {
    background: #ffffff !important;
    padding: 3.5mm !important;
    box-sizing: border-box !important;
  }

  .pvc-back-inner {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    justify-content: space-between !important;
  }

  .pvc-back-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 0.8pt solid #142e4f !important;
    padding-bottom: 1mm !important;
  }

  .pvc-back-logo {
    height: 4.5mm !important;
    width: auto !important;
  }

  .pvc-back-creci-pj {
    font-size: 5pt !important;
    font-weight: 700 !important;
    color: #b09874 !important;
  }

  .pvc-back-code-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: #f8fafc !important;
    padding: 1mm 2mm !important;
    border-radius: 1mm !important;
    border: 0.4pt solid #e2e8f0 !important;
    margin-top: 1mm !important;
  }

  .pvc-back-label {
    font-size: 5pt !important;
    font-weight: 700 !important;
    color: #64748b !important;
  }

  .pvc-back-code {
    font-size: 6.5pt !important;
    font-weight: 800 !important;
    color: #142e4f !important;
  }

  .pvc-qr-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1mm !important;
    margin: 1.5mm 0 !important;
    text-align: center !important;
  }

  .pvc-qr-img {
    width: 26mm !important;
    height: 26mm !important;
    padding: 1mm !important;
    display: block !important;
    border: 0.8pt solid #142e4f !important;
    border-radius: 1.5mm !important;
    background: #ffffff !important;
  }

  .pvc-qr-instruction {
    font-size: 4.5pt !important;
    color: #475569 !important;
    line-height: 1.2 !important;
    max-width: 46mm !important;
  }

  .pvc-disclaimer {
    font-size: 4pt !important;
    line-height: 1.2 !important;
    color: #64748b !important;
    background: #f8fafc !important;
    padding: 1.5mm !important;
    border-radius: 1mm !important;
    border: 0.4pt dashed #cbd5e1 !important;
    text-align: justify !important;
  }

  .pvc-back-footer {
    font-size: 4pt !important;
    color: #94a3b8 !important;
    text-align: center !important;
    line-height: 1.2 !important;
    border-top: 0.4pt solid #f1f5f9 !important;
    padding-top: 1mm !important;
  }
}

/* ============================================================= */
/* CENTRAL DE PATCH NOTES, HOMOLOGAÇÃO & SUGESTÕES DA EQUIPE     */
/* ============================================================= */

.patch-subnav-container {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 24px;
}

.patch-subnav-pills {
  display: inline-flex;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}

.subnav-pill {
  border: none;
  background: transparent;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.subnav-pill:hover {
  color: #0f172a;
}

.subnav-pill.active {
  background: #ffffff;
  color: #142e4f;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Fase 1 (feedback Kelly) — filtro Ativos | Arquivados | Todos do Mural */
.mural-filtro-btn {
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #fff);
  color: var(--text-secondary, #475569);
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mural-filtro-btn:hover { border-color: var(--gold); color: var(--navy, #142e4f); }
[data-theme="dark"] .mural-filtro-btn:hover { color: #f8fafc; }
.btn-group-toggle .btn-icon.active {
  background: var(--navy, #142e4f);
  border-color: var(--navy, #142e4f);
  color: #fff;
  box-shadow: 0 2px 6px rgba(20, 46, 79, 0.25);
}
[data-theme="dark"] .btn-group-toggle .btn-icon.active {
  background: var(--gold, #d4af37);
  border-color: var(--gold, #d4af37);
  color: #1a1a1a;
}

.mural-filtro-btn.active {
  background: var(--navy, #142e4f);
  border-color: var(--navy, #142e4f);
  color: #fff;
  box-shadow: 0 2px 6px rgba(20, 46, 79, 0.25);
}
[data-theme="dark"] .mural-filtro-btn.active {
  background: var(--gold, #d4af37);
  border-color: var(--gold, #d4af37);
  color: #1a1a1a;
  box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}
/* Fase (pedido do usuário) — gestão de canais setoriais do chat */
.chat-canal-add-btn {
  border: none;
  background: none;
  color: var(--gold, #d4af37);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
}

.chat-canal-gear-btn {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.gerenciar-canal-emoji-sugestoes span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.gerenciar-canal-membros-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-hover);
}
.gerenciar-canal-membro-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.aviso-arquivamento-info {
  background: var(--surface-hover, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-secondary, #475569);
  margin: 10px 0;
}

.subnav-counter {
  background: #cbd5e1;
  color: #334155;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
}

.subnav-pill.active .subnav-counter {
  background: #142e4f;
  color: #ffffff;
}

/* ============================================================= */
/* CENTRAL DE PATCH NOTES & RELEASES (ACCORDION MODERNO)         */
/* ============================================================= */

.patch-header-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.patch-summary-count {
  font-size: 0.88rem;
  color: #64748b;
}

.patch-summary-count strong {
  color: #0f172a;
}

.btn-accordion-control {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 6px 12px;
  border-radius: var(--btn-radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--btn-transition);
}

.btn-accordion-control:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* Cards em Formato Accordion */

.patch-accordion-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.patch-accordion-card:hover {
  border-color: #b09874;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.patch-accordion-card.open {
  border-color: #b09874;
  box-shadow: 0 6px 18px rgba(176, 152, 116, 0.12);
}

/* Cabeçalho do Accordion (Sempre Visível) */

.badge-version {
  background: #0f172a;
  color: #f8fafc;
  font-family: monospace;
  font-weight: 700;
  font-size: 0.76rem;
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-category-tag {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-status-tag {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-status-tag.homologado {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-status-tag.validacao {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.patch-accordion-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px 0;
  line-height: 1.35;
  word-break: break-word;
}

.patch-accordion-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #64748b;
  flex-wrap: wrap;
}

.patch-accordion-meta strong {
  color: #334155;
}

.meta-dot {
  color: #cbd5e1;
}

.btn-toggle-patch {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--btn-radius);
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  transition: var(--btn-transition);
  white-space: nowrap;
}

.patch-accordion-card:hover .btn-toggle-patch {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.patch-accordion-card.open .btn-toggle-patch {
  background: #fdf6e9;
  border-color: #b09874;
  color: #84683d;
}

/* Corpo do Accordion (Expansível) */
.patch-accordion-body {
  display: none;
  padding: 22px 24px;
  background: #ffffff;
  animation: patchFadeIn 0.2s ease-out;
}

@keyframes patchFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Bloco de Descrição */
.patch-section-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.patch-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.patch-desc-text {
  font-size: 0.92rem;
  color: #1e293b;
  line-height: 1.6;
  margin: 0;
}

/* Guias de Teste e Observação */
.patch-guides-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 840px) {
  .patch-guides-container {
    grid-template-columns: 1fr;
  }
}

.guide-col {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-test-col {
  border-left: 4px solid #3b82f6;
}

.guide-observe-col {
  border-left: 4px solid #10b981;
}

.guide-test-col .guide-col-header {
  color: #1d4ed8;
}

.guide-observe-col .guide-col-header {
  color: #047857;
}

.guide-step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.86rem;
  color: #334155;
  line-height: 1.5;
}

/* Barra de Validações e Ação do Patch */
.patch-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.patch-validations-info {
  font-size: 0.84rem;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
}

.patch-validations-info strong {
  color: #0f172a;
}

.btn-validar-action:disabled {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
  cursor: default;
}

.patch-val-count-falha {
  color: #b91c1c;
}

/* Lista de resultados de teste da equipe */
.patch-val-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.patch-val-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 0.8rem;
  color: #475569;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border-left: 3px solid #cbd5e1;
}

.patch-val-result {
  font-weight: 700;
  color: #0f172a;
}

.patch-val-data {
  color: #94a3b8;
}

.patch-val-coment {
  flex-basis: 100%;
  color: #64748b;
  font-style: italic;
}

/* Opções de resultado no modal de validação */

.val-resultado-opt {
  --val-accent: #64748b;
  position: relative;
  /* .form-group label {display:block} tem mais especificidade (0,1,1 vs
     0,1,0) e vencia isto, empilhando o radio acima do texto — o !important
     garante que a linha fique sempre horizontal. */
  display: flex !important;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-main, #0f172a);
  background: var(--bg-card, #fff);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .1s ease;
}

.val-resultado-opt--incompleto { --val-accent: #64748b; }

.val-resultado-opt input {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: border-color .15s ease;
}

/* ============================================================= */
/* CAIXA DE SUGESTÕES & WIDGET DE UPVOTE / DOWNVOTE              */
/* ============================================================= */

.sugestoes-hero-box {
  background: linear-gradient(135deg, #142e4f 0%, #1e3a5f 100%);
  border-radius: 14px;
  padding: 24px;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(20, 46, 79, 0.15);
}

.sugestoes-hero-content h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #ffffff;
}

.sugestoes-hero-content p {
  font-size: 0.9rem;
  color: #cbd5e1;
  max-width: 700px;
  line-height: 1.5;
}

.sugestoes-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sugestao-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.sugestao-vote-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 6px 8px;
  min-width: 68px;
  flex-shrink: 0;
  gap: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.btn-vote {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--btn-radius);
  padding: 5px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  color: #64748b;
  transition: var(--btn-transition);
  user-select: none;
}

.btn-vote:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.btn-vote.btn-upvote:hover {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.btn-vote.btn-upvote.active {
  background: #dcfce7;
  color: #15803d;
  font-weight: 700;
  border-color: #86efac;
}

.btn-vote.btn-downvote:hover {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.btn-vote.btn-downvote.active {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
  border-color: #fca5a5;
}

.vote-score-divider {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
  margin: 2px 0;
  letter-spacing: 0.2px;
}

.vote-score-divider.positive {
  background: #d1fae5;
  color: #065f46;
}

.vote-score-divider.negative {
  background: #fee2e2;
  color: #991b1b;
}

/* Badge 2FA */
.badge-2fa {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  white-space: nowrap !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 10px !important;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}

.sugestao-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.sugestao-desc {
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.55;
  margin-bottom: 12px;
}

.sugestao-meta-author {
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sugestao-resposta-box {
  margin-top: 14px;
  background: #f0fdf4;
  border-left: 3px solid #10b981;
  border-radius: 6px;
  padding: 10px 14px;
}

/* ------------------------------------------------------------- */
/* MÓDULO FINANCEIRO, VAULT & RBAC ERP STYLES                    */
/* ------------------------------------------------------------- */

.badge-pago {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 4px 10px !important;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap !important;
  line-height: 1.2;
  flex-shrink: 0;
}

.badge-pendente {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  padding: 4px 10px !important;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap !important;
  line-height: 1.2;
  flex-shrink: 0;
}

.badge-cancelado {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 4px 10px !important;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap !important;
  line-height: 1.2;
  flex-shrink: 0;
}

.badge-aliberar {
  background: #fdf4ff;
  color: #86198f;
  border: 1px solid #f5d0fe;
  padding: 4px 10px !important;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap !important;
  line-height: 1.2;
  flex-shrink: 0;
}

.badge-recebido {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 4px 10px !important;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap !important;
  line-height: 1.2;
  flex-shrink: 0;
}

.badge-master-dennis {
  background: #0f172a;
  color: #fbbf24;
  border: 1px solid #d97706;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.badge-cargo-pill {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

/* Fix Foto do Colaborador (Avatar) */
.avatar-mini {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 2px solid var(--gold, #b09874) !important;
  flex-shrink: 0 !important;
  display: block !important;
}

.avatar-placeholder-mini {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  border-radius: 50% !important;
  background: #e2e8f0;
  color: #1e293b;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #cbd5e1;
}

/* Barra de Ações em Lote para Exportação de NFs */
.batch-action-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 14px;
  animation: fadeIn 0.2s ease;
}

.batch-action-bar.active {
  display: flex;
}

.chk-custom {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #142e4f;
  vertical-align: middle;
}

.btn-action-mini {
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--btn-radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--btn-transition);
}

.btn-action-view {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}
.btn-action-view:hover {
  background: #dbeafe;
}

.btn-action-pay {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}
.btn-action-pay:hover {
  background: #d1fae5;
}

.btn-action-del {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}
.btn-action-del:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #f87171;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(220, 38, 38, 0.15);
}

.currency-bold {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  white-space: nowrap;
}

.btn-action-dup {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}
.btn-action-dup:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.badge-parcela {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-recorrencia {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Badge de competência em lançamento manual — PN Fase 5 / item G */
.badge-competencia {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

[data-theme="dark"] .btn-action-dup {
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.12);
}
[data-theme="dark"] .btn-action-dup:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}
[data-theme="dark"] .badge-parcela {
  background: rgba(109, 40, 217, 0.2);
  color: #c4b5fd;
  border-color: rgba(109, 40, 217, 0.4);
}
[data-theme="dark"] .badge-recorrencia {
  background: rgba(217, 119, 6, 0.2);
  color: #fcd34d;
  border-color: rgba(217, 119, 6, 0.4);
}

/* ========================================================================== */
/* ERP 3.0: RETRACTABLE SIDEBAR, COCKPIT, HELP CENTER, AGENDA & GAMIFICATION   */
/* ========================================================================== */

/* Retractable Sidebar */
.sidebar {
  width: 250px;
  min-width: 250px;
  background: #0b1a30;
  color: #ffffff;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .side-badge,
.sidebar.collapsed .user-info-text,
.sidebar.collapsed .user-config-icon {
  display: none !important;
}

.sidebar.collapsed .user-profile-widget {
  justify-content: center;
  padding: 6px 0;
}

/* Sidebar Header */

.sidebar-logo {
  height: 36px;
  width: auto;
  border-radius: 6px;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffffff;
  letter-spacing: 0.3px;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.68rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.sidebar-toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}

/* Destaque de cor no título da categoria que contém a aba aberta — o selo
   truncado que existia aqui foi removido a pedido do usuário (confundia
   mais do que ajudava; a aba clicada já se destaca sozinha na lista). */
.sidebar-section-title.categoria-ativa {
  color: #ffffff !important;
  font-weight: 800 !important;
  letter-spacing: 0.14em !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.45);
}
.sidebar-section-title.categoria-ativa .side-categoria-chevron {
  color: #ffffff !important;
  opacity: 1 !important;
  font-weight: 800 !important;
}
.sidebar-section-title.categoria-ativa::after {
  background: rgba(255, 255, 255, 0.35) !important;
}

/* Atalhos Rápidos — ficam visíveis mesmo com a sidebar em modo ícone-only,
   configuráveis pelo usuário (engrenagem), guardados em localStorage. */
.sidebar-atalhos-rapidos {
  display: none !important;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.atalho-rapido-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.atalho-rapido-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}
.atalho-rapido-btn.atalho-config-btn {
  opacity: 0.55;
  font-size: 0.85rem;
}
.sidebar.collapsed .sidebar-atalhos-rapidos {
  display: none !important;
  justify-content: center;
  padding: 10px 8px;
}

.side-nav-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 3px;
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  position: relative;
}

.side-nav-btn.active {
  background: linear-gradient(90deg, rgba(176, 152, 116, 0.22), rgba(176, 152, 116, 0.06));
  color: #ffffff;
  border-left: 3px solid var(--gold);
  font-weight: 600;
}

.nav-icon {
  font-size: 1.15rem;
  min-width: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-label {
  flex: 1;
  margin-left: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
}

.badge-warning {
  background: #f59e0b;
  color: #0f172a;
}

/* Rodapé da Sidebar */

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.user-profile-widget:hover {
  background: rgba(255, 255, 255, 0.08);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #9c8360);
  color: #ffffff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-info-text {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.7rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-config-icon {
  font-size: 0.95rem;
  color: #94a3b8;
  transition: transform 0.2s;
}

.user-profile-widget:hover .user-config-icon {
  transform: rotate(45deg);
  color: #ffffff;
}

/* Topbar */
.topbar {
  height: 60px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-main);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: #64748b;
}

.bc-sep {
  color: #cbd5e1;
}

.bc-current {
  font-weight: 600;
  color: #0f172a;
}

.topbar-time {
  font-family: 'Outfit', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.top-btn-2fa,
.top-btn-perfil,
.top-btn-logout {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

/* Central de notificações — PN Fase 10 / item J */
.notif-wrap { position: relative; }
.top-btn-notif {
  position: relative;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 8px;
  height: 32px; min-width: 34px;
  font-size: 1rem;
  cursor: pointer;
}
.notif-badge {
  position: absolute; top: -6px; right: -6px;
  background: #ef4444; color: #fff;
  font-size: 0.62rem; font-weight: 800;
  min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
}
.notif-panel {
  position: absolute; right: 0; top: 40px; z-index: 200;
  width: 340px; max-height: 70vh; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-size: 0.9rem; color: var(--text-main);
}
.notif-empty { padding: 22px 14px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.notif-item {
  display: flex; gap: 10px; width: 100%; text-align: left;
  padding: 11px 14px; border: 0; border-bottom: 1px solid var(--border);
  background: transparent; cursor: pointer;
  border-left: 3px solid transparent;
}
.notif-item:hover { background: var(--surface-hover); }
.notif-item.notif-alta { border-left-color: #ef4444; }
.notif-item.notif-media { border-left-color: #f59e0b; }
.notif-item-ico { font-size: 1.1rem; flex-shrink: 0; }
.notif-item-txt { display: flex; flex-direction: column; min-width: 0; }
.notif-item-txt strong { font-size: 0.84rem; color: var(--text-main); }
.notif-item-txt span { font-size: 0.75rem; color: var(--text-muted); }

/* Fase 2 (feedback Kelly) — filtros da Central de Notificações */
.notif-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.notif-filtro-btn {
  border: 1px solid var(--border-color, var(--border));
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
}
.notif-filtro-btn:hover { border-color: var(--gold); }
.notif-filtro-btn.active { background: var(--navy, #142e4f); border-color: var(--navy, #142e4f); color: #fff; }

.top-btn-2fa.is-active {
  background: #ecfdf5 !important;
  color: #065f46 !important;
  border: 1px solid #6ee7b7 !important;
  font-weight: 700;
}
.top-btn-2fa.is-active:hover {
  background: #d1fae5 !important;
  color: #047857 !important;
  border-color: #34d399 !important;
}

.top-btn-2fa.is-inactive {
  background: #fffbeb !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
  font-weight: 700;
}
.top-btn-2fa.is-inactive:hover {
  background: #fef3c7 !important;
  color: #92400e !important;
  border-color: #f59e0b !important;
}

.top-btn-perfil {
  background: #f8fafc;
  color: #334155;
  border-color: #e2e8f0;
}
.top-btn-perfil:hover {
  background: #f1f5f9;
}

.top-btn-logout {
  background: #fff1f2;
  color: #e11d48;
  border-color: #fecdd3;
}

/* ========================================================================== */
/* HOME & COCKPIT OPERACIONAL                                                 */
/* ========================================================================== */

.welcome-hero-card {
  background: linear-gradient(135deg, #0b1a30, #172a45);
  color: #ffffff;
  border-radius: 14px;
  padding: 26px 30px;
  box-shadow: 0 8px 24px rgba(11, 26, 48, 0.15);
  border: 1px solid rgba(176, 152, 116, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.welcome-pill {
  display: inline-block;
  background: rgba(176, 152, 116, 0.2);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  border: 1px solid rgba(176, 152, 116, 0.35);
}

.welcome-greeting {
  font-family: 'Outfit', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 6px 0;
  letter-spacing: 0.3px;
}

.welcome-sub {
  font-size: 0.9rem;
  color: #94a3b8;
  margin: 0;
}

/* Grid de KPIs do Cockpit */
.cockpit-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  border-color: #cbd5e1;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.kpi-icon-purple {
  background: #f5f3ff;
  color: #7c3aed;
}

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}

.kpi-label {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
  margin-top: 2px;
}

/* Split Grid Cockpit */
.cockpit-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.cockpit-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
}

.cockpit-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.cockpit-card-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Itens de Atalho Rápido */
.cockpit-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.shortcut-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.shortcut-icon {
  font-size: 1.3rem;
}

.shortcut-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: #1e293b;
}

.shortcut-desc {
  font-size: 0.72rem;
  color: #64748b;
}

/* ========================================================================== */
/* MURAL DE AVISOS                                                            */
/* ========================================================================== */

.aviso-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
}

.aviso-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 10px 0;
  line-height: 1.32;
}

.aviso-meta {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.aviso-content {
  font-size: 0.89rem;
  line-height: 1.65;
  color: #334155;
  flex: 1;
  margin-bottom: 20px;
  white-space: pre-line;
}

.aviso-footer {
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Botão de confirmação de ciência — antes um btn-primary genérico verde,
   agora com peso visual próprio (é a ação principal do card). */
.aviso-btn-confirmar {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.1px;
  color: #ffffff;
  background: linear-gradient(180deg, #10b981, #059669);
  border: 1px solid #047857;
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
  transition: box-shadow 0.15s ease, transform 0.15s ease, filter 0.15s ease;
}

.aviso-confirmado-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.83rem;
  font-weight: 600;
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 999px;
  padding: 8px 16px;
}

[data-theme="dark"] .aviso-meta {
  border-bottom-color: #1e293b;
}

[data-theme="dark"] .aviso-confirmado-tag {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

/* ========================================================================== */
/* CENTRAL DE AJUDA & MANUAL INTERNO                                          */
/* ========================================================================== */

.manual-layout-grid {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 24px;
  min-height: 680px;
  align-items: start;
}

.manual-sidebar {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.manual-search-box {
  margin-bottom: 16px;
}

.manual-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 6px;
  margin-bottom: 4px;
}
.manual-seletor-novo:hover { color: var(--gold, #b09874); }
.manual-seletor-edit, .manual-cat-edit {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  opacity: 0.55;
  padding: 2px 4px;
  flex: none;
  text-transform: none;
  letter-spacing: normal;
}

.manual-article-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.manual-article-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.manual-article-link.active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.manual-article-viewer {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 40px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  line-height: 1.7;
  color: #334155;
  min-height: 600px;
}

.manual-article-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px 0;
}

.manual-article-meta {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Imagens inline no conteúdo do Manual */
.manual-img {
  margin: 18px 0;
  max-width: 100%;
}
.manual-img-el {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: zoom-in;
  background: #f8fafc;
}
.manual-img-legenda {
  margin-top: 6px;
  font-size: 0.82rem;
  color: #64748b;
  font-style: italic;
  line-height: 1.5;
}
[data-theme="dark"] .manual-img-el {
  border-color: #334155;
  background: #1e293b;
}
[data-theme="dark"] .manual-img-legenda {
  color: #94a3b8;
}

/* Painel de inserção de imagem no editor do Manual */
.manual-img-panel {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  background: #f8fafc;
}
[data-theme="dark"] .manual-img-panel {
  border-color: #475569;
  background: #1e293b;
}

/* Pré-visualização de conteúdo rico no editor */
.rico-preview-wrap {
  margin-top: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.rico-preview-label {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-bottom: 1px solid #e2e8f0;
}
.rico-preview {
  padding: 16px;
  max-height: 320px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.7;
  background: #fff;
}
[data-theme="dark"] .rico-preview-wrap { border-color: #334155; }
[data-theme="dark"] .rico-preview-label {
  background: #1e293b;
  color: #94a3b8;
  border-bottom-color: #334155;
}
[data-theme="dark"] .rico-preview { background: #0e1726; }

/* Lightbox / visualização ampliada */
.manual-lightbox-fig img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.manual-lightbox-fig figcaption {
  margin-top: 12px;
  color: #e2e8f0;
  font-size: 0.9rem;
  text-align: center;
  max-width: 80vw;
}

/* Callouts Estilizados do Manual */
.callout-dica {
  background: #ecfdf5;
  border-left: 4px solid #10b981;
  padding: 14px 18px;
  border-radius: 6px;
  margin: 16px 0;
  color: #065f46;
}

.callout-urgente {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 14px 18px;
  border-radius: 6px;
  margin: 16px 0;
  color: #92400e;
}

.callout-proibicao {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  padding: 14px 18px;
  border-radius: 6px;
  margin: 16px 0;
  color: #991b1b;
}

.callout-procedimento {
  background: #eef6ff;
  border-left: 4px solid #3b82f6;
  padding: 14px 18px;
  border-radius: 6px;
  margin: 16px 0;
  color: #1e40af;
}

.callout-modelo {
  background: #f5f3ff;
  border-left: 4px solid #8b5cf6;
  padding: 14px 18px;
  border-radius: 6px;
  margin: 16px 0;
  color: #5b21b6;
}

/* ========================================================================== */
/* AGENDA & FILA DE HOMOLOGAÇÃO DE VISITAS                                    */
/* ========================================================================== */

.visita-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
}

.visita-card.pendente {
  border-left: 4px solid #f59e0b;
}

.visita-card.confirmada {
  border-left: 4px solid #10b981;
}

.visita-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.visita-meta {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.visita-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.btn-homologar-visita {
  background: #10b981;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--btn-radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--btn-transition);
}

/* ========================================================================== */
/* GAMIFICAÇÃO & RANKING JUSTO                                                */
/* ========================================================================== */

.meta-coletiva-card {
  background: linear-gradient(135deg, #0b1a30, #142e4f);
  color: #ffffff;
  border-radius: 14px;
  padding: 24px 28px;
  box-shadow: 0 8px 24px rgba(11, 26, 48, 0.15);
  margin-bottom: 24px;
  border: 1px solid rgba(176, 152, 116, 0.25);
}

.meta-progress-track {
  height: 18px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0;
}

.meta-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #b09874, #f59e0b);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pódio Visual */
.ranking-podium-grid {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 16px;
  margin: 30px 0 40px;
  min-height: 280px;
}

.podium-card {
  width: 220px;
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s ease;
}

.podium-1 {
  order: 2;
  height: 270px;
  background: linear-gradient(180deg, #fffdf5 0%, #ffffff 100%);
  border: 2px solid var(--gold);
}

.podium-2 {
  order: 1;
  height: 235px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border: 1px solid #cbd5e1;
}

.podium-3 {
  order: 3;
  height: 215px;
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
  border: 1px solid #d97706;
}

.podium-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.podium-points {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #b09874;
}

/* Gatekeeper Modal Legal */
.modal-gatekeeper {
  background: rgba(11, 26, 48, 0.88) !important;
  backdrop-filter: blur(8px);
  z-index: 99999 !important;
}

/* Responsividade Mobile */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100vh;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
  }
  .sidebar.mobile-open {
    left: 0;
  }
  .mobile-menu-btn {
    display: block;
  }
  .cockpit-split-grid {
    grid-template-columns: 1fr;
  }
  .manual-layout-grid {
    grid-template-columns: 1fr;
  }
  .ranking-podium-grid {
    flex-direction: column;
    align-items: stretch;
  }
  .podium-card {
    width: 100%;
    height: auto !important;
    order: unset !important;
  }
}

/* ========================================================================== */
/* MODO ESCURO (DARK MODE) — KELLY KEITH IMÓVEIS ERP 3.0                      */
/* ========================================================================== */

/* Transições suaves ao alternar o tema */
body, .sidebar, .topbar, .cockpit-card, .kpi-card, .shortcut-item, 
.mural-card, .aviso-card, .manual-sidebar, .manual-article-viewer, 
.visita-card, .meta-coletiva-card, .podium-card, .modal-box, table, 
th, td, input, select, textarea, .stat-card, .patch-accordion-card {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

[data-theme="dark"] {
  /* Sem isso o navegador não sabe que deve desenhar os controles nativos
     (lista aberta de <select>, scrollbars) em modo escuro - mesmo com o
     fundo do select fechado já escuro, a lista de opções abria branca. */
  color-scheme: dark;
  /* As cores do tema escuro da imobiliaria ficam em marca.css (T-0220). */
  --warning: #fbbf24;
  --info: #60a5fa;
}

[data-theme="dark"] body {
  background-color: #080d16;
  color: #f8fafc;
}

/* Botão de Alternância de Tema */
.top-btn-theme {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #cbd5e1;
  color: #1e293b;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.top-btn-theme:hover {
  background: #ffffff;
  border-color: #94a3b8;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .top-btn-theme {
  background: #152238;
  border-color: #24354f;
  color: #f1f5f9;
}

[data-theme="dark"] .top-btn-theme:hover {
  background: #1c2e4d;
  border-color: #d4af37;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
}

/* Topbar Dark */
[data-theme="dark"] .topbar {
  background: #0e1726;
  border-bottom: 1px solid #1e293b;
}

[data-theme="dark"] .topbar-time {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid #1e293b;
}

[data-theme="dark"] .top-btn-2fa {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .top-btn-2fa.is-active {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
}
[data-theme="dark"] .top-btn-2fa.is-active:hover {
  background: rgba(16, 185, 129, 0.28) !important;
  color: #6ee7b7 !important;
  border-color: #10b981 !important;
}

[data-theme="dark"] .top-btn-2fa.is-inactive {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
}
[data-theme="dark"] .top-btn-2fa.is-inactive:hover {
  background: rgba(245, 158, 11, 0.28) !important;
  color: #fde68a !important;
  border-color: #f59e0b !important;
}

[data-theme="dark"] .top-btn-perfil {
  background: #152238;
  border: 1px solid #24354f;
  color: #cbd5e1;
}

[data-theme="dark"] .top-btn-perfil:hover {
  background: #1c2e4d;
  color: #f8fafc;
}

[data-theme="dark"] .top-btn-logout {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .breadcrumb .bc-current {
  color: #f8fafc;
}

[data-theme="dark"] .breadcrumb span {
  color: #94a3b8;
}

/* Sidebar Dark Refinamentos */
[data-theme="dark"] .sidebar {
  background: #09111e;
  border-right: 1px solid #172438;
}

/* Cards & Cockpit Dark */
[data-theme="dark"] .cockpit-card {
  background: #0e1726;
  border: 1px solid #1e293b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .cockpit-card-header h3 {
  color: #f8fafc;
}

[data-theme="dark"] .kpi-card {
  background: #0e1726;
  border: 1px solid #1e293b;
}

[data-theme="dark"] .kpi-card:hover {
  background: #131f33;
  border-color: #2e4466;
  transform: translateY(-2px);
}

[data-theme="dark"] .kpi-title {
  color: #94a3b8;
}

[data-theme="dark"] .kpi-sub {
  color: #64748b;
}

[data-theme="dark"] .kpi-value {
  color: #f8fafc;
}

[data-theme="dark"] .shortcut-item {
  background: #121d30;
  border: 1px solid #1e293b;
}

[data-theme="dark"] .shortcut-item:hover {
  background: #17263d;
  border-color: #d4af37;
}

[data-theme="dark"] .shortcut-title {
  color: #f1f5f9;
}

[data-theme="dark"] .shortcut-desc {
  color: #94a3b8;
}

/* Mural de Avisos Dark */
[data-theme="dark"] .aviso-card {
  background: #0e1726;
  border: 1px solid #1e293b;
}

[data-theme="dark"] .aviso-title {
  color: #f8fafc;
}

[data-theme="dark"] .aviso-content {
  color: #cbd5e1;
}

[data-theme="dark"] .aviso-footer {
  border-top-color: #1e293b;
}

/* Central de Ajuda & Manual Dark */
[data-theme="dark"] .manual-sidebar {
  background: #0e1726;
  border: 1px solid #1e293b;
}

[data-theme="dark"] .manual-article-viewer {
  background: #0e1726;
  border: 1px solid #1e293b;
  color: #cbd5e1;
}

[data-theme="dark"] .manual-article-title {
  color: #f8fafc;
}

[data-theme="dark"] .manual-cat-header {
  color: #94a3b8;
}

[data-theme="dark"] .manual-article-link {
  color: #cbd5e1;
}

[data-theme="dark"] .manual-article-link:hover {
  background: #152238;
  color: #ffffff;
}

[data-theme="dark"] .manual-article-link.active {
  background: #1c2e4d;
  color: #d4af37;
  font-weight: 700;
}

[data-theme="dark"] .manual-article-body h2,
[data-theme="dark"] .manual-article-body h3,
[data-theme="dark"] .manual-article-body strong {
  color: #f8fafc !important;
}

[data-theme="dark"] .callout-dica {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}

[data-theme="dark"] .callout-urgente {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}

[data-theme="dark"] .callout-proibicao {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

[data-theme="dark"] .callout-procedimento {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
}

[data-theme="dark"] .callout-modelo {
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
}

/* Agenda & Visitas Dark */
[data-theme="dark"] .visita-card {
  background: #0e1726;
  border: 1px solid #1e293b;
}

[data-theme="dark"] .visita-title {
  color: #f8fafc;
}

[data-theme="dark"] .visita-meta {
  color: #cbd5e1;
}

[data-theme="dark"] .visita-meta strong {
  color: #f8fafc;
}

[data-theme="dark"] .visita-actions {
  border-top-color: #1e293b;
}

/* Ranking & Pódio Dark */
[data-theme="dark"] .podium-card {
  background: #0e1726;
  border: 1px solid #1e293b;
}

[data-theme="dark"] .podium-1 {
  background: linear-gradient(180deg, #1f1b0a 0%, #0e1726 100%);
  border: 2px solid #d4af37;
}

[data-theme="dark"] .podium-2 {
  background: linear-gradient(180deg, #151f2e 0%, #0e1726 100%);
  border: 1px solid #64748b;
}

[data-theme="dark"] .podium-3 {
  background: linear-gradient(180deg, #24190c 0%, #0e1726 100%);
  border: 1px solid #d97706;
}

[data-theme="dark"] .podium-name {
  color: #f8fafc;
}

/* Tabelas Dark */
[data-theme="dark"] table {
  color: #cbd5e1;
}

[data-theme="dark"] th {
  background: #121d30;
  color: #94a3b8;
  border-bottom: 1px solid #1e293b;
}

[data-theme="dark"] td {
  border-bottom: 1px solid #1e293b;
  color: #cbd5e1;
}

[data-theme="dark"] td strong,
[data-theme="dark"] td div[style*="font-weight: 600"],
[data-theme="dark"] td div[style*="font-weight:600"] {
  color: #f8fafc !important;
}

[data-theme="dark"] .badge-code {
  background: #152238;
  color: #d4af37;
}

[data-theme="dark"] tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] tr:hover td {
  background-color: #152238 !important;
  color: #ffffff !important;
}

/* Forms, Inputs e Selects Dark */
[data-theme="dark"] .search-input,
[data-theme="dark"] .status-select,
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
  background: #09111e;
  border: 1px solid #223249;
  color: #f8fafc;
}

[data-theme="dark"] .search-input:focus,
[data-theme="dark"] .status-select:focus,
[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus {
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
  outline: none;
}

[data-theme="dark"] .form-group label {
  color: #cbd5e1;
}

/* Modais Dark */
[data-theme="dark"] .modal-box,
[data-theme="dark"] .modal-content {
  background: #0e1726;
  border: 1px solid #223249;
  color: #f8fafc;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .modal-header {
  border-bottom: 1px solid #1e293b;
}

[data-theme="dark"] .modal-header h3 {
  color: #f8fafc;
}

[data-theme="dark"] .modal-footer {
  border-top: 1px solid #1e293b;
}

[data-theme="dark"] .modal-close {
  color: #94a3b8;
}

[data-theme="dark"] .modal-close:hover {
  color: #f8fafc;
}

/* Patch Notes & Sugestões Dark */
[data-theme="dark"] .patch-header-toolbar {
  background: #0e1726;
  border: 1px solid #1e293b;
}

[data-theme="dark"] .patch-summary-count strong {
  color: #f8fafc;
}

[data-theme="dark"] .patch-accordion-card {
  background: #0e1726 !important;
  border: 1px solid #1e293b !important;
}

[data-theme="dark"] .patch-accordion-header {
  background: #0e1726 !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .patch-accordion-header:hover {
  background: #152238 !important;
}

[data-theme="dark"] .patch-accordion-card.open .patch-accordion-header {
  background: #152238 !important;
  border-bottom: 1px solid #1e293b !important;
}

[data-theme="dark"] .patch-accordion-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .patch-accordion-meta {
  color: #94a3b8 !important;
}

[data-theme="dark"] .patch-accordion-meta strong {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .patch-accordion-meta span {
  color: #94a3b8 !important;
}

[data-theme="dark"] .patch-accordion-body {
  background: #0a101d !important;
  color: #f8fafc !important;
}

::selection {
  background: var(--gold) !important;
  color: #0f172a !important;
}

[data-theme="dark"] ::selection {
  background: #eab308 !important;
  color: #09111e !important;
}

[data-theme="dark"] .patch-section-block {
  background: #09111e;
  border: 1px solid #1e293b;
}

[data-theme="dark"] .patch-section-title {
  color: #94a3b8;
}

[data-theme="dark"] .patch-desc-text {
  color: #e2e8f0;
}

[data-theme="dark"] .guide-col {
  background: #09111e;
  border: 1px solid #1e293b;
}

[data-theme="dark"] .guide-col-header {
  color: #f8fafc;
}

[data-theme="dark"] .guide-step-item {
  color: #cbd5e1;
}

[data-theme="dark"] .btn-toggle-patch {
  background: #121d30;
  color: #94a3b8;
  border-color: #1e293b;
}

[data-theme="dark"] .patch-accordion-card:hover .btn-toggle-patch {
  background: #1a2b45;
  color: #f8fafc;
}

[data-theme="dark"] .patch-accordion-card.open .btn-toggle-patch {
  background: #1e293b;
  color: #d4af37;
  border-color: #d4af37;
}

[data-theme="dark"] .patch-subnav-pills {
  background: #09111e;
}

[data-theme="dark"] .subnav-pill {
  color: #94a3b8;
}

[data-theme="dark"] .subnav-pill.active {
  background: #152238;
  color: #d4af37;
}

/* Caixa de Sugestões Dark Mode */
[data-theme="dark"] .sugestao-card {
  background: #0e1726 !important;
  border: 1px solid #1e293b !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .sugestao-vote-widget {
  background: #09111e !important;
  border: 1px solid #1e293b !important;
}

[data-theme="dark"] .btn-vote {
  color: #94a3b8 !important;
}

[data-theme="dark"] .btn-vote:hover {
  background: #152238 !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .btn-vote.btn-upvote:hover {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #6ee7b7 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

[data-theme="dark"] .btn-vote.btn-upvote.active {
  background: rgba(16, 185, 129, 0.25) !important;
  color: #34d399 !important;
  border-color: #10b981 !important;
}

[data-theme="dark"] .btn-vote.btn-downvote:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

[data-theme="dark"] .btn-vote.btn-downvote.active {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #f87171 !important;
  border-color: #ef4444 !important;
}

[data-theme="dark"] .vote-score-divider {
  background: #1e293b !important;
  color: #94a3b8 !important;
}

[data-theme="dark"] .vote-score-divider.positive {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
}

[data-theme="dark"] .vote-score-divider.negative {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
}

[data-theme="dark"] .sugestao-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .sugestao-desc {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .sugestao-meta-author {
  color: #94a3b8 !important;
}

[data-theme="dark"] .sugestao-resposta-title {
  color: #6ee7b7 !important;
}

/* Stat Cards Dark */
[data-theme="dark"] .stat-card {
  background: #0e1726;
  border: 1px solid #1e293b;
}

[data-theme="dark"] .stat-title {
  color: #94a3b8;
}

[data-theme="dark"] .stat-val {
  color: #f8fafc;
}

/* Botões Secundários */
[data-theme="dark"] .btn-icon {
  background: #121d30;
  border: 1px solid #1e293b;
  color: #cbd5e1;
}

/* Theme Selector no Modal de Perfil */
.theme-selector-group {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.theme-option {
  flex: 1;
  cursor: pointer;
}

.theme-option input {
  display: none;
}

.theme-option-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  transition: all 0.2s ease;
}

.theme-option input:checked + .theme-option-box {
  border-color: var(--gold);
  background: #fffdf5;
  color: #856404;
  box-shadow: 0 0 0 2px rgba(176, 152, 116, 0.25);
}

[data-theme="dark"] .theme-option-box {
  border-color: #223249;
  background: #09111e;
  color: #94a3b8;
}

[data-theme="dark"] .theme-option input:checked + .theme-option-box {
  border-color: #d4af37;
  background: #172338;
  color: #f8fafc;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.35);
}

/* Refinamentos de Contraste Globais — Dark Mode */
[data-theme="dark"] .dash-header h1 {
  color: #f8fafc;
}

[data-theme="dark"] .dash-header p {
  color: #94a3b8;
}

[data-theme="dark"] .section-desc {
  color: #94a3b8;
}

[data-theme="dark"] .section-box-header h3 {
  color: #f8fafc;
}

[data-theme="dark"] .header-with-badge h3 {
  color: #f8fafc;
}

[data-theme="dark"] .manual-placeholder h3 {
  color: #f8fafc;
}

[data-theme="dark"] .manual-placeholder p {
  color: #94a3b8;
}

[data-theme="dark"] .manual-article-body {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .manual-article-body p,
[data-theme="dark"] .manual-article-body li,
[data-theme="dark"] .manual-article-body div {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .home-urgent-spotlight {
  background: #0e1726;
  border-color: #1e293b;
}

[data-theme="dark"] .home-urgent-spotlight .aviso-title {
  color: #f8fafc;
}

[data-theme="dark"] .home-urgent-spotlight p {
  color: #cbd5e1;
}

[data-theme="dark"] .cockpit-card-header span.badge-tag {
  background: #152238;
  color: #d4af37;
}

[data-theme="dark"] .filter-bar {
  background: transparent;
}

/* ============================================================= */
/* BOTÕES HERO REFINADOS & LINKS ELEGANTES                        */
/* ============================================================= */
.btn-hero-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 10px 18px;
  border-radius: var(--btn-radius);
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: var(--btn-transition);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-hero-action.btn-hero-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-hover));
  color: #0a192f;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(176, 152, 116, 0.25);
}

.btn-hero-action.btn-hero-gold:hover {
  background: linear-gradient(135deg, #e5c158, #c4ab85);
  box-shadow: 0 6px 18px rgba(176, 152, 116, 0.4);
}

.btn-sm-text {
  background: transparent;
  border: none;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--btn-radius-sm);
  transition: var(--btn-transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-sm-text:hover {
  background: rgba(176, 152, 116, 0.1);
  color: var(--gold-hover);
  text-decoration: underline;
}

/* ============================================================= */
/* CALENDÁRIO MENSAL INTERATIVO DA AGENDA                        */
/* ============================================================= */
.calendar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cal-day-cell.is-selected {
  background: rgba(176, 152, 116, 0.16) !important;
  outline: 2px solid var(--gold);
  z-index: 2;
}

.dot-pendente { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); }

/* ============================================================= */
/* PAINEL GRÁFICO & FLUXO FINANCEIRO                              */
/* ============================================================= */
.fin-charts-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .fin-charts-container {
    grid-template-columns: 1fr;
  }
}

.fin-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.bar-track {
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ============================================================= */
/* ALERTA DE GOVERNANÇA (90 DIAS SEM REVISÃO OPERACIONAL)        */
/* ============================================================= */
.governance-alert-box {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid #f59e0b;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* Badges e tags de Login na tabela de usuários */
.user-login-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(176, 152, 116, 0.15);
  color: var(--gold);
  border: 1px solid rgba(176, 152, 116, 0.3);
}

.btn-action-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
  border: 1px solid rgba(2, 132, 199, 0.3);
  padding: 4px 10px;
  border-radius: var(--btn-radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--btn-transition);
}

.btn-action-edit:hover {
  background: #0284c7;
  color: #ffffff;
}

[data-theme="dark"] .btn-action-edit {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

[data-theme="dark"] .btn-action-edit:hover {
  background: #38bdf8;
  color: #0f172a;
}

[data-theme="dark"] .btn-action-del {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .btn-action-del:hover {
  background: rgba(239, 68, 68, 0.32) !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-action-view {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
}

[data-theme="dark"] .btn-action-view:hover {
  background: rgba(59, 130, 246, 0.32) !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
}

[data-theme="dark"] .btn-action-pay {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
}

[data-theme="dark"] .btn-action-pay:hover {
  background: rgba(16, 185, 129, 0.32) !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

/* ============================================================= */
/* PERMISSÕES GRANULARES (MODAIS DE USUÁRIOS E CARGOS)           */
/* ============================================================= */
.granular-perms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: #f8fafc;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

/* Grade "Acesso por Módulo" — PN Fase 2.1 / ajuste layout 6-E */
.modulos-perm-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}
.mod-perm-row {
  display: grid;
  grid-template-columns: 1fr 150px;
  align-items: center;
  column-gap: 12px;
  padding: 8px;
  border-radius: 8px;
}
.mod-perm-row + .mod-perm-row { border-top: 1px solid var(--border); }
.mod-perm-row:hover { background: var(--surface); }
.mod-perm-info { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.mod-perm-info strong { font-size: 0.85rem; color: var(--text-main); line-height: 1.25; }
.mod-perm-info span { font-size: 0.72rem; color: var(--text-muted); line-height: 1.3; }
/* vence o `.form-group select { width:100% }` que espremia o rótulo */
.modulos-perm-grid select.mod-perm-select {
  width: 100%;
  max-width: 150px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  background: var(--surface);
  color: var(--text-main);
}
@media (max-width: 460px) {
  .mod-perm-row { grid-template-columns: 1fr; row-gap: 6px; }
  .modulos-perm-grid select.mod-perm-select { max-width: none; }
}
.perm-efetivas-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.8rem;
}
.perm-efetivas-table th,
.perm-efetivas-table td {
  text-align: left;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
}
.perm-efetivas-table th { color: var(--text-muted); font-weight: 700; text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.4px; }

/* Fase 2.2 — Matriz Ação × Escopo (tela de Cargos) */
.matriz-acoes-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-hover);
}
.matriz-acoes-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.matriz-acoes-table th, .matriz-acoes-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: center; }
.matriz-acoes-table thead th {
  position: sticky; top: 0; background: var(--surface);
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); font-weight: 700;
}
.matriz-acoes-table td.mx-rec, .matriz-acoes-table th.mx-rec { text-align: left; }
.matriz-acoes-grupo td {
  background: var(--surface); font-weight: 700; font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); text-align: left;
}
.matriz-acoes-table td.mx-rec strong { font-size: 0.8rem; color: var(--text-main); }
.matriz-acoes-table td.mx-rec small { color: var(--text-muted); font-size: 0.68rem; display: block; }
.matriz-acoes-table input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; }
.matriz-acoes-table input[type="checkbox"]:disabled { opacity: 0.25; cursor: not-allowed; }
.mx-escopo-select {
  padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.72rem; background: var(--surface); color: var(--text-main);
}
.mx-escopo-na { color: var(--text-muted); font-size: 0.7rem; }
.matriz-acoes-scroll { max-height: 320px; overflow: auto; }

/* Histórico de um registro — PN Fase 4-K */
.btn-hist-registro {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--btn-radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1;
  padding: 4px 6px;
  color: var(--text-muted);
}

/* Dica do combobox de fornecedor — PN Fase 5.1 */
.forn-hint-new { color: #b45309; }

/* Extrato de pontos — origem do lançamento (PN Fase 6) */
.lanc-orig { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.lanc-auto { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

.perm-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
}

.perm-checkbox-item:hover {
  background: rgba(176, 152, 116, 0.08);
}

.perm-checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

/* Modo Escuro para Permissões Granulares */
[data-theme="dark"] .granular-perms-grid {
  background: #09111e;
  border-color: #1e293b;
}

[data-theme="dark"] .perm-checkbox-item {
  color: #f1f5f9;
}

[data-theme="dark"] .perm-checkbox-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ============================================================= */
/* ACESSO RÁPIDO: ESPAÇAMENTO E GRID ROBUSTO                     */
/* ============================================================= */
.quick-shortcuts-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-shortcuts-grid .shortcut-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-shortcuts-grid .shortcut-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .quick-shortcuts-grid .shortcut-item {
  background: #121d30;
  border-color: #1e293b;
}

[data-theme="dark"] .quick-shortcuts-grid .shortcut-item:hover {
  background: #17263d;
  border-color: #d4af37;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.quick-shortcuts-grid .sc-icon {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(176, 152, 116, 0.1);
  flex-shrink: 0;
}

.quick-shortcuts-grid .sc-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.quick-shortcuts-grid .sc-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ============================================================= */
/* CARDS DE VISITAS & AÇÕES (HOMOLOGAÇÃO & RECUSA)               */
/* ============================================================= */
.visita-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

[data-theme="dark"] .visita-actions {
  border-top-color: #1e293b;
}

.visita-actions .btn-homologar-visita {
  background: #10b981;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.visita-actions .btn-homologar-visita:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.visita-actions .btn-recusar-visita {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.visita-actions .btn-recusar-visita:hover {
  background: #ef4444;
  color: #ffffff;
}

/* ============================================================= */
/* BOTÕES DE SEGURANÇA (DESCONECTAR DISPOSITIVOS & REVOGAR 2FA)  */
/* ============================================================= */
.user-security-actions-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(176, 152, 116, 0.05);
  border: 1px solid rgba(176, 152, 116, 0.2);
}

[data-theme="dark"] .user-security-actions-box {
  background: rgba(212, 175, 55, 0.04);
  border-color: rgba(212, 175, 55, 0.15);
}

.btn-security-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 7px 12px;
  border-radius: var(--btn-radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--btn-transition);
}

.btn-security-action:hover {
  background: #ef4444;
  color: #ffffff;
}

.btn-security-action.danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-security-action.danger:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Espaçamento em Linhas de Header de Sugestões e Outros Cards */
.sugestao-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.sugestao-card {
  display: flex;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.sugestao-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

[data-theme="dark"] .sugestao-card {
  background: #0e1726;
  border-color: #1e293b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .modal-box {
  background: #0f172a;
  border: 1px solid #1e293b;
  color: #f1f5f9;
}

[data-theme="dark"] .modal-footer {
  background: #0b1120;
  border-top-color: #1e293b;
}

[data-theme="dark"] .modal-body {
  color: #f1f5f9;
}

[data-theme="dark"] .sugestao-card:hover {
  background: #131f33;
  border-color: #2e4466;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.sugestao-vote-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 48px;
}

.btn-vote {
  background: var(--bg-admin);
  border: 1px solid var(--border);
  border-radius: var(--btn-radius);
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: var(--btn-transition);
  color: var(--text-main);
}

.btn-vote:hover {
  background: rgba(176, 152, 116, 0.1);
  border-color: var(--gold);
}

.btn-vote.active {
  background: var(--gold);
  color: #ffffff;
  border-color: var(--gold);
}

.vote-score-divider {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.vote-score-divider.positive { color: #10b981; }
.vote-score-divider.negative { color: #ef4444; }

.sugestao-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.sugestao-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.sugestao-meta-author {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 0.78rem;
  color: #94a3b8;
}

.sugestao-resposta-box {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(16, 185, 129, 0.06);
  border-left: 3px solid #10b981;
  border-radius: 6px;
}

.sugestao-resposta-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #059669;
  margin-bottom: 4px;
}

[data-theme="dark"] .sugestao-resposta-title {
  color: #34d399;
}

.sugestao-resposta-text {
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.4;
}

/* ============================================================= */
/* AGENDA & VISITAS: REFINAMENTO VISUAL E ESPAÇAMENTOS           */
/* ============================================================= */
.agenda-section-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  margin-bottom: 24px;
  transition: all 0.2s ease;
}

[data-theme="dark"] .agenda-section-box {
  background: #0e1726;
  border-color: #1e293b;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.header-with-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-with-badge h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.badge-pill-pulse {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .badge-pill-pulse {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.visita-card {
  background: var(--bg-admin);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

[data-theme="dark"] .visita-card {
  background: #121d30;
  border-color: #1e293b;
}

.visita-card.pendente {
  border-left: 4px solid #f59e0b;
}

.visita-card.confirmada {
  border-left: 4px solid #10b981;
}

.audit-mod-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* Paletas Temáticas por Módulo (Modo Claro) */
.audit-mod-gold {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.audit-mod-blue {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.audit-mod-emerald {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
.audit-mod-teal {
  background: #f0fdfa;
  color: #0f766e;
  border-color: #99f6e4;
}
.audit-mod-cyan {
  background: #ecfeff;
  color: #0e7490;
  border-color: #a5f3fc;
}
.audit-mod-indigo {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}
.audit-mod-purple {
  background: #faf5ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}
.audit-mod-rose {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}
.audit-mod-amber {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
.audit-mod-orange {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}
.audit-mod-slate {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
.audit-mod-navy {
  background: #0b1a30;
  color: #dbeafe;
  border-color: #1d4ed8;
}

/* Paletas Temáticas por Módulo (Modo Escuro) */
[data-theme="dark"] .audit-mod-gold {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
[data-theme="dark"] .audit-mod-emerald {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}
[data-theme="dark"] .audit-mod-teal {
  background: rgba(20, 184, 166, 0.16) !important;
  color: #2dd4bf !important;
  border-color: rgba(20, 184, 166, 0.35) !important;
}
[data-theme="dark"] .audit-mod-amber {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
[data-theme="dark"] .audit-mod-slate {
  background: rgba(148, 163, 184, 0.14) !important;
  color: #cbd5e1 !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
}

/* Linha da Ação e Chips */
.audit-code-pill {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.22);
}
[data-theme="dark"] .audit-code-pill {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.3);
}

/* Transições de Status */
.audit-state-pill {
  padding: 3px 8px;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.75rem;
}
.audit-state-pill.pill-from {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
[data-theme="dark"] .audit-state-pill.pill-from {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.2);
}
[data-theme="dark"] .audit-state-pill.pill-to {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}
.audit-state-arrow {
  color: #94a3b8;
  font-weight: bold;
}

/* Bloco de Data e Hora */
.audit-date-day {
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}
.audit-date-hour {
  font-family: monospace;
  font-size: 0.72rem;
  color: #64748b;
}
[data-theme="dark"] .audit-date-hour {
  color: #94a3b8;
}

/* Bloco do Operador */
.audit-op-sub {
  font-size: 0.74rem;
  color: #64748b;
}
[data-theme="dark"] .audit-op-sub {
  color: #94a3b8;
}

/* Ícone SVG nos botões de ação */
.action-btn-svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ========================================================================== */
/* FASE 4: POLIMENTO VISUAL ESPECÍFICO (4 ÁREAS REQUISITADAS)                 */
/* ========================================================================== */

[data-theme="dark"] .forn-cnpj-text {
  color: #f1f5f9;
}
[data-theme="dark"] .forn-tipo-pill {
  color: #94a3b8;
}

/* 2. Botões de Ação na Tabela de Usuários (Acessos Master TI) */
.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.table-actions .btn-icon {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.table-actions .btn-icon:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .table-actions .btn-icon {
  background: rgba(18, 29, 48, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .table-actions .btn-icon:hover {
  background: #1c2e4d;
  border-color: var(--gold);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.25);
}

/* 3. Header de Visitas da Kiara (Homologação & Origem) */
.badge-origem-kiara {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.2);
  letter-spacing: 0.3px;
  white-space: nowrap;
}
[data-theme="dark"] .badge-origem-kiara {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.25);
}

/* 4. Badges de Status e Confirmação de Ciência */
.side-badge {
  font-size: 0.70rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1.25;
}
.badge-warning {
  background: #f59e0b;
  color: #0f172a;
  border: 1px solid rgba(217, 119, 6, 0.4);
}

/* ============================================================= */
/* MÓDULO TAREFAS DIÁRIAS, KANBAN, GRADE HORÁRIA & CHECKLIST    */
/* ============================================================= */

/* View Switcher */
.view-switch-group {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.05);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  gap: 4px;
}
.view-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.view-switch-btn:hover {
  color: var(--navy, #142e4f);
}
[data-theme="dark"] .view-switch-btn:hover {
  color: #f8fafc;
}
.view-switch-btn.active {
  background: #ffffff;
  color: var(--navy, #142e4f);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .view-switch-btn.active {
  background: #1e293b;
  color: #f1f5f9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Kanban Board Layout */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: flex-start;
  min-height: 520px;
  padding-bottom: 24px;
}
@media (max-width: 1200px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 700px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }
}

/* Negócios & Pipeline — 6 etapas fixas, rola na horizontal em vez de empilhar
   (ordem da esquerda pra direita importa no funil de vendas). */
.kanban-board-negocios {
  grid-template-columns: repeat(6, minmax(210px, 1fr));
  min-width: 1260px;
}
@media (max-width: 1200px) {
  .kanban-board-negocios {
    grid-template-columns: repeat(6, minmax(210px, 1fr));
  }
}
@media (max-width: 700px) {
  .kanban-board-negocios {
    grid-template-columns: repeat(6, minmax(210px, 1fr));
  }
}

.kanban-col {
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  min-height: 480px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
[data-theme="dark"] .kanban-col {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.08);
}
.kanban-col.drag-over {
  background: rgba(14, 165, 233, 0.05);
  border: 2px dashed #0ea5e9;
}

.kanban-col-header {
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
[data-theme="dark"] .kanban-col-header {
  border-color: rgba(255, 255, 255, 0.08);
}
.col-hdr-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  color: #1e293b;
}
[data-theme="dark"] .col-hdr-title {
  color: #f1f5f9;
}
.col-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.dot-pendente { background: #64748b; }
.dot-andamento { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.dot-revisao { background: #3b82f6; }
.dot-concluida { background: #10b981; }

.col-count-badge {
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.07);
  color: #475569;
  padding: 2px 8px;
  border-radius: 999px;
}
[data-theme="dark"] .col-count-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.kanban-col-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 200px;
}

/* Kanban Card */
.task-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: grab;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.task-card:active {
  cursor: grabbing;
}
.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}
[data-theme="dark"] .task-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .task-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.task-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.task-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Prioridades */
.badge-prio {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-prio-urgente {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #f87171;
}
.badge-prio-alta {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}
.badge-prio-media {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}
.badge-prio-baixa {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}
[data-theme="dark"] .badge-prio-urgente {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.5);
}
[data-theme="dark"] .badge-prio-alta {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.5);
}
[data-theme="dark"] .badge-prio-media {
  background: rgba(14, 165, 233, 0.2);
  color: #7dd3fc;
  border-color: rgba(14, 165, 233, 0.5);
}
[data-theme="dark"] .badge-prio-baixa {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.3);
}

.task-time-badge {
  font-size: 0.72rem;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}
[data-theme="dark"] .task-time-badge {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
}

.task-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.35;
  color: #0f172a;
  margin: 0;
}
[data-theme="dark"] .task-card-title {
  color: #f8fafc;
}
.task-card.is-concluida .task-card-title {
  text-decoration: line-through;
  opacity: 0.7;
}

.task-card-desc {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
[data-theme="dark"] .task-card-desc {
  color: #94a3b8;
}

/* Checklist Progress */
.task-checklist-box {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  padding: 8px 10px;
}
[data-theme="dark"] .task-checklist-box {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.05);
}
.task-checklist-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 5px;
}
[data-theme="dark"] .task-checklist-meta {
  color: #cbd5e1;
}
.task-checklist-track {
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.task-checklist-fill {
  height: 100%;
  background: #10b981;
  transition: width 0.3s ease;
  border-radius: 999px;
}

/* Checklist Itens Inline */
.task-chk-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #334155;
  cursor: pointer;
}
[data-theme="dark"] .task-chk-row {
  color: #cbd5e1;
}

/* Card Footer */
.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}
[data-theme="dark"] .task-card-footer {
  border-color: rgba(255, 255, 255, 0.06);
}
.task-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}
[data-theme="dark"] .task-user-pill {
  color: #94a3b8;
}
.task-user-avatar-sm {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--navy, #142e4f);
  color: #ffffff;
  font-size: 0.62rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.task-actions-btn-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-task-action {
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: var(--btn-radius-sm);
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  cursor: pointer;
  color: #64748b;
  transition: var(--btn-transition);
}
.btn-task-action:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}
[data-theme="dark"] .btn-task-action {
  border-color: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}
[data-theme="dark"] .btn-task-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* GRADE HORÁRIA / TIMELINE */
.horaria-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 16px;
}
[data-theme="dark"] .horaria-header-bar {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}
.time-slot-row {
  display: grid;
  grid-template-columns: 85px 1fr;
  gap: 14px;
  align-items: stretch;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  transition: border-color 0.2s ease;
}
[data-theme="dark"] .time-slot-row {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}
.time-slot-row.now-hour {
  border-left: 4px solid var(--gold, #c5a86a);
  background: rgba(197, 168, 106, 0.04);
}
.time-slot-hour {
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--navy, #142e4f);
}
.time-task-pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.time-task-pill:hover {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border-color: var(--gold, #c5a86a);
}
[data-theme="dark"] .time-task-pill {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}
[data-theme="dark"] .time-task-pill:hover {
  background: #1e293b;
  border-color: var(--gold, #c5a86a);
}

/* Modal Checklist Builder */
.modal-chk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 6px 10px;
  border-radius: 6px;
}
[data-theme="dark"] .modal-chk-item {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.08);
}
.modal-chk-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.modal-chk-remove-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0 4px;
  line-height: 1;
}

/* ============================================================= */
/* FASE 6: CENTRAL KIARA SDR & GESTÃO DE VISITAS / DOSSIÊ BANT   */
/* (REDEFINIÇÃO VISUAL DE ALTA PERFORMANCE & HARMONIA PREMIUM)   */
/* ============================================================= */

.kiara-command-center {
  border-top: 3px solid var(--gold, #c5a86a) !important;
  border-radius: 12px;
}

.visitas-inbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.visita-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.visita-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
  border-color: var(--gold, #c5a86a);
}

.visita-card.pendente {
  border-left: 4px solid #f59e0b;
}

.visita-card.confirmada {
  border-left: 4px solid #10b981;
}

.visita-card.reagendamento {
  border-left: 4px solid #3b82f6;
}

/* Cliente pediu cancelamento — precisa saltar aos olhos na fila */
.visita-card.cancelamento-solicitado {
  border-left: 5px solid #dc2626;
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.05) 0%, transparent 90px);
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.25);
}

.visita-card.handoff-ativo {
  border-left: 4px solid #8b5cf6;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.04) 0%, var(--bg-card) 100%);
}

.visita-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.visita-badge-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* Chips temáticos para as 9 Categorias */
.chip-cat {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.chip-cat-onl { background: #f0fdfa; color: #0f766e; border: 1px solid #99f6e4; }
.chip-cat-fin { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.chip-cat-jur { background: #f8fafc; color: #334155; border: 1px solid #cbd5e1; }
.chip-cat-mkt { background: rgba(245, 158, 11, 0.15); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.35); }

.badge-origem-kiara {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(100, 116, 139, 0.08);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(100, 116, 139, 0.15);
  white-space: nowrap;
}

/* Título harmônico */
.visita-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin: 0 0 12px 0;
  word-break: break-word;
}

/* Pílula de WhatsApp - NUNCA QUEBRA LINHA */
.btn-whatsapp-pill {
  white-space: nowrap !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(37, 211, 102, 0.12);
  color: #15803d;
  border: 1px solid rgba(37, 211, 102, 0.28);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: var(--btn-transition);
  line-height: 1.2;
}

/* Grade de Informações do Lead & Imóvel */
.visita-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  background: var(--bg-main, #f8fafc);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  margin-bottom: 10px;
}

.visita-info-label {
  font-size: 0.68rem;
  color: var(--text-muted, #64748b);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.visita-info-val code {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Balão do Dossiê Kiara */
.visita-dossie-quote {
  background: rgba(197, 168, 106, 0.06);
  border-left: 3px solid var(--gold, #c5a86a);
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  font-size: 0.78rem;
  color: var(--text-main);
  line-height: 1.45;
  margin-top: 4px;
  position: relative;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Barra de Ações Alinhada e Harmônica */
.visita-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

.btn-dossie-bant:hover {
  background: rgba(197, 168, 106, 0.24);
  border-color: var(--gold, #c5a86a);
  transform: translateY(-1px);
}

.btn-atribuir-corretor {
  background: var(--bg-main, #f1f5f9);
  color: var(--text-main, #334155);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: var(--btn-radius);
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--btn-transition);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
}

.btn-atribuir-corretor:hover {
  background: var(--border-color, #e2e8f0);
}

.btn-handoff-toggle {
  background: rgba(139, 92, 246, 0.08);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--btn-radius);
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--btn-transition);
  height: 32px;
  margin-left: auto;
}

/* Fileira de Decisão Principal (Homologar, Reagendar, Recusar) */

.btn-homologar-visita {
  background: #10b981;
  color: #ffffff;
  border: none;
  border-radius: var(--btn-radius);
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--btn-transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
}

/* ============================================================= */
/* MODAL DE RESUMO INTUITIVO DE TAREFAS & DETALHES DE EXECUÇÃO   */
/* ============================================================= */

.resumo-tarefa-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  .resumo-tarefa-meta-grid {
    grid-template-columns: 1fr;
  }
}

.resumo-meta-card {
  background: var(--bg-main, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
}

.resumo-meta-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.resumo-meta-icon {
  font-size: 0.85rem;
}

.resumo-meta-label {
  font-size: 0.68rem;
  color: var(--text-muted, #64748b);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.resumo-meta-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-main);
  min-height: 32px;
}

.resumo-time-pill {
  font-size: 0.74rem;
  color: var(--gold, #c5a86a);
  background: rgba(197, 168, 106, 0.12);
  border: 1px solid rgba(197, 168, 106, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.resumo-status-dropdown {
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-card, #ffffff);
  color: var(--text-main, #0f172a);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.resumo-status-dropdown:hover,
.resumo-status-dropdown:focus {
  border-color: var(--gold, #c5a86a);
}

.resumo-recorrencia-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(100, 116, 139, 0.08);
  border: 1px solid rgba(100, 116, 139, 0.2);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
}

.resumo-secao-box {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 16px;
}

.resumo-tarefa-desc-content {
  background: var(--bg-main, #f8fafc);
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e2e8f0);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

.resumo-chk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-main, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.resumo-chk-item:hover {
  border-color: var(--gold, #c5a86a);
  background: rgba(197, 168, 106, 0.05);
}

.resumo-chk-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold, #c5a86a);
  cursor: pointer;
}

/* Indicadores de clique nos cards de tarefas */
.task-card {
  cursor: pointer;
  transition: all 0.2s ease;
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  border-color: var(--gold, #c5a86a);
}

.task-card .task-actions-btn-group button,
.task-card input[type="checkbox"] {
  cursor: pointer;
}

.time-task-pill {
  cursor: pointer;
  transition: all 0.2s ease;
}

.time-task-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

/* Prevenção de quebra feia na tabela da agenda */
#agendaTable td code {
  white-space: nowrap !important;
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
}

#agendaTable td {
  vertical-align: middle;
}

/* Modo escuro para Fase 6 e Resumo de Tarefas */
[data-theme="dark"] .visita-card {
  background: #111827;
  border-color: #1f2937;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .visita-info-grid {
  background: #0b1120;
  border-color: #1e293b;
}

[data-theme="dark"] .visita-dossie-quote {
  background: #0f172a;
  border-left-color: #f59e0b;
  color: #cbd5e1;
}

[data-theme="dark"] .chip-cat-vis { background: rgba(236, 253, 245, 0.15); color: #6ee7b7; border-color: rgba(167, 243, 208, 0.3); }
[data-theme="dark"] .chip-cat-jur { background: rgba(248, 250, 252, 0.15); color: #cbd5e1; border-color: rgba(203, 213, 225, 0.3); }

[data-theme="dark"] .btn-atribuir-corretor {
  background: #1e293b;
  color: #f1f5f9;
  border-color: #334155;
}
[data-theme="dark"] .btn-atribuir-corretor:hover {
  background: #334155;
}
[data-theme="dark"] .btn-dossie-bant {
  color: #fcd34d;
}

[data-theme="dark"] .resumo-meta-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

[data-theme="dark"] .resumo-meta-card strong {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .resumo-status-dropdown {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .resumo-recorrencia-badge {
  background: rgba(148, 163, 184, 0.1) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .resumo-secao-box,
[data-theme="dark"] .resumo-tarefa-desc-content,
[data-theme="dark"] .resumo-chk-item {
  background: #0f172a !important;
  border-color: #1e293b !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] #agendaTable td code {
  background: rgba(255, 255, 255, 0.08);
}

/* ============================================================= */
/* FASE 7: BANCO INTER PJ - BOLETOS, PIX COBRANÇA & SPLIT        */
/* ============================================================= */

.inter-banner-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.08) 0%, rgba(20, 46, 79, 0.05) 100%);
  border: 1px solid rgba(234, 88, 12, 0.25);
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.inter-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
  border: 1px solid rgba(234, 88, 12, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@keyframes pulse-inter {
  to {
    box-shadow: 0 0 0 8px rgba(234, 88, 12, 0);
  }
}

[data-theme="dark"] .inter-split-preview-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

[data-theme="dark"] #viewInterPixCode,
[data-theme="dark"] #viewInterLinhaDigitavel {
  background: #0f172a !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}


/* ================================================================ */
/* SIDEBAR — GRUPO EXPANSÍVEL (Finance & outros futuros grupos)     */
/* ================================================================ */

/* NOVO (12/09/2026) — antes estes itens só apareciam com o grupo aberto,
   então cabia serem visualmente menores/secundários. Agora ficam sempre
   visíveis junto dos itens principais, então precisam do mesmo peso visual
   (tamanho de fonte, ícone e espaçamento) — senão parecem uma lista
   secundária esquecida dentro do menu. */
.sidebar-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  margin-bottom: 3px;
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 0.855rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.sub-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.08rem;
  min-width: 22px;
  opacity: .92;
  text-align: center;
}

/* Cofre de Documentos, Gestão Financeira, Agenda & Visitas, etc. deixaram de
   ter cabeçalho próprio. O contador de pendências de cada grupo (Agenda,
   Tarefas, Patch Notes) tentou virar uma linha/selo solto algumas vezes, mas
   isso sempre destoava do resto (única linha sem ícone nem texto, tamanho
   diferente). Solução definitiva: o contador mora dentro de um sub-item real
   (Compromissos, Kanban, Notas de Atualização) como um .sub-item-badge comum
   — exatamente a mesma peça já usada em Fila Kiara SDR e Notas Fiscais, sem
   nenhum elemento "solto" na sidebar. */

.sub-item-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}


/* ================================================================ */
/* MÓDULO FINANCEIRO — HEADER REDESENHADO                          */
/* ================================================================ */

.fin-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.fin-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.fin-header-title-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.fin-header-icon {
  font-size: 2rem;
  line-height: 1;
  background: linear-gradient(135deg, rgba(176, 152, 116, 0.15), rgba(176, 152, 116, 0.05));
  border: 1px solid rgba(176, 152, 116, 0.25);
  border-radius: 12px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fin-header-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
  margin-bottom: 3px;
}

.fin-header-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
}

.fin-refresh-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Action Bar */
.fin-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.fin-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fin-action-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.fin-action-btn {
  height: 34px !important;
  padding: 0 12px !important;
  font-size: 0.82rem !important;
  border-radius: 8px !important;
}

.fin-action-divider {
  width: 1px;
  height: 30px;
  background: var(--border);
  flex-shrink: 0;
}

/* Espaçador que empurra o grupo persistente (Cockpit/Históricos) para a direita;
   só some quando não há nenhum grupo contextual visível ao lado. */
.fin-action-bar-spacer {
  flex: 1 1 auto;
}

.fin-action-group-persistent {
  border-left: 1px solid var(--border);
  padding-left: 10px;
}

.fin-btn-green {
  background: #059669 !important;
  border-color: #047857 !important;
  color: #fff !important;
}
.fin-btn-green:hover {
  background: #047857 !important;
}

.fin-btn-orange {
  background: #ea580c !important;
  border-color: #c2410c !important;
  color: #fff !important;
}
.fin-btn-orange:hover {
  background: #c2410c !important;
}

/* Dark Mode: Finance Header */
[data-theme="dark"] .fin-header {
  background: #0e1726;
  border-color: #1e293b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .fin-header-title {
  color: #f1f5f9;
}

[data-theme="dark"] .fin-header-icon {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(212, 175, 55, 0.04));
  border-color: rgba(212, 175, 55, 0.2);
}


/* ================================================================ */
/* KPI CARDS FINANCEIROS — DESIGN MELHORADO                        */
/* ================================================================ */

.fin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.fin-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border-left: 4px solid transparent;
}

.fin-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.fin-kpi-icon-wrap {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.fin-kpi-content {
  flex: 1;
  min-width: 0;
}

.fin-kpi-label {
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 4px;
  line-height: 1.3;
}

.fin-kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.fin-kpi-sub {
  margin-top: 5px;
}

.fin-kpi-sub-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* KPI Color Variants */
.fin-kpi-danger { border-left-color: #ef4444; }
.fin-kpi-danger .fin-kpi-value { color: #dc2626; }
.fin-kpi-danger .fin-kpi-sub-badge { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

.fin-kpi-success { border-left-color: #10b981; }
.fin-kpi-success .fin-kpi-value { color: #059669; }

.fin-kpi-info { border-left-color: #3b82f6; }
.fin-kpi-info .fin-kpi-value { color: #2563eb; }

.fin-kpi-warning { border-left-color: #f59e0b; }
.fin-kpi-warning .fin-kpi-value { color: #d97706; }
.fin-kpi-warning .fin-kpi-sub-badge { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

.fin-kpi-gold { border-left-color: #b09874; }
.fin-kpi-gold .fin-kpi-value { color: #b09874; }

/* Dark Mode: KPI Cards */
[data-theme="dark"] .fin-kpi-card {
  background: #0e1726;
  border-color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .fin-kpi-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .fin-kpi-label {
  color: #64748b;
}
[data-theme="dark"] .fin-kpi-danger .fin-kpi-value { color: #f87171; }
[data-theme="dark"] .fin-kpi-success .fin-kpi-value { color: #34d399; }
[data-theme="dark"] .fin-kpi-info .fin-kpi-value { color: #60a5fa; }
[data-theme="dark"] .fin-kpi-warning .fin-kpi-value { color: #fbbf24; }
[data-theme="dark"] .fin-kpi-gold .fin-kpi-value { color: #d4af37; }
[data-theme="dark"] .fin-kpi-warning .fin-kpi-sub-badge {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.25);
}
[data-theme="dark"] .fin-kpi-danger .fin-kpi-sub-badge {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.25);
}


/* ================================================================ */
/* SECTION INDICATOR — breadcrumb interno da sub-aba ativa         */
/* ================================================================ */

.fin-section-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.fin-section-icon {
  font-size: 1.1rem;
}

.fin-section-name {
  color: var(--navy);
  font-weight: 700;
}

[data-theme="dark"] .fin-section-indicator {
  background: #0e1726;
  border-color: #1e293b;
}

[data-theme="dark"] .fin-section-name {
  color: #f1f5f9;
}


/* ================================================================ */
/* DARK MODE — FIX ABRANGENTE: MODAIS, TABELAS, INPUTS, SELECTS    */
/* ================================================================ */

/* Modal Box */
[data-theme="dark"] .modal-box {
  background: #0e1726 !important;
  color: #f1f5f9;
}

[data-theme="dark"] .modal-body {
  background: #0e1726;
  color: #e2e8f0;
}

[data-theme="dark"] .modal-footer {
  background: #0b1120;
  border-top: 1px solid #1e293b;
}

/* Tabelas */
[data-theme="dark"] .table-container {
  background: #0e1726;
  border-color: #1e293b;
}

[data-theme="dark"] th {
  background: #0b1120 !important;
  color: #64748b !important;
  border-bottom-color: #1e293b !important;
}

[data-theme="dark"] td {
  color: #e2e8f0;
  border-bottom-color: #1e293b;
}

[data-theme="dark"] tr:hover td {
  background-color: #152238 !important;
}

[data-theme="dark"] .stat-card {
  background: #0e1726;
  border-color: #1e293b;
}

[data-theme="dark"] .stat-title {
  color: #64748b;
}

[data-theme="dark"] .stat-val {
  color: #f1f5f9;
}

/* Inputs e Selects globais */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] textarea {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] input[type="text"]:focus,
[data-theme="dark"] input[type="email"]:focus,
[data-theme="dark"] input[type="number"]:focus,
[data-theme="dark"] input[type="date"]:focus,
[data-theme="dark"] textarea:focus {
  border-color: #d4af37 !important;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #475569 !important;
}

[data-theme="dark"] select,
[data-theme="dark"] .status-select {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .search-input {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .search-input:focus {
  border-color: #d4af37 !important;
}

/* Filter Bar */
[data-theme="dark"] .filter-bar {
  background: #0e1726 !important;
  border-color: #1e293b !important;
}

/* Labels nos modais */
[data-theme="dark"] .modal-body label {
  color: #94a3b8;
}

/* Badge Code */
[data-theme="dark"] .badge-code {
  background: #1e293b;
  color: #7dd3fc;
}

/* Botão de ícone */
[data-theme="dark"] .btn-icon {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .btn-icon:hover {
  background: #263348 !important;
  border-color: #475569 !important;
}

/* Botão de ícone gold/dourado */
[data-theme="dark"] .btn-icon.gold {
  background: rgba(212, 175, 55, 0.15) !important;
  color: #d4af37 !important;
  border-color: rgba(212, 175, 55, 0.35) !important;
}

[data-theme="dark"] .btn-icon.gold:hover {
  background: rgba(212, 175, 55, 0.25) !important;
}

/* Batch Action Bar */
[data-theme="dark"] .batch-action-bar {
  background: #0f172a;
  border-color: #1e293b;
  color: #e2e8f0;
}

/* Dash Header title (azul escuro) fica invisível no dark */
[data-theme="dark"] .dash-header h1 {
  color: #f1f5f9;
}

[data-theme="dark"] .dash-header p {
  color: #64748b;
}

/* Patch Notes / cards genéricos */
[data-theme="dark"] .table-card {
  background: #0e1726;
  border-color: #1e293b;
}

/* Tooltips e pequenas labels */
[data-theme="dark"] .subnav-counter {
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

/* Action Bar dark */
[data-theme="dark"] .fin-action-bar {
  border-top-color: #1e293b;
}

[data-theme="dark"] .fin-action-divider {
  background: #1e293b;
}

[data-theme="dark"] .fin-action-label {
  color: #475569;
}


/* ================================================================ */
/* COMPONENTES TAB-HEADER UNIFICADOS (v7.0) — TODAS AS ABAS         */
/* ================================================================ */

.tab-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tab-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.tab-header-title-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tab-header-icon {
  font-size: 2rem;
  line-height: 1;
  background: linear-gradient(135deg, rgba(176, 152, 116, 0.15), rgba(176, 152, 116, 0.05));
  border: 1px solid rgba(176, 152, 116, 0.25);
  border-radius: 12px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tab-header-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.15;
  margin-bottom: 3px;
}

.tab-header-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* .tab-header-bar/.tab-header-actions/.tab-header-subtitle: variante mais simples
   de cabeçalho de aba (sem o bloco de ícone), usada em Imóveis VistaSoft, Meus
   Imóveis, Carteira de Clientes, Negócios & Pipeline, Pessoas Externas e Pessoas
   (Cadastro Mestre) — nunca tinham nenhuma regra, título/subtítulo/botões caíam
   como blocos soltos em vez do layout título-à-esquerda/ações-à-direita. */
.tab-header-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.tab-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tab-header-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
  margin: 4px 0 0;
}
[data-theme="dark"] .tab-header-bar {
  background: #0e1726;
  border-color: #1e293b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.tab-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  margin-bottom: 20px;
}

.tab-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-action-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.tab-action-btn {
  height: 34px !important;
  padding: 0 12px !important;
  font-size: 0.82rem !important;
  border-radius: 8px !important;
}

.tab-action-divider {
  width: 1px;
  height: 30px;
  background: var(--border);
  flex-shrink: 0;
}

/* Indicador de sub-seção unificado */
.tab-section-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* KPI Grid & Cards Unificados */
.tab-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.tab-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border-left: 4px solid transparent;
}

.tab-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tab-kpi-icon-wrap {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.tab-kpi-content {
  flex: 1;
  min-width: 0;
}

.tab-kpi-label {
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 4px;
  line-height: 1.3;
}

.tab-kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

/* Variantes de cores para tab-kpi */
.tab-kpi-info { border-left-color: #3b82f6; }
.tab-kpi-info .tab-kpi-value { color: #2563eb; }

.tab-kpi-success { border-left-color: #10b981; }
.tab-kpi-success .tab-kpi-value { color: #059669; }

.tab-kpi-warning { border-left-color: #f59e0b; }
.tab-kpi-warning .tab-kpi-value { color: #d97706; }

.tab-kpi-danger { border-left-color: #ef4444; }
.tab-kpi-danger .tab-kpi-value { color: #dc2626; }

.tab-kpi-gold { border-left-color: #b09874; }
.tab-kpi-gold .tab-kpi-value { color: #b09874; }

.tab-kpi-purple { border-left-color: #8b5cf6; }
.tab-kpi-purple .tab-kpi-value { color: #7c3aed; }

/* Dark mode: tab-header e tab-kpi */
[data-theme="dark"] .tab-header {
  background: #0e1726;
  border-color: #1e293b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .tab-header-title {
  color: #f1f5f9;
}

[data-theme="dark"] .tab-header-icon {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(212, 175, 55, 0.04));
  border-color: rgba(212, 175, 55, 0.2);
}

[data-theme="dark"] .tab-action-bar {
  border-top-color: #1e293b;
}

[data-theme="dark"] .tab-action-divider {
  background: #1e293b;
}

[data-theme="dark"] .tab-action-label {
  color: #64748b;
}

[data-theme="dark"] .tab-section-indicator {
  background: #0e1726;
  border-color: #1e293b;
}

[data-theme="dark"] .tab-section-name {
  color: #f1f5f9;
}

[data-theme="dark"] .tab-kpi-card {
  background: #0e1726;
  border-color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .tab-kpi-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .tab-kpi-label {
  color: #64748b;
}

[data-theme="dark"] .tab-kpi-info .tab-kpi-value { color: #60a5fa; }
[data-theme="dark"] .tab-kpi-success .tab-kpi-value { color: #34d399; }
[data-theme="dark"] .tab-kpi-warning .tab-kpi-value { color: #fbbf24; }
[data-theme="dark"] .tab-kpi-danger .tab-kpi-value { color: #f87171; }
[data-theme="dark"] .tab-kpi-gold .tab-kpi-value { color: #d4af37; }
[data-theme="dark"] .tab-kpi-purple .tab-kpi-value { color: #a78bfa; }

/* Dark mode: boxes de seções da agenda e cockpits */
[data-theme="dark"] .agenda-section-box {
  background: #0e1726 !important;
  border-color: #1e293b !important;
}

[data-theme="dark"] .agenda-section-box h3,
[data-theme="dark"] .cockpit-card h3,
[data-theme="dark"] .meta-title {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .cockpit-card {
  background: #0e1726 !important;
  border-color: #1e293b !important;
}

[data-theme="dark"] .meta-coletiva-card {
  background: #0e1726 !important;
  border-color: #1e293b !important;
}

[data-theme="dark"] .manual-sidebar,
[data-theme="dark"] .manual-article-viewer {
  background: #0e1726 !important;
  border-color: #1e293b !important;
}

[data-theme="dark"] .manual-category-item {
  color: #94a3b8;
}

[data-theme="dark"] .manual-category-item:hover {
  background: #1e293b;
  color: #f1f5f9;
}

[data-theme="dark"] .manual-content-view {
  color: #e2e8f0;
}

/* ==========================================================================
   GUIA "COMO USAR ESTA ABA" (DESIGN LUXUOSO & RETRÁTIL)
   ========================================================================== */

.guia-como-usar-card {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.45) 0%, rgba(255, 251, 235, 0.8) 100%);
  border: 1px solid rgba(217, 119, 6, 0.35);
  border-left: 5px solid #d97706;
  border-radius: 14px;
  /* Antes só tinha margem embaixo — quando aparecia logo depois de uma
     tabela/seção anterior, colava sem respiro nenhum. */
  margin: 28px 0 24px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(217, 119, 6, 0.08);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .guia-como-usar-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 41, 59, 0.82) 100%);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-left: 5px solid #f59e0b;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(217, 119, 6, 0.08);
}

.guia-como-usar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
  background: rgba(217, 119, 6, 0.08);
  border-bottom: 1px solid rgba(217, 119, 6, 0.15);
  transition: all 0.2s ease;
}

.guia-como-usar-header:hover {
  background: rgba(217, 119, 6, 0.14);
}

[data-theme="dark"] .guia-como-usar-header {
  background: rgba(217, 119, 6, 0.1);
  border-bottom: 1px solid rgba(217, 119, 6, 0.2);
}

[data-theme="dark"] .guia-como-usar-header:hover {
  background: rgba(217, 119, 6, 0.18);
}

.guia-como-usar-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.guia-como-usar-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff !important;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.35);
}

.guia-como-usar-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #78350f;
  letter-spacing: -0.01em;
}

[data-theme="dark"] .guia-como-usar-title {
  color: #fde68a;
}

.guia-como-usar-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(217, 119, 6, 0.15);
  color: #92400e;
  border: 1px solid rgba(217, 119, 6, 0.35);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="dark"] .guia-como-usar-toggle-btn {
  background: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

.guia-como-usar-toggle-btn:hover {
  background: rgba(217, 119, 6, 0.25);
  transform: translateY(-1px);
}

.guia-como-usar-chevron {
  font-size: 0.75rem;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-block;
}

/* ==========================================================================
   ESTADO RECOLHIDO DO GUIA (RETRAÇÃO PERFEITA)
   ========================================================================== */
.guia-como-usar-card.recolhido {
  margin-bottom: 14px !important;
}

.guia-como-usar-card.recolhido .guia-como-usar-header {
  border-bottom: none !important;
}

.guia-como-usar-card.recolhido .guia-como-usar-body {
  display: none !important;
}

.guia-como-usar-card.recolhido .guia-como-usar-chevron {
  transform: rotate(-90deg) !important;
}

/* Corpo e Grid de 3 Colunas */
.guia-como-usar-body {
  padding: 20px;
  animation: guiaFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes guiaFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.guia-grid-colunas {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

@media (max-width: 980px) {
  .guia-grid-colunas {
    grid-template-columns: 1fr;
  }
}

.guia-coluna {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(217, 119, 6, 0.18);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .guia-coluna {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(217, 119, 6, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.guia-coluna-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(217, 119, 6, 0.15);
}

.guia-coluna-icon {
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: rgba(217, 119, 6, 0.15);
  border-radius: 8px;
}

.guia-coluna-titulo {
  font-size: 0.88rem;
  font-weight: 700;
  color: #78350f;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

[data-theme="dark"] .guia-coluna-titulo {
  color: #fcd34d;
}

.guia-coluna p {
  font-size: 0.87rem;
  line-height: 1.55;
  color: #334155;
  margin: 0;
}

[data-theme="dark"] .guia-coluna p {
  color: #cbd5e1;
}

.guia-passos-lista {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guia-passos-lista li {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #334155;
}

[data-theme="dark"] .guia-passos-lista li {
  color: #cbd5e1;
}

.guia-passos-lista li::marker {
  color: #d97706;
  font-weight: 700;
}


/* ==========================================================================
   WIDGET FLUTUANTE DO COPILOTO IA (DESIGN LUXUOSO / GLASSMORPHISM)
   ========================================================================== */

/* Botão Flutuante (FAB) */
.copiloto-fab {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 9999 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 8px 20px 8px 10px !important;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
  border: 1.5px solid rgba(245, 158, 11, 0.6) !important;
  border-radius: 50px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(217, 119, 6, 0.3) !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  color: #ffffff !important;
  width: auto !important;
  height: auto !important;
}

.copiloto-fab:hover {
  transform: translateY(-3px) scale(1.03) !important;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55), 0 0 30px rgba(217, 119, 6, 0.5) !important;
  border-color: #fbbf24 !important;
}

.copiloto-fab-avatar {
  font-size: 1.35rem;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.4);
  flex-shrink: 0;
}

.copiloto-fab-label {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
  white-space: nowrap;
}

.copiloto-fab-pulse {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulseVerde 2s infinite;
  flex-shrink: 0;
}

@keyframes pulseVerde {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Modal / Drawer do Copiloto */
.copiloto-modal {
  position: fixed !important;
  bottom: 84px !important;
  right: 24px !important;
  width: 440px !important;
  max-width: calc(100vw - 32px) !important;
  height: 640px !important;
  max-height: calc(100vh - 100px) !important;
  z-index: 10000 !important;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.97) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1.5px solid rgba(245, 158, 11, 0.4) !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 35px rgba(217, 119, 6, 0.18) !important;
  overflow: hidden;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .copiloto-modal {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1.5px solid rgba(217, 119, 6, 0.35) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18), 0 0 25px rgba(217, 119, 6, 0.1) !important;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header do Copiloto */
.copiloto-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 16px 18px !important;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%) !important;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25) !important;
}

[data-theme="light"] .copiloto-header {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  border-bottom: 1px solid rgba(217, 119, 6, 0.2) !important;
}

.copiloto-brand {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.copiloto-avatar-header {
  width: 40px !important;
  height: 40px !important;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.35rem !important;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.35) !important;
}

.copiloto-title {
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  line-height: 1.2 !important;
}

[data-theme="light"] .copiloto-title {
  color: #78350f !important;
}

.copiloto-status {
  font-size: 0.74rem !important;
  color: #94a3b8 !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-top: 3px !important;
}

[data-theme="light"] .copiloto-status {
  color: #92400e !important;
}

.copiloto-status-dot {
  width: 7px !important;
  height: 7px !important;
  background: #10b981 !important;
  border-radius: 50% !important;
  display: inline-block !important;
  box-shadow: 0 0 6px #10b981 !important;
}

.copiloto-actions {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.copiloto-action-btn {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #94a3b8 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 0.95rem !important;
  transition: all 0.2s ease !important;
}

[data-theme="light"] .copiloto-action-btn {
  background: rgba(0, 0, 0, 0.05) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: #78350f !important;
}

.copiloto-action-btn:hover {
  background: rgba(217, 119, 6, 0.25) !important;
  color: #fde68a !important;
  border-color: rgba(217, 119, 6, 0.4) !important;
}

/* Quick Chips */
.copiloto-quick-chips {
  display: flex !important;
  gap: 8px !important;
  padding: 10px 16px !important;
  overflow-x: auto !important;
  white-space: nowrap !important;
  background: rgba(15, 23, 42, 0.5) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  scrollbar-width: none !important;
}

.copiloto-quick-chips::-webkit-scrollbar {
  display: none !important;
}

[data-theme="light"] .copiloto-quick-chips {
  background: rgba(245, 245, 244, 0.7) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.quick-chip {
  padding: 6px 14px !important;
  background: rgba(217, 119, 6, 0.14) !important;
  border: 1px solid rgba(217, 119, 6, 0.32) !important;
  border-radius: 20px !important;
  color: #fde68a !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0 !important;
}

[data-theme="light"] .quick-chip {
  background: rgba(217, 119, 6, 0.1) !important;
  border-color: rgba(217, 119, 6, 0.3) !important;
  color: #92400e !important;
}

.quick-chip:hover {
  background: rgba(217, 119, 6, 0.28) !important;
  border-color: #f59e0b !important;
  transform: translateY(-1px) !important;
}

/* Feed de Mensagens */
.copiloto-messages {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 18px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}

.copiloto-bubble {
  max-width: 88% !important;
  padding: 14px 16px !important;
  border-radius: 16px !important;
  font-size: 0.88rem !important;
  line-height: 1.55 !important;
  word-wrap: break-word !important;
  animation: bubbleFadeIn 0.25s ease !important;
}

.copiloto-bubble-user {
  align-self: flex-end !important;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  color: #ffffff !important;
  border-bottom-right-radius: 4px !important;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3) !important;
}

.copiloto-bubble-ai {
  align-self: flex-start !important;
  background: rgba(30, 41, 59, 0.88) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-bottom-left-radius: 4px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] .copiloto-bubble-ai {
  background: #f8fafc !important;
  color: #1e293b !important;
  border: 1px solid #e2e8f0 !important;
}

.bubble-sender {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  opacity: 0.85 !important;
  margin-bottom: 6px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

.bubble-text {
  line-height: 1.6 !important;
}

.bubble-text strong {
  color: #fde68a !important;
}

[data-theme="light"] .bubble-text strong {
  color: #92400e !important;
}

.bubble-time {
  font-size: 0.68rem !important;
  opacity: 0.6 !important;
  text-align: right !important;
  margin-top: 6px !important;
}

/* Footer & Input */
.copiloto-footer {
  padding: 14px 16px !important;
  background: rgba(15, 23, 42, 0.95) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="light"] .copiloto-footer {
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
}

.copiloto-input-wrapper {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: rgba(30, 41, 59, 0.85) !important;
  border: 1.5px solid rgba(217, 119, 6, 0.4) !important;
  border-radius: 24px !important;
  padding: 4px 6px 4px 16px !important;
  transition: border-color 0.2s ease !important;
}

[data-theme="light"] .copiloto-input-wrapper {
  background: #f1f5f9 !important;
  border-color: rgba(217, 119, 6, 0.3) !important;
}

.copiloto-input-wrapper:focus-within {
  border-color: #f59e0b !important;
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.3) !important;
}

.copiloto-textarea {
  flex: 1 !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #f8fafc !important;
  font-family: inherit !important;
  font-size: 0.88rem !important;
  line-height: 1.4 !important;
  resize: none !important;
  max-height: 90px !important;
  padding: 8px 0 !important;
}

[data-theme="light"] .copiloto-textarea {
  color: #0f172a !important;
}

.copiloto-send-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  border: none !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.35) !important;
  transition: all 0.2s ease !important;
}

.copiloto-send-btn:hover {
  transform: scale(1.06) !important;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}


/* ==========================================================================
   CHAT DA EQUIPE EM TEMPO REAL (DESIGN DISCORD / SLACK ULTRA ELEGANTE)
   ========================================================================== */

.chat-equipe-layout {
  display: flex !important;
  height: calc(100vh - 200px) !important;
  min-height: 580px !important;
  background: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45) !important;
}

[data-theme="light"] .chat-equipe-layout {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08) !important;
}

/* Sidebar de Canais */

[data-theme="light"] .chat-sidebar {
  background: #f8fafc !important;
  border-right: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .chat-sidebar-header {
  border-bottom: 1px solid #e2e8f0 !important;
}

.chat-sidebar-title {
  font-size: 0.96rem !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  letter-spacing: -0.01em !important;
}

[data-theme="light"] .chat-sidebar-title {
  color: #0f172a !important;
}

.chat-search-box input {
  width: 100% !important;
  padding: 8px 12px !important;
  background: rgba(30, 41, 59, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px !important;
  color: #f1f5f9 !important;
  font-size: 0.82rem !important;
  outline: none !important;
  transition: border-color 0.2s ease !important;
}

[data-theme="light"] .chat-search-box input {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

.chat-search-box input:focus {
  border-color: #d97706 !important;
}

.chat-channel-item {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
  border-left: 3px solid transparent !important;
  color: #94a3b8 !important;
}

[data-theme="light"] .chat-channel-item {
  color: #475569 !important;
}

.chat-channel-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #f8fafc !important;
}

[data-theme="light"] .chat-channel-item:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

.chat-channel-item.active {
  background: rgba(217, 119, 6, 0.15) !important;
  border-left: 3px solid #f59e0b !important;
  color: #fde68a !important;
}

[data-theme="light"] .chat-channel-item.active {
  background: #fef3c7 !important;
  border-left: 3px solid #d97706 !important;
  color: #92400e !important;
}

.chat-channel-icon {
  font-size: 1.05rem !important;
  width: 28px !important;
  height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border-radius: 8px !important;
  flex-shrink: 0 !important;
  color: #d97706 !important;
}

.chat-channel-item.active .chat-channel-icon {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid #d97706 !important;
  color: #d97706 !important;
}

.chat-channel-preview {
  font-size: 0.75rem !important;
  color: #64748b !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin-top: 3px !important;
}

.badge-unread {
  background: #ef4444 !important;
  color: #ffffff !important;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  padding: 2px 7px !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4) !important;
  flex-shrink: 0 !important;
}

/* Área Principal da Conversa */
.chat-main-area {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #0f172a !important;
  position: relative !important;
  min-width: 0 !important;
}

[data-theme="light"] .chat-main-area {
  background: #ffffff !important;
}

[data-theme="light"] .chat-header-bar {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.chat-title {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  line-height: 1.2 !important;
}

[data-theme="light"] .chat-title {
  color: #0f172a !important;
}

.chat-subtitle {
  font-size: 0.78rem !important;
  color: #94a3b8 !important;
  margin-top: 3px !important;
}

[data-theme="light"] .chat-subtitle {
  color: #64748b !important;
}

.chat-btn-action {
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #94a3b8 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

/* Feed de Mensagens do Chat */

.chat-empty-feed {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
  text-align: center !important;
  color: #64748b !important;
  padding: 40px 20px !important;
}

.chat-empty-feed h3 {
  font-size: 1.15rem !important;
  color: #f1f5f9 !important;
  margin: 0 0 6px 0 !important;
}

[data-theme="light"] .chat-empty-feed h3 {
  color: #0f172a !important;
}

/* Linha de Mensagem do Chat */

.chat-msg-row.msg-me {
  align-self: flex-end !important;
  flex-direction: row-reverse !important;
}

.chat-msg-row.msg-other {
  align-self: flex-start !important;
}

.chat-msg-author {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  color: #cbd5e1 !important;
}

[data-theme="light"] .chat-msg-author {
  color: #334155 !important;
}

.chat-msg-time {
  font-size: 0.7rem !important;
  color: #64748b !important;
}

.chat-msg-bubble {
  padding: 12px 16px !important;
  border-radius: 16px !important;
  font-size: 0.9rem !important;
  line-height: 1.55 !important;
  word-wrap: break-word !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.chat-msg-row.msg-other .chat-msg-bubble {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-top-left-radius: 4px !important;
}

[data-theme="light"] .chat-msg-row.msg-other .chat-msg-bubble {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
}

.chat-msg-row.msg-me .chat-msg-bubble {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  color: #ffffff !important;
  border-top-right-radius: 4px !important;
}

/* --- Fase N: refino estilo WhatsApp --- */
.chat-messages-container {
  background:
    radial-gradient(rgba(255,255,255,0.02) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--bg-main, #0b1220) !important;
  gap: 6px !important;
}

/* separador de dia */
.chat-day-sep span {
  background: rgba(15,23,42,0.85) !important;
  color: #cbd5e1 !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  padding: 3px 12px !important;
  border-radius: 999px !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25) !important;
  text-transform: capitalize !important;
}
[data-theme="light"] .chat-day-sep span {
  background: #ffffff !important; color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}

/* mensagens agrupadas (mesmo autor em sequência) */
.chat-msg-row.msg-grouped.msg-other .chat-msg-bubble { border-top-left-radius: 16px !important; }
.chat-msg-row.msg-grouped.msg-me .chat-msg-bubble { border-top-right-radius: 16px !important; }

/* hora dentro do balão, discreta (WhatsApp) */
.chat-msg-bubble { position: relative !important; padding-bottom: 16px !important; }
.chat-msg-row.msg-other .chat-msg-time-inline { color: #94a3b8 !important; }
.chat-msg-row.msg-me .chat-msg-time-inline { color: rgba(255,255,255,0.85) !important; }

/* Barra de Input do Chat */

[data-theme="light"] .chat-input-bar {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
}

.rel-atd-bar {
  width: 100%;
  max-width: 34px;
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transition: height 0.4s ease;
  min-height: 3px;
}

.chat-mention-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 20px;
  width: 260px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.24);
  z-index: 30;
}
.chat-msg-bubble .chat-mencao {
  font-weight: 700;
  color: var(--gold, #b09874);
  background: rgba(176, 152, 116, .14);
  padding: 0 4px;
  border-radius: 4px;
}
.chat-msg-bubble .chat-mencao.chat-mencao-eu {
  background: rgba(176, 152, 116, .28);
}

.chat-textarea {
  flex: 1 !important;
  padding: 12px 18px !important;
  background: rgba(30, 41, 59, 0.75) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 24px !important;
  color: #f8fafc !important;
  font-family: inherit !important;
  font-size: 0.9rem !important;
  line-height: 1.4 !important;
  outline: none !important;
  resize: none !important;
  max-height: 100px !important;
  transition: all 0.2s ease !important;
}

[data-theme="light"] .chat-textarea {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #0f172a !important;
}

.chat-textarea:focus {
  border-color: #f59e0b !important;
  box-shadow: 0 0 14px rgba(217, 119, 6, 0.3) !important;
}

/* Fase 3 (feedback Kelly) — editar/apagar/responder/anexar/pesquisar */
.chat-btn-anexo {
  width: 40px !important; height: 40px !important; border-radius: 50% !important;
  border: 1.5px solid rgba(255,255,255,0.12) !important; background: rgba(30,41,59,0.75) !important;
  color: #f8fafc !important; cursor: pointer !important; flex-shrink: 0 !important; font-size: 1rem !important;
}
[data-theme="light"] .chat-btn-anexo { background: #fff !important; color: #142e4f !important; border-color: #e2e8f0 !important; }
.chat-btn-anexo:hover { border-color: #d97706 !important; }

.chat-msg-actions button {
  background: transparent; border: none; cursor: pointer; font-size: 0.78rem;
  opacity: 0.6; padding: 2px 4px; border-radius: 4px;
}

.chat-msg-reply-preview {
  display: flex; flex-direction: column; gap: 1px;
  border-left: 3px solid #d97706; padding: 4px 8px; margin-bottom: 6px;
  background: rgba(217,119,6,0.1); border-radius: 6px; font-size: 0.78rem;
}

.chat-msg-anexo-img { max-width: 220px; max-height: 220px; border-radius: 10px; display: block; margin-bottom: 4px; cursor: pointer; }
.chat-msg-anexo-arquivo {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  border-radius: 8px; background: rgba(255,255,255,0.08); color: inherit !important;
  text-decoration: none; font-size: 0.82rem; margin-bottom: 4px;
}

/* Fase 5 (feedback Kelly) — reações, fixar, rascunho, leitura */
.chat-reacao-chip {
  border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.06);
  border-radius: 999px; padding: 1px 7px; font-size: 0.74rem; cursor: pointer; color: inherit;
}
.chat-reacao-chip.de-mim { border-color: #d97706; background: rgba(217,119,6,0.18); }
[data-theme="light"] .chat-reacao-chip { border-color: #e2e8f0; background: #f1f5f9; }
[data-theme="light"] .chat-reacao-chip.de-mim { border-color: #d97706; background: rgba(217,119,6,0.12); }

.chat-fixada-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.78rem; background: rgba(217,119,6,0.08); border-radius: 8px; padding: 5px 10px; }

/* Fase 5 (feedback Kelly) — salvar/acompanhar depois (Atendimento ao Vivo) */
.atd-btn-salvar.is-salvo { color: #d4af37; border-color: #d4af37; }

.pesq-chat-btn-buscar {
  width: 100%;
  padding: 10px 16px;
  font-weight: 700;
  margin-bottom: 18px;
}
.pesq-chat-item { border: 1px solid var(--border-color, #e2e8f0); border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.pesq-chat-item-topo { font-size: 0.76rem; color: var(--text-secondary, #64748b); margin-bottom: 6px; }

/* ==========================================================================
   DARK MODE — REDE DE SEGURANÇA DE CONTRASTE (2026-09-07)
   Cobre superfícies e textos que ficaram claros no tema escuro por usarem
   cor fixa (#fff, #f8fafc, #0f172a…) sem um override específico.
   Fica no fim do arquivo de propósito, para ganhar da cascata.
   Exceções preservadas: a prévia da credencial impressa (.pvc-*) e @media print.
   ========================================================================== */

/* --- Superfícies claras fixas viram superfície do tema --- */
[data-theme="dark"] .patch-guides-container,
[data-theme="dark"] .guide-col,
[data-theme="dark"] .edit-tabs-nav,
[data-theme="dark"] .edit-tab-btn.active,
[data-theme="dark"] .edit-badge-preview-box,
[data-theme="dark"] .totp-secret-box,
[data-theme="dark"] .twofa-grid,
[data-theme="dark"] .badge-2fa.off,
[data-theme="dark"] .btn-sm-chip,
[data-theme="dark"] .btn-accordion-control,
[data-theme="dark"] .patch-validations-info,
[data-theme="dark"] .patch-section-block,
[data-theme="dark"] .val-resultado-opt,
[data-theme="dark"] .subnav-pill.active,
[data-theme="dark"] .badge-preview-banner,
[data-theme="dark"] .patch-summary-count,
[data-theme="dark"] .patch-header-toolbar,
[data-theme="dark"] .qr-preview-wrap,
[data-theme="dark"] .info-box,
[data-theme="dark"] .info-card,
[data-theme="dark"] .section-box,
[data-theme="dark"] .detail-box,
[data-theme="dark"] .resumo-box,
[data-theme="dark"] .list-card,
[data-theme="dark"] .content-panel,
[data-theme="dark"] .data-panel {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text-main);
}

/* --- Elementos com fundo claro escrito no atributo style (markup dinâmico) --- */
[data-theme="dark"] [style*="background:#fff"]:not(.pvc-card):not(.pvc-official-back),
[data-theme="dark"] [style*="background: #fff"]:not(.pvc-card):not(.pvc-official-back),
[data-theme="dark"] [style*="background:#FFF"]:not(.pvc-card):not(.pvc-official-back),
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background:#f9fafb"],
[data-theme="dark"] [style*="background: #f9fafb"],
[data-theme="dark"] [style*="background:#f1f5f9"],
[data-theme="dark"] [style*="background: #f1f5f9"],
[data-theme="dark"] [style*="background:#eef2f7"],
[data-theme="dark"] [style*="background: #eef2f7"],
[data-theme="dark"] [style*="background:#f4f6f8"] {
  background: var(--surface) !important;
  color: var(--text-main);
  border-color: var(--border);
}

/* Caixinhas pastel semânticas (verde/vermelho/azul/amarelo) do markup dinâmico:
   suaviza o fundo e clareia o texto para ler no escuro. */
[data-theme="dark"] [style*="background:#f0fdf4"],
[data-theme="dark"] [style*="background: #f0fdf4"],
[data-theme="dark"] [style*="background:#ecfdf5"],
[data-theme="dark"] [style*="background:#dcfce7"] {
  background: rgba(34, 197, 94, 0.12) !important;
  color: #86efac !important;
  border-color: rgba(34, 197, 94, 0.35) !important;
}
[data-theme="dark"] [style*="background:#fef2f2"],
[data-theme="dark"] [style*="background: #fef2f2"],
[data-theme="dark"] [style*="background:#fee2e2"],
[data-theme="dark"] [style*="background: #fee2e2"] {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}
[data-theme="dark"] [style*="background:#fef9c3"],
[data-theme="dark"] [style*="background: #fef9c3"],
[data-theme="dark"] [style*="background:#fef3c7"],
[data-theme="dark"] [style*="background: #fef3c7"],
[data-theme="dark"] [style*="background:#fffbeb"] {
  background: rgba(217, 119, 6, 0.14) !important;
  color: #fcd34d !important;
  border-color: rgba(217, 119, 6, 0.4) !important;
}
[data-theme="dark"] [style*="background:#e2e8f0"],
[data-theme="dark"] [style*="background: #e2e8f0"] {
  background: var(--surface-hover) !important;
  color: var(--text-main) !important;
  border-color: var(--border) !important;
}

/* --- Texto escuro fixo no atributo style, que sumiria no fundo escuro --- */
[data-theme="dark"] [style*="color:#0f172a"],
[data-theme="dark"] [style*="color: #0f172a"],
[data-theme="dark"] [style*="color:#111827"],
[data-theme="dark"] [style*="color: #111827"],
[data-theme="dark"] [style*="color:#1e293b"],
[data-theme="dark"] [style*="color: #1e293b"],
[data-theme="dark"] [style*="color:#0b192c"],
[data-theme="dark"] [style*="color: #0b192c"] {
  color: var(--text-main) !important;
}
[data-theme="dark"] [style*="color:#334155"],
[data-theme="dark"] [style*="color: #334155"],
[data-theme="dark"] [style*="color:#475569"],
[data-theme="dark"] [style*="color: #475569"],
[data-theme="dark"] [style*="color:#64748b"],
[data-theme="dark"] [style*="color: #64748b"] {
  color: var(--text-muted) !important;
}
/* Títulos coloridos das caixas semânticas (aba Marketing etc.) */
[data-theme="dark"] [style*="color:#166534"],
[data-theme="dark"] [style*="color: #166534"] { color: #86efac !important; }
[data-theme="dark"] [style*="color:#991b1b"],
[data-theme="dark"] [style*="color: #991b1b"] { color: #fca5a5 !important; }
[data-theme="dark"] [style*="color:#1e40af"],
[data-theme="dark"] [style*="color: #1e40af"] { color: #93c5fd !important; }
[data-theme="dark"] [style*="color:#854d0e"],
[data-theme="dark"] [style*="color: #854d0e"] { color: #fcd34d !important; }
[data-theme="dark"] [style*="color:#92400e"],
[data-theme="dark"] [style*="color: #92400e"] { color: #fcd34d !important; }

/* --- Tabelas dentro de markup dinâmico (aba Marketing, extratos, dossiê…) --- */
[data-theme="dark"] .tab-content table th {
  background: var(--table-head-bg) !important;
  color: var(--text-main);
}
[data-theme="dark"] .tab-content table td {
  border-color: var(--border);
  color: var(--text-main);
}

/* --- Títulos/labels que usam a cor "navy" (quase preta no escuro) --- */
[data-theme="dark"] .tab-section-name,
[data-theme="dark"] .fin-section-name,
[data-theme="dark"] .qr-link-text,
[data-theme="dark"] .hist-when,
[data-theme="dark"] .tab-btn:hover,
[data-theme="dark"] .tab-btn.active,
[data-theme="dark"] .section-title,
[data-theme="dark"] .block-title,
[data-theme="dark"] .card-title,
[data-theme="dark"] h1.page-title,
[data-theme="dark"] .agenda-title {
  color: var(--text-main) !important;
}

/* --- Inputs/again: qualquer campo de formulário que ficou claro --- */
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--surface-hover);
  color: var(--text-main);
  border-color: var(--border);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #64748b;
}

/* --- A prévia da credencial impressa continua branca (é a simulação do cartão) --- */
[data-theme="dark"] .pvc-card,
[data-theme="dark"] .pvc-official-back {
  background: #ffffff !important;
  color: #0f172a !important;
}

/* ==========================================================================
   FASE Q — COCKPIT PREMIUM · Camada de design-system (Deploy Q.1 — 2026-09-07)
   --------------------------------------------------------------------------
   Bloco 100% ADITIVO. Só cria tokens --kk-* e classes .kk-*.
   Não altera nenhuma regra existente → risco de regressão zero.
   Ambos os temas são declarados explicitamente (não depende do catch-all).
   Ref.: directives/roadmap_evolucao_sistema.md → "FASE Q"
   Wiring (JS/HTML) entra nos deploys Q.2–Q.4.
   ========================================================================== */
:root {
  --kk-ok: #16a34a;      --kk-ok-bg: #dcfce7;   --kk-ok-fg: #15803d;
  --kk-warn: #d97706;    --kk-warn-bg: #fef3c7; --kk-warn-fg: #b45309;
  --kk-crit: #dc2626;    --kk-crit-bg: #fee2e2; --kk-crit-fg: #b91c1c;
  --kk-proc: #7c3aed;    --kk-proc-bg: #ede9fe; --kk-proc-fg: #6d28d9;
  --kk-idle: #64748b;    --kk-idle-bg: #f1f5f9; --kk-idle-fg: #475569;
  --kk-accent-bg: rgba(15, 118, 110, 0.10);     --kk-accent-fg: #0f766e;
  --kk-radius: 10px;
  --kk-shadow: 0 1px 2px rgba(15,23,42,.06), 0 8px 24px -12px rgba(15,23,42,.18);
  --kk-shadow-hover: 0 2px 6px rgba(15,23,42,.08), 0 14px 32px -14px rgba(15,23,42,.26);
}
[data-theme="dark"] {
  --kk-ok: #34d399;      --kk-ok-bg: rgba(52,211,153,.14);   --kk-ok-fg: #6ee7b7;
  --kk-warn: #fbbf24;    --kk-warn-bg: rgba(251,191,36,.14); --kk-warn-fg: #fcd34d;
  --kk-crit: #f87171;    --kk-crit-bg: rgba(248,113,113,.15);--kk-crit-fg: #fca5a5;
  --kk-proc: #a78bfa;    --kk-proc-bg: rgba(167,139,250,.16);--kk-proc-fg: #c4b5fd;
  --kk-idle: #94a3b8;    --kk-idle-bg: rgba(148,163,184,.14);--kk-idle-fg: #cbd5e1;
  --kk-accent-bg: rgba(45,212,191,.16);         --kk-accent-fg: #2dd4bf;
  --kk-shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6);
  --kk-shadow-hover: 0 2px 8px rgba(0,0,0,.4), 0 16px 40px -16px rgba(0,0,0,.7);
}

/* ---- Q·1  Taxonomia única de pills ------------------------------------- */
.kk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  white-space: nowrap;
  vertical-align: middle;
}
.kk-pill .kk-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.kk-pill--ok     { background: var(--kk-ok-bg);     color: var(--kk-ok-fg); }
.kk-pill--crit   { background: var(--kk-crit-bg);   color: var(--kk-crit-fg); }
.kk-pill--proc   { background: var(--kk-proc-bg);   color: var(--kk-proc-fg); }
.kk-pill--pulse .kk-pill-dot { animation: kk-pulse 1.4s ease-in-out infinite; }
@keyframes kk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* Painel "Conexões & Integrações" (Home Cockpit) — cartões empilhados
   verticalmente (ícone+título / pill / subtítulo) em vez de título e pill
   disputando a mesma linha, que quebrava texto em domínios com nome maior
   ("Google Workspace", "Marketing — Meta Ads"). */
.kk-conexao-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.kk-conexao-tile {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--surface-hover);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  transition: border-color .15s ease;
}
.kk-conexao-tile:hover { border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); }
.kk-conexao-tile-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kk-conexao-tile-icon { font-size: 1.05rem; line-height: 1; flex-shrink: 0; }
.kk-conexao-tile-title {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.kk-conexao-tile-pill { display: flex; }
.kk-conexao-tile-pill .kk-pill { white-space: nowrap; }
.kk-conexao-tile-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ---- Q·11  Selo de autonomia da automação (L1–L4) -------------------- */
.kk-lvl {
  font-family: 'Outfit', ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
  white-space: nowrap;
}
.kk-lvl--l1 { color: var(--kk-ok-fg);     border-color: var(--kk-ok-fg); }
.kk-lvl--l2 { color: var(--kk-accent-fg); border-color: var(--kk-accent-fg); }
.kk-lvl--l3 { color: var(--kk-warn-fg);   border-color: var(--kk-warn-fg); }
.kk-lvl--l4 { color: var(--kk-crit-fg);   border-color: var(--kk-crit-fg); }

/* ---- Q·3  Estado vazio ---------------------------------------------- */
.kk-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 40px 24px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--kk-radius);
}
.kk-empty-icon  { font-size: 1.8rem; opacity: .7; line-height: 1; }
.kk-empty-title { font-weight: 600; color: var(--text-main); font-size: 0.92rem; }
.kk-empty-hint  { font-size: 0.82rem; max-width: 44ch; }
.kk-empty-action { margin-top: 8px; }

/* ---- Q·3  Skeleton de carregamento --------------------------------- */
.kk-skeleton {
  position: relative;
  overflow: hidden;
  background: var(--kk-idle-bg);
  border-radius: 8px;
}
.kk-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  animation: kk-shimmer 1.4s ease-in-out infinite;
}
[data-theme="dark"] .kk-skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
}
@keyframes kk-shimmer { 100% { transform: translateX(100%); } }
.kk-skeleton--line { height: 12px; margin: 6px 0; }
.kk-skeleton--card { height: 84px; }

/* ---- Q·3  Erro inline --------------------------------------------- */
.kk-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--kk-crit-bg);
  border-left: 4px solid var(--kk-crit);
  border-radius: 8px;
  background: var(--kk-crit-bg);
  color: var(--kk-crit-fg);
  font-size: 0.84rem;
}
.kk-error-detail {
  margin-left: auto;
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
}

/* ---- Q·3  Utilitário de hover (eleva o card) ---------------------- */
.kk-hover-lift { transition: transform .15s ease, box-shadow .15s ease; }
.kk-hover-lift:hover { transform: translateY(-2px); box-shadow: var(--kk-shadow-hover); }

/* ---- Q·4  Rótulo de origem do dado (provenance) ------------------- */
.kk-prov {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.kk-prov::before { content: "\21B3"; opacity: .6; }

/* ---- Q·5  Banner de conquista (topo do cockpit) ----------------- */
.kk-winbanner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--kk-radius);
  background: var(--kk-accent-bg);
  border: 1px solid var(--kk-accent-bg);
  color: var(--text-main);
  font-size: 0.9rem;
}

/* ---- Q·8  Nota do Sistema (0–100) ------------------------------- */
.kk-score { display: inline-flex; align-items: baseline; gap: 4px; font-family: 'Outfit', sans-serif; }
.kk-score-num { font-size: 1.6rem; font-weight: 700; color: var(--text-main); font-variant-numeric: tabular-nums; }
.kk-score-max { font-size: 0.8rem; color: var(--text-muted); }
.kk-score--good .kk-score-num { color: var(--kk-ok-fg); }
.kk-score--mid  .kk-score-num { color: var(--kk-warn-fg); }
.kk-score--low  .kk-score-num { color: var(--kk-crit-fg); }

/* ---- Q·6  Guard-rail de área financeira ------------------------- */
.kk-guardrail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--kk-warn-bg);
  color: var(--kk-warn-fg);
}
.kk-guardrail::before { content: "\1F512"; font-size: .8em; }

/* ---- Acessibilidade: respeita "reduzir movimento" -------------- */
@media (prefers-reduced-motion: reduce) {
  .kk-skeleton::after,
  .kk-pill--pulse .kk-pill-dot { animation: none; }
  .kk-hover-lift { transition: none; }
}
/* ===== FIM FASE Q — COCKPIT PREMIUM (Deploy Q.1) ===== */

/* ==========================================================================
   FASE R / R.2 — Atendimento ao Vivo (layout responsivo). Bloco aditivo.
   ========================================================================== */
.atd-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 280px;
  gap: 12px;
  height: calc(100vh - 190px);
  min-height: 420px;
}
.atd-layout > .atd-col {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  min-height: 0;
}

@media (max-width: 900px) {
  .atd-layout { grid-template-columns: 1fr; height: calc(100vh - 200px); }
  .atd-msg-wrap { max-width: 90%; }
  .atd-col-head { border-radius: 10px 10px 0 0; }
}

/* ---- Componentes visuais do Atendimento (R.3b) ---- */
.atd-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Pedido da Kelly: o filtro (Abertas/Pendentes/...) alinhado em cima da
   coluna de conversas (esquerda) e os ícones de ação em cima da coluna de
   contato (direita), acompanhando as mesmas larguras do .atd-layout abaixo -
   em vez de tudo empilhado/centralizado numa linha só. */
.atd-toolbar-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 280px;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.atd-toolbar-icons { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 900px) {
  .atd-toolbar-grid { grid-template-columns: 1fr; }
  .atd-toolbar-icons { justify-content: flex-start; }
}

.atd-conv { display: flex; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; align-items: flex-start; transition: background .12s; }
.atd-conv:hover { background: var(--surface-hover); }
.atd-conv.is-active { background: var(--accent-soft); }
.atd-unread { background: var(--kk-crit); color: #fff; border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px; font-size: .67rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* cabeçalho fixo da coluna de conversas */
.atd-col-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 2; border-radius: 10px 10px 0 0; }
.atd-eyebrow { font-size: .61rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.atd-search { width: 100%; padding: 8px 13px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-hover); color: var(--text-main); font-size: .82rem; }
.atd-group-label { font-size: .61rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; padding: 12px 14px 4px; }

/* header da conversa (sempre visível) */
.atd-thread-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.atd-thread-head .atd-conv-av { width: 34px; height: 34px; font-size: .74rem; }

/* mensagens: autor acima, hora abaixo */
.atd-msg-wrap { display: flex; flex-direction: column; margin: 9px 0; max-width: 82%; }
.atd-time { font-size: .62rem; color: var(--text-muted); margin-top: 3px; padding: 0 5px; }
.atd-bubble { border-radius: 14px; padding: 9px 12px; font-size: .86rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.atd-msg-wrap.in .atd-bubble { background: var(--surface-hover); border-bottom-left-radius: 5px; }
.atd-msg-wrap.out .atd-bubble { background: var(--accent-soft); border-bottom-right-radius: 5px; }

/* faixa de handoff — NOVO (12/09/2026): movida do topo do chat (onde ficava
   larga demais, cortando o centro da tela) para o painel lateral do contato,
   como um cartão compacto. Mesmo #id, só o visual muda por aqui. */
.atd-banner { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; margin: 0 12px 10px; border: 1px solid var(--border); border-radius: 9px; font-size: .76rem; background: var(--bg-admin); }

/* ficha do contato */
.atd-ficha-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: .8rem; }
.atd-ficha-row:last-child { border-bottom: 0; }
.atd-ficha-k { color: var(--text-muted); }
.atd-ficha-v { font-weight: 700; text-align: right; word-break: break-word; }
.atd-card-dark { background: var(--navy); color: #fff; border-radius: 12px; padding: 12px; }
.atd-card-dark .atd-sec-title { color: rgba(255,255,255,.6); }
.atd-bubble-time { font-size: .62rem; color: var(--text-muted); margin-top: 3px; text-align: right; }
.atd-note-tag { font-size: .6rem; font-weight: 700; opacity: .8; letter-spacing: .04em; display: block; }
.atd-media img { max-width: 220px; max-height: 260px; border-radius: 8px; display: block; cursor: pointer; margin-bottom: 4px; }

/* Fase 2 (feedback Kelly) — popover de mensagens rápidas */
.atd-modelos-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 320px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.2);
  z-index: 50;
  padding: 6px;
}
.atd-modelo-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

/* Nota interna: destaca o composer inteiro assim que a pessoa marca a opção,
   não só depois de enviada — reduz o risco de confundir nota com resposta
   real ao cliente. */
.atd-composer.modo-nota-interna {
  background: color-mix(in srgb, #d97706 8%, transparent);
  border-top-color: #d97706;
}
.atd-nota-interna-aviso {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: #92400e;
  background: color-mix(in srgb, #d97706 16%, transparent);
  border: 1px solid color-mix(in srgb, #d97706 45%, transparent);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
}
[data-theme="dark"] .atd-nota-interna-aviso { color: #fbbf24; }
.atd-composer.modo-nota-interna .atd-composer-row textarea {
  background: color-mix(in srgb, #d97706 10%, var(--surface));
  border-color: #d97706;
}
/* NOVO (12/09/2026): "Assinar com meu nome" e "Enviar com" saíram da barra
   sempre visível do composer (eram mudadas raramente, só poluíam) e foram
   pra este popover, aberto pelo ⚙️. */
.atd-config-popover { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 8px; min-width: 190px; }

.atd-rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger, #dc2626);
  animation: atdRecPulse 1.1s ease-in-out infinite;
  flex: none;
}
@keyframes atdRecPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}
.atd-rec-tempo { font-size: 0.92rem; font-weight: 700; color: var(--danger, #dc2626); font-variant-numeric: tabular-nums; }

.chat-btn-anexo.is-recording { background: rgba(239, 68, 68, 0.18) !important; color: #ef4444 !important; border-color: rgba(239, 68, 68, 0.4) !important; }
.atd-composer-row textarea { flex: 1; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-main); resize: none; font: inherit; max-height: 120px; }
.atd-icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text-main); cursor: pointer; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.atd-icon-btn:hover { border-color: var(--accent); }
.atd-send-btn { height: 36px; padding: 0 16px; border: 0; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; flex: none; }
.atd-send-btn:hover { filter: brightness(1.06); }

.atd-contact-head .atd-conv-av { width: 52px; height: 52px; font-size: 1.05rem; margin: 0 auto 8px; }
.atd-sec { margin-bottom: 14px; }
.atd-sec-title { font-size: .67rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.atd-btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
.atd-btn { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-main); font-size: .78rem; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.atd-btn:hover { border-color: var(--accent); background: var(--surface-hover); }
.atd-btn--danger { color: var(--kk-crit-fg); }
.atd-kiara { padding: 10px; border-radius: 10px; border: 1px solid var(--border); }
.atd-kiara.is-paused { border-color: var(--kk-proc); background: var(--kk-proc-bg); }
.atd-kiara-status { font-size: .75rem; color: var(--text-muted); margin-bottom: 6px; }
.atd-label { background: var(--kk-accent-bg); color: var(--kk-accent-fg); border-radius: 999px; padding: 2px 9px; font-size: .72rem; cursor: pointer; }
.atd-resp { font-size: .85rem; margin: 2px 0 6px; }
/* ===== FIM FASE R ===== */

/* ==========================================================================
   FASE R.3f — Polimento visual (2026-09-08)
   Aditivo. Segmented control de fonte, botoes da Fila Kiara, painel de Metas
   multi-dimensao, formulario de Respostas Rapidas, chip de hash dos contratos,
   cards do Resumo do dia. Ambos os temas via tokens --kk-* / core.
   ========================================================================== */

/* --- Segmented control: fonte das conversas (Chatwoot | Proprio) --------- */
.rm-filter {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.rm-filter > button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}

/* --- Fila Kiara: barra de acoes harmonica ------------------------------- */
.visita-actions-support > button {
  height: 34px;
  border-radius: 9px;
  font-size: .78rem;
  font-weight: 600;
  padding: 0 12px;
  transition: transform .15s, background .15s, border-color .15s, box-shadow .15s, color .15s;
}
.btn-dossie-bant {
  background: var(--kk-warn-bg);
  color: var(--kk-warn-fg);
  border: 1px solid var(--kk-warn);
}
.btn-dossie-bant:hover { background: var(--kk-warn); color: #fff; border-color: var(--kk-warn); }
.btn-atribuir-corretor {
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border);
}
.btn-atribuir-corretor:hover { background: var(--surface-hover); border-color: var(--accent); }
.btn-handoff-toggle {
  background: var(--kk-proc-bg);
  color: var(--kk-proc-fg);
  border: 1px solid var(--kk-proc);
}
.btn-handoff-toggle:hover { background: var(--kk-proc); color: #fff; }
.btn-handoff-reativar {
  background: var(--kk-proc);
  color: #fff;
  border: 1px solid var(--kk-proc);
}
[data-theme="dark"] .btn-dossie-bant { color: var(--kk-warn-fg); }

/* fileira de decisao: alturas e realces coerentes com os tokens */
.visita-actions-decision > button { height: 38px; border-radius: 9px; }
.visita-actions-decision .btn-homologar-visita { background: var(--kk-ok); border-color: var(--kk-ok); }
.visita-actions-decision .btn-homologar-visita:hover {
  background: var(--kk-ok); filter: brightness(.94);
  box-shadow: 0 6px 16px -6px var(--kk-ok);
}
.visita-actions-decision .btn-recusar-visita:hover {
  background: var(--kk-crit-bg); border-color: var(--kk-crit); color: var(--kk-crit-fg);
}

/* --- Painel de Metas multi-dimensao ----------------------------------- */
.pm-group {
  margin: 16px 0 6px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.pm-group:first-child { margin-top: 4px; }
.pm-row { padding: 9px 0; border-bottom: 1px solid var(--border); }
.pm-row:last-child { border-bottom: 0; }
.pm-row-head, .pm-sub {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 250px);
  align-items: center;
  gap: 14px;
}
.pm-sub { padding: 5px 0 2px 18px; }
.pm-label { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pm-label strong { font-size: .87rem; color: var(--text-main); }
.pm-label--sub > span:first-child { font-size: .82rem; color: var(--text-muted); }
.pm-val { font-size: .76rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pm-sep { opacity: .4; }
.pm-track { display: flex; align-items: center; gap: 8px; }
.pm-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-hover); overflow: hidden; }
.pm-bar-fill { height: 100%; border-radius: 999px; transition: width .5s ease; }
.pm-ok  { color: var(--kk-ok-fg); }
.pm-mid { color: var(--kk-accent-fg); }
.pm-low { color: var(--kk-warn-fg); }
.pm-bar-fill.pm-ok  { background: var(--kk-ok); }
.pm-bar-fill.pm-mid { background: var(--kk-accent-fg); }
.pm-bar-fill.pm-low { background: var(--kk-warn); }
.pm-nometa {
  font-size: .68rem;
  color: var(--text-muted);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
  margin-left: auto;
}
@media (max-width: 640px) {
  .pm-row-head, .pm-sub { grid-template-columns: 1fr; gap: 6px; }
  .pm-nometa { margin-left: 0; }
}

/* --- Respostas rapidas: formulario "Novo modelo" --------------------- */
#rrNovoTitulo, #rrNovaCategoria, #rrNovoTexto {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-main);
  font: inherit;
  font-size: .84rem;
  margin-bottom: 8px;
}
#rrNovoTitulo::placeholder, #rrNovaCategoria::placeholder, #rrNovoTexto::placeholder { color: var(--text-muted); opacity: .8; }
#rrNovoTitulo:focus, #rrNovaCategoria:focus, #rrNovoTexto:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
#rrNovoTexto { resize: vertical; min-height: 66px; line-height: 1.5; }

/* --- Resumo do dia: blocos com cara de card ------------------------- */
#homeResumoMatinal .rm-bloco {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
/* ===== FIM FASE R.3f ===== */

/* ==========================================================================
   FASE R.3g — Polimento visual (2026-09-08 · 2ª rodada)
   Badges de status uniformes, KPIs do Início, painel de Metas (selo "sem meta"
   deixa de flutuar solto), balão do Dossiê Kiara, tabela do Assinador Digital,
   gatilho ⌘K, tag "A definir". Tudo por tokens, dark incluso.
   ========================================================================== */

/* --- Badge de status genérico (antes: só cor de fundo, sem forma) -------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
}
[data-theme="dark"] .badge-warning { background: var(--kk-warn-bg); color: var(--kk-warn-fg); border: 1px solid var(--kk-warn); }
[data-theme="dark"] .badge-success { background: var(--kk-ok-bg); color: var(--kk-ok-fg); border: 1px solid var(--kk-ok); }

/* tag discreta "A definir" e afins */
.kk-muted-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

/* --- KPIs do Início: número é o herói, cards com altura pareja --------- */
.cockpit-stats-grid .kpi-card { align-items: flex-start; min-height: 92px; }
.kpi-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex: none;
}
.kpi-content { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.kpi-content .kpi-label {
  order: -1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}
.kpi-number {
  font-family: 'Outfit', sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-main);
  letter-spacing: -0.01em;
}
.kpi-sub .kk-spark { -webkit-line-clamp: none; }

/* --- Painel de Metas: selo "sem meta" perto do conteúdo, sem flutuar --- */
.pm-group, .pm-row { max-width: 760px; }
.pm-row-head, .pm-sub { grid-template-columns: minmax(0, 1fr) 190px; gap: 16px; }
.pm-track { justify-content: flex-end; }
.pm-nometa { margin-left: 0; }
@media (max-width: 680px) {
  .pm-group, .pm-row { max-width: none; }
  .pm-row-head, .pm-sub { grid-template-columns: 1fr; gap: 6px; }
  .pm-track { justify-content: flex-start; }
}

/* --- Balão do Dossiê Kiara: corte suave + clique para expandir -------- */
.visita-dossie-quote {
  -webkit-line-clamp: 3;
  max-height: 4.6em;
  cursor: pointer;
  transition: max-height .2s ease;
}

/* --- Gatilho ⌘K na topbar (DESATIVADO) -------------------------------- */
.kk-palette-trigger,
#kkPaletteTrigger,
#kkPaletteOverlay {
  display: none !important;
}
.kk-palette-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 14px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.kk-palette-trigger:hover { border-color: var(--accent); color: var(--text-main); background: var(--surface-hover); }
.kk-palette-trigger .kk-pt-ico { font-size: 0.85rem; opacity: .8; }
.kk-palette-trigger .kk-pt-kbd {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}
@media (max-width: 720px) { .kk-palette-trigger .kk-pt-txt { display: none; } }
/* ===== FIM FASE R.3g ===== */

/* ==========================================================================
   FASE R.3h — Polimento visual (2026-09-08 · 3ª rodada)
   Números dos KPIs, menu lateral legível, caixa da Kiara, aba Ranking/Metas,
   busca de imóveis, Assinador em cartões/envelopes, descartar notificações,
   Resumo do dia. Tudo por tokens; dark incluso.
   ========================================================================== */

/* --- KPIs do Início: número menor + sufixo discreto ------------------- */
.kpi-number { font-size: 1.5rem; font-weight: 800; }
.kpi-number b, .kpi-number strong { font-weight: 800; }
.kpi-number small {
  font-size: 0.5em;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-left: 5px;
  text-transform: none;
}

/* --- Menu lateral: caber os rótulos --------------------------------- */
.nav-label { margin-left: 9px; }
.nav-icon { min-width: 20px; text-align: center; }
@media (max-width: 1024px) { .sidebar { width: 250px; min-width: 250px; } }

/* --- Caixa de texto da Kiara: legível + na paleta ------------------- */
.copiloto-input-wrapper {
  align-items: flex-end !important;
  border-color: var(--border) !important;
  border-width: 1px !important;
  border-radius: 16px !important;
  padding: 6px 6px 6px 14px !important;
}
[data-theme="light"] .copiloto-input-wrapper { border-color: var(--border) !important; }
.copiloto-input-wrapper:focus-within {
  border-color: var(--gold, #b09874) !important;
  box-shadow: 0 0 0 3px rgba(176, 152, 116, 0.18) !important;
}
.copiloto-textarea {
  min-height: 46px !important;
  padding: 10px 0 !important;
  font-size: 0.9rem !important;
  line-height: 1.45 !important;
  overflow-y: auto !important;
}

/* --- Busca de imóveis e demais barras de filtro -------------------- */
.filtro-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.filtro-bar input[type="text"],
.filtro-bar input:not([type]),
.filtro-bar input[type="search"],
.filtro-bar select {
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-main);
  font: inherit;
  font-size: 0.85rem;
}
.filtro-bar input::placeholder { color: var(--text-muted); opacity: 0.85; }
.filtro-bar input[type="text"]:focus,
.filtro-bar input:not([type]):focus,
.filtro-bar input[type="search"]:focus,
.filtro-bar select:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.filtro-bar select { cursor: pointer; }
.filtro-bar label:has(input[type="checkbox"]) {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
  user-select: none;
}
.filtro-bar label input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

/* --- Painel de Metas: preencher a largura, sem meta = realizado ---- */
.pm-group, .pm-row { max-width: none; }
.pm-row-head, .pm-sub { grid-template-columns: minmax(0, 1fr) 210px; }
.pm-real {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--text-main);
  margin-left: auto;
}
.pm-real small {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 1px;
}

/* --- Assinador Digital: lista de envelopes (accordion) ------------- */
.env-empty {
  display: flex; gap: 14px; align-items: center;
  background: var(--surface); border: 1px dashed var(--border); border-radius: 12px;
}
.env-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.env-sub .badge { font-size: 0.66rem; }
.env-body code {
  display: inline-block;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  word-break: break-all;
}
.env-actions .btn-action-mini {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  padding: 6px 12px;
  font-size: 0.78rem;
}

/* --- Central de Notificações: descartar antigas ------------------- */
.notif-row { position: relative; }
.notif-row .notif-item { width: 100%; }
.notif-dismiss {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s, background .12s, color .12s;
}
.notif-row:hover .notif-dismiss, .notif-dismiss:focus-visible { opacity: 1; }
.notif-dismiss:hover { background: var(--kk-crit-bg); color: var(--kk-crit-fg); border-color: var(--kk-crit); }
.notif-item.notif-limpar {
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.notif-item.notif-limpar:hover { color: var(--kk-crit-fg); }

/* --- Resumo do dia: layout com hierarquia ------------------------ */
#homeResumoMatinal .rm-narrar {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
#homeResumoMatinal #resumoMatinalTexto {
  display: none;
  font-size: 0.88rem;
  line-height: 1.5;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  white-space: pre-wrap;
}
#homeResumoMatinal .rm-count {
  flex: none;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--kk-accent-bg);
  color: var(--kk-accent-fg);
  font-size: 0.74rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#homeResumoMatinal .rm-list li::marker { color: var(--gold, #b09874); }
/* ===== FIM FASE R.3h ===== */

/* ==========================================================================
   FASE R.3i — Polimento visual (2026-09-08 · 4ª rodada)
   Menu lateral que quebra linha (nada cortado), Metas em lista compacta sem
   vãos, markdown legível no chat da Kiara, chips de papéis, lista de
   Atendimento mais densa + remover da lista (gestão), foto do contato.
   ========================================================================== */

/* --- Menu lateral: legível, rótulo quebra em 2 linhas -------------- */
.sidebar { width: 272px; min-width: 272px; }
@media (max-width: 1024px) { .sidebar { width: 252px; min-width: 252px; } }
.nav-label {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.22;
}
.sidebar-group-header .nav-label { white-space: normal; }

/* --- Painel de Metas: lista compacta, sem espaços vazios --------- */
#painelMetasBody { max-width: 620px; padding: 4px 2px 2px; }
.pm-linha {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.pm-linha--sub { padding: 3px 0 3px 16px; border-bottom: 0; }
.pm-linha + .pm-linha--sub { border-top: 0; }
.pm-nome { font-size: 0.86rem; font-weight: 700; color: var(--text-main); min-width: 0; }
.pm-linha--sub .pm-nome { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }
.pm-dir { display: inline-flex; align-items: center; gap: 8px; flex: none; white-space: nowrap; }
.pm-alvo { font-size: 0.74rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pm-bar { width: 92px; height: 6px; border-radius: 999px; background: var(--surface-hover); overflow: hidden; display: inline-block; }
.pm-bar-fill { display: block; height: 100%; border-radius: 999px; }
.pm-bar-fill.pm-ok { background: var(--kk-ok); }
.pm-bar-fill.pm-mid { background: var(--kk-accent-fg); }
.pm-bar-fill.pm-low { background: var(--kk-warn); }
.pm-pct { font-size: 0.78rem; font-weight: 800; min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.pm-pct.pm-ok { color: var(--kk-ok-fg); }
.pm-pct.pm-mid { color: var(--kk-accent-fg); }
.pm-pct.pm-low { color: var(--kk-warn-fg); }
.pm-num { font-size: 0.95rem; font-weight: 800; color: var(--text-main); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .pm-linha, .pm-linha--sub { flex-wrap: wrap; } .pm-bar { width: 70px; } }

/* --- Markdown legível no chat da Kiara e no resumo em texto ------ */
.bubble-text .md-h, #resumoMatinalTexto .md-h {
  font-weight: 800;
  color: var(--text-main);
  margin: 10px 0 4px;
  line-height: 1.3;
}
.bubble-text .md-h1 { font-size: 1.02rem; }
.bubble-text .md-h2, .bubble-text .md-h3, .bubble-text .md-h4 { font-size: 0.92rem; }
.bubble-text .md-h:first-child, #resumoMatinalTexto .md-h:first-child { margin-top: 0; }
.bubble-text .md-p, #resumoMatinalTexto .md-p { margin: 6px 0; line-height: 1.5; }
.bubble-text .md-ul, .bubble-text .md-ol,
#resumoMatinalTexto .md-ul, #resumoMatinalTexto .md-ol { margin: 6px 0; padding-left: 20px; line-height: 1.5; }
.bubble-text .md-ul li, #resumoMatinalTexto .md-ul li { margin: 2px 0; }
.bubble-text .md-ul li::marker, #resumoMatinalTexto .md-ul li::marker { color: var(--gold, #b09874); }
.bubble-text .md-code, #resumoMatinalTexto .md-code {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 0.86em;
}
#resumoMatinalTexto { white-space: normal !important; }

/* --- Chips de papéis (Pessoa Externa) --------------------------- */
.papel-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
  user-select: none;
}

/* --- Lista de Atendimento: mais densa + remover da lista -------- */
.atd-conv--compact { position: relative; padding: 8px 10px; gap: 9px; }
.atd-conv--compact .atd-conv-av { width: 34px; height: 34px; font-size: .72rem; }
.atd-conv-x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s, background .12s, color .12s;
}
/* ===== FIM FASE R.3i ===== */

/* ==========================================================================
   FASE R.3j — Polimento visual (2026-09-08 · 5ª rodada)
   Balões do chat ao vivo, fila de visitas com "mais ações" recolhível,
   painel de Metas em largura própria.
   ========================================================================== */

/* --- Chat ao vivo: balões limpos estilo mensageiro ---------------- */
.atd-msg-wrap { max-width: 74%; margin: 8px 0; }
.atd-author { margin-bottom: 2px; }
.atd-bubble {
  padding: 7px 10px 7px 11px;
  font-size: .85rem;
  line-height: 1.4;
  max-width: 100%;
}
.atd-msg-wrap.in .atd-bubble { border-radius: 4px 13px 13px 13px; }
.atd-msg-wrap.out .atd-bubble { border-radius: 13px 4px 13px 13px; }
.atd-cont.in .atd-bubble { border-top-left-radius: 13px; }
.atd-cont.out .atd-bubble { border-top-right-radius: 13px; }

/* Player de áudio customizado (pedido do usuário, estilo Chatwoot) */
.atd-audio-player {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(15, 23, 42, .06);
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
  min-width: 250px;
  max-width: 100%;
}

.atd-audio-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent, #0f766e);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: 0;
  transition: transform .12s ease, filter .12s ease;
}

.atd-audio-seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .18);
  cursor: pointer;
  margin: 0;
}
.atd-audio-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--accent, #0f766e);
  box-shadow: 0 0 0 2px var(--surface, #fff);
  cursor: pointer;
}
.atd-audio-seek::-moz-range-thumb {
  width: 11px; height: 11px;
  border: none;
  border-radius: 50%;
  background: var(--accent, #0f766e);
  box-shadow: 0 0 0 2px var(--surface, #fff);
  cursor: pointer;
}
.atd-audio-seek::-moz-range-track { height: 4px; border-radius: 999px; background: rgba(15, 23, 42, .18); }

.atd-audio-speed {
  background: rgba(15, 23, 42, .1);
  border: none;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  flex: none;
  transition: background .12s ease;
}
[data-theme="dark"] .atd-audio-speed { background: rgba(255,255,255,.14); }
.atd-audio-speed:hover { background: rgba(15, 23, 42, .18); }

/* ID da conversa + toast de cópia (pedido do usuário) */
.atd-toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--navy, #142e4f);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.82rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 9999;
}
.atd-toast.atd-toast--show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Fase 2 (feedback Kelly) — pop-up de menção no chat, discreto e clicável */
.mencao-popup-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
}
.mencao-popup {
  background: var(--navy, #142e4f);
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: mencaoPopupIn .25s ease-out;
  border-left: 4px solid var(--gold, #d4af37);
}
.mencao-popup-close { background: none; border: none; color: #cbd5e1; cursor: pointer; font-size: 1rem; padding: 0; flex-shrink: 0; }
.mencao-popup-close:hover { color: #fff; }
.mencao-popup.mencao-popup-out { animation: mencaoPopupOut .18s ease-in forwards; }
@keyframes mencaoPopupIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes mencaoPopupOut { from { opacity: 1; } to { opacity: 0; transform: translateX(24px); } }

.atd-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-main);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}

.atd-anexo-item {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border: 1px solid var(--border);
}
.atd-anexo-item:hover { border-color: var(--gold, #b09874); }
.atd-time { display: none; }

/* --- Fila da Kiara: "mais ações" recolhível ----------------------- */
.visita-mais > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .76rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  user-select: none;
}
.visita-handoff-tag {
  font-size: .74rem;
  font-weight: 700;
  color: var(--kk-proc-fg);
  background: var(--kk-proc-bg);
  border: 1px solid var(--kk-proc);
  border-radius: 8px;
  padding: 5px 10px;
  margin-bottom: 8px;
}

/* --- Painel de Metas: card com largura própria (nada de vão) ----- */
#painelMetasCard { max-width: 780px; }
#painelMetasCard #painelMetasBody { max-width: none; }
/* ===== FIM FASE R.3j ===== */

/* ==========================================================================
   FASE R.3k — Aba Ranking harmônica, markdown WhatsApp no chat, botão da fila.
   ========================================================================== */

/* Metas: card volta a ocupar a largura; corpo em 2 colunas (grupos inteiros) */
#painelMetasCard { max-width: none; margin-top: 20px; }
#painelMetasCard #painelMetasBody {
  max-width: none;
  padding: 8px 4px 4px;
  column-count: 2;
  column-gap: 44px;
}
@media (max-width: 900px) { #painelMetasCard #painelMetasBody { column-count: 1; } }
.pm-legenda { column-span: all; -webkit-column-span: all; margin-top: 14px; }

/* Pódio dentro de um card, alinhado com os demais */
#rankingPodiumCard { margin-top: 20px; }
#rankingPodiumCard .ranking-podium-grid { margin: 8px 0 6px; min-height: 0; }
.podium-card { box-shadow: var(--kk-shadow); }

/* Chat ao vivo: bloco de código estilo WhatsApp */
.atd-bubble .atd-code-block {
  display: block;
  white-space: pre-wrap;
  background: rgba(0, 0, 0, .18);
  border-radius: 6px;
  padding: 6px 8px;
  margin: 3px 0;
  font-size: .8rem;
}
.atd-bubble code {
  background: rgba(0, 0, 0, .16);
  border-radius: 4px;
  padding: 1px 4px;
  font-size: .82em;
}

.visita-mais > summary.visita-mais-cta {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: .01em;
}
.visita-mais[open] > summary.visita-mais-cta { border-radius: 10px 10px 0 0; margin-bottom: 0; }
.visita-mais-body {
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Chat ao vivo: a seta "voltar" só faz sentido no mobile (no desktop a lista fica sempre à vista) */
.atd-thread-head .atd-voltar { display: none; }
@media (max-width: 900px) { .atd-thread-head .atd-voltar { display: inline-flex; } }

/* --- Rodapé do Patch Note: números legíveis + cores calmas no dark ------ */
.patch-footer-bar { border-top-color: var(--border, #f1f5f9); }
.patch-validations-info { color: var(--text-muted, #475569); }
.patch-validations-info strong { color: var(--text-main, #0f172a); font-variant-numeric: tabular-nums; }
.patch-val-count-falha { color: var(--kk-crit-fg); }
.btn-validar-action {
  background: var(--kk-ok-bg);
  color: var(--kk-ok-fg);
  border: 1px solid var(--kk-ok);
}
.btn-validar-action:hover:not(:disabled) { background: var(--kk-ok); color: #fff; border-color: var(--kk-ok); }
.btn-validar-action:disabled { background: var(--surface-hover); color: var(--text-muted); border-color: var(--border); }
.btn-validar-action.validated { background: var(--kk-ok-bg); color: var(--kk-ok-fg); border-color: var(--kk-ok); }

/* --- Badges da sidebar: contagem "primary" e selo "Beta" -------------- */
[data-theme="dark"] .side-badge.badge-primary { background: rgba(45, 212, 191, .16); color: var(--kk-accent-fg); }

/* --- Status do usuário na sidebar ---------------------------------- */
.user-avatar { position: relative; }
.user-status-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--navy, #0b1a30);
  box-sizing: border-box;
  cursor: pointer;
}
[data-theme="dark"] .user-status-dot { border-color: #09111e; }
.user-status-txt { cursor: pointer; font-weight: 600; }
.user-status-txt:hover { text-decoration: underline; }

/* --- Presença da equipe (dots no Chat da Equipe) ------------------ */
.presence-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94a3b8;
  vertical-align: middle;
}
.chat-channel-icon .presence-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  border: 2px solid var(--surface, #fff);
}
.presence-online { background: #22c55e; }
.presence-ausente { background: #f59e0b; }
.presence-ocupado { background: #ef4444; }
.presence-off { background: #94a3b8; }
#chatAtivoSubtitulo .presence-dot { margin-right: 4px; }
/* ===== FIM FASE R.3l ===== */

.roster-head #chatEquipeOnline { color: var(--kk-ok-fg, #16a34a); font-weight: 800; }
.roster-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
}
.roster-item .presence-dot { flex: none; }
/* ===== FIM FASE R.3q ===== */

/* ==========================================================================
   FASE R.3r — Notificação de nova mensagem, feedback da Kiara, janela 24h
   ========================================================================== */
@keyframes kkNudge {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

/* Aviso de janela de 24h do WhatsApp */
.atd-janela24 {
  margin: 0 12px 8px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 0.76rem;
  line-height: 1.45;
  background: var(--kk-warn-bg);
  color: var(--kk-warn-fg);
  border: 1px solid var(--kk-warn);
}

/* Feedback 👍/👎 nas respostas da Kiara */
.kiara-fb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.kiara-fb button {
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 7px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  transition: background .12s, border-color .12s;
}
.kiara-fb button:hover { background: var(--surface-hover); border-color: var(--accent); }

/* --- Ficha rica do imóvel (VistaSoft) ---------------------------- */
#imvFotoMain {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  background: var(--surface-hover);
}
.imv-thumbs img {
  width: 68px;
  height: 50px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--border);
  cursor: pointer;
  flex: none;
  opacity: .8;
  transition: opacity .12s, border-color .12s;
}
/* ===== FIM FASE R.3r ===== */

/* ===== FASE Q·25 — Central de Automações (n8n) ===== */
#n8nAutomacoesLista { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.n8n-wf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.n8n-wf-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.n8n-wf-nome {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.n8n-wf-sub { font-size: 0.7rem; color: var(--text-muted); }
.n8n-wf-kiara {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: .03em;
  background: var(--kk-crit-bg);
  color: var(--kk-crit-fg);
  vertical-align: middle;
}
.n8n-wf-toggle {
  flex: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: background .12s, color .12s, border-color .12s;
}
.n8n-wf-toggle.on { background: var(--kk-ok-bg); color: var(--kk-ok-fg); border-color: var(--kk-ok); }
.n8n-wf-toggle.off { background: var(--kk-idle-bg); color: var(--kk-idle-fg); }
.n8n-wf-toggle:hover { border-color: var(--accent); }
.n8n-wf-empty { font-size: 0.78rem; color: var(--text-muted); padding: 8px 2px; }
/* ===== FIM FASE Q·25 ===== */

/* ==========================================================================
   KK UI v2 — HARMONIZAÇÃO VISUAL DO PAINEL (2026-09-09)
   --------------------------------------------------------------------------
   Camada ADITIVA, sempre no FIM do admin.css. Não remove nem reescreve nada
   do legado: apenas redefine os tokens (que já são usados em ~640 pontos) e
   normaliza raio, sombra, espaçamento e tipografia dos componentes centrais.

   Identidade: Navy (#142e4f) = estrutura · Dourado (#b09874) = marca/destaque
   Azul (#1e5fa0) = ação/link · verde/âmbar/vermelho = status.

   Para reverter: apagar deste marcador até o fim do arquivo.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1) ESCALA DE DESIGN (tokens novos, prefixo --kk2-)
   -------------------------------------------------------------------------- */
:root {
  /* As rampas da marca (navy e dourado) e o anel de foco ficam em marca.css (T-0220). */

  /* Raio — uma escala só, 5 degraus */
  --kk2-r-xs: 6px;
  --kk2-r-sm: 9px;
  --kk2-r-md: 12px;
  --kk2-r-lg: 16px;
  --kk2-r-xl: 20px;
  --kk2-r-pill: 999px;

  /* Sombra — tingida de navy, some no dark */
  --kk2-sh-xs: 0 1px 2px rgba(16, 28, 44, .05);
  --kk2-sh-sm: 0 1px 2px rgba(16, 28, 44, .05), 0 2px 6px -2px rgba(16, 28, 44, .06);
  --kk2-sh-md: 0 2px 4px rgba(16, 28, 44, .04), 0 8px 20px -8px rgba(16, 28, 44, .14);
  --kk2-sh-lg: 0 4px 8px rgba(16, 28, 44, .05), 0 18px 40px -14px rgba(16, 28, 44, .22);
  --kk2-sh-xl: 0 8px 16px rgba(16, 28, 44, .06), 0 32px 64px -20px rgba(16, 28, 44, .30);

  /* Espaçamento base */
  --kk2-sp-1: 4px;
  --kk2-sp-2: 8px;
  --kk2-sp-3: 12px;
  --kk2-sp-4: 16px;
  --kk2-sp-5: 20px;
  --kk2-sp-6: 24px;
  --kk2-sp-8: 32px;

  /* Superfície da sidebar */
  --kk2-side-bg: linear-gradient(180deg, #0d2136 0%, #0a1a2c 55%, #081524 100%);
  --kk2-side-line: rgba(255, 255, 255, .07);
  --kk2-side-txt: #cbd8e6;
  --kk2-side-txt-dim: rgba(203, 216, 230, .55);
}

/* --------------------------------------------------------------------------
   2) TOKENS CENTRAIS REAFINADOS
   --------------------------------------------------------------------------
   REGRA DE OURO desta camada: os neutros (surface, border, text) NÃO mudam de
   valor. O CSS legado repete #f8fafc (84x), #f1f5f9 (71x), #e2e8f0 (66x),
   #0f172a (57x) e #64748b (54x) escritos à mão; mexer nos tokens deixaria
   esses ~400 pontos fora de tom. O caráter da marca entra pela forma (raio,
   sombra, espaço) e pelas superfícies de marca (sidebar, hero, foco dourado).
   A única troca de cor é o acento: teal -> azul-marinho, que tem só 13 usos
   fixos e destoava do navy+dourado da Kelly Keith.
   -------------------------------------------------------------------------- */
:root {
  /* O ÚNICO neutro que muda de valor, e por um motivo: o fundo da página era
     #f8fafc, quase branco. Card branco sobre fundo quase branco não se separa
     — o painel virava uma folha só. Este tom dá o degrau que faltava, e é
     seguro porque os #f8fafc escritos à mão no legado são fundos de
     COMPONENTE (cabeçalho de tabela, atalho, botão), não do documento: eles
     continuam claros e agora leem como superfície, que é o que são. */
  --bg-admin: #edf0f6;

  --accent: #1e5fa0;            /* ação/link — era #0f766e (teal) */
  --accent-soft: rgba(30, 95, 160, .10);
  --info: #1e5fa0;

  --kk-radius: var(--kk2-r-md);
  --kk-shadow: var(--kk2-sh-sm);
  --kk-shadow-hover: var(--kk2-sh-md);
  --kk-accent-bg: rgba(30, 95, 160, .10);
  --kk-accent-fg: #1b5490;
}

/* ARMADILHA A NÃO REPETIR:
   `:root` e `[data-theme="dark"]` têm a MESMA especificidade (0,1,0). Como
   este bloco fica no fim do arquivo, todo token que ele redefine em `:root`
   passa a valer TAMBÉM no modo escuro, engolindo a definição escura que
   está lá em cima. É a origem clássica do "fundo branco no dark".
   REGRA: todo token de COR redefinido no `:root` acima precisa aparecer
   de novo aqui. O validador do deploy confere isso. */
[data-theme="dark"] {
  --bg-admin: #080d16;          /* sem esta linha, o dark herda o fundo claro */

  --accent: #6fa8dc;
  --accent-soft: rgba(111, 168, 220, .16);
  --info: #6fa8dc;

  --kk-accent-bg: rgba(111, 168, 220, .14);
  --kk-accent-fg: #9ec8ec;

  --kk2-sh-xs: 0 1px 2px rgba(0, 0, 0, .35);
  --kk2-sh-sm: 0 1px 2px rgba(0, 0, 0, .38), 0 2px 6px -2px rgba(0, 0, 0, .45);
  --kk2-sh-md: 0 2px 6px rgba(0, 0, 0, .40), 0 10px 26px -10px rgba(0, 0, 0, .60);
  --kk2-sh-lg: 0 4px 10px rgba(0, 0, 0, .45), 0 22px 46px -16px rgba(0, 0, 0, .70);
  --kk2-sh-xl: 0 8px 18px rgba(0, 0, 0, .50), 0 36px 70px -22px rgba(0, 0, 0, .80);
  --kk2-ring: 0 0 0 3px rgba(212, 175, 55, .28);   /* casa com o --gold do dark */
  --kk2-ring-danger: 0 0 0 3px rgba(248, 113, 113, .26);

  --kk2-side-bg: linear-gradient(180deg, #0b1521 0%, #080f1a 60%, #060b13 100%);
  --kk2-side-line: rgba(255, 255, 255, .06);
  --kk2-side-txt: #b9c8d9;
  --kk2-side-txt-dim: rgba(185, 200, 217, .5);
}

/* --------------------------------------------------------------------------
   3) BASE — leitura, foco, seleção, barra de rolagem
   -------------------------------------------------------------------------- */
/* Pilha de fontes com fallback real: se o Google Fonts não responder, o
   painel cai numa fonte de sistema parecida em vez do sans-serif genérico. */
:root {
  --kk2-font-ui: 'Inter', ui-sans-serif, system-ui, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
  --kk2-font-display: 'Outfit', var(--kk2-font-ui);
}

body, input, select, textarea, button { font-family: var(--kk2-font-ui); }

h1, h2, h3, .tab-header-title, .kpi-value, .stat-val, .welcome-greeting,
.cockpit-card-header h3, .brand-name, .topbar-time, .fin-kpi-value {
  font-family: var(--kk2-font-display);
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.004em;
}

h1, h2, h3, h4,
.tab-header-title, .kpi-value, .stat-val, .welcome-greeting,
.cockpit-card-header h3 {
  letter-spacing: -0.018em;
}

::selection { background: rgba(176, 152, 116, .28); color: var(--text-main); }

/* Números sempre alinhados em colunas */
.kpi-value, .stat-val, .fin-kpi-value, .topbar-time,
td .valor, .kk-score-num, .badge-code {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Foco visível e consistente — acessibilidade (WCAG 2.4.7) */
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: var(--kk2-ring);
}

/* Barra de rolagem discreta */
* { scrollbar-width: thin; scrollbar-color: rgba(95, 112, 137, .35) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(95, 112, 137, .28);
  border-radius: var(--kk2-r-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(95, 112, 137, .48); background-clip: content-box; }

/* --------------------------------------------------------------------------
   4) SIDEBAR — navy em profundidade, item ativo em pílula dourada
   -------------------------------------------------------------------------- */
.sidebar {
  background: var(--kk2-side-bg);
  border-right: 1px solid var(--kk2-side-line);
  box-shadow: none;
  color: var(--kk2-side-txt);
}

.sidebar-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--kk2-side-line);
}

.sidebar-logo { border-radius: var(--kk2-r-xs); }

.brand-name { font-size: 1.02rem; letter-spacing: -0.01em; }
.brand-sub {
  color: var(--kk2-gold-400);
  font-size: 0.63rem;
  letter-spacing: 0.14em;
  margin-top: 1px;
}

.sidebar-toggle-btn {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--kk2-side-line);
  border-radius: var(--kk2-r-sm);
  color: var(--kk2-side-txt-dim);
}
.sidebar-toggle-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.sidebar-menu-wrapper { padding: 12px 10px 18px; }

.sidebar-section-title {
  color: var(--kk2-side-txt-dim);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  margin: 18px 10px 6px;
}

.side-nav-btn {
  border-radius: var(--kk2-r-sm);
  padding: 9px 11px;
  margin-bottom: 2px;
  color: var(--kk2-side-txt);
  font-size: 0.855rem;
  transition: background .14s ease, color .14s ease;
}
.side-nav-btn:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
  transform: none;              /* o translateX antigo fazia o menu "tremer" */
}

/* Ativo: pílula com barra dourada interna — não desloca o texto */
.side-nav-btn.active {
  background: linear-gradient(90deg, rgba(176, 152, 116, .20), rgba(176, 152, 116, .05));
  color: #ffffff;
  border-left: 0;
  box-shadow: inset 3px 0 0 var(--kk2-gold-400);
  font-weight: 600;
}
.side-nav-btn.active .nav-icon { filter: none; }

.nav-icon { font-size: 1.08rem; min-width: 22px; opacity: .92; }
.nav-label { margin-left: 10px; line-height: 1.25; }

/* Sub-item ativo precisa do MESMO destaque dourado do item principal — antes
   ficava com um branco/cinza discreto (regra antiga nunca atualizada junto
   com a de cima), por isso parecia que só algumas abas "acendiam" ao clicar. */
.sidebar-sub-item.active {
  background: linear-gradient(90deg, rgba(176, 152, 116, .20), rgba(176, 152, 116, .05));
  color: #ffffff;
  border-left: 0;
  box-shadow: inset 3px 0 0 var(--kk2-gold-400);
  font-weight: 600;
}

/* Mesmo tamanho/proporção do item principal (.side-nav-btn), ponto a ponto:
   margin-bottom e o espaçamento ícone→texto (gap) tinham ficado 1-2px
   diferentes porque só o item principal recebeu esses ajustes finos antes. */
.sidebar-sub-item {
  border-radius: var(--kk2-r-sm);
  padding: 9px 11px;
  margin-bottom: 2px;
  gap: 10px;
  color: var(--kk2-side-txt);
  font-size: 0.855rem;
  line-height: 1.25;
}
.sidebar-sub-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.sidebar-footer {
  border-top: 1px solid var(--kk2-side-line);
  background: rgba(0, 0, 0, .18);
  padding: 10px;
}
.user-profile-widget { border-radius: var(--kk2-r-sm); }
.user-avatar {
  background: linear-gradient(135deg, var(--kk2-gold-400), var(--kk2-gold-600));
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

.side-badge {
  border-radius: var(--kk2-r-pill);
  letter-spacing: .04em;
  font-size: 0.66rem;
  padding: 2px 8px;
}

/* --------------------------------------------------------------------------
   5) TOPBAR — mais leve, sem "degrau" de sombra
   -------------------------------------------------------------------------- */
.topbar {
  height: 62px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  padding: 0 24px;
}

@supports not (backdrop-filter: blur(1px)) {
  .topbar { background: var(--surface); }
}

.breadcrumb { font-size: 0.84rem; color: var(--text-muted); }
.bc-current { color: var(--text-main); font-weight: 600; }
.bc-sep { color: var(--border); }

.topbar-time {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--kk2-r-sm);
  color: var(--text-muted);
  font-weight: 600;
}

.top-btn-2fa, .top-btn-perfil, .top-btn-logout, .top-btn-theme, .top-btn-notif {
  border-radius: var(--kk2-r-sm);
  height: 34px;
}

.notif-panel {
  border-radius: var(--kk2-r-lg);
  box-shadow: var(--kk2-sh-xl);
  border-color: var(--border);
}
.notif-panel-head { border-radius: var(--kk2-r-lg) var(--kk2-r-lg) 0 0; }

.content-body { padding: 24px 28px 56px; }

/* --------------------------------------------------------------------------
   6) SUPERFÍCIES — um raio, uma sombra, uma borda para todo card
   -------------------------------------------------------------------------- */
.cockpit-card,
.kpi-card,
.stat-card,
.table-container,
.filter-bar,
.filtro-bar,
.tab-header,
.aviso-card,
.mural-card,
.visita-card,
.meta-coletiva-card,
.podium-card,
.fin-kpi-card,
.patch-accordion-card,
.env-card,
.kk-card,
.atd-layout > .atd-col {
  border-radius: var(--kk2-r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--kk2-sh-sm);
}

/* .meta-coletiva-card é sempre escuro (texto branco fixo, linha 3971) — mas
   entra na lista acima por causa da borda/raio/sombra padrão, e essa lista
   também define o FUNDO, apagando o navy do card e deixando texto branco
   sobre fundo branco no modo claro. Restaura o fundo escuro pretendido. */
.meta-coletiva-card {
  background: linear-gradient(135deg, #0b1a30, #142e4f) !important;
}

.cockpit-card, .tab-header { padding: 20px 22px; }

.cockpit-card-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.cockpit-card-header h3 { font-size: 1.02rem; }

/* Hover só onde o card é clicável */
.kpi-card, .shortcut-item, .fin-kpi-card {
  transition: transform .16s cubic-bezier(.4, 0, .2, 1), box-shadow .16s ease, border-color .16s ease;
}
.kpi-card:hover, .fin-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--kk2-sh-md);
  border-color: color-mix(in srgb, var(--gold) 42%, var(--border));
}

.shortcut-item {
  background: var(--surface-hover);
  border: 1px solid transparent;
  border-radius: var(--kk2-r-sm);
}
.shortcut-item:hover {
  background: var(--surface);
  border-color: var(--border);
  transform: translateY(-1px);
  box-shadow: var(--kk2-sh-sm);
}

/* --------------------------------------------------------------------------
   7) CABEÇALHO DE ABA — hierarquia clara em todas as telas
   -------------------------------------------------------------------------- */
.tab-header { margin-bottom: 20px; }
.tab-header-title { font-size: 1.42rem; }   /* cor segue var(--navy) do legado */
.tab-header-sub { font-size: 0.83rem; line-height: 1.5; }
.tab-header-icon { opacity: .9; }
.tab-action-divider { background: var(--border); height: 24px; }

.dash-header h1 { font-size: 1.42rem; }

/* --------------------------------------------------------------------------
   8) BOTÕES — mesma altura, mesmo raio, mesma resposta ao toque
   -------------------------------------------------------------------------- */
.btn-primary, .btn-gold, .btn-icon, .btn-action-header,
.dash-buttons .btn-primary, .dash-buttons .btn-gold,
.dash-buttons .btn-icon, .dash-buttons .btn-action-header {
  border-radius: var(--kk2-r-sm);
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: background .15s ease, border-color .15s ease,
              box-shadow .15s ease, transform .12s ease;
}

.btn-primary {
  background: var(--kk2-navy-700);
  border-color: var(--kk2-navy-700);
  box-shadow: var(--kk2-sh-xs);
}
.btn-primary:hover {
  background: var(--kk2-navy-600);
  border-color: var(--kk2-navy-600);
  box-shadow: var(--kk2-sh-sm);
}

/* ACESSIBILIDADE: branco sobre o dourado da marca dá contraste 2.77:1 e
   reprova em WCAG AA (mín. 4.5). Trocando o texto para o navy da marca o
   contraste sobe para 4.95:1 — sem alterar o dourado, que é a cor oficial.
   O hover CLAREIA o dourado (escurecer derrubaria o contraste de novo). */
.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--kk2-navy-700);
  box-shadow: var(--kk2-sh-xs);
}
.btn-gold:hover {
  background: color-mix(in srgb, var(--gold) 82%, #ffffff);
  border-color: color-mix(in srgb, var(--gold) 82%, #ffffff);
  color: var(--kk2-navy-800);
  box-shadow: var(--kk2-sh-sm);
}
.btn-gold:active { transform: translateY(1px); box-shadow: none; }

/* mesmo cuidado onde o dourado é fundo sólido */
.nav-badge { color: var(--kk2-navy-800); }

/* o selo azul do menu ficou com fundo teal fixo do acento antigo */
[data-theme="dark"] .side-badge.badge-primary { background: var(--kk-accent-bg); }

.btn-icon {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: var(--kk2-r-xs);
}
.btn-icon:hover {
  background: var(--surface-hover);
  border-color: color-mix(in srgb, var(--gold) 55%, var(--border));
}
.btn-icon.gold {
  background: var(--kk2-gold-50);
  border-color: var(--kk2-gold-200);
  color: var(--kk2-gold-700);
}
.btn-icon.gold:hover { background: var(--kk2-gold-200); }

[data-theme="dark"] .btn-icon.gold {
  background: rgba(217, 188, 127, .12);
  border-color: rgba(217, 188, 127, .32);
  color: var(--gold);
}

.tab-action-btn {
  border-radius: var(--kk2-r-xs) !important;
  height: 34px !important;
}

.btn-card-link { color: var(--accent); }
.btn-card-link:hover { text-decoration: none; opacity: .8; }

/* --------------------------------------------------------------------------
   9) FORMULÁRIOS — rótulo legível, campo com foco dourado
   -------------------------------------------------------------------------- */
.form-group { margin-bottom: 14px; }

.form-group label {
  text-transform: none;         /* CAIXA ALTA em 317 rótulos cansava a leitura */
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0;
  margin-bottom: 5px;
  opacity: .88;
}

.form-group input,
.form-group select,
.form-group textarea,
.search-input,
.status-select,
.form-control {
  border-radius: var(--kk2-r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  padding: 9px 12px;
  font-size: 0.88rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover,
.search-input:hover,
.status-select:hover,
.form-control:hover { border-color: color-mix(in srgb, var(--gold) 50%, var(--border)); }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.search-input:focus,
.status-select:focus,
.form-control:focus {
  border-color: var(--gold);
  box-shadow: var(--kk2-ring);
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.search-input::placeholder,
.form-control::placeholder { color: var(--text-muted); opacity: .68; }

input.input-invalido,
.form-group input.input-invalido {
  border-color: var(--danger);
  box-shadow: var(--kk2-ring-danger);
  background: transparent;
}

.filter-bar, .filtro-bar { padding: 12px 14px; gap: 10px; }

/* --------------------------------------------------------------------------
   10) TABELAS — cabeçalho fixo discreto, zebra sutil, densidade uniforme
   -------------------------------------------------------------------------- */
.table-container { overflow: auto; }

.table-container table { border-collapse: separate; border-spacing: 0; }

.table-container th {
  /* --table-head-bg é #f8fafc: quase branco sobre branco, o cabeçalho sumia */
  background: var(--surface-hover);
  color: var(--text-muted);
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table-container td {
  padding: 12px 16px;
  font-size: 0.855rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.table-container tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface-hover) 45%, transparent);
}
.table-container tbody tr:hover td { background: var(--surface-hover); }
.table-container tbody tr:last-child td { border-bottom: none; }

.badge-code {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--kk2-r-xs);
  color: var(--text-main);
  font-size: .78rem;
  letter-spacing: .02em;
}

.table-actions { gap: 5px; }

/* --------------------------------------------------------------------------
   11) SELOS E PÍLULAS — uma altura só, sem quebra de linha
   -------------------------------------------------------------------------- */
.status-pill, .side-badge, .badge-role, .badge-2fa,
.badge-status-tag, .badge-category-tag, .badge-version,
.kk-pill, .atd-label, .badge-cargo-pill {
  border-radius: var(--kk2-r-pill);
  white-space: nowrap;
  line-height: 1.3;
}

.status-pill {
  font-size: 0.72rem;
  letter-spacing: .04em;
  padding: 3px 10px;
}

/* --------------------------------------------------------------------------
   12) MODAIS — profundidade e entrada suave
   -------------------------------------------------------------------------- */
.modal-overlay {
  background: rgba(10, 20, 34, .55);
  backdrop-filter: blur(6px) saturate(1.1);
  -webkit-backdrop-filter: blur(6px) saturate(1.1);
}

.modal-box {
  background: var(--surface);
  color: var(--text-main);
  border-radius: var(--kk2-r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--kk2-sh-xl);
}

.modal-header { padding: 18px 22px; }
.modal-body { padding: 20px 22px; }
.modal-footer { padding: 14px 22px; }

.modal-close {
  border-radius: var(--kk2-r-xs);
  transition: background .15s ease, color .15s ease;
}

/* Modal de confirmação padrão do painel (substitui window.confirm / window.prompt) */
.modal-box--confirm {
  border-radius: var(--kk2-r-md, 10px);
  overflow: hidden;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.4);
}
.modal-box--confirm .modal-header {
  background: var(--navy) !important;
  color: #ffffff !important;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}
.modal-box--confirm .modal-header h3,
.modal-box--confirm .modal-header h3 span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff !important;
  margin: 0;
}
.modal-box--confirm .modal-header .modal-close {
  color: #ffffff !important;
  opacity: 0.85;
  background: transparent;
  border: none;
  font-size: 1.35rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.modal-box--confirm .modal-header .modal-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
}
.modal-box--confirm .modal-body {
  padding: 20px 22px;
}
.modal-box--confirm .modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-hover);
}
.modal-box--confirm .modal-footer .btn-secondary,
.modal-box--confirm .modal-footer .btn-cancel {
  min-width: 90px;
  height: 38px;
  padding: 0 16px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--btn-radius, 8px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.modal-box--confirm .modal-footer .btn-gold {
  min-width: 100px;
  height: 38px;
  padding: 0 18px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--btn-radius, 8px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.confirm-painel-msg {
  white-space: pre-line;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-main);
  margin: 0;
}

/* --------------------------------------------------------------------------
   13) COCKPIT — herói mais sóbrio, KPIs com hierarquia
   -------------------------------------------------------------------------- */
.home-cockpit-container { gap: 18px; }

.welcome-hero-card {
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(176, 152, 116, .16) 0%, transparent 58%),
    linear-gradient(135deg, var(--kk2-navy-800) 0%, var(--kk2-navy-600) 100%);
  border: 1px solid rgba(176, 152, 116, .22);
  border-radius: var(--kk2-r-lg);
  box-shadow: var(--kk2-sh-md);
  padding: 24px 28px;
}

.welcome-pill {
  background: rgba(201, 177, 144, .16);
  border: 1px solid rgba(201, 177, 144, .30);
  color: var(--kk2-gold-400);
  letter-spacing: .1em;
  font-size: 0.68rem;
}

.welcome-greeting { font-size: 1.5rem; }
.welcome-sub { color: #a9bcd0; font-size: 0.87rem; }

.cockpit-stats-grid { gap: 14px; }

.kpi-icon { width: 44px; height: 44px; border-radius: var(--kk2-r-sm); font-size: 1.28rem; }
.kpi-value { font-size: 1.45rem; color: var(--text-main); }
.kpi-label { font-size: 0.775rem; color: var(--text-muted); }

.kpi-icon-amber  { background: color-mix(in srgb, var(--warning) 12%, transparent); color: var(--warning); }
.kpi-icon-blue   { background: color-mix(in srgb, var(--accent) 12%, transparent);  color: var(--accent); }
.kpi-icon-green  { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.kpi-icon-purple { background: color-mix(in srgb, #7c3aed 12%, transparent);        color: #7c3aed; }

.cockpit-split-grid { gap: 18px; }

.shortcut-title { color: var(--text-main); }
.shortcut-desc  { color: var(--text-muted); }

.stat-val { font-size: 1.68rem; }           /* cor segue var(--navy) do legado */
.stat-title { font-size: 0.72rem; letter-spacing: .08em; }

/* --------------------------------------------------------------------------
   14) ATENDIMENTO AO VIVO — alinhado ao resto do painel
   -------------------------------------------------------------------------- */
.atd-layout { gap: 14px; }
.atd-col-head { border-radius: var(--kk2-r-md) var(--kk2-r-md) 0 0; }
.atd-conv { border-radius: var(--kk2-r-sm); }
.atd-search { border-radius: var(--kk2-r-pill); }
.atd-search:focus { border-color: var(--gold); box-shadow: var(--kk2-ring); }
.atd-bubble { box-shadow: var(--kk2-sh-xs); border-radius: var(--kk2-r-md); }
.atd-send-btn, .atd-icon-btn { border-radius: var(--kk2-r-sm); }
.atd-composer-row textarea { border-radius: var(--kk2-r-sm); }
.atd-card-dark { background: var(--kk2-navy-700); border-radius: var(--kk2-r-md); }

/* --------------------------------------------------------------------------
   15) DETALHES QUE FALTAVAM
   -------------------------------------------------------------------------- */
/* Separadores e blocos vazios */
.kk-empty, .notif-empty, .atd-group-label { color: var(--text-muted); }

/* Spinner com a cor da marca */
.loading-spinner-sm, .loading-spinner {
  border-top-color: var(--gold) !important;
}

/* --------------------------------------------------------------------------
   16) RESPONSIVO E MOVIMENTO
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .content-body { padding: 16px 14px 40px; }
  .topbar { padding: 0 14px; height: 56px; }
  .tab-header { padding: 16px; }
  .cockpit-split-grid { grid-template-columns: 1fr; }
  .welcome-hero-card { padding: 20px; }
  .welcome-greeting { font-size: 1.28rem; }
}

@media (prefers-reduced-motion: reduce) {
  .kpi-card, .fin-kpi-card, .shortcut-item,
  .btn-primary, .btn-gold, .btn-icon, .side-nav-btn {
    transition: none !important;
  }
  .kpi-card:hover, .fin-kpi-card:hover,
  .shortcut-item:hover, .btn-primary:active, .btn-gold:active {
    transform: none !important;
  }
}

@media print {
  .sidebar, .topbar, .tab-action-group, .notif-panel { display: none !important; }
  .content-body { padding: 0; max-width: none; }
  .cockpit-card, .tab-header, .table-container { box-shadow: none; border-color: #ccc; }
}

/* ==========================================================================
   17) HIERARQUIA — nem tudo é card
   --------------------------------------------------------------------------
   O painel tratava KPI, filtro, tabela e formulário com a mesma borda e a
   mesma sombra. Quando tudo tem o mesmo peso, o olho não sabe onde pousar.
   Agora: superfície de TRABALHO (onde se lê e se opera) fica plana; card de
   DECISÃO (onde se olha um número e se resolve algo) ganha elevação.
   ========================================================================== */
.table-container,
.filter-bar,
.filtro-bar,
.tab-header {
  box-shadow: none;
}

.cockpit-card,
.kpi-card,
.fin-kpi-card,
.stat-card,
.modal-box,
.notif-panel {
  box-shadow: var(--kk2-sh-sm);
}

/* ==========================================================================
   18) PRANCHETA DE DADOS — o filtro gruda na tabela que ele filtra
   --------------------------------------------------------------------------
   Barra de filtros e tabela eram duas caixas soltas com um vão no meio.
   Coladas, viram uma peça só: "isto filtra aquilo" fica óbvio sem legenda.
   ========================================================================== */
.filter-bar:has(+ .table-container),
.filtro-bar:has(+ .table-container) {
  margin-bottom: 0;
  border-radius: var(--kk2-r-md) var(--kk2-r-md) 0 0;
  border-bottom-color: transparent;
  /* barra de ferramentas: um degrau mais escura que a tabela que ela comanda */
  background: var(--surface-hover);
}

.filter-bar + .table-container,
.filtro-bar + .table-container {
  border-radius: 0 0 var(--kk2-r-md) var(--kk2-r-md);
  border-top: 1px solid var(--border);
  margin-top: 0;
}

/* A barra fica à mão ao rolar uma lista longa: quem varre 200 credenciais
   não precisa voltar ao topo para trocar o filtro. (Se algum ancestral tiver
   overflow, o sticky simplesmente não gruda — nada quebra.) */
@media (min-height: 620px) {
  .filter-bar:has(+ .table-container),
  .filtro-bar:has(+ .table-container) {
    position: sticky;
    top: 62px;
    z-index: 5;
  }
}

/* ==========================================================================
   19) O CONTEÚDO MANDA NA ALTURA
   --------------------------------------------------------------------------
   Numa grade de duas colunas, o card mais curto era esticado até a altura do
   mais alto — sobrava um vazio grande dentro dele. Agora cada card para onde
   o conteúdo acaba.
   ========================================================================== */
.cockpit-split-grid,
.cockpit-stats-grid {
  align-items: start;
}

/* ==========================================================================
   20) KPIs MAIS DENSOS
   --------------------------------------------------------------------------
   Cada cartão tinha ~300px de largura para ~150px de conteúdo. Encolhendo a
   caixa cabem mais indicadores na mesma linha, sem apertar a leitura.
   ========================================================================== */
.cockpit-stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(198px, 1fr));
  gap: 12px;
}

.kpi-card { padding: 14px 16px; gap: 12px; align-items: center; }
.kpi-icon { width: 38px; height: 38px; font-size: 1.12rem; border-radius: var(--kk2-r-xs); }
.kpi-value { font-size: 1.38rem; line-height: 1.05; }
.kpi-label { font-size: 0.76rem; margin-top: 3px; line-height: 1.3; }

/* ícone com presença: fundo mais firme e cor sólida, não pastel lavado */
.kpi-icon-amber  { background: color-mix(in srgb, var(--warning) 18%, transparent); }
.kpi-icon-blue   { background: color-mix(in srgb, var(--accent)  18%, transparent); }
.kpi-icon-green  { background: color-mix(in srgb, var(--success) 18%, transparent); }
.kpi-icon-purple { background: color-mix(in srgb, #7c3aed 18%, transparent); }

/* ==========================================================================
   21) HERO MAIS BAIXO
   --------------------------------------------------------------------------
   A faixa de boas-vindas comia 130px de altura para uma saudação e três
   números. Encolhida, o cockpit começa mais perto do topo da tela.
   ========================================================================== */
.welcome-hero-card { padding: 20px 24px; align-items: center; }
.welcome-greeting { font-size: 1.35rem; margin-bottom: 4px; }
.welcome-sub { font-size: 0.85rem; }
.welcome-pill { margin-bottom: 6px; padding: 2px 9px; }

.tab-header { padding: 16px 20px; margin-bottom: 16px; }
.tab-header-title { font-size: 1.3rem; }

/* ==========================================================================
   22) TABELA COMO FERRAMENTA DE LEITURA
   --------------------------------------------------------------------------
   Mais linhas por tela, e a linha sob o cursor marcada com um traço dourado
   na borda — quem varre uma lista de 80 credenciais não perde o lugar.
   ========================================================================== */
.table-container td { padding: 10px 14px; }
.table-container th { padding: 10px 14px; }

.table-container tbody tr { transition: background .1s ease; }
.table-container tbody tr:hover td { background: var(--surface-hover); }
.table-container tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--gold);
}
.table-container tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface-hover) 55%, transparent);
}
.table-container tbody tr:nth-child(even):hover td { background: var(--surface-hover); }

/* botões de ação da linha: presentes sem gritar */
.table-actions .btn-icon { padding: 5px 10px; font-size: 0.78rem; }

/* ==========================================================================
   23) MODAL QUE CABE NA TELA
   --------------------------------------------------------------------------
   Formulário longo empurrava o rodapé para fora da janela e o botão Salvar
   sumia. Agora só o miolo rola; título e botões ficam sempre visíveis.
   ========================================================================== */
.modal-box { max-height: 88vh; }
.modal-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  gap: 8px;
}

/* ==========================================================================
   24) MENU LATERAL — grupos que se leem de relance
   ========================================================================== */
.sidebar-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   25) ESCALA TIPOGRÁFICA
   --------------------------------------------------------------------------
   Havia 107 tamanhos de fonte diferentes no arquivo. Estes seis cobrem o que
   os componentes centrais precisam; o resto do legado continua de pé.
   ========================================================================== */
:root {
  --kk2-fs-micro: 0.68rem;   /* eyebrow, selo */
  --kk2-fs-cap:   0.76rem;   /* legenda, rótulo de KPI */
  --kk2-fs-sm:    0.84rem;   /* apoio, tabela */
  --kk2-fs-base:  0.92rem;   /* corpo */
  --kk2-fs-lg:    1.06rem;   /* título de card */
  --kk2-fs-xl:    1.30rem;   /* título de aba */
}

.cockpit-card-header h3 { font-size: var(--kk2-fs-lg); }
.shortcut-title { font-size: var(--kk2-fs-sm); }
.shortcut-desc  { font-size: var(--kk2-fs-micro); }
.tab-header-sub { font-size: var(--kk2-fs-sm); }
.btn-card-link  { font-size: var(--kk2-fs-sm); }
.atd-conv-name  { font-size: var(--kk2-fs-sm); }

/* ==========================================================================
   26) TELAS LARGAS
   --------------------------------------------------------------------------
   Num monitor de 1920 sobravam 260px de margem de cada lado enquanto a
   tabela espremia as colunas. A área de trabalho passa a acompanhar a tela.
   ========================================================================== */
@media (min-width: 1700px) {
  .content-body { max-width: 1640px; }
}

/* ==========================================================================
   27) O QUE É CLICÁVEL PARECE CLICÁVEL
   ========================================================================== */
.kpi-card, .shortcut-item, .atd-conv, .visita-card {
  cursor: pointer;
}
.kpi-card:focus-visible, .shortcut-item:focus-visible {
  box-shadow: var(--kk2-ring), var(--kk2-sh-md);
}

/* estado vazio com cara de estado vazio, não de erro */
.kk-empty, .notif-empty, .atd-empty {
  text-align: center;
  padding: 28px 16px;
  font-size: var(--kk2-fs-sm);
  color: var(--text-muted);
}
/* ===== FIM KK UI v2 ===== */

/* ==========================================================================
   28) GOVERNANÇA FINANCEIRA & COCKPIT 5 CAIXAS (PREMIUM SAAS & CLEAN DESIGN)
   ========================================================================== */

/* Top Header */
.gov-top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 24px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.gov-brand-title h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.gov-badge-gold {
  background: rgba(176, 152, 116, 0.15);
  color: var(--gold);
  border: 1px solid rgba(176, 152, 116, 0.35);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gov-quota-pill {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  padding: 1px 8px;
  border-radius: 6px;
  font-weight: 600;
  color: var(--text-main);
}

.gov-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-admin);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 10px;
}

/* Cada select ganha sua própria "pílula" com fundo e borda, em vez de
   texto solto ao lado do outro dentro da mesma caixa. */
.gov-select-control {
  background: var(--surface-hover) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  padding: 4px 8px !important;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.gov-btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.gov-btn-icon {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

/* Notice Banner */
.gov-notice-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(20, 46, 79, 0.04);
  border: 1px solid rgba(20, 46, 79, 0.12);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 18px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.gov-notice-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.gov-notice-content b {
  color: var(--text-main);
}

/* Hero Card: Caixa Livre Gerencial */
.gov-hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 26px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.gov-hero-pill {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.gov-hero-tag-warning {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.gov-hero-symbol {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-muted);
}

.gov-hero-val {
  font-family: 'Outfit', sans-serif;
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1;
}

/* Breakdown Horizontal Row */
.gov-breakdown-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  background: var(--bg-admin);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.gb-sign {
  font-family: monospace;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 2px 4px;
  border-radius: 4px;
}

.gov-breakdown-col.plus .gb-sign {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
}

.gov-breakdown-col.minus .gb-sign {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}

.gb-val {
  font-family: 'Outfit', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

/* Deck dos 5 Caixas (5 colunas uniformes) */
.gov-caixas-deck {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.gov-c-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 190px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.gov-c-card.c1::before { background: #3b82f6; }
.gov-c-card.c2::before { background: #10b981; }
.gov-c-card.c3::before { background: #f59e0b; }
.gov-c-card.c4::before { background: #8b5cf6; }
.gov-c-card.c5::before { background: var(--gold); }

.gov-p-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-hover);
  color: var(--text-muted);
}

.c1 .gov-p-tag { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.c2 .gov-p-tag { background: rgba(16, 185, 129, 0.12); color: #059669; }
.c3 .gov-p-tag { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.c4 .gov-p-tag { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }
.c5 .gov-p-tag { background: rgba(176, 152, 116, 0.15); color: var(--gold); }

/* Forma do selo dos cards dos 5 caixas — antes só herdava cor de .badge-*,
   sem padding/pill próprios, e o texto (ex.: "Recompor com Prioridade")
   colava nas bordas de uma caixa apertada. Mantém a quebra permitida (o
   card é estreito numa grade de 5 colunas) mas com respiro e centralizado. */
.gov-caixa-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
  max-width: 100%;
}

.gov-c-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
  line-height: 1.1;
}

.gov-meter-track {
  width: 100%;
  height: 5px;
  background: var(--surface-hover);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
}

.gov-meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Navegação Segmentada (Tabs Internas) — agora com 8 abas: quebra em linhas em
   vez de forçar rolagem horizontal ou espremer tudo numa linha só. */
.gov-segmented-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  padding: 6px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.gov-seg-tab {
  flex: 1 1 140px;
  max-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.gov-seg-tab.active {
  background: var(--surface);
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Stepper das 3 Etapas */
.gov-stepper-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 22px;
  margin-bottom: 18px;
}

.gov-stepper-step.active .gov-step-num {
  background: var(--navy);
  border-color: var(--navy);
  color: #ffffff;
}

.gov-stepper-step.completed .gov-step-num {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.gov-step-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Checklist Card & Rows */
.gov-checklist-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.gov-progress-pill {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy);
  background: rgba(20, 46, 79, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
}

.gov-checklist-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  transition: all 0.2s ease;
}

.gov-checklist-row.item-concluido {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.04);
}

.gov-chk-pasta-badge {
  font-size: 0.7rem;
  font-weight: 600;
  font-family: monospace;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
}

.gov-chk-doc-ok {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  padding: 2px 8px;
  border-radius: 4px;
}

.gov-chk-doc-faltante {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--surface-hover);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Toolbar de Filtros da Tabela-Mestra */
.gov-filters-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
}

.gov-search-input {
  width: 100%;
  padding: 7px 12px;
  background: var(--bg-admin);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-main);
  outline: none;
}

.gov-select-filter {
  padding: 6px 10px;
  background: var(--bg-admin);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

/* Modern Tables */
.gov-table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.gov-modern-table th {
  background: var(--surface-hover);
  color: var(--text-muted);
  font-weight: 600;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.gov-modern-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  color: var(--text-main);
}

/* Chips e Badges dentro da tabela */
.gov-caixa-chip-mini {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
}
.gov-caixa-chip-mini.caixa-1 { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.gov-caixa-chip-mini.caixa-2 { background: rgba(16, 185, 129, 0.15); color: #059669; }
.gov-caixa-chip-mini.caixa-3 { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.gov-caixa-chip-mini.caixa-4 { background: rgba(139, 92, 246, 0.15); color: #7c3aed; }
.gov-caixa-chip-mini.caixa-5 { background: rgba(176, 152, 116, 0.2); color: var(--gold); }

.gov-evidencia-chip {
  font-size: 0.68rem;
  font-weight: 700;
  font-family: monospace;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Repasses Top Bar & Window Tabs */

.gov-window-btn {
  display: flex;
  flex-direction: column;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.gov-window-btn.active {
  border-color: var(--gold);
  background: rgba(176, 152, 116, 0.08);
}

.gov-formula-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  line-height: 1.4;
}

/* Societário Duo Grid */
.gov-soc-duo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.gov-soc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.gov-stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
}

.gov-lock-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 16px;
}

.gov-lock-text b {
  color: #dc2626;
}

.gov-q-pill {
  background: var(--bg-admin);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.gov-matriz-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-admin);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.35;
  margin-bottom: 16px;
}

/* ==========================================================================
   29) MODO ESCURO — GOVERNANÇA FINANCEIRA (PERFEIÇÃO E HARMONIA)
   ========================================================================== */

[data-theme="dark"] .gov-top-header,
[data-theme="dark"] .gov-top-header,
[data-theme="dark"] .gov-hero-card,
[data-theme="dark"] .gov-hero-card,
[data-theme="dark"] .gov-c-card,
[data-theme="dark"] .gov-c-card,
[data-theme="dark"] .gov-stepper-container,
[data-theme="dark"] .gov-stepper-container,
[data-theme="dark"] .gov-checklist-card,
[data-theme="dark"] .gov-checklist-card,
[data-theme="dark"] .gov-filters-toolbar,
[data-theme="dark"] .gov-filters-toolbar,
[data-theme="dark"] .gov-table-card,
[data-theme="dark"] .gov-table-card,
[data-theme="dark"] .gov-window-btn,
[data-theme="dark"] .gov-window-btn,
[data-theme="dark"] .gov-soc-card,
[data-theme="dark"] .gov-soc-card {
  background: #0e1726;
  border-color: #1e293b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .gov-notice-banner,
[data-theme="dark"] .gov-notice-banner {
  background: rgba(15, 23, 42, 0.6);
  border-color: #1e293b;
  border-left-color: #d4af37;
  color: #94a3b8;
}

[data-theme="dark"] .gov-control-group,
[data-theme="dark"] .gov-control-group,
[data-theme="dark"] .gov-breakdown-row,
[data-theme="dark"] .gov-breakdown-row,
[data-theme="dark"] .gov-search-input,
[data-theme="dark"] .gov-search-input,
[data-theme="dark"] .gov-select-filter,
[data-theme="dark"] .gov-select-filter,
[data-theme="dark"] .gov-formula-hint,
[data-theme="dark"] .gov-formula-hint,
[data-theme="dark"] .gov-q-pill,
[data-theme="dark"] .gov-q-pill,
[data-theme="dark"] .gov-matriz-note,
[data-theme="dark"] .gov-matriz-note {
  background: #080d16;
  border-color: #1e293b;
}

[data-theme="dark"] .gov-segmented-nav,
[data-theme="dark"] .gov-segmented-nav {
  background: #080d16;
  border-color: #1e293b;
}

[data-theme="dark"] .gov-seg-tab.active,
[data-theme="dark"] .gov-seg-tab.active {
  background: #152238;
  color: #d4af37;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .gov-checklist-row,
[data-theme="dark"] .gov-checklist-row {
  background: #0e1726;
  border-color: #1e293b;
}

[data-theme="dark"] .gov-checklist-row:hover,
[data-theme="dark"] .gov-checklist-row:hover {
  background: #152238;
}

[data-theme="dark"] .gov-checklist-row.item-concluido,
[data-theme="dark"] .gov-checklist-row.item-concluido {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

[data-theme="dark"] .gov-modern-table th,
[data-theme="dark"] .gov-modern-table th,
[data-theme="dark"] .gov-table-header-title,
[data-theme="dark"] .gov-table-header-title {
  background: #131f33;
  color: #94a3b8;
  border-color: #1e293b;
}

[data-theme="dark"] .gov-modern-table td,
[data-theme="dark"] .gov-modern-table td {
  border-color: #1e293b;
  color: #f8fafc;
}

[data-theme="dark"] .gov-modern-table tr:hover,
[data-theme="dark"] .gov-modern-table tr:hover {
  background: #152238;
}

[data-theme="dark"] .gov-progress-pill,
[data-theme="dark"] .gov-progress-pill {
  background: rgba(212, 175, 55, 0.15);
  color: #d4af37;
}

[data-theme="dark"] .gov-lock-callout,
[data-theme="dark"] .gov-lock-callout {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.3);
  color: #cbd5e1;
}

[data-theme="dark"] .gov-hero-tag-warning,
[data-theme="dark"] .gov-hero-tag-warning {
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(220, 38, 38, 0.35);
  color: #f87171;
}

[data-theme="dark"] .gov-badge-gold,
[data-theme="dark"] .gov-badge-gold {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.3);
  color: #d4af37;
}

[data-theme="dark"] .gov-window-btn.active,
[data-theme="dark"] .gov-window-btn.active {
  border-color: #d4af37;
  background: rgba(212, 175, 55, 0.1);
}

[data-theme="dark"] .gov-doc-demonstrativo,
[data-theme="dark"] .gov-doc-demonstrativo {
  background: #0e1726;
  color: #f8fafc;
  border-color: #1e293b;
}

[data-theme="dark"] .gov-doc-header,
[data-theme="dark"] .gov-doc-header {
  border-color: #d4af37;
}

[data-theme="dark"] .gov-doc-table th,
[data-theme="dark"] .gov-doc-table th {
  background: #131f33;
  color: #f8fafc;
  border-color: #1e293b;
}

[data-theme="dark"] .gov-doc-table td,
[data-theme="dark"] .gov-doc-table td {
  border-color: #1e293b;
  color: #f8fafc;
}

[data-theme="dark"] .gov-doc-sign-line,
[data-theme="dark"] .gov-doc-sign-line {
  border-color: #cbd5e1;
}

/* Responsividade Mobile/Tablet */
@media (max-width: 1200px) {
  .gov-caixas-deck {
    grid-template-columns: repeat(3, 1fr);
  }
  .gov-breakdown-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .gov-caixas-deck {
    grid-template-columns: 1fr;
  }
  .gov-breakdown-row {
    grid-template-columns: 1fr;
  }
  .gov-soc-duo-grid {
    grid-template-columns: 1fr;
  }
  .gov-stepper-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ==========================================================================
   FASE 1 — HOTFIXES DE AUDITORIA (12/09/2026)
   Correções cirúrgicas de apresentação identificadas na auditoria de UI/UX.
   Nenhuma regra de negócio, id ou chamada de API foi alterada aqui — só CSS
   (e, no admin.js, só o nome da classe/badge injetada, nunca a lógica).
   ========================================================================== */

/* --- 1) --input-bg nunca era declarada -----------------------------------
   Os campos de Pix/boleto (admin.html) referenciam var(--input-bg, #fff) e
   caíam sempre no fallback branco, em qualquer tema. Alias para --surface —
   o mesmo token que os inputs gerais (.form-group input) já usam
   corretamente nos dois temas — resolve os dois casos de uma vez, sem
   precisar de uma entrada separada em [data-theme="dark"] (o token se
   resolve pela cascata de --surface no uso, mesmo padrão já usado por
   --border-color/--bg-card/--bg-main em :root). */
:root { --input-bg: var(--surface); }

/* --- 2) .badge-status ------------------------------------------------------
   Usada por renderCredenciaisTable (admin.js) para o selo de status da
   credencial, mas nunca existiu no CSS — o dado de segurança mais crítico
   da tabela renderizava sem cor nenhuma. Usa os tokens --status-* já
   declarados em :root / [data-theme="dark"]. */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-status.ativa {
  background: rgba(16, 185, 129, 0.14);
  color: var(--status-ativa);
  border-color: rgba(16, 185, 129, 0.35);
}
.badge-status.treinamento {
  background: rgba(245, 158, 11, 0.16);
  color: var(--status-treinamento);
  border-color: rgba(245, 158, 11, 0.4);
}
.badge-status.inativa {
  background: rgba(239, 68, 68, 0.14);
  color: var(--status-inativa);
  border-color: rgba(239, 68, 68, 0.35);
}
.badge-status.extravio {
  background: rgba(153, 27, 27, 0.16);
  color: var(--status-extravio);
  border-color: rgba(153, 27, 27, 0.45);
}
[data-theme="dark"] .badge-status.ativa       { background: rgba(16, 185, 129, 0.18); }
[data-theme="dark"] .badge-status.treinamento { background: rgba(245, 158, 11, 0.20); }
[data-theme="dark"] .badge-status.inativa     { background: rgba(239, 68, 68, 0.18); }
[data-theme="dark"] .badge-status.extravio    { background: rgba(153, 27, 27, 0.22); color: #fca5a5; }

/* --- 3) .badge-secondary — nunca tinha cor em nenhuma combinação ----------
   Usada em várias tabelas de Governança (Tabela-Mestra, Repasses "Janela",
   CDB, Marketing) e agora também no fallback de getBadgeStatusDeliberacao
   (ver admin.js). Fica neutra/cinza — nunca falsamente verde. */
.badge.badge-secondary,
.side-badge.badge-secondary,
.gov-caixa-badge.badge-secondary {
  background: var(--surface-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
[data-theme="dark"] .badge.badge-secondary,
[data-theme="dark"] .side-badge.badge-secondary,
[data-theme="dark"] .gov-caixa-badge.badge-secondary {
  background: var(--surface-hover);
  color: var(--text-muted);
  border-color: var(--border);
}

/* --- 4) Kanban de Tarefas — cores das 4 colunas ---------------------------
   col-hdr-pendente/andamento/revisao/concluida já existiam no HTML
   (admin.html) mas nunca tiveram regra CSS — as 4 colunas eram
   visualmente idênticas exceto pelo texto. */
.col-hdr-pendente {
  background: rgba(100, 116, 139, 0.10);
  border-bottom-color: rgba(100, 116, 139, 0.35) !important;
}
.col-hdr-andamento {
  background: rgba(245, 158, 11, 0.10);
  border-bottom-color: rgba(245, 158, 11, 0.35) !important;
}
.col-hdr-revisao {
  background: rgba(37, 99, 235, 0.10);
  border-bottom-color: rgba(37, 99, 235, 0.35) !important;
}
.col-hdr-concluida {
  background: rgba(22, 163, 74, 0.10);
  border-bottom-color: rgba(22, 163, 74, 0.35) !important;
}
[data-theme="dark"] .col-hdr-pendente  { background: rgba(148, 163, 184, 0.12); }
[data-theme="dark"] .col-hdr-andamento { background: rgba(245, 158, 11, 0.16); }
[data-theme="dark"] .col-hdr-revisao   { background: rgba(96, 165, 250, 0.16); }
[data-theme="dark"] .col-hdr-concluida { background: rgba(52, 211, 153, 0.16); }

/* --- 5) .modal-content — base completa no modo claro ----------------------
   Os 10 modais do módulo de Governança Financeira usam .modal-content em vez
   de .modal-box. O par escuro já existia (combinado com .modal-box, linha
   ~4401) mas o modo claro nunca teve NENHUMA regra — sem fundo, borda,
   largura, layout flex ou sombra. Espelha .modal-box exatamente (mesmos
   valores), só trocando a cor fixa #fff pelo token --surface. Modais
   específicos que já sobrescrevem max-width via style inline (ex.:
   modalNovoRepasse, 750px) continuam funcionando normalmente. */
.modal-content {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  animation: modalIn 0.25s ease-out;
}

/* ==========================================================================
   FASE 2 — HOTFIXES DE AUDITORIA (12/09/2026)
   Continuação da Fase 1. Só correções de bugs reais (contraste/tema quebrado,
   classes já usadas no HTML/JS sem nenhuma regra CSS, cores hardcoded que
   ignoram data-theme). Nenhuma regra de negócio, id ou chamada de API foi
   alterada — no admin.js, só o nome da classe/badge injetada.
   ========================================================================== */

/* --- A) .badge-pago/.badge-pendente/.badge-cancelado sem par escuro -------
   Afeta todas as tabelas de Contas a Pagar/Receber, DRE e Notas Fiscais —
   os badges de status mais usados do Financeiro ficavam brancos/creme
   "acesos" sobre o card escuro. */
[data-theme="dark"] .badge-pago {
  background: rgba(52, 211, 153, 0.14);
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.35);
}
[data-theme="dark"] .badge-pendente {
  background: rgba(251, 191, 36, 0.14);
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.35);
}

/* --- B) .dre-regime-btn — não existia nenhuma regra --------------------- */
.dre-regime-btn {
  background: var(--surface-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.dre-regime-btn.active {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}
[data-theme="dark"] .dre-regime-btn.active {
  background: var(--gold);
  color: var(--navy-dark);
  border-color: var(--gold);
}

/* --- C) .gov-caixa-badge.badge-gold / .badge-primary --------------------
   Badges "Societário" (Caixa 5) e "Caixa 2" (Pró-Labore) e o badge dinâmico
   "Aporte Liberado" do Caixa 4 (admin.js) renderizavam sem cor nenhuma. */
.gov-caixa-badge.badge-gold {
  background: rgba(176, 152, 116, 0.15);
  color: var(--gold);
  border: 1px solid rgba(176, 152, 116, 0.35);
}
.gov-caixa-badge.badge-primary {
  background: var(--accent-soft, rgba(15, 118, 110, 0.12));
  color: var(--accent, #0f766e);
  border: 1px solid var(--accent, #0f766e);
}
[data-theme="dark"] .gov-caixa-badge.badge-gold {
  background: rgba(212, 175, 55, 0.16);
  color: var(--gold);
  border-color: rgba(212, 175, 55, 0.35);
}

/* --- D) Extrato Banco Inter — badges de conciliação ----------------------
   "Sugestão p/ conferir" era inline (indigo fixo, sem par dark) e "Ignorado"
   não tinha cor nenhuma — justo o status que mais precisa de atenção manual. */
.badge-sugestao {
  background: var(--accent-soft, rgba(15, 118, 110, 0.12));
  color: var(--accent, #0f766e);
  border: 1px solid var(--accent, #0f766e);
}

/* --- E) Mini-KPIs do Banco Inter ------------------------------------------
   Eram style="color:#hex" inline direto no HTML — o par dark existente não
   tinha !important e nunca vencia o inline. Convertidos para classes já
   theme-aware (os tokens usados já têm par dark oficial). */
.stat-title.stat-c-info,    .stat-val.stat-c-info    { color: var(--info); }
.stat-title.stat-c-success, .stat-val.stat-c-success { color: var(--success); }
.stat-title.stat-c-gold,    .stat-val.stat-c-gold    { color: var(--gold); }
.stat-title.stat-c-accent,  .stat-val.stat-c-accent  { color: var(--accent, #0f766e); }
.stat-title.stat-c-warning, .stat-val.stat-c-warning { color: var(--warning); }

/* --- F) Cofre GED · Acessos & Sigilo — sem nenhuma regra base ------------
   .panel-card/.table-wrap não tinham fundo/borda/padding nenhum; em modo
   escuro ficavam ilegíveis (texto solto sobre o fundo da página). */
.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .panel-card { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); }
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
/* .badge-cargo-pill é usada tanto na categoria do Cofre GED quanto no cargo
   de Usuários (RBAC) — tinha regra clara (#f1f5f9/#334155) mas nenhum par
   escuro; corrige as duas telas de uma vez. */
[data-theme="dark"] .badge-cargo-pill {
  background: var(--surface-hover);
  color: var(--text-secondary, var(--text-muted));
  border-color: var(--border);
}

/* --- G) Modais — visualizadores de iframe e demonstrativo ----------------
   modalViewDocumento e modalVisualizarCertidao (dois viewers que fazem a
   mesma coisa) tinham fundos hardcoded opostos (#0b192c vs #fff) — um
   padrão único para os dois. printDemonstrativoArea era sempre "folha
   branca" mesmo fora da impressão; agora só fica branco no @media print. */
.modal-body.modal-body-iframe-wrap {
  flex: 1;
  padding: 0;
  overflow: hidden;
  background: var(--navy-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}
#printDemonstrativoArea .dem-row-header {
  background: var(--surface-hover) !important;
  color: var(--text-main);
}
#printDemonstrativoArea .dem-row-danger {
  color: var(--danger) !important;
}
#printDemonstrativoArea .dem-row-total {
  background: var(--surface-hover) !important;
  color: var(--success) !important;
}
@media print {
  #printDemonstrativoArea,
  #printDemonstrativoArea .dem-row-header,
  #printDemonstrativoArea .dem-row-total {
    background: #ffffff !important;
    color: #1e293b !important;
  }
  #printDemonstrativoArea .dem-row-danger { color: #dc2626 !important; }
  #printDemonstrativoArea th,
  #printDemonstrativoArea td { border-color: #cbd5e1 !important; }
}

/* --- H) Preview de comissão + alerta de sigilo (gatekeeper LGPD) ---------
   Os dois eram 100% inline, cores fixas pensadas só para fundo claro. O
   modalTermoSigilo é visto por 100% dos usuários no 1º acesso. */
:root {
  --info-box-bg: #fdfaf3; --info-box-border: #ebd9c0; --info-box-text: #475569;
  --warning-box-bg: #fffbeb; --warning-box-border: #fef3c7;
  --warning-box-text-strong: #92400e; --warning-box-text: #b45309;
}
[data-theme="dark"] {
  --info-box-bg: rgba(212, 175, 55, 0.08); --info-box-border: rgba(212, 175, 55, 0.25); --info-box-text: var(--text-muted);
  --warning-box-bg: rgba(245, 158, 11, 0.12); --warning-box-border: rgba(245, 158, 11, 0.3);
  --warning-box-text-strong: #fbbf24; --warning-box-text: #fde68a;
}
.kk-preview-box {
  background: var(--info-box-bg);
  border: 1px solid var(--info-box-border);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: var(--info-box-text);
}
.termo-alert-box {
  background: var(--warning-box-bg);
  border: 1px solid var(--warning-box-border);
  border-left: 4px solid var(--warning);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.termo-alert-box strong { color: var(--warning-box-text-strong); }
.termo-alert-box p, .termo-alert-box span { color: var(--warning-box-text); }
.termo-header-accent {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color: #ffffff;
  border-bottom: 2px solid var(--gold);
}

/* --- I) Assinador — banner de aviso legal --------------------------------- */
.ass-legal-banner {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  background: var(--accent-soft, rgba(37, 99, 235, 0.08));
  border-left: 3px solid var(--info);
  padding: 8px 12px;
  border-radius: 4px;
}

/* --- J) CRM Imóveis Vista — miniatura consistente + placeholder ---------- */
.imv-thumb {
  width: 44px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 8px;
  background: var(--surface-hover);
  display: inline-block;
}
.imv-thumb--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  border: 1px dashed var(--border);
}

/* --- K) Barra de status/filtros do CRM Imóveis Vista ---------------------
   Fundo já era theme-aware, mas o texto era hardcoded (#475569/#64748b) —
   no escuro caía para ~2.3:1 de contraste, abaixo do mínimo WCAG AA. */
.vista-status-linha {
  margin: 10px 0;
  padding: 10px 12px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- L) Carteira de Clientes ----------------------------------------------
   Grid "Qualidade da carteira" era 100% inline. O sinal de "lead parado"
   (rgba(220,38,38,.05) na linha inteira) é crítico para o negócio e ficava
   praticamente invisível sobre o fundo escuro — mesma opacidade calibrada
   só para fundo claro. */
.carteira-qualidade-tile {
  background: var(--bg-main, var(--bg-admin));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 12px;
  text-align: center;
  transition: border-color .15s ease;
}
:root {
  --danger-row-bg: rgba(220, 38, 38, 0.05); --danger-box-bg: rgba(220, 38, 38, 0.08);
  --danger-box-border: rgba(220, 38, 38, 0.4); --warning-box-bg-2: rgba(217, 119, 6, 0.08);
}
[data-theme="dark"] {
  --danger-row-bg: rgba(248, 113, 113, 0.16); --danger-box-bg: rgba(248, 113, 113, 0.14);
  --danger-box-border: rgba(248, 113, 113, 0.5); --warning-box-bg-2: rgba(251, 191, 36, 0.14);
}
.carteira-box-escalonamento {
  background: var(--danger-box-bg);
  border: 1px solid var(--danger-box-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.carteira-box-triagem {
  background: var(--warning-box-bg-2);
  border: 1px solid var(--danger-box-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

/* --- M) Calendário / Agenda -----------------------------------------------
   O outline do dia selecionado usava #d4af37 (gold do tema ESCURO) fora de
   qualquer escopo [data-theme="dark"] — aparecia errado no modo claro. */
.cal-day-cell.is-selected {
  background: rgba(176, 152, 116, 0.16) !important;
  outline: 2px solid var(--gold);
  z-index: 2;
}
.dot-confirmada { background: var(--info); }

/* --- N) Pódio / Ranking — pontuação hardcoded no gold do tema claro ------ */
.podium-points { color: var(--gold); }
[data-theme="dark"] .podium-points { color: var(--gold); text-shadow: 0 0 12px rgba(212, 175, 55, 0.25); }

/* --- O) Chat interno — bolhas absurdamente largas em telas grandes ------- */
.chat-msg-row { max-width: min(80%, 560px) !important; }

/* --- P) Central de Chamados — cor de prioridade abaixo do WCAG AA --------
   #2563eb (azul do tema claro) direto como texto sobre --surface escuro
   calculava ~3.3:1 de contraste, abaixo do mínimo AA (4.5:1). */
.badge-prio-texto.prio-critica { color: var(--danger) !important; }
.badge-prio-texto.prio-alta    { color: var(--warning) !important; }
.badge-prio-texto.prio-media   { color: var(--info) !important; }
.badge-prio-texto.prio-baixa   { color: var(--text-muted) !important; }

/* --- Q) RBAC / Usuários — status Ativo/Desativado ------------------------
   Era style="color:#059669/#dc2626" inline, fixo mesmo em [data-theme="dark"]. */
.badge-user-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.badge-user-status.on  { background: rgba(22, 163, 74, 0.14); color: var(--success); }
.badge-user-status.off { background: rgba(220, 38, 38, 0.14); color: var(--danger); }
[data-theme="dark"] .badge-user-status.on  { background: rgba(52, 211, 153, 0.16); }
[data-theme="dark"] .badge-user-status.off { background: rgba(248, 113, 113, 0.16); }
/* O elemento real (renderUsuariosTable) usa a classe .badge-2fa pura, sem
   modificador .on/.off — é essa que precisa do par escuro, não a combinação. */
[data-theme="dark"] .badge-2fa {
  background: rgba(52, 211, 153, 0.16);
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.35);
}
[data-theme="dark"] .avatar-placeholder-mini {
  background: var(--surface-hover);
  color: var(--text-main);
  border: 1px solid var(--border);
}

/* --- R) Sidebar — regra escura antiga sempre vencia por especificidade,
   o gradiente "v2" planejado (--kk2-side-bg) nunca chegava a aplicar. */
[data-theme="dark"] .sidebar { background: var(--kk2-side-bg, #09111e); }

/* --- S) Grid de KPIs da Home — cor do ícone era style inline sem par dark */
:root {
  --kpi-blue-bg: rgba(37, 99, 235, 0.12);  --kpi-blue-fg: var(--info);
  --kpi-green-bg: rgba(22, 163, 74, 0.12); --kpi-green-fg: var(--success);
  --kpi-amber-bg: rgba(217, 119, 6, 0.14); --kpi-amber-fg: var(--warning);
  --kpi-red-bg: rgba(220, 38, 38, 0.14);   --kpi-red-fg: var(--danger);
  --kpi-teal-bg: var(--accent-soft, rgba(15, 118, 110, 0.12)); --kpi-teal-fg: var(--accent, #0f766e);
}
[data-theme="dark"] {
  --kpi-blue-bg: rgba(96, 165, 250, 0.16);
  --kpi-green-bg: rgba(52, 211, 153, 0.16);
  --kpi-amber-bg: rgba(251, 191, 36, 0.18);
  --kpi-red-bg: rgba(248, 113, 113, 0.18);
}
.kpi-icon-wrap.kpi-ico-blue  { background: var(--kpi-blue-bg);  color: var(--kpi-blue-fg); }
.kpi-icon-wrap.kpi-ico-green { background: var(--kpi-green-bg); color: var(--kpi-green-fg); }
.kpi-icon-wrap.kpi-ico-amber { background: var(--kpi-amber-bg); color: var(--kpi-amber-fg); }
.kpi-icon-wrap.kpi-ico-red   { background: var(--kpi-red-bg);   color: var(--kpi-red-fg); }
.kpi-icon-wrap.kpi-ico-teal  { background: var(--kpi-teal-bg);  color: var(--kpi-teal-fg); }

/* --- T) Modal — botão de fechar (✕) com estilo default do navegador ------
   Completa o hotfix de .modal-content da Fase 1: sem isto, o X dos 10
   modais de Governança ficava cinza/com borda em cima do header navy. */
.modal-close-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .15s ease, color .15s ease;
}
.modal-close-btn:hover { background: rgba(255, 255, 255, 0.12); color: var(--danger); }

/* --- V) Governança — cabeçalho/rodapé dos 10 modais nunca tiveram CSS -----
   .modal-title-group/.modal-icon/.modal-title/.modal-subtitle (cabeçalho) e
   .btn-cancel (rodapé) eram usados só nesses 10 modais e não tinham nenhuma
   regra — o cabeçalho caía como texto solto em vez do layout ícone+título
   pretendido, e o botão Cancelar ficava sem forma nenhuma de botão.
   .modal-header é sempre navy/texto branco (ver regra base), por isso o
   título/subtítulo aqui usam branco fixo em vez de var(--text-main). */
.modal-title-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.modal-icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.modal-title { margin: 0; font-family: 'Outfit', sans-serif; font-size: 1.1rem; color: #ffffff; }
.modal-subtitle { margin: 2px 0 0; font-size: 0.78rem; color: rgba(255, 255, 255, 0.72); }

.btn-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0 18px;
  height: 38px;
  border-radius: var(--btn-radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--btn-transition);
}
.btn-cancel:hover { background: var(--surface-hover); }

/* --- W) Assistente em passos do cadastro de imóvel (Meus Imóveis) ------- */
.imovel-wizard-dot {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-main, #f1f5f9);
  color: var(--text-muted);
  white-space: nowrap;
}
.imovel-wizard-dot.concluido { background: rgba(16, 185, 129, 0.14); color: #10b981; }
.imovel-wizard-dot.ativo { background: var(--gold, #d4af37); color: #1a1a1a; }

/* --- X) Picker de mapa (Leaflet) para latitude/longitude ---------------- */
.leaflet-container { font-family: inherit; }

/* --- Y) Resíduo de framework não usado no projeto (Bootstrap), mas ainda
   referenciado em alguns pontos do HTML — utilitárias mínimas, sem trazer o
   framework inteiro só por essas duas classes. */
.text-center { text-align: center; }

/* --- U) Tabelas — cabeçalho fixo genérico + resgate de .patch-table -------
   Sticky existia em só 1 de ~34 tabelas. .patch-table (extrato financeiro,
   resumo semanal, lançamentos previstos) não tinha NENHUMA regra própria —
   reproduzia o bug de cabeçalho quase-branco-sobre-branco já corrigido em
   .table-container. */
.table-container thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-hover);
  box-shadow: 0 1px 0 var(--border);
}
.patch-table th {
  background: var(--surface-hover) !important;
  color: var(--text-muted);
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 3;
}

/* --- V) Logs de Erro de Automações — cor crua ignorando o tema -----------
   O card de erro mais importante da tela (borda + fundo do <pre>) usava
   hex fixo e um token --bg-color inexistente, sempre igual nos dois temas. */
.autolog-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border-left: 4px solid var(--text-faint, var(--text-muted));
}
.autolog-erro-box {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 6px 0;
  font-size: 0.8rem;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-main);
}
.autolog-resumo-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--surface);
  min-width: 120px;
  border-left: 4px solid var(--text-faint, var(--text-muted));
}

/* --- X) .badge-cargo-pill com override inline (Recorrências/Fornecedores) */
.badge-cargo-pill.badge-cargo-sistema { background: var(--surface-hover); }
.badge-cargo-pill.badge-cargo-personalizado { background: rgba(217, 119, 6, 0.16); color: var(--warning); }
[data-theme="dark"] .badge-cargo-pill.badge-cargo-sistema { background: var(--surface-hover); }
[data-theme="dark"] .badge-cargo-pill.badge-cargo-personalizado { background: rgba(251, 191, 36, 0.18); color: var(--warning); }

/* ==========================================================================
   FASE 3 — MELHORIAS FUNCIONAIS (12/09/2026)
   Itens que a auditoria sugeriu mas mudam comportamento (ordenação, filtro,
   paginação) em vez de só corrigir apresentação. Nenhuma chamada de API foi
   criada/alterada — tudo roda sobre dados já carregados no navegador.
   ========================================================================== */

/* Paginação client-side (Credenciais e Auditoria) */
.kk-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.kk-pagination button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.8rem;
}
.kk-pagination button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.kk-pagination button:disabled { opacity: .4; cursor: not-allowed; }

.audit-date-range input[type="date"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-main);
  font-size: 0.82rem;
}

.perm-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft, rgba(15, 118, 110, 0.12));
  color: var(--accent, #0f766e);
  white-space: nowrap;
}

/* "Últimos vistos" na Central de Ajuda */
.manual-seletor-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all .15s ease;
}
.manual-seletor-btn:hover { background: var(--surface-hover); border-color: var(--gold, #b09874); }
.manual-seletor-btn.active {
  background: linear-gradient(90deg, rgba(176, 152, 116, .18), rgba(176, 152, 116, .05));
  border-color: var(--gold, #b09874);
  color: var(--gold, #b09874);
}

.manual-atalho-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  background: var(--surface-hover);
}
.manual-atalho-item:hover { color: var(--gold); background: rgba(176, 152, 116, 0.12); }
[data-theme="dark"] .manual-atalho-item:hover { background: rgba(212, 175, 55, 0.14); }

/* ==========================================================================
   TEMA CLARO GLOBAL: CORREÇÃO COMPLETA DE ELEMENTOS ESCUROS RESIDUAIS
   Garante consistência luminosa em modo claro para Sidebar, Hero, Modais e FAB.
   ========================================================================== */

/* 1. SIDEBAR EM MODO CLARO */
[data-theme="light"] .sidebar,
:root:not([data-theme="dark"]) .sidebar {
  background: #ffffff !important;
  border-right: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
  box-shadow: 1px 0 10px rgba(15, 23, 42, 0.04) !important;
}

[data-theme="light"] .sidebar-header,
:root:not([data-theme="dark"]) .sidebar-header {
  border-bottom: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
}

[data-theme="light"] .brand-name,
:root:not([data-theme="dark"]) .brand-name {
  color: #0f172a !important;
}

[data-theme="light"] .brand-sub,
:root:not([data-theme="dark"]) .brand-sub {
  color: #b45309 !important;
}

[data-theme="light"] .sidebar-toggle-btn,
:root:not([data-theme="dark"]) .sidebar-toggle-btn {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

[data-theme="light"] .sidebar-toggle-btn:hover,
:root:not([data-theme="dark"]) .sidebar-toggle-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] .sidebar-section-title,
:root:not([data-theme="dark"]) .sidebar-section-title {
  color: #64748b !important;
}

[data-theme="light"] .side-categoria-chevron,
:root:not([data-theme="dark"]) .side-categoria-chevron {
  color: #94a3b8 !important;
}

[data-theme="light"] .side-nav-btn,
[data-theme="light"] .sidebar-sub-item,
:root:not([data-theme="dark"]) .side-nav-btn,
:root:not([data-theme="dark"]) .sidebar-sub-item {
  color: #334155 !important;
}

[data-theme="light"] .side-nav-btn:hover,
[data-theme="light"] .sidebar-sub-item:hover,
:root:not([data-theme="dark"]) .side-nav-btn:hover,
:root:not([data-theme="dark"]) .sidebar-sub-item:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="light"] .side-nav-btn.active,
[data-theme="light"] .sidebar-sub-item.active,
:root:not([data-theme="dark"]) .side-nav-btn.active,
:root:not([data-theme="dark"]) .sidebar-sub-item.active {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.16), rgba(212, 175, 55, 0.04)) !important;
  color: #0f172a !important;
  font-weight: 600 !important;
  box-shadow: inset 3px 0 0 #d4af37 !important;
}

[data-theme="light"] .sidebar-atalhos-rapidos,
:root:not([data-theme="dark"]) .sidebar-atalhos-rapidos {
  display: none !important;
  border-bottom: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
}

[data-theme="light"] .atalho-rapido-btn,
:root:not([data-theme="dark"]) .atalho-rapido-btn {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
}

[data-theme="light"] .atalho-rapido-btn:hover,
:root:not([data-theme="dark"]) .atalho-rapido-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] .sidebar-footer,
:root:not([data-theme="dark"]) .sidebar-footer {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .user-name,
:root:not([data-theme="dark"]) .user-name {
  color: #0f172a !important;
}

[data-theme="light"] .user-role,
:root:not([data-theme="dark"]) .user-role {
  color: #64748b !important;
}

[data-theme="light"] .user-config-icon,
:root:not([data-theme="dark"]) .user-config-icon {
  color: #64748b !important;
}

[data-theme="light"] .user-profile-widget:hover,
:root:not([data-theme="dark"]) .user-profile-widget:hover {
  background: #eef2f6 !important;
}

/* 2. COCKPIT HERO BANNER EM MODO CLARO */
[data-theme="light"] .welcome-hero-card,
:root:not([data-theme="dark"]) .welcome-hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1px solid rgba(212, 175, 55, 0.28) !important;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  color: #0f172a !important;
}

[data-theme="light"] .welcome-pill,
:root:not([data-theme="dark"]) .welcome-pill {
  background: rgba(212, 175, 55, 0.12) !important;
  border: 1px solid rgba(212, 175, 55, 0.35) !important;
  color: #92400e !important;
}

[data-theme="light"] .welcome-greeting,
:root:not([data-theme="dark"]) .welcome-greeting {
  color: #0f172a !important;
}

[data-theme="light"] .welcome-sub,
:root:not([data-theme="dark"]) .welcome-sub {
  color: #475569 !important;
}

[data-theme="light"] .btn-hero-action,
:root:not([data-theme="dark"]) .btn-hero-action {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .btn-hero-action:hover,
:root:not([data-theme="dark"]) .btn-hero-action:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

[data-theme="light"] .btn-hero-action.btn-hero-gold,
:root:not([data-theme="dark"]) .btn-hero-action.btn-hero-gold {
  background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
  color: #78350f !important;
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
}

/* 3. BOTÃO FLUTUANTE KIARA EM MODO CLARO */
[data-theme="light"] .copiloto-fab,
:root:not([data-theme="dark"]) .copiloto-fab {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
  color: #0f172a !important;
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.16) !important;
}

[data-theme="light"] .copiloto-fab-label,
:root:not([data-theme="dark"]) .copiloto-fab-label {
  color: #0f172a !important;
}

/* 4. META COLETIVA EM MODO CLARO */
[data-theme="light"] .meta-coletiva-card,
:root:not([data-theme="dark"]) .meta-coletiva-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1px solid rgba(212, 175, 55, 0.28) !important;
  color: #0f172a !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06) !important;
}

[data-theme="light"] .meta-coletiva-card *,
:root:not([data-theme="dark"]) .meta-coletiva-card * {
  color: #0f172a;
}

[data-theme="light"] .meta-coletiva-card .meta-sub,
:root:not([data-theme="dark"]) .meta-coletiva-card .meta-sub {
  color: #64748b;
}

/* 5. CARDS DE ATENDIMENTO E AUDITORIA EM MODO CLARO */
[data-theme="light"] .atd-card-dark,
:root:not([data-theme="dark"]) .atd-card-dark {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .atd-card-dark .atd-sec-title,
:root:not([data-theme="dark"]) .atd-card-dark .atd-sec-title {
  color: #64748b !important;
}

[data-theme="light"] .audit-mod-navy,
:root:not([data-theme="dark"]) .audit-mod-navy {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

/* 6. MODAIS DO PAINEL EM MODO CLARO & ESCURO (Substitutos de confirm/prompt/alert) */
[data-theme="light"] .modal-box--confirm,
:root:not([data-theme="dark"]) .modal-box--confirm {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.22) !important;
}

/* O cabeçalho dos modais é SEMPRE navy com texto branco (regra base do ERP),
   garantindo contraste nítido em 100% dos temas e evitando texto da mesma cor da barra */
[data-theme="light"] .modal-box--confirm .modal-header,
:root:not([data-theme="dark"]) .modal-box--confirm .modal-header {
  background: #142e4f !important;
  color: #ffffff !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
}

[data-theme="light"] .modal-box--confirm .modal-header h3,
:root:not([data-theme="dark"]) .modal-box--confirm .modal-header h3,
[data-theme="light"] .modal-box--confirm .modal-header h3 span,
:root:not([data-theme="dark"]) .modal-box--confirm .modal-header h3 span {
  color: #ffffff !important;
}

[data-theme="light"] .modal-box--confirm .modal-header .modal-close,
:root:not([data-theme="dark"]) .modal-box--confirm .modal-header .modal-close {
  color: #ffffff !important;
}

[data-theme="light"] .modal-box--confirm .modal-footer,
:root:not([data-theme="dark"]) .modal-box--confirm .modal-footer {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .modal-box--confirm .confirm-painel-msg,
:root:not([data-theme="dark"]) .modal-box--confirm .confirm-painel-msg {
  color: #1e293b !important;
}

[data-theme="light"] .modal-box--confirm .modal-footer .btn-secondary,
:root:not([data-theme="dark"]) .modal-box--confirm .modal-footer .btn-secondary {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .modal-box--confirm .modal-footer .btn-secondary:hover,
:root:not([data-theme="dark"]) .modal-box--confirm .modal-footer .btn-secondary:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

[data-theme="light"] .modal-box--confirm .form-control,
:root:not([data-theme="dark"]) .modal-box--confirm .form-control {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid #cbd5e1 !important;
}

[data-theme="light"] .modal-box--confirm .form-control:focus,
:root:not([data-theme="dark"]) .modal-box--confirm .form-control:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(176, 152, 116, 0.2) !important;
}

/* Modais de confirmação em Modo Escuro */
[data-theme="dark"] .modal-box--confirm {
  background: #0e1726 !important;
  color: #f8fafc !important;
  border: 1px solid #223249 !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .modal-box--confirm .modal-header {
  background: #0b192c !important;
  color: #ffffff !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .modal-box--confirm .modal-header h3,
[data-theme="dark"] .modal-box--confirm .modal-header h3 span {
  color: #ffffff !important;
}

[data-theme="dark"] .modal-box--confirm .modal-header .modal-close {
  color: #ffffff !important;
}

[data-theme="dark"] .modal-box--confirm .modal-footer {
  background: #0b1422 !important;
  border-top: 1px solid #1e293b !important;
}

[data-theme="dark"] .modal-box--confirm .confirm-painel-msg {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .modal-box--confirm .modal-footer .btn-secondary {
  background: #18263e !important;
  color: #e2e8f0 !important;
  border: 1px solid #2d4160 !important;
}

[data-theme="dark"] .modal-box--confirm .modal-footer .btn-secondary:hover {
  background: #223452 !important;
  color: #ffffff !important;
  border-color: #3e587e !important;
}

[data-theme="dark"] .modal-box--confirm .form-control {
  background: #142033 !important;
  color: #f8fafc !important;
  border: 1.5px solid #273852 !important;
}

[data-theme="dark"] .modal-box--confirm .form-control:focus {
  border-color: #d4af37 !important;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25) !important;
}

/* --- Novos Recursos: Cofre, Transmissão, Chat WhatsApp & Google Agenda --- */
@keyframes rotatingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.rotating-spin {
  display: inline-block !important;
  animation: rotatingSpin 0.9s linear infinite !important;
}

#modalPreviewMidiaChat .modal-box {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

#transmissaoProgressoBarra {
  transition: width 0.3s ease;
}


/* ==========================================================================
   ATUALIZAÇÃO v5.2 - INTERFACE, TABS TAREFAS, VISITAS & RESPONSIVIDADE MOBILE
   ========================================================================== */

/* 1. Tabs individuais: Kanban / Grade Horária / Lista */
.tarefas-tabs-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--surface-subtle, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 18px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

[data-theme="dark"] .tarefas-tabs-nav {
  background: rgba(255, 255, 255, 0.04);
  border-color: #273852;
}

.tarefas-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tarefas-tab-btn:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .tarefas-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.tarefas-tab-btn.active {
  background: var(--bg-card, #ffffff);
  color: var(--primary, #1e40af);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

[data-theme="dark"] .tarefas-tab-btn.active {
  background: #1e293b;
  color: #38bdf8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tarefas-tab-btn .tab-icon {
  font-size: 1.05rem;
}

/* 4. Responsividade Geral Mobile (Eliminação de cortes e sobreposições) */
@media (max-width: 900px) {
  .cockpit-split-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .tarefas-tabs-nav {
    width: 100% !important;
    justify-content: flex-start !important;
  }

  .modal-box {
    max-width: 95vw !important;
    max-height: 92vh !important;
    margin: 10px auto !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
  }

  .table-container {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .tab-header, .dash-header, .filter-bar {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  .topbar {
    padding: 0 12px !important;
  }
}

@media (max-width: 600px) {
  .tarefas-tab-btn {
    padding: 7px 12px !important;
    font-size: 0.8rem !important;
  }

}

.chat-mencao-badge {
  position: absolute !important;
  top: -5px !important;
  right: -5px !important;
  background: #ef4444 !important;
  color: #ffffff !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  min-width: 17px !important;
  height: 17px !important;
  border-radius: 9px !important;
  padding: 0 4px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 2px solid #0f172a !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) !important;
  pointer-events: none !important;
  animation: pulseBadgeChat 1.8s infinite ease-in-out !important;
  z-index: 10 !important;
}

@keyframes pulseBadgeChat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.btn-novo-chat.is-active {
  background: #f59e0b !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5) !important;
  outline: 2px solid #fbbf24 !important;
}

@keyframes balancarSino {
  0%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(-12deg); }
  20%, 40% { transform: rotate(12deg); }
  50% { transform: rotate(0); }
}

.chat-msg-highlight {
  animation: highlightMentionRow 3.5s ease-out forwards !important;
  border-radius: 8px !important;
}

@keyframes highlightMentionRow {
  0% {
    background-color: rgba(245, 158, 11, 0.35) !important;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.6) !important;
  }
  70% {
    background-color: rgba(245, 158, 11, 0.15) !important;
  }
  100% {
    background-color: transparent !important;
  }
}


/* ===================================================================== */
/* SUB-NAVEGAÇÃO HORIZONTAL (Financeiro, Agenda, Tarefas)                */
/* ===================================================================== */
.fin-subnav-container,
.agenda-subnav-container,
.tarefas-subnav-container {
  display: flex;
  overflow-x: auto;
  padding: 4px 2px 14px 2px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.fin-subnav-pills,
.agenda-subnav-pills,
.tarefas-subnav-pills {
  display: inline-flex;
  align-items: center;
  background: var(--bg-hover, #e2e8f0);
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
  white-space: nowrap;
}

[data-theme="dark"] .fin-subnav-pills,
[data-theme="dark"] .agenda-subnav-pills,
[data-theme="dark"] .tarefas-subnav-pills {
  background: #09111e;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.fin-subnav-pills .subnav-pill,
.agenda-subnav-pills .subnav-pill,
.tarefas-subnav-pills .subnav-pill {
  border: none;
  background: transparent;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.fin-subnav-pills .subnav-pill:hover,
.agenda-subnav-pills .subnav-pill:hover,
.tarefas-subnav-pills .subnav-pill:hover {
  color: var(--text-main, #0f172a);
}

.fin-subnav-pills .subnav-pill.active,
.agenda-subnav-pills .subnav-pill.active,
.tarefas-subnav-pills .subnav-pill.active {
  background: #ffffff;
  color: #142e4f;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .fin-subnav-pills .subnav-pill,
[data-theme="dark"] .agenda-subnav-pills .subnav-pill,
[data-theme="dark"] .tarefas-subnav-pills .subnav-pill {
  color: #94a3b8;
}

[data-theme="dark"] .fin-subnav-pills .subnav-pill:hover,
[data-theme="dark"] .agenda-subnav-pills .subnav-pill:hover,
[data-theme="dark"] .tarefas-subnav-pills .subnav-pill:hover {
  color: #f1f5f9;
}

[data-theme="dark"] .fin-subnav-pills .subnav-pill.active,
[data-theme="dark"] .agenda-subnav-pills .subnav-pill.active,
[data-theme="dark"] .tarefas-subnav-pills .subnav-pill.active {
  background: #152238;
  color: #d4af37;
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.subnav-counter {
  display: inline-block;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.15);
  color: #ef4444;
}

.subnav-counter:empty,
.subnav-counter[data-count="0"] {
  display: none !important;
}

/* Ocultar badges estáticos de 0 quando vazios */
.side-badge:empty,
.sub-item-badge:empty {
  display: none !important;
}


/* --- Estilos: Botão e Badge Google Agenda por Usuário --- */
.btn-google-connect {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: rgba(66, 133, 244, 0.12) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(66, 133, 244, 0.35) !important;
  font-weight: 500 !important;
  font-size: 0.82rem !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}
.btn-google-connect:hover {
  background: rgba(66, 133, 244, 0.24) !important;
  border-color: #60a5fa !important;
  transform: translateY(-1px);
}
.google-badge-connected {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: rgba(34, 197, 94, 0.12) !important;
  border: 1px solid rgba(34, 197, 94, 0.35) !important;
  border-radius: 20px !important;
  padding: 5px 12px !important;
  font-size: 0.8rem !important;
  color: #4ade80 !important;
}
.google-badge-email {
  font-weight: 600 !important;
  max-width: 160px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.google-badge-btn {
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  padding: 0 4px !important;
  font-size: 0.82rem !important;
  color: inherit !important;
  opacity: 0.85 !important;
  transition: opacity 0.15s !important;
}
.google-badge-btn:hover {
  opacity: 1 !important;
}
.pulse-dot-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

/* ==========================================================================
   DESTAQUE DA CATEGORIA SELECIONADA NA SIDEBAR (KK UI v2)
   ========================================================================== */
.sidebar-section-title {
  transition: color 0.2s ease, text-shadow 0.2s ease, opacity 0.2s ease;
}

.sidebar-section-title:hover {
  color: rgba(255, 255, 255, 0.88) !important;
}
.sidebar-section-title:hover .side-categoria-chevron {
  color: rgba(255, 255, 255, 0.85) !important;
}

.sidebar-section-title.categoria-ativa {
  color: #ffffff !important;
  font-weight: 800 !important;
  letter-spacing: 0.14em !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.45);
}

.sidebar-section-title.categoria-ativa .side-categoria-chevron {
  color: #ffffff !important;
  opacity: 1 !important;
}

.sidebar-section-title.categoria-ativa::after {
  background: rgba(255, 255, 255, 0.35) !important;
}

[data-theme="light"] .sidebar-section-title.categoria-ativa,
:root:not([data-theme="dark"]) .sidebar-section-title.categoria-ativa {
  color: #0f172a !important;
  font-weight: 800 !important;
  text-shadow: none !important;
}

[data-theme="light"] .sidebar-section-title.categoria-ativa .side-categoria-chevron,
:root:not([data-theme="dark"]) .sidebar-section-title.categoria-ativa .side-categoria-chevron {
  color: #0f172a !important;
}

[data-theme="light"] .sidebar-section-title.categoria-ativa::after,
:root:not([data-theme="dark"]) .sidebar-section-title.categoria-ativa::after {
  background: #94a3b8 !important;
}

/* ==========================================================================
   CENTRAL DE CHAMADOS — KANBAN & CARDS ESTILO ITIBAN (KK UI v2)
   ========================================================================== */
.chamados-kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 14px;
  overflow-x: auto;
  align-items: flex-start;
  padding-bottom: 20px;
}
@media (max-width: 1200px) {
  .chamados-kanban-board {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}
@media (max-width: 700px) {
  .chamados-kanban-board {
    grid-template-columns: 1fr;
  }
}

.chamado-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 480px;
  transition: all 0.2s ease;
}
.chamado-col.drag-over {
  background: rgba(212, 175, 55, 0.08) !important;
  border: 2px dashed var(--gold, #d4af37) !important;
  transform: scale(1.01);
}
.chamado-col-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.chamado-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
}
.chamado-col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 200px;
}

/* Card do Chamado */
.chamado-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: grab;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  user-select: none;
}
.chamado-card:active {
  cursor: grabbing;
}
.chamado-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  border-color: var(--gold, #d4af37);
}
[data-theme="dark"] .chamado-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .chamado-card:hover {
  border-color: var(--gold, #d4af37);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

/* Prioridades no Cartão */
.chamado-card.prio-critica { border-left: 4px solid #ef4444 !important; }
.chamado-card.prio-alta    { border-left: 4px solid #f97316 !important; }
.chamado-card.prio-media   { border-left: 4px solid #3b82f6 !important; }
.chamado-card.prio-baixa   { border-left: 4px solid #64748b !important; }

/* SLA Badges */
.chamado-sla-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chamado-sla-badge.vencido {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.chamado-sla-badge.alerta {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.chamado-sla-badge.ok {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.chamado-sla-badge.concluido {
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
}

/* Categoria Tag */
.cham-cat-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
}
/* T-0134 (volta 1): selo "IA pausada - assumida por X ate dd/mm hh:mm" da conversa do atendimento.
   Computador: a pilula quebra linha e o prazo fica em linha propria (nada cortado no painel estreito).
   Celular (ate 900 px): barra no topo da conversa com o selo e o botao de devolver (44 px). */
.atd-banner .kk-pill { white-space: normal; max-width: 100%; align-items: flex-start; text-align: left; line-height: 1.35; padding-top: 4px; padding-bottom: 4px; border-radius: 12px; }
.atd-banner .kk-pill .kk-pill-dot { margin-top: 5px; flex: none; }
.atd-banner .atd-pausa-txt { display: block; min-width: 0; overflow-wrap: anywhere; }
.atd-banner .atd-pausa-ate { display: block; font-weight: 600; }
.atd-barra-pausa { display: none; }
@media (max-width: 900px) {
  .atd-barra-pausa.is-ativa { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin: 8px 12px 0; border: 1px solid var(--kk-warn); background: var(--kk-warn-bg); border-radius: 9px; font-size: .8rem; }
  .atd-barra-txt { flex: 1 1 180px; min-width: 0; line-height: 1.4; color: var(--text-main); overflow-wrap: anywhere; }
  .atd-barra-txt .atd-pausa-ate { font-weight: 600; white-space: nowrap; }
  .atd-barra-btn { min-height: 44px; min-width: 44px; padding: 0 14px; flex: 0 0 auto; }
}

[data-theme="light"] .cham-cat-tag {
  background: #f1f5f9;
  color: #475569;
}

/* T-0263: barra do topo, pill do WhatsApp do cartao da visita e botoes de variaveis da transmissao no celular.
   Computador (acima de 900 px): a barra do topo nao muda; so o pill deixa de ser cortado quando o cartao e estreito.
   Ate 900 px: botoes do topo com 44 px de toque. Ate 640 px: barra em duas linhas (menu e caminho; botoes so com icone). */
.visita-info-val .btn-whatsapp-pill { max-width: 100%; box-sizing: border-box; flex-wrap: wrap; justify-content: center; white-space: normal !important; }
.visita-info-item:has(.btn-whatsapp-pill) { container-type: inline-size; }
.visita-info-item:has(.btn-whatsapp-pill) .visita-info-val { white-space: normal; }
@container (max-width: 170px) { .visita-info-val .btn-whatsapp-pill > span:first-child { display: none; } }
.top-btn-perfil, .top-btn-logout { gap: 3px; }
.tx-var-linha { flex-wrap: wrap; row-gap: 6px; }
.tx-var-botoes { flex-wrap: wrap; row-gap: 6px; }
@media (max-width: 900px) {
  .top-btn-theme, .top-btn-2fa, .top-btn-perfil, .top-btn-logout, .top-btn-notif { height: auto; min-height: 44px; min-width: 44px; justify-content: center; }
  .mobile-menu-btn { min-width: 44px; min-height: 44px; }
  .tx-var-botoes .btn-icon { min-height: 44px; }
}
@media (max-width: 640px) {
  .topbar { height: auto; flex-wrap: wrap; align-content: center; row-gap: 6px; padding: 6px 12px !important; }
  .topbar-left { flex: 1 1 100%; min-width: 0; gap: 8px; }
  .topbar-left .breadcrumb { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
  .topbar-right { flex: 1 1 100%; justify-content: space-between; gap: 8px; }
  .topbar-right .topbar-time { margin-right: auto; }
  .top-btn-theme .top-btn-txt, .top-btn-perfil .top-btn-txt, .top-btn-logout .top-btn-txt, .top-btn-2fa .top-btn-txt, .top-btn-2fa > span + span { display: none; }
  .top-btn-theme, .top-btn-2fa, .top-btn-perfil, .top-btn-logout { padding: 6px 10px; font-size: 1rem; }
  .visita-info-item:has(.btn-whatsapp-pill) { grid-column: 1 / -1; }
}

/* T-0268: no celular o botao flutuante da Kiara vira so o avatar (48 px) no canto e a tela reserva o espaco dele embaixo:
   a caixa de resposta/Enviar da conversa e o "Acoes da visita" do cartao deixam de ficar por baixo dele.
   Computador (acima de 900 px): sem mudanca. O botao continua abrindo a mesma janela da Kiara. */
@media (max-width: 900px) {
  .copiloto-fab { bottom: 12px !important; right: 12px !important; width: 48px !important; height: 48px !important; min-width: 48px !important; padding: 0 !important; gap: 0 !important; justify-content: center !important; border-radius: 50% !important; }
  .copiloto-fab .copiloto-fab-label { display: none; }
  .copiloto-fab .copiloto-fab-pulse { position: absolute; top: 3px; right: 3px; }
  .content-body { padding-bottom: 88px; }
  .atd-layout { height: calc(100vh - 200px - 72px); }
}
@media (max-width: 640px) {
  .atd-layout { height: calc(100vh - 251px - 72px); }
}

/* T-0138: cartao da visita (agenda): ponto de encontro, selo "presenca confirmada" e botao. Tudo quebra linha, nada corta;
   no celular (ate 900 px) campo com 16 px (sem zoom do iOS) e toque de 44 px. */
.visita-presenca-bloco { display: flex; flex-direction: column; gap: 6px; margin: 0 0 10px; min-width: 0; }
.visita-presenca-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.visita-presenca-input { flex: 1 1 160px; min-width: 0; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-main); font-size: 0.82rem; }
.visita-presenca-btn { flex: 0 0 auto; }
.visita-presenca-selo { display: inline-flex; align-items: center; max-width: 100%; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.visita-presenca-selo.ok { background: rgba(5, 150, 105, 0.12); color: #047857; border: 1px solid rgba(5, 150, 105, 0.35); }
.visita-presenca-selo.aguardando { background: rgba(217, 119, 6, 0.12); color: #92400e; border: 1px solid rgba(217, 119, 6, 0.35); }
@media (max-width: 900px) {
  .visita-presenca-input { min-height: 44px; font-size: 16px; flex: 1 1 100%; }
  .visita-presenca-btn { min-height: 44px; min-width: 44px; }
}

/* T-0245 volta 3 (so visual, Afrodite P-AF245T): (1) botoes "Executar a troca" e "Negar" do pedido de troca legiveis nos dois temas
   (fundo e texto do mesmo token, contraste medido nos testes >= 4,5:1); (2) a linha de acoes da lista da Carteira quebra em mais de uma
   linha em vez de passar do cartao (celular) ou da tela (1366). Vale so para a lista da Carteira (#carteiraTbody) e para estes botoes. */
:root {
  --pedido-troca-ok-bg: #ecfdf5;   --pedido-troca-ok-fg: #065f46;   --pedido-troca-ok-borda: #059669;
  --pedido-troca-no-bg: #fef2f2;   --pedido-troca-no-fg: #991b1b;   --pedido-troca-no-borda: #dc2626;
}
[data-theme="dark"] {
  --pedido-troca-ok-bg: #064e3b;   --pedido-troca-ok-fg: #d1fae5;   --pedido-troca-ok-borda: #34d399;
  --pedido-troca-no-bg: #7f1d1d;   --pedido-troca-no-fg: #fee2e2;   --pedido-troca-no-borda: #f87171;
}
.btn-pedido-troca {
  min-height: 44px; padding: 8px 14px; border: 1px solid transparent; border-radius: var(--btn-radius-sm, 8px);
  font-size: 0.85rem; font-weight: 700; line-height: 1.2; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-pedido-troca--executar { background: var(--pedido-troca-ok-bg); color: var(--pedido-troca-ok-fg); border-color: var(--pedido-troca-ok-borda); }
.btn-pedido-troca--negar { background: var(--pedido-troca-no-bg); color: var(--pedido-troca-no-fg); border-color: var(--pedido-troca-no-borda); }
#carteiraTbody .table-actions { flex-wrap: wrap; }
@media (min-width: 769px) and (max-width: 1599px) {   /* computador pequeno (1366): em varias linhas dentro da coluna */
  #carteiraTbody .table-actions { max-width: 250px; }
}
@media (min-width: 1600px) {   /* tela grande: uma fila so, igual a antes */
  #carteiraTbody .table-actions { flex-wrap: nowrap; }
}

/* T-0408: tabela de boletos Inter vira cartao no celular (ate 700 px) com data-label e botoes de 44 px;
   no computador (1366) coluna Acoes visivel sem rolar a tabela (position: sticky a direita e quebra de colunas largas).
   Em 1920 continua como hoje. */

/* Computador (>= 701 px): coluna Acoes fixa a direita para visualizacao imediata no 1366 sem rolar */
@media (min-width: 701px) {
  .tabela-boletos-inter {
    position: relative;
    box-sizing: border-box;
  }
  .tabela-boletos-inter th:last-child,
  .tabela-boletos-inter td:last-child:not([colspan]) {
    position: sticky;
    right: 0;
    box-shadow: -3px 0 6px -2px rgba(0, 0, 0, 0.08);
  }
  .tabela-boletos-inter thead th:last-child {
    z-index: 4;
    background: var(--surface-hover);
  }
  .tabela-boletos-inter tbody td:last-child:not([colspan]) {
    z-index: 2;
    background: var(--surface, #ffffff);
  }
  .tabela-boletos-inter tbody tr:nth-child(even) td:last-child:not([colspan]) {
    background: color-mix(in srgb, var(--surface-hover) 55%, var(--surface, #ffffff));
  }
  .tabela-boletos-inter tbody tr:hover td:last-child:not([colspan]) {
    background: var(--surface-hover);
  }
  .tabela-boletos-inter tbody tr:nth-child(even):hover td:last-child:not([colspan]) {
    background: var(--surface-hover);
  }

  [data-theme="dark"] .tabela-boletos-inter th:last-child,
  [data-theme="dark"] .tabela-boletos-inter td:last-child:not([colspan]) {
    box-shadow: -3px 0 6px -2px rgba(0, 0, 0, 0.45);
  }
  [data-theme="dark"] .tabela-boletos-inter thead th:last-child {
    background: var(--surface-hover, #1f1f1f);
  }
  [data-theme="dark"] .tabela-boletos-inter tbody td:last-child:not([colspan]) {
    background: var(--surface, #151515);
  }
  [data-theme="dark"] .tabela-boletos-inter tbody tr:nth-child(even) td:last-child:not([colspan]) {
    background: color-mix(in srgb, var(--surface-hover) 55%, var(--surface, #151515));
  }
  [data-theme="dark"] .tabela-boletos-inter tbody tr:hover td:last-child:not([colspan]) {
    background: var(--surface-hover, #1f1f1f);
  }
  [data-theme="dark"] .tabela-boletos-inter tbody tr:nth-child(even):hover td:last-child:not([colspan]) {
    background: var(--surface-hover, #1f1f1f);
  }

  /* T-0408 volta 1 (obs Poseidon): celula de lista vazia / carregamento nao recebe sticky nem sombra lateral */
  .tabela-boletos-inter td[colspan] {
    position: static !important;
    box-shadow: none !important;
  }
}

@media (min-width: 701px) and (max-width: 1599px) {
  /* T-0408 volta 1/2/3: colunas otimizadas para 1036 px sem rolagem interna, títulos sem corte e valores com respiro */
  .tabela-boletos-inter {
    table-layout: auto;
    width: 100%;
  }
  .tabela-boletos-inter th,
  .tabela-boletos-inter td {
    padding: 7px 5px;
    font-size: 0.82rem;
    box-sizing: border-box;
  }
  /* Volta 3 (Iris P-IR408U): títulos do cabeçalho quebram entre palavras (duas linhas), sem corte e sem quebrar no meio da palavra */
  .tabela-boletos-inter th {
    font-size: 0.70rem;
    line-height: 1.2;
    vertical-align: bottom;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  /* Coluna 1: Nosso Número */
  .tabela-boletos-inter th:nth-child(1) {
    width: 90px;
    max-width: 100px;
  }
  .tabela-boletos-inter td:nth-child(1) {
    white-space: nowrap;
    width: 90px;
    max-width: 100px;
  }

  /* Coluna 2: Locatário (Inquilino) - largura mínima 140px, quebra só entre palavras */
  .tabela-boletos-inter th:nth-child(2),
  .tabela-boletos-inter td:nth-child(2) {
    min-width: 140px;
    max-width: 155px;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
  }

  /* Coluna 3: Imóvel / Locador - largura mínima 130px, quebra só entre palavras */
  .tabela-boletos-inter th:nth-child(3),
  .tabela-boletos-inter td:nth-child(3) {
    min-width: 130px;
    max-width: 145px;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
  }

  /* Coluna 4: Vencimento - padding 8-12px (Iris P-IR408U) */
  .tabela-boletos-inter th:nth-child(4) {
    width: 88px;
    max-width: 95px;
    padding: 7px 10px;
  }
  .tabela-boletos-inter td:nth-child(4) {
    white-space: nowrap;
    width: 88px;
    max-width: 95px;
    padding: 7px 10px;
  }

  /* Coluna 5: Valor Total - padding 8-12px para não encostar nas vizinhas (Iris P-IR408U) */
  .tabela-boletos-inter th:nth-child(5) {
    width: 95px;
    max-width: 105px;
    padding: 7px 10px;
  }
  .tabela-boletos-inter td:nth-child(5) {
    white-space: nowrap;
    width: 95px;
    max-width: 105px;
    padding: 7px 10px;
  }

  /* Coluna 6: Taxa Adm (10%) - padding 8-12px e contraste aprimorado (Iris P-IR408U) */
  .tabela-boletos-inter th:nth-child(6) {
    width: 92px;
    max-width: 102px;
    padding: 7px 10px;
  }
  .tabela-boletos-inter td:nth-child(6) {
    white-space: nowrap;
    width: 92px;
    max-width: 102px;
    padding: 7px 10px;
  }
  .tabela-boletos-inter td:nth-child(6) span {
    color: #8c6d3b;
  }
  [data-theme="dark"] .tabela-boletos-inter td:nth-child(6) span {
    color: #d4af37;
  }

  /* Coluna 7: Repasse Locador - padding 8-12px (Iris P-IR408U) */
  .tabela-boletos-inter th:nth-child(7) {
    width: 95px;
    max-width: 105px;
    padding: 7px 10px;
  }
  .tabela-boletos-inter td:nth-child(7) {
    white-space: nowrap;
    width: 95px;
    max-width: 105px;
    padding: 7px 10px;
  }

  /* Coluna 8: Status */
  .tabela-boletos-inter th:nth-child(8) {
    width: 88px;
    max-width: 95px;
    text-align: center;
  }
  .tabela-boletos-inter td:nth-child(8) {
    white-space: nowrap;
    width: 88px;
    max-width: 95px;
    text-align: center;
  }
  .tabela-boletos-inter td:nth-child(8) .badge {
    padding: 3px 6px;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  /* Coluna 9: Ações - mais estreita (175-185px) liberando espaço para as colunas numéricas, botões quebram em duas linhas (Iris P-IR408U) */
  .tabela-boletos-inter th:nth-child(9),
  .tabela-boletos-inter td:nth-child(9) {
    width: 175px;
    max-width: 185px;
  }
  .tabela-boletos-inter td:nth-child(9) {
    white-space: normal !important;
    padding: 6px 4px;
    text-align: center;
  }
  .tabela-boletos-inter td:nth-child(9) .btn-action-mini {
    padding: 2px 5px;
    font-size: 0.72rem;
    margin: 1px 1px;
    vertical-align: middle;
  }
  .tabela-boletos-inter td:nth-child(9) .btn-hist-registro {
    padding: 2px 4px;
    font-size: 0.74rem;
    margin: 1px 1px;
    vertical-align: middle;
  }
}

/* Celular (ate 700 px): cada boleto vira um cartao sem rolagem lateral; botoes com 44 px de altura */
@media (max-width: 700px) {
  .table-container:has(.tabela-boletos-inter) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow-x: visible !important;
  }

  .tabela-boletos-inter,
  .tabela-boletos-inter thead,
  .tabela-boletos-inter tbody,
  .tabela-boletos-inter tr,
  .tabela-boletos-inter td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .tabela-boletos-inter {
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }

  .tabela-boletos-inter thead {
    display: none !important;
  }

  .tabela-boletos-inter tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .tabela-boletos-inter tbody tr {
    display: flex !important;
    flex-direction: column !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    margin: 0 !important;
  }

  .tabela-boletos-inter tbody tr:hover td:first-child {
    box-shadow: none !important;
  }

  .tabela-boletos-inter tbody tr td,
  .tabela-boletos-inter tbody tr:nth-child(even) td,
  .tabela-boletos-inter tbody tr:hover td,
  .tabela-boletos-inter tbody tr:nth-child(even):hover td {
    background: transparent !important;
  }

  /* Linhas do cartao: rotulo data-label a esquerda, valor a direita */
  .tabela-boletos-inter tbody td {
    display: grid !important;
    grid-template-columns: minmax(110px, 140px) 1fr !important;
    align-items: center !important;
    column-gap: 12px !important;
    row-gap: 2px !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 40%, transparent) !important;
    font-size: 0.855rem !important;
    position: static !important;
    box-shadow: none !important;
    white-space: normal !important;
  }

  .tabela-boletos-inter tbody td[data-label]::before {
    content: attr(data-label);
    grid-column: 1 !important;
    grid-row: 1 / span 10 !important;
    align-self: center !important;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: left !important;
    line-height: 1.25;
  }

  .tabela-boletos-inter tbody td > * {
    grid-column: 2 !important;
    justify-self: end !important;
    text-align: right !important;
    max-width: 100% !important;
    word-break: break-word !important;
  }

  /* Coluna Acoes no cartao */
  .tabela-boletos-inter tbody td[data-label="Ações"] {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    border-bottom: none !important;
    padding-top: 12px !important;
    padding-bottom: 2px !important;
    margin-top: 4px !important;
    border-top: 1px dashed var(--border) !important;
  }

  .tabela-boletos-inter tbody td[data-label="Ações"]::before {
    display: block !important;
    width: 100% !important;
    margin-bottom: 2px !important;
    text-align: left !important;
  }

  .tabela-boletos-inter tbody td[data-label="Ações"] button {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    border-radius: var(--btn-radius-sm, 8px) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
  }

  .tabela-boletos-inter tbody td[data-label="Ações"] > button.btn-action-view,
  .tabela-boletos-inter tbody td[data-label="Ações"] > button.btn-action-pay {
    flex: 1 1 120px !important;
  }

  .tabela-boletos-inter tbody td[data-label="Ações"] > button.btn-hist-registro {
    flex: 0 0 44px !important;
    width: 44px !important;
  }

  .tabela-boletos-inter tbody td[data-label="Ações"] > div {
    flex: 1 1 100% !important;
    width: 100% !important;
    margin-top: 0 !important;
  }

  .tabela-boletos-inter tbody td[data-label="Ações"] > div > button {
    width: 100% !important;
  }

  /* Mensagem de lista vazia */
  .tabela-boletos-inter tbody td[colspan] {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    padding: 24px 12px !important;
    border-bottom: none !important;
  }
  .tabela-boletos-inter tbody td[colspan]::before {
    display: none !important;
  }
}

/* T-0410: modais do ERP no celular; computador preservado acima de 700 px. */
@media (max-width: 700px) {
  .modal-overlay {
    padding: 8px !important;
    box-sizing: border-box;
    align-items: stretch;
  }
  .modal-overlay .modal-box,
  .modal-overlay .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100vh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    margin: 0 !important;
    padding: 16px !important;
    min-width: 0;
    box-sizing: border-box;
    overflow-y: auto !important;
  }
  /* So caixas com miolo proprio delegam a rolagem ao modal-body. */
  .modal-overlay .modal-box:has(> .modal-body),
  .modal-overlay .modal-box:has(> form > .modal-body),
  .modal-overlay .modal-content:has(> .modal-body),
  .modal-overlay .modal-content:has(> form > .modal-body) {
    padding: 0 !important;
    overflow: hidden !important;
  }
  .modal-overlay input,
  .modal-overlay select,
  .modal-overlay textarea {
    font-size: 16px !important;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .modal-box button,
  .modal-overlay .modal-content button {
    min-height: 44px !important;
    min-width: 44px !important;
    height: auto !important;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    flex-shrink: 0;
  }
  .modal-box .modal-footer,
  .modal-overlay .modal-content .modal-footer {
    flex: none;
    flex-wrap: wrap;
  }
  .modal-box .modal-header,
  .modal-overlay .modal-content .modal-header {
    display: flex;
    flex: none;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 8px;
    padding: 8px 12px !important;
    min-height: 60px;
    box-sizing: border-box;
  }
  .modal-box .modal-header > div,
  .modal-box .modal-header > h3,
  .modal-overlay .modal-content .modal-header > div,
  .modal-overlay .modal-content .modal-header > h3 { flex: 1 1 auto; min-width: 0; }
  .modal-box .modal-header h3,
  .modal-overlay .modal-content .modal-header h3 {
    min-width: 0;
    flex: 1 1 auto;
    font-size: 16px !important;
    line-height: 22px;
    max-height: 44px;
    overflow-wrap: anywhere;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .modal-box .modal-header h3 > span,
  .modal-overlay .modal-content .modal-header h3 > span { display: inline; font-size: inherit; line-height: inherit; }
  .modal-box .modal-header .modal-close,
  .modal-overlay .modal-content .modal-header .modal-close,
  .modal-overlay .modal-content .modal-header .modal-close-btn {
    flex: 0 0 44px;
    width: 44px;
    height: 44px !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .modal-box .modal-body,
  .modal-overlay .modal-content .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-wrap: anywhere;
    overscroll-behavior: contain;
  }
  /* Volta 2: grades do contrato respeitam a largura disponivel. */
  #modalNovoContratoLocacao .modal-box > form,
  #modalNovoContratoLocacao .modal-content > form {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  #modalNovoContratoLocacao .modal-body [style*="grid-template-columns"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  #modalNovoContratoLocacao .modal-body div {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  #modalNovoContratoLocacao .modal-body input:not([type="checkbox"]):not([type="radio"]),
  #modalNovoContratoLocacao .modal-body select,
  #modalNovoContratoLocacao .modal-body textarea { width: 100%; }
  .modal-box .modal-footer > div,
  .modal-overlay .modal-content .modal-footer > div { flex-wrap: wrap; min-width: 0; max-width: 100%; }
  .modal-box .modal-footer button,
  .modal-overlay .modal-content .modal-footer button { min-width: 0; max-width: 100%; box-sizing: border-box; }
  /* Prompts e confirmacoes pequenos continuam com altura do conteudo. */
  #modalPromptPainel,
  #modalConfirmPainel { align-items: center; }
  #modalPromptPainel .modal-box,
  #modalConfirmPainel .modal-box,
  #modalPromptPainel .modal-content,
  #modalConfirmPainel .modal-content { height: auto !important; }
  /* Modal aberto por classe ou por display inline: a Kiara nao cobre as acoes. */
  body:has(.modal-overlay.active:not([style*="display: none"]):not([style*="display:none"])) #copilotoAiFab,
  body:has(.modal-overlay[style*="display: flex"]) #copilotoAiFab,
  body:has(.modal-overlay[style*="display:flex"]) #copilotoAiFab { display: none !important; }
  /* T-0414: selects com area de toque de 44 px e form dos modais equivalentes. */
  .modal-overlay select { min-height: 44px !important; }
  .modal-overlay .modal-content > form:has(> .modal-body) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  /* T-0414 volta 1: caixas pequenas seguem o conteudo; o Demonstrativo grande fica como antes. */
  .modal-overlay .modal-content:not(:has(> #printDemonstrativoArea)) {
    height: auto !important;
    min-height: auto !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    align-self: center;
  }
  /* O rotulo pode quebrar; o valor monetario e seu cabecalho ficam inteiros. */
  .modal-overlay #printDemonstrativoArea th:last-child,
  .modal-overlay #printDemonstrativoArea td:last-child {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    width: 1%;
  }
  .modal-overlay #printDemonstrativoArea td:first-child {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  /* T-0424: aviso e confirmacoes (.modal-box--confirm) com altura do conteudo no celular, centralizadas na vertical e max-height com rolagem interna se a mensagem for longa. */
  .modal-overlay .modal-box--confirm {
    height: auto !important;
    min-height: auto !important;
    max-height: calc(100vh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    align-self: center !important;
    margin: auto 0 !important;
  }
  .modal-overlay .modal-box--confirm .confirm-painel-msg {
    font-size: 16px !important;
  }
  .modal-overlay .modal-box--confirm button {
    min-height: 44px !important;
  }
  /* T-0434 volta curta: somente a lista de correcao da visita acompanha o conteudo. */
  #modalCorrecaoVisitaRanking .modal-box {
    height: auto !important;
    min-height: auto !important;
    max-height: calc(100vh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    align-self: center !important;
    margin: auto 0 !important;
  }
}

/* T-0426: acabamento restrito a condicoes de contrato e identidade. */
#formNovoContratoLocacao[data-contrato-id] input:disabled,
#formNovoContratoLocacao[data-contrato-id] select:disabled,
#formNovoContratoLocacao[data-contrato-id] textarea:disabled {
  opacity: .6;
  background-color: var(--bg-main);
  cursor: not-allowed;
}
#modalReautenticacao .modal-footer button {
  font-size: 16px;
}

/* T-0442: URI somente leitura inteira, inclusive no celular. */
#cfgGoogleRedirectUri {
  flex: 1 1 0%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-all;
  overflow: hidden;
  resize: none;
  line-height: 1.5;
}
/* T-0449: identidade compacta e ranking desligado na faixa intermediaria. */
@media (max-width: 768px) {
  #modalReautenticacao {
    align-items: center !important;
    padding: 8px !important;
  }
  #modalReautenticacao > .modal-box {
    height: auto !important;
    min-height: auto !important;
    max-height: calc(100vh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    max-width: 440px !important;
    min-width: 0;
    padding: 0 !important;
    align-self: center !important;
    margin: auto 0 !important;
    overflow: hidden !important;
  }
  #modalReautenticacao .modal-box > form {
    flex: 0 1 auto;
    min-height: 0;
  }
  #modalReautenticacao .modal-body {
    flex: 0 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow-y: auto !important;
  }
  #modalReautenticacao .modal-footer button {
    min-height: 44px !important;
    height: auto !important;
    max-width: 100%;
    white-space: normal;
  }
}
@media (min-width: 769px) and (max-width: 1100px) {
  #rankingTabela.ranking-sem-competicao {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }
  #rankingTabela.ranking-sem-competicao > thead > tr > th {
    padding: 10px 2px;
    box-sizing: border-box;
    font-size: 0.7rem;
    letter-spacing: 0;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
  }
  #rankingTabela.ranking-sem-competicao > tbody > tr > td {
    padding: 10px 2px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #rankingTabela.ranking-sem-competicao > thead > tr > th:nth-child(2) { width: 16%; }
  #rankingTabela.ranking-sem-competicao > thead > tr > th:nth-child(3),
  #rankingTabela.ranking-sem-competicao > thead > tr > th:nth-child(10) { width: 12%; }
  #rankingTabela.ranking-sem-competicao > thead > tr > th:nth-child(4) { width: 8%; }
  #rankingTabela.ranking-sem-competicao > thead > tr > th:nth-child(5) { width: 7%; }
  #rankingTabela.ranking-sem-competicao > thead > tr > th:nth-child(6) { width: 11%; }
  #rankingTabela.ranking-sem-competicao > thead > tr > th:nth-child(7),
  #rankingTabela.ranking-sem-competicao > thead > tr > th:nth-child(9) { width: 10%; }
  #rankingTabela.ranking-sem-competicao > thead > tr > th:nth-child(8) { width: 14%; }
  #rankingTabela.ranking-sem-competicao .ranking-valor,
  #rankingTabela.ranking-sem-competicao .badge-role {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #rankingTabela.ranking-sem-competicao .badge-role { padding: 3px 4px; }
  #rankingTabela.ranking-sem-competicao .btn-action-edit {
    display: inline-block;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    height: auto;
    padding: 6px 2px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
/* Fim T-0449. */
/* T-0431: somente fila de cancelados e sua janela de decisao. */
.fila-cancelado-cartao {
  padding: 16px; min-width: 0; overflow-wrap: anywhere; white-space: normal;
  line-height: 1.5; background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 8px; margin: 12px 0;
}
.fila-cancelado-cabecalho { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.fila-cancelado-cabecalho h4 { margin: 0; min-width: 0; }
.fila-cancelado-cabecalho .badge { flex-shrink: 0; }
.fila-cancelado-dados { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 16px 0; }
.fila-cancelado-dados dt { font-weight: 600; }
.fila-cancelado-dados dd { margin: 0; }
#modalDecisaoCanceladoLocacao .modal-box { box-sizing: border-box; width: min(600px, calc(100vw - 32px)); min-width: 0; max-height: 90dvh; overflow-y: auto; }
#modalDecisaoCanceladoLocacao .form-group { margin-top: 20px; }
#modalDecisaoCanceladoLocacao label { display: block; margin-bottom: 8px; }
#modalDecisaoCanceladoLocacao select,
#modalDecisaoCanceladoLocacao input,
#modalDecisaoCanceladoLocacao textarea { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; }
#modalDecisaoCanceladoLocacao .fila-cancelado-destino-descricao { margin: 8px 0 0; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .fila-cancelado-dados { grid-template-columns: minmax(0, 1fr); }
  #modalDecisaoCanceladoLocacao .modal-body { padding: 16px; }
  #modalDecisaoCanceladoLocacao select { padding-left: 8px; padding-right: 24px; }
  #modalDecisaoCanceladoLocacao .modal-footer button { min-height: 44px; max-width: 100%; white-space: normal; }
}

/* T-0463: faturas de locacao em cartoes no celular */
@media (max-width: 768px) {
  .table-container:has(#locacoesFaturasTbody) {
    min-width: 0;
    max-width: 100%;
  }
  table:has(> #locacoesFaturasTbody) {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }
  table:has(> #locacoesFaturasTbody) > thead { display: none; }
  #locacoesFaturasTbody {
    display: grid;
    width: 100%;
    min-width: 0;
    gap: 12px;
    padding: 12px;
    box-sizing: border-box;
  }
  #locacoesFaturasTbody > tr {
    display: block;
    min-width: 0;
    max-width: 100%;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
  }
  #locacoesFaturasTbody > tr > td {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 0;
    white-space: normal !important;
    overflow-wrap: anywhere;
    text-align: left !important;
    background: transparent !important;
    box-shadow: none !important;
    border-bottom: 1px solid var(--border);
  }
  #locacoesFaturasTbody > tr > td:last-child { border-bottom: 0; }
  #locacoesFaturasTbody > tr > td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.4;
  }
  #locacoesFaturasTbody > tr > td > * {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #locacoesFaturasTbody > tr > td[data-label="Ações"] > div {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px !important;
    width: 100%;
  }
  #locacoesFaturasTbody .btn-action-mini {
    min-width: 44px;
    min-height: 44px;
    height: auto;
    box-sizing: border-box;
    justify-content: center;
    flex-shrink: 0;
  }
}
/* Fim T-0463. */

/* T-0464: ranking com competicao no computador */
@media (min-width: 769px) and (max-width: 1366px) {
  #rankingTabela:not(.ranking-sem-competicao) {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th {
    padding: 10px 2px;
    box-sizing: border-box;
    font-size: 0.7rem;
    letter-spacing: 0;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }
  #rankingTabela:not(.ranking-sem-competicao) > tbody > tr > td {
    padding: 10px 2px;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(1) { width: 7%; }
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(2) { width: 16%; }
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(3) { width: 12%; }
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(4) { width: 8%; }
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(5) { width: 7%; }
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(6) { width: 11%; }
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(7) { width: 10%; }
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(8) { width: 11%; }
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(9) { width: 10%; }
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(10) { width: 8%; }
  #rankingTabela:not(.ranking-sem-competicao) .ranking-valor,
  #rankingTabela:not(.ranking-sem-competicao) .badge-role {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #rankingTabela:not(.ranking-sem-competicao) .badge-role { padding: 3px 4px; }
  #rankingTabela:not(.ranking-sem-competicao) .btn-action-edit {
    display: inline-block;
    box-sizing: border-box;
    min-width: 44px;
    max-width: 100%;
    min-height: 44px;
    height: auto;
    padding: 6px 2px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
@media (min-width: 769px) and (max-width: 1200px) {
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th {
    font-size: 0.66rem;
    overflow-wrap: break-word;
  }
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(1) { width: 9%; }
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(2) { width: 13%; }
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(3) { width: 14%; }
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(4) { width: 6.5%; }
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(5) { width: 5.5%; }
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(8) { width: 13%; }
  #rankingTabela:not(.ranking-sem-competicao) > tbody > tr > td:nth-child(3),
  #rankingTabela:not(.ranking-sem-competicao) > tbody > tr > td:nth-child(3) .ranking-valor,
  #rankingTabela:not(.ranking-sem-competicao) > tbody > tr > td:nth-child(3) .badge-role {
    overflow-wrap: break-word;
    word-break: normal;
  }
}
/* Fim T-0464. */

/* T-0473 */
@media (min-width: 769px) and (max-width: 1200px) {
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(4),
  #rankingTabela:not(.ranking-sem-competicao) > thead > tr > th:nth-child(5) {
    padding-left: 0;
    padding-right: 0;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }
}
@media (max-width: 700px) {
  #modalFecharMesRanking .modal-box {
    height: auto !important;
    min-height: auto !important;
    max-height: calc(100vh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    align-self: center !important;
    margin: auto 0 !important;
  }
}
/* Fim T-0473. */

/* T-0470 */
.fila-cancelado-tabela { width: 100%; table-layout: fixed; margin: 16px 0; }
.fila-cancelado-tabela th, .fila-cancelado-tabela td {
  padding: 8px; vertical-align: top; text-align: left;
  white-space: normal; overflow-wrap: anywhere;
}
.fila-cancelado-tabela .fila-cancelado-rotulo { display: none; }
.fila-cancelado-alerta {
  margin: 12px 0; padding: 12px; border-left: 3px solid var(--warning);
  background: var(--bg-card); color: var(--text-main); overflow-wrap: anywhere;
}
@media (max-width: 768px) {
  .fila-cancelado-tabela, .fila-cancelado-tabela tbody, .fila-cancelado-tabela tr, .fila-cancelado-tabela td {
    display: block; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box;
  }
  .fila-cancelado-tabela thead { display: none; }
  .fila-cancelado-tabela td { padding: 8px 0; }
  .fila-cancelado-tabela .fila-cancelado-rotulo {
    display: block; font-weight: 600; color: var(--text-muted); margin-bottom: 4px;
  }
}
/* Fim T-0470 */

/* T-0474 */
@media (max-width: 768px) {
  #panelGovFechamento textarea[id^="govJustificativa_"],
  #govFechamentoMotivoExcecao,
  #fl375Motivo {
    font-size: 16px !important;
  }
  #rankingRegistrosWrap {
    overflow-x: visible !important;
    overflow-y: visible !important;
  }
  #rankingTabela, #rankingTabela tbody, #rankingTabela tr {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  #rankingTabela .ranking-valor {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
  }
  #rankingTabela td[data-label="Cargo / Função"],
  #rankingTabela td[data-label="Cargo / Função"] .ranking-valor,
  #rankingTabela td[data-label="Cargo / Função"] .badge-role {
    min-width: 0;
    max-width: 100%;
    white-space: normal !important;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: none;
    overflow: visible;
  }
  #rankingTabela .btn-action-edit {
    min-height: 44px !important;
    min-width: 44px;
    height: auto !important;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
  }
}
/* Fim T-0474. */


/* T-0244 volta 3: mensagens e rodape da comissao no padrao do ERP. */
#modalNewComissao #comCaptacaoAviso,
#modalNewComissao #comAutorizacaoAjuda,
#modalNewComissao #comPreviewAviso {
  display: block;
  font-family: var(--kk2-font-ui);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 8px 0 12px;
  overflow-wrap: anywhere;
}
#modalNewComissao #comErro {
  font-family: var(--kk2-font-ui);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--danger) !important;
  margin-top: 12px;
  margin-bottom: 16px !important;
  padding: 10px 12px;
  border: 1px solid var(--danger);
  border-left-width: 3px;
  border-radius: 8px;
  overflow-wrap: anywhere;
}
#modalNewComissao #comErro:empty { display: none; }
@media (max-width: 700px) {
  #modalNewComissao .modal-footer {
    justify-content: center;
    gap: 8px;
  }
  #modalNewComissao .modal-footer button {
    flex: 1 1 180px;
    min-width: 0;
    max-width: 100%;
  }
}
/* Fim T-0244 volta 3 visual. */

/* T-0479 */
@media (min-width: 1280px) {
  #viewLocacoesFaturas { min-width: 0; max-width: 100%; overflow: visible; }
  #viewLocacoesFaturas > table { width: 100%; min-width: 0; max-width: 100%; table-layout: fixed; }
  #viewLocacoesFaturas > table > thead > tr > th,
  #locacoesFaturasTbody > tr > td {
    box-sizing: border-box; min-width: 0; padding-left: 4px; padding-right: 4px;
    white-space: normal !important; overflow-wrap: break-word; word-break: normal; hyphens: none;
  }
  #viewLocacoesFaturas > table > thead > tr > th { letter-spacing: normal; overflow-wrap: normal; word-break: normal; padding-left: 0; padding-right: 0; }
  #viewLocacoesFaturas > table > thead > tr > th:nth-child(1) { width: 9.2%; }
  #viewLocacoesFaturas > table > thead > tr > th:nth-child(2) { width: 7%; }
  #viewLocacoesFaturas > table > thead > tr > th:nth-child(3) { width: 7.2%; }
  #viewLocacoesFaturas > table > thead > tr > th:nth-child(4) { width: 10.3%; }
  #viewLocacoesFaturas > table > thead > tr > th:nth-child(5) { width: 9.2%; }
  #viewLocacoesFaturas > table > thead > tr > th:nth-child(6) { width: 10.4%; }
  #viewLocacoesFaturas > table > thead > tr > th:nth-child(7) { width: 10.2%; }
  #viewLocacoesFaturas > table > thead > tr > th:nth-child(8) { width: 10%; }
  #viewLocacoesFaturas > table > thead > tr > th:nth-child(9) { width: 12.5%; }
  #viewLocacoesFaturas > table > thead > tr > th:nth-child(10) { width: 9.7%; }
  #viewLocacoesFaturas > table > thead > tr > th:nth-child(11) { width: 4.3%; }
  #locacoesFaturasTbody > tr > td:nth-child(5),
  #locacoesFaturasTbody > tr > td:nth-child(6),
  #locacoesFaturasTbody > tr > td:nth-child(7),
  #locacoesFaturasTbody > tr > td:nth-child(8) { overflow-wrap: normal; word-break: normal; }
  #viewLocacoesFaturas > table > thead > tr > th:nth-child(1),
  #locacoesFaturasTbody > tr > td:nth-child(1) { padding-left: 6px; }
  #locacoesFaturasTbody > tr > td:nth-child(11) { padding-left: 0; padding-right: 0; }
  #locacoesFaturasTbody > tr > td > div { min-width: 0; max-width: 100%; }
  #locacoesFaturasTbody > tr > td .badge { display: inline-block; max-width: 100%; box-sizing: border-box; padding-inline: 6px; white-space: nowrap; overflow-wrap: normal; }
  #locacoesFaturasTbody > tr > td[data-label="Ações"] > div { flex-wrap: wrap; max-width: 100%; }
}
@media (min-width: 1280px) and (max-width: 1365px) {
  #viewLocacoesFaturas > table > thead > tr > th { font-size: 0.64rem; }
  #locacoesFaturasTbody > tr > td { padding-left: 2px; padding-right: 2px; }
  #locacoesFaturasTbody > tr > td .badge { padding-inline: 3px; }
}
#listaCanceladosLocacao { padding-bottom: 112px; }
/* Fim T-0479. */

/* T-0480 */
@media (min-width: 769px) {
  #cfgGoogleRedirectUri {
    field-sizing: content;
    min-height: 44px;
  }
}
@media (max-width: 768px) {
  #modalReautenticacao .modal-footer button {
    flex: 1 1 0%;
    width: 0;
    min-width: 0;
    box-sizing: border-box;
    padding-inline: 12px;
    min-height: 44px !important;
  }
}
/* Fim T-0480. */

/* T-0506 - Atendimento: filtros Minhas/Sem responsavel, tiques, autores, nota privada e conversa reaberta. So classes atd-*. */
.atd-filtros { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.atd-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 5px 0 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-main); font: inherit; font-size: .72rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.atd-chip:hover { background: var(--surface-hover); }
.atd-chip.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--text-main); }
.atd-chip:focus-visible, .atd-rel-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.atd-chip-n { min-width: 16px; padding: 0 4px; border-radius: 999px; background: var(--surface-hover); color: var(--text-muted); font-size: .66rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.atd-chip.is-on .atd-chip-n { background: var(--accent); color: #fff; }
.atd-chip-n:empty { display: none; }
.atd-sem-resp { color: var(--kk-warn-fg); font-weight: 600; }
.atd-rel-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text-main); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.atd-rel-btn:hover { background: var(--surface-hover); }

/* tiques de envio: texto so para leitor de tela; o estado tambem muda de forma, nao so de cor */
.atd-tique-slot { display: inline-flex; vertical-align: -3px; margin-left: 4px; }
.atd-tique { display: inline-flex; align-items: center; line-height: 0; color: var(--text-muted); }
.atd-tique--lida { color: var(--info); }
.atd-tique--erro { color: var(--kk-crit); }
.atd-tique--pendente { opacity: .8; }
.atd-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.atd-bubble-hora { opacity: 1; color: var(--text-muted); } /* os tiques ficam dentro da hora: sem opacidade para continuarem legiveis no escuro */

/* autor da mensagem enviada */
.atd-autor-tag { display: inline-block; padding: 0 6px; border-radius: 999px; font-size: .6rem; font-weight: 700; line-height: 1.5; letter-spacing: .03em; }
.atd-autor-tag--kiara { background: var(--accent-soft); color: var(--text-main); border: 1px solid var(--accent); }
.atd-autor-tag--celular { background: var(--kk-warn-bg); color: var(--kk-warn-fg); border: 1px solid var(--kk-warn); }
.atd-bubble--celular { box-shadow: inset 3px 0 0 var(--kk-warn); }
.atd-banner.is-celular { border-style: dashed; }

/* nota privada: cartao em largura cheia, bem diferente de uma bolha ao cliente */
.atd-msg-wrap.nota { max-width: 100%; align-items: stretch; margin: 12px 0; }
.atd-nota { border: 1px dashed #d4a72c; border-left: 4px solid #d4a72c; border-radius: 10px; background: #fef9c3; color: #713f12; padding: 9px 12px 7px; }
:root:not([data-theme="light"]) .atd-nota { background: #3f3410; color: #fde68a; border-color: #a5802a; }
:root[data-theme="dark"] .atd-nota { background: #3f3410; color: #fde68a; border-color: #a5802a; }
.atd-nota-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; margin-bottom: 5px; }
.atd-nota-tit { font-size: .76rem; font-weight: 700; }
.atd-nota-sub { font-size: .66rem; opacity: .8; }
.atd-nota-corpo { font-size: .84rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.atd-nota-hora { margin-top: 4px; font-size: .62rem; opacity: .75; text-align: right; font-variant-numeric: tabular-nums; }

/* conversa reaberta: o historico anterior fica acima do separador */
.atd-reaberta { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; color: var(--text-muted); font-size: .68rem; font-weight: 600; text-align: center; }
.atd-reaberta::before, .atd-reaberta::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.atd-reaberta span { max-width: 80%; }

@media (max-width: 768px) {
  .atd-chip { min-height: 44px; padding: 0 14px; font-size: .84rem; }
  .atd-icon-btn, .atd-send-btn { min-width: 44px; width: 44px; min-height: 44px; height: 44px; }
  .atd-send-btn { width: auto; padding: 0 16px; }
  .atd-btn { min-height: 44px; }
  .atd-toolbar-select .status-select { min-height: 44px; font-size: 16px; }
  .atd-search, .atd-select, .atd-composer textarea { min-height: 44px; font-size: 16px; }
  /* campo de texto em linha propria; os botoes ficam a esquerda e deixam livre o canto direito do botao flutuante da Ita */
  .atd-composer-row { flex-wrap: wrap; }
  .atd-composer-row textarea { flex: 1 1 100%; order: -1; }
  .atd-rel-btn { min-height: 44px; }
  .atd-tique { transform: scale(1.1); }
  .atd-msg-wrap.nota { margin: 10px 0; }
}
/* Fim T-0506. */

/* T-0229: topbar do celular (ate 768 px) portada do painel, com as cores do marca.css.
   Ate 768 px: relogio escondido; tema, 2FA, perfil e sair vao para o painel do botao "⋯"; sino e "⋯" com 44 px;
   a barra fica numa linha so (menu, titulo da tela, sino e "⋯").
   Acima de 768 px nada muda: o "⋯" nem aparece. Faixa lateral de prioridade das notificacoes vale em qualquer largura. */
.notif-item.notif-importante { border-left-color: var(--kk-warn); }
.notif-item.notif-baixa { border-left-color: var(--kk-ok); }
.topbar-mais-wrap { display: none; }
.topbar-mais-tema-claro { display: none; }
[data-theme="dark"] .topbar-mais-tema-escuro { display: none; }
[data-theme="dark"] .topbar-mais-tema-claro { display: inline; }
@media (max-width: 768px) {
  .topbar { height: 56px !important; flex-wrap: nowrap; padding: 0 12px !important; overflow: visible; max-width: 100vw; box-sizing: border-box; }
  .topbar-left { flex: 1 1 auto; min-width: 0; gap: 8px; overflow: hidden; }
  .topbar-left .breadcrumb { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
  .breadcrumb > span:not(.bc-current), .breadcrumb > .bc-sep { display: none; }
  .bc-current { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; font-weight: 700; }
  .topbar-right { flex: 0 0 auto; justify-content: flex-end; gap: 8px; }
  #topbarClock,
  .topbar-right > .top-btn-theme,
  .topbar-right > .top-btn-2fa,
  .topbar-right > .top-btn-perfil,
  .topbar-right > .top-btn-logout { display: none; }
  .mobile-menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; flex-shrink: 0; }
  .top-btn-notif, .top-btn-mais {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; margin: 0; flex-shrink: 0; box-sizing: border-box;
  }
  .topbar-mais-wrap { position: relative; display: inline-flex; align-items: center; flex-shrink: 0; }
  .top-btn-mais {
    background: var(--surface-hover); border: 1px solid var(--border); border-radius: var(--kk2-r-sm);
    color: var(--text-main); font-size: 1.3rem; font-weight: 800; line-height: 1; cursor: pointer;
  }
  .top-btn-mais[aria-expanded="true"] { border-color: var(--gold); }
  .topbar-mais-painel {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 1000; min-width: 220px; max-width: calc(100vw - 24px);
    display: flex; flex-direction: column; padding: 6px 0; box-sizing: border-box; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--kk2-r-md); box-shadow: var(--kk2-sh-xl);
  }
  .topbar-mais-painel[hidden] { display: none; }
  .topbar-mais-item {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 16px; box-sizing: border-box;
    border: 0; background: transparent; color: var(--text-main); font: inherit; font-size: .92rem; font-weight: 600; text-align: left; cursor: pointer;
  }
  .topbar-mais-item:hover, .topbar-mais-item:focus-visible { background: var(--surface-hover); outline: none; box-shadow: inset 3px 0 0 var(--gold); }
  .topbar-mais-ico { width: 22px; flex-shrink: 0; text-align: center; font-size: 1.1rem; }
  .atd-toolbar-icons .atd-icon-btn { flex: none; min-width: 44px; min-height: 44px; }
  /* painel do sino preso a direita da barra (antes saia pela esquerda da tela) e com alvos de 44 px */
  .notif-wrap { position: static; }
  .notif-panel { position: absolute; top: 100%; left: auto; right: 8px; width: min(340px, calc(100vw - 16px)); max-height: calc(100dvh - 140px); }
  .notif-panel-head .btn-icon { min-width: 44px; min-height: 44px; }
  .notif-filtro-btn { min-height: 44px; padding: 4px 14px; font-size: .8rem; }
}
/* Fim T-0229. */

/* T-0725: painel do sino. No escuro (qualquer largura), pilulas do filtro com o dourado e o marinho do marca.css
   (a ativa era marinho sobre o fundo escuro e sumia). Ate 768 px, o X de marcar como lida e o "Marcar todas"
   com alvo de 44 px; o X fica visivel (no toque nao existe hover). Acima de 768 px no claro nada muda.
   Fica antes do bloco do T-0491 porque o teste dele le dali ate o fim do arquivo e nao aceita @media. */
[data-theme="dark"] .notif-filtro-btn { border-color: var(--kk2-navy-500); color: var(--text-muted); }
[data-theme="dark"] .notif-filtro-btn:hover { border-color: var(--gold); color: var(--text-main); }
[data-theme="dark"] .notif-filtro-btn.active { background: var(--gold); border-color: var(--gold); color: var(--kk2-navy-900); }
@media (max-width: 768px) {
  .notif-row:has(.notif-dismiss) .notif-item { min-height: 44px; padding-right: 52px; }
  .notif-dismiss { top: 0; right: 0; bottom: 0; width: 44px; height: auto; min-height: 44px; opacity: 1; font-size: .9rem; }
  .notif-item.notif-limpar { min-height: 44px; align-items: center; }
}
/* Fim T-0725. */

/* T-0224: o bloco MV2-A do tema.css forca display:flex/inline-block !important ate 900 px e mostrava o que o ERP
   esconde: itens do menu com style display none e o icone/rotulo do outro tema no painel "...". Sai quando o tema
   do ITIBAN respeitar o item escondido (ticket proprio) e for recopiado. */
@media (max-width: 900px) {
  .side-nav-btn[style*="display:none"], .side-nav-btn[style*="display: none"],
  .sidebar-section-title[style*="display:none"], .sidebar-section-title[style*="display: none"],
  :root:not([data-theme="dark"]) .topbar-mais-tema-claro,
  [data-theme="dark"] .topbar-mais-tema-escuro { display: none !important; }
  /* volta 1 (Afrodite A1/A2, Zeus 19:10): botao vazio nao vira vao de 44 px; o "..." aberto mantem a borda dourada */
  .side-nav-btn:empty { display: none !important; }
  .top-btn-mais[aria-expanded="true"] { border-color: var(--gold) !important; }
}
/* Fim T-0224. */

/* T-0491: formulario da comissao, autorizacao e gestao no padrao do ERP. */
#modalNewComissao .com-autorizacao-linha {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 44px;
  font-family: var(--kk2-font-ui);
  font-size: 0.85rem;
  line-height: 1.5;
}
#modalNewComissao #comAutorizacao {
  flex: 0 0 20px;
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  height: 20px !important;
  min-height: 20px !important;
  padding: 0 !important;
  margin: 0;
}
#modalNewComissao #comEditarCaptacao {
  display: block;
  font-family: var(--kk2-font-ui);
  line-height: 1.5;
}
#modalNewComissao #comEditarCaptacao > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-main);
}
#modalNewComissao #comEditarCaptacao > :not(summary) { margin-top: 8px; }
/* Fim T-0491. */

/* T-0931: Meus Imoveis e Catalogo VistaSoft viram cartao no celular; computador preservado acima de 700 px. */
@media (max-width: 700px) {
  .table-container:has(.tabela-imoveis-cartao) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow-x: visible !important;
  }
  .tabela-imoveis-cartao,
  .tabela-imoveis-cartao thead,
  .tabela-imoveis-cartao tbody,
  .tabela-imoveis-cartao tr,
  .tabela-imoveis-cartao td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .tabela-imoveis-cartao thead { display: none !important; }
  .tabela-imoveis-cartao tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
  .tabela-imoveis-cartao tbody tr {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    margin: 0 !important;
  }
  .tabela-imoveis-cartao tbody tr:hover td,
  .tabela-imoveis-cartao tbody tr:nth-child(even) td { background: transparent !important; }
  /* Rotulo (data-label) a esquerda, valor a direita; o miolo tem texto, <br> e botoes soltos, entao rotulo flutuante. */
  .tabela-imoveis-cartao tbody td {
    display: flow-root !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 40%, transparent) !important;
    font-size: 0.855rem !important;
    text-align: right !important;
    word-break: break-word !important;
    white-space: normal !important;
  }
  .tabela-imoveis-cartao tbody td[data-label]::before {
    content: attr(data-label);
    float: left;
    width: 38%;
    max-width: 140px;
    margin-right: 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: left;
    line-height: 1.25;
  }
  .tabela-imoveis-cartao tbody td img.imv-thumb { max-width: 100%; }
  /* Acoes / Documentos: botoes visiveis com alvo de toque de 44 px */
  .tabela-imoveis-cartao tbody td[data-label="Ações"],
  .tabela-imoveis-cartao tbody td[data-label="Atualizado"] {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
  }
  .tabela-imoveis-cartao tbody td[data-label="Ações"] {
    border-bottom: none !important;
    padding-top: 12px !important;
    margin-top: 4px !important;
    border-top: 1px dashed var(--border) !important;
  }
  .tabela-imoveis-cartao tbody td[data-label="Ações"]::before,
  .tabela-imoveis-cartao tbody td[data-label="Atualizado"]::before {
    float: none;
    width: 100%;
    max-width: none;
    margin-right: 0;
  }
  .tabela-imoveis-cartao tbody td button {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
  }
  .tabela-imoveis-cartao tbody td[colspan] {
    display: block !important;
    text-align: center !important;
    padding: 24px 12px !important;
    border-bottom: none !important;
  }
}
/* Fim T-0931. */
