/* Seção "Mapa e inventário de recursos" — mesma paleta verde KW do relatório. */
.tabs{display:flex;gap:4px;border-bottom:1px solid #d8e1da;margin:0 0 14px}
.tabs button{border:0;border-bottom:3px solid transparent;border-radius:0;background:transparent;height:36px;padding:0 14px;color:#65776b;font-weight:500}
.tabs button:hover{background:#f0f5f2}
.tabs button[aria-selected="true"]{color:#163f32;border-bottom-color:#1e684b;font-weight:600}

/* Na aba do mapa, filtros e relatório de atualizações ficam ocultos (conexão permanece). */
#main.view-map .controls label,#main.view-map #summary,#main.view-map .report-layout{display:none}

.map-filters{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin-bottom:6px}
.map-filters label:has(#mSearch){flex:1;min-width:200px}
#mSearch{width:100%}
.map-panel,.items-panel{margin-bottom:14px}
#map{height:400px;background:#eef3f0;z-index:0}
.dot{display:inline-block;width:11px;height:11px;border-radius:50%;vertical-align:middle;margin-right:5px}
.dot-gps{background:#2f8f64;border:2px solid #163f32}
.dot-uf{background:transparent;border:2px dashed #b36a1f}

.items-table{min-width:760px;table-layout:auto}
.items-table th,.items-table td{height:auto;padding:6px 12px;vertical-align:middle}
.items-table thead th{background:#163f32;color:#fff;height:34px;position:sticky;top:0;z-index:1}
.items-table th:first-child{width:76px}
.items-table th:nth-child(3){width:130px}
.items-table th:nth-child(4){width:100px;text-align:right}
.items-table td:nth-child(4){text-align:right;font-variant-numeric:tabular-nums;font-weight:600}
.items-table tbody td+td{border-left:1px solid #dce4df}
.items-table td small{display:block;margin:2px 0 0;color:#7c8c80}
.items-table tbody tr.is-active{background:#edf5ef}
.thumb{width:56px;height:44px;border:1px solid #d8e1da;border-radius:4px;background:#f2f5f3;padding:0;display:flex;align-items:center;justify-content:center;overflow:hidden;color:#97a399;font-size:10px;cursor:default;position:relative}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.thumb.has-photo{cursor:zoom-in}
.thumb .count{position:absolute;right:2px;bottom:2px;background:#163f32cc;color:#fff;border-radius:3px;padding:0 4px;font-size:10px;line-height:14px}
.more{padding:10px 14px;text-align:center;border-top:1px solid #edf1ee}
.more[hidden],#mMore[hidden]{display:none}

#photoDialog{width:900px}
.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px;margin-top:15px;max-height:70vh;overflow:auto}
.gallery figure{margin:0}
.gallery img{width:100%;border-radius:6px;border:1px solid #d8e1da;display:block;background:#f2f5f3;min-height:120px;object-fit:contain}
.gallery figcaption{font-size:11px;color:#7c8c80;margin-top:4px}
.leaflet-popup-content{font:12px "Segoe UI",Arial,sans-serif;line-height:1.5;color:#233b30}
.leaflet-popup-content button{margin-top:6px}
@media(max-width:700px){#map{height:320px}
.tabs button{padding:0 8px;font-size:11px}}
@media print{.tabs,.map-filters,.more{display:none}
#map{height:300px}}
.items-table th:nth-child(2){width:30%}
.items-table th:nth-child(5){width:24%}
.items-table th:nth-child(6){width:20%}

/* Layout lado a lado: tabela à esquerda; mapa e comparativo PEX à direita. */
.map-layout{display:grid;grid-template-columns:minmax(0,1fr) 460px;gap:14px;align-items:start}
.map-layout>*{min-width:0}
.side{display:flex;flex-direction:column;gap:14px}
.side section,.map-layout>section{margin:0}
.items-panel .scroll{max-height:none;overflow:visible}
.items-table{min-width:0;width:100%}
.items-table th,.items-table td{padding:2px 8px;font-size:11px;line-height:1.25}
.items-table thead th{height:28px}
.items-table th:first-child{width:44px}
.items-table th:nth-child(3){width:92px}
.items-table th:nth-child(4){width:56px}
.items-table th:nth-child(5){width:84px}
.items-table th:nth-child(2){width:auto}
.items-table th:nth-child(6){width:18%}
.thumb{width:36px;height:26px;border-radius:3px;font-size:8px}
.thumb .count{font-size:8px;line-height:11px;padding:0 3px}
.items-table td small{font-size:10px;margin:0}
tr.grp th{background:#edf5ef;color:#163f32;font-weight:600;text-align:left;border-top:1px solid #d9e7dd;border-bottom:1px solid #d9e7dd;padding:4px 8px;cursor:pointer;height:auto;font-size:11px}
tr.grp th small{font-weight:400;color:#63796a;margin-left:8px}
tr.grp th::before{content:"▾ ";color:#4a946b}
tr.grp.closed th::before{content:"▸ "}
.pex-table{min-width:0;table-layout:auto;width:100%}
.pex-table th,.pex-table td{padding:3px 8px;font-size:11px;height:auto}
.pex-table thead th{background:#163f32;color:#fff;height:28px;text-align:right}
.pex-table thead th:first-child{text-align:left}
.pex-table td{text-align:right;font-variant-numeric:tabular-nums}
.pex-table td:first-child{text-align:left}
.pex-table td+td{border-left:1px solid #dce4df}
.pex-table tfoot td,.pex-table tfoot th{background:#edf5ef;color:#163f32;font-weight:600;border-top:2px solid #b8cbbf;text-align:right;height:auto;padding:4px 8px;font-size:11px}
.pex-table tfoot th{text-align:left}
.neg{color:#c52f32}
.pos{color:#163f32}
.cov{display:flex;align-items:center;gap:8px;justify-content:flex-end}
.cov i{display:block;width:60px;height:6px;background:#e6ece8;border-radius:3px;overflow:hidden;flex:none}
.cov b{display:block;height:100%;background:currentColor;border-radius:3px}
.cov em{font-style:normal;font-weight:600;min-width:66px;text-align:right;font-variant-numeric:tabular-nums;color:#163f32}
.cov.t-na em{font-weight:400;color:#5b6d62}
.sem-pex td{color:#5b6d62}
.sem-pex td:first-child{font-style:italic}
.pex-note{margin:0;padding:8px 14px;font-size:10px;color:#7c8c80;line-height:1.5;border-top:1px solid #edf1ee}
.map-filters select{min-width:130px}
@media(max-width:1100px){.map-layout{grid-template-columns:minmax(0,1fr)}
.side{position:static;order:-1}
.items-panel .scroll{max-height:none}}
.items-table td:nth-child(4){white-space:nowrap}
.items-table td:nth-child(4) small{display:inline;margin-left:2px}
.av{width:22px;height:22px;border-radius:50%;object-fit:cover;vertical-align:middle;margin-right:7px;border:1px solid #d8e1da;background:#f2f5f3;flex:none}
.av-i{display:inline-flex;align-items:center;justify-content:center;font-size:9px;font-weight:600;color:#163f32;background:#dceee2}
.rank-label span{display:flex;align-items:center}
tr.grp th .av{width:20px;height:20px}
.pex-row{cursor:pointer}
.pex-row:hover{background:#f4f9f6}
.pex-panel .heading select{height:28px;padding:2px 8px}
.pex-panel .scroll{max-height:none;overflow:visible}
.pex-items{min-width:700px;font-size:11px}
.pex-items th,.pex-items td{padding:4px 8px;font-size:11px}
#pexDialog{width:1000px}
.items-table th:nth-child(7){width:15%}
.items-table th:nth-child(8){width:84px}
.items-table td:nth-child(8){white-space:nowrap}

/* Filtros à esquerda, indicadores no topo, quantidades em cores vivas. */
.map-shell{display:grid;grid-template-columns:220px minmax(0,1fr);gap:14px;align-items:start}
.filters{background:#fff;border:1px solid #e1e8e3;border-radius:8px;padding:12px;position:sticky;top:8px;display:flex;flex-direction:column;gap:10px}
.filters h2{font-size:14px;margin:0 0 2px}
.filters label{display:block}
.filters input,.filters select{width:100%}
.filters button{width:100%}
.map-main{min-width:0}
.v-pex{color:#0b63ff;font-weight:700}
.v-app{color:#00a152;font-weight:700}
.v-neg{color:#e11d2a;font-weight:700}
.t-ok{color:#00a152}
.t-mid{color:#f08000}
.t-low{color:#e11d2a}
.t-na{color:#7c8c80}
.qv{color:#00a152;font-weight:700}
.items-table td.qv small{color:#7c8c80;font-weight:400}
.kpi-band{background:#fff;border:1px solid #e1e8e3;border-radius:8px;padding:12px;margin-bottom:12px}
.kpi-top{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;align-items:start}
.kpi-cards{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.kpi-cards .kpi-gauge{grid-column:span 2}
.kpi{border:1px solid #e1e8e3;border-radius:8px;padding:10px 12px;background:#fbfdfc;display:flex;flex-direction:column;gap:2px;min-width:0}
.kpi small{font-size:11px;color:#65776b}
.kpi b{font-size:24px;line-height:1.15;font-variant-numeric:tabular-nums}
.kpi b .of{font-size:13px;color:#7c8c80;font-weight:500}
.kpi em{font-style:normal;font-size:10px;color:#86938b}
.kpi-gauge{flex-direction:row;align-items:center;gap:12px}
.kpi-gauge>div:last-child{display:flex;flex-direction:column;gap:2px}
.gauge{--deg:0deg;width:64px;height:64px;border-radius:50%;flex:none;display:grid;place-items:center;background:conic-gradient(currentColor var(--deg),#e8eeea 0)}
.gauge span{width:48px;height:48px;border-radius:50%;background:#fff;display:grid;place-items:center;font-size:10px;letter-spacing:-.2px;font-weight:700;color:#163f32}

.kpi-chart h3{margin:0 0 6px;font-size:12px;font-weight:600;color:#163f32}
.kpi-chart h3 small{font-weight:400;color:#86938b;margin-left:6px}
.bars{padding-right:4px}
.bar-row{padding:4px 0;border-bottom:1px solid #f0f3f1}
.bar-row:last-child{border:0}
.bar-label{display:flex;justify-content:space-between;gap:8px;font-size:11px;align-items:center}
.bar-label span{display:flex;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:0}
.bar-label strong{font-variant-numeric:tabular-nums}
.bar-track{height:7px;background:#eef2ef;border-radius:3px;overflow:hidden;margin:3px 0 2px}
.bar-fill{height:100%;border-radius:3px}
.f-ok{background:#00b35a}
.f-mid{background:#ff9500}
.f-low{background:#f0303d}
.f-na{background:#c3cdc7}
.bar-sub{font-size:10px;color:#7c8c80}
@media(max-width:1100px){.map-shell{grid-template-columns:minmax(0,1fr)}
.filters{position:static;display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}
.kpi-top{grid-template-columns:1fr}
.kpi-cards{grid-column:auto;grid-template-columns:1fr 1fr}
.kpi-cards .kpi-gauge{grid-column:span 2}}

#photoDialog{width:min(1100px,96vw)}
.photo-split{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:16px;align-items:start}
.photo-split .gallery{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}
.photo-split .gallery img{width:100%;border-radius:6px;cursor:zoom-in}
.photo-info{margin-top:15px;border:1px solid #d9e0ea;border-radius:8px;padding:12px;background:#f7f9fc;max-height:70vh;overflow:auto}
.photo-info dl{margin:0;display:grid;grid-template-columns:auto 1fr;gap:6px 10px;font-size:13px}
.photo-info dt{color:#5b6778;font-weight:600}
.photo-info dd{margin:0;word-break:break-word}
@media(max-width:800px){.photo-split{grid-template-columns:1fr}}

.kpi-hist{margin-top:14px;border-top:1px solid #eef2ef;padding-top:10px}
.kpi-hist h3{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.hist-opt{margin-left:auto;font-size:11px;font-weight:400;color:#65776b}
.hist-opt select{font-size:11px;margin-left:4px}
.hist-leg{font-size:11px;font-weight:400;color:#65776b}
.hist-leg i{display:inline-block;width:10px;height:10px;border-radius:2px;margin:0 4px 0 8px;vertical-align:-1px}
.v-pex-bg{background:#0b63ff}
.v-app-bg{background:#00a152}
.hist{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(52px,1fr);gap:6px;overflow-x:auto;padding-bottom:4px}
.hist-col{display:flex;flex-direction:column;min-width:0}
.hist-bars{height:170px;display:flex;align-items:flex-end;justify-content:center;gap:3px;border-bottom:1px solid #cfd8d2}
.hist-bar{flex:1;max-width:24px;min-height:1px;border-radius:3px 3px 0 0;position:relative}
.hist-bar.p{background:#0b63ff}
.hist-bar.a{background:#00a152}
.hist-bar span{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);font-size:9px;font-weight:700;white-space:nowrap;padding-bottom:1px}
.hist-bar.p span{color:#0b63ff}
.hist-bar.a span{color:#00a152}
.hist-name{font-size:10px;line-height:1.2;color:#35453b;text-align:center;margin-top:4px;height:36px;overflow:hidden;word-break:break-word}

.side-kpi{background:#fff;border:1px solid #e1e8e3;border-radius:8px;padding:10px}
.side-kpi .summary{margin:8px 0 0;font-size:11px;color:#65776b}
.side-kpi .kpi-cards{grid-template-columns:repeat(2,1fr)}

.side-kpi .kpi-top{grid-template-columns:1fr;margin-top:12px;gap:12px}
.side-kpi .kpi-hist{margin-top:12px}
.side-kpi .hist-bars{height:140px}
.side-kpi .hist{grid-auto-columns:minmax(58px,1fr)}
@media(min-width:1101px){.map-layout{grid-template-columns:minmax(0,1fr) 520px}}

/* Diálogo de foto + ficha */
#photoDialog{padding:0;border:0;border-radius:12px;box-shadow:0 20px 60px rgba(10,30,22,.35);width:min(1080px,96vw)}
#photoDialog::backdrop{background:rgba(12,28,22,.55)}
.pd-head{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;padding:16px 20px;border-bottom:1px solid #e1e8e3;background:#f4f8f5;border-radius:12px 12px 0 0}
#photoTitle{margin:0;display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;font-size:18px;color:#163f32}
#photoTitle small{flex-basis:100%;font-size:12px;font-weight:400;color:#65776b}
.pd-tag{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;background:#e3f1ea;color:#0f5a3a;border-radius:999px;padding:3px 10px}
.pd-tag .ic{width:14px;height:14px}
#photoClose{border:1px solid #d3dcd6;background:#fff;color:#163f32;font-size:15px;line-height:1;border-radius:8px;width:34px;height:34px;cursor:pointer}
#photoClose:hover{background:#eef3ef}
.photo-split{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:20px;padding:20px;align-items:start}
.photo-split .gallery{display:flex;flex-direction:column;gap:10px;margin:0;max-height:none;overflow:visible}
.pg-main{margin:0;background:#101a16;border-radius:10px;display:flex;flex-direction:column;overflow:hidden}
.pg-main img{width:100%;height:min(52vh,460px);object-fit:contain;background:#101a16;display:block}
.pg-main figcaption{font-size:11px;color:#c9d6cf;padding:6px 10px;background:#1a2a23}
.pg-thumbs{display:flex;gap:8px;flex-wrap:wrap}
.pg-thumbs button{padding:0;border:2px solid transparent;border-radius:8px;overflow:hidden;width:76px;height:58px;cursor:pointer;background:#e8eeea}
.pg-thumbs button.on{border-color:#00a152}
.pg-thumbs img{width:100%;height:100%;object-fit:cover;display:block}
.pg-empty{display:grid;place-items:center;align-content:center;gap:6px;min-height:240px;border:2px dashed #d3dcd6;border-radius:10px;color:#86938b}
.pg-empty .ic{width:42px;height:42px}
.photo-info{margin:0;border:0;padding:0;background:none;max-height:min(70vh,560px);overflow:auto;display:flex;flex-direction:column;gap:10px}
.pi-sec{border:1px solid #e1e8e3;border-radius:10px;padding:10px 12px;background:#fbfdfc}
.pi-sec h3{margin:0 0 6px;font-size:11px;letter-spacing:.04em;text-transform:uppercase;color:#4d6a5b;display:flex;align-items:center;gap:6px}
.ic{width:16px;height:16px;flex:none}
.pi-sec dl{margin:0;display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 12px;font-size:13px}
.pi-sec dt{color:#65776b}
.pi-sec dd{margin:0;font-weight:500;color:#1c2b23;word-break:break-word}
.pi-sec dd.wide{grid-column:1/-1;font-weight:400}
@media(max-width:800px){.photo-split{grid-template-columns:1fr}}

/* Histograma por grupo (barras horizontais, eixo %) */
.hist{display:block;overflow:visible;padding:4px 0 0}
.hh-axis,.hh-row{display:grid;grid-template-columns:104px minmax(0,1fr);gap:8px;align-items:center}
.hh-axis>div{position:relative;height:14px;font-size:9px;color:#65776b;margin-right:34px}
.hh-axis span{position:absolute;transform:translateX(-50%)}
.hh-axis span:first-child{transform:none}
.hh-row{padding:3px 0;border-bottom:1px solid #f0f3f1}
.hh-name{font-size:11px;line-height:1.2;color:#35453b;word-break:break-word}
.hh-bars{position:relative;display:flex;flex-direction:column;gap:2px;margin-right:34px}
.hh-grid{position:absolute;inset:0;pointer-events:none}
.hh-grid i{position:absolute;top:0;bottom:0;border-left:1px dashed #e1e8e3}
.hb{position:relative;height:10px;display:flex;align-items:center}
.hb-fill{height:100%;min-width:1px;border-radius:0 3px 3px 0;position:relative}
.hb-fill.p{background:#0b63ff}
.hb-fill.a{background:#00a152}
.hb-val{font-size:9px;font-weight:700;white-space:nowrap;margin-left:4px;position:relative}
.hb-val.p{color:#0b63ff}
.hb-val.a{color:#00a152}

.side-kpi .kpi-top{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px}
.side-kpi .bar-label{font-size:11px}

.hb-val small{font-weight:400;color:inherit;opacity:.8;font-size:inherit}
.hh-axis>div{margin-right:76px}
.hh-bars{margin-right:76px}

/* Histograma: barra do PEX (100%) ao fundo e cadastrado sobreposto */
.hh-bars{display:flex;flex-direction:row;align-items:center;gap:8px;margin-right:0}
.hb-over{position:relative;flex:1;min-width:0;height:16px}
.hb-total{position:absolute;inset:0 auto 0 0;background:var(--blue-soft,#c9dcec);border:1px solid var(--info);border-radius:var(--radius-sm)}
.hb-over .hb-fill{position:absolute;left:0;top:3px;bottom:3px;height:auto;min-width:1px;background:var(--success);border-radius:var(--radius-sm)}
.hb-lbl{flex:none;width:118px;font-size:11px;text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.hb-lbl small{color:var(--ink-muted);margin-left:2px}
.hh-axis>div{margin-right:126px}

.dot-gps{background:#faac3d;border:2px solid #201e1e}
.dot-uf{background:#fdd798;border:2px dashed #201e1e}
.sw{display:inline-block;width:12px;height:12px;border:1px solid #7c9a88;vertical-align:middle;margin-right:5px;border-radius:2px}
.sw-com{background:#276342}
.sw-sem{background:#f4b8b2}
.sw-nao{background:#fff}
.legend{flex-wrap:wrap;gap:4px 14px}

.dot-gps{background:#fff;border:2px solid #201e1e}
.dot-uf{background:#fff;border:2px dashed #201e1e}
.co-wrap{background:none;border:0}
.co{height:34px;box-sizing:border-box;padding:2px 8px;background:#fff;border:1px solid #201e1e;border-left-width:4px;border-radius:2px;font:12px/15px Arial,Helvetica,sans-serif;color:#201e1e;display:flex;flex-direction:column;justify-content:center;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.15)}
.co b{font-size:11px;font-weight:700;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.co span{font-size:11px;white-space:nowrap}
.co strong{font-weight:700}
.co-ok{border-left-color:#1d7346}
.co-mid{border-left-color:#e8921c}
.co-low{border-left-color:#b42318}
.co-na{border-left-color:#92978f}
.co-over{border-left-color:#1f5f8b}

/* Tabelas sem barra de rolagem própria: a página rola e o cabeçalho fica fixo logo abaixo da barra de abas (40px).
   overflow:clip mantém os cantos arredondados sem criar um container de rolagem, que desativaria o sticky. */
.items-panel,.pex-panel{overflow:clip}
.items-table thead th,.pex-table thead th{position:sticky;top:40px;z-index:2}

/* Exportar relatório */
.exp-wrap{display:block}
.exp-an{margin-top:8px;display:flex;flex-direction:column;gap:4px}
.exp-an label{display:flex;flex-direction:column;gap:2px;font-size:11px}
.exp-an select{font-size:12px}
.exp-wrap p{margin:4px 2px 0;font-size:11px;color:#65776b}
.exp-wrap p:empty{display:none}
@media print{.exp-wrap{display:none}}

/* Altura de linha estática: nada quebra de linha; nomes longos ganham reticências (o nome completo fica no title). */
.pex-table td,.pex-table th{white-space:nowrap}
.pex-table tbody td{height:28px;padding-top:0;padding-bottom:0;vertical-align:middle}
.pex-table td:first-child{width:100%;min-width:140px;max-width:1px;overflow:hidden;text-overflow:ellipsis}
.pex-table .cov{height:28px}
.hh-row{height:26px;padding:0;align-items:center}
.hh-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;word-break:normal}
.bar-row{height:50px;box-sizing:border-box;overflow:hidden}
.bar-label{height:18px}
.bar-label span,.bar-label strong,.bar-sub{white-space:nowrap}
.bar-sub{overflow:hidden;text-overflow:ellipsis}
/* A barra de aderência usa a cor da faixa (o kw_ds.css força verde; esta regra é mais específica). */
.pex-panel .pex-table .cov i b{background:currentColor}
.pex-panel .pex-table .cov em{font-style:normal}
.g-leg{display:grid;grid-template-columns:12px minmax(0,1fr) auto;gap:7px;align-items:center;padding:3px 0}
.g-leg i{width:12px;height:12px;border-radius:50%}
.g-leg span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.g-leg b{font-variant-numeric:tabular-nums}
.g-note{grid-template-columns:12px minmax(0,1fr);color:#65776b;margin-top:4px}
.g-note span{white-space:normal}
.g-gps{background:#8a948e;border:1.5px solid #201e1e}
.g-apx{background:transparent;border:2px dashed #8a948e}
.leaflet-control-layers{font:12px "Segoe UI",Arial,sans-serif}
.leaflet-control-layers-list label{display:flex;align-items:center;gap:6px;margin:2px 0;font-size:12px}
.leaflet-control-layers-list input{width:auto;height:auto;margin:0}
.leaflet-control-layers-list span{display:inline}
.leaflet-control-layers-list label{display:block}
.leaflet-control-layers-list label>span{display:flex;flex-direction:row;align-items:center;gap:6px;white-space:nowrap}
.leaflet-control-layers-base{display:flex;flex-direction:column;gap:2px}
.g-leg i.g-ico{width:20px;height:20px;border-radius:50%;display:grid;place-items:center}
.g-leg:has(.g-ico){grid-template-columns:20px minmax(0,1fr) auto}
.g-leg.g-size{grid-template-columns:1fr}

/* Resumo por equipamento (clique na bolha) e legenda do contorno */
.g-uf{width:12px;height:12px;border:1.5px solid #00873f;border-radius:2px;background:rgba(0,194,90,.35)}
.rs{font-size:12px}
.rs-box{max-height:270px;overflow:auto;margin:8px 0;border:1px solid #e1e8e3;border-radius:6px}
.rs-tab{width:100%;border-collapse:collapse;min-width:0;font-size:12px}
.rs-tab th,.rs-tab td{padding:4px 8px;text-align:right;height:auto;white-space:nowrap}
.rs-tab th:first-child,.rs-tab td:first-child{text-align:left;white-space:normal}
.rs-tab td:first-child{position:relative}
.rs-tab thead th{background:#163f32;color:#fff;position:sticky;top:0;z-index:1}
.rs-tab tbody td{border-top:1px solid #eef2ef}
.rs-tab td:first-child{padding-bottom:8px}
.rs-tab td:first-child i{position:absolute;left:8px;bottom:2px;height:3px;border-radius:2px;opacity:.75;max-width:calc(100% - 16px)}
.rs-ico{width:16px;height:16px;border-radius:50%;display:inline-grid;place-items:center;vertical-align:middle;margin-right:6px}
.rs-tab tfoot th{background:#edf5ef;color:#163f32;border-top:2px solid #b8cbbf;position:sticky;bottom:0}
.rs-tab td b{color:#00a152}
.rs-act{display:flex;gap:8px}
.rs-act button{flex:1;margin:0}

/* Resumo da bolha: abas e organograma gerente > coordenador > CR */
.rs-tabs{display:flex;gap:4px;margin:8px 0 0}
.rs-tabs button{flex:1;margin:0;border-radius:6px 6px 0 0;border:1px solid #d3ddd6;border-bottom:0;background:#eef3ef;color:#163f32;font-weight:600;padding:5px 8px}
.rs-tabs button.on{background:#163f32;color:#fff;border-color:#163f32}
.rs-box[hidden]{display:none}
.rs-tabs+.rs-box{margin-top:0;border-radius:0 0 6px 6px}
.rs-box[data-pane=org]{max-height:none;overflow:visible}
.oc{padding:10px 8px;display:flex;flex-direction:column;gap:12px}
.oc-g{display:flex;flex-direction:column;align-items:center}
.oc-kids{position:relative;display:flex;flex-wrap:wrap;justify-content:center;gap:10px 8px;margin-top:14px;padding-top:0}
.oc-g>.oc-1::after{content:"";display:block;position:absolute}
.oc-c{position:relative;display:flex;flex-direction:column;align-items:center;gap:3px;width:96px;text-align:center}
.oc-c b{font-size:10px;font-weight:600;line-height:1.15;color:#163f32;max-width:100%;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.oc-f{width:38px;height:38px;border-radius:50%;object-fit:cover;border:2px solid #9db8a8;background:#e6f3ea}
.oc-i{display:inline-grid;place-items:center;font-size:12px;font-weight:700;color:#163f32}
.oc-1 .oc-f{width:46px;height:46px;border-color:#163f32}
.oc-1{width:130px}
.oc-1 b{font-size:11px;font-weight:700}
.oc-2::before{content:"";position:absolute;top:-8px;left:50%;height:8px;border-left:2px solid #9db8a8}
.oc-g:has(.oc-2)>.oc-1::after{position:absolute;left:50%;bottom:-14px;height:14px;border-left:2px solid #9db8a8}
.oc-g:has(.oc-2)>.oc-1{margin-bottom:0}
.oc-kids::before{content:"";position:absolute;top:-8px;left:48px;right:48px;border-top:2px solid #9db8a8}
.oc-g:not(:has(.oc-2)) .oc-kids{display:none}


/* Resumo da bolha: tabela e organograma lado a lado */
.rs-cols{display:flex;gap:12px;align-items:flex-start;margin:8px 0}
.rs-cols .rs-box{margin:0}
.rs-eq{flex:1 1 330px;min-width:0}
.rs-org{flex:1 1 340px;min-width:0}
.rs-oh{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#163f32;margin:0 0 4px}
.rs-org .rs-box{max-height:none;overflow:visible}
@media(max-width:820px){.rs-cols{flex-direction:column}}
.leaflet-control-layers{display:none}
/* Resumo da bolha: organograma acima da tabela */
.rs-cols{flex-direction:column;gap:10px}
.rs-eq,.rs-org{flex:none;width:100%}
.rs-oh{margin-bottom:4px}
/* Resumo da bolha: linhas de grade na tabela */
.rs-tab{border-collapse:separate;border-spacing:0}
.rs-tab tbody td{border-top:0;border-bottom:1px solid var(--border)}
.rs-tab tbody td+td,.rs-tab thead th+th,.rs-tab tfoot th+th{border-left:1px solid var(--border)}
.rs-tab thead th+th{border-left-color:rgba(255,255,255,.25)}
.rs-tab tbody tr:nth-child(even) td{background:var(--surface-raised)}
.rs-tab tbody tr:hover td{background:var(--green-50)}
/* Resumo da bolha: coluna de quantidade centralizada e mais estreita */
.rs-tab{table-layout:fixed}
.rs-tab th:last-child,.rs-tab td:last-child{width:92px;text-align:center;font-variant-numeric:tabular-nums}
/* Resumo da bolha: cabeçalho e total ficam por cima das linhas ao rolar (ícones não vazam) */
.rs-tab thead th,.rs-tab tfoot th{z-index:5;background-clip:padding-box}
.rs-tab tbody td{position:relative;z-index:0}
.rs-tab tbody td:first-child{isolation:isolate}
.rs-box{isolation:isolate}
/* Resumo da bolha: revisão da tabela (barra de proporção ao fundo, uma linha por item, números neutros) */
.rs-tab tbody td{padding:7px 10px;height:34px;vertical-align:middle}
.rs-tab tbody td:first-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-bottom:7px}
.rs-tab td:first-child i{left:0;top:0;bottom:auto;height:100%;max-width:100%;border-radius:0;opacity:.16;z-index:-1}
.rs-tab td b{color:var(--ink);font-weight:700}
.rs-tab tbody td:last-child{font-size:13px}
.rs-tab tfoot th{font-weight:700;padding:8px 10px;font-size:12px}
.rs-tab tfoot th:last-child{font-size:13px}
.rs-tab thead th{padding:8px 10px;font-size:12px;letter-spacing:.02em}
.rs-ico{margin-right:8px}
.eqk{display:flex;flex-direction:column;min-width:0;background:var(--surface);border:1px solid var(--border);border-left:3px solid var(--primary);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:var(--space-4)}
.eqk{padding:var(--space-3)}
@container (max-width:270px){
 .eqk-chip{display:none}
 .eqk-ico{width:32px;height:32px}
 .eqk-total{font-size:24px}
 .eqk-pct b{font-size:13px}
.eqk-pct small{font-size:10px}
 .eqk-sit{grid-template-columns:repeat(3,minmax(0,1fr))}
 .eqk-sit b{font-size:14px}
.eqk-sit span{font-size:10px;padding-left:0;line-height:12px}
 .eqk-h small{font-size:11px}
}
@container (max-width:215px){.eqk-sep-v,.eqk-pct{display:none}
.eqk-h .eqk-sep{display:none}}
.eqk{padding:var(--space-3) var(--space-3) var(--space-3) var(--space-4)}
@container (max-width:250px){
 .eqk-sit .lg{display:none}
.eqk-sit .sh{display:inline}
 .eqk-sit>div{padding:0 var(--space-1)}
 .eqk-sit span{font-size:10px}
}
/* Indicadores: versão compacta */
.eqk{padding:var(--space-2) var(--space-3) var(--space-2) var(--space-3)}
/* Organização mais densa */@media(min-width:1101px){
 .eqk{padding:6px var(--space-3)}
}
@container (max-width:260px){.eqk-h small{display:none}}
@container (max-width:190px){
 .eqk{padding:6px var(--space-2)}
 .eqk-h{gap:var(--space-1)}
 .eqk-ico{width:18px;height:18px}
.eqk-ico svg{stroke-width:1.7}
 .eqk-h .eqk-sep{display:none}
 .eqk-tit{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
 .eqk-h div{min-width:0;flex:1}
 .eqk-total{font-size:20px;line-height:24px}
 .eqk-barra{height:5px;margin:4px 0}
 .eqk-sit{padding-top:4px}
 .eqk-sit>div{padding:0 3px}
 .eqk-sit b{font-size:12px;gap:3px}
.eqk-sit b i{width:7px;height:7px}
 .eqk-sit .lg,.eqk-sit .sh{display:none}
.eqk-sit .xs{display:inline;font-size:9px}
 .eqk-sit span{font-size:9px;min-height:0;line-height:11px}
 .eqk-sit .pc{display:none}
 .eqk-and{flex-direction:column;align-items:flex-start;gap:2px}
.eqk-and .eqk-sep{display:none}
 .eqk-m1 b{font-size:14px}
.eqk-m1 small{font-size:9px}
}
@container (max-width:190px){
 .eqk-tit .tl{display:none}
.eqk-tit .ts{display:inline}
 .eqk-sit{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr)}
 .eqk-sit b{font-size:11px}
 .eqk-corpo{justify-content:space-between}
}
@container (max-width:190px){
 .eqk-st{gap:var(--space-2)}
.eqk-ro{width:44px;height:44px}
.eqk-nums li{font-size:11px;gap:4px}
}
@container (max-width:130px){.eqk-ro{width:38px;height:38px}
.eqk-nums li{font-size:10px;gap:3px}}
@container (max-width:150px){
 .kp-tit .tl{display:none}
.kp-tit .ts{display:inline}
 .kp-v>b{font:var(--text-heading-1)}
 .kp-ro{width:40px;height:40px}
.kp-ro text{display:none}
 .kp-nums{gap:0 var(--space-2)}
}
@container (max-width:150px){
 .eq-kpis .kp-ico{width:var(--space-4);height:var(--space-4)}
 .kp-h{gap:var(--space-1)}
}
@container (max-width:150px){.kp-v>b{font:var(--text-heading-1)}}

/* Indicadores na faixa superior, à direita dos botões e do status de conexão */
.top-bar{display:flex;align-items:flex-start;gap:var(--space-4)}
.top-info{flex:0 1 auto;min-width:0}
.top-kpis{flex:1 1 0;min-width:0}
.top-kpis[hidden]{display:none}
@media(max-width:1100px){.top-bar{flex-direction:column;align-items:stretch}}
@media(min-width:1101px){.top-info{flex:0 0 360px;max-width:360px}
.top-info .controls{flex-wrap:wrap}
.top-info #connection{white-space:normal}}

/* Ajuste de largura da faixa superior */@media(min-width:1101px){.top-info{flex:0 0 300px;max-width:300px}}

/* Resumo da bolha: árvore grupo > tipo > modelo */
.tr-head{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:var(--space-3);padding:6px var(--space-2);background:var(--band);color:var(--on-band);border-radius:var(--radius-sm) var(--radius-sm) 0 0;font:var(--text-label)}
.tr-head span:nth-child(2){text-align:right}
.tr-all{font:var(--text-chart-axis);font-weight:700;padding:1px var(--space-2);height:auto;width:auto;margin:0;background:var(--on-dark-fill);color:var(--on-band);border:1px solid var(--on-dark-line);border-radius:var(--radius-sm);cursor:pointer}
.tr-box{max-height:240px;overflow:auto;border:1px solid var(--border);border-top:0;border-radius:0;margin:0}
.tr-box summary{list-style:none;cursor:pointer}
.tr-box summary::-webkit-details-marker{display:none}
.tr-g>summary{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:var(--space-2);padding:5px var(--space-2);background:var(--green-50);border-bottom:1px solid var(--border);font:var(--text-label);color:var(--ink);position:sticky;top:0;z-index:1}
.tr-g>summary::before{content:"";width:6px;height:6px;border-right:2px solid var(--primary);border-bottom:2px solid var(--primary);transform:rotate(-45deg);transition:transform .12s;margin-right:2px;grid-column:1;grid-row:1}
.tr-g>summary .rs-ico{display:none}
.tr-g[open]>summary::before{transform:rotate(45deg)}
.tr-g>summary span{grid-column:2}
.tr-g>summary b{grid-column:3;font-variant-numeric:tabular-nums}
.tr-g>summary:hover,.tr-t>summary:hover{background:var(--green-100)}
.tr-b{padding:0}
.tr-t>summary,.tr-leaf{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--space-2);align-items:center;padding:4px var(--space-2) 4px var(--space-6);border-bottom:1px solid var(--border);font:var(--text-web-table);color:var(--ink)}
.tr-t>summary{position:relative}
.tr-t>summary::before{content:"";position:absolute;left:var(--space-3);top:50%;width:5px;height:5px;margin-top:-4px;border-right:2px solid var(--ink-muted);border-bottom:2px solid var(--ink-muted);transform:rotate(-45deg);transition:transform .12s}
.tr-t[open]>summary::before{transform:rotate(45deg);margin-top:-5px}
.tr-t ul{list-style:none;margin:0;padding:0;background:var(--surface-raised)}
.tr-t li{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--space-2);padding:3px var(--space-2) 3px calc(var(--space-6) + var(--space-4));border-bottom:1px solid var(--border);font:var(--text-chart-axis);color:var(--ink-muted)}
.tr-box span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tr-box b{font:var(--text-label);color:var(--ink);font-variant-numeric:tabular-nums;text-align:right}
.tr-t li b{font:var(--text-chart-axis);font-weight:700}
.tr-tot{display:flex;justify-content:space-between;align-items:center;padding:6px var(--space-2);background:var(--panel-brand);border:1px solid var(--border);border-top:2px solid var(--green-200);border-radius:0 0 var(--radius-sm) var(--radius-sm);font:var(--text-label);color:var(--band)}
.tr-tot b{font-variant-numeric:tabular-nums}
.tr-box{max-height:200px}
.rs-mm-pop .rs-act{margin-top:0}
.rs-mm-pop .leaflet-popup-content{margin:var(--space-3)}
@keyframes mm-in{from{opacity:0;transform:translateX(-6px)}
to{opacity:1;transform:none}}

.g-uf{border:1px solid #00a650;background:rgba(0,166,80,.12)}

/* Mapa em cores neon: estados e bolhas com brilho */
.leaflet-contornoUf-pane path{filter:drop-shadow(0 0 3px #00ff85) drop-shadow(0 0 7px rgba(0,255,133,.55))}
.g-uf{border:1px solid #00ff85;background:rgba(0,255,133,.14);box-shadow:0 0 5px #00ff85}

/* neon somente no mapa mental (círculos e estados voltam ao visual anterior) */
.leaflet-contornoUf-pane path{filter:none}
.g-uf{border:1px solid #00a650;background:rgba(0,166,80,.12);box-shadow:none}

/* ===== Aba Posse de recursos: o conteúdo é React + Tailwind + shadcn/ui (painel-ui/ -> posse/posse.js e posse.css). Aqui só o enquadramento da página. ===== */
body:has(#viewHist:not([hidden])) header.kw-banner{padding:var(--space-1) var(--space-4)}
body:has(#viewHist:not([hidden])) .kw-logo{height:28px}
body:has(#viewHist:not([hidden])) .tabs button{height:34px}
body:has(#viewHist:not([hidden])) .kw-sub{display:none}
body:has(#viewHist:not([hidden])) .tabs{margin:0}
body:has(#viewHist:not([hidden])) main{display:flex;align-items:center;gap:var(--space-4);max-width:none;padding:var(--space-1) var(--space-3)}
body:has(#viewHist:not([hidden])) .top-bar{flex:1;min-width:0}
body:has(#viewHist:not([hidden])) main footer{flex:none;max-width:40%;margin:0}
body:has(#viewHist:not([hidden])) main{flex-direction:column;align-items:stretch}
body:has(#viewHist:not([hidden])) main footer{max-width:none}
#viewHist{background:transparent}
@media(max-width:1100px){
body:has(#viewHist:not([hidden])) main{flex-direction:column;align-items:stretch}
body:has(#viewHist:not([hidden])) main footer{max-width:none}
}

/* ===== Padrão das abas: barra de conexão em uma linha; filtros sempre no painel lateral ===== */
.inv-shell[hidden]{display:none}
.inv-shell .report-layout{min-width:0}
.top-bar .top-info{flex:1;max-width:none;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:var(--space-2) var(--space-4)}
.top-info .controls{flex:none;margin:0}
.top-info .controls button{height:28px}
.top-info #connection{flex:1 1 280px;min-width:0;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top-info .sync-bar,.top-info .summary{margin:0}
@media(max-width:700px){.top-info #connection{flex-basis:100%;white-space:normal}}
