:root {
    --pmmg-black: #373435;
    --pmmg-khaki: #9a8656;
    --pmmg-khaki-light: rgba(154, 134, 86, 0.14);
    --pmmg-khaki-text: #5c4c30;
    --pmmg-red: #ab2328;
    --bg-app: #f4f4f2;
    --bg-surface: #ffffff;
    --text-main: #202124;
    --text-muted: #646464;
    --border-color: #dddddd;
    --ok: #2e7d32;
    --warn: #b26a00;
    --focus-ring: #1d5fd6;
    /* Reforma visual 2026-07-25 (inspirada no Vue Argon Dashboard, mesma paleta PMMG - ver
       CLAUDE.md): raio/sombra maiores e mais suaves em vez do 6-8px/sombra quase imperceptivel
       de antes, pra dar a sensacao de "cards flutuando" sem mudar nenhuma cor de marca. */
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-card: 0 4px 18px rgba(20, 20, 20, .07);
    --shadow-card-hover: 0 10px 26px rgba(20, 20, 20, .11);
}

/* Icones da sidebar/Dashboard (reforma 2026-07-25) - SVGs simples embutidos como data URI via
   mask-image, nunca um icon-font/CDN externo (mesma disciplina do ECharts/Vue vendorizados -
   ver CLAUDE.md sobre o problema que um CDN de terceiro causou na rede do batalhao). Cada
   classe .icon-X so define a variavel --icon-svg; quem de fato aplica a mascara e .nav-icon/
   .stat-icon abaixo, combinadas na mesma tag (ex. class="nav-icon icon-dashboard"). */
.icon-dashboard {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E");
}
.icon-municipios {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='1'/%3E%3Cline x1='9' y1='8' x2='9.01' y2='8'/%3E%3Cline x1='15' y1='8' x2='15.01' y2='8'/%3E%3Cline x1='9' y1='12.5' x2='9.01' y2='12.5'/%3E%3Cline x1='15' y1='12.5' x2='15.01' y2='12.5'/%3E%3Crect x='9.5' y='16.5' width='5' height='4.5'/%3E%3C/svg%3E");
}
.icon-locais {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.3-7-11.5A7 7 0 0 1 19 9.5C19 14.7 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.3'/%3E%3C/svg%3E");
}
.icon-mapa {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21'/%3E%3Cline x1='9' y1='3' x2='9' y2='18'/%3E%3Cline x1='15' y1='6' x2='15' y2='21'/%3E%3C/svg%3E");
}
.icon-censo {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='7' r='3.2'/%3E%3Cpath d='M3 20c0-3.5 2.7-6 6-6s6 2.5 6 6'/%3E%3Ccircle cx='17' cy='8' r='2.4'/%3E%3Cpath d='M21 20c0-2.6-1.7-4.7-4-5.4'/%3E%3C/svg%3E");
}
.icon-escala {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='16' rx='1.5'/%3E%3Cline x1='3' y1='9.5' x2='21' y2='9.5'/%3E%3Cline x1='8' y1='2.5' x2='8' y2='6.5'/%3E%3Cline x1='16' y1='2.5' x2='16' y2='6.5'/%3E%3Cpath d='M8.5 14.5l2 2 4-4.5'/%3E%3C/svg%3E");
}
.icon-consulta {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cline x1='20' y1='20' x2='15.3' y2='15.3'/%3E%3C/svg%3E");
}
.icon-usuarios {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v6c0 4.5-3 7.5-7 9-4-1.5-7-4.5-7-9V6l7-3z'/%3E%3Cpath d='M9 12l2 2 4-4.5'/%3E%3C/svg%3E");
}
.icon-secoes {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 3 21 8.5 12 14 3 8.5'/%3E%3Cpolyline points='3 15 12 20.5 21 15'/%3E%3C/svg%3E");
}
.icon-alerta {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3L2 20h20L12 3z'/%3E%3Cline x1='12' y1='10' x2='12' y2='14.5'/%3E%3Ccircle cx='12' cy='17.3' r='1' fill='black' stroke='none'/%3E%3C/svg%3E");
}
/* Aba Eventos SIGOP (2026-08-18, ver CLAUDE.md) */
.icon-eventos {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11v3a1 1 0 0 0 1 1h2l4 4V6L7 10H5a1 1 0 0 0-1 1z'/%3E%3Cpath d='M15 8.5c1 1 1 6 0 7'/%3E%3Cpath d='M18 6c2 2.5 2 9.5 0 12'/%3E%3C/svg%3E");
}
.nav-icon, .stat-icon {
    display: inline-block;
    flex-shrink: 0;
    -webkit-mask-image: var(--icon-svg);
    mask-image: var(--icon-svg);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    background-color: currentColor;
}
.nav-icon { width: 18px; height: 18px; margin-right: 11px; }
.stat-icon { width: 22px; height: 22px; }

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    min-height: 100vh;
    background: var(--bg-app);
    color: var(--text-main);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
.nav-item:focus-visible,
.bottom-nav-item:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.app-container { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px;
    background: var(--pmmg-black);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.sidebar-header {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    flex: 0 0 auto;
}
.sidebar-header h1 { color: var(--pmmg-khaki); font-size: 1.15rem; letter-spacing: .04em; }
.sidebar-header small { display: block; margin-top: 6px; color: #ddd; }
/* Sidebar reformada 2026-07-25: navegacao agrupada por tema (Dados Eleitorais / Escala de
   Servico / Administracao - ver admin/index.html), item ativo vira um "pill" com fundo caqui
   em vez da borda esquerda fina de antes - mesmo espirito do Argon Dashboard mantendo a cor da
   marca. */
.sidebar-nav {
    padding: 16px 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}
.nav-grupo-titulo {
    margin: 18px 10px 6px;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .38);
}
.sidebar-nav > .nav-grupo-titulo:first-child { margin-top: 4px; }
.nav-item {
    display: flex;
    align-items: center;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: #d5d5d5;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.nav-item:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}
.nav-item.active {
    background: var(--pmmg-khaki);
    color: #fff;
    box-shadow: 0 4px 12px rgba(154, 134, 86, .35);
}
/* Sinaliza, antes do clique, que a aba exige login individual (Censo Eleitoral, Escala
   Eleicao, Consulta Escala - ver CLAUDE.md). Puramente visual: o gate de verdade e o 401 da
   API, tratado em redirecionarParaLogin() (app.js). margin-left: auto (nao float) porque
   .nav-item agora e flex - float nao empurraria o cadeado pra ponta certa dentro de um item flex. */
.nav-item--protegido::after {
    content: '🔒';
    margin-left: auto;
    font-size: .75rem;
    opacity: .7;
}

.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 68px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}
.menu-toggle {
    display: none;
    border: 0;
    background: transparent;
    color: var(--pmmg-black);
    font-size: .9rem;
    font-weight: 800;
    cursor: pointer;
}
/* Trilha tipo breadcrumb ("Painel / Aba atual"), no lugar do titulo solto de antes - #titulo-
   pagina continua o mesmo id/comportamento (so app.js altera o texto, nada de JS mudou aqui). */
.breadcrumb { display: flex; flex-direction: column; gap: 2px; }
.breadcrumb-trilha {
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.page-title { font-weight: 800; color: var(--pmmg-black); font-size: 1.08rem; }
.user-info { color: var(--text-muted); font-size: .9rem; }
.content-area { flex: 1; overflow: auto; padding: 24px 28px; }
.view-section { display: none; }
.view-section.active { display: block; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.stat-card, .card {
    background: var(--bg-surface);
    border: 1px solid rgba(0, 0, 0, .05);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    transition: box-shadow .15s ease;
}
.stat-card:hover, .card:hover { box-shadow: var(--shadow-card-hover); }
/* Cards de estatistica reformados 2026-07-25: badge de icone colorido no canto (estilo Argon
   Dashboard) no lugar da borda esquerda fina de antes - a cor de cada categoria
   (.stat-khaki/.stat-red/.stat-warn, ja usadas em admin/index.html) agora tinge o badge em vez
   da borda. padding-right abre espaco pro badge sem sobrepor o texto. */
.stat-card {
    padding: 20px;
    padding-right: 76px;
    position: relative;
}
.stat-card h3 {
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.stat-card .value {
    margin-top: 10px;
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--pmmg-black);
}
.stat-icon-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    background: var(--pmmg-black);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .18);
}
.stat-icon-badge .stat-icon { background-color: #fff; }
.stat-card.stat-khaki .stat-icon-badge { background: var(--pmmg-khaki); box-shadow: 0 6px 14px rgba(154, 134, 86, .35); }
.stat-card.stat-red .stat-icon-badge { background: var(--pmmg-red); box-shadow: 0 6px 14px rgba(171, 35, 40, .3); }
.stat-card.stat-warn .stat-icon-badge { background: var(--warn); box-shadow: 0 6px 14px rgba(178, 106, 0, .3); }
.stat-card-button {
    font: inherit;
    text-align: left;
    width: 100%;
    cursor: pointer;
}
.stat-card-hint {
    display: block;
    margin-top: 10px;
    font-size: .82rem;
    font-weight: 700;
    color: var(--pmmg-khaki-text);
}
.card {
    padding: 22px;
    margin-bottom: 20px;
    border-top: 4px solid var(--pmmg-khaki);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.card h2 { font-size: 1.05rem; font-weight: 800; color: var(--pmmg-black); }
/* Cards colapsaveis (<details class="card"><summary class="card-header">...) - o marcador
   nativo do <summary> vira uma seta que gira ao abrir, pra dar a mesma dica visual de um
   "dropdown" sem depender de JS pra abrir/fechar. */
details.card > summary.card-header {
    cursor: pointer;
    list-style: none;
}
details.card > summary.card-header::-webkit-details-marker { display: none; }
details.card > summary.card-header::after {
    content: '\25B8';
    margin-left: auto;
    color: var(--text-muted);
    transition: transform .15s ease;
}
details.card[open] > summary.card-header::after { transform: rotate(90deg); }
.muted { color: var(--text-muted); font-size: .92rem; }
.map-link {
    color: var(--pmmg-khaki-text);
    font-weight: 800;
    text-decoration: none;
}
.map-link:hover { text-decoration: underline; }
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}
.modal-overlay[hidden] {
    display: none;
}
.modal-card {
    background: var(--bg-surface);
    border-top: 4px solid var(--pmmg-khaki);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card-hover);
    padding: 22px;
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    overflow-y: auto;
}
#painelMoverSecoes {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}
.graficos-censo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
.grafico-censo {
    height: 320px;
    min-width: 0;
}
.grafico-censo-pequeno {
    height: 240px;
}
.map-card { min-height: calc(100vh - 112px); }
.map-canvas {
    width: 100%;
    height: min(72vh, 720px);
    min-height: 440px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: #e9e6df;
}
.map-canvas-pequeno {
    height: 340px;
    min-height: 260px;
    margin-bottom: 12px;
}

.busca-municipios { max-width: 360px; margin-bottom: 12px; }

.meter-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e7e7e4;
    overflow: hidden;
    margin: 4px 0 10px;
}
.meter-fill {
    height: 100%;
    border-radius: 999px;
    transition: width .3s ease;
    background: var(--ok);
}
.meter-fill--ok { background: var(--ok); }
.meter-fill--warn { background: var(--warn); }
.meter-fill--danger { background: var(--pmmg-red); }
.meter-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin-top: 10px;
    font-size: .88rem;
    color: var(--text-muted);
}
.meter-breakdown strong { color: var(--text-main); }

/* Reforma 2026-07-25: toolbar de grid rigido (3 colunas fixas) virou flex-wrap - o grid de 3
   colunas so funcionava bem com exatamente 3 itens visiveis; toolbars com 5+ filtros (ex. Locais
   de Votacao: municipio/zona/area/TTE/busca/botao/exportar) formavam pares de linha confusos
   (item 4 alinhado embaixo do item 1, etc.) em vez de simplesmente fluir. Cada select/input
   cresce ate um minimo razoavel e quebra linha sozinho; botoes/links ficam do tamanho do
   conteudo. */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}
/* max-width evita que um select/input sozinho numa toolbar esparsa (ex.: filtro de municipio
   sozinho na aba Mapa) estique pra preencher a linha inteira - sem isso ficava bom so quando
   havia varios controles competindo por espaco (ex.: Locais de Votacao). */
.toolbar .form-control {
    flex: 1 1 180px;
    width: auto;
    min-width: 150px;
    max-width: 320px;
}
.toolbar .btn-primary,
.toolbar .btn-secondary,
.toolbar > a {
    flex: 0 0 auto;
}
/* Checkbox com rotulo dentro de uma .toolbar (card "Opcoes da Escala", aba Usuarios) - mesmo
   alinhamento vertical dos <select>/<input> vizinhos, sem esticar feito .form-control. */
.campo-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    font-size: .85rem;
    color: var(--pmmg-black);
}
.campo-checkbox input[type="checkbox"] {
    margin: 0;
}
/* Paginacao client-side simples (card "Opcoes da Escala", aba Usuarios) - so Anterior/indicador/
   Proxima centralizados, sem componente de paginacao dedicado no resto do projeto. */
.toolbar-paginacao {
    justify-content: center;
}
.toolbar-paginacao button:disabled {
    opacity: .5;
    cursor: default;
}
/* Linha "orfa" (valor usado em escala_eleicao mas nunca cadastrado em escala_opcoes) - mesmo
   tom de destaque suave usado noutros avisos "precisa de atencao" do painel. */
.linha-opcao-orfa {
    background: #fbf6d9;
}
.campo-unificar-opcao {
    max-width: 220px !important;
}
/* Painel de filtros com fundo/borda proprios (reforma 2026-07-25) - antes os filtros ficavam
   soltos junto do resto do card, sem nenhuma separacao visual do titulo/botoes acima ou da
   tabela abaixo ("filtros sem divisao", reportado pelo usuario). Vira uma faixa propria, mesmo
   principio em toda aba que usa toolbar-filtros (Locais, Mapa, Censo, Escala Eleicao, Consulta
   Escala, Usuarios) sem precisar tocar em cada uma. */
.toolbar-filtros {
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin: 14px 0;
}
.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    font-size: .92rem;
    white-space: nowrap;
}
.checkbox-inline input { width: 16px; height: 16px; }
.map-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    margin-top: 10px;
}
.legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: middle;
}
.legend-cia-1 { background: #2563eb; }
.legend-cia-2 { background: #16a34a; }
.legend-cia-3 { background: #b26a00; }
.legend-cia-4 { background: #7c3aed; }
.form-control {
    width: 100%;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-main);
    transition: border-color .15s ease;
}
.form-control:focus-visible { border-color: var(--pmmg-khaki); }
/* .btn-primary/.btn-secondary tambem sao usadas em <a> (ex.: "Exportar XLSX", "Baixar
   planilha") - display:inline-flex + text-decoration:none garantem que um link se pareca
   exatamente com um <button> da mesma classe (senao um <a> fica inline por padrao, ignorando
   min-height/padding vertical e mantendo o sublinhado - so ficou visualmente obvio depois da
   reforma 2026-07-25, quando esses links passaram a aparecer ao lado de botoes de verdade). */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.btn-primary {
    min-height: 42px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--pmmg-khaki);
    color: #fff;
    font-weight: 700;
    padding: 0 18px;
    cursor: pointer;
    transition: background .15s ease, box-shadow .15s ease;
}
.btn-primary:hover { background: #806f47; box-shadow: 0 4px 10px rgba(154, 134, 86, .3); }
.btn-secondary {
    min-height: 42px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--pmmg-black);
    font-weight: 700;
    padding: 0 16px;
    cursor: pointer;
    transition: background .15s ease;
}
.btn-secondary:hover { background: #f6f5f3; }

/* Envolve toda <table class="data-table"> (ver admin/index.html) - sem isso, uma tabela
   larga (muitas colunas, e-mail/timestamp/JSON longos como em Usuarios/Logs de auditoria)
   forcava a pagina inteira a rolar na horizontal em vez de só a tabela dentro do card. */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
}
.data-table th {
    background: var(--pmmg-khaki-light);
    color: var(--pmmg-black);
    font-size: .85rem;
}
.data-table tr:hover td { background: #fafafa; }
.linha-clicavel { cursor: pointer; }
.linha-clicavel:hover td { background: var(--pmmg-khaki-light); }
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: .78rem;
    font-weight: 700;
}
.badge-ok { background: #e8f5e9; color: var(--ok); }
.badge-warn { background: #fff7e6; color: var(--warn); }
.badge-danger { background: #ffebee; color: var(--pmmg-red); }
.status-line {
    margin-top: 10px;
    min-height: 20px;
    color: var(--text-muted);
    font-size: .92rem;
}
.bottom-nav { display: none; }

/* Aba Escala Eleicao (Vue, escala-app.js) - unico bloco de CSS do painel escrito pra
   componente reativo em vez de tabela/toolbar estatica; reaproveita as variaveis de cor
   ja definidas em :root em vez de introduzir uma paleta nova. */
.escala-resumo-legenda {
    max-width: 760px;
    margin-bottom: 14px;
    line-height: 1.5;
}
.escala-resumo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
/* Esses .stat-card sao reusados aqui sem badge de icone (um card por municipio, nao uma
   metrica fixa do Dashboard) - sem essa sobrescrita, o padding-right reservado pro badge
   (.stat-card no Dashboard) deixaria um vazio sem uso do lado direito. */
.escala-resumo-grid .stat-card { padding-right: 20px; }
.escala-resumo-grid .value-alerta { color: var(--pmmg-red); }
/* KPI por CIA do card "Efetivo sem escala" (2026-07-28) - reusa .stat-card/.escala-resumo-grid
   como um filtro clicavel: clicar numa CIA aplica/remove o filtro de CIA da tabela abaixo, sem
   precisar usar o <select> ao lado. */
.stat-card--selecionavel { cursor: pointer; }
.stat-card--ativo { border-color: var(--pmmg-khaki); box-shadow: 0 0 0 2px var(--pmmg-khaki) inset; }
.escala-resumo-detalhe {
    margin-top: 8px;
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.escala-resumo-pendente { color: var(--pmmg-red); font-weight: 700; }
.escala-conflitos { border-top-color: var(--pmmg-khaki); }
.escala-conflitos ul { margin: 8px 0 0 20px; }
.escala-duplicidade-lista { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.escala-duplicidade-item { border-left: 3px solid var(--pmmg-khaki); background: var(--bg-app); border-radius: var(--radius-sm); padding: 8px 12px; }
.escala-duplicidade-item.duplicidade-alta { border-left-color: var(--pmmg-red); }
.escala-duplicidade-item ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: .82rem; color: var(--text-muted); }
.escala-duplicidade-tag { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 1px 6px; border-radius: 8px; margin-left: 6px; }
.escala-duplicidade-tag.tag-alta { background: rgba(171,35,40,.12); color: var(--pmmg-red); }
.escala-duplicidade-tag.tag-media { background: var(--pmmg-khaki-light); color: var(--pmmg-khaki-text); }

/* Painel de reforcos (2026-08-06) - origem do reforco (interno 19 BPM / externo / cruzamento
   interno em Teofilo Otoni) como 3 "cards-filtro" clicaveis, mesmo mecanismo de
   .stat-card--selecionavel/.stat-card--ativo ja usado pelo KPI por CIA, so que aqui e
   multi-selecao (varios grupos podem ficar ativos ao mesmo tempo) em vez de um so por vez -
   dai a cor de borda vir de uma custom property (--grupo-cor) por instancia, e o estado
   "excluido do filtro" ser so opacidade reduzida em vez de trocar a cor toda. */
.reforco-grupo-card { border-left: 4px solid var(--grupo-cor, var(--pmmg-khaki)); }
.reforco-grupo-card.stat-card--ativo { box-shadow: 0 0 0 2px var(--grupo-cor, var(--pmmg-khaki)) inset; }
.reforco-grupo-card.reforco-grupo-inativo { opacity: .45; }
.reforco-cat-list {
    max-height: 210px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-app);
    margin-top: 8px;
}
.reforco-cat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: .82rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}
.reforco-cat-row:last-child { border-bottom: none; }
.reforco-cat-row:hover { background: var(--pmmg-khaki-light); }
.reforco-cat-row .reforco-cat-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.reforco-cat-row .reforco-cat-nome { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.reforco-cat-row .reforco-cat-cnt { font-size: .74rem; color: var(--text-muted); }
.reforco-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px 2px 7px;
    border-radius: 12px;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}
.reforco-badge .reforco-badge-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.reforco-muni-lista { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.reforco-muni-linha {
    display: grid;
    grid-template-columns: 150px 1fr 34px;
    align-items: center;
    gap: 10px;
    padding: 4px 6px;
    border-radius: 8px;
    cursor: pointer;
}
.reforco-muni-linha:hover { background: var(--pmmg-khaki-light); }
.reforco-muni-linha.reforco-muni-ativa { background: var(--pmmg-khaki-light); box-shadow: 0 0 0 1px var(--pmmg-khaki) inset; }
.reforco-muni-nome { font-size: .82rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reforco-muni-trilha { height: 14px; border-radius: 4px; background: var(--bg-app); border: 1px solid var(--border-color); display: flex; overflow: hidden; }
.reforco-muni-seg { height: 100%; }
.reforco-muni-total { font-size: .78rem; text-align: right; color: var(--text-muted); }
.escala-grid { display: flex; flex-direction: column; gap: 26px; }
/* Cabecalho de municipio/CIA (reforma 2026-07-25) - banda com fundo caqui suave em vez de so
   uma linha embaixo do texto, pra funcionar como um "titulo de secao" de verdade e separar
   visualmente um municipio do outro numa lista longa (a Escala Eleicao normalmente mostra os
   21 municipios empilhados). */
.escala-grupo-titulo {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--pmmg-black);
    background: var(--pmmg-khaki-light);
    border-radius: var(--radius-sm);
    padding: 11px 16px;
    margin-bottom: 16px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.escala-grupo-total { margin-left: auto; font-weight: 400; }
.escala-seta { display: inline-block; width: 12px; color: var(--pmmg-khaki-text); }
.escala-subgrupo { margin-bottom: 20px; }
/* Nome do local + zona/contagem/botao numa linha propria embaixo (reforma 2026-07-25) - antes
   tudo dividia a mesma linha flex sem min-width:0, entao um nome de local longo (ex.: 2+ locais
   condensados "Escola A + Escola B") estourava a largura do card em vez de quebrar linha
   (reportado pelo usuario com print mostrando o texto cortado pela borda). */
.escala-local-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}
.escala-local-titulo {
    font-weight: 700;
    color: var(--pmmg-black);
    font-size: .98rem;
    overflow-wrap: break-word;
    margin-bottom: 6px;
}
.escala-local-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
}
.escala-chips {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}
.escala-chip {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--pmmg-khaki);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: box-shadow .15s ease;
}
.escala-chip:hover { box-shadow: var(--shadow-card-hover); }
.escala-chip.chip-hipotecado { border-left-color: var(--warn); }
.escala-chip.chip-reforco { border-left-color: var(--pmmg-red); }
.escala-chip.chip-rp { border-left-color: #6f9bbf; }
.escala-chip.chip-sof { border-left-color: #6f9bbf; }
.escala-chip.chip-oficial_referencia { border-left-color: var(--pmmg-black); }
.escala-chip.chip-cartorio_eleitoral { border-left-color: var(--pmmg-black); }
.escala-chip.chip-disposicao_juiza { border-left-color: var(--pmmg-black); }
.escala-chip.chip-motorista_cpu { border-left-color: #6f9bbf; }
.escala-chip.chip-motorrecobrimento { border-left-color: var(--pmmg-black); }
.escala-chip.chip-gepar { border-left-color: var(--pmmg-black); }
.escala-chip.chip-olho_vivo { border-left-color: var(--pmmg-black); }
.escala-chip.chip-copom { border-left-color: var(--pmmg-black); }
.escala-chip.chip-teleatendimento_remoto { border-left-color: var(--pmmg-black); }
.escala-chip.chip-p3 { border-left-color: var(--pmmg-black); }
.escala-chip.chip-pendente {
    border-left-style: dashed;
    background: repeating-linear-gradient(135deg, var(--bg-surface), var(--bg-surface) 10px, #fafafa 10px, #fafafa 20px);
}
.escala-chip.chip-pendente .chip-papel { color: var(--pmmg-red); }
/* Militar indisponivel (transferido/afastado/etc., ver CLAUDE.md 2026-07-30) mas ainda com
   atribuicao na escala - "tom degrade avermelhado" pedido pelo usuario, so alerta visual (a
   remocao da atribuicao continua sempre manual, nunca automatica). */
.escala-chip.chip-indisponivel {
    background: linear-gradient(135deg, var(--bg-surface) 0%, #f8d2d2 100%);
    border-left-color: var(--pmmg-red);
    border-left-width: 6px;
}
.escala-chip-aviso-indisponivel {
    color: var(--pmmg-red);
    font-weight: 800;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.chip-papel {
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--pmmg-khaki-text);
}
.chip-nome { font-weight: 700; color: var(--pmmg-black); }
.chip-detalhe { font-size: .82rem; }
/* Lista dos locais que um chip condensado representa (2026-07-25) - so aparece quando o card
   junta 2+ locais com equipe identica. Cada tag tem seu proprio "x" pra remover a pessoa so
   daquele local especifico, sem desfazer a presenca dela nos outros locais do grupo. */
.chip-locais-agrupados {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.chip-local-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--pmmg-khaki-light);
    color: var(--pmmg-khaki-text);
    border-radius: 999px;
    padding: 2px 4px 2px 8px;
    font-size: .72rem;
    font-weight: 600;
}
.chip-local-remover {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: .95rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}
.chip-local-remover:hover { color: var(--pmmg-red); }
.chip-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn-chip { min-height: 32px; padding: 6px 12px; font-size: .78rem; }
.escala-oficiais-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}
.escala-oficial-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--pmmg-black);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.escala-oficial-card h3 {
    font-size: .95rem;
    color: var(--pmmg-khaki-text);
    text-transform: uppercase;
    letter-spacing: .03em;
    margin: 0;
}
.escala-oficial-titulo { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 6px; }
.escala-oficial-card--recolhido { padding-bottom: 12px; gap: 0; }
.escala-oficial-nome { font-weight: 700; color: var(--pmmg-black); }
.escala-oficial-whatsapp {
    display: inline-block;
    margin-top: 6px;
    text-align: center;
    background: #25d366;
    border-color: #25d366;
    color: #fff;
}
.escala-oficial-whatsapp:hover { background: #1ebe5a; }
.escala-busca-resultados {
    list-style: none;
    margin: 6px 0 14px;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
.escala-busca-resultados li {
    padding: 8px 10px;
    cursor: pointer;
    font-size: .88rem;
    border-bottom: 1px solid var(--border-color);
}
.escala-busca-resultados li:last-child { border-bottom: 0; }
.escala-busca-resultados li:hover { background: var(--pmmg-khaki-light); }

/* Aba Eventos SIGOP (2026-08-18) - 4 KPIs de dia relativo que tambem funcionam como filtro
   clicavel (mesmo padrao ja usado por .stat-card--selecionavel/.stat-card--ativo no card
   "Efetivo sem escala" da aba Escala Eleicao). */
.kpi-row-eventos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin: 14px 0;
}
.kpi-dia-evento {
    background: var(--bg-surface);
    border: 1px solid rgba(0, 0, 0, .05);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 16px 18px;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
}
.kpi-dia-evento:hover { box-shadow: var(--shadow-card-hover); }
.kpi-dia-evento.ativo { box-shadow: 0 0 0 2px var(--pmmg-khaki) inset, var(--shadow-card); }
.kpi-dia-evento .rotulo { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.kpi-dia-evento .valor { margin-top: 8px; font-size: 1.7rem; font-weight: 800; color: var(--pmmg-black); }
.kpi-dia-evento .pendentes { margin-top: 6px; font-size: .76rem; font-weight: 700; color: var(--pmmg-red); }

/* Linha "amanha, ainda pendente" - mesmo raciocinio ja documentado pro chip-indisponivel da
   Escala Eleicao: gradiente/pulso normal aqui porque e tela de navegador, nunca o relatorio
   impresso via window.print() (onde um gradiente ja causou rasterizacao do PDF - ver CLAUDE.md). */
.linha-evento-alerta td { background: #fff3f3; animation: pulsoAlertaEvento 1.8s ease-in-out infinite; }
@keyframes pulsoAlertaEvento {
    0%, 100% { box-shadow: inset 3px 0 0 var(--pmmg-red); }
    50% { box-shadow: inset 3px 0 0 rgba(171, 35, 40, .35); }
}
.badge-conflito { background: #fff3e0; color: #9a5a00; }

@media (max-width: 800px) {
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        transform: translateX(-100%);
        transition: transform .2s ease;
        z-index: 20;
    }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle { display: inline-block; }
    .content-area { padding: 12px 12px 72px; }
    .toolbar .form-control { flex-basis: 100%; }
    /* minmax(220px,1fr) do desktop nao cabe em 2 colunas numa tela de ~390px (iPhone comum) -
       forca 1 coluna nesse breakpoint em vez de estourar a largura (achado testando o
       screenshot mobile da reforma 2026-07-25). */
    .dashboard-grid { grid-template-columns: 1fr; }
    .stat-card { padding-right: 20px; }
    .stat-icon-badge { position: static; margin-top: 10px; }
    .bottom-nav {
        position: fixed;
        inset: auto 0 0 0;
        height: 60px;
        background: #fff;
        border-top: 1px solid var(--border-color);
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        z-index: 10;
    }
    .bottom-nav-item {
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        text-decoration: none;
        font-size: .78rem;
        cursor: pointer;
    }
    .bottom-nav-item.active { color: var(--pmmg-khaki-text); font-weight: 800; }
    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table tr {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-bottom: 12px;
        background: #fff;
    }
    .data-table td {
        display: grid;
        grid-template-columns: 120px 1fr;
        gap: 10px;
        border: 0;
    }
    .data-table td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-weight: 700;
    }
}
