/* ================================================================
   Painel Jaqueline Cassol -- Design System
   Paleta: navy (institucional) + vinho (marca) + verde/ambar (status)
   ================================================================ */

:root {
  /* Cor -- fundo em cinza neutro (conforme paleta enviada pelo usuário)
     em vez de branco/azul, para uma cara mais sóbria e profissional em
     todos os menus do Painel. */
  --bg: #cccccc;
  --surface: #f7f7f7;
  --surface-2: #dedede;
  --ink: #0f1626;
  --ink-soft: #4b5468;
  --muted: #6b7488;
  --line: #b3b3b3;
  --line-soft: #c2c2c2;

  --navy: #101a33;
  --navy-2: #0b1220;
  --wine: #7a1f1f;
  --wine-2: #591616;
  --gold: #c9932f;

  --success: #15803d;
  --success-bg: #dcfce7;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --info: #3730a3;
  --info-bg: #eef2ff;

  /* Espacamento */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;

  /* Raio e sombra */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(15,23,42,.06);
  --shadow-md: 0 10px 28px rgba(15,23,42,.09);
  --shadow-lg: 0 18px 44px rgba(15,23,42,.14);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin:0; padding:0; overflow-x:hidden; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  width: 100%;
}
img, svg:not(.icon) { max-width: 100%; height: auto; }
canvas { max-width: 100%; }
a { color: inherit; }
::selection { background: rgba(16,26,51,.16); }

/* Foco acessivel visivel em qualquer elemento navegavel por teclado */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2.5px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}

.icon { width: 18px; height: 18px; flex: none; display:inline-block; vertical-align: -4px; }

/* ---------------- Layout geral: barra lateral + conteudo ---------------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

.app-shell { display:flex; align-items:stretch; min-height: 100vh; }

.sidebar {
  width: 252px; flex: none;
  background: linear-gradient(180deg, var(--navy-2), var(--navy) 75%);
  color:#fff; display:flex; flex-direction:column;
  padding: 22px 16px; position: sticky; top:0; height:100vh; overflow-y:auto;
}
.sidebar-brand {
  padding: 6px 10px 22px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand-name { font-size:16.5px; font-weight:800; line-height:1.25; letter-spacing:-.01em; }
.brand-sub { font-size:11px; color:#9aa4c2; font-weight:600; margin-top:3px; text-transform:uppercase; letter-spacing:.04em; }

.sidebar-user {
  padding: 2px 10px 14px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-user-name { font-size:13px; font-weight:800; color:#fff; line-height:1.3; }
.sidebar-user-role { font-size:10.5px; color:#9aa4c2; font-weight:600; margin-top:3px; text-transform:uppercase; letter-spacing:.03em; }

.sidebar-nav { display:flex; flex-direction:column; gap:3px; margin-top:6px; }
.sidebar-nav-group:first-child .sidebar-nav-label { padding-top:2px; }
.sidebar-nav-label {
  width:100%; padding:16px 13px 6px; font-size:10px; font-weight:800; letter-spacing:.08em;
  text-transform:uppercase; color:#6b7699; background:none; border:none; font-family:inherit;
  display:flex; align-items:center; justify-content:space-between; gap:6px; cursor:pointer;
}
.sidebar-nav-label:hover { color:#9aa4c4; }
.sidebar-nav-label .chevron { width:12px; height:12px; flex:none; opacity:.75; transition: transform .15s ease; }
.sidebar-nav-group:not(.open) .sidebar-nav-label .chevron { transform: rotate(-90deg); }
.sidebar-nav-items { display:flex; flex-direction:column; gap:3px; }
.sidebar-nav-group:not(.open) .sidebar-nav-items { display:none; }
.sidebar-nav a {
  display:flex; align-items:center; gap:12px; padding:12px 13px; border-radius:10px;
  color:#c7cfe4; text-decoration:none; font-weight:700; font-size:13.7px;
  transition: background .15s ease, color .15s ease;
}
.sidebar-nav a .icon { opacity:.85; flex:none; }
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color:#fff; }
.sidebar-nav a.active { background: linear-gradient(135deg, var(--gold), #b8842a); color:#211705; box-shadow: var(--shadow-sm); }
.sidebar-nav a.active .icon { opacity:1; }
.sidebar-nav-exit { margin-top:10px; padding-top:14px; border-top:1px solid rgba(255,255,255,.1); color:#e6a3a3 !important; }
.sidebar-nav-exit:hover { background: rgba(185,28,28,.2) !important; color:#fff !important; }

.sidebar-foot {
  margin-top:auto; padding-top:16px; border-top:1px solid rgba(255,255,255,.12);
  font-size:11px; color:#8b93ac; line-height:1.6;
}

.content { flex:1; min-width:0; padding: 30px 34px 70px; }
.content > * { max-width: 1280px; margin-left:auto; margin-right:auto; }

.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; flex-wrap:wrap; margin-bottom: 26px; }
.page-head-text h1 { font-size: clamp(21px,2.6vw,27px); margin:0 0 5px; font-weight:800; letter-spacing:-.01em; }
.page-sub { color: var(--muted); font-size: 13.6px; margin:0; max-width: 640px; }
.page-head-extra { flex:none; display:flex; gap:10px; flex-wrap:wrap; }
.page-date-badge {
  display:inline-flex; align-items:center; gap:9px; background: var(--surface);
  border:1px solid var(--line-soft); border-radius: var(--radius-sm); padding:11px 16px;
  font-size:13px; font-weight:700; color: var(--ink-soft); box-shadow: var(--shadow-sm);
}
.page-date-badge .icon { color: var(--navy); }

/* ---------------- KPIs ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 26px; }
#uso-api-anthropic .kpi-card.highlight { background: linear-gradient(135deg, #c9932f, #a67623 70%); }
#uso-api-anthropic .zone-tag { display:inline-block; }
.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-grid-2 { grid-template-columns: repeat(2, 1fr); }
.kpi-card {
  background: linear-gradient(135deg, var(--navy-2), var(--navy) 70%);
  color: #fff; border-radius: var(--radius); padding: 18px 17px;
  box-shadow: var(--shadow-sm); border: 1px solid transparent;
  display:flex; flex-direction:column; align-items:center; text-align:center; gap:8px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,.16); color: #fff;
  display:flex; align-items:center; justify-content:center;
}
.kpi-value { font-size: 25px; font-weight: 800; letter-spacing: -.01em; }
.kpi-label { font-size: 12px; color: #c3cbe4; font-weight: 600; }

/* ---------------- Paineis / cards ---------------- */
section.panel {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  border: 1px solid var(--line-soft);
  padding: 26px; margin-bottom: 22px;
}
h2 { font-size: 18.5px; margin: 0 0 5px; font-weight: 800; letter-spacing: -.005em; display:flex; align-items:center; gap:9px; }
.panel-sub { color: var(--muted); font-size: 13.3px; margin: 0 0 18px; max-width: 820px; }

/* ---------------- Mapa / legenda / barras ---------------- */
.map-photo {
  position: relative; margin: 0 0 24px; padding: 0; text-align:center;
  border-radius: var(--radius); overflow:hidden;
  border: 1px solid var(--line-soft); box-shadow: var(--shadow-md);
  background: var(--surface-2);
  width: fit-content; max-width: 100%; margin-left:auto; margin-right:auto;
}
.map-photo img { display:block; width:100%; max-width:460px; margin:0 auto; height:auto; cursor: zoom-in; }
.map-photo-zoom {
  position:absolute; top:10px; right:10px; z-index:2;
  display:flex; align-items:center; gap:6px;
  background: rgba(11,18,32,.72); color:#fff; border:none; border-radius:999px;
  padding:7px 13px 7px 11px; font-size:12px; font-weight:700; cursor:pointer;
  backdrop-filter: blur(2px); transition: background .15s ease;
}
.map-photo-zoom:hover { background: rgba(11,18,32,.9); }
.map-photo-zoom .icon { width:15px; height:15px; }

/* Mapa interativo por municipio (bolhas de confirmados sobre a arte) */
.map-photo .mun-map-wrap { position:relative; width:100%; max-width:680px; margin:0 auto; line-height:0; }
.map-photo .mun-map-wrap img { display:block; width:100%; max-width:none; height:auto; margin:0; cursor: zoom-in; }
.mun-pin {
  position:absolute; transform:translate(-50%,-50%); border-radius:50%;
  border:2px solid rgba(255,255,255,.92); box-shadow:0 2px 6px rgba(16,26,51,.35);
  cursor:pointer; transition: transform .15s ease, box-shadow .15s ease; z-index:3;
}
.mun-pin:hover, .mun-pin:focus-visible { transform:translate(-50%,-50%) scale(1.25); box-shadow:0 3px 12px rgba(16,26,51,.55); z-index:6; outline:none; }
.mun-pin.active { box-shadow:0 0 0 3px #fff, 0 0 0 6px var(--navy-2), 0 3px 10px rgba(16,26,51,.5); z-index:7; }
.mun-pin.zero { opacity:.5; }
.mun-pin::after {
  content: attr(data-tip);
  position:absolute; bottom:calc(100% + 8px); left:50%; transform:translateX(-50%);
  background: var(--navy-2); color:#fff; font-size:11px; font-weight:700; white-space:nowrap;
  padding:6px 10px; border-radius:7px; opacity:0; pointer-events:none; transition:opacity .15s ease;
  box-shadow: var(--shadow-md); z-index:20;
}
.mun-pin:hover::after, .mun-pin:focus-visible::after { opacity:1; }

.img-lightbox {
  display:none; position: fixed; inset:0; z-index: 200;
  background: rgba(8,12,22,.86); align-items:center; justify-content:center; padding: 32px;
}
.img-lightbox.open { display:flex; }
.img-lightbox img { max-width: min(92vw, 1100px); max-height: 88vh; width:auto; height:auto; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.img-lightbox-close {
  position:absolute; top:20px; right:24px; width:40px; height:40px; border-radius:50%;
  background: rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.25); color:#fff;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  transition: background .15s ease;
}
.img-lightbox-close:hover { background: rgba(255,255,255,.22); }

/* ---------------- Modal de edicao ---------------- */
.modal-overlay {
  display:none; position: fixed; inset:0; z-index: 210;
  background: rgba(8,12,22,.55); align-items:center; justify-content:center; padding: 20px;
}
.modal-overlay.open { display:flex; }
.modal-box {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width:100%; max-width: 440px; padding: 22px 22px 24px; max-height: 90vh; overflow-y:auto;
}
.modal-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.modal-head h3 { margin:0; font-size:16.5px; font-weight:800; }
.modal-close {
  width:32px; height:32px; flex:none; border-radius:50%; border:1px solid var(--line);
  background: var(--surface-2); color: var(--ink-soft); cursor:pointer;
  display:flex; align-items:center; justify-content:center; transition: background .15s ease;
}
.modal-close:hover { background: var(--line-soft); }
.modal-close .icon { width:16px; height:16px; }
.map-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: start; }
/* Sem isso, um item de grid nao encolhe alem do tamanho "natural" do que
   tem dentro (min-width:auto e' o padrao do CSS Grid). Um <canvas> do
   Chart.js tem largura intrinseca em pixels -- entao, no celular, a coluna
   do grafico forcava a coluna inteira (e a pagina) a ficar mais larga que a
   tela, mesmo com "overflow-x:hidden" no body e o grid ja "colapsado" para
   1 coluna. min-width:0 permite o item encolher normalmente. */
.map-grid > * { min-width: 0; }
.ro-map { width: 100%; height: auto; max-height: 540px; }
.region-shape { cursor: pointer; }
.region-shape path { transition: filter .15s ease, opacity .15s ease; }
.region-shape:hover path, .region-shape:focus path { filter: brightness(1.14); }
.region-shape.dim path { opacity: .32; }
.region-label { fill:#fff; font-size:46px; font-weight:700; text-anchor:middle; pointer-events:none;
  paint-order: stroke; stroke: rgba(0,0,0,.55); stroke-width:6px; }

.legend { display:flex; flex-wrap:wrap; gap:8px; margin-top: 16px; }
.legend-item {
  display:flex; align-items:center; gap:7px; border:1px solid var(--line); background:var(--surface);
  border-radius:999px; padding:7px 13px; font-size:12.5px; font-weight:600; cursor:pointer; color:var(--ink);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.legend-item:hover { border-color:#c8cede; transform: translateY(-1px); }
.legend-item.active { background:var(--navy-2); color:#fff; border-color:var(--navy-2); }
.dot { width:10px; height:10px; border-radius:50%; display:inline-block; flex:none; box-shadow: 0 0 0 3px rgba(0,0,0,.04); }

.bars { display:flex; flex-direction:column; gap:15px; }
.bar-row { display:grid; grid-template-columns: 180px 1fr; row-gap:5px; align-items:center; }
.bar-label { font-size:12.5px; font-weight:700; display:flex; align-items:center; gap:7px; }
.bar-track { background: var(--surface-2); border-radius:8px; height:12px; overflow:hidden; grid-column:2; box-shadow: inset 0 0 0 1px var(--line-soft); }
.bar-fill { height:100%; border-radius:8px; transition: width .5s ease; }
.bar-value { grid-column:2; font-size:11.5px; color:var(--muted); margin-top:2px; }

/* ---------------- Graficos interativos (Chart.js) ---------------- */
.chart-hint { font-size:11.5px; color:var(--muted); margin:0 0 12px; }
.chart-wrap { position: relative; height: 300px; overflow: hidden; max-width: 100%; }
.chart-wrap.small { height: 240px; }
.chart-legend-custom { display:flex; flex-wrap:wrap; gap:9px 18px; margin-top:16px; justify-content:center; }
.chart-legend-custom span { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:700; color:var(--ink-soft); }
.chart-legend-custom .dot { width:10px; height:10px; }

/* ---------------- Velocimetros + semaforo por regiao (meta de cadastros) ---------------- */
.gauge-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap:14px; margin-top:12px; }
.gauge-card { background:var(--surface); border:1px solid var(--line-soft); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); padding:14px; text-align:center; }
.gauge-card-head { display:flex; align-items:center; justify-content:center; gap:6px; font-size:12.5px; font-weight:800; color:var(--ink-soft); margin-bottom:2px; }
.gauge-card-head .dot { width:8px; height:8px; box-shadow:none; }
.gauge-canvas-wrap { position:relative; height:90px; }
.gauge-falta { font-size:12px; color:var(--muted); margin-top:2px; }
.gauge-falta strong { color:var(--ink); }
.gauge-status { font-size:11.5px; font-weight:800; margin-top:8px; }
.semaforo { display:flex; justify-content:center; align-items:center; gap:6px; margin-top:10px; }
.semaforo .luz { width:12px; height:12px; border-radius:50%; background:var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-soft); transition: background .2s ease, box-shadow .2s ease; }
.semaforo .luz.vermelha.on { background:#dc2626; box-shadow: 0 0 8px rgba(220,38,38,.55); }
.semaforo .luz.amarela.on { background:#b45309; box-shadow: 0 0 8px rgba(180,83,9,.55); }
.semaforo .luz.verde.on { background:#15803d; box-shadow: 0 0 8px rgba(21,128,61,.55); }

/* ---------------- Cartoes de regiao (accordion) ---------------- */
.zone-card {
  background:var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-bottom: 12px; border: 1px solid var(--line-soft); border-left: 6px solid var(--zc); overflow:hidden;
  transition: box-shadow .15s ease;
}
.zone-card.open { box-shadow: var(--shadow-md); }
.zone-card-header {
  width:100%; background:none; border:none; cursor:pointer; text-align:left;
  display:flex; align-items:center; gap:12px; padding:16px 18px; font: inherit; color:inherit; flex-wrap:wrap;
}
.zone-card-header:hover { background: var(--surface-2); }
.zone-chip { width:12px; height:12px; border-radius:3px; flex:none; }
.zone-name { font-weight:800; font-size:15.5px; }
.zone-count { font-size:11.5px; font-weight:700; color:var(--muted); background:var(--surface-2); padding:4px 10px; border-radius:999px; }
.zone-mini-stats { margin-left:auto; font-size:12px; color:var(--muted); }
.zone-mini-stats strong { color: var(--ink); }
.chevron { transition: transform .2s ease; color: var(--muted); }
.zone-card.open .chevron { transform: rotate(180deg); }
.zone-card-body { max-height:0; overflow:hidden; transition: max-height .3s ease; }
.zone-card.open .zone-card-body { max-height: 900px; }

/* ---------------- Tabelas ---------------- */
table { width:100%; border-collapse: collapse; font-size: 13.2px; }
.mini-table { padding: 0 18px 16px; }
th, td {
  text-align:center; padding: 12px 13px; border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
}
th.num, td.num { text-align:right; }
td:first-child, th:first-child { text-align:left; }
th:last-child, td:last-child { border-right:none; }
thead th {
  font-size:12.5px; color:#fff; background: linear-gradient(180deg, var(--navy), var(--navy-2));
  position: sticky; top: 0; font-weight: 800; letter-spacing:.01em; border-bottom:none;
  border-right: 1px solid rgba(255,255,255,.14);
}
thead th:last-child { border-right:none; }
thead th:first-child { border-top-left-radius: var(--radius-sm); }
thead th:last-child { border-top-right-radius: var(--radius-sm); }
tbody tr { transition: background .12s ease; background: var(--surface); }
tbody tr:hover { background: var(--surface-2); }
.full-table-wrap { overflow-x:auto; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.full-table-wrap table { min-width: 640px; }
.empty-state { text-align:center; color:var(--muted); padding: 34px 16px !important; font-size: 13.5px; }

.inline-form { display:inline; }

.zone-tag { font-size:10.5px; font-weight:800; padding:4px 9px; border-radius:999px; white-space:nowrap; letter-spacing:.02em; }
.status-pill {
  font-size:11px; font-weight:800; padding:5px 13px; border-radius:999px; display:inline-flex;
  align-items:center; gap:5px; letter-spacing:.01em;
}
.status-pill::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; flex:none; }
.status-pill.ok { background:var(--success-bg); color:var(--success); }
.status-pill.mid { background:var(--warn-bg); color:var(--warn); }
.status-pill.no { background:var(--line-soft); color:var(--muted); }
.status-pill.urgente { background:var(--danger-bg); color:var(--danger); }

/* ---------------- Materiais de Campanha: linhas de item repetiveis ---------------- */
.item-linha {
  display:flex; align-items:center; gap:10px; margin-bottom:10px; flex-wrap:wrap;
}
.item-linha select { flex:2 1 240px; }
.item-linha input[type="number"], .item-linha input[type="text"] { flex:1 1 140px; }
.item-linha select, .item-linha input {
  padding:11px 13px; border-radius:10px; border:1.5px solid var(--line); font-size:14.5px; font-family:inherit; background:var(--surface); color:var(--ink);
}
.item-linha .icon-btn { flex:none; }

/* ---------------- Calendario Eleitoral ---------------- */
.calendario-proximos { display:flex; flex-direction:column; gap:10px; }
.calendario-item {
  display:flex; align-items:flex-start; gap:14px; padding:14px 16px; border-radius:var(--radius-sm);
  background:var(--surface-2, #f8f9fc); border:1px solid var(--line-soft);
}
.calendario-item-data {
  flex:none; width:64px; text-align:center; font-weight:800; color:var(--navy);
  border-right:1px solid var(--line-soft); padding-right:14px;
}
.calendario-item-data .dia { font-size:20px; line-height:1.1; display:block; }
.calendario-item-data .mes { font-size:11px; text-transform:uppercase; color:var(--muted); display:block; }
.calendario-item-body { flex:1 1 auto; min-width:0; }
.calendario-item-titulo { font-weight:700; color:var(--navy); margin-bottom:2px; }
.calendario-item-desc { font-size:13px; color:var(--muted); margin-top:4px; }
.calendario-timeline-mes { font-weight:800; color:var(--navy); margin:22px 0 8px; font-size:14px; text-transform:uppercase; letter-spacing:.03em; }
.calendario-timeline-mes:first-child { margin-top:0; }
.calendario-row-passado { opacity:.55; }
#linha-do-tempo tbody tr.calendario-mes-tint-a { background:rgba(37,99,235,.045); }
#linha-do-tempo tbody tr.calendario-mes-tint-b { background:rgba(217,119,6,.045); }
#linha-do-tempo tbody tr.calendario-mes-tint-a:hover { background:rgba(37,99,235,.1); }
#linha-do-tempo tbody tr.calendario-mes-tint-b:hover { background:rgba(217,119,6,.1); }
#linha-do-tempo tbody tr.calendario-mes-tint-a .calendario-timeline-mes,
#linha-do-tempo tbody tr.calendario-mes-tint-b .calendario-timeline-mes { background:transparent; }
.calendario-badge-clicavel { border:none; cursor:pointer; font-family:inherit; transition:filter .15s, transform .15s; }
.calendario-badge-clicavel:hover, .calendario-badge-clicavel:focus-visible { filter:brightness(1.08); transform:translateY(-1px); }

/* ---------------- Calendario Eleitoral: legenda de categorias ---------------- */
.calendario-legenda { display:flex; flex-wrap:wrap; gap:14px; margin:0 0 20px; }
.calendario-legenda-item { display:inline-flex; align-items:center; gap:6px; font-size:12.5px; color:var(--muted); font-weight:600; }
.calendario-legenda-dot { width:10px; height:10px; border-radius:50%; flex:none; }

/* ---------------- Calendario Eleitoral: navegacao (Hoje / setas / titulo) ---------------- */
.gcal-nav { display:flex; align-items:center; gap:14px; margin-bottom:14px; flex-wrap:wrap; }
.gcal-btn-hoje {
  font-size:12.5px; font-weight:700; color:var(--navy); background:var(--surface); border:1px solid var(--line-soft);
  border-radius:999px; padding:7px 16px; cursor:pointer; transition:background .15s;
}
.gcal-btn-hoje:hover, .gcal-btn-hoje:focus-visible { background:var(--surface-2, #f7f8fb); }
.gcal-nav-setas { display:flex; gap:4px; }
.gcal-btn-seta {
  width:32px; height:32px; border-radius:50%; border:1px solid var(--line-soft); background:var(--surface);
  color:var(--navy); font-size:18px; line-height:1; cursor:pointer; display:inline-flex;
  align-items:center; justify-content:center; transition:background .15s;
}
.gcal-btn-seta:hover, .gcal-btn-seta:focus-visible { background:var(--surface-2, #f7f8fb); }
.gcal-nav-titulo { font-size:18px; font-weight:800; color:var(--navy); margin:0; text-transform:capitalize; }
.gcal-nav .gcal-badge-eventos {
  font-size:11px; font-weight:700; color:var(--muted); background:var(--surface-2, #f7f8fb);
  border-radius:999px; padding:3px 10px;
}

/* ---------------- Calendario Eleitoral: grade estilo Google Calendar (um mes por vez) ---------------- */
.gcal-meses { position:relative; }
.gcal-mes-card { display:none; border:1px solid var(--line-soft); border-radius:var(--radius-sm); overflow:hidden; background:var(--surface); box-shadow:var(--shadow-sm); }
.gcal-mes-card.ativo { display:block; }
.gcal-grid { display:grid; grid-template-columns:repeat(7, 1fr); }
.gcal-dow {
  font-size:11px; font-weight:700; color:var(--muted); text-align:center; text-transform:uppercase;
  padding:10px 4px; background:var(--surface-2, #f7f8fb); border-bottom:1px solid var(--line-soft);
}
.gcal-dia {
  min-height:112px; padding:8px 6px; position:relative; background:var(--surface);
  border-right:1px solid var(--line-soft); border-bottom:1px solid var(--line-soft);
  display:flex; flex-direction:column; gap:6px;
}
.gcal-dia:nth-child(7n) { border-right:none; }
.gcal-dia.vazio { background:var(--surface-2, #f7f8fb); }
.gcal-dia-num {
  font-size:12.5px; color:var(--navy); font-weight:600; line-height:1; align-self:flex-start;
  width:24px; height:24px; border-radius:50%; display:flex; align-items:center; justify-content:center;
}
.gcal-dia.hoje .gcal-dia-num { background:var(--gold, #c9932f); color:#fff; font-weight:800; }
.gcal-dia-eventos { display:flex; flex-direction:column; gap:3px; max-width:100%; }
.gcal-evento-chip {
  display:flex; align-items:center; gap:4px; border:none; padding:2px 4px; border-radius:4px;
  background:var(--surface-2, #f7f8fb); cursor:pointer; max-width:100%; font-family:inherit;
  transition:background .15s, transform .15s;
}
.gcal-evento-chip:hover, .gcal-evento-chip:focus-visible { background:var(--line-soft); transform:translateX(1px); }
.gcal-evento-dot { width:7px; height:7px; border-radius:50%; flex:none; }
.gcal-evento-label {
  font-size:9.5px; font-weight:700; color:var(--navy); white-space:nowrap; overflow:hidden;
  text-overflow:ellipsis; line-height:1.2;
}
.gcal-dia-mais { font-size:9px; font-weight:700; color:var(--muted); line-height:1; padding-left:2px; }

/* ---------------- Formularios / filtros ---------------- */
.filter-form { display:flex; gap:12px; flex-wrap:wrap; align-items:end; margin-bottom: 18px; }
.filter-field { display:flex; flex-direction:column; gap:6px; font-size:12.5px; color:var(--ink-soft); font-weight:700; }
.filter-field input, .filter-field select {
  padding:10px 13px; border-radius:10px; border:1.5px solid var(--line); font-size:14px; min-width:180px;
  font-family: inherit; background:var(--surface); color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease;
}
.filter-field input:hover, .filter-field select:hover { border-color:#c8cede; }
.filter-field input:focus, .filter-field select:focus {
  border-color: var(--navy); box-shadow: 0 0 0 3.5px rgba(16,26,51,.12); outline: none;
}

.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 18px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, var(--navy-2), var(--navy)); color: #fff; font-weight: 700; font-size: 13.5px;
  cursor: pointer; text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); filter: brightness(1.06); }
.btn:active { transform: translateY(0); filter: brightness(.97); }
.btn.secondary { background:var(--surface-2); color:var(--ink); box-shadow:none; border: 1.5px solid var(--line); }
.btn.secondary:hover { background:#eceef5; }
.btn.small { padding:6px 12px; font-size:12px; border-radius:8px; }
.btn.ghost { background:transparent; color:var(--navy); border:1.5px solid var(--line); box-shadow:none; }
.btn.ghost:hover { background: var(--surface-2); border-color:#c8cede; }
.btn.danger { background: var(--danger); color:#fff; }
.btn.danger:hover { filter: brightness(1.08); }

/* ---------------- Botao com menu (ex: "Imprimir PDF") ---------------- */
.dropdown-btn { position:relative; display:inline-flex; }
.dropdown-btn summary { list-style:none; }
.dropdown-btn summary::-webkit-details-marker { display:none; }
.dropdown-btn[open] summary { filter:brightness(.95); }
.dropdown-menu {
  position:absolute; top:calc(100% + 8px); right:0; z-index:60; min-width:270px;
  background:#fff; border:1px solid var(--line); border-radius:12px; padding:6px;
  box-shadow: var(--shadow-md); display:flex; flex-direction:column; gap:2px;
}
.dropdown-menu a {
  display:block; padding:10px 12px; border-radius:8px; color:var(--ink); text-decoration:none;
  font-size:13.5px; font-weight:600;
}
.dropdown-menu a:hover { background:var(--surface-2); }
.dropdown-sep { height:1px; background:var(--line-soft); margin:5px 2px; }

.form-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap:16px; }
.form-field { display:flex; flex-direction:column; gap:6px; margin-bottom:16px; }
.form-field label { font-size:12.5px; font-weight:800; color: var(--ink-soft); }
.form-field input, .form-field select, .form-field textarea {
  padding:11px 13px; border-radius:10px; border:1.5px solid var(--line); font-size:14.5px; font-family:inherit;
  transition: border-color .15s ease, box-shadow .15s ease; background:var(--surface); color:var(--ink);
}
.form-field input:hover, .form-field select:hover, .form-field textarea:hover { border-color:#c8cede; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--navy); box-shadow: 0 0 0 3.5px rgba(16,26,51,.12); outline: none;
}
.form-field textarea { resize: vertical; min-height:76px; }
.checkbox-row { display:flex; align-items:center; gap:8px; font-size:13.5px; font-weight:600; }
.checkbox-row input[type="checkbox"], .checkbox-row input[type="radio"] { width:16px; height:16px; accent-color: var(--navy); }

.checklist-secao {
  margin:14px 0; padding:14px 18px; border:1.5px solid var(--line-soft); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.checklist-secao-title {
  display:block; margin-bottom:10px; font-size:12.5px; font-weight:800; letter-spacing:.03em;
  text-transform: uppercase; color: var(--info);
}
.checklist-secao label.checkbox-row { align-items:flex-start; font-weight:400; margin-bottom:10px; }
.checklist-secao label.checkbox-row input { margin-top:3px; }

.alert {
  display:flex; align-items:flex-start; gap:10px;
  padding:13px 16px; border-radius:12px; font-size:13.5px; margin-bottom:18px; font-weight:600;
  border: 1px solid transparent;
}
.alert::before { font-weight:900; flex:none; line-height:1.35; }
.alert.success { background:var(--success-bg); color:var(--success); border-color: rgba(21,128,61,.18); }
.alert.success::before { content: "\2713"; }
.alert.error { background:var(--danger-bg); color:var(--danger); border-color: rgba(185,28,28,.18); }
.alert.error::before { content: "\26A0"; }
.alert.warning { background:var(--warn-bg); color:var(--warn); border-color: rgba(146,64,14,.18); align-items:center; flex-wrap:wrap; }
.alert.warning::before { content: "\26A0"; }
.alert.warning .inline-form { margin-left:auto; }

/* ---------------- Backup: barra de progresso ---------------- */
.backup-progress { margin-top:14px; }
.backup-progress-track {
  width:100%; height:10px; border-radius:999px; background:var(--surface-2, #f7f8fb);
  border:1px solid var(--line-soft); overflow:hidden;
}
.backup-progress-fill {
  height:100%; width:0%; border-radius:999px; background:var(--gold, #c9932f);
  transition:width .3s ease, background-color .3s ease;
}
.backup-progress-label { margin:8px 0 0; font-size:12.5px; color:var(--muted); font-weight:600; }
.backup-progress-label span:first-child { color:var(--navy); font-weight:800; }
.alert:not(.success):not(.error) { background:var(--info-bg); color:var(--info); border-color: rgba(55,48,163,.16); }
.alert:not(.success):not(.error)::before { content: "\2139"; }

.pagination {
  display:flex; gap:8px; margin-top:18px; flex-wrap:nowrap;
  overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch;
  scroll-behavior:smooth; padding:2px 2px 8px;
}
.pagination::-webkit-scrollbar { height:6px; }
.pagination::-webkit-scrollbar-track { background:transparent; }
.pagination::-webkit-scrollbar-thumb { background:var(--line); border-radius:99px; }
.pagination::-webkit-scrollbar-thumb:hover { background:#c8cede; }
.pagination a, .pagination span {
  flex:none;
  padding:7px 13px; border-radius:8px; border:1.5px solid var(--line); font-size:12.5px; text-decoration:none;
  font-weight:700; transition: border-color .15s ease, background .15s ease;
}
.pagination a:hover { border-color:#c8cede; background: var(--surface-2); }
.pagination .current { background:var(--navy-2); color:#fff; border-color:var(--navy-2); }

.badge-source { display:inline-block; background:var(--surface-2); color:var(--muted); font-size:11px; font-weight:700; padding:4px 10px;
  border-radius:999px; margin-left:8px; }

/* ---------------- Rumo ao Sucesso: progresso e funil ---------------- */
.meta-progress-wrap { margin: 20px 0 10px; }
.meta-progress-track {
  background: var(--surface-2); border-radius:14px; height:30px; overflow:hidden; position:relative;
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.meta-progress-fill {
  height:100%; border-radius:14px; background: linear-gradient(90deg, var(--navy-2), var(--wine));
  transition: width .6s cubic-bezier(.22,.9,.34,1);
}
.meta-progress-label {
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-size:12.5px; font-weight:800; color:#fff; text-shadow:0 1px 3px rgba(0,0,0,.4); letter-spacing:.01em;
}
.jornada-grid { display:grid; grid-template-columns: 1fr 1.05fr; gap:28px; align-items:start; }
.meta-form { display:flex; gap:12px; align-items:end; flex-wrap:wrap; }
.meta-form input[type="number"] {
  padding:10px 13px; border-radius:10px; border:1.5px solid var(--line); font-size:14px; width:170px; font-family:inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.meta-form input[type="number"]:focus { border-color: var(--navy); box-shadow: 0 0 0 3.5px rgba(16,26,51,.12); outline:none; }

/* ---- Funil da jornada (ilustracao 100% CSS -- cadastros > enviados >
   confirmados, cada barra proporcional a etapa anterior, com seta entre
   cada passo). A meta de votos e uma barra de progresso separada logo
   abaixo, porque e uma grandeza (milhares de votos) que nao cabe na mesma
   escala visual das etapas de contato. ---- */
.gami-funil { display:flex; flex-direction:column; gap:6px; margin-bottom:22px; }
.gami-funil-etapa { display:flex; flex-direction:column; gap:6px; }
.gami-funil-barra-wrap { width:100%; }
.gami-funil-barra {
  width: var(--etapa-largura, 100%); min-width:150px; max-width:100%;
  display:flex; align-items:center; gap:10px; height:52px; padding:0 18px;
  border-radius: 12px 999px 999px 12px;
  background: linear-gradient(100deg, var(--etapa-cor), color-mix(in srgb, var(--etapa-cor) 65%, #000));
  color:#fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--etapa-cor) 35%, transparent);
  transition: width .8s cubic-bezier(.22,.9,.34,1);
  animation: gami-funil-entra .6s cubic-bezier(.22,1.1,.4,1) both;
}
.gami-funil-icon { width:22px; height:22px; flex:none; opacity:.92; }
.gami-funil-valor { font-size:17px; font-weight:800; letter-spacing:-.01em; }
.gami-funil-legenda { display:flex; align-items:center; gap:7px; font-size:12.5px; font-weight:700; color: var(--ink-soft); padding-left:2px; }
.gami-funil-legenda .dot { width:9px; height:9px; flex:none; }
.gami-funil-conv { color: var(--muted); font-weight:600; }
.gami-funil-seta { display:flex; align-items:center; padding-left:20px; color: var(--line); margin:-2px 0; }
.gami-funil-seta svg { width:16px; height:16px; }
@keyframes gami-funil-entra {
  from { opacity:0; transform: translateX(-14px) scaleX(.92); transform-origin:left center; }
  to   { opacity:1; transform: translateX(0) scaleX(1); }
}

.gami-funil-meta {
  margin-top:6px; padding-top:18px; border-top:1px dashed var(--line-soft);
}
.gami-funil-meta-topo { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:9px; }
.gami-funil-meta-label { display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:800; color: var(--navy-2); }
.gami-funil-meta-label svg { width:18px; height:18px; color: var(--wine); }
.gami-funil-meta-topo strong { font-size:15px; color: var(--wine); }
.gami-funil-meta-track {
  height:16px; border-radius:999px; background: var(--surface-2); overflow:hidden;
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.gami-funil-meta-fill {
  height:100%; border-radius:999px; background: linear-gradient(90deg, var(--wine), var(--gold));
  transition: width 1.1s cubic-bezier(.22,.9,.36,1);
}
.gami-funil-meta-sub { font-size:12px; color: var(--muted); font-weight:600; margin-top:7px; }

/* ---------------- Login ---------------- */
.login-body {
  background: linear-gradient(160deg, var(--navy-2), var(--navy) 55%, var(--wine-2));
  min-height: 100vh;
}
.login-shell {
  min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:24px; gap:22px;
}
.login-top-brand {
  display:flex; flex-direction:column; align-items:center; gap:12px;
}
.login-top-logo {
  width:76px; height:76px; border-radius:22px; box-shadow: var(--shadow-lg); display:block;
}
.login-top-brand-text {
  color:#fff; font-size:20px; font-weight:400; letter-spacing:0; text-align:center;
  text-shadow: 0 2px 10px rgba(0,0,0,.2);
}
.login-card {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width:100%; max-width:400px; padding:34px 30px 30px;
}
.login-brand { text-align:center; margin-bottom:22px; }
.login-brand .brand-sub {
  color: var(--muted); text-transform:uppercase; letter-spacing:.04em; font-size:11px;
  font-weight:700;
}
.login-card h1 { font-size:20px; margin:0 0 4px; text-align:center; justify-content:center; }
.login-card .panel-sub { text-align:center; margin: 0 0 20px; max-width:none; }
.login-submit { width:100%; justify-content:center; }

/* ---------------- Rodape ---------------- */
footer {
  color:var(--muted); font-size:12px; text-align:center; padding: 26px 20px 4px;
  border-top: 1px solid var(--line-soft); line-height:1.7;
}

/* ---------------- Responsivo ---------------- */
@media (max-width: 980px) {
  .kpi-grid, .kpi-grid-4 { grid-template-columns: repeat(3,1fr); }
  .map-grid { grid-template-columns: 1fr; }
  .jornada-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  section.panel { padding: 20px; }
  .content { padding: 24px 20px 60px; }
}
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width:100%; height:auto; position:relative; flex-direction:row; align-items:center;
    padding: 12px 14px; overflow-x:auto; gap: 6px;
  }
  .sidebar-brand { padding: 2px 18px 2px 2px; margin-bottom:0; border-bottom:none; border-right: 1px solid rgba(255,255,255,.1); }
  .brand-sub { display:none; }
  .sidebar-user { display:none; }
  .sidebar-nav { flex-direction:row; margin-top:0; flex:none; }
  .sidebar-nav-group { display:contents; }
  .sidebar-nav-items { display:contents !important; }
  .sidebar-nav-label { display:none; }
  .sidebar-nav a { white-space:nowrap; padding:10px 12px; }
  .sidebar-nav-exit { margin-top:0; padding-top:10px; border-top:none; border-left:1px solid rgba(255,255,255,.1); border-radius:0 10px 10px 0; }
  .sidebar-foot { display:none; }
  .page-head { align-items:flex-start; }
}
@media (max-width: 560px) {
  .kpi-grid, .kpi-grid-4, .kpi-grid-2 { grid-template-columns: repeat(2,1fr); }
  .zone-mini-stats { margin-left:0; width:100%; }
  .bar-row { grid-template-columns: 1fr; row-gap:6px; }
  .bar-track, .bar-value { grid-column: 1; }
  .chart-wrap { height: 240px; }
  .chart-wrap.small { height: 220px; }
  .filter-form, .meta-form { flex-direction:column; align-items:stretch; }
  .filter-field input, .filter-field select { min-width:0; width:100%; }
  .meta-form input[type="number"] { width:100%; }
  .filter-form .btn, .filter-form .btn.secondary,
  .meta-form .btn, .form-field + .btn { width:100%; justify-content:center; }
  .page-head { flex-direction:column; align-items:stretch; }
  .page-head-extra .btn, .page-head-extra { width:100%; }
  .page-head-extra .btn { justify-content:center; }
  .page-head-extra .dropdown-btn { width:100%; }
  .page-head-extra .dropdown-btn summary.btn { width:100%; justify-content:center; }
  .dropdown-menu { left:0; right:0; width:auto; }
  .gami-funil-barra { width:100% !important; min-width:0; }
  .gami-funil-seta { padding-left:0; justify-content:center; }
  .gami-destaque-top3 { flex-direction:column; }
}
@media (max-width: 480px) {
  .content { padding: 18px 14px 50px; }
  section.panel { padding: 16px; }
  .kpi-grid, .kpi-grid-4, .kpi-grid-2 { grid-template-columns: repeat(2,1fr); gap:10px; }
  .kpi-value { font-size:21px; }
  .modal-box { padding: 18px 16px 20px; }
  .map-photo-zoom span, .map-photo-zoom { font-size:11px; padding:6px 11px 6px 9px; }
  table { font-size:12.4px; }
  th, td { padding:9px 10px; }
  td > .btn.small, td .inline-form { display:block; margin:0 0 6px; }
  td > .btn.small:last-child, td .inline-form:last-child { margin-bottom:0; }
  .meta-progress-track { height:auto; min-height:34px; padding:8px 6px; }
  .meta-progress-fill { position:absolute; inset:0; z-index:0; height:auto; }
  .meta-progress-label {
    position:relative; z-index:1; white-space:normal; line-height:1.3; font-size:11.5px;
    padding:0 4px; text-align:center;
  }
  .gcal-nav { gap:10px; }
  .gcal-nav-titulo { font-size:15px; width:100%; order:3; }
  .gcal-dia { min-height:64px; padding:5px 3px; }
  .gcal-dia-num { font-size:11px; width:20px; height:20px; }
  .gcal-dow { font-size:9px; padding:7px 2px; }
  .gcal-evento-label { font-size:8.5px; }
}
@media (max-width: 360px) {
  .kpi-grid, .kpi-grid-4, .kpi-grid-2 { grid-template-columns: 1fr; }
}

/* ---------------- Lideranca: checkbox extra, badge e banner ---------------- */
.checkbox-field { margin-top:2px; margin-bottom:18px; }
.field-hint { font-weight:400; color:var(--muted); font-size:12px; }

.badge-lideranca {
  background: rgba(122,31,31,.12); color: var(--wine); margin-left:6px;
}
.badge-multiplicador {
  background: rgba(201,147,47,.16); color: var(--gold, #c9932f); margin-left:6px;
}

section.panel.lideranca-banner {
  display:flex; align-items:center; gap:18px;
  background: linear-gradient(135deg, var(--wine), var(--wine-2));
  color:#fff;
}
.lideranca-banner-icon {
  flex:none; width:48px; height:48px; border-radius:50%;
  background: rgba(255,255,255,.16); display:flex; align-items:center; justify-content:center;
}
.lideranca-banner-icon .icon { width:24px; height:24px; color:#fff; }
.lideranca-banner-title { font-size:17px; font-weight:800; }
.lideranca-banner-sub { font-size:13px; opacity:.85; margin-top:2px; }

.presenca-list {
  display:flex; flex-direction:column; gap:2px; max-height:400px; overflow-y:auto;
  padding-right:6px; margin-top:6px; border-top:1px solid var(--line-soft); padding-top:4px;
}
.presenca-list .checkbox-row { font-weight:600; }

.presenca-item {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:10px 4px; border-bottom:1px solid var(--line-soft);
}
.presenca-item:last-child { border-bottom:none; }
.presenca-nome { font-size:13.5px; font-weight:700; color:var(--navy); }
.presenca-opcoes { display:flex; gap:14px; flex:none; }
.presenca-opcoes label {
  display:flex; align-items:center; gap:5px; font-size:12.5px; font-weight:600; color:var(--muted);
  white-space:nowrap; cursor:pointer;
}
.presenca-opcoes input[type="radio"] { width:15px; height:15px; accent-color: var(--navy); margin:0; }
.presenca-opcoes label:has(input:checked) { color:var(--navy); }

.status-pill-btn {
  border:none; -webkit-appearance:none; appearance:none; cursor:pointer; font-family:inherit;
  transition: filter .15s ease;
}
.status-pill-btn:hover, .status-pill-btn:focus-visible { filter:brightness(.94); }

.nomes-popup-list { list-style:none; margin:10px 0 0; padding:0; display:flex; flex-direction:column; gap:2px; max-height:380px; overflow-y:auto; }
.nomes-popup-list li {
  display:flex; align-items:center; gap:8px; font-size:13.5px; font-weight:600; color:var(--navy);
  padding:9px 4px; border-bottom:1px solid var(--line-soft);
}
.nomes-popup-list li:last-child { border-bottom:none; }

@media (max-width: 560px) {
  .lideranca-banner { flex-direction:column; align-items:flex-start; gap:10px; }
  .presenca-item { flex-direction:column; align-items:flex-start; gap:8px; }
}

/* ---------------- Cadastros: acoes em icone colorido + tooltip ---------------- */
.sr-only {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

.actions-icons { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
/* Sobrescreve a regra generica "td .inline-form { display:block }" do modo
   mobile (ela e para os botoes de texto antigos) -- aqui os forms sempre
   ficam lado a lado, como icones. */
.actions-icons .inline-form { display:inline-flex; margin:0; }

.icon-btn {
  display:inline-flex; align-items:center; justify-content:center;
  width:34px; height:34px; border-radius:9px; border:1.5px solid transparent;
  cursor:pointer; position:relative; padding:0; flex:none;
  transition: transform .12s ease, filter .12s ease, background .12s ease, color .12s ease;
}
.icon-btn .icon { width:16px; height:16px; }
.icon-btn:hover { transform:translateY(-1px); filter:brightness(.95); }
.icon-btn:active { transform:translateY(0); }
.icon-btn:focus-visible { outline:2px solid var(--navy-2); outline-offset:2px; }

.icon-btn.edit    { background:var(--info-bg);    color:var(--info);    border-color:rgba(55,48,163,.16); }
.icon-btn.info    { background:var(--info-bg);    color:var(--info);    border-color:rgba(55,48,163,.16); }
.glossario-lista dt { font-weight:600; color:var(--navy-2); margin-top:14px; }
.glossario-lista dt:first-child { margin-top:0; }
.glossario-lista dd { margin:2px 0 0; color:var(--muted, #565f78); }
.glossario-lista h4 { margin:18px 0 4px; font-size:13px; text-transform:uppercase; letter-spacing:.02em; color:var(--info); }
.glossario-lista h4:first-child { margin-top:0; }
.icon-btn.send    { background:var(--warn-bg);    color:var(--warn);    border-color:rgba(146,64,14,.16); }
.icon-btn.confirm { background:var(--success-bg); color:var(--success); border-color:rgba(21,128,61,.16); }
.icon-btn.delete  { background:var(--danger-bg);  color:var(--danger);  border-color:rgba(185,28,28,.16); }

.icon-btn.send.active    { background:var(--warn);    color:#fff; }
.icon-btn.confirm.active { background:var(--success); color:#fff; }

/* Tooltip customizado (mesmo padrao usado no mapa de municipios) */
.icon-btn[data-tip]::after {
  content: attr(data-tip);
  position:absolute; bottom:calc(100% + 9px); left:50%; transform:translateX(-50%) translateY(4px);
  background:var(--navy-2); color:#fff; font-size:11.5px; font-weight:700; white-space:nowrap;
  padding:6px 11px; border-radius:7px; opacity:0; pointer-events:none;
  transition: opacity .15s ease, transform .15s ease; z-index:30;
  box-shadow: 0 8px 20px rgba(0,0,0,.2);
}
.icon-btn[data-tip]::before {
  content:""; position:absolute; bottom:calc(100% + 4px); left:50%; transform:translateX(-50%);
  border:5px solid transparent; border-top-color:var(--navy-2); opacity:0; pointer-events:none;
  transition: opacity .15s ease; z-index:30;
}
.icon-btn[data-tip]:hover::after, .icon-btn[data-tip]:focus-visible::after,
.icon-btn[data-tip]:hover::before, .icon-btn[data-tip]:focus-visible::before {
  opacity:1; transform:translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  td .actions-icons { justify-content:flex-start; }
}

/* ---------------- Aniversariantes ---------------- */
section.panel.aniversario-banner {
  background: linear-gradient(135deg, var(--gold), #a97423);
  color:#2b1c05;
}
.aniversario-banner-head { display:flex; align-items:center; gap:18px; }
.aniversario-banner-icon {
  flex:none; width:48px; height:48px; border-radius:50%;
  background: rgba(255,255,255,.35); display:flex; align-items:center; justify-content:center;
}
.aniversario-banner-icon .icon { width:24px; height:24px; color:#2b1c05; }
.aniversario-banner-title { font-size:17px; font-weight:800; }
.aniversario-banner-sub { font-size:13px; opacity:.8; margin-top:2px; }

.aniversario-hoje-grid {
  display:grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap:12px; margin-top:18px;
}
.aniversario-card {
  background: rgba(255,255,255,.55); border-radius: var(--radius-sm); padding:14px 16px;
  border: 1px solid rgba(255,255,255,.6);
}
.aniversario-card-nome { font-size:14.5px; font-weight:800; color:#2b1c05; }
.aniversario-card-info { font-size:12px; color:#4a3510; margin-top:2px; font-weight:600; }
.aniversario-card-fone {
  display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:8px;
  font-size:12.5px; font-weight:700; color:#2b1c05;
}
.aniversario-card-fone .icon { width:14px; height:14px; flex:none; }
.aniversario-wa-link {
  margin-left:auto; font-size:11.5px; font-weight:800; color:#15803d; text-decoration:none;
  background:var(--surface); padding:4px 10px; border-radius:999px; box-shadow: var(--shadow-sm);
}
.aniversario-wa-link:hover { filter:brightness(.96); }

tr.linha-aniversario-hoje td { background: #fdf3e0; }

@media (max-width: 560px) {
  .aniversario-banner-head { flex-direction:column; align-items:flex-start; gap:10px; }
}

/* ---------------- Enquete (perfil DISC do eleitor) ---------------- */
.link-publico-row { display:flex; gap:10px; flex-wrap:wrap; }
.link-publico-row input[type="text"] {
  flex:1; min-width:220px; padding:10px 12px; border:1px solid var(--line-soft); border-radius: var(--radius-sm);
  font-size:13px; color: var(--ink-soft); background: var(--surface-2); font-family: monospace;
}
.link-publico-row .btn { flex:none; }

.disc-form { display:flex; flex-direction:column; gap:22px; }

.disc-pergunta { border-top: 1px solid var(--line-soft); padding-top:16px; }
.disc-pergunta-titulo { font-size:14.5px; font-weight:800; margin-bottom:12px; }

.disc-alternativas { display:grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap:10px; }
.disc-alternativa {
  display:flex; align-items:flex-start; gap:10px; cursor:pointer;
  background: var(--surface-2); border: 1.5px solid var(--line-soft); border-radius: var(--radius-sm);
  padding:12px 14px; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.disc-alternativa:hover { border-color: var(--gold); }
.disc-alternativa input[type="radio"] { margin-top:2px; width:16px; height:16px; flex:none; accent-color: var(--navy); }
.disc-alternativa:has(input:checked) {
  border-color: var(--navy); background:var(--surface); box-shadow: 0 0 0 1px var(--navy) inset, var(--shadow-sm);
}
.disc-alternativa-letra {
  flex:none; width:24px; height:24px; border-radius:50%; background: var(--navy);
  color:#fff; font-size:11.5px; font-weight:800; display:flex; align-items:center; justify-content:center;
}
.disc-alternativa-texto { font-size:13.3px; font-weight:600; color: var(--ink-soft, #2c3550); line-height:1.35; }

/* KPIs coloridos por perfil (--dc definido inline via style="--dc:...") */
.disc-kpi-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap:14px; }
.disc-kpi-card {
  border-radius: var(--radius); padding:16px 15px; text-align:center;
  background: linear-gradient(135deg, var(--navy-2), var(--navy) 70%); border: 1px solid var(--navy-2);
  display:flex; flex-direction:column; align-items:center; gap:4px;
  border-top: 4px solid var(--dc, var(--gold)); color:#fff;
}
.disc-kpi-total { border-top-color: var(--gold); }
.disc-kpi-card .disc-kpi-label { color:#c3cbe4; }
.disc-kpi-sigla {
  width:26px; height:26px; border-radius:50%; background: var(--dc, var(--muted)); color:#fff;
  font-size:12px; font-weight:800; display:flex; align-items:center; justify-content:center; margin-bottom:2px;
}
.disc-kpi-value { font-size:22px; font-weight:800; letter-spacing:-.01em; }
.disc-kpi-label { font-size:11.8px; color: var(--muted); font-weight:700; }

/* Legenda de interpretacao dos 4 perfis + misto */
.disc-legenda-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap:14px; }
.disc-legenda-card {
  border-radius: var(--radius-sm); padding:15px 16px; background: #fff;
  border: 1px solid var(--line-soft); border-left: 5px solid var(--dc, var(--muted));
}
.disc-legenda-head { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.disc-legenda-sigla {
  flex:none; width:32px; height:32px; border-radius:50%; background: var(--dc, var(--muted)); color:#fff;
  font-size:14px; font-weight:800; display:flex; align-items:center; justify-content:center;
}
.disc-legenda-nome { font-size:14px; font-weight:800; }
.disc-legenda-apelido { font-size:11.8px; color: var(--dc, var(--muted)); font-weight:700; }
.disc-legenda-desc { font-size:12.8px; color: var(--ink-soft, #2c3550); line-height:1.45; margin:0; }

/* Selo de perfil usado na tabela de enquetes recentes */
.disc-perfil-pill {
  display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:800;
  padding:4px 10px; border-radius:999px; background: color-mix(in srgb, var(--dc, var(--muted)) 15%, #fff);
  color: var(--dc, var(--muted));
}

@media (max-width: 560px) {
  .disc-alternativas { grid-template-columns: 1fr; }
}

/* ---------------- Popup "Ver respostas" da enquete ---------------- */
.mvr-box { max-width: 560px; }
.mvr-meta { font-size:12.6px; color: var(--muted); margin:0 0 8px; }
.mvr-perfil-tag { margin-bottom:16px; }
.mvr-secao { margin-top:18px; }
.mvr-secao h4 {
  margin:0 0 8px; font-size:13px; font-weight:800; color: var(--navy-2);
  text-transform: uppercase; letter-spacing:.02em;
}
.mvr-lista { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
.mvr-lista li {
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  padding:10px 12px; font-size:12.8px; line-height:1.5;
}
.mvr-lista li strong { display:block; color: var(--ink, #1c2436); font-size:12.8px; margin-bottom:3px; }
.mvr-lista-resp { color: var(--ink-soft, #2c3550); }
.mvr-card { border-radius: var(--radius-sm); padding:14px 16px; border:1px solid var(--line-soft); }
.mvr-card p { margin:0; font-size:12.8px; line-height:1.55; color: var(--ink-soft, #2c3550); }
.mvr-card-pessoa { background: var(--surface-2); }
.mvr-card-pessoa .mvr-hint { font-size:11.3px; color: var(--muted); margin-bottom:8px; font-style:italic; }
.mvr-card-afinidade { background: var(--info-bg, #eef2ff); border-color: rgba(55,48,163,.16); }
.mvr-afinidade-rotulo { font-size:13px; font-weight:800; color: var(--info, #3730a3); margin-bottom:6px; }
.mvr-aviso { margin-top:10px !important; font-size:11.3px !important; color: var(--muted) !important; font-style:italic; }

/* Aviso introdutorio do popup de exclusao de enquete (motivo obrigatorio) */
.mev-aviso {
  font-size:12.6px; line-height:1.5; color: var(--ink-soft, #2c3550);
  background: var(--danger-bg); border: 1px solid rgba(185,28,28,.16); border-radius: var(--radius-sm);
  padding:11px 13px; margin:0 0 16px;
}
.modal-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:6px; }

/* ---------------- Niveis de acesso (checkboxes, ate 3 por usuario) ---------------- */
.niveis-checklist { max-width: 620px; }
.niveis-checklist > label { display:block; font-size:12.6px; font-weight:700; color:var(--ink-soft, #2c3550); margin-bottom:8px; }
.niveis-grid {
  display:grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap:8px 16px;
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  padding:12px 14px;
}
.niveis-grid .checkbox-row { font-weight:500; }
.niveis-grid input[type="checkbox"]:disabled { opacity:.35; cursor:not-allowed; }
.niveis-grid label:has(input:disabled) { opacity:.55; }

@media (max-width: 560px) {
  .niveis-grid { grid-template-columns: 1fr; }
}

/* ---------------- Analise Estrategica (IA) ---------------- */
.analise-texto {
  font-size:13.8px; line-height:1.7; color: var(--ink-soft, #2c3550);
  background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding:26px 28px; white-space: normal;
}
.analise-texto h3 {
  margin:22px 0 8px; font-size:15px; font-weight:800; color: var(--navy-2);
  padding-bottom:6px; border-bottom:2px solid rgba(122,31,31,.14);
}
.analise-texto h3:first-child { margin-top:0; }
.analise-texto p { margin:0 0 10px; }
.analise-texto ul { margin:0 0 14px; padding-left:20px; }
.analise-texto li { margin:0 0 6px; }
.analise-texto strong { color: var(--navy-2); font-weight:700; }
#btn-gerar-analise:disabled { opacity:.7; cursor:wait; }
#btn-gerar-analise .icon { animation: analise-girar 1.4s linear infinite paused; }
#btn-gerar-analise:disabled .icon { animation-play-state: running; }
@keyframes analise-girar { from { transform:rotate(0deg); } to { transform:rotate(360deg); } }

.chave-api-actions { display:flex; align-items:flex-end; gap:12px; flex-wrap:wrap; }
.chave-api-form { display:flex; align-items:flex-end; gap:12px; flex-wrap:wrap; }
.chave-api-form .form-field { margin-bottom:0; }

.analise-dash-grid {
  display:grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap:14px;
  margin:14px 0 22px;
}
.analise-dash-grid .gauge-card { text-align:center; }
.analise-dash-grid .chart-card .gauge-card-head { justify-content:center; }
.pizza-canvas-wrap { position:relative; height:150px; margin-top:4px; }

#historico-analises table td.max-resumo,
#historico-analises .linha-atual { background: rgba(122,31,31,.05); }
#historico-analises .linha-atual td:first-child { border-left:3px solid #7a1f1f; }

/* =================================================================
   Gamificacao -- menu "Rumo ao Sucesso"
   ================================================================= */

/* ---- Emblema base (brasao em formato de escudo), reaproveitado no nivel
   da campanha, nos avatares do podio/ranking e nas medalhas de conquista.
   Usa a variavel --tier-cor (pessoas/conquistas) ou --lvl-cor (nivel da
   campanha) para colorir -- a mesma classe serve para os dois casos. ---- */
.gami-emblem {
  position:relative; flex:none;
  clip-path: polygon(50% 0%, 100% 22%, 100% 68%, 50% 100%, 0% 68%, 0% 22%);
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--tier-cor, var(--lvl-cor, var(--navy))) 85%, #fff) 0%,
    var(--tier-cor, var(--lvl-cor, var(--navy))) 55%,
    color-mix(in srgb, var(--tier-cor, var(--lvl-cor, var(--navy))) 70%, #000) 100%);
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.gami-emblem-letra { position:relative; z-index:2; color:#fff; font-weight:800; text-shadow:0 1px 3px rgba(0,0,0,.35); }
.gami-emblem-icon { position:absolute; inset:0; margin:auto; width:60%; height:60%; color:#fff; opacity:.28; z-index:1; }
.gami-emblem-stamp {
  position:absolute; bottom:-7px; left:50%; transform:translateX(-50%); z-index:3;
  width:20px; height:20px; border-radius:50%; background:var(--surface);
  border:2px solid var(--tier-cor, var(--lvl-cor, var(--navy)));
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 2px 5px rgba(0,0,0,.3);
}
.gami-emblem-stamp svg { width:11px; height:11px; color: var(--tier-cor, var(--lvl-cor, var(--navy))); }

/* ---- Hero: nivel da campanha ----
   Observacao: usamos o seletor composto "section.panel.gami-hero" (em vez de
   so ".gami-hero") de proposito -- a regra generica "section.panel" (que
   define o fundo claro padrao dos paineis) tem especificidade elemento+classe,
   maior que uma classe sozinha. Sem o composto, o fundo escuro do hero perdia
   a "briga" de especificidade e caia no fundo claro padrao, deixando o texto
   branco ilegivel por cima. O mesmo vale para o banner de destaque abaixo. */
section.panel.gami-hero { background: linear-gradient(135deg, var(--navy-2), var(--navy) 75%); color:#fff; border:none; position:relative; overflow:hidden; }
.gami-hero .panel-sub { color:#c3cbe4; }
.gami-hero-top { display:flex; align-items:center; gap:20px; flex-wrap:wrap; position:relative; z-index:2; }
.gami-hero-watermark {
  position:absolute; top:-34px; right:-28px; width:230px; height:230px;
  color:#fff; opacity:.07; pointer-events:none; z-index:1;
}
.gami-hero-spark {
  position:absolute; border-radius:50%; background: var(--gold); opacity:.55; pointer-events:none;
  animation: gami-float 4.2s ease-in-out infinite; z-index:1;
}
.gami-hero-spark-1 { top:16%; right:22%; width:8px; height:8px; animation-delay:0s; }
.gami-hero-spark-2 { top:52%; right:9%;  width:5px; height:5px; animation-delay:1.3s; }
.gami-hero-spark-3 { top:74%; right:30%; width:6px; height:6px; animation-delay:2.4s; }
@keyframes gami-float {
  0%, 100% { transform: translateY(0); opacity:.4; }
  50% { transform: translateY(-16px); opacity:1; }
}
.gami-level-badge {
  width:82px; height:90px; flex-direction:column;
  animation: gami-pulse 2.6s ease-in-out infinite;
}
.gami-level-badge-num { position:relative; z-index:2; font-size:26px; font-weight:800; line-height:1; color:#fff; text-shadow:0 1px 3px rgba(0,0,0,.35); }
.gami-level-badge-tag { position:relative; z-index:2; font-size:9px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:rgba(255,255,255,.9); margin-top:2px; }
.gami-level-badge .gami-emblem-icon { width:52%; height:52%; opacity:.32; }
.gami-hero-text { flex:1; min-width:220px; }
.gami-hero-kicker { font-size:11.5px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; color:var(--gold); margin:0 0 2px; }
.gami-hero-title { font-size:24px; font-weight:800; margin:0 0 8px; color:#fff; }

.gami-xp-track {
  position:relative; height:22px; border-radius:999px; margin-top:20px; overflow:hidden;
  background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.gami-xp-fill {
  position:relative; height:100%; border-radius:999px; transition: width 1.1s cubic-bezier(.22,.9,.36,1);
  background: linear-gradient(90deg, var(--lvl-cor), color-mix(in srgb, var(--lvl-cor) 60%, #fff));
  box-shadow: 0 0 14px color-mix(in srgb, var(--lvl-cor) 70%, transparent);
}
.gami-xp-fill::after {
  content:''; position:absolute; inset:0;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,.35) 45%, transparent 60%);
  background-size: 220% 100%; animation: gami-shimmer 2.4s linear infinite;
}
.gami-xp-label {
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:800; color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.4); letter-spacing:.02em;
}
.gami-hero .kpi-card { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color:#fff; }
.gami-hero .kpi-card.highlight { background: rgba(201,147,47,.22); border-color: rgba(201,147,47,.4); }
.gami-hero .kpi-label { color:#c3cbe4; }
.gami-hero .kpi-icon { color:#fff; }

@keyframes gami-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255,255,255,.14), 0 8px 22px rgba(0,0,0,.35); }
  50% { box-shadow: 0 0 0 8px rgba(255,255,255,.06), 0 8px 26px rgba(0,0,0,.4); }
}
@keyframes gami-shimmer {
  from { background-position: 220% 0; }
  to { background-position: -20% 0; }
}

/* ---- Banner "quem vem se destacando" (top 3) ---- */
section.panel.gami-destaque-banner {
  background: linear-gradient(120deg, rgba(201,147,47,.12), rgba(122,31,31,.05));
  border-color: rgba(201,147,47,.3);
}
.gami-destaque-header { display:flex; align-items:center; gap:16px; margin-bottom:18px; }
.gami-destaque-icone {
  flex:none; width:52px; height:52px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background: rgba(201,147,47,.18); color: var(--gold); animation: gami-flame 1.8s ease-in-out infinite;
}
.gami-destaque-icone .icon { width:26px; height:26px; }
.gami-destaque-kicker { font-size:11.5px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; color: var(--gold); margin:0 0 2px; }
@keyframes gami-flame {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.gami-destaque-top3 { display:flex; gap:14px; flex-wrap:wrap; }
.gami-destaque-card {
  position:relative; flex:1 1 220px; display:flex; align-items:center; gap:12px;
  background: var(--surface); border:1px solid var(--line-soft); border-radius: var(--radius);
  padding:14px 16px; box-shadow: var(--shadow-sm);
}
.gami-destaque-card-1 {
  border-color: color-mix(in srgb, var(--gold) 45%, var(--line-soft));
  box-shadow: 0 5px 16px rgba(201,147,47,.2);
}
.gami-destaque-crown {
  position:absolute; top:-11px; left:16px; width:20px; height:20px; color: var(--gold);
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.25));
}
.gami-destaque-avatar { width:44px; height:50px; font-size:16px; flex:none; }
.gami-destaque-info { min-width:0; flex:1; }
.gami-destaque-pos { font-size:10.5px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; color: var(--muted); }
.gami-destaque-nome { font-size:14px; font-weight:800; color: var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin:1px 0 5px; }
.gami-destaque-xp { font-size:11px; font-weight:700; color: var(--navy-2); margin-top:5px; }

/* ---- Selo de tier (bronze/prata/ouro/platina/diamante/lendario) ---- */
.gami-tier-pill {
  display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:800;
  padding:3px 10px 3px 7px; border-radius:999px; white-space:nowrap;
  background: color-mix(in srgb, var(--tier-cor, var(--muted)) 16%, #fff);
  color: var(--tier-cor, var(--muted));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tier-cor, var(--muted)) 30%, transparent);
}
.gami-tier-pill-icon { width:12px; height:12px; flex:none; }

/* ---- Podio (top 3 do ranking de destaque) ---- */
.gami-podium { display:flex; align-items:flex-end; justify-content:center; gap:14px; margin:8px 0 20px; flex-wrap:wrap; }
.gami-podium-item {
  flex:1 1 160px; max-width:220px; display:flex; flex-direction:column; align-items:center; gap:6px;
  background: var(--surface-2); border:1px solid var(--line-soft); border-radius: var(--radius);
  padding:20px 14px 16px; text-align:center; position:relative;
  animation: gami-pop-in .5s cubic-bezier(.22,1.4,.4,1) both;
}
.gami-podium-1 { order:2; padding-top:14px; border-top:4px solid var(--gold); transform: translateY(-10px); box-shadow: var(--shadow-md); animation-delay:.05s; }
.gami-podium-2 { order:1; border-top:4px solid #8a94a6; animation-delay:.15s; }
.gami-podium-3 { order:3; border-top:4px solid #a05a2c; animation-delay:.25s; }
.gami-podium-crown { width:26px; height:26px; color: var(--gold); margin-bottom:-2px; animation: gami-float 3s ease-in-out infinite; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.gami-podium-avatar { width:54px; height:60px; font-size:19px; margin-bottom:8px; }
.gami-podium-1 .gami-podium-avatar { width:68px; height:76px; font-size:23px; }
.gami-podium-1 .gami-emblem-stamp { width:24px; height:24px; }
.gami-podium-1 .gami-emblem-stamp svg { width:13px; height:13px; }
.gami-podium-lugar { font-size:12px; font-weight:800; color: var(--muted); }
.gami-podium-nome { font-size:14px; font-weight:800; color: var(--ink); }
.gami-podium-xp { font-size:12.5px; font-weight:700; color: var(--navy-2); }
@keyframes gami-pop-in {
  from { opacity:0; transform: translateY(14px) scale(.94); }
  to { opacity:1; transform: translateY(0) scale(1); }
}

/* ---- Lista do ranking (posicoes 4 em diante) ---- */
.gami-rank-list { display:flex; flex-direction:column; gap:8px; }
.gami-rank-row {
  display:grid; grid-template-columns: 30px 40px 1fr auto auto; align-items:center; gap:12px;
  background: var(--surface-2); border:1px solid var(--line-soft); border-radius: var(--radius-sm);
  padding:12px 14px 10px;
}
.gami-rank-pos { font-size:12.5px; font-weight:800; color: var(--muted); text-align:center; }
.gami-rank-avatar { width:34px; height:38px; font-size:13px; margin-bottom:2px; }
.gami-rank-avatar .gami-emblem-stamp { width:14px; height:14px; bottom:-5px; }
.gami-rank-avatar .gami-emblem-stamp svg { width:8px; height:8px; }
.gami-rank-info { min-width:0; }
.gami-rank-nome { font-size:13.2px; font-weight:700; color: var(--ink); margin-bottom:5px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.gami-rank-bar-track { height:6px; border-radius:999px; background: var(--line-soft); overflow:hidden; }
.gami-rank-bar-fill { height:100%; border-radius:999px; transition: width .9s cubic-bezier(.22,.9,.36,1); }
.gami-rank-xp { font-size:12.5px; font-weight:800; color: var(--navy-2); white-space:nowrap; }

/* ---- Catalogo de conquistas: cada uma vira uma medalha com fita ---- */
.gami-badge-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap:16px 14px; }
.gami-badge-card {
  background: var(--surface-2); border:1px solid var(--line-soft); border-radius: var(--radius-sm);
  padding:18px 14px 16px; text-align:center; opacity:.55; filter:grayscale(.5); transition: opacity .2s ease, filter .2s ease, transform .2s ease;
}
.gami-badge-card.is-unlocked { opacity:1; filter:none; border-color: rgba(201,147,47,.35); background: linear-gradient(160deg, rgba(201,147,47,.1), var(--surface-2) 60%); }
.gami-badge-card.is-unlocked:hover { transform: translateY(-3px); }
.gami-badge-icon {
  position:relative; width:48px; height:54px; margin:0 auto 16px; display:flex; align-items:center; justify-content:center;
  clip-path: polygon(50% 0%, 100% 22%, 100% 70%, 50% 100%, 0% 70%, 0% 22%);
  background: linear-gradient(160deg, rgba(122,31,31,.2), rgba(16,26,51,.12)); color: var(--navy-2);
}
.gami-badge-icon::before, .gami-badge-icon::after {
  content:''; position:absolute; bottom:-8px; width:8px; height:14px;
  background: rgba(16,26,51,.22);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 68%, 0 100%);
}
.gami-badge-icon::before { left:9px; transform:rotate(8deg); }
.gami-badge-icon::after  { right:9px; transform:rotate(-8deg); }
.gami-badge-card.is-unlocked .gami-badge-icon {
  background: linear-gradient(160deg, #f0c869, var(--gold) 75%); color:#fff;
  box-shadow: 0 5px 12px rgba(201,147,47,.4);
}
.gami-badge-card.is-unlocked .gami-badge-icon::before,
.gami-badge-card.is-unlocked .gami-badge-icon::after { background: color-mix(in srgb, var(--gold) 55%, #7a1f1f); }
.gami-badge-icon .icon { width:22px; height:22px; }
.gami-badge-nome { font-size:12.8px; font-weight:800; color: var(--ink); margin-bottom:4px; }
.gami-badge-desc { font-size:11.3px; color: var(--muted); line-height:1.4; margin-bottom:8px; min-height:30px; }
.gami-badge-contagem { font-size:10.8px; font-weight:700; color: var(--navy-2); text-transform:uppercase; letter-spacing:.02em; }

/* ---- Ranking de regioes (times) ---- */
.gami-regiao-lista { display:flex; flex-direction:column; gap:10px; }
.gami-regiao-row { display:flex; align-items:center; gap:14px; }
.gami-regiao-lugar {
  flex:none; width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:800; background: var(--surface-2); color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.gami-regiao-lugar svg { width:17px; height:17px; }
.gami-regiao-lugar-1 { background: linear-gradient(160deg, #f0c869, var(--gold) 80%); color:#fff; box-shadow: 0 3px 8px rgba(201,147,47,.4); }
.gami-regiao-lugar-2 { background: linear-gradient(160deg, #c7cedb, #8a94a6 80%); color:#fff; box-shadow: 0 3px 8px rgba(138,148,166,.35); }
.gami-regiao-lugar-3 { background: linear-gradient(160deg, #cf8a56, #a05a2c 80%); color:#fff; box-shadow: 0 3px 8px rgba(160,90,44,.35); }
.gami-regiao-info { flex:1; min-width:0; display:flex; flex-direction:column; gap:5px; }

/* ================================================================
 * Comunicacao > WhatsApp: Kanban de Atendimento + painel de conversa (chat)
 * ================================================================ */
.status-pill.info { background: var(--info-bg); color: var(--info); }

.kanban-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-bottom:18px; }
.kanban-busca { display:flex; gap:8px; }
.kanban-busca input { padding:9px 12px; border:1.5px solid var(--line-soft); border-radius: var(--radius-sm); font-size:13.5px; min-width:260px; }
.kanban-aviso { background: var(--info-bg); color: var(--info); font-size:12.5px; font-weight:700; padding:8px 14px; border-radius: var(--radius-sm); }
.kanban-aviso a { color: inherit; text-decoration: underline; }

.kanban-board { display:grid; grid-template-columns: repeat(3, 1fr); gap:16px; align-items:start; }
.kanban-col { background: var(--surface); border:1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); display:flex; flex-direction:column; min-width:0; }
.kanban-col-head { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:14px 14px 10px; }
.kanban-col-count { font-size:12px; font-weight:800; color: var(--muted); background: var(--surface-2); border-radius:999px; padding:2px 9px; }
.kanban-col-body { display:flex; flex-direction:column; gap:10px; padding:0 12px 14px; max-height: 620px; overflow-y:auto; }
.kanban-empty { padding: 18px 8px !important; font-size:12.5px; }

.kanban-card {
  background:#fff; border:1px solid var(--line-soft); border-radius: var(--radius-sm);
  padding:11px 12px; cursor:pointer; transition: transform .12s ease, box-shadow .12s ease;
  display:flex; flex-direction:column; gap:5px;
}
.kanban-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color:#b7bfd4; }
.kanban-card-top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.kanban-card-nome { font-weight:800; font-size:13.5px; color: var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.kanban-badge-naolidas { background: var(--danger); color:#fff; font-size:11px; font-weight:800; border-radius:999px; min-width:19px; height:19px; display:inline-flex; align-items:center; justify-content:center; padding:0 5px; flex:none; }
.kanban-card-tel { font-size:11.5px; color: var(--muted); }
.kanban-card-assunto { font-size:12px; font-weight:700; color: var(--navy); }
.kanban-card-preview { font-size:12px; color: var(--ink-soft); overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.kanban-card-tags { display:flex; flex-wrap:wrap; gap:5px; }
.kanban-card-foot { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:2px; }
.kanban-card-tempo { font-size:11px; color: var(--muted); }
.kanban-card-atendente { font-size:11px; color: var(--muted); font-weight:700; }

.chip {
  display:inline-flex; align-items:center; background: var(--surface-2); color: var(--ink-soft);
  font-size:11px; font-weight:700; border-radius:999px; padding:3px 10px; white-space:nowrap;
}
.chip-btn { border:1.5px solid var(--line-soft); background:#fff; cursor:pointer; transition: background .12s ease; }
.chip-btn:hover { background: var(--surface-2); }

/* ---- Painel lateral de conversa (chat) ---- */
.chat-overlay { display:none; position:fixed; inset:0; z-index:220; background: rgba(11,18,32,.45); }
.chat-overlay.open { display:flex; justify-content:flex-end; }
.chat-drawer-box {
  width:min(440px, 100%); height:100%; background:#fff; box-shadow: var(--shadow-lg);
  display:flex; flex-direction:column; animation: chat-slide-in .18s ease;
}
@keyframes chat-slide-in { from { transform: translateX(24px); opacity:.4; } to { transform: translateX(0); opacity:1; } }
.chat-drawer-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:16px 18px; border-bottom:1px solid var(--line-soft); }
.chat-drawer-nome { font-weight:800; font-size:15px; }
.chat-drawer-tel { font-size:12px; color: var(--muted); }
.chat-drawer-acoes { display:flex; flex-wrap:wrap; gap:8px; padding:10px 18px; border-bottom:1px solid var(--line-soft); }
.chat-drawer-body { flex:1; overflow-y:auto; padding:16px 18px; display:flex; flex-direction:column; gap:10px; background: var(--surface); }
.chat-bubble { max-width:82%; padding:9px 12px; border-radius:12px; font-size:13px; line-height:1.42; white-space:pre-wrap; word-break:break-word; }
.chat-bubble.in { align-self:flex-start; background:#fff; border:1px solid var(--line-soft); border-bottom-left-radius:3px; }
.chat-bubble.out { align-self:flex-end; background: var(--navy-2); color:#fff; border-bottom-right-radius:3px; }
.chat-bubble-hora { display:block; margin-top:4px; font-size:10px; opacity:.65; text-align:right; }
.chat-drawer-respostas { display:flex; flex-wrap:wrap; gap:6px; padding:10px 18px 0; }
.chat-drawer-form { display:flex; gap:8px; padding:12px 18px; border-top:1px solid var(--line-soft); }
.chat-drawer-form textarea { flex:1; resize:none; padding:9px 12px; border:1.5px solid var(--line-soft); border-radius: var(--radius-sm); font-size:13px; font-family:inherit; }
.chat-drawer-crm { border-top:1px solid var(--line-soft); padding:12px 18px 16px; }
.chat-drawer-crm summary { cursor:pointer; font-weight:700; font-size:12.5px; color: var(--navy); }
.chat-drawer-crm form { margin-top:12px; display:flex; flex-direction:column; gap:12px; }

.dash-grid { display:grid; grid-template-columns: 1fr 1fr; gap:16px; }
.periodo-toggle { display:inline-flex; border:1.5px solid var(--line-soft); border-radius:999px; overflow:hidden; }
.periodo-toggle a { padding:7px 14px; font-size:12.5px; font-weight:700; color: var(--ink-soft); }
.periodo-toggle a.active { background: var(--navy-2); color:#fff; }

@media (max-width: 900px) {
  .kanban-board { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .chat-drawer-box { width:100%; }
}

@media (max-width: 720px) {
  .gami-rank-row { grid-template-columns: 26px 32px 1fr; row-gap:6px; }
  .gami-rank-xp, .gami-rank-row .gami-tier-pill { grid-column: 3; justify-self:start; }
  .gami-podium-item { max-width:none; flex-basis:100%; }
  .gami-podium-1, .gami-podium-2, .gami-podium-3 { order:0; transform:none; }
}

/* ================================================================
   Chat-bot visual (Comunicacao > Chat-bot)
   ================================================================ */
.chatbot-back-link { font-size:12.5px; font-weight:700; color:var(--muted); white-space:nowrap; }
.chatbot-back-link:hover { color:var(--navy); }

.chatbot-toolbar {
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  padding-bottom:16px; margin-bottom:16px; border-bottom:1px solid var(--line-soft);
}
.chatbot-name-input {
  width:100%; border:1.5px solid transparent; background:transparent;
  font-size:17px; font-weight:800; color:var(--ink); padding:6px 8px; border-radius:var(--radius-sm);
}
.chatbot-name-input:hover { border-color:var(--line-soft); }
.chatbot-name-input:focus { border-color:var(--navy-2); background:#fff; outline:none; }

.chatbot-status-chip {
  display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:999px;
  font-size:12px; font-weight:800; white-space:nowrap;
}
.chatbot-status-chip.is-active { background:var(--success-bg); color:var(--success); }
.chatbot-status-chip.is-inactive { background:var(--line-soft); color:var(--muted); }
.chatbot-status-dot { width:7px; height:7px; border-radius:50%; background:currentColor; }
.chatbot-status-chip.is-active .chatbot-status-dot { animation: wa-pulse-ring-verde 1.8s ease-out infinite; }

.chatbot-warning-banner {
  background:var(--warn-bg); color:var(--warn); border:1px solid rgba(146,64,14,.18);
  border-radius:var(--radius-sm); padding:12px 16px; margin-bottom:16px; font-size:13px;
  animation: atend-rise .4s cubic-bezier(.16,1,.3,1);
}
.chatbot-warning-banner strong { display:block; margin-bottom:4px; }
.chatbot-warning-banner ul { margin:0; padding-left:20px; }
.chatbot-warning-banner li { margin:2px 0; }

.chatbot-palette {
  display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:14px;
}
.chatbot-palette-label { font-size:12.5px; font-weight:800; color:var(--ink-soft); margin-right:4px; }

/* -- Listagem de fluxos (kpi-card reaproveitado, com toque proprio) -- */
.wa-chatbot-kpis .wa-chatbot-card {
  animation: atend-rise .45s cubic-bezier(.16,1,.3,1) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
  align-items:flex-start; text-align:left;
}
.wa-chatbot-icone {
  width:32px; height:32px; border-radius:9px; flex:none;
  background:rgba(255,255,255,.16); display:flex; align-items:center; justify-content:center;
}
.wa-chatbot-icone .icon { width:17px; height:17px; }
.wa-chatbot-card.is-ativo { box-shadow: 0 0 0 2px rgba(21,128,61,.35), var(--shadow-sm); }
.wa-chatbot-card.is-ativo .wa-chatbot-icone { background:rgba(52,211,153,.3); }
@media (prefers-reduced-motion: reduce) {
  .chatbot-status-chip.is-active .chatbot-status-dot, .chatbot-warning-banner, .wa-chatbot-kpis .wa-chatbot-card { animation:none !important; }
}

#chatbot-canvas-wrap {
  position:relative; width:100%; height:560px; overflow:auto;
  background:var(--surface); border:1.5px solid var(--line-soft); border-radius:var(--radius);
  background-image: radial-gradient(circle, var(--line-soft) 1px, transparent 1px);
  background-size: 18px 18px;
}
#chatbot-canvas { position:relative; width:1600px; height:1200px; }
#chatbot-edges-svg { position:absolute; top:0; left:0; width:100%; height:100%; pointer-events:none; overflow:visible; }

.chatbot-edge-path { fill:none; stroke:var(--navy-2); stroke-width:2; }
.chatbot-edge-path-temp { fill:none; stroke:var(--gold); stroke-width:2; stroke-dasharray:5 4; }

.chatbot-node {
  position:absolute; width:220px; background:#fff; border-radius:var(--radius-sm);
  border:1.5px solid var(--line-soft); border-left-width:5px; box-shadow:var(--shadow-sm);
  cursor:default; user-select:none;
}
.chatbot-node:hover { box-shadow:var(--shadow-md); }
.chatbot-node-inicio { border-left-color:var(--gold); }
.chatbot-node-mensagem { border-left-color:var(--info); }
.chatbot-node-menu { border-left-color:var(--navy-2); }
.chatbot-node-encaminhar { border-left-color:var(--warn); }
.chatbot-node-encerrar { border-left-color:var(--danger); }

.chatbot-node-header {
  display:flex; align-items:center; justify-content:space-between; gap:6px;
  padding:8px 10px; border-bottom:1px solid var(--line-soft);
}
.chatbot-node-type { font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.03em; color:var(--ink-soft); }
.chatbot-node-del {
  width:20px; height:20px; line-height:18px; text-align:center; border-radius:50%;
  color:var(--muted); font-size:15px; flex:none;
}
.chatbot-node-del:hover { background:var(--danger-bg); color:var(--danger); }

.chatbot-node-body { padding:10px; cursor:grab; }
.chatbot-node-body:active { cursor:grabbing; }
.chatbot-node-preview { font-size:12.5px; color:var(--ink); line-height:1.4; word-break:break-word; }
.chatbot-node-empty { color:var(--muted); font-style:italic; }

.chatbot-port {
  position:absolute; width:14px; height:14px; border-radius:50%;
  background:#fff; border:2.5px solid var(--navy-2); cursor:crosshair; z-index:2;
}
.chatbot-port:hover { background:var(--gold); border-color:var(--gold); }
.chatbot-port-in { left:-8px; top:34px; }
.chatbot-port-out-wrap { position:relative; }
.chatbot-port-out { right:-8px; }

.chatbot-menu-options { display:flex; flex-direction:column; gap:8px; margin-bottom:10px; }
.chatbot-option-editor-row { display:flex; align-items:center; gap:8px; }
.chatbot-option-editor-row .chatbot-option-label {
  flex:1; padding:8px 10px; border:1.5px solid var(--line-soft); border-radius:var(--radius-sm); font-size:13px;
}
.chatbot-option-remove {
  width:26px; height:26px; flex:none; border-radius:50%; color:var(--muted); font-size:15px;
}
.chatbot-option-remove:hover { background:var(--danger-bg); color:var(--danger); }

/* ---- Selecionar provedor (Comunicacao > Configuracoes) ---- */
.provider-select { display:grid; grid-template-columns:repeat(3, 1fr); gap:12px; margin-bottom:20px; }
.provider-option {
  display:block; border:1.5px solid var(--line-soft); border-radius:var(--radius); padding:14px 16px;
  cursor:pointer; background:#fff; transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  animation: atend-rise .45s cubic-bezier(.16,1,.3,1) backwards;
  animation-delay: calc(var(--i, 0) * 80ms);
}
.provider-option:hover { border-color:var(--navy-2); transform:translateY(-2px); box-shadow:var(--shadow-sm); }
.provider-option input[type="radio"] { margin-right:8px; }
.provider-option.is-checked { border-color:var(--navy-2); box-shadow:0 0 0 2px rgba(11,18,32,.1), var(--shadow-sm); }
.provider-option-icon {
  display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px;
  border-radius:9px; margin-bottom:8px; color:#fff;
  transition: transform .18s ease;
}
.provider-option-icon .icon { width:17px; height:17px; }
.provider-option:hover .provider-option-icon { transform:scale(1.08) rotate(-3deg); }
.provider-icon-evolution { background:linear-gradient(135deg, #34d399, #15803d); }
.provider-icon-meta { background:linear-gradient(135deg, #60a5fa, #1d4ed8); }
.provider-icon-apibrasil { background:linear-gradient(135deg, #fb923c, #b91c1c); }
.provider-option-title { display:block; font-weight:800; font-size:13.5px; color:var(--ink); }
.provider-option-desc { display:block; margin-top:4px; font-size:12px; color:var(--muted); line-height:1.4; }
.provider-fields { display:none; padding:16px; background:var(--surface); border-radius:var(--radius); margin-bottom:20px; }
.provider-fields.is-active { display:block; animation: wa-fields-in .3s ease-out; }
@keyframes wa-fields-in {
  from { opacity:0; transform:translateY(-6px); }
  to { opacity:1; transform:translateY(0); }
}
.status-pill.wa-pill-live::before { animation: wa-pulse-ring-verde 1.8s ease-out infinite; }
@keyframes wa-pulse-ring-verde {
  0% { box-shadow:0 0 0 0 rgba(21,128,61,.55); }
  70% { box-shadow:0 0 0 8px rgba(21,128,61,0); }
  100% { box-shadow:0 0 0 0 rgba(21,128,61,0); }
}
@media (prefers-reduced-motion: reduce) {
  .provider-option, .provider-fields.is-active, .status-pill.wa-pill-live::before { animation:none !important; }
}

@media (max-width: 900px) {
  .provider-select { grid-template-columns:1fr; }
}

/* ================================================================
   Atendimento (whatsapp.php) -- cards de resumo + lista de conversas
   Paleta com intencao (psicologia das cores): vermelho/laranja = urgencia
   (Em espera, prende atencao primeiro), indigo/azul = foco/confianca (Em
   atendimento, trabalho em curso), verde = conclusao/alivio (Fechadas),
   navy/dourado = marca/visao geral (Todas). Animacoes sutis (entrada em
   cascata, pulso, contagem crescente) para dar sensacao de "vivo" sem
   distrair do trabalho -- tudo respeita prefers-reduced-motion no final.
   ================================================================ */
.atend-stats-row { display:grid; grid-template-columns:repeat(4, 1fr); gap:12px; margin-bottom:12px; }
.atend-stat-card, .atend-info-card {
  position:relative; display:flex; align-items:center; gap:14px; background:#fff;
  border:1.5px solid var(--line-soft); border-radius:var(--radius); padding:14px 16px;
  overflow:hidden; animation:atend-rise .5s cubic-bezier(.16,1,.3,1) backwards;
  animation-delay:calc(var(--i, 0) * 55ms);
}
.atend-stat-card {
  transition: border-color .18s ease, box-shadow .25s ease, transform .18s ease;
  isolation:isolate;
}
.atend-stat-card::before {
  content:""; position:absolute; inset:0; z-index:-1; opacity:0; transition:opacity .25s ease;
  background:radial-gradient(120px 90px at 15% 15%, rgba(11,18,32,.06), transparent 70%);
}
.atend-stat-card:hover { border-color:var(--navy-2); box-shadow:var(--shadow-md); transform:translateY(-3px); }
.atend-stat-card:hover::before { opacity:1; }
.atend-stat-urgente:hover { box-shadow:0 10px 26px rgba(185,28,28,.18); }
.atend-stat-info:hover { box-shadow:0 10px 26px rgba(55,48,163,.18); }
.atend-stat-ok:hover { box-shadow:0 10px 26px rgba(21,128,61,.18); }
.atend-stat-card.is-active { border-color:var(--navy-2); box-shadow:0 0 0 2px rgba(11,18,32,.1); }

.atend-stat-icon {
  flex:none; width:42px; height:42px; border-radius:13px; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, var(--navy), var(--navy-2)); color:#fff;
  box-shadow:0 4px 12px rgba(11,18,32,.22);
  transition:transform .3s cubic-bezier(.34,1.56,.64,1);
}
.atend-stat-card:hover .atend-stat-icon, .atend-info-card:hover .atend-stat-icon { transform:scale(1.08) rotate(-4deg); }
.atend-stat-icon .icon { width:20px; height:20px; }
.atend-stat-icon-espera, .atend-stat-urgente .atend-stat-icon { background:linear-gradient(135deg, #f97316, #b91c1c); box-shadow:0 4px 14px rgba(185,28,28,.3); }
.atend-stat-icon-atendimento, .atend-stat-info .atend-stat-icon { background:linear-gradient(135deg, #6366f1, #3730a3); box-shadow:0 4px 14px rgba(55,48,163,.3); }
.atend-stat-icon-fechadas, .atend-stat-ok .atend-stat-icon { background:linear-gradient(135deg, #34d399, #15803d); box-shadow:0 4px 14px rgba(21,128,61,.3); }
.atend-stat-icon-conexao { background:linear-gradient(135deg, #94a3b8, #64748b); box-shadow:0 4px 14px rgba(100,116,139,.25); }
.atend-stat-icon-conexao.is-live { background:linear-gradient(135deg, #34d399, #15803d); box-shadow:0 4px 14px rgba(21,128,61,.3); }
.atend-stat-icon-naolidas { background:linear-gradient(135deg, #fb7185, #b91c1c); box-shadow:0 4px 14px rgba(185,28,28,.25); }
.atend-stat-icon-midias { background:linear-gradient(135deg, #c9932f, #92400e); box-shadow:0 4px 14px rgba(146,64,14,.25); }
.atend-stat-icon-noar { background:linear-gradient(135deg, #64748b, #334155); box-shadow:0 4px 14px rgba(51,65,85,.25); }

.atend-stat-body { display:flex; flex-direction:column; gap:2px; min-width:0; }
.atend-stat-label { font-size:11.5px; font-weight:800; text-transform:uppercase; letter-spacing:.02em; color:var(--muted); }
.atend-stat-value { font-size:21px; font-weight:800; color:var(--ink); line-height:1.1; font-variant-numeric:tabular-nums; }
.atend-stat-dot {
  position:absolute; top:13px; right:13px; width:9px; height:9px; border-radius:50%; background:var(--danger);
  box-shadow:0 0 0 0 rgba(185,28,28,.55); animation:atend-pulse-ring 1.8s ease-out infinite;
}
.atend-stats-row-info { margin-bottom:20px; }
.atend-info-card { cursor:default; }
.atend-info-value { font-size:15px; font-weight:800; color:var(--ink); font-variant-numeric:tabular-nums; }
.atend-info-value-ok { color:var(--success); }
.atend-info-value-alerta { color:var(--danger); }
.atend-info-value-muted { color:var(--muted); font-weight:700; font-size:13px; }

.atend-lista { display:flex; flex-direction:column; gap:8px; }
.atend-card {
  display:flex; align-items:center; gap:12px; background:#fff; border:1.5px solid var(--line-soft);
  border-radius:var(--radius); padding:12px 14px; cursor:pointer;
  transition: border-color .18s ease, box-shadow .22s ease, transform .18s ease;
  animation:atend-rise .45s cubic-bezier(.16,1,.3,1) backwards;
  animation-delay:calc(min(var(--i, 0), 14) * 40ms);
}
.atend-card:hover { border-color:var(--navy-2); box-shadow:var(--shadow-md); transform:translateY(-2px) translateX(2px); }
.atend-avatar {
  flex:none; width:40px; height:40px; border-radius:50%; color:#fff;
  display:flex; align-items:center; justify-content:center; font-weight:800; font-size:13px;
  box-shadow:0 3px 8px rgba(11,18,32,.2); transition:transform .2s ease;
}
.atend-card:hover .atend-avatar { transform:scale(1.06); }
.atend-avatar-c0 { background:linear-gradient(135deg, var(--navy), var(--navy-2)); }
.atend-avatar-c1 { background:linear-gradient(135deg, #6366f1, #3730a3); }
.atend-avatar-c2 { background:linear-gradient(135deg, #14b8a6, #0f766e); }
.atend-avatar-c3 { background:linear-gradient(135deg, var(--gold), #92400e); }
.atend-avatar-c4 { background:linear-gradient(135deg, #fb7185, var(--wine)); }
.atend-avatar-c5 { background:linear-gradient(135deg, #8b5cf6, #5b21b6); }
.atend-card-info { flex:1; min-width:0; }
.atend-card-top { display:flex; align-items:center; gap:8px; }
.atend-tag { font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.02em; padding:2px 8px; border-radius:999px; flex:none; }
.atend-tag-conhecido { background:var(--success-bg); color:var(--success); }
.atend-tag-novo { background:var(--surface-2); color:var(--muted); }
.atend-card-nome { font-weight:800; font-size:13.5px; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.atend-badge-naolidas {
  margin-left:auto; background:linear-gradient(135deg, #fb7185, var(--danger)); color:#fff; font-size:11px; font-weight:800;
  border-radius:999px; min-width:19px; height:19px; display:inline-flex; align-items:center; justify-content:center;
  padding:0 5px; flex:none; animation:atend-badge-pop .35s cubic-bezier(.34,1.56,.64,1) backwards; animation-delay:inherit;
}
.atend-card-tel { font-size:11.5px; color:var(--muted); margin-top:1px; }
.atend-card-preview { font-size:12px; color:var(--ink-soft); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ---- Estado vazio ilustrado ---- */
.atend-empty { display:flex; flex-direction:column; align-items:center; text-align:center; padding:36px 20px 30px; }
.atend-empty-compact { padding:26px 20px; }
.atend-empty-illustration { margin-bottom:6px; }
.atend-empty-illustration .atend-empty-blob { animation:atend-breathe 4s ease-in-out infinite; transform-origin:center; }
.atend-empty-illustration .atend-empty-bubble { animation:atend-float 3.6s ease-in-out infinite; transform-origin:center; }
.atend-empty-illustration.is-vivo .atend-empty-typing-dot { animation:atend-typing 1.2s ease-in-out infinite; }
.atend-empty-illustration .atend-empty-typing-dot:nth-child(1) { animation-delay:0s; }
.atend-empty-illustration .atend-empty-bubble .atend-empty-typing-dot:nth-of-type(2) { animation-delay:.15s; }
.atend-empty-illustration .atend-empty-bubble .atend-empty-typing-dot:nth-of-type(3) { animation-delay:.3s; }
.atend-empty-dot { animation:atend-float 3s ease-in-out infinite; transform-origin:center; }
.atend-empty-dot-1 { animation-duration:3.4s; }
.atend-empty-dot-2 { animation-duration:2.6s; animation-delay:.4s; }
.atend-empty-dot-3 { animation-duration:3.8s; animation-delay:.2s; }
.atend-empty-icone-busca {
  width:52px; height:52px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:var(--surface-2); color:var(--muted); margin-bottom:12px;
}
.atend-empty-icone-busca .icon { width:24px; height:24px; }
.atend-empty-titulo { margin:6px 0 4px; font-size:16px; color:var(--ink); }
.atend-empty-texto { margin:0 0 16px; max-width:360px; font-size:13px; color:var(--muted); line-height:1.5; }

.chat-drawer-head-acoes { display:flex; align-items:center; gap:8px; }
.chat-drawer-controles { display:flex; flex-wrap:wrap; gap:8px; padding:10px 18px; border-bottom:1px solid var(--line-soft); position:relative; }
.chat-drawer-select { padding:7px 10px; border:1.5px solid var(--line-soft); border-radius:var(--radius-sm); font-size:12.5px; background:#fff; }
.chat-drawer-vincular { position:relative; flex:1; min-width:180px; }
.chat-drawer-vincular .chat-drawer-select { width:100%; }
.chat-vincular-resultados {
  position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:30; background:#fff;
  border:1.5px solid var(--line-soft); border-radius:var(--radius-sm); box-shadow:var(--shadow-md);
  max-height:220px; overflow-y:auto;
}
.chat-vincular-item { display:block; width:100%; text-align:left; padding:8px 12px; font-size:12.5px; border-bottom:1px solid var(--line-soft); }
.chat-vincular-item:last-child { border-bottom:none; }
.chat-vincular-item:hover { background:var(--surface); }

@keyframes atend-rise {
  from { opacity:0; transform:translateY(12px); }
  to { opacity:1; transform:translateY(0); }
}
@keyframes atend-pulse-ring {
  0% { box-shadow:0 0 0 0 rgba(185,28,28,.55); }
  70% { box-shadow:0 0 0 9px rgba(185,28,28,0); }
  100% { box-shadow:0 0 0 0 rgba(185,28,28,0); }
}
@keyframes atend-badge-pop {
  0% { transform:scale(0); opacity:0; }
  70% { transform:scale(1.15); opacity:1; }
  100% { transform:scale(1); }
}
@keyframes atend-breathe {
  0%, 100% { transform:scale(1); opacity:.16; }
  50% { transform:scale(1.06); opacity:.26; }
}
@keyframes atend-float {
  0%, 100% { transform:translateY(0); }
  50% { transform:translateY(-6px); }
}
@keyframes atend-typing {
  0%, 60%, 100% { transform:translateY(0); opacity:.55; }
  30% { transform:translateY(-5px); opacity:1; }
}

@media (max-width: 900px) {
  .atend-stats-row { grid-template-columns:repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .atend-stats-row { grid-template-columns:1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .atend-stat-card, .atend-info-card, .atend-card, .atend-stat-dot, .atend-badge-naolidas,
  .atend-empty-blob, .atend-empty-bubble, .atend-empty-dot, .atend-empty-typing-dot {
    animation:none !important;
  }
  .atend-stat-card, .atend-card { transition:border-color .12s ease, box-shadow .12s ease; }
}

/* ================================================================
   Dashboard de Atendimento (whatsapp_relatorios.php)
   ================================================================ */
.dash-fila-agora { display:flex; gap:28px; }
.dash-fila-agora > div { display:flex; flex-direction:column; gap:2px; }
.dash-fila-valor { font-size:28px; font-weight:800; line-height:1.1; }
.dash-fila-espera { color:var(--danger); }
.dash-fila-atendimento { color:var(--info); }
.dash-atendente-lista { display:flex; flex-direction:column; gap:2px; }
.dash-atendente-lista li { display:flex; align-items:center; justify-content:space-between; padding:10px 2px; border-bottom:1px solid var(--line-soft); font-size:13.5px; }
.dash-atendente-lista li:last-child { border-bottom:none; }
.dash-atendente-lista strong { color:var(--navy); }

/* -- Polish: entrada animada + cores por categoria dos KPIs, pulso no
      card "hero" (tempo medio de resposta), e paineis/linhas com stagger. -- */
.wa-relat-kpis .kpi-card,
.wa-dash-panel {
  animation: atend-rise .5s cubic-bezier(.16,1,.3,1) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.wa-relat-kpis .wa-kpi-recebidas .kpi-icon { background: linear-gradient(135deg, rgba(129,140,248,.55), rgba(55,48,163,.7)); }
.wa-relat-kpis .wa-kpi-respondidas .kpi-icon { background: linear-gradient(135deg, rgba(52,211,153,.5), rgba(21,128,61,.7)); }
.wa-relat-kpis .wa-kpi-finalizadas .kpi-icon { background: linear-gradient(135deg, rgba(45,212,191,.5), rgba(15,118,110,.7)); }
body.tab-whatsapp_relatorios .kpi-card.highlight {
  background: linear-gradient(135deg, #fbc76a 0%, #e07f1a 45%, #8a2e0a 100%);
  box-shadow: 0 6px 22px rgba(180,86,15,.35), var(--shadow-sm);
  animation: atend-rise .5s cubic-bezier(.16,1,.3,1) backwards, wa-kpi-glow 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 70ms), .6s;
}
body.tab-whatsapp_relatorios .kpi-card.highlight .kpi-icon { background: rgba(255,255,255,.34); box-shadow: 0 2px 6px rgba(0,0,0,.15); }
body.tab-whatsapp_relatorios .kpi-card.highlight .kpi-value,
body.tab-whatsapp_relatorios .kpi-card.highlight .kpi-label { text-shadow: 0 1px 4px rgba(0,0,0,.3); }
body.tab-whatsapp_relatorios .kpi-card.highlight .kpi-value .wa-kpi-vazio { font-size:22px; opacity:.85; letter-spacing:.04em; }
@keyframes wa-kpi-glow {
  0%, 100% { box-shadow: 0 6px 22px rgba(180,86,15,.35), var(--shadow-sm); }
  50% { box-shadow: 0 0 0 6px rgba(224,127,26,.28), 0 6px 22px rgba(180,86,15,.45); }
}
.dash-atendente-lista li {
  animation: atend-rise .4s cubic-bezier(.16,1,.3,1) backwards;
  animation-delay: calc(min(var(--i, 0), 10) * 45ms);
}
.wa-empty-icon { display:flex; flex-direction:column; align-items:center; gap:10px; text-align:center; padding:22px 14px !important; }
.wa-empty-icon::before {
  content:"";
  width:42px; height:42px; border-radius:50%; flex:none;
  background-color: var(--surface-2);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:center; background-size:20px;
}
.wa-relat-tabela tbody tr { transition: background-color .15s ease; }
.wa-relat-tabela tbody tr:hover { background: var(--surface-2); }
@media (prefers-reduced-motion: reduce) {
  .wa-relat-kpis .kpi-card, .wa-dash-panel, .dash-atendente-lista li, body.tab-whatsapp_relatorios .kpi-card.highlight {
    animation: none !important;
  }
}

/* ================================================================
   Mensagens Padrao (whatsapp_respostas.php)
   ================================================================ */
.resp-nova-form { display:flex; gap:14px; align-items:flex-end; flex-wrap:wrap; }
.resp-nova-form .form-field { margin-bottom:0; flex:1; min-width:200px; }
.resp-nova-texto { flex:2; min-width:280px; }
.resp-nova-texto textarea { min-height:44px; resize:vertical; }
.resp-nova-btn { flex:none; height:41px; }
.resp-lista { display:flex; flex-direction:column; gap:10px; }
.resp-card {
  display:flex; align-items:flex-start; justify-content:space-between; gap:14px;
  background:#fff; border:1.5px solid var(--line-soft); border-left:3px solid var(--gold);
  border-radius:var(--radius); padding:14px 16px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  animation: atend-rise .4s cubic-bezier(.16,1,.3,1) backwards;
  animation-delay: calc(min(var(--i, 0), 14) * 45ms);
}
.resp-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); border-left-color:var(--navy-2); }
.resp-card-icone {
  flex:none; width:34px; height:34px; border-radius:10px;
  background:linear-gradient(135deg, rgba(201,147,47,.18), rgba(201,147,47,.32));
  color:var(--gold); display:flex; align-items:center; justify-content:center;
}
.resp-card-icone .icon { width:18px; height:18px; }
.resp-card-texto { min-width:0; flex:1; }
.resp-card-titulo { display:flex; align-items:center; gap:8px; font-weight:800; font-size:13.5px; color:var(--ink); margin-bottom:4px; }
.resp-card-mensagem { font-size:12.5px; color:var(--ink-soft); line-height:1.5; }
.resp-card-acoes { display:flex; gap:8px; flex:none; }

@media (max-width: 700px) {
  .resp-nova-form { flex-direction:column; align-items:stretch; }
  .resp-card { flex-direction:column; }
}
@media (prefers-reduced-motion: reduce) {
  .resp-card { animation:none !important; }
}

/* ================================================================
   Contatos (whatsapp_contatos.php)
   ================================================================ */
.wa-contato-linha { display:inline-flex; align-items:center; gap:10px; }
.wa-contato-avatar { width:28px; height:28px; font-size:11px; box-shadow:0 2px 5px rgba(11,18,32,.18); }
.wa-contatos-tabela tbody tr {
  animation: atend-rise .35s cubic-bezier(.16,1,.3,1) backwards;
  animation-delay: calc(min(var(--i, 0), 16) * 30ms);
}
@media (prefers-reduced-motion: reduce) {
  .wa-contatos-tabela tbody tr { animation:none !important; }
}
