:root{--navy:#12263f;--ink:#213348;--muted:#667b92;--edge:#dfe6f0;--panel:#fff;--blue:#2563eb;--gray:#87919e;--first:#81cba3;--green:#148d53;--yellow:#eeb444;--red:#d7464e;--cyan:#4976ba}*{box-sizing:border-box}html,body{height:100%}body{margin:0;color:var(--ink);background:#f5f8fc;font:14px/1.42 system-ui,-apple-system,'Segoe UI',sans-serif}button,input,select,textarea{font:inherit}button{cursor:pointer}button:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #6ba4f6;outline-offset:2px}a{color:#205bd6}.top{height:62px;display:flex;align-items:center;justify-content:space-between;background:var(--navy);padding:0 18px;color:white;gap:9px}.brand{display:flex;align-items:center;gap:10px}.brand strong{display:block;font-size:16px}.brand small{display:block;color:#c1d1e4;font-size:11px}.brand-icon{width:32px;height:32px;background:#2d77d4;border-radius:10px;display:grid;place-items:center;font-size:24px}.demo-tag{font-size:11px;color:#e5edfa;background:#2d465e;padding:6px 9px;border-radius:8px;white-space:nowrap}.layout{height:calc(100dvh - 62px);min-height:410px;display:grid;grid-template-columns:minmax(315px,365px) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);grid-template-areas:'filters map' 'panel map'}.filters{grid-area:filters;background:#fff;border-right:1px solid var(--edge);padding:12px 13px 9px;border-bottom:1px solid var(--edge)}.searchrow{display:grid;grid-template-columns:42% 1fr;gap:8px}.field{display:flex;flex-direction:column;gap:4px;min-width:0}.field>span{color:#627389;font-weight:700;font-size:11px}.field input,.field select,.status-control,.note-input{background:white;border:1px solid #cfd9e8;color:var(--ink);border-radius:9px;min-width:0;width:100%;min-height:40px;padding:8px 9px}.field input[type=file]{font-size:12px;padding:7px}.filter-bottom{display:flex;justify-content:space-between;gap:8px;margin-top:10px;align-items:center}.filter-action{padding:7px 9px;border-radius:8px;background:#fff;border:1px solid #dae3f0;color:#435b79;font-size:11px;font-weight:700;min-height:36px}.filter-action.on{background:#e7f3e9;border-color:#a8d5b5;color:#126c3e}.layers{position:relative;font-size:11px}.layers summary{cursor:pointer;border:1px solid #d9e2ee;border-radius:8px;padding:8px 9px;min-height:36px;font-weight:700;list-style:none;background:#f7fafd;white-space:nowrap}.layers summary::-webkit-details-marker{display:none}.layer-options{position:absolute;right:0;top:38px;min-width:242px;z-index:1100;background:white;padding:13px;border:1px solid #d5e1ef;border-radius:10px;box-shadow:0 8px 24px #0817282c}.layer-options label{display:flex;gap:9px;padding:6px;align-items:center;font-size:12px;white-space:nowrap}.layer-options input{width:17px;height:17px;accent-color:#2068d7}.swatch{display:inline-block;width:13px;height:13px;border-radius:50%;border:1px solid #0002;flex:none}.stats{margin-top:10px;display:flex;justify-content:space-between;gap:5px;color:#62758a;font-size:10px;font-weight:750}.stats span{background:#f3f6fc;border-radius:7px;padding:5px;white-space:nowrap}.mapbox{grid-area:map;position:relative;min-width:0;min-height:240px;background:#e7eef1}#map{height:100%;width:100%}.map-tip{z-index:400;position:absolute;top:12px;left:12px;max-width:290px;pointer-events:none;background:#fffffff0;border-radius:9px;padding:8px 11px;box-shadow:0 3px 15px #0b213129;font-size:12px;color:#466075}.panel{grid-area:panel;overflow:auto;background:#fff;border-right:1px solid var(--edge);padding:13px;min-height:0;scrollbar-width:thin}.panel-heading,.group-heading{display:flex;justify-content:space-between;align-items:center;gap:8px}.panel-heading strong{font-size:14px}.text-btn{border:none;background:transparent;color:#355f94;font-size:12px;font-weight:700;padding:6px}.empty{background:#f2f6fa;color:#75869d;font-size:12px;padding:15px;border:1px dashed #d5e0ed;border-radius:9px;margin:10px 0 15px}.contact-head{display:flex;gap:11px;align-items:center;margin-top:11px}.contact-bubble{display:grid;place-items:center;flex:none;border-radius:11px;width:48px;height:48px;background:#eef3fb;color:#294768;font-weight:850;font-size:16px}.contact-head strong{display:block;font-size:14px;line-height:1.23}.contact-head small{color:#6c7d90}.info-grid{display:grid;grid-template-columns:70px minmax(0,1fr);gap:6px 10px;font-size:12px;margin:13px 0}.info-grid .key{color:#70829b}.info-grid .val{min-width:0;overflow-wrap:anywhere}.phones{display:flex;gap:8px;flex-wrap:wrap;margin:9px 0}.phone-link{display:flex;align-items:center;gap:7px;background:#e9f4ef;border:1px solid #bce1ce;color:#176c48;font-weight:800;text-decoration:none;border-radius:10px;padding:11px 13px;min-height:45px}.phone-link:hover{background:#d8ece0}.buttonrow{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.button{min-height:44px;padding:9px 10px;border:1px solid #cfdbea;border-radius:10px;background:#fff;color:#374d66;font-weight:750;font-size:12px}.button.primary{background:#226fe7;border-color:#226fe7;color:white}.button.subtle{background:#f6f8fc}.button:disabled{opacity:.45;cursor:not-allowed}.status-area{display:flex;align-items:center;gap:10px;margin-top:13px}.status-area label{font-weight:750;font-size:12px;white-space:nowrap}.status-control{font-weight:650;flex:1;min-width:0}.note-label{display:block;color:#53677d;font-weight:750;font-size:12px;margin-top:12px}.note-input{display:block;min-height:66px;resize:vertical;padding:9px;margin-top:5px}.note-meta{font-size:10px;color:#8290a1;margin-top:4px}.warning{font-size:11px;color:#805900;background:#fff8e6;border:1px solid #efd9a2;padding:8px 10px;border-radius:8px;margin:9px 0}.group-section{margin-top:14px;padding-top:12px;border-top:1px solid #e5ebf3}.group-heading strong{font-size:13px}.tiny{font-size:10px;color:#7b8ca0}.group-list{display:flex;flex-direction:column;gap:7px;margin-top:9px;max-height:39vh;overflow:auto}.group-card,.member-card{border:1px solid #dee6f0;background:#fff;width:100%;display:flex;align-items:center;gap:10px;text-align:left;padding:9px 10px;border-radius:10px;color:var(--ink);min-height:54px}.group-card.open{border-color:#8eadd9;background:#edf5ff}.member-card{margin-left:13px;width:calc(100% - 13px);background:#f8fafd;border-style:dashed}.member-card.selected{border:2px solid #4277b9;background:#eaf3fc}.chip{flex:none;min-width:37px;height:37px;border-radius:50%;display:grid;place-items:center;font-weight:850;font-size:12px;border:2px solid #fff;box-shadow:0 1px 5px #0002;position:relative;color:white}.chip .micro{font-size:8px;position:absolute;right:-6px;bottom:-5px;background:#1c3554;color:white;padding:2px 4px;border-radius:4px}.card-text{min-width:0;flex:1}.card-text b{font-size:12px;display:block}.card-text small{font-size:11px;color:#718197;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.arrow{color:#788da4}.state-gray{background:var(--gray)}.state-first{background:var(--first);color:#153d2a}.state-complete{background:var(--green)}.state-absent{background:var(--yellow);color:#533c06}.state-reject{background:var(--red)}.state-appointment{background:var(--cyan)}.state-empty{background:#9aa5b3}.map-pin{position:relative;width:40px;height:40px;border-radius:50%;border:3px solid #fff;display:grid;place-items:center;box-shadow:0 2px 8px #0007;font-weight:900;font-size:13px;color:#fff;text-align:center;line-height:1}.map-pin.state-first,.map-pin.state-absent{color:#143b2d}.map-pin.selected{outline:3px solid #205fec;outline-offset:3px}.map-pin .corner{position:absolute;bottom:-8px;right:-9px;background:#213951;color:#fff;border:1px solid white;border-radius:6px;font-size:9px;line-height:1.4;padding:1px 4px;font-weight:800}.map-pin .corner.small{font-size:8px}.leaflet-div-icon{background:transparent!important;border:0!important}.tools{margin:15px 0;background:#f5f8fd;border:1px solid #dce6f1;border-radius:9px;padding:10px;font-size:12px}.tools summary{font-weight:800;cursor:pointer}.tool-body{margin-top:12px}.tool-body p{font-size:11px;color:#667b92}.template{display:inline-block;margin-top:10px;font-size:12px}footer{font-size:10px;color:#8795a5;margin:16px 0}.leaflet-control-attribution{font-size:9px!important}
@media(max-width:780px){.top{height:54px;padding:0 10px}.brand strong{font-size:14px}.brand-icon{width:28px;height:28px;font-size:19px}.brand small{font-size:9px}.demo-tag{font-size:9px;padding:5px 6px}.layout{height:calc(100dvh - 54px);min-height:460px;grid-template-columns:1fr;grid-template-rows:auto minmax(205px,47dvh) minmax(160px,1fr);grid-template-areas:'filters' 'map' 'panel'}.filters{padding:8px 10px}.field input,.field select{min-height:37px;padding:6px 8px}.filter-bottom{margin-top:7px}.stats{margin-top:6px}.mapbox{min-height:205px}.panel{border-right:none;border-top:2px solid #d6e0ec;padding:11px 13px 24px}.group-list{max-height:none}.map-tip{font-size:10px;top:8px;left:9px;max-width:220px;padding:6px 8px}.map-pin{width:39px;height:39px}.group-card,.member-card{min-height:55px}.note-input{min-height:68px}.layer-options{right:0;top:36px}.buttonrow{margin-top:8px}}
@media(max-width:360px){.demo-tag{font-size:8px}.stats{font-size:9px}.filters{padding:7px}.map-tip{max-width:185px}}
/* v3 · acciones y registro cronológico */
.button.call-button{display:flex;align-items:center;justify-content:center;background:#147f54;color:white;border-color:#147f54;text-decoration:none;font-size:13px}
.secondary-phone{display:inline-block;font-size:12px;margin-top:7px;color:#176c48;font-weight:700}
.location-row{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid #e6edf5;padding-top:10px;margin-top:10px;flex-wrap:wrap}
.location-hint{color:#7b8aa0;font-size:11px;font-variant-numeric:tabular-nums}
.small-action{border:1px solid #d0dbea;border-radius:7px;background:#f7f9fc;color:#4a617b;font-size:11px;font-weight:720;padding:5px 9px;min-height:30px;cursor:pointer}
.small-action.relocate{color:#2d5b91;border-color:#b6cbdf}
.small-action.save-edit{color:white;background:#2563eb;border-color:#2563eb}
.small-action.danger{color:#b33b42;border-color:#f0c6c7}
.notes-section{margin-top:13px;border:1px solid #dae5f2;border-radius:11px;background:#f6f9fd;padding:11px}
.notes-section .note-label{margin-top:0;font-size:13px;color:#2a486d}
.notes-section .note-input{min-height:68px;background:white}
.note-submit{background:#1e6bd6;color:white;border-color:#1e6bd6;width:100%;margin-top:8px;font-size:13px}
.history-title{display:flex;align-items:center;justify-content:space-between;gap:5px;margin:18px 0 9px}
.history-title strong{font-size:13px}.history-title small{font-size:10px;color:#718398}
.history{display:flex;flex-direction:column;gap:9px}
.event{border:1px solid #e1e8ef;border-radius:12px;padding:10px 11px;overflow-wrap:anywhere}
.note-event{background:#eaf3ff;margin-left:10px;border-color:#c8dced;border-top-right-radius:4px}
.system-event{background:#f5f7fa;border-left:3px solid #99adc3}
.event-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.event-head strong{font-size:11px}.event-time{color:#647992;font-size:10px;text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.event-body{margin:8px 0 5px;white-space:pre-wrap;font-size:12px;line-height:1.5;color:#233b54}
.event-edited,.event-meta,.history-empty{font-size:10px;color:#6d7f95}
.event-actions{display:flex;gap:7px;justify-content:flex-end;margin-top:8px}
.coords-change{display:flex;flex-direction:column;margin:7px 0;gap:5px;font-size:11px;font-variant-numeric:tabular-nums}
.geo-success{color:#14714d}.geo-info{color:#718196}
.move-bar{position:absolute;z-index:850;bottom:14px;left:15px;right:15px;margin:auto;max-width:450px;border:2px solid #316ace;border-radius:13px;padding:13px;background:white;box-shadow:0 6px 24px #12233465}
.move-bar[hidden]{display:none!important}
.move-bar strong{display:block;color:#194c86}.move-bar span{display:block;font-size:11px;color:#627995;margin:4px 0 10px}
.move-buttons{display:flex;gap:8px}.move-buttons .button{flex:1}
.relocation-mode{cursor:crosshair!important}
.reset-button{width:100%;margin-top:10px}
@media(max-width:780px){
  html,body{height:auto;min-height:100%}
  .layout{height:auto;min-height:calc(100dvh - 54px);display:flex;flex-direction:column}
  .mapbox{height:45dvh;min-height:270px;flex:none}
  .panel{min-height:300px;overflow:visible;flex:1;padding:13px 14px 30px}
  .filters{flex:none}
  .group-list{max-height:none}
  .selection{scroll-margin-top:10px}
  .mapbox{scroll-margin-top:10px}
  .move-bar{bottom:7px;left:8px;right:8px;padding:9px 10px}
  .move-bar .button{font-size:12px;padding:6px}
  .event-head{flex-wrap:wrap;gap:4px}
  .event-time{margin-left:auto}
  .buttonrow .button{min-height:49px;font-size:13px}
}

/* v4: encuesta, geolocalización, filtros de distancia y símbolos */
.type-tabs{display:flex;align-items:center;gap:6px;overflow-x:auto;margin-top:10px;padding:0 0 7px;scrollbar-width:thin;scroll-snap-type:x proximity}
.type-tab{flex:none;scroll-snap-align:start;display:flex;align-items:center;gap:6px;padding:8px 10px;background:#f3f7fc;color:#35526c;border:1px solid #d9e3f2;border-radius:9px;white-space:nowrap;font-size:11px;font-weight:750;min-height:37px}
.type-tab>span{font-size:17px;line-height:1}.type-tab.active{color:white;background:#245cb1;border-color:#245cb1}.type-tab i{font-style:normal;font-size:9px;background:#fff;color:#496278;border-radius:10px;padding:1px 5px}
.location-strip{display:flex;align-items:center;justify-content:space-between;gap:8px;background:#f3f7ff;border:1px solid #dbe6f9;border-radius:9px;padding:6px 8px;margin-top:5px}
.loc-text{font-size:10px;font-weight:750;color:#516b8b;line-height:1.3;min-width:0}.loc-text[data-state=ok]{color:#1765bc}.loc-text[data-state=error]{color:#a35332}
.loc-button{flex:none;border:1px solid #bdd2ec;background:#fff;border-radius:8px;color:#285b9a;padding:7px 8px;font-size:10px;font-weight:850;min-height:33px}.loc-button:disabled{opacity:.45;cursor:default}.loc-button.secondary{background:#e7f1ff}
.nearby-row{display:flex;align-items:center;gap:7px;margin-top:6px;color:#60768e;font-size:10px}.nearby-row label{font-weight:750}.nearby-row select{flex:1;min-width:0;border:1px solid #d5e1ef;border-radius:8px;padding:6px;background:#fff;color:#334c69;font-size:11px}.nearby-row .loc-button{padding:5px 8px}
.position-badge{position:absolute;bottom:28px;right:9px;z-index:450;border:1px solid #c0d9f4;box-shadow:0 3px 12px #1b40633a;border-radius:9px;padding:6px 9px;color:#1763b8;font-size:11px;font-weight:850;background:#f6fbff}
.position-badge[hidden]{display:none!important}.my-position-dot{filter:drop-shadow(0px 1px 3px #285a98aa)}
.map-pin-v4{position:relative;display:grid;place-items:center;width:54px;height:54px;filter:drop-shadow(0 2px 4px #0008);--pinfill:#87919e;--pintext:#fff}
.shape-chip{display:grid;place-items:center;width:42px;height:42px;flex:none;--pinfill:#87919e;--pintext:#fff}
.map-pin-v4 svg{width:52px;height:52px}.shape-chip svg{width:42px;height:42px}
.map-pin-v4 .pin-shape,.shape-chip .pin-shape{fill:var(--pinfill)}
.map-pin-v4 .pin-number,.shape-chip .pin-number{fill:var(--pintext);font-size:16px;font-weight:950;paint-order:stroke;stroke:#203f4530;stroke-width:.8px;letter-spacing:-.5px}
.map-pin-v4.state-gray,.shape-chip.state-gray{--pinfill:#87919e}.map-pin-v4.state-absent,.shape-chip.state-absent{--pinfill:#eeb444;--pintext:#513a06}
.map-pin-v4.state-first,.shape-chip.state-first{--pinfill:#81cba3;--pintext:#144a32}.map-pin-v4.state-complete,.shape-chip.state-complete{--pinfill:#148d53}
.map-pin-v4.state-reject,.shape-chip.state-reject{--pinfill:#d7464e}.map-pin-v4.state-appointment,.shape-chip.state-appointment{--pinfill:#4976ba}
.map-pin-v4.selected svg{filter:drop-shadow(0 0 3px #2167f6)}.map-pin-v4.selected{outline:3px dashed #2c74ea;border-radius:50%;outline-offset:1px}
.map-pin-v4 .corner{position:absolute;bottom:-8px;right:-6px;background:#162f4b;color:#fff;border:1px solid white;border-radius:6px;font-size:9px;line-height:1.4;padding:1px 4px;font-weight:800}
.survey-alert{display:flex;align-items:center;gap:9px;min-width:0;background:#e9f2ff;border:1px solid #b9d3f8;padding:10px;border-radius:11px;margin-top:12px}
.survey-alert-icon{width:35px;height:35px;border-radius:10px;background:white;display:grid;place-items:center;color:#285ab0;font-size:20px;flex:none}
.survey-alert>div{flex:1;min-width:0}.survey-alert small{font-size:9px;color:#5d7c9e;display:block;font-weight:800;letter-spacing:.04em}.survey-alert strong{display:block;font-size:14px;color:#1e4b81}
.survey-open{flex:none;text-decoration:none;background:#1b65d1;color:white;padding:10px 9px;border-radius:9px;font-weight:850;font-size:11px;text-align:center;max-width:44%}
.survey-open:hover{background:#1555ad}.contact-head .shape-chip{width:48px;height:48px}.contact-head .shape-chip svg{width:48px;height:48px}
@media(max-width:780px){.type-tabs{margin-top:6px}.type-tab{font-size:12px;padding:7px 11px}.location-strip{margin-top:2px}.loc-button{font-size:11px;min-height:38px}.loc-text{font-size:11px}.survey-open{font-size:11px;padding:10px}.nearby-row{font-size:11px}.map-pin-v4{width:48px;height:48px}.map-pin-v4 svg{width:48px;height:48px}}
@media(max-width:390px){.survey-alert{gap:5px;padding:7px}.survey-alert-icon{display:none}.survey-open{font-size:10px}.nearby-row label{font-size:10px}.position-badge{font-size:9px}}

/* V5 - mapas compactos, capas y agenda */
[hidden]{display:none!important}
.map-pin-v4{width:40px;height:40px;filter:drop-shadow(0 1px 2px #203f5777)}
.map-pin-v4 svg{width:33px;height:33px}
.map-pin-v4 .corner{font-size:8px;bottom:-5px;right:-1px;padding:0px 3px}
.map-pin-v4 .appt-dot{position:absolute;right:-2px;top:-2px;display:grid;place-items:center;width:15px;height:15px;border-radius:50%;background:#2264b3;border:1.5px solid white;color:white;font-size:12px;font-weight:900;line-height:1}
.map-pin-v4.selected{outline:2px dashed #2565c8;outline-offset:0}
.map-pin-v4 .pin-number{font-size:19px;stroke-width:.4px}
.shape-chip{width:34px;height:34px}.shape-chip svg{width:33px;height:33px}
.contact-head .shape-chip,.contact-head .shape-chip svg{width:39px;height:39px}
.layer-and-staff{display:flex;align-items:end;gap:8px;margin:9px 0 4px}
.type-layers{flex:1;position:relative;min-width:0}.type-layers summary{min-height:39px;display:flex;align-items:center;justify-content:space-between}
.type-layers summary span{background:#e8eff7;border-radius:12px;padding:1px 6px;font-size:10px;margin-left:8px}
.type-layers .layer-options{left:0;right:auto;min-width:230px;top:41px}
.type-symbol{width:25px;text-align:center;font-size:19px;color:#52677a}
.staff-filter{flex:1;min-width:0}.staff-filter select{min-height:39px;padding:6px 8px;font-size:11px}
.location-controls{display:flex;align-items:center;justify-content:flex-end;gap:7px;margin-top:5px}
.appt-top{background:#eff5ff;color:#245589}.appt-top span{display:inline-block;padding:1px 5px;background:#dce9fb;border-radius:9px}
.panel-tabs{position:sticky;top:0;z-index:20;display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:6px 0 11px;background:#fff;border-bottom:1px solid #e1e9f2;margin-bottom:12px}
.panel-tab{background:#f2f6fb;color:#49617a;border:1px solid #dce5ef;border-radius:9px;font-weight:800;padding:9px 7px;font-size:12px;min-height:42px}
.panel-tab.active{background:#205caa;color:#fff;border-color:#205caa}
.panel-tab span{font-size:10px;background:#dceafb;padding:2px 6px;border-radius:15px;color:#174879}
.appointments-intro strong{font-size:17px}.appointments-intro p{font-size:12px;color:#718297;margin:5px 0 14px}
.agenda-heading{font-size:12px;font-weight:850;color:#415b77;margin:15px 0 8px;border-bottom:1px solid #e2ebf2;padding-bottom:6px}
.appointments-list{display:flex;flex-direction:column;gap:9px}
.appointment-card{width:100%;border:1px solid #c6d9ef;border-left:4px solid #4976ba;border-radius:10px;padding:12px;text-align:left;background:#f6faff;color:#28415d;display:flex;flex-direction:column;gap:5px}
.appointment-card.overdue{border-left-color:#d09d2c;background:#fffaf0}
.appointment-card strong{font-size:13px}.appointment-card small{color:#667a8f;font-size:11px}.appointment-date{font-weight:850;color:#1c60a4;font-size:13px}.appt-person{font-size:11px;color:#2f567d}
.appt-current{margin-top:11px;padding:10px;background:#e8f1ff;border:1px solid #b9d3ef;border-radius:11px;display:flex;flex-direction:column;gap:4px}
.appt-current span{font-size:10px;letter-spacing:.04em;color:#3f658f;font-weight:850}.appt-current strong{font-size:15px;color:#18599c}.appt-current small{font-size:11px;color:#54738f}
.appointment-actions{display:flex;gap:7px;margin-top:8px;flex-wrap:wrap}.appointment-button{background:#ecf3ff;color:#215991;border-color:#bad1eb;min-height:39px}
.appointment-editor{margin-top:10px;padding:12px;background:#fff;border:1px solid #b6cbea;border-radius:11px;box-shadow:0 2px 9px #263d581a}
.appointment-editor strong{color:#215991;display:block;margin-bottom:9px}
.appointment-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:7px}
.appointment-editor label{display:flex;flex-direction:column;gap:5px;font-size:11px;font-weight:750;color:#4f6984}
.appointment-editor input{min-height:42px;border:1px solid #cddaea;border-radius:8px;background:#fff;padding:7px;width:100%;min-width:0;color:#263d55}
.appointment-event{border-left-color:#4976ba}
@media(max-width:780px){
 .map-pin-v4,.map-pin-v4 svg{width:40px;height:40px}.map-pin-v4 svg{width:32px;height:32px}
 .layer-and-staff{margin:6px 0 2px}.type-layers .layer-options{max-width:90vw}
 .location-controls{margin-top:5px}.panel-tabs{position:sticky;top:0;margin-top:-1px;padding-top:7px}
 .panel-tab{min-height:46px;font-size:12px}.mapbox{height:51dvh;min-height:310px}
 .map-tip{max-width:190px;font-size:10px}.appointment-card{min-height:80px}
 .appt-top{min-height:38px}
}
@media(max-width:375px){.staff-filter{flex:0.85}.layer-and-staff{gap:5px}.type-layers summary{padding:7px;font-size:10px}.appointment-fields{grid-template-columns:1fr 1fr}}

@media(max-width:780px){body.modo-movil .mapbox{height:54dvh;min-height:330px}body.modo-movil .panel-tab{min-height:50px}body.modo-movil .panel-tabs{box-shadow:0 3px 9px #0001}}


/* V7 · Navegación territorial · contador de grupos por municipio */
.municipality-view{position:absolute;z-index:600;left:12px;top:66px;background:#fff;color:#184b7d;border:1px solid #abc9e5;border-radius:10px;padding:9px 11px;box-shadow:0 2px 12px #0c335025;font-size:12px;font-weight:850;min-height:39px}
.municipality-view.active{background:#e5f1ff;color:#124f89;border-color:#76aee3}
.municipal-marker{border:0!important;background:transparent!important}
.municipality-marker{display:flex;align-items:center;flex-direction:column;justify-content:center;min-height:68px;min-width:112px;max-width:112px;cursor:pointer;filter:drop-shadow(0 3px 5px #0b253b55);transition:transform .16s}
.municipality-marker:hover{transform:scale(1.07)}
.municipality-count{width:37px;height:37px;background:#205eac;border:3px solid #fff;border-radius:50%;color:#fff;display:grid;place-items:center;font-size:16px;font-weight:950;line-height:1;box-shadow:0 0 0 1px #1b549e55}
.municipality-current .municipality-count{background:#154670;box-shadow:0 0 0 3px #ffcc62,0 1px 7px #0006}
.municipality-name{max-width:112px;background:#fff;color:#173958;font-size:10px;line-height:1.12;font-weight:900;border-radius:7px;padding:3px 6px;text-align:center;margin-top:2px;white-space:normal;word-break:normal}
.municipality-caption{font-size:9px;color:#56738e;background:#ffffffee;border-radius:6px;padding:0 5px;font-weight:800}
@media(max-width:780px){.municipality-view{top:53px;left:9px;font-size:11px;padding:7px 9px;min-height:35px}.municipality-marker{min-height:62px}.municipality-name{font-size:9px}}

/* V8: estados ampliados, agenda y resumen de grupos por municipio */
.map-pin-v4 .absent-number{position:absolute;top:-5px;left:-4px;min-width:16px;height:16px;padding:1px 3px;border-radius:9px;background:#e2a72e;border:1.6px solid #fff;color:#483509;font-size:10px;font-weight:950;line-height:12px;display:grid;place-items:center;box-shadow:0 1px 4px #283a4b44}
.map-pin-v4.state-second-absent,.shape-chip.state-second-absent{--pinfill:#81cba3;--pintext:#124e36}
.map-pin-v4.state-second-absent .pin-shape,.shape-chip.state-second-absent .pin-shape{stroke:#ee9419;stroke-width:5px}
.map-pin-v4 .second-absent-dot{position:absolute;left:-3px;top:-4px;width:16px;height:16px;border-radius:50%;background:#ef9219;border:1px solid white;display:grid;place-items:center;color:white;font-weight:950;font-size:11px}
.stat-review{color:#b15d17;font-weight:850}
.municipal-marker{width:152px!important;height:92px!important}
.municipality-marker.v8{min-width:152px;max-width:152px;min-height:92px;gap:1px}
.municipality-marker.v8 .municipality-name{max-width:144px;font-size:11px}
.municipality-breakdown{display:flex;gap:3px;align-items:center;padding:3px 5px;border-radius:7px;background:#ffffffef;box-shadow:0 1px 4px #30405936}
.municipality-breakdown b{font-size:9px;min-width:34px;text-align:center;color:#606f7e;background:#e7ecf2;border-radius:4px;padding:1px 3px}
.municipality-breakdown b:nth-child(2){background:#cbf1dc;color:#24654c}
.municipality-breakdown b:nth-child(3){background:#14794c;color:white}
.municipality-breakdown .review-number{background:#fff0d7;color:#a44f0b;border:1px solid #ebc081}
.appointment-card.fulfilled{background:#f6f8fa;border-color:#e2e7eb;border-left-color:#b6c2cc;color:#83909c;opacity:.74}
.appointment-card.fulfilled strong,.appointment-card.fulfilled .appointment-date{color:#81909b}
.appointment-finished{font-size:11px;font-weight:750;color:#6f8b7e}
.pool-actions{border:1px solid #edba77;background:#fff8ec;padding:12px;border-radius:11px;margin:10px 0;display:flex;flex-wrap:wrap;gap:8px}
.pool-actions strong{flex-basis:100%;color:#905314;font-size:13px}
.pool-actions p{flex-basis:100%;color:#805a34;font-size:11px;margin:0}
.pool-actions button{background:white;color:#9a591b;border-color:#e3be87;min-height:37px}
.decision-overlay{position:fixed;inset:0;background:#081b31a3;display:flex;align-items:center;justify-content:center;padding:20px;z-index:99999}
.decision-card{background:white;color:#253f59;border-radius:15px;padding:22px;box-shadow:0 18px 45px #08162966;width:100%;max-width:410px}
.decision-card h2{font-size:21px;margin:0 0 8px;color:#1d4168}
.decision-card p{font-size:14px;line-height:1.5;margin:0 0 19px}
.decision-actions{display:flex;flex-direction:column;gap:9px}
.decision-actions .button{min-height:44px;text-align:center}
.button.danger-quiet{background:#fff0f0;border-color:#e9b4b4;color:#a42731}
@media(max-width:780px){.municipality-marker.v8{min-height:85px}.municipality-breakdown b{font-size:9px}.decision-card{padding:18px}.stats{flex-wrap:wrap}.stat-review{font-size:11px}}
