/* Inteligencia territorial (V360-HTML-05A). Scoped to the route; shared cards, status pills and buttons come from base. */

.gis-head-action{display:grid;gap:6px;justify-items:end;}
.gis-note{margin:0;color:var(--muted);font:400 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;}
.gis-top{display:grid;grid-template-columns:308.3294px minmax(0,1fr) 363.6706px;gap:16px;align-items:stretch;}
.gis-top>.card{box-sizing:border-box;min-height:760px;padding:14px 16px;display:flex;flex-direction:column;gap:12px;overflow:hidden;}
/* A 1 px border plus 9 px padding leaves the full middle column available to the map. */
.gis-top>.gis-map-card{position:relative;padding:9px;gap:0;}
#gis-view{padding-top:6px;}

/* Affiliation chart: donut 116 px in the card, legend, totals and the two notes. */
.gis-chart-body{display:grid;grid-template-columns:116px minmax(0,1fr);gap:20px;align-items:center;position:relative;}
.gis-donut{display:block;width:116px;height:116px;}
.gis-donut__centre{position:absolute;left:0;top:0;width:116px;height:116px;display:grid;place-content:center;justify-items:center;pointer-events:none;}
.gis-donut__centre strong{font:600 22px/26px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);}
.gis-donut__centre small{font:400 12px/16px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--muted);}
.gis-chart-legend{list-style:none;margin:0;padding:0;display:grid;gap:8px;}
.gis-chart-legend li{display:grid;grid-template-columns:10px minmax(0,1fr) auto;gap:8px;align-items:center;font:400 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);}
.gis-chart-legend strong{font-weight:600;font-variant-numeric:tabular-nums;}
.gis-chart-totals{margin:0;font:400 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);}
.gis-dot{display:inline-block;width:10px;height:10px;border-radius:50%;flex:none;}
.gis-ring{display:inline-block;width:14px;height:14px;border:2px solid #00a3c4;border-radius:50%;flex:none;}

/* Fluid map with the source 652:480 aspect ratio. Camera, basemap, zones and markers share its geometry. */
.gis-map-head{height:30px;display:flex;align-items:center;}
.gis-scope{font-weight:500;}
.gis-viewport{position:relative;width:100%;aspect-ratio:652 / 480;flex-shrink:0;overflow:hidden;border-radius:8px;background:#f3f6fb;}
/* Crop the source image's empty edge margins uniformly; all geographic layers
 * share this base framing independently of the interactive 100/125/150% zoom. */
.gis-camera{position:absolute;inset:0;transform-origin:50% 50%;scale:1.1;}
.gis-basemap{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:80% 55%;display:block;}
.gis-zones{position:absolute;inset:0;pointer-events:none;}
.gis-zone{position:absolute;border-radius:10px;opacity:.22;}
.gis-zone--worked{background:#176b46;}
.gis-zone--pending{background:#855500;}
.gis-markers{position:absolute;inset:0;}
.gis-marker{position:absolute;width:44px;height:44px;transform:translate(-50%,-50%);margin:0;padding:0;border:0;background:transparent;cursor:pointer;}
.gis-marker__symbol{position:absolute;left:13px;top:13px;width:18px;height:18px;box-sizing:border-box;border:3px solid var(--gis-use);background:var(--gis-affiliation);border-radius:3px;}
.gis-marker--early::before{content:"";position:absolute;left:2px;top:2px;width:40px;height:40px;box-sizing:border-box;border:2px solid #00a3c4;border-radius:50%;}
.gis-marker__count{position:absolute;left:24px;top:0;min-width:18px;height:16px;padding:0 4px;box-sizing:border-box;border-radius:999px;background:#182236;color:#fff;font:600 11px/16px Inter,ui-sans-serif,system-ui,sans-serif;text-align:center;}
.gis-marker--selected .gis-marker__symbol{outline:2px solid #ffbf47;outline-offset:2px;}
.gis-zoom{position:absolute;top:8px;right:8px;z-index:5;display:flex;align-items:center;gap:4px;padding:4px;background:#fff;border:1px solid var(--line);border-radius:8px;}
.gis-zoom button{min-width:44px;min-height:44px;margin:0;padding:0 8px;background:#fff;border:1px solid var(--line);border-radius:6px;color:var(--navy-950);font:600 16px/20px Inter,ui-sans-serif,system-ui,sans-serif;cursor:pointer;}
.gis-zoom button:disabled{opacity:.45;cursor:not-allowed;}
.gis-zoom output{min-width:52px;text-align:center;font:600 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;}
.gis-tooltip{position:absolute;z-index:20;box-sizing:border-box;width:240px;padding:10px 12px;display:grid;gap:4px;background:#182236;color:#fff;border-radius:8px;font:400 12px/16px Inter,ui-sans-serif,system-ui,sans-serif;pointer-events:none;}
.gis-tooltip strong{font-weight:600;}
.gis-legend{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;font:400 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);}
.gis-legend strong{font-weight:600;}
.gis-legend ul{display:flex;flex-wrap:wrap;gap:8px 14px;list-style:none;margin:0;padding:0;}
.gis-legend li{display:flex;align-items:center;gap:6px;}
.gis-legend small{color:var(--muted);}

/* Detail card. */
.gis-detail-list{display:grid;gap:8px;margin:0;}
.gis-detail-list>div{display:grid;grid-template-columns:132px minmax(0,1fr);gap:12px;}
.gis-detail-list dt{font:600 12px/16px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--muted);text-transform:uppercase;}
.gis-detail-list dd{margin:0;font:400 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);overflow-wrap:anywhere;}
.gis-status{align-self:flex-start;}
.gis-deferred{display:grid;gap:6px;}
.gis-deferred .button{width:100%;min-height:48px;}
.gis-validate:not(:disabled){color:#c91f3d;border-color:#c91f3d;}
.gis-snackbar{position:fixed;right:24px;bottom:24px;z-index:100;max-width:min(420px,calc(100vw - 48px));padding:14px 18px;border-radius:11px;box-shadow:var(--shadow);background:var(--navy-950);color:#fff;font:600 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;}
.gis-snackbar[hidden]{display:none;}
@media (min-width:1181px){
  /* The GIS return label is longer than the original 112px Volver slot. Preserve the shared 16px text insets. */
  .main-content:has(.profile-grid):has([data-origin="gis"]) .page-actions{grid-template-columns:160px 214px;max-width:386px;}
}
.gis-pill--danger{color:#9d2433;background:#fdecef;}
.gis-pill--muted{color:#596579;background:#eef1f6;}

/* Filter band: five labelled controls in source order, custom groups open one at a time. */
.gis-filters{margin-top:16px;padding:12px 16px;display:flex;flex-direction:column;gap:12px;}
.gis-filters>.card__head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:12px;padding:0;}
.gis-filters>.card__head p{margin:2px 0 0;}
.gis-filter-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;}
.gis-filter-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:end;}
.gis-filter-clear{align-self:end;width:100%;height:48px;}
.gis-filter{position:relative;display:grid;gap:5px;min-width:0;}
.gis-filter__label,.gis-filter>label{font:500 14px/18px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);}
.gis-filter select{width:100%;height:48px;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:#fff;font:400 16px/24px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);}
.gis-trigger{width:100%;height:48px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 12px;margin:0;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);font:400 16px/24px Inter,ui-sans-serif,system-ui,sans-serif;text-align:left;cursor:pointer;}
.gis-menu{position:absolute;z-index:30;top:calc(100% + 8px);left:0;width:max(100%,240px);max-height:360px;overflow:auto;box-sizing:border-box;padding:10px;display:grid;gap:8px;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow);}
.gis-menu--up{top:auto;bottom:calc(100% + 8px);}
.gis-menu[hidden]{display:none;}
.gis-check{display:flex;align-items:center;gap:8px;min-height:44px;font:400 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);cursor:pointer;}
.gis-check input{width:18px;height:18px;margin:0;flex:none;}
.gis-filter-message{margin:0;min-height:0;color:var(--danger);font:500 13px/18px Inter,ui-sans-serif,system-ui,sans-serif;}
.gis-filter-message:empty{display:none;}

/* Household table: 1376 px card, 8 columns from the source widths (154/195/160/82/86/305/160/234). */
.gis-ledger{margin-top:16px;}
.gis-ledger__head{height:80px;padding:14px 16px 0;box-sizing:border-box;border-bottom:0;}
.gis-ledger__head h2{margin:0;font:600 18px/26px Inter,ui-sans-serif,system-ui,sans-serif;}
.gis-table{width:100%;table-layout:fixed;}
.gis-table th,.gis-table td{height:44px;padding:0 6px;vertical-align:middle;text-align:left;overflow-wrap:anywhere;}
.gis-table thead th{white-space:nowrap;}
.gis-table thead th{font:600 11px/16px Inter,ui-sans-serif,system-ui,sans-serif;text-transform:uppercase;color:var(--muted);background:var(--surface-subtle);}
.gis-table td{font:400 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;}
.gis-table tbody tr:nth-child(even){background:var(--surface-subtle);}
.gis-table tbody tr.gis-row--selected td{background:#eaf0fb;}
.gis-table th:nth-child(1),.gis-table td:nth-child(1){width:11.19%;}
.gis-table th:nth-child(2),.gis-table td:nth-child(2){width:14.17%;}
.gis-table th:nth-child(3),.gis-table td:nth-child(3){width:11.63%;}
.gis-table th:nth-child(4),.gis-table td:nth-child(4){width:7.56%;}
.gis-table th:nth-child(5),.gis-table td:nth-child(5){width:6.25%;}
.gis-table th:nth-child(6),.gis-table td:nth-child(6){width:20.57%;}
.gis-table th:nth-child(7),.gis-table td:nth-child(7){width:11.63%;}
.gis-table th:nth-child(8),.gis-table td:nth-child(8){width:17.01%;}
.gis-table .text-button{min-height:44px;font-weight:600;}
.gis-ledger__note{padding:12px 16px 16px;}
.gis-empty-cell{text-align:left !important;padding:24px 16px !important;}

/* Below the three-column desktop threshold, retain the existing wrapped panels and natural card heights.
 * Filter controls use their own responsive rules; the map always fills whichever column it receives. */
@media (min-width:1181px) and (max-width:1727px){
  .gis-top{grid-template-columns:minmax(0,1fr) minmax(0,1fr);}
  .gis-top>.card{min-height:0;}
  .gis-top>.gis-map-card{grid-column:1 / -1;}
  .gis-filter-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
  .gis-filter-grid .gis-filter:nth-child(4),.gis-filter-grid .gis-filter:nth-child(5){grid-column:auto;}
}

/* Narrow widths: panels stack, the map keeps its aspect ratio and the filters wrap. */
@media (max-width:1180px){
  .gis-top{grid-template-columns:minmax(0,1fr);}
  .gis-top>.card{min-height:0;}
  .gis-viewport{width:100%;}
  .gis-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .gis-filter-grid .gis-filter:nth-child(4),.gis-filter-grid .gis-filter:nth-child(5){grid-column:span 2;}
  .gis-filter-clear{grid-column:1 / -1;}
}
@media (max-width:720px){
  .gis-filter-grid{grid-template-columns:minmax(0,1fr);}
  .gis-filter-grid .gis-filter:nth-child(4),.gis-filter-grid .gis-filter:nth-child(5){grid-column:auto;}
  .gis-chart-body{grid-template-columns:116px minmax(0,1fr);}
  .gis-detail-list>div{grid-template-columns:minmax(0,1fr);gap:2px;}
}
@media (max-width:860px){
  .gis-table{table-layout:auto;}
  /* Card rows need full-width, natural-height cells; desktop percentages can cover the location action. */
  .gis-table td:nth-child(n){width:100%;height:auto;min-height:44px;padding:6px 0;}
}

/* Owner adjustment: keep the reset action beside the five fields wherever the desktop row fits. */
@media(min-width:1280px){
  .gis-filter-grid{grid-template-columns:minmax(150px,1.1fr) minmax(90px,.6fr) minmax(90px,.6fr) minmax(170px,1.3fr) minmax(165px,1.2fr) auto;gap:10px;}
}

/* V360-EXT-UI-GIS-01 (Owner-authorized GIS overview override, documents 50 and 51; scope amendment, manifest55). Appended after the original
 * 11,748-byte prefix, which stays an exact prefix. Scope: .gis-top and its cards, the GIS main-content gutter, the chart, the donut centre,
 * the detail list, the deferred actions, and the map head, where the zoom group now sits in normal flow above the geographic viewport.
 * Marker, camera, tooltip, filter and shared shell rules are not changed here. */

/* Three ordered columns at 1024 px and above: affiliation/chart, the map (the widest column), and the property/elector detail. */
@media(min-width:1024px){
  .gis-top{grid-template-columns:clamp(164px,18%,308px) minmax(0,1fr) clamp(216px,24%,364px);align-items:stretch;}
  .gis-top>.card{min-height:0;min-width:0;}
  .gis-top>.gis-map-card{grid-column:auto;}
}

/* 1024-1179 px: 8 px GIS gutters and column gaps, the narrowest desktop columns. */
@media(min-width:1024px) and (max-width:1179px){
  .main-content:has(#gis-view){padding-left:8px;padding-right:8px;}
  .gis-top{gap:8px;}
}

/* 1180-1279 px: the accepted 40 px shell gutter is kept (a 16 px gutter let a nowrap ledger status pill pass the ledger edge at 1181 px).
 * The columns get 12 px gaps. */
@media(min-width:1180px) and (max-width:1279px){
  .gis-top{gap:12px;}
}

/* Below 1920 px the donut sits above a full-width legend, and its centre text is centred on the donut in both axes. */
@media(min-width:1024px) and (max-width:1919px){
  .gis-chart-body{grid-template-columns:minmax(0,1fr);gap:12px;justify-items:center;}
  .gis-donut__centre{left:50%;transform:translateX(-50%);}
  .gis-chart-legend{width:100%;}
}

/* At 1920 px and above the donut and legend sit side by side; the centre follows the donut's vertical centre. */
@media(min-width:1920px){
  .gis-chart-body{gap:12px;}
  .gis-donut__centre{top:50%;transform:translateY(-50%);}
}

/* Below 1536 px the detail values stack under their labels, and the deferred action wraps instead of clipping. */
@media(min-width:1024px) and (max-width:1535px){
  .gis-detail-list>div{grid-template-columns:minmax(0,1fr);gap:2px;}
  .gis-deferred .button{white-space:normal;padding-left:8px;padding-right:8px;}
}

/* Map head: the scope chip and the existing zoom group share one normal-flow row above the map, inside the same card. The row wraps at
 * narrow widths. The zoom controls keep their 44 px targets and their order; they no longer overlay the geographic viewport. */
.gis-map-head{height:auto;min-height:30px;flex-wrap:wrap;justify-content:space-between;gap:8px;margin-bottom:8px;}
.gis-map-head>.gis-zoom{position:static;flex-direction:row;gap:4px;padding:4px;flex-shrink:0;max-width:100%;}
