/*
 * components.css — Componentes visuais: cards, badges, tabelas,
 * modais, toasts, botões, formulários, switches, integr-cards etc.
 * Estilo Velzon: mais sombra, border-radius 8px, ícones MDI.
 */

/* ── Window (container genérico) ─────────────────── */
.window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-soft);
}
.window-title {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -.01em;
}
.window-title .win-icon {
  font-size: 16px;
  color: var(--accent);
  opacity: .8;
}
.consolidados-toggle { cursor:pointer; user-select:none; }
.consolidados-toggle:hover { background:color-mix(in srgb, var(--accent) 6%, transparent); }
.consolidados-chevron { margin-left:auto; font-size:18px; transition:transform .2s; color:var(--text-muted); }
.consolidados-chevron.open { transform:rotate(90deg); }
.window-title .dots {
  display: flex;
  gap: 5px;
  margin-left: auto;
}
.window-title .dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
  display: inline-block;
}
.window-title .win-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── KPI Cards ────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.kpi-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.kpi-card .label {
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 2px;
}
.kpi-card .value {
  font-size: var(--fs-display);
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--text);
  line-height: 1.1;
}
.kpi-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.kpi-card .trend {
  font-size: var(--fs-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.trend-up { color: var(--risk-low); }
.trend-down { color: var(--risk-high); }
.trend-neutral { color: var(--text-muted); }
@keyframes pulse-glow { 0%,100% { border-color: var(--border); } 50% { border-color: var(--risk-critical); } }
.kpi-card.pulse { animation: pulse-glow 2s ease-in-out infinite; }

/* ── Layout 2 colunas (mapa + feed) ──────────────── */
.map-alerts-row {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 16px;
  margin-bottom: 20px;
}
.map-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  position: relative;
  height: 420px;
  box-shadow: var(--shadow-soft);
}
.map-container #map-dashboard,
.map-container #map-risco { height: 100%; width: 100%; }
.map-container:fullscreen,
.map-container:-webkit-full-screen {
  height: 100vh;
  width: 100vw;
  border-radius: 0;
}
.map-container:fullscreen .map-leaflet-wrap,
.map-container:-webkit-full-screen .map-leaflet-wrap {
  height: calc(100vh - 46px);
}
.map-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.map-card-header .map-title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
}
.map-card-header .map-actions { margin-left: auto; display: flex; gap: 6px; }
.map-leaflet-wrap {
  position: relative;
  height: calc(100% - 46px);
}
.map-leaflet-wrap .leaflet-map { height: 100%; width: 100%; }
.map-refresh {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 999;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-ui);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background .15s ease;
}
.map-refresh:hover { background: var(--surface-3); }
.map-toggle-pessoas { right: 110px; }

/* ── Feed de alertas ──────────────────────────────── */
.alerts-feed {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}
.alerts-feed-header {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.alerts-feed-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  max-height: 374px;
}
.alert-item {
  padding: 10px 12px;
  border-left: 3px solid var(--border);
  margin-bottom: 8px;
  border-radius: 0 6px 6px 0;
  background: var(--surface-2);
  font-size: var(--fs-base);
  transition: background .15s ease;
}
.alert-item:hover { background: var(--surface-3); }
.alert-item .alert-sev-icon { font-size: 14px; margin-right: 4px; }
.alert-item .route { font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.alert-item .msg { color: var(--text-muted); margin-top: 4px; font-size: var(--fs-sm); line-height: 1.45; }
.alert-item .time { color: var(--text-muted); font-size: var(--fs-xs); margin-top: 4px; }

/* ── Tabelas ──────────────────────────────────────── */
.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  margin-bottom: 20px;
}
.table-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.table-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
}
.table-count {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  background: var(--surface-3);
  border-radius: 9999px;
  padding: 2px 8px;
}
.table-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  flex: 1;
  min-width: 140px;
  max-width: 260px;
}
.table-search input {
  border: none;
  background: transparent;
  font-size: var(--fs-sm);
  color: var(--text);
  width: 100%;
  outline: none;
  font-family: var(--font-ui);
}
.table-search input::placeholder { color: var(--text-muted); }
.table-search .mdi { color: var(--text-muted); }

table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); font-family: var(--font-ui); }
th {
  text-align: left;
  padding: 11px 16px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: var(--fs-xs);
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
  cursor: default;
  user-select: none;
}
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--text); }
th.sorted-asc::after { content: ' ↑'; font-size: var(--fs-2xs); }
th.sorted-desc::after { content: ' ↓'; font-size: var(--fs-2xs); }
td { padding: 10px 16px; border-bottom: 1px solid var(--surface-3); color: var(--text-2); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-3); }

/* Pagination */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}
.pagination-info { flex: 1; }
.pagination-buttons { display: flex; gap: 4px; align-items: center; }
.pagination-btn {
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background .15s ease;
  font-family: var(--font-ui);
}
.pagination-btn:hover { background: var(--surface-3); }
.pagination-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Badges / Pills ───────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}
/* Status badges */
.badge-rascunho,
.badge-concluido { background: color-mix(in srgb, var(--text-muted) 14%, transparent); color: var(--text-muted); }
.badge-aprovado,
.badge-enviado { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.badge-em_andamento,
.badge-lido,
.badge-baixa { background: color-mix(in srgb, var(--risk-low) 16%, transparent); color: var(--risk-low); }
.badge-moderada,
.badge-pendente { background: color-mix(in srgb, var(--risk-medium) 18%, transparent); color: color-mix(in srgb, var(--risk-medium) 90%, #000); }
.badge-alta { background: color-mix(in srgb, var(--risk-high) 16%, transparent); color: var(--risk-high); }
.badge-cancelado,
.badge-extrema { background: color-mix(in srgb, var(--risk-critical) 14%, transparent); color: var(--risk-critical); }
.badge-aguardando_confirmacao { background: color-mix(in srgb, var(--risk-high) 18%, transparent); color: color-mix(in srgb, var(--risk-high) 90%, #000); }
.badge-rejeitado { background: color-mix(in srgb, var(--text-muted) 16%, transparent); color: var(--text-muted); text-decoration: line-through; }
@keyframes pulse-badge { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--risk-critical) 0%, transparent); } 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--risk-critical) 28%, transparent); } }
.badge-extrema.pulse { animation: pulse-badge 2s ease-in-out infinite; }

/* ── Botões ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--btn-pad);
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease, transform .1s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-fg); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-fg); box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn-primary:active { transform: translateY(1px); }
.btn-danger { background: var(--risk-critical); border-color: var(--risk-critical); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); box-shadow: 0 2px 8px color-mix(in srgb, var(--risk-critical) 35%, transparent); }
.btn-success { background: var(--risk-low); border-color: var(--risk-low); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: var(--fs-sm); }
.btn-xs { padding: 2px 8px; font-size: var(--fs-xs); }
.btn-icon { padding: 7px; width: 34px; height: 34px; justify-content: center; }
.btn-icon.btn-sm { padding: 5px; width: 28px; height: 28px; }

/* ── Filtros ──────────────────────────────────────── */
.filters-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filtro-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}
.filtro-bar label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-weight: 500;
}
.filtro-bar input[type="date"],
.filtro-bar select,
.filters-row select,
.filters-row input {
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface);
  color: var(--text);
  min-width: 110px;
  outline: none;
  transition: border-color .15s ease;
}
.filtro-bar input:focus,
.filtro-bar select:focus,
.filters-row select:focus,
.filters-row input:focus { border-color: var(--accent); }
.filtro-bar .btn { align-self: flex-end; }

/* ── Multi-select (dropdown com checkboxes) ─────────── */
.msel { position: relative; }
.msel-btn {
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface);
  color: var(--text);
  min-width: 130px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: border-color .15s ease;
}
.msel-btn:hover, .msel.open .msel-btn { border-color: var(--accent); }
.msel-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.msel-btn .mdi { font-size: 15px; color: var(--text-muted); transition: transform .15s ease; }
.msel.open .msel-btn .mdi { transform: rotate(180deg); }
.msel-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 5000;
  min-width: 220px;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 6px;
}
.msel.open .msel-panel { display: block; }
.filtro-bar label.msel-opt,
.msel-opt {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.msel-opt:hover { background: var(--surface-2); }
.msel-opt input[type="checkbox"] { width: auto; margin: 0; }

/* ── Modal ────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-window);
  padding: 0 0 20px;
  width: 90%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2), 0 0 0 1px rgba(0,0,0,.04);
  animation: modal-in .2s ease;
}
@keyframes modal-in { from { opacity:0; transform:scale(.96) translateY(-10px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-window) var(--radius-window) 0 0;
  flex-shrink: 0;
}
.modal h2,
.modal-title {
  font-family: var(--font-brand);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  margin: 0;
  padding: 0;
  border: none;
  background: none;
}
.modal-close {
  margin-left: auto;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 20px;
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color .15s ease;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 0 24px; }
.modal label {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 5px;
  margin-top: 14px;
}
.modal input,
.modal select,
.modal textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  outline: none;
  transition: border-color .15s ease;
}
.modal input:focus,
.modal select:focus,
.modal textarea:focus { border-color: var(--accent); }
.modal textarea { height: 80px; resize: vertical; }
.modal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding: 0 24px;
}

/* ── Toast ────────────────────────────────────────── */
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  font-weight: 500;
  border: 1px solid transparent;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  animation: toast-in .3s ease;
  max-width: 380px;
}
@keyframes toast-in { from { opacity:0; transform:translateX(30px); } to { opacity:1; transform:translateX(0); } }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-success { background: color-mix(in srgb, var(--risk-low) 12%, var(--surface)); border-color: color-mix(in srgb, var(--risk-low) 30%, transparent); color: var(--text); }
.toast-success .toast-icon { color: var(--risk-low); }
.toast-error { background: color-mix(in srgb, var(--risk-critical) 10%, var(--surface)); border-color: color-mix(in srgb, var(--risk-critical) 25%, transparent); color: var(--text); }
.toast-error .toast-icon { color: var(--risk-critical); }
.toast-info { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--text); }
.toast-info .toast-icon { color: var(--accent); }
.toast-warning { background: color-mix(in srgb, var(--risk-medium) 12%, var(--surface)); border-color: color-mix(in srgb, var(--risk-medium) 30%, transparent); color: var(--text); }
.toast-warning .toast-icon { color: var(--risk-medium); }

/* ── Status semáforo ──────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 20%, transparent);
}
.status-dot.verde { background: var(--risk-low); color: var(--risk-low); }
.status-dot.amarelo { background: var(--risk-medium); color: var(--risk-medium); }
.status-dot.vermelho { background: var(--risk-critical); color: var(--risk-critical); animation: pulse-badge 1.6s ease-in-out infinite; }

/* ── Config: abas ─────────────────────────────────── */
.config-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
}
.config-tab {
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s ease, border-color .15s ease;
}
.config-tab:hover { color: var(--text); }
.config-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.config-tabpane { display: none; }
.config-tabpane.active { display: block; }
.config-intro {
  font-family: var(--font-ui);
  color: var(--text-muted);
  font-size: var(--fs-base);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ── Formulário de config fora de modal (ex.: Notificações) ─────────── */
.notif-form label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 5px;
}
.notif-form input,
.notif-form select {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  outline: none;
  transition: border-color .15s ease;
}
.notif-form input:focus,
.notif-form select:focus { border-color: var(--accent); }
.notif-form input::placeholder { color: var(--text-muted); font-size: var(--fs-sm); }
.notif-form .notif-field { margin-bottom: 14px; }
.notif-form .notif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0 16px;
}
.notif-form .notif-section-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: var(--fs-base);
  color: var(--text);
  margin: 22px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}
.notif-form .notif-section-title:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.notif-form .notif-configurado-tag {
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
}

/* ── Theme Grid ───────────────────────────────────── */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.theme-card {
  position: relative;
  border: 2px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.theme-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.theme-card.active { border-color: var(--accent); }
.theme-swatch { height: 90px; display: flex; flex-direction: column; padding: 12px; gap: 8px; position: relative; }
.theme-swatch .sw-top { display: flex; gap: 6px; align-items: center; }
.theme-swatch .sw-dot { width: 20px; height: 20px; border-radius: 5px; }
.theme-swatch .sw-bars { display: flex; flex-direction: column; gap: 5px; margin-top: auto; }
.theme-swatch .sw-bar { height: 7px; border-radius: 9999px; }
.tc-body { padding: 10px 14px 12px; border-top: 1px solid var(--border); }
.tc-name { font-family: var(--font-brand); font-weight: 700; font-size: var(--fs-md); color: var(--text); display: flex; align-items: center; gap: 6px; }
.tc-desc { font-family: var(--font-ui); font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; line-height: 1.45; }
.tc-check { margin-left: auto; font-size: var(--fs-xs); font-weight: 700; color: var(--accent); }
.theme-card:not(.active) .tc-check { display: none; }
.theme-category { font-size: var(--fs-2xs); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 10px; margin-top: 4px; }

/* ── Integração cards ─────────────────────────────── */
.integr-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.integr-toolbar .integr-count {
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  color: var(--text-muted);
  margin-right: auto;
}
.integr-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.integr-grupo { margin-bottom: 24px; }
.integr-grupo-header { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.integr-grupo-titulo { font-family: var(--font-ui); font-size: var(--fs-md); font-weight: 700; color: var(--text); }
.integr-grupo-count {
  font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted);
  background: var(--surface-2); border-radius: 10px; padding: 1px 8px;
}
.integr-grupo-desc { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: 10px; }
.integr-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.integr-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.integr-head { display: flex; align-items: flex-start; gap: 10px; }
.integr-name { font-family: var(--font-brand); font-weight: 600; font-size: var(--fs-md); color: var(--text); display: flex; align-items: center; gap: 6px; }
.integr-desc { font-family: var(--font-ui); font-size: var(--fs-sm); color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.integr-meta { font-family: var(--font-ui); font-size: var(--fs-sm); color: var(--text-muted); margin: 10px 0; padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-card); }
.integr-meta .ok { color: var(--risk-low); font-weight: 600; }
.integr-meta .erro { color: var(--risk-critical); font-weight: 600; }
.consolidado-expand-icon { font-size: 20px; color: var(--text-muted); transition: transform .2s ease; }
.integr-card.expanded .consolidado-expand-icon { transform: rotate(180deg); }
.integr-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.integr-vazio { padding: 24px; text-align: center; color: var(--text-muted); font-family: var(--font-ui); font-size: var(--fs-base); }

/* ── Saude das fontes ────────────────────────────────── */
.saude-badge { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-ui); font-size: var(--fs-2xs); font-weight: 600; padding: 2px 7px; border-radius: 999px; line-height: 1.6; }
.saude-ok { background: color-mix(in srgb, var(--risk-low) 16%, transparent); color: var(--risk-low); }
.saude-atrasada { background: color-mix(in srgb, var(--risk-medium) 18%, transparent); color: color-mix(in srgb, var(--risk-medium) 90%, #000); }
.saude-erro { background: color-mix(in srgb, var(--risk-critical) 14%, transparent); color: var(--risk-critical); }
.saude-nunca { background: var(--surface-2); color: var(--text-muted); }
.saude-inativa { background: var(--surface-2); color: var(--text-muted); }

.saude-resumo-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.saude-resumo-titulo { font-family: var(--font-brand); font-weight: 600; font-size: var(--fs-sm); color: var(--text); display: flex; align-items: center; gap: 4px; margin-right: 4px; }
.saude-resumo-chip { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-ui); font-size: var(--fs-xs); font-weight: 600; padding: 4px 10px; border-radius: 999px; cursor: pointer; transition: filter .15s ease; }
.saude-resumo-chip:hover { filter: brightness(0.95); }
.saude-resumo-chip.saude-ok { background: color-mix(in srgb, var(--risk-low) 14%, transparent); color: var(--risk-low); }
.saude-resumo-chip.saude-atrasada { background: color-mix(in srgb, var(--risk-medium) 16%, transparent); color: color-mix(in srgb, var(--risk-medium) 90%, #000); }
.saude-resumo-chip.saude-erro { background: color-mix(in srgb, var(--risk-critical) 12%, transparent); color: var(--risk-critical); }
.saude-resumo-chip.saude-nunca, .saude-resumo-chip.saude-inativa { background: var(--surface-2); color: var(--text-muted); }
.saude-resumo-chip.saude-limpar { background: var(--surface-2); color: var(--text-muted); margin-left: auto; }

/* ── Toggle switch ────────────────────────────────── */
.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex-shrink: 0; margin-left: auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid var(--border); border-radius: 9999px; transition: .2s; cursor: pointer; }
.slider::before { content: ''; position: absolute; height: 15px; width: 15px; left: 2px; top: 2px; background: var(--surface); border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--brand); border-color: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(17px); background: var(--brand-fg, #fff); }

/* ── Admin gate ───────────────────────────────────── */
.admin-gate { display: flex; flex-direction: column; gap: 12px; max-width: 400px; }
.admin-gate .gate-msg { font-family: var(--font-ui); font-size: var(--fs-base); color: var(--text-2); line-height: 1.5; }
.admin-gate input { padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-input); color: var(--text); font-family: var(--font-ui); font-size: var(--fs-md); outline: none; }
.admin-gate input:focus { border-color: var(--accent); }

/* ── Mapa: legenda e popup ────────────────────────── */
.map-legend {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  color: var(--text-2);
  box-shadow: var(--shadow-soft);
}
.map-legend .leg-item { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.map-legend .leg-item:last-child { margin-bottom: 0; }
.map-legend .leg-dot { width: 11px; height: 11px; border-radius: 50%; }

.map-timeline-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--surface);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}

/* Popup do mapa */
.popup-ev { max-width: 340px; line-height: 1.45; }
.popup-ev .popup-titulo { font-weight: 600; font-size: var(--fs-base); margin-bottom: 4px; }
.popup-ev .popup-meta { font-size: var(--fs-sm); color: #666; margin-bottom: 4px; }
.popup-ev .popup-cat-row { display: flex; align-items: center; gap: 4px; font-size: var(--fs-sm); margin: 4px 0; padding: 4px 6px; background: rgba(0,0,0,.04); border-radius: 4px; }
.popup-ev .popup-sev-row { font-size: var(--fs-sm); margin: 2px 0; }
.popup-ev .popup-fonte-row { font-size: var(--fs-xs); color: #888; margin-top: 4px; }
.popup-ev .popup-info-link { cursor: pointer; text-decoration: none; font-size: var(--fs-xs); color: var(--accent); font-weight: 500; }
.popup-ev .popup-info-link:hover { text-decoration: underline; }
.popup-ev .popup-detail { display: none; margin-top: 6px; padding: 6px 8px; font-size: var(--fs-xs); background: rgba(0,0,0,.03); border-radius: 4px; border-left: 2px solid var(--accent); line-height: 1.5; }
.popup-ev .popup-detail.open { display: block; }
.popup-pessoa { max-width: 280px; line-height: 1.45; }
.popup-pessoa .popup-sit-row { font-size: var(--fs-xs); margin-top: 4px; padding: 4px 6px; background: rgba(0,0,0,.04); border-radius: 4px; }

/* Tooltip inline */
.cat-info-tip { position: relative; cursor: help; }
.cat-info-tip .tip-text { visibility: hidden; opacity: 0; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: 280px; padding: 8px 10px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font-size: var(--fs-xs); line-height: 1.5; box-shadow: 0 4px 12px rgba(0,0,0,.15); z-index: 999; transition: opacity .15s; pointer-events: none; }
.cat-info-tip:hover .tip-text { visibility: visible; opacity: 1; }

/* ── Voo detalhe ──────────────────────────────────── */
.voo-toggle:hover { text-decoration: underline; cursor: pointer; }
.voo-detalhe { display: none; max-height: 0; overflow: hidden; transition: max-height .15s ease; }
.voo-detalhe.open { display: block; max-height: 200px; margin-top: 4px; padding: 4px 6px; background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 4px; }

/* ── Leaflet.draw override (geofencing) ───────────── */
.leaflet-draw-toolbar a { background-color: var(--surface) !important; color: var(--text) !important; }
.leaflet-draw-actions a { background: var(--accent) !important; color: #fff !important; font-size: var(--fs-xs) !important; }

/* ── Linha expansível de itinerário ───────────────── */
.itin-row { cursor: pointer; }
.itin-row:hover { background: var(--surface-2); }
.itin-detail-row td { background: color-mix(in srgb, var(--accent) 4%, transparent); border-top: none; padding: 12px 16px; }
.itin-detail-body { font-size: var(--fs-sm); color: var(--text); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.itin-detail-row-item { line-height: 1.5; }

/* ── Charts placeholder ───────────────────────────── */
.charts-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 1200px) { .charts-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .charts-row { grid-template-columns: 1fr; } }
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  min-width: 0;
}
.chart-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.chart-card-title { font-size: var(--fs-base); font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-card-sub { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 1px; }
.chart-card-body { padding: 14px; }
.chart-card-wide { grid-column: 1 / -1; }

/* ── Infográfico por categoria (donut + legenda vertical compacta) ── */
.cat-infographic { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cat-donut-wrap { width: 100%; min-height: 170px; }
.cat-legend { width: 100%; display: flex; flex-direction: column; gap: 4px; max-height: 210px; overflow-y: auto; }
.cat-legend-item { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; transition: background .15s; }
.cat-legend-item:hover { background: var(--surface-2); }
.cat-legend-icon { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; flex-shrink: 0; }
.cat-legend-info { min-width: 0; flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.cat-legend-title { font-size: var(--fs-xs); font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-legend-pct { font-size: var(--fs-sm); font-weight: 700; flex-shrink: 0; }
.cat-legend-count { font-size: var(--fs-2xs); color: var(--text-muted); flex-shrink: 0; }

/* ── Infográfico por severidade (mesma linguagem do cat-*) ── */
.sev-infographic { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sev-donut-wrap { width: 100%; min-height: 170px; }
.sev-legend { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.sev-legend-item { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; transition: background .15s; }
.sev-legend-item:hover { background: var(--surface-2); }
.sev-legend-icon { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; flex-shrink: 0; }
.sev-legend-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text); flex: 1; }
.sev-legend-count { font-size: var(--fs-sm); font-weight: 700; }
.sev-legend-pct { font-size: var(--fs-2xs); color: var(--text-muted); min-width: 28px; text-align: right; }

/* ── Resumo estatístico da tendência ─────────────── */
.trend-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.trend-stat-item { text-align: center; }
.trend-stat-icon { font-size: 15px; margin-bottom: 2px; }
.trend-stat-value { font-size: var(--fs-lg); font-weight: 700; color: var(--text); }
.trend-stat-label { font-size: var(--fs-2xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; margin-top: 1px; }

/* ── Nuvem de palavras ────────────────────────────── */
/* Card Exposição da equipe / Regiões (substituiu a nuvem de palavras) */
.expo-tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.expo-tab { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 12px; margin-bottom: -1px; font: inherit; font-size: var(--fs-sm); color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; gap: 6px; }
.expo-tab:hover { color: var(--text); }
.expo-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.expo-cnt { font-size: var(--fs-2xs); background: var(--surface-2); color: var(--text-muted);
  padding: 1px 6px; border-radius: 20px; font-variant-numeric: tabular-nums; font-weight: 500; }
.expo-tab[aria-selected="true"] .expo-cnt { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.expo-wrap { display: flex; flex-direction: column; gap: 10px; min-height: 220px; }
.expo-wrap[hidden] { display: none; }
.expo-row { display: grid; grid-template-columns: 20px 1fr 42px; align-items: center; gap: 10px; }
.expo-pos { font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; text-align: right; }
.expo-main { min-width: 0; cursor: pointer; border-radius: 4px; padding: 2px 4px; margin: -2px -4px; }
.expo-main:hover { background: var(--surface-2); }
.expo-main:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.expo-lab { font-size: var(--fs-sm); display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.expo-nome { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expo-sub2 { font-size: var(--fs-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expo-chip { font-size: var(--fs-2xs); padding: 1px 6px; border-radius: 20px; border: 1px solid currentColor; white-space: nowrap; flex-shrink: 0; }
.expo-bar { display: flex; height: 9px; border-radius: 5px; overflow: hidden; margin-top: 5px; }
.expo-val { font-size: var(--fs-sm); text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.expo-legenda { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; padding-top: 10px;
  border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-muted); }
.expo-legenda span { display: inline-flex; align-items: center; gap: 5px; }
.expo-dot { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.expo-nota { font-size: var(--fs-xs); color: var(--text-muted); }

/* ── Equipe: semáforo de check-in ─────────────────── */
.team-status-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.team-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}
.team-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.team-stat-val { font-size: var(--fs-display); font-weight: 700; line-height: 1.1; color: var(--text); }
.team-stat-lbl { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }


/* Colapso da meta — restrito aos cards CONSOLIDADOS (que expandem ao clicar).
   Sem o escopo #consolidados-body, esta regra colapsava tambem a meta dos cards
   do painel de Integracoes (credenciais/ultima ingestao/agendamento ficavam com
   height 0, invisiveis). */
#consolidados-body .integr-meta { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out, padding 0.3s ease-out; padding: 0 16px; }
#consolidados-body .integr-card.expanded .integr-meta { max-height: 500px; padding: 12px 16px; overflow: visible; }
/* Tooltip de fonte vive dentro do .integr-meta (ícone à direita da linha):
   ancora pela direita p/ abrir à esquerda e não vazar pela borda do card. */
.integr-meta .cat-info-tip .tip-text { left: auto; right: 0; transform: none; }

/* ── Login (layout "cover" split-screen, inspirado no Velzon auth-signin-cover) ── */
.login-overlay {
  position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: var(--canvas); padding: 24px;
}
.login-cover-card {
  width: 100%; max-width: 900px; min-height: 480px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-md); overflow: hidden;
  display: flex; flex-wrap: wrap;
}

/* Painel de marca (esquerda) */
.login-cover-brand {
  flex: 1 1 46%; min-width: 320px; position: relative; padding: 40px 36px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, var(--sidebar-bg, #1e2433), color-mix(in srgb, var(--accent) 55%, var(--sidebar-bg, #1e2433)));
  color: rgba(255,255,255,.92);
}
.login-cover-logo { font-family: var(--font-brand); font-weight: 700; font-size: var(--fs-xl); display: flex; align-items: center; gap: 8px; }
.login-cover-logo .mdi { font-size: 24px; }
.login-cover-quote { position: relative; }
.login-cover-quote > .mdi { font-size: 34px; color: rgba(255,255,255,.35); display: block; margin-bottom: 8px; }
.login-cover-carousel { position: relative; min-height: 66px; }
.login-cover-tagline {
  font-family: var(--font-ui); font-size: var(--fs-md); font-style: italic; line-height: 1.55; color: rgba(255,255,255,.85);
  position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease;
}
.login-cover-tagline.active { opacity: 1; position: relative; }
.login-cover-dots { display: flex; gap: 6px; margin-top: 16px; }
.login-cover-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.3); cursor: pointer; transition: background .2s; }
.login-cover-dots span.active { background: #fff; }

/* Painel de formulário (direita) */
.login-cover-form { flex: 1 1 50%; min-width: 300px; padding: 40px 36px; display: flex; flex-direction: column; justify-content: center; }
.login-cover-title { font-family: var(--font-brand); font-weight: 700; font-size: var(--fs-xl); color: var(--accent); margin: 0 0 4px; }
.login-cover-sub { font-family: var(--font-ui); font-size: var(--fs-base); color: var(--text-muted); margin: 0 0 20px; }
.login-cover-form label { font-family: var(--font-ui); font-size: var(--fs-sm); font-weight: 600; color: var(--text); display: block; margin-top: 14px; margin-bottom: 5px; }
.login-cover-form input[type="email"], .login-cover-form input[type="password"] {
  width: 100%; font-family: var(--font-ui); font-size: var(--fs-base); padding: 9px 11px; border: 1px solid var(--border);
  border-radius: var(--radius-card); background: var(--surface-2); color: var(--text); box-sizing: border-box;
}
.login-cover-form input:focus { outline: none; border-color: var(--accent); }
.login-pass-wrap { position: relative; }
.login-pass-wrap input { padding-right: 36px !important; }
.login-pass-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: none;
  color: var(--text-muted); cursor: pointer; padding: 6px; display: flex; align-items: center;
}
.login-pass-toggle:hover { color: var(--text); }
.login-remember {
  display: flex !important; align-items: center; gap: 8px; margin-top: 14px !important; font-weight: 400 !important;
  color: var(--text-muted) !important; cursor: pointer;
}
.login-remember input { width: auto !important; }
.login-erro { font-family: var(--font-ui); font-size: var(--fs-sm); color: var(--risk-critical); min-height: 16px; margin-top: 10px; }
.login-hint { font-family: var(--font-ui); font-size: var(--fs-xs); color: var(--text-muted); text-align: center; margin-top: 16px; }
.login-footer { font-family: var(--font-ui); font-size: var(--fs-xs); color: var(--text-muted); text-align: center; }

@media (max-width: 767px) {
  .login-cover-brand { display: none; }
  .login-cover-form { padding: 32px 24px; }
}

/* ── Menu "Camadas" do mapa (item 3 do HANDOFF_UIUX) ───────────────── */
.camadas-badge { display: inline-block; min-width: 16px; padding: 0 5px; border-radius: 9px;
  background: rgba(255,255,255,.25); font-size: var(--fs-2xs); line-height: 16px; text-align: center; }
.camadas-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 1100; min-width: 234px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.15); font-family: var(--font-ui); text-align: left;
  max-height: min(420px, 70vh); overflow-y: auto; overflow-x: visible; }
.camadas-panel.acima { top: auto; bottom: calc(100% + 6px); }
.camadas-grupo { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); margin: 10px 0 4px 4px; }
.camadas-grupo:first-child { margin-top: 2px; }
.btn.camada-item { display: flex; width: 100%; justify-content: flex-start; gap: 7px;
  border: 0; background: none; padding: 5px 6px; font-size: var(--fs-sm); border-radius: 6px; }
.btn.camada-item:hover { background: var(--canvas); }
.camadas-foot { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 6px; }
.camadas-link { background: none; border: 0; padding: 0 4px; cursor: pointer;
  color: var(--accent); font-family: var(--font-ui); font-size: var(--fs-xs); }
/* o filtro de Pontos seguros abre ao lado do menu, não por cima dele */
#camadas-panel #safe-filter-panel { top: 0; left: calc(100% + 6px); }

/* ── Bloco "Confiança" dos cards consolidados (item 4 do HANDOFF_UIUX) ── */
.conf-bloco { margin-top: 5px; font-family: var(--font-ui); }
.conf-linha { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-2); }
.conf-linha .cat-info-tip .mdi { color: var(--text-muted); font-size: 14px; }
.conf-bar { display: inline-block; width: 74px; height: 5px; border-radius: 3px;
  background: var(--surface-3); overflow: hidden; }
.conf-bar > i { display: block; height: 100%; }
.conf-bar > i.conf-alta { background: var(--risk-low); }
.conf-bar > i.conf-media { background: var(--risk-medium); }
.conf-bar > i.conf-baixa { background: var(--risk-high); }
.conf-detalhe { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }

/* ── Classes utilitárias de texto (item 6a do HANDOFF_UIUX) ─────────────
   Substituem o par mais repetido do index.html:
   style="font-size:11px;color:var(--text-muted)"  →  class="t-xs t-muted" */
.t-2xs { font-size: var(--fs-2xs); }
.t-xs { font-size: var(--fs-xs); }
.t-sm { font-size: var(--fs-sm); }
.t-base { font-size: var(--fs-base); }
.t-md { font-size: var(--fs-md); }
.t-lg { font-size: var(--fs-lg); }
.t-xl { font-size: var(--fs-xl); }
.t-display { font-size: var(--fs-display); }
.t-muted { color: var(--text-muted); }
.t-2 { color: var(--text-2); }
.t-semi { font-weight: 600; }
.t-bold { font-weight: 700; }
.t-upper { text-transform: uppercase; letter-spacing: .04em; }
