:root{color-scheme:light;--bg:#f4f7fa;--ink:#17364e;--muted:#7790a4;--border:#d6e2eb;--blue:#1b537a;--red:#cd2e39;--orange:#cc8215;--green:#218061;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-synthesis:none}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-size:13px}button,select,input{font:inherit}button{cursor:pointer}.stripe{height:5px;background:linear-gradient(90deg,#123f66 0%,#1887b3 55%,#2db3bc 100%)}.page{max-width:1550px;padding:26px 30px 45px;margin:0 auto}.page-header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px}.branding{display:flex;gap:15px;align-items:center}.brand-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:13px;color:white;background:linear-gradient(145deg,#164b70,#2692b5);box-shadow:0 5px 14px #174e6c27;flex-shrink:0}.brand-icon svg{width:28px;height:28px}.overline{font-weight:900;letter-spacing:1.65px;color:#0f7ba9;font-size:10px}h1{font-size:27px;font-weight:860;letter-spacing:-.8px;margin:3px 0 5px}p{margin:0}.branding p{color:#748c9f;font-size:12px}.header-right{display:flex;align-items:center;gap:16px}.public{font-size:11px;color:#246f60;background:#eaf8f2;border:1px solid #c7ecdc;border-radius:25px;padding:8px 12px;white-space:nowrap;font-weight:800}.green-circle{display:inline-block;width:7px;height:7px;border-radius:50%;background:#20ae7a;margin-right:7px}.stamp{background:white;border:1px solid #d9e5ed;border-radius:11px;padding:10px 16px;min-width:196px;display:flex;flex-direction:column;gap:2px}.stamp span,.stamp small{font-size:10px;color:#8197a9}.stamp span{letter-spacing:.5px;font-weight:800}.stamp strong{font-size:12px;color:#174361}.stats{background:white;border:1px solid var(--border);border-radius:12px;display:grid;grid-template-columns:repeat(4,1fr);overflow:hidden;margin-bottom:15px;box-shadow:0 2px 13px #214e7008}.stat{padding:18px 22px;display:flex;flex-direction:column;align-items:flex-start;gap:3px;min-height:105px;border-right:1px solid var(--border)}.stat:last-child{border-right:0}.stat>span{font-size:10px;letter-spacing:.55px;font-weight:900;color:#607b91}.stat strong{font-size:32px;line-height:1.2;letter-spacing:-.8px;color:#174969;font-weight:850}.stat small{font-size:10px;color:#92a2b0}.stat.red strong{color:var(--red)}.stat.orange strong{color:var(--orange)}.stat.green strong{color:var(--green)}.report{background:white;border:1px solid var(--border);border-radius:13px;overflow:hidden;box-shadow:0 3px 14px #163e5909}.report-head{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:18px 20px 13px}.section-meta{color:#166e9b;font-size:10px;letter-spacing:1.05px;font-weight:900;display:flex;align-items:center;gap:7px}.cloud{font-size:18px;line-height:1;color:#167cac}.report-head h2{margin:7px 0 5px;font-size:18px;color:#163d5d;letter-spacing:-.25px}.report-head p{font-size:11px;color:#8196a5}.toolbar{display:flex;align-items:end;gap:9px;flex-wrap:wrap}.filter{display:flex;flex-direction:column;gap:5px;color:#728b9e;font-size:10px;font-weight:850}.filter input,.filter select{height:36px;background:#fff;border:1px solid #d5e3ed;border-radius:8px;color:#345a77;padding:7px 9px;min-width:138px;font-size:11px;font-weight:650}.filter select{min-width:156px}.refresh{height:36px;display:flex;align-items:center;gap:7px;border:1px solid #a9cddd;background:#eaf5fb;border-radius:8px;font-weight:800;font-size:11px;color:#146688;padding:9px 13px}.refresh:hover{background:#d7edf8}.refresh svg{width:14px;height:14px}.refresh:disabled{opacity:.65;cursor:wait}.report-note{border-top:1px solid #e8eef3;background:#f9fcfe;padding:10px 21px;font-size:10px;color:#7991a2}.pulse{display:inline-block;width:6px;height:6px;background:#1fa27a;border-radius:50%;margin-right:7px}.report-note.error{background:#fff2f1;color:#ae2830}.report-note.error .pulse{background:#c83340}.table-scroller{margin:0 14px;overflow:auto;border:1px solid #cbd9e5;border-radius:10px}.table{border-collapse:collapse;width:100%;min-width:1150px;font-size:11px}.table th{background:#1d5278;border-right:1px solid #567f9f;padding:13px 10px;color:#fff;text-align:left;letter-spacing:.2px;white-space:nowrap;font-size:10px;font-weight:900}.table th:last-child{border-right:0}.table td{padding:10px 11px;min-height:36px;border-right:1px solid #dbe5ed;border-bottom:1px solid #dce6ef;color:#37536a;vertical-align:middle;line-height:1.45;overflow-wrap:anywhere}.table tr:last-child td{border-bottom:0}.table td:last-child{border-right:0}.table tr:nth-child(even) td:not(.risk-cell):not(.motivo-cell){background:#fbfcfd}.table td.dep{font-weight:850;color:#26455f;white-space:nowrap}.table td.when{white-space:nowrap;font-size:10px;color:#688299}.risk-cell{font-weight:900;white-space:nowrap}.risk-cell.critico{color:#c42532;background:#fdebe9}.risk-cell.parcial{color:#a86b08;background:#fff2d8}.risk-cell.normal,.risk-cell.finalizada{color:#226b43;background:#e6f3e7}.risk-cell.por_evaluar{color:#39788e;background:#eaf5f9}.motivo-cell{font-weight:780}.motivo-cell.critico{color:#b85a0f;background:#fff0e9}.motivo-cell.parcial{color:#9f6306;background:#fff3d9}.motivo-cell.normal,.motivo-cell.finalizada{color:#236d43;background:#e7f4e8}.motivo-cell.por_evaluar{color:#3b7892;background:#ebf6fa}.secondary{display:block;font-size:9px;font-weight:550;color:#7b92a3;margin-top:4px}.comment{max-width:320px;font-size:10.5px}.comment .label{font-size:9px;color:#7991a0;font-weight:800;margin-right:4px}.comment .detail{display:block;margin:2px 0}.comment .mitigation{color:#326f59}.evidence{background:#f4fbff;border:1px solid #c5dfef;border-radius:7px;padding:7px 10px;color:#176c98;font-size:10px;font-weight:900;white-space:nowrap}.evidence:hover{background:#e3f2fa}.empty{text-align:center;color:#8196a6!important;padding:35px 12px!important}.footer-row{padding:13px 19px;display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:10px;color:#8195a8}.export{border:0;background:none;color:#136a99;font-size:11px;font-weight:900;padding:6px;cursor:pointer}.export:hover{text-decoration:underline}.foot{display:flex;justify-content:space-between;gap:28px;margin-top:15px;color:#7c91a1;font-size:10px;line-height:1.5}.foot p:first-child{max-width:760px}.overlay[hidden]{display:none!important}.overlay{position:fixed;z-index:10000;inset:0;background:#0b253aa8;backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;padding:15px}.dialog{width:min(820px,100%);max-height:94vh;overflow:hidden;background:white;border-radius:14px;display:flex;flex-direction:column;box-shadow:0 25px 90px #06192588}.dialog-header{display:flex;align-items:center;gap:10px;padding:15px 19px;border-bottom:1px solid #e1e9f0}.dialog-icon{display:grid;place-items:center;width:35px;height:35px;border-radius:9px;background:#eef6fb;color:#257cab;font-size:23px}.dialog-header>div:nth-child(2){flex:1}.dialog-header span,.notes span{font-weight:900;color:#71899b;letter-spacing:.7px;font-size:9px}.dialog-header h2{font-size:17px;color:#173f5c;margin:3px 0}.close{border:0;background:#f2f6fa;color:#496c82;border-radius:7px;padding:8px 10px}.dialog-body{padding:16px;overflow:auto}.media{min-height:220px;max-height:62vh;background:#172a38;display:flex;justify-content:center;align-items:center;overflow:hidden;border-radius:9px;color:#dae4ec;font-size:12px;text-align:center;padding:15px}.media img,.media video{max-width:100%;max-height:58vh;width:auto;height:auto;object-fit:contain}.media video{width:100%}.media-nav{display:flex;justify-content:center;align-items:center;gap:18px;padding:12px}.media-nav[hidden]{display:none}.media-nav button{border-radius:7px;padding:7px 11px;background:#f3f8fb;color:#24678d;border:1px solid #d5e5ef;font-size:11px;font-weight:800}.media-nav span{color:#7592a6;font-size:10px}.notes{background:#f9fbfc;border:1px solid #dfe9ef;border-radius:10px;margin-top:11px;padding:12px 14px;display:grid;gap:11px}.notes>div+div{border-top:1px solid #e1e9ed;padding-top:10px}.notes p{font-size:12px;color:#3e586b;margin-top:5px;white-space:pre-wrap;overflow-wrap:anywhere}.notes>div:last-child span{color:#368068}@media(max-width:1050px){.page{padding:23px 17px}.report-head{align-items:flex-start;flex-direction:column}.toolbar{justify-content:flex-start}.stats{grid-template-columns:repeat(2,1fr)}.stat:nth-child(2){border-right:0}.stat:nth-child(-n+2){border-bottom:1px solid var(--border)}}@media(max-width:620px){.page{padding:18px 9px 25px}.page-header{align-items:flex-start;flex-direction:column}.brand-icon{width:38px;height:38px}.branding{gap:9px}h1{font-size:20px}.header-right{width:100%;justify-content:space-between}.stamp{min-width:0}.stat{padding:14px 12px;min-height:88px}.stat strong{font-size:25px}.stat>span{font-size:9px}.report-head{padding:14px 11px}.report-head h2{font-size:16px}.filter input,.filter select{min-width:120px}.table-scroller{margin:0 6px}.footer-row{padding:12px}.foot{display:block;padding:0 5px}.foot p+p{margin-top:6px}.dialog-body{padding:11px}.media{min-height:160px}}

/* Visor V1.1: mapa territorial Leaflet integrado sin tocar la tabla. */
.map-report{background:#fff;border:1px solid var(--border);border-radius:13px;padding:16px 14px 12px;margin-top:16px;box-shadow:0 1px 3px #22546c0a;min-width:0}
.map-report-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:2px 4px 13px}
.map-report-heading h2{font-size:16px;color:#173b55;letter-spacing:-.3px;margin:5px 0}
.map-report-heading p{font-size:10.5px;color:#7890a3}
.map-legend{display:flex;gap:13px;align-items:center;flex-wrap:wrap;font-size:10px;font-weight:800;color:#47667b}
.map-legend span{display:flex;align-items:center;gap:5px}
.map-legend-dot{width:9px;height:9px;border-radius:50%;display:inline-block}
.map-legend-dot.is-critical{background:#d8263b}.map-legend-dot.is-partial{background:#f3a11b}.map-legend-dot.is-review{background:#57a1cb}
.map-toolbar{display:flex;gap:7px;align-items:center;background:#eff5f9;border:1px solid #d6e5ef;padding:8px 10px;border-radius:9px;margin-bottom:10px}
.map-button{color:#205c82;background:white;border:1px solid #c9dce9;border-radius:7px;font-size:10px;font-weight:800;padding:9px 11px;cursor:pointer}
.map-button.primary{background:#19577b;color:white;border-color:#19577b}
.map-button.expand{margin-left:auto}.map-button:hover{filter:brightness(.96)}
.map-layout{display:grid;grid-template-columns:minmax(0,56fr) minmax(0,44fr);gap:11px;min-width:0;align-items:stretch;height:410px}
.map-left{display:flex;flex-direction:column;min-width:0;min-height:0;border:1px solid #d5e3ec;border-radius:9px;overflow:hidden;background:#e8f2f7}
.map-canvas{flex:1;min-height:0;width:100%;background:#e3f0f7;z-index:0}
.map-foot{padding:6px 10px;background:#f7fafc;border-top:1px solid #d9e6ee;color:#6e879d;font-size:9.5px;min-height:27px}
.map-summary{border:1px solid #d6e3eb;border-radius:9px;overflow:hidden;display:flex;flex-direction:column;min-width:0;min-height:0;background:white}
.map-summary-head{display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid #e0e9ee;gap:10px}
.map-summary-icon{width:30px;height:30px;border-radius:8px;background:#fff0f1;color:#df3040;display:grid;place-items:center;font-size:16px;flex-shrink:0}
.map-summary-head>div:nth-child(2){flex:1;min-width:0}.map-summary-head strong{display:block;font-size:11px;color:#173f5d}
.map-summary-head small{display:block;margin-top:3px;color:#8398a8;font-size:9.5px}
.map-summary-count{color:#cc2736;background:#fff0f2;padding:6px 10px;border-radius:8px;font-size:17px;font-weight:900}
.map-summary-columns{display:flex;justify-content:space-between;gap:8px;padding:9px 11px;font-weight:800;font-size:9px;color:#607e92;border-bottom:1px solid #e3e9ee;background:#fbfdfe}
.map-summary-rows{overflow-y:auto;flex:1;min-height:0}
.map-location{display:grid;grid-template-columns:24px minmax(0,1fr) auto;gap:9px;align-items:start;padding:11px 10px;border-bottom:1px solid #e4ebf1;min-width:0}
.map-location:hover{background:#f9fbfe}
.map-index{width:23px;height:23px;background:#d82b3d;border-radius:50%;font-weight:850;display:grid;place-items:center;color:white;font-size:10px}
.map-index.parcial{background:#df921b}.map-index.por_evaluar{background:#6baecb}.map-index.normal{background:#22947b}
.map-location-main{min-width:0}
.map-name{border:0;background:none;padding:0;color:#144d72;font-size:11px;font-weight:900;cursor:pointer;text-align:left}.map-name:hover{text-decoration:underline}
.map-zone{font-size:10px;color:#6f87a0;margin:4px 0;overflow-wrap:anywhere}
.map-comment,.map-mitigation{font-size:10px;line-height:1.45;color:#4c6579;overflow-wrap:anywhere;margin-top:4px}
.map-comment{font-style:italic}.map-mitigation{color:#367366}
.map-location-action{display:flex;flex-direction:column;align-items:flex-end;gap:8px}
.map-risk{background:#fae5e9;color:#c02d3a;border-radius:25px;padding:4px 7px;font-size:9px;font-weight:900;white-space:nowrap}
.map-risk.critico{color:#fff;background:#d8263b}.map-risk.parcial{color:#fff;background:#e49a23}
.map-risk.por_evaluar{color:#fff;background:#5eacc8}.map-risk.normal{color:#fff;background:#159879}
.map-view-file{background:#f4faff;border:1px solid #cbdfee;color:#1f6690;border-radius:7px;padding:6px 8px;font-size:10px;font-weight:900;white-space:nowrap;cursor:pointer}
.map-view-file:hover{background:#e3f3fc}.map-summary-footer{border-top:1px solid #e2ebf0;background:#f8fbfd;font-size:9px;color:#72899e;padding:9px 10px;line-height:1.4}
.map-empty{padding:20px;font-size:11px;color:#7790a4;text-align:center}
.map-disclaimer{font-size:9.5px;color:#7891a5;margin:9px 3px 0;line-height:1.4}
.leaflet-container{font-family:inherit!important}.leaflet-control-attribution{font-size:9px!important}.leaflet-popup-content p{margin:6px 0;font-size:11px;color:#385e78}
.map-report.map-fullscreen{position:fixed;inset:10px;z-index:11000;margin:0;padding:12px 14px;background:white;display:flex;flex-direction:column;border-radius:11px;box-shadow:0 18px 60px #10273888;min-height:0;max-height:calc(100dvh - 20px)}
.map-report.map-fullscreen .map-report-heading{flex:0 0 auto;padding-bottom:7px}.map-report.map-fullscreen .map-toolbar{flex:0 0 auto}
.map-report.map-fullscreen .map-layout{height:auto;flex:1 1 auto;min-height:0;grid-template-columns:minmax(0,60fr) minmax(290px,40fr)}
.map-report.map-fullscreen .map-disclaimer{flex:0 0 auto}
@media(max-width:1050px){.map-layout{grid-template-columns:1fr;height:auto}.map-left{height:410px}.map-summary{min-height:230px;max-height:380px}.map-report.map-fullscreen .map-layout{grid-template-columns:1fr;grid-template-rows:minmax(210px,1fr) minmax(130px,.45fr)}.map-report.map-fullscreen .map-left{height:auto}.map-report.map-fullscreen .map-summary{max-height:none;min-height:0}}
@media(max-width:620px){.map-report{padding:11px 8px}.map-report-heading{align-items:flex-start;flex-direction:column}.map-legend{gap:9px}.map-toolbar{flex-wrap:wrap}.map-button.expand{margin-left:auto}.map-left{height:350px}.map-location{grid-template-columns:24px minmax(0,1fr) auto;gap:7px}.map-location-action{gap:6px}.map-risk{font-size:8px}.map-view-file{font-size:9px}}

/* V1.2: motor cartográfico local de respaldo, disponible aunque falle CDN Leaflet.
   Las teselas de OpenStreetMap siguen siendo opcionales y las zonas administrativas
   reales se dibujan en SVG, incluso si no llegan las teselas. */
.offline-leaflet{background:#dcebf2;cursor:grab;user-select:none}
.offline-leaflet:active{cursor:grabbing}
.offline-map-attribution{position:absolute;right:3px;bottom:3px;z-index:420;
  background:#fffd;color:#344e60;border-radius:3px;padding:3px 5px;font-size:9px;line-height:1.2}
.offline-map-attribution a{color:#13597f;text-decoration:none}
.offline-zoom{position:absolute;z-index:510;left:11px;top:11px;display:flex;flex-direction:column;
  border:1px solid #b8cdd9;border-radius:7px;overflow:hidden;box-shadow:0 2px 7px #183c5433}
.offline-zoom button{width:34px;height:33px;background:#fff;color:#165a83;border:0;font-size:20px;
  font-weight:800;cursor:pointer}
.offline-zoom button+button{border-top:1px solid #d1e0e8}
.offline-zoom button:hover{background:#e7f3f9}
.offline-map-popup{position:absolute;z-index:650;background:#fff;border:1px solid #cddce7;
  width:230px;max-width:calc(100% - 16px);border-radius:9px;padding:12px;
  box-shadow:0 6px 28px #092d4650;font-size:11px;color:#214862}
.offline-map-popup[hidden]{display:none}
.offline-map-popup button{margin-top:6px}
.offline-map-shapes{pointer-events:auto}
.offline-map-shapes path:hover{stroke-width:3;fill-opacity:.75}
