:root{
  --app-bg:#f4f6f8;
  --surface:#ffffff;
  --surface-2:#f8fafc;
  --ink:#111827;
  --muted:#667085;
  --line:#e4e7ec;
  --line-strong:#d0d5dd;
  --accent:#18b8f2;
  --accent-soft:#e8f8fe;
  --danger:#dc2626;
  --warning:#d97706;
  --success:#16a34a;
  --header-h:84px;
  --nav-h:76px;
  --radius:18px;
  --shadow:0 14px 38px rgba(15,23,42,.10);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  color:#111827;
  background:#f4f6f8;
}
*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden;background:var(--app-bg);color:var(--ink)}
body{-webkit-tap-highlight-color:transparent;overscroll-behavior:none}
button,input,textarea,select{font:inherit}
button,a{-webkit-tap-highlight-color:transparent}
button{touch-action:manipulation}

/* Login / instalación */
.auth-screen,.install-screen{min-height:100dvh;display:grid;place-items:center;padding:28px 20px calc(28px + env(safe-area-inset-bottom));background:radial-gradient(circle at 50% -10%,#15304b 0,#08111f 58%,#050a12 100%)}
.auth-card,.install-card{width:min(420px,100%);display:grid;justify-items:center;text-align:center;gap:14px;padding:28px 24px;border:1px solid rgba(255,255,255,.10);border-radius:26px;background:rgba(13,27,46,.94);box-shadow:0 28px 80px rgba(0,0,0,.34);color:#fff}
.auth-logo,.install-logo{width:82px;height:82px;object-fit:cover;border-radius:22px;box-shadow:0 12px 32px rgba(0,0,0,.28)}
.auth-kicker,.install-kicker{margin:2px 0 0;color:#7ddcff;font-size:11px;font-weight:900;letter-spacing:.12em}
.auth-card h1,.install-card h1{margin:0;font-size:32px;line-height:1;letter-spacing:-.035em}
.auth-card p,.install-copy{margin:0;max-width:320px;color:#b7c6d8;line-height:1.52;font-size:15px}
.google-button{margin-top:8px;min-height:44px}
.auth-error{color:#fecaca!important;font-weight:700}
.auth-action,.auth-secondary,.install-primary,.install-secondary{width:100%;min-height:52px;border-radius:14px;display:flex;align-items:center;justify-content:center;gap:9px;text-decoration:none;font-weight:850}
.auth-action,.install-primary{border:0;background:#18b8f2;color:#04121b;box-shadow:0 12px 26px rgba(24,184,242,.22)}
.auth-secondary,.install-secondary{border:1px solid rgba(255,255,255,.16);background:transparent;color:#e8f7ff}
.install-help{width:100%;margin-top:4px;padding:14px 15px;border-radius:14px;background:rgba(255,255,255,.06);text-align:left;display:grid;gap:4px;color:#9fb0c7;font-size:13px;line-height:1.35}
.install-help strong{color:#fff}.install-help.is-emphasis{outline:2px solid #18b8f2;background:rgba(24,184,242,.10)}

/* Shell de aplicación */
.gsl-app{height:100dvh;display:grid;grid-template-rows:calc(var(--header-h) + env(safe-area-inset-top)) minmax(0,1fr) calc(var(--nav-h) + env(safe-area-inset-bottom));background:var(--app-bg);overflow:hidden}
.app-header{padding:env(safe-area-inset-top) 18px 0;height:calc(var(--header-h) + env(safe-area-inset-top));display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--surface);border-bottom:1px solid var(--line);z-index:20}
.app-brand{display:flex;align-items:center;gap:12px;min-width:0}
.app-brand img{width:48px;height:48px;border-radius:13px;object-fit:cover;box-shadow:0 5px 16px rgba(15,23,42,.14);flex:0 0 auto}
.app-brand div{min-width:0;display:grid;gap:3px}
.app-brand strong{font-size:22px;letter-spacing:-.03em;line-height:1.05;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.app-brand span{font-size:12px;font-weight:750;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.icon-button{width:48px;height:48px;display:grid;place-items:center;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);padding:0;flex:0 0 auto}
.icon-button:active{transform:scale(.96);background:var(--surface-2)}
.icon{width:22px;height:22px;display:inline-grid;place-items:center;color:currentColor}
.icon svg{width:100%;height:100%;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

.app-stage{position:relative;min-height:0;overflow:hidden;padding:16px 16px 12px}
.screen{position:absolute;inset:0;padding:16px;display:grid;grid-template-rows:auto minmax(0,1fr);gap:14px;overflow:hidden;background:var(--app-bg)}
.screen.screen-flat{grid-template-rows:minmax(0,1fr)}
.screen-head{display:flex;align-items:end;justify-content:space-between;gap:12px;min-height:52px}
.screen-head>div{min-width:0}.screen-head h1{margin:0;font-size:27px;line-height:1;letter-spacing:-.045em}.screen-head p{margin:6px 0 0;color:var(--muted);font-size:13px;font-weight:600}.screen-head .head-action{min-height:42px;padding:0 13px;border:1px solid var(--line);border-radius:12px;background:var(--surface);font-weight:800;color:var(--ink)}

.app-nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:stretch;padding:8px 8px calc(8px + env(safe-area-inset-bottom));background:rgba(255,255,255,.98);border-top:1px solid var(--line);z-index:30}
.nav-item{border:0;background:transparent;border-radius:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:#667085;font-size:10px;font-weight:800;min-width:0;min-height:58px;padding:5px 2px}
.nav-item .icon{width:23px;height:23px}.nav-item span:last-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.nav-item.is-active{color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,#fff)}
.nav-item:active{transform:scale(.96)}

/* Inicio */
.home-layout{height:100%;display:grid;grid-template-rows:auto auto minmax(0,1fr);gap:13px;min-height:0}
.today-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.metric-button{min-width:0;border:1px solid var(--line);border-radius:16px;background:var(--surface);padding:11px 8px;text-align:left;display:grid;gap:3px;box-shadow:0 4px 12px rgba(15,23,42,.035)}
.metric-button strong{font-size:25px;line-height:1;font-weight:900;letter-spacing:-.04em;color:var(--ink)}
.metric-button span{font-size:10px;line-height:1.15;color:var(--muted);font-weight:800;overflow-wrap:anywhere}
.metric-button.is-alert strong{color:var(--danger)}
.home-bottom{display:grid;grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr);gap:10px;min-height:0}
.section-label{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:11px;font-weight:900;letter-spacing:.085em;color:#475467;text-transform:uppercase}
.section-label button{border:0;background:none;color:var(--accent);font-weight:900;font-size:11px;text-transform:none;letter-spacing:0;padding:4px}
.priority-stack{display:grid;grid-template-rows:repeat(3,minmax(0,1fr));gap:8px;min-height:0}
.priority-card{border:1px solid var(--line);border-radius:16px;background:var(--surface);display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px 12px;min-height:0;text-align:left}
.priority-card .lead-icon{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent)}
.priority-card.is-danger .lead-icon{background:#fef2f2;color:var(--danger)}
.priority-card.is-warning .lead-icon{background:#fff7ed;color:var(--warning)}
.priority-card .copy{min-width:0;display:grid;gap:2px}.priority-card .copy strong{font-size:14px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.priority-card .copy span{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.priority-card .value{font-size:18px;font-weight:900;letter-spacing:-.03em}

/* Hubs y listas */
.hub-grid{height:100%;display:grid;grid-template-rows:repeat(3,minmax(0,1fr));gap:11px;min-height:0}
.hub-card{border:1px solid var(--line);border-radius:18px;background:var(--surface);padding:16px;display:grid;grid-template-columns:52px minmax(0,1fr) auto;align-items:center;gap:14px;text-align:left;box-shadow:0 5px 18px rgba(15,23,42,.04)}
.hub-icon{width:52px;height:52px;border-radius:15px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center}.hub-icon .icon{width:27px;height:27px}
.hub-copy{min-width:0;display:grid;gap:5px}.hub-copy strong{font-size:18px;letter-spacing:-.025em}.hub-copy span{font-size:12px;color:var(--muted);line-height:1.3}.hub-chevron{color:#98a2b3}

.tool-screen{height:100%;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;gap:10px;min-height:0}
.segmented{display:grid;grid-template-columns:repeat(var(--segments,3),minmax(0,1fr));gap:4px;padding:4px;border-radius:15px;background:#e9edf2;border:1px solid #dde2e8}
.segmented button{min-height:43px;border:0;border-radius:11px;background:transparent;color:#667085;font-weight:850;font-size:13px;padding:0 7px}
.segmented button.is-active{background:var(--surface);color:var(--ink);box-shadow:0 2px 7px rgba(15,23,42,.10)}
.date-strip{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:8px}.date-strip button{height:44px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--accent);font-weight:900;font-size:19px}.date-strip strong{height:44px;border:1px solid var(--line);border-radius:12px;background:var(--surface);display:grid;place-items:center;font-size:13px;text-transform:capitalize}
.paged-list{min-height:0;display:grid;grid-template-rows:repeat(3,minmax(0,1fr));gap:8px;overflow:hidden}
.list-card{min-height:0;border:1px solid var(--line);border-radius:16px;background:var(--surface);padding:11px 12px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;text-align:left}
.list-card.is-empty{grid-column:1/-1;display:grid;place-items:center;text-align:center;color:var(--muted);font-size:13px;padding:18px}
.list-main{min-width:0;display:grid;gap:3px}.list-top{display:flex;align-items:center;gap:7px;min-width:0}.list-time{font-size:12px;font-weight:900;color:var(--accent);white-space:nowrap}.list-name{font-size:15px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.list-sub{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.list-meta{display:flex;align-items:center;gap:6px;min-width:0}.chip{display:inline-flex;align-items:center;max-width:100%;height:24px;padding:0 8px;border-radius:999px;background:#f2f4f7;color:#475467;font-size:10px;font-weight:850;white-space:nowrap}.chip.risk-alto{background:#fef2f2;color:#b91c1c}.chip.risk-moderado{background:#fff7ed;color:#b45309}.chip.risk-bajo{background:#f0fdf4;color:#15803d}.chip.overdue{background:#fef2f2;color:#b91c1c}.list-side{display:grid;place-items:center;color:#98a2b3}.list-side .icon{width:18px;height:18px}
.pager{display:grid;grid-template-columns:52px minmax(0,1fr) 52px;gap:8px;align-items:center}.pager button{height:44px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);display:grid;place-items:center}.pager button:disabled{opacity:.35}.pager span{text-align:center;color:var(--muted);font-size:11px;font-weight:800}

/* Casos */
.cases-screen{height:100%;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;gap:10px;min-height:0}
.search-box{height:50px;border:1px solid var(--line);border-radius:15px;background:var(--surface);display:grid;grid-template-columns:24px minmax(0,1fr) 42px;align-items:center;gap:8px;padding:0 8px 0 14px;box-shadow:0 3px 12px rgba(15,23,42,.04)}
.search-box>.icon{color:#98a2b3}.search-box input{height:100%;border:0;outline:0;background:transparent;color:var(--ink);min-width:0;font-size:15px}.search-box button{width:40px;height:40px;border:0;border-radius:11px;background:var(--accent);color:#fff;display:grid;place-items:center}
.search-hint{font-size:11px;color:var(--muted);font-weight:700}

/* Alertas */
.alert-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;min-height:0}
.alert-tile{border:1px solid var(--line);border-radius:17px;background:var(--surface);padding:14px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;text-align:left}
.alert-tile .label{display:grid;gap:5px;min-width:0}.alert-tile strong{font-size:15px}.alert-tile small{font-size:11px;color:var(--muted)}.alert-tile b{font-size:24px;letter-spacing:-.04em}.alert-tile.is-danger b{color:var(--danger)}.alert-tile.is-warning b{color:var(--warning)}
.alert-detail{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:10px;min-height:0}
.back-button{display:inline-flex;align-items:center;gap:6px;border:0;background:none;color:var(--accent);font-weight:850;padding:4px 0;min-height:36px}

/* Más */
.more-grid{height:100%;display:grid;grid-template-rows:repeat(5,minmax(0,1fr));gap:9px;min-height:0}
.more-item{border:1px solid var(--line);border-radius:17px;background:var(--surface);display:grid;grid-template-columns:46px minmax(0,1fr) auto;align-items:center;gap:12px;padding:11px 13px;text-align:left;min-height:0}.more-item .more-icon{width:46px;height:46px;border-radius:13px;display:grid;place-items:center;background:#f2f4f7;color:#475467}.more-copy{min-width:0;display:grid;gap:3px}.more-copy strong{font-size:15px}.more-copy span{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.more-item.is-danger .more-icon,.more-item.is-danger strong{color:var(--danger)}

/* Estadísticas */
.stats-grid{height:100%;display:grid;grid-template-rows:auto repeat(2,minmax(0,1fr));gap:10px;min-height:0}.stats-card{border:1px solid var(--line);border-radius:18px;background:var(--surface);padding:15px;display:grid;gap:10px;min-height:0}.stats-card h3{margin:0;font-size:14px}.risk-bars{display:grid;gap:7px}.bar-row{display:grid;grid-template-columns:78px minmax(0,1fr) 34px;gap:8px;align-items:center;font-size:11px;color:var(--muted);font-weight:750}.bar-track{height:8px;background:#eef2f6;border-radius:999px;overflow:hidden}.bar-track i{display:block;height:100%;border-radius:999px;background:var(--accent)}.bar-row b{text-align:right;color:var(--ink)}
.movement{display:grid;grid-template-columns:1fr 1fr;gap:9px}.movement div{border-radius:14px;background:var(--surface-2);padding:12px;display:grid;gap:4px}.movement strong{font-size:25px}.movement span{font-size:11px;color:var(--muted);font-weight:800}

/* Sheet */
.sheet-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.45);backdrop-filter:blur(3px);z-index:70}
.app-sheet{position:fixed;left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom));z-index:80;max-height:min(78dvh,720px);display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;border:1px solid var(--line);border-radius:24px;background:var(--surface);box-shadow:0 28px 70px rgba(15,23,42,.28);overflow:hidden}
.app-sheet[hidden],.sheet-backdrop[hidden]{display:none}.sheet-handle{width:42px;height:5px;border-radius:999px;background:#d0d5dd;margin:9px auto 2px}.sheet-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px 12px;border-bottom:1px solid var(--line)}.sheet-header small{font-size:10px;color:var(--accent);font-weight:900;letter-spacing:.08em}.sheet-header h2{margin:3px 0 0;font-size:22px;letter-spacing:-.035em}.sheet-body{min-height:0;overflow:auto;padding:14px 16px 18px;overscroll-behavior:contain}.sheet-actions{padding:10px 16px calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;background:var(--surface)}.sheet-actions[hidden]{display:none}
.detail-grid{display:grid;gap:9px}.detail-row{padding:10px 0;border-bottom:1px solid #f0f2f5;display:grid;gap:3px}.detail-row:last-child{border-bottom:0}.detail-row span{font-size:10px;font-weight:850;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}.detail-row strong,.detail-row p{margin:0;font-size:14px;line-height:1.35}.detail-row p{font-weight:550;color:#344054}.detail-pills{display:flex;gap:6px;flex-wrap:wrap}.sheet-button{min-height:46px;border-radius:13px;border:1px solid var(--line);background:var(--surface);color:var(--ink);font-weight:850}.sheet-button.primary{background:var(--accent);border-color:var(--accent);color:#fff}.sheet-button.danger{border-color:#fecaca;color:var(--danger);background:#fff}
.history-list{display:grid;gap:8px;margin-top:6px}.history-item{border-left:3px solid var(--accent);padding:7px 0 7px 10px;display:grid;gap:3px}.history-item b{font-size:12px}.history-item span{font-size:11px;color:var(--muted);line-height:1.35}

.app-busy{position:fixed;left:50%;top:calc(env(safe-area-inset-top) + 18px);transform:translateX(-50%);z-index:100;display:flex;align-items:center;gap:9px;padding:9px 13px;border-radius:999px;background:#0f172a;color:#fff;box-shadow:0 10px 28px rgba(15,23,42,.24);font-size:12px;font-weight:800}.app-busy[hidden]{display:none}.busy-spinner{width:18px;height:18px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:spin .75s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
.error-card{height:100%;display:grid;place-items:center;text-align:center;padding:24px;color:var(--muted)}.error-card div{display:grid;gap:10px}.error-card strong{color:var(--ink);font-size:18px}.error-card button{min-height:46px;border:0;border-radius:13px;background:var(--accent);color:#fff;font-weight:850;padding:0 18px}

@media (max-width:380px){
  :root{--header-h:76px;--nav-h:70px}.app-header{padding-left:13px;padding-right:13px}.app-stage,.screen{padding-left:12px;padding-right:12px}.app-brand img{width:44px;height:44px}.app-brand strong{font-size:20px}.today-grid{gap:6px}.metric-button{padding:9px 6px}.metric-button strong{font-size:22px}.metric-button span{font-size:9px}.hub-card{padding:13px}.hub-icon{width:46px;height:46px}.hub-copy strong{font-size:16px}.priority-card{padding:9px 10px}.app-nav{padding-left:4px;padding-right:4px}.nav-item{font-size:9px}}
@media (max-height:700px){
  :root{--header-h:74px;--nav-h:68px}.app-brand img{width:42px;height:42px}.app-brand strong{font-size:20px}.screen{padding-top:11px;padding-bottom:9px;gap:9px}.screen-head{min-height:44px}.screen-head h1{font-size:24px}.screen-head p{margin-top:4px}.today-grid{gap:6px}.metric-button{padding:8px 7px}.priority-stack{gap:6px}.priority-card{padding:7px 10px}.hub-grid,.more-grid{gap:7px}.hub-card{padding:11px 14px}.hub-icon{width:44px;height:44px}.paged-list{gap:6px}.list-card{padding:8px 10px}.segmented button{min-height:39px}.date-strip button,.date-strip strong{height:40px}.pager button{height:40px}}


/* V6 · Domicilios: mapa nativo de la app, sin reutilizar la vista desktop. */
.tool-screen.is-dom{grid-template-rows:auto auto auto minmax(0,1fr) auto}
.dom-map-shell{position:relative;min-height:0;height:100%;overflow:hidden;border:1px solid var(--line);border-radius:18px;background:#e9eef2;box-shadow:0 4px 16px rgba(15,23,42,.05)}
.dom-map-canvas{position:absolute;inset:0;width:100%;height:100%;background:#e9eef2}
.dom-map-status{position:absolute;z-index:550;left:10px;top:10px;max-width:calc(100% - 20px);padding:7px 10px;border:1px solid rgba(255,255,255,.7);border-radius:999px;background:rgba(15,23,42,.84);color:#fff;font-size:10px;font-weight:800;line-height:1.2;box-shadow:0 5px 15px rgba(15,23,42,.16);pointer-events:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gsl-app-map-label.leaflet-tooltip{background:transparent!important;border:0!important;box-shadow:none!important;color:#fff!important;font-weight:900!important;font-size:11px!important;line-height:1!important;padding:0!important;pointer-events:none!important}.gsl-app-map-label.leaflet-tooltip:before{display:none!important}
.dom-map-shell .leaflet-control-attribution{font-size:8px!important}
.dom-map-shell .leaflet-control-zoom a{width:34px!important;height:34px!important;line-height:34px!important}
.route-button{height:44px;border:1px solid color-mix(in srgb,var(--accent) 36%,var(--line));border-radius:13px;background:var(--surface);color:var(--ink);display:flex;align-items:center;justify-content:center;gap:8px;font-weight:850}.route-button .icon{color:var(--accent);width:20px;height:20px}.route-button:disabled{opacity:.4}

/* V8 · Sistema visual móvil operativo.
   La app usa jerarquía, contraste y escala táctil propios; no hereda la estética desktop. */
:root{
  --app-bg:#eef2f6;
  --surface:#ffffff;
  --surface-2:#f3f6f9;
  --ink:#0b1220;
  --muted:#465468;
  --line:#cfd7e2;
  --line-strong:#b8c3d1;
  --accent-soft:color-mix(in srgb,var(--accent) 13%,#fff);
  --shadow:0 10px 28px rgba(15,23,42,.10);
  --header-h:82px;
  --nav-h:82px;
}
html,body,.gsl-app{overflow:hidden!important;overscroll-behavior:none}
.app-stage,.screen{overflow:hidden!important}

/* Cabecera: ninguna acción muda. */
.app-header{padding-left:20px;padding-right:16px;border-bottom-color:var(--line);box-shadow:0 3px 14px rgba(15,23,42,.05)}
.app-brand img{width:50px;height:50px;border-radius:14px}
.app-brand strong{font-size:25px;line-height:1.02;font-weight:900;letter-spacing:-.04em;color:var(--ink)}
.app-brand span{font-size:14px;line-height:1.15;font-weight:800;color:var(--muted)}
.header-menu-button{min-width:84px;height:48px;padding:0 13px;display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid var(--line-strong);border-radius:14px;background:#fff;color:var(--ink);font-size:14px;font-weight:850;box-shadow:0 3px 10px rgba(15,23,42,.06)}
.header-menu-button .icon{width:21px;height:21px;color:var(--accent)}
.header-menu-button:active{transform:scale(.97);background:var(--surface-2)}

/* Navegación primaria: icono + texto legibles, estado activo inequívoco. */
.app-nav{padding:7px 8px calc(7px + env(safe-area-inset-bottom));border-top-color:var(--line-strong);box-shadow:0 -6px 20px rgba(15,23,42,.06)}
.nav-item{min-height:64px;border-radius:16px;gap:5px;color:#526174;font-size:12px;font-weight:850}
.nav-item .icon{width:26px;height:26px}
.nav-item.is-active{color:color-mix(in srgb,var(--accent) 82%,#00536f);background:color-mix(in srgb,var(--accent) 15%,#fff);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 18%,#fff)}

/* Escala tipográfica general. */
.screen{padding:18px 18px 14px;gap:15px}
.screen-head{min-height:58px;align-items:center}
.screen-head h1{font-size:31px;line-height:1.02;font-weight:950;letter-spacing:-.045em;color:var(--ink)}
.screen-head p{margin-top:7px;font-size:16px;line-height:1.3;font-weight:650;color:var(--muted)}
.section-label{font-size:13px;line-height:1.2;font-weight:900;letter-spacing:.075em;color:#334155}
.section-label button,.back-button{font-size:14px;font-weight:900}
.back-button .icon{width:21px;height:21px}

/* Inicio: números útiles y textos que se pueden leer sin acercar el teléfono. */
.today-grid{gap:10px}
.metric-button{min-height:78px;padding:12px 10px;border-color:var(--line);border-radius:17px;box-shadow:0 4px 14px rgba(15,23,42,.05)}
.metric-button strong{font-size:29px}
.metric-button span{font-size:12px;line-height:1.12;color:#526174;font-weight:850}
.priority-stack{grid-template-rows:repeat(3,minmax(74px,1fr));gap:9px}
.priority-card{padding:11px 13px;grid-template-columns:46px minmax(0,1fr) auto;border-color:var(--line);box-shadow:0 3px 11px rgba(15,23,42,.04)}
.priority-card .lead-icon{width:46px;height:46px}
.priority-card .lead-icon .icon{width:24px;height:24px}
.priority-card .copy strong{font-size:16px;line-height:1.2}
.priority-card .copy span{font-size:13px;line-height:1.25;color:var(--muted)}
.priority-card .value{font-size:23px}

/* Hubs: acciones compactas y explícitas, no tarjetas gigantes vacías. */
.hub-grid{grid-template-rows:repeat(3,minmax(104px,116px));align-content:start;gap:12px}
.hub-card{min-height:104px;padding:15px 16px;border-color:var(--line);border-radius:18px;grid-template-columns:58px minmax(0,1fr) 24px;gap:15px;box-shadow:var(--shadow)}
.hub-icon{width:58px;height:58px;border-radius:16px;background:var(--accent-soft);border:1px solid color-mix(in srgb,var(--accent) 19%,#fff)}
.hub-icon .icon{width:30px;height:30px}
.hub-copy strong{font-size:20px;line-height:1.15;font-weight:900;color:var(--ink)}
.hub-copy span{font-size:15px;line-height:1.28;color:var(--muted);font-weight:600}
.hub-chevron .icon,.hub-card>.icon{width:22px;height:22px;color:#64748b}

/* Agenda/listas: 3 elementos por página, pero sin microtipografía. */
.tool-screen{gap:11px}
.segmented{padding:4px;border-radius:14px;background:#dfe5ec;border-color:#cbd5e1}
.segmented button{min-height:47px;font-size:15px;font-weight:850;color:#526174}
.segmented button.is-active{color:var(--ink);box-shadow:0 3px 9px rgba(15,23,42,.12)}
.date-strip{grid-template-columns:50px minmax(0,1fr) 50px;gap:9px}
.date-strip button,.date-strip strong{height:50px;border-color:var(--line-strong);border-radius:14px}
.date-strip button{font-size:23px}.date-strip strong{font-size:16px;font-weight:900;color:var(--ink)}
.paged-list{gap:10px}
.list-card{padding:13px 14px;border-color:var(--line);border-radius:17px;box-shadow:0 4px 13px rgba(15,23,42,.045)}
.list-card.is-empty{font-size:15px;line-height:1.4}
.list-main{gap:5px}
.list-top{gap:8px}
.list-time{font-size:14px;font-weight:950}
.list-name{font-size:18px;line-height:1.18;font-weight:950;color:#050b14}
.list-sub{font-size:14px;line-height:1.28;color:var(--muted);font-weight:580}
.list-side .icon{width:21px;height:21px;color:#64748b}
.chip{height:28px;padding:0 10px;font-size:12px;font-weight:900}
.pager{grid-template-columns:58px minmax(0,1fr) 58px}
.pager button{height:50px;border-color:var(--line-strong);border-radius:14px}
.pager span{font-size:13px;color:#526174;font-weight:850}

/* Casos */
.search-box{height:58px;border-color:var(--line-strong);border-radius:17px;grid-template-columns:27px minmax(0,1fr) 48px;padding-left:16px;box-shadow:0 4px 14px rgba(15,23,42,.06)}
.search-box>.icon{width:25px;height:25px;color:#64748b}
.search-box input{font-size:18px;font-weight:600}
.search-box button{width:48px;height:48px;border-radius:13px}.search-box button .icon{width:25px;height:25px}
.search-hint{font-size:13px;color:var(--muted)}

/* Alertas */
.alert-summary{gap:11px}
.alert-tile{padding:15px;border-color:var(--line);border-radius:18px;box-shadow:0 4px 14px rgba(15,23,42,.05)}
.alert-tile strong{font-size:18px;font-weight:900;color:var(--ink)}
.alert-tile small{font-size:13px;line-height:1.25;color:var(--muted);font-weight:650}
.alert-tile b{font-size:31px;font-weight:950}

/* Más */
.more-grid{grid-template-rows:repeat(5,minmax(76px,1fr));gap:10px}
.more-item{padding:12px 14px;border-color:var(--line);border-radius:17px;grid-template-columns:52px minmax(0,1fr) 22px;box-shadow:0 4px 13px rgba(15,23,42,.04)}
.more-item .more-icon{width:52px;height:52px;border-radius:15px;background:#e9eef4;color:#334155}
.more-item .more-icon .icon{width:27px;height:27px}
.more-copy strong{font-size:18px;line-height:1.15;font-weight:900;color:var(--ink)}
.more-copy span{font-size:14px;line-height:1.25;color:var(--muted);font-weight:600}
.more-item>.icon{width:21px;height:21px;color:#64748b}

/* Formularios operativos */
.action-form{display:grid;gap:15px}
.form-field{display:grid;gap:7px}
.form-field>span,.form-field>label,.field-label{font-size:13px;line-height:1.2;font-weight:900;letter-spacing:.045em;text-transform:uppercase;color:#526174}
.form-field input,.form-field select,.form-field textarea{width:100%;min-height:54px;border:1px solid var(--line-strong);border-radius:14px;background:#fff;color:var(--ink);padding:12px 13px;font-size:17px;line-height:1.35;font-weight:600;outline:none}
.form-field textarea{min-height:100px;resize:vertical}
.form-field input:focus,.form-field select:focus,.form-field textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 17%,transparent)}
.form-check{min-height:52px;display:flex;align-items:center;gap:11px;padding:10px 12px;border:1px solid var(--line);border-radius:14px;background:var(--surface-2);font-size:15px;font-weight:750;color:var(--ink)}
.form-check input{width:22px;height:22px;accent-color:var(--accent)}

/* Sheets operativos: detalle legible y acciones con nombre + icono. */
.sheet-backdrop{background:rgba(11,18,32,.58);backdrop-filter:blur(5px)}
.app-sheet{left:10px;right:10px;bottom:calc(10px + env(safe-area-inset-bottom));max-height:min(86dvh,820px);border-color:var(--line-strong);border-radius:26px;box-shadow:0 30px 80px rgba(5,11,20,.34)}
.sheet-header{padding:12px 18px 15px}
.sheet-header small{font-size:12px;letter-spacing:.09em}
.sheet-header h2{margin-top:5px;font-size:28px;line-height:1.08;font-weight:950;letter-spacing:-.04em;color:var(--ink)}
.sheet-body{padding:16px 18px 20px}
.sheet-actions{padding:12px 18px calc(12px + env(safe-area-inset-bottom));grid-template-columns:repeat(auto-fit,minmax(132px,1fr));gap:9px}
.detail-grid{gap:4px}
.detail-row{padding:12px 0;gap:5px;border-bottom-color:#e2e8f0}
.detail-row span{font-size:12px;color:#526174;font-weight:900;letter-spacing:.055em}
.detail-row strong,.detail-row p{font-size:17px;line-height:1.38;color:#263548;font-weight:680}
.sheet-button{min-height:52px;padding:8px 12px;display:flex;align-items:center;justify-content:center;gap:8px;border-color:var(--line-strong);border-radius:14px;font-size:15px;line-height:1.2;font-weight:900}
.sheet-button .icon{width:21px;height:21px}
.sheet-button.primary{background:var(--accent);border-color:var(--accent);color:#04131b}
.sheet-button.danger{border-color:#f6b9b9;background:#fff5f5;color:#b91c1c}
.history-list{gap:10px}.history-item{border-left-width:4px;padding:9px 0 9px 12px}.history-item b{font-size:15px}.history-item span{font-size:13px;line-height:1.4;color:var(--muted)}

/* Estadísticas: gráficos reales y una visualización por pantalla. */
.stats-screen{height:100%;min-height:0;display:grid;grid-template-rows:auto auto minmax(0,1fr);gap:12px}
.stats-tabs button{font-size:14px}
.chart-card{height:100%;min-height:0;border:1px solid var(--line);border-radius:20px;background:#fff;padding:18px;box-shadow:var(--shadow);overflow:hidden}
.chart-title{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.chart-title strong{font-size:20px;line-height:1.15;color:var(--ink)}.chart-title span{font-size:13px;color:var(--muted);font-weight:700;text-align:right}
.chart-risk{display:grid;grid-template-columns:minmax(180px,.92fr) 1.08fr;align-items:center;gap:18px}
.donut-wrap{display:grid;place-items:center;min-height:0}
.donut{width:min(44vw,190px);aspect-ratio:1;border-radius:50%;background:conic-gradient(var(--donut));display:grid;place-items:center;position:relative;box-shadow:inset 0 0 0 1px rgba(15,23,42,.04)}
.donut:after{content:"";position:absolute;inset:25%;border-radius:50%;background:#fff;box-shadow:0 0 0 1px #edf1f5}
.donut>div{position:relative;z-index:1;display:grid;place-items:center;gap:2px}.donut strong{font-size:34px;line-height:1;font-weight:950;color:var(--ink)}.donut span{font-size:12px;font-weight:800;color:var(--muted)}
.chart-legend{display:grid;gap:11px}.chart-legend>div{display:grid;grid-template-columns:12px minmax(0,1fr) auto;align-items:center;gap:9px}.chart-legend i{width:12px;height:12px;border-radius:50%}.chart-legend span{font-size:14px;font-weight:700;color:#334155}.chart-legend b{font-size:18px;color:var(--ink)}
.chart-motives{display:grid;grid-template-rows:auto minmax(0,1fr);gap:14px}.motive-bars{display:grid;align-content:center;gap:9px;min-height:0}.motive-row{display:grid;grid-template-columns:minmax(105px,1.15fr) minmax(90px,1fr) 34px;align-items:center;gap:8px}.motive-row>span{font-size:12px;font-weight:800;color:#334155;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.motive-row>div{height:11px;border-radius:999px;background:#e6ebf0;overflow:hidden}.motive-row i{display:block;height:100%;border-radius:999px;background:var(--accent)}.motive-row b{text-align:right;font-size:14px;color:var(--ink)}
.chart-movement{display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:14px}.movement-chart{display:flex;justify-content:center;align-items:end;gap:54px;min-height:0;padding:4px 20px 0}.movement-column{height:100%;min-height:170px;display:grid;grid-template-rows:minmax(0,1fr) auto auto;justify-items:center;gap:6px}.movement-bar-shell{width:72px;height:100%;min-height:120px;display:flex;align-items:end;border-radius:16px 16px 5px 5px;background:#e8edf2;overflow:hidden}.movement-bar-shell i{display:block;width:100%;background:var(--accent);border-radius:16px 16px 5px 5px}.movement-column.is-close .movement-bar-shell i{background:#334155}.movement-column strong{font-size:28px;line-height:1}.movement-column span{font-size:14px;font-weight:850;color:var(--muted)}.movement-summary{padding:11px 13px;border-radius:13px;background:var(--surface-2);font-size:14px;line-height:1.35;font-weight:700;color:#334155;text-align:center}

/* Mapa: siempre dentro de la app. */
.dom-map-shell{border-color:var(--line-strong);border-radius:18px;box-shadow:var(--shadow)}
.dom-map-status{top:12px;left:12px;max-width:calc(100% - 24px);padding:9px 12px;font-size:12px;line-height:1.25}
.route-button{height:50px;border-color:var(--line-strong);font-size:15px;border-radius:14px;box-shadow:0 3px 10px rgba(15,23,42,.05)}
.route-button .icon{width:22px;height:22px}

/* Mensajes breves */
.app-toast{position:fixed;left:16px;right:16px;bottom:calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);z-index:120;min-height:52px;display:flex;align-items:center;justify-content:center;padding:11px 14px;border-radius:14px;background:#0b1220;color:#fff;font-size:15px;font-weight:850;box-shadow:0 14px 34px rgba(5,11,20,.28);text-align:center}
.app-toast.is-warning{background:#92400e}.app-toast.is-error{background:#991b1b}.app-toast.is-success{background:#14532d}

/* En pantallas muy angostas no achicar la tipografía a niveles ilegibles. */
@media (max-width:390px){
  :root{--header-h:78px;--nav-h:78px}
  .app-header{padding-left:15px;padding-right:12px}.app-brand img{width:46px;height:46px}.app-brand strong{font-size:23px}.app-brand span{font-size:13px}
  .header-menu-button{min-width:72px;padding:0 10px;font-size:13px}
  .screen{padding-left:14px;padding-right:14px}.screen-head h1{font-size:29px}.screen-head p{font-size:15px}
  .nav-item{font-size:11px}.nav-item .icon{width:24px;height:24px}
  .hub-card{grid-template-columns:52px minmax(0,1fr) 20px;padding:13px}.hub-icon{width:52px;height:52px}.hub-copy strong{font-size:18px}.hub-copy span{font-size:14px}
  .today-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.metric-button{min-height:65px}.metric-button strong{font-size:27px}.metric-button span{font-size:12px}
  .list-name{font-size:17px}.list-sub{font-size:13px}
  .chart-risk{grid-template-columns:1fr 1fr;gap:10px}.donut{width:min(42vw,155px)}.donut strong{font-size:29px}.chart-legend{gap:8px}.chart-legend span{font-size:12px}.chart-legend b{font-size:16px}
  .motive-row{grid-template-columns:minmax(90px,1.1fr) minmax(75px,1fr) 28px;gap:6px}.motive-row>span{font-size:11px}
}

/* En teléfonos bajos se compacta el espacio, no la legibilidad. */
@media (max-height:720px){
  :root{--header-h:74px;--nav-h:72px}
  .app-brand img{width:43px;height:43px}.app-brand strong{font-size:22px}.app-brand span{font-size:12px}
  .screen{padding-top:11px;padding-bottom:9px;gap:10px}.screen-head{min-height:48px}.screen-head h1{font-size:28px}.screen-head p{font-size:14px;margin-top:4px}
  .hub-grid{grid-template-rows:repeat(3,minmax(88px,98px));gap:8px}.hub-card{min-height:88px;padding-top:10px;padding-bottom:10px}.hub-icon{width:48px;height:48px}.hub-copy strong{font-size:18px}.hub-copy span{font-size:13px}
  .more-grid{gap:7px}.more-item{padding-top:8px;padding-bottom:8px}.more-item .more-icon{width:46px;height:46px}.more-copy strong{font-size:17px}.more-copy span{font-size:13px}
  .date-strip button,.date-strip strong{height:44px}.segmented button{min-height:42px}
  .list-card{padding-top:9px;padding-bottom:9px}.list-name{font-size:17px}.list-sub{font-size:13px}.chip{height:25px;font-size:11px}
  .pager button{height:44px}
}

/* V8 · ayudas de acción explícita */
.list-side-action{display:flex;align-items:center;justify-content:flex-end;gap:4px;min-width:68px;color:#526174}
.list-side-action small{font-size:11px;font-weight:900;color:#526174;letter-spacing:.01em}
.list-side-action .icon{color:var(--accent)}
.check-field{min-height:54px;display:flex;align-items:center;gap:12px;padding:11px 13px;border:1px solid var(--line);border-radius:14px;background:var(--surface-2);font-size:15px;line-height:1.3;font-weight:750;color:var(--ink)}
.check-field input{width:22px;height:22px;flex:0 0 auto;accent-color:var(--accent)}
.form-field small{font-size:12px;line-height:1.35;color:var(--muted);font-weight:600}
.confirm-panel{display:grid;justify-items:center;text-align:center;gap:10px;padding:10px 4px 4px}.confirm-panel .confirm-icon{width:58px;height:58px;border-radius:18px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent)}.confirm-panel .confirm-icon .icon{width:30px;height:30px}.confirm-panel h3{margin:0;font-size:21px;color:var(--ink)}.confirm-panel p{margin:0;font-size:15px;line-height:1.45;color:var(--muted)}
@media(max-width:390px){.list-side-action{min-width:56px}.list-side-action small{font-size:10px}}

/* V8 · contraste de marca */
.app-header{background:#081426;border-bottom-color:#132238;box-shadow:0 5px 18px rgba(3,9,20,.18)}
.app-brand strong{color:#fff}.app-brand span{color:#a9c2d8}
.header-menu-button{background:#10233a;border-color:#294158;color:#fff;box-shadow:none}
.header-menu-button .icon{color:var(--accent)}
.header-menu-button:active{background:#17304d}


/* V9 · identidad Gestión SL + jerarquía informativa móvil */
:root{--header-h:92px;--nav-h:72px;font-family:system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,"Helvetica Neue","Noto Sans",Arial,sans-serif}
.app-header{background:#fff;border-bottom:3px solid var(--accent);box-shadow:0 4px 18px rgba(15,23,42,.08)}
.app-brand{gap:11px}.app-brand img{width:48px;height:48px;border-radius:12px;object-fit:contain;box-shadow:none}
.app-brand div{display:grid;grid-template-columns:auto 1fr;column-gap:8px;row-gap:1px;align-items:baseline}
.app-brand .product-name{grid-column:1/-1;font-size:18px!important;line-height:1;color:#0f172a!important;letter-spacing:-.02em}
.app-brand .screen-name{font-size:13px;font-weight:800;color:var(--accent);line-height:1.15}
.app-brand #appContext{font-size:13px;font-weight:650;color:#64748b;line-height:1.15}
.header-menu-button{background:color-mix(in srgb,var(--accent) 9%,#fff);border:1px solid color-mix(in srgb,var(--accent) 25%,#e2e8f0);color:#0f172a}
.app-nav{border-top:1px solid #dbe2e8;box-shadow:0 -4px 16px rgba(15,23,42,.04)}
.nav-item.is-active{background:transparent;color:var(--accent);position:relative}.nav-item.is-active:before{content:"";position:absolute;top:-8px;left:24%;right:24%;height:3px;border-radius:0 0 3px 3px;background:var(--accent)}
.screen{overflow-y:auto;overscroll-behavior:contain}
.list-name{font-size:16px;line-height:1.25;font-weight:800;color:#111827}.list-sub{font-size:13px;line-height:1.35;font-weight:600;color:#475569;white-space:normal}.list-address{display:flex;align-items:flex-start;gap:5px;font-size:13px;line-height:1.3;color:#334155;font-weight:650}.list-address .icon{width:15px;height:15px;flex:0 0 auto;margin-top:1px;color:var(--accent)}
.more-copy strong{font-size:16px}.more-copy span{font-size:13px}.screen-head h1{font-size:25px}.screen-head p{font-size:13px}
/* Estadísticas: dos lecturas relacionadas juntas, conservando tortas. */
.stats-scroll{display:block}.stats-dashboard{display:grid;gap:14px;padding-bottom:8px}.stats-intro h1,.direction-intro h1{margin:4px 0 5px;font-size:24px;line-height:1.08;letter-spacing:-.035em}.stats-intro p,.direction-intro p{margin:0;color:#64748b;font-size:13px;line-height:1.4}.eyebrow{font-size:10px;font-weight:900;letter-spacing:.1em;color:var(--accent)}
.stats-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}.mini-chart{min-width:0;background:#fff;border:1px solid #dfe4ea;border-radius:16px;padding:12px;box-shadow:0 3px 12px rgba(15,23,42,.04)}.mini-chart-head{display:flex;justify-content:space-between;gap:5px;align-items:flex-start;margin-bottom:10px}.mini-chart-head strong{font-size:13px;line-height:1.15}.mini-chart-head>span{font-size:16px;font-weight:900}.mini-donut-row{display:grid;gap:10px}.donut-small{width:min(31vw,126px);margin:auto}.donut-small:after{inset:28%}.donut-small strong{font-size:22px}.donut-small span{font-size:9px}.chart-legend.compact{gap:5px}.chart-legend.compact>div{grid-template-columns:8px minmax(0,1fr) auto;gap:5px}.chart-legend.compact i{width:8px;height:8px}.chart-legend.compact span{font-size:10px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chart-legend.compact b{font-size:11px}.stats-group{display:grid;gap:8px}.activity-kpis,.direction-attention{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.activity-kpis>div,.direction-attention>div{background:#fff;border:1px solid #dfe4ea;border-radius:14px;padding:11px}.activity-kpis strong,.direction-attention strong{display:block;font-size:23px;line-height:1;font-weight:900}.activity-kpis span,.direction-attention span{display:block;margin-top:5px;font-size:11px;line-height:1.2;color:#64748b;font-weight:700}
/* Dirección: información visible, no escondida en Más. */
.direction-scroll{display:block}.direction-home{display:grid;gap:13px;padding-bottom:8px}.direction-kpis{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.direction-kpis .metric-button{min-height:76px;padding:12px}.direction-kpis .metric-button strong{font-size:27px}.direction-kpis .metric-button span{font-size:12px;line-height:1.2}.supervision-link{width:100%;min-height:68px;border:1px solid color-mix(in srgb,var(--accent) 28%,#dfe4ea);border-radius:15px;background:color-mix(in srgb,var(--accent) 7%,#fff);padding:12px 14px;display:flex;align-items:center;justify-content:space-between;text-align:left;color:#0f172a}.supervision-link span:first-child{display:grid;gap:3px}.supervision-link b{font-size:15px}.supervision-link small{font-size:12px;color:#64748b;font-weight:650}.supervision-link>.icon{color:var(--accent)}
/* Identidad municipal secundaria: marca de contexto, no reemplaza Gestión SL. */
.app-nav:after{content:"";position:absolute;width:0;height:0;background-image:var(--municipality-logo);background-size:contain;background-repeat:no-repeat}
@media(max-width:390px){:root{--header-h:88px;--nav-h:72px}.app-brand img{width:44px;height:44px}.app-brand .product-name{font-size:17px!important}.app-brand .screen-name,.app-brand #appContext{font-size:12px}.stats-pair{gap:7px}.mini-chart{padding:10px}.donut-small{width:min(29vw,112px)}.chart-legend.compact span{font-size:9px}.direction-intro h1,.stats-intro h1{font-size:22px}}

/* V10 · densidad móvil, identidad dual y organización por acciones */
:root{--header-h:76px;--nav-h:68px;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.app-header{padding-left:14px;padding-right:12px;background:#fff;border-bottom:3px solid var(--accent)}
.app-brand{gap:9px}.app-brand img{width:40px;height:40px;border-radius:10px}.app-brand div{column-gap:7px}.app-brand .product-name{font-size:17px!important}.app-brand .screen-name,.app-brand #appContext{font-size:11px!important}
.municipality-badge{height:46px;max-width:148px;padding:5px 8px;border:1px solid color-mix(in srgb,var(--accent) 30%,#d8e0e8);border-radius:13px;background:color-mix(in srgb,var(--accent) 6%,#fff);display:flex;align-items:center;gap:7px;color:#0f172a;text-align:left}
.municipality-badge img{width:31px;height:31px;object-fit:contain;border-radius:7px;background:#fff}.municipality-badge span{min-width:0;display:grid;gap:1px}.municipality-badge small{font-size:8px;line-height:1;text-transform:uppercase;letter-spacing:.07em;color:#64748b;font-weight:800}.municipality-badge b{font-size:10px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.app-nav{padding:4px 5px calc(4px + env(safe-area-inset-bottom))}.nav-item{min-height:56px;border-radius:12px;font-size:10px;gap:3px}.nav-item .icon{width:23px;height:23px}.nav-item.is-active:before{top:-5px}
.screen{padding:13px 14px 10px;gap:10px}.screen-head{min-height:42px}.screen-head h1{font-size:24px;margin-top:3px}.screen-head p{font-size:12px;margin-top:3px}.section-label{font-size:11px}
.today-grid{gap:7px}.metric-button{min-height:62px;padding:8px;border-radius:14px}.metric-button strong{font-size:25px}.metric-button span{font-size:10px}
.home-layout{gap:9px!important}.priority-stack{grid-template-rows:none!important;gap:7px}.priority-card{min-height:62px;padding:8px 10px;grid-template-columns:38px minmax(0,1fr) auto;border-radius:14px}.priority-card .lead-icon{width:38px;height:38px;border-radius:11px}.priority-card .lead-icon .icon{width:21px;height:21px}.priority-card .copy strong{font-size:14px}.priority-card .copy span{font-size:11px}.priority-card .value{font-size:19px}
.quick-section{display:grid;gap:6px}.quick-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.quick-grid button{min-height:62px;border:1px solid var(--line);border-radius:13px;background:#fff;color:#334155;display:grid;place-items:center;align-content:center;gap:5px;font-size:10px;font-weight:800}.quick-grid .icon{width:22px;height:22px;color:var(--accent)}
.agenda-hub-screen .hub-grid{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:none;gap:8px;align-content:start}.agenda-hub-screen .hub-card{min-height:108px;padding:12px;display:grid;grid-template-columns:38px 1fr;grid-template-rows:auto auto;gap:7px 9px;border-radius:15px;text-align:left}.agenda-hub-screen .hub-card:nth-child(3){grid-column:1/-1;min-height:82px;grid-template-columns:38px 1fr 20px;grid-template-rows:1fr}.agenda-hub-screen .hub-icon{width:38px;height:38px;border-radius:11px}.agenda-hub-screen .hub-icon .icon{width:22px;height:22px}.agenda-hub-screen .hub-copy{align-self:center}.agenda-hub-screen .hub-copy strong{font-size:15px}.agenda-hub-screen .hub-copy span{font-size:11px;margin-top:3px}.agenda-hub-screen .hub-chevron{display:none}.agenda-hub-screen .hub-card:nth-child(3) .hub-chevron{display:block}
.paged-list{gap:7px}.list-card{padding:10px 11px;border-radius:14px}.list-name{font-size:15px}.list-sub,.list-address{font-size:12px}.pager{grid-template-columns:44px 1fr 44px}.pager button{height:40px}.pager span{font-size:10px}
.more-screen{display:block;overflow-y:auto!important}.compact-head{margin-bottom:12px}.action-section{display:grid;gap:7px;margin-bottom:14px}.action-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.action-tile{min-height:104px;padding:12px;border:1px solid var(--line);border-radius:15px;background:#fff;color:#111827;display:grid;justify-items:start;align-content:start;gap:5px;text-align:left}.action-icon{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent)}.action-icon .icon{width:21px;height:21px}.action-tile strong{font-size:14px}.action-tile small{font-size:10px;line-height:1.2;color:#64748b;font-weight:650}.account-list{display:grid;gap:7px}.account-list .more-item{min-height:60px;padding:8px 10px;grid-template-columns:38px 1fr 18px;border-radius:13px}.account-list .more-icon{width:38px;height:38px;border-radius:10px}.account-list .more-copy strong{font-size:14px}.account-list .more-copy span{font-size:11px}
.stats-dashboard{gap:9px}.stats-intro h1,.direction-intro h1{font-size:21px;margin:2px 0 3px}.stats-intro p,.direction-intro p{font-size:11px}.stats-pair{gap:7px}.mini-chart{padding:9px;border-radius:13px}.mini-chart-head{margin-bottom:6px}.mini-chart-head strong{font-size:11px}.mini-chart-head>span{font-size:14px}.mini-donut-row{gap:6px}.donut-small{width:min(27vw,108px)}.donut-small strong{font-size:19px}.chart-legend.compact{gap:3px}.chart-legend.compact span{font-size:9px}.chart-legend.compact b{font-size:10px}.activity-kpis>div,.direction-attention>div{padding:8px;border-radius:12px}.activity-kpis strong,.direction-attention strong{font-size:20px}.activity-kpis span,.direction-attention span{font-size:9px}
@media(max-width:390px){:root{--header-h:72px;--nav-h:66px}.municipality-badge{max-width:128px}.municipality-badge b{font-size:9px}.app-brand img{width:38px;height:38px}.app-brand .product-name{font-size:16px!important}.screen{padding-left:12px;padding-right:12px}.agenda-hub-screen .hub-card{min-height:100px}.action-tile{min-height:96px}}

/* V11 · organización móvil: menos pantallas-hub, más información útil por pantalla */
.screen{overflow-y:auto;overscroll-behavior:contain}
.home-layout{height:auto!important;min-height:100%;display:flex!important;flex-direction:column;gap:10px!important;padding-bottom:4px}
.home-bottom{display:block}.priority-stack{display:grid;gap:7px!important}
.home-panorama{display:grid;gap:7px;margin-top:2px}
.home-stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.home-stat{min-width:0;border:1px solid var(--line);background:#fff;border-radius:14px;padding:9px;display:grid;grid-template-columns:44px minmax(0,1fr);align-items:center;gap:8px;text-align:left}
.home-donut{width:44px;height:44px;border-radius:50%;background:var(--home-donut);display:grid;place-items:center;position:relative}.home-donut:after{content:"";position:absolute;inset:9px;border-radius:50%;background:#fff}.home-donut b{position:relative;z-index:1;font-size:11px;color:var(--ink)}
.home-stat>span:last-child{min-width:0;display:grid;gap:3px}.home-stat strong{font-size:11px;line-height:1.15}.home-stat small{font-size:8.5px;line-height:1.25;color:var(--muted)}
.home-links{display:grid;grid-template-columns:1fr 1fr;gap:7px}.home-links button{border:1px solid var(--line);background:#fff;border-radius:13px;min-height:52px;padding:8px 10px;display:grid;grid-template-columns:22px minmax(0,1fr);gap:8px;align-items:center;text-align:left;color:#334155}.home-links button:last-child{grid-column:1/-1}.home-links .icon{color:var(--accent);width:20px;height:20px}.home-links span:last-child{display:grid;gap:1px}.home-links b{font-size:10.5px}.home-links small{font-size:8.5px;color:var(--muted)}

/* Agenda: los tres ámbitos son pestañas, no una pantalla intermedia */
.agenda-direct{grid-template-rows:auto auto minmax(0,1fr) auto!important}
.agenda-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;padding:4px;border:1px solid #dbe2e8;border-radius:13px;background:#e9edf2}
.agenda-tabs button{min-width:0;height:40px;border:0;border-radius:9px;background:transparent;color:#667085;display:flex;align-items:center;justify-content:center;gap:5px;font-size:10px;font-weight:850}.agenda-tabs button .icon{width:16px;height:16px}.agenda-tabs button.is-active{background:#fff;color:var(--accent);box-shadow:0 1px 5px rgba(15,23,42,.1)}

/* Alertas: 4 accesos compactos, sin cuatro tarjetas dominantes */
.compact-alerts{align-content:start;grid-auto-rows:minmax(72px,auto);gap:7px}.compact-alerts .alert-tile{border-radius:13px;padding:10px 11px}.compact-alerts .alert-tile strong{font-size:12px}.compact-alerts .alert-tile small{font-size:9px}.compact-alerts .alert-tile b{font-size:19px}

/* Más queda para opciones secundarias, no para esconder información central */
.compact-more{grid-template-rows:auto auto!important;align-content:start}.compact-more .account-list{display:grid;gap:7px}.compact-more .more-item{min-height:62px;border-radius:14px;padding:8px 10px}.compact-more .more-icon{width:38px;height:38px;border-radius:11px}.compact-more .more-copy strong{font-size:13px}.compact-more .more-copy span{font-size:10px}

/* Cuando hay una sola página, la paginación no debe ocupar el fondo entero visualmente */
.pager{margin-top:2px}.pager button{height:38px}.pager span{font-size:10px}

@media(max-width:390px){.home-stat{grid-template-columns:40px minmax(0,1fr);padding:8px}.home-donut{width:40px;height:40px}.home-donut:after{inset:8px}.home-stat small{font-size:8px}.agenda-tabs button{font-size:9px}}
/* V12: alertas visibles en Inicio y motivos realmente discriminados */
.home-motive-legend{display:grid;gap:2px;margin-top:2px}
.home-motive-legend small{display:grid!important;grid-template-columns:7px minmax(0,1fr) auto;align-items:center;gap:4px;font-size:7.8px!important;line-height:1.15!important;white-space:normal!important}
.home-motive-legend i{width:7px;height:7px;border-radius:50%}
.home-motive-legend b{font-size:7.8px;font-weight:900}
.motive-stat{align-items:start}
.home-links button:last-child{grid-column:auto}
@media(max-width:390px){.home-motive-legend small,.home-motive-legend b{font-size:7.2px!important}}
.auth-account-change{margin-top:12px;border:0;background:transparent;color:#bfeeff;font:inherit;font-weight:800;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.about-link{color:var(--primary,#18b8f2);font-weight:850;text-decoration:none}.about-link:hover{text-decoration:underline}


/* App 14 — Dirección: más información útil, menos superficie vacía */
.stats-stack{display:grid;gap:10px}
.risk-chart-wide,.motives-chart-wide{padding:13px 14px}
.risk-chart-layout{display:grid;grid-template-columns:minmax(130px,38%) minmax(0,1fr);gap:18px;align-items:center}
.donut-large{width:min(34vw,150px);margin:auto}
.donut-large:after{inset:27%}
.donut-large strong{font-size:25px}
.donut-large span{font-size:10px}
.risk-legend{display:grid;gap:8px}
.risk-legend>div{display:grid;grid-template-columns:10px minmax(0,1fr) auto;align-items:center;gap:8px}
.risk-legend i{width:10px;height:10px;border-radius:50%}
.risk-legend span{font-size:12px;font-weight:700;color:#475569}
.risk-legend b{font-size:13px}
.motive-head>div{display:grid;gap:2px}.motive-head small{font-size:10px;color:#64748b;font-weight:650}
.motive-bars{display:grid;gap:7px;margin-top:4px}
.motive-bar-row{display:grid;gap:3px}
.motive-bar-label{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.motive-bar-label span{font-size:11px;line-height:1.15;font-weight:750;color:#334155}
.motive-bar-label b{font-size:12px;color:#0f172a}
.motive-bar-track{height:7px;border-radius:999px;background:#e8edf2;overflow:hidden}
.motive-bar-track i{display:block;height:100%;border-radius:inherit;background:var(--accent)}
.motive-pending{margin-top:10px;padding-top:9px;border-top:1px solid #e5e7eb;display:flex;align-items:baseline;gap:7px}
.motive-pending strong{font-size:18px;color:#0f172a}.motive-pending span{font-size:11px;color:#64748b;font-weight:700}
.chart-empty{font-size:12px;color:#64748b}

.direction-abrigos{display:grid;gap:8px}
.abrigo-mobile-list{gap:9px}
.abrigo-mobile-card{width:100%;border:1px solid var(--line);border-radius:17px;background:#fff;padding:13px 14px;display:grid;gap:10px;text-align:left;box-shadow:0 4px 13px rgba(15,23,42,.045)}
.abrigo-mobile-head{display:grid;grid-template-columns:minmax(0,1fr) 20px;gap:8px;align-items:center}
.abrigo-mobile-head>span:first-child{display:grid;gap:3px}
.abrigo-mobile-head strong{font-size:16px;line-height:1.15;color:#111827}
.abrigo-mobile-head small{font-size:11px;color:#64748b;font-weight:650}
.abrigo-mobile-head>.icon{color:#64748b}
.abrigo-mobile-status{display:flex;align-items:center;justify-content:space-between;gap:8px}
.abrigo-mobile-status b{font-size:11px;color:#475569;text-align:right}
.perd-timeline{position:relative;display:grid;grid-template-columns:repeat(5,1fr);gap:0;padding-top:2px}
.perd-line{position:absolute;left:9%;right:9%;top:10px;height:2px;background:#dbe3ea}
.perd-step{position:relative;z-index:1;display:grid;justify-items:center;gap:2px;min-width:0}
.perd-step i{width:16px;height:16px;border-radius:50%;background:#fff;border:3px solid #cbd5e1}
.perd-step b{font-size:10px;line-height:1;color:#334155}.perd-step small{font-size:9px;color:#64748b}.perd-step em{font-style:normal;font-size:8px;font-weight:800;color:#64748b}
.perd-step.done i{border-color:#22c55e;background:#22c55e}.perd-step.done em{color:#15803d}
.perd-step.overdue i{border-color:#dc2626;background:#dc2626}.perd-step.overdue em{color:#b91c1c}
.perd-step.soon i{border-color:#f59e0b;background:#fff7ed}.perd-step.soon em{color:#b45309}
.perd-extension{display:flex;justify-content:space-between;gap:8px;padding:7px 9px;border-radius:10px;background:#f8fafc}
.perd-extension strong{font-size:10px;color:#334155}.perd-extension span{font-size:9px;color:#64748b;text-align:right}

@media(max-width:390px){
  .risk-chart-layout{grid-template-columns:112px minmax(0,1fr);gap:11px}
  .donut-large{width:108px}
  .abrigo-mobile-card{padding:11px 12px}
  .abrigo-mobile-head strong{font-size:15px}
  .perd-step small{font-size:8px}.perd-step em{font-size:7px}
}

/* App 15 — color semántico consistente para motivos */
.motive-bar-label>span{display:flex;align-items:center;gap:6px;min-width:0}
.motive-dot{width:9px;height:9px;border-radius:50%;background:var(--motive-color);flex:0 0 9px}
.motive-bar-track i{background:var(--motive-color)}
.motive-pending{--motive-color:#aeb8c5}

/* App 16 — Dirección: alertas + agenda visibles; densidad segura */
.direction-home-v16{display:grid;gap:10px;padding-bottom:8px}
.direction-home-v16 .direction-intro{margin-bottom:0}
.direction-home-v16 .direction-kpis{gap:8px}
.direction-alert-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.direction-alert-grid>button,.direction-alert-grid>div{min-width:0;min-height:68px;border:1px solid var(--line);border-radius:14px;background:#fff;padding:10px 11px;display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px;text-align:left}
.direction-alert-grid strong{font-size:23px;line-height:1;color:#111827}
.direction-alert-grid span{font-size:10px;line-height:1.18;font-weight:750;color:#5b6778;overflow-wrap:anywhere}
.direction-alert-grid .is-danger strong{color:#dc2626}.direction-alert-grid .is-warning strong{color:#d97706}
.direction-today-counts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.direction-today-counts button{min-width:0;border:1px solid var(--line);border-radius:13px;background:#fff;padding:8px 9px;text-align:left}
.direction-today-counts strong{display:block;font-size:20px;line-height:1;color:#111827}.direction-today-counts span{display:block;margin-top:4px;font-size:10px;font-weight:800;color:#64748b;overflow:hidden;text-overflow:ellipsis}
.direction-today-list{display:grid;gap:6px}
.direction-today-row{min-width:0;border:1px solid var(--line);border-radius:12px;background:#fff;padding:8px 10px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.direction-today-row>span{min-width:0}.direction-today-row b,.direction-today-row small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.direction-today-row b{font-size:11px;color:#111827}.direction-today-row small{font-size:9px;color:#64748b;margin-top:2px}.direction-today-row>strong{font-size:12px;color:var(--accent)}
.direction-empty{padding:12px;border:1px solid var(--line);border-radius:12px;background:#fff;font-size:11px;color:#64748b}
.direction-access-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.direction-access-grid button{min-width:0;border:1px solid var(--line);border-radius:14px;background:#fff;padding:10px;display:grid;grid-template-columns:28px minmax(0,1fr);gap:8px;text-align:left;align-items:center}
.direction-access-grid .icon{color:var(--accent)}.direction-access-grid b,.direction-access-grid small{display:block}.direction-access-grid b{font-size:11px}.direction-access-grid small{font-size:9px;color:#64748b;margin-top:2px;line-height:1.15}
.direction-attention.compact{grid-template-columns:1fr 1fr}
.direction-attention.compact>div{min-height:58px}
.abrigo-mobile-list{gap:7px}
.abrigo-mobile-card{padding:10px 12px;gap:7px;border-radius:15px}
.abrigo-mobile-head strong{font-size:14px;line-height:1.1}
.abrigo-mobile-head small{font-size:10px}
.abrigo-mobile-status b{font-size:10px;line-height:1.1;max-width:62%}
.perd-step i{width:14px;height:14px}.perd-line{top:9px}
.perd-step b{font-size:9px}.perd-step small{font-size:8px}.perd-step em{font-size:7px}
@media(max-width:390px){
 .direction-alert-grid>button,.direction-alert-grid>div{padding:9px;gap:6px}
 .direction-alert-grid strong{font-size:20px}
 .direction-alert-grid span{font-size:9px}
 .direction-access-grid button{padding:9px 8px}
 .abrigo-mobile-card{padding:9px 10px;gap:6px}
 .abrigo-mobile-head strong{font-size:13px}
}

/* App 17 — Dirección: supervisión, sin agenda operativa */
.direction-home-v17{display:grid;gap:11px;padding-bottom:10px}
.direction-stats-feature,.direction-interventions-feature{width:100%;min-width:0;border:1px solid color-mix(in srgb,var(--accent) 38%,#cbd5e1);border-radius:16px;background:color-mix(in srgb,var(--accent) 6%,#fff);padding:13px 14px;display:grid;grid-template-columns:28px minmax(0,1fr) 18px;gap:9px;align-items:center;text-align:left}
.direction-stats-feature .icon,.direction-interventions-feature .icon{color:var(--accent)}
.direction-stats-feature b,.direction-stats-feature small,.direction-interventions-feature b,.direction-interventions-feature small{display:block}
.direction-stats-feature b,.direction-interventions-feature b{font-size:13px;color:#111827}
.direction-stats-feature small,.direction-interventions-feature small{font-size:10px;line-height:1.25;color:#64748b;margin-top:2px}
.direction-home-v17 .direction-alert-grid{grid-template-columns:repeat(2,minmax(0,1fr))}

/* App 18 */
.direction-scope{display:grid;gap:6px;margin-bottom:4px}.direction-scope label{display:grid;gap:4px;min-width:0}.direction-scope label>span{font-size:9px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:#64748b}.direction-scope select{width:100%;height:38px;border:1px solid var(--line);border-radius:11px;background:#fff;padding:0 10px;font-size:11px;font-weight:800;color:#172033}
.direction-home-v18{display:grid;gap:10px}.direction-stat-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.dir-stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.dir-stat-card{min-width:0;background:#fff;border:1px solid var(--line);border-radius:15px;padding:11px}.dir-stat-card.full{grid-column:1/-1}.dir-stat-card h3{font-size:12px;margin:0 0 9px}.dir-stat-bars{display:grid;gap:7px}.dir-stat-bars>div{display:grid;grid-template-columns:minmax(0,1fr) 64px 26px;gap:6px;align-items:center}.dir-stat-bars span{font-size:9px;font-weight:750;line-height:1.1;overflow-wrap:anywhere}.dir-stat-bars i{height:7px;border-radius:99px;background:#e8edf3;overflow:hidden}.dir-stat-bars i b{display:block;height:100%;border-radius:inherit}.dir-stat-bars strong{font-size:10px;text-align:right}.stat-copy{display:grid;grid-template-columns:auto 1fr;gap:5px 7px;align-items:baseline}.stat-copy b{font-size:20px}.stat-copy span{font-size:9px;font-weight:750;color:#64748b}.stat-copy small{grid-column:1/-1;font-size:8px;color:#64748b}.trend-list{display:grid;gap:5px}.trend-row{display:grid;grid-template-columns:52px repeat(3,1fr);gap:5px;padding:6px 0;border-bottom:1px solid #eef2f6;font-size:8px}.service-compare{display:grid;gap:6px}.service-compare>div{display:grid;grid-template-columns:minmax(90px,1.4fr) repeat(4,1fr);gap:5px;padding:7px 0;border-bottom:1px solid #eef2f6;font-size:8px}.list-card,.list-main,.list-top{min-width:0}.list-main{overflow:hidden}.list-name,.list-sub{max-width:100%;overflow-wrap:anywhere;word-break:break-word}.list-sub{white-space:normal!important;display:-webkit-box!important;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden!important}.list-side{flex:0 0 auto}.case-interventions .history-item span{white-space:normal;overflow-wrap:anywhere}.case-interventions .history-item small{display:block;margin-top:4px;font-size:9px;color:#64748b}
@media(max-width:390px){.direction-stat-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.dir-stats-grid{grid-template-columns:1fr}.dir-stat-card.full{grid-column:auto}.service-compare>div{grid-template-columns:minmax(80px,1.3fr) repeat(2,1fr)}.service-compare>div span:nth-of-type(n+3){display:none}}


/* App 19 — corrección de estructura vertical en Dirección */
.cases-screen:has(.direction-scope){
  grid-template-rows:auto auto auto minmax(0,1fr) auto;
}
.direction-abrigos{
  grid-template-rows:auto auto minmax(0,1fr) auto;
}
.screen.stats-scroll{
  overflow-y:auto!important;
  overflow-x:hidden!important;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-y:contain;
}

/* App 20 — Dirección: jerarquía visual de estadísticas */
.direction-stats-v20{gap:12px;padding-bottom:18px}
.direction-stat-kpis-v20{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.direction-stat-kpis-v20>div{min-width:0;background:#fff;border:1px solid var(--line);border-radius:14px;padding:10px 9px}
.direction-stat-kpis-v20 strong{display:block;font-size:22px;line-height:1;color:#111827;font-weight:900}
.direction-stat-kpis-v20 span{display:block;margin-top:5px;font-size:9px;line-height:1.15;color:#64748b;font-weight:800;overflow-wrap:anywhere}
.direction-feature-chart,.direction-bars-card{background:#fff;border:1px solid var(--line);border-radius:17px;padding:14px;box-shadow:0 3px 12px rgba(15,23,42,.035)}
.direction-feature-head{display:grid;gap:3px;margin-bottom:11px}
.direction-feature-head strong{font-size:15px;line-height:1.15;color:#111827}
.direction-feature-head small{font-size:10px;line-height:1.3;color:#64748b;font-weight:650}
.direction-feature-body{display:grid;grid-template-columns:minmax(145px,42%) minmax(0,1fr);gap:18px;align-items:center}
.direction-donut{width:min(39vw,170px);margin:auto}
.direction-donut:after{inset:27%}
.direction-donut strong{font-size:27px}.direction-donut span{font-size:9px}
.direction-feature-legend{display:grid;gap:9px;min-width:0}
.direction-feature-legend>div{display:grid;grid-template-columns:10px minmax(0,1fr) auto;gap:8px;align-items:center}
.direction-feature-legend i{width:10px;height:10px;border-radius:50%}
.direction-feature-legend span{font-size:11px;line-height:1.2;font-weight:750;color:#475569;overflow-wrap:anywhere}
.direction-feature-legend b{font-size:12px;color:#111827}
.direction-motive-bars{gap:9px}.direction-motive-bars .motive-bar-track{height:8px}
.direction-note{margin-top:11px;padding-top:9px;border-top:1px solid #e5e7eb;display:flex;gap:7px;align-items:baseline}
.direction-note b{font-size:18px}.direction-note span{font-size:10px;color:#64748b;font-weight:750}
.direction-inline-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.direction-inline-kpis>div{min-width:0;background:#fff;border:1px solid var(--line);border-radius:13px;padding:9px}
.direction-inline-kpis b{display:block;font-size:18px;line-height:1;color:#111827}.direction-inline-kpis span{display:block;margin-top:5px;font-size:9px;line-height:1.15;color:#64748b;font-weight:750;overflow-wrap:anywhere}
.direction-wide-bars>div{grid-template-columns:minmax(105px,1fr) minmax(90px,1.25fr) 30px}
.direction-stats-v20 .trend-row{font-size:9px}
@media(max-width:390px){
 .direction-stat-kpis-v20{grid-template-columns:repeat(2,minmax(0,1fr))}
 .direction-feature-body{grid-template-columns:125px minmax(0,1fr);gap:12px}
 .direction-donut{width:122px}.direction-donut strong{font-size:23px}
 .direction-feature-chart,.direction-bars-card{padding:12px}
 .direction-feature-legend{gap:7px}.direction-feature-legend span{font-size:10px}
 .direction-wide-bars>div{grid-template-columns:minmax(90px,1fr) minmax(70px,1fr) 26px}
}
\n\n/* App 21 — Estadísticas: +1 pt aprox. en textos de lectura */
.direction-stats-v20 .direction-scope label>span{font-size:10.3px}
.direction-stats-v20 .direction-scope select{font-size:12.3px}
.direction-stats-v20 .stats-intro p{font-size:calc(1em + 1.33px)}
.direction-stats-v20 .direction-stat-kpis-v20 span{font-size:10.3px}
.direction-stats-v20 .direction-feature-head small{font-size:11.3px}
.direction-stats-v20 .direction-feature-legend span{font-size:12.3px}
.direction-stats-v20 .direction-feature-legend b{font-size:13.3px}
.direction-stats-v20 .direction-donut span{font-size:10.3px}
.direction-stats-v20 .motive-bar-label{font-size:calc(1em + 1.33px)}
.direction-stats-v20 .dir-stat-bars span{font-size:10.3px;line-height:1.2}
.direction-stats-v20 .dir-stat-bars strong{font-size:11.3px}
.direction-stats-v20 .direction-note span{font-size:11.3px}
.direction-stats-v20 .direction-inline-kpis span{font-size:10.3px}
.direction-stats-v20 .trend-row{font-size:10.3px;line-height:1.25}
.direction-stats-v20 .service-compare>div{font-size:9.3px;line-height:1.25}
@media(max-width:390px){.direction-stats-v20 .direction-feature-legend span{font-size:11.3px}}

/* App 23 — Abrigos profesional compactos + fechas de Agenda por tipo */
.professional-abrigos{grid-template-rows:auto minmax(0,1fr) auto!important;}
.professional-abrigos .abrigo-mobile-list{align-content:start;}

/* Dirección — Intervenciones: corrige únicamente el espacio vertical con selector de SL */
.alert-detail:has(> .direction-scope){grid-template-rows:auto auto minmax(0,1fr) auto}

/* V24.1 · SOLO Dirección > Intervenciones: elimina el espacio vertical sobrante */
.direction-interventions{height:auto;min-height:100%;display:flex;flex-direction:column;gap:10px}
.direction-interventions>.direction-scope,.direction-interventions>.section-label,.direction-interventions>.pager{flex:0 0 auto}
.direction-interventions>.paged-list{flex:0 0 auto;display:grid;grid-template-rows:repeat(3,auto);gap:7px;overflow:visible}

/* V24.2 · Intervenciones: misma vista compacta en Profesional y Dirección */
.interventions-view{height:auto;min-height:100%;display:flex;flex-direction:column;gap:9px}
.interventions-view>.direction-scope,.interventions-view>.section-label,.interventions-view>.interventions-filter,.interventions-view>.pager{flex:0 0 auto}
.interventions-view>.interventions-filter{--segments:2;width:min(240px,100%);align-self:flex-end}
.interventions-view>.interventions-filter button{min-height:36px;font-size:12px}
.interventions-view>.paged-list{flex:0 0 auto;display:grid;grid-template-rows:repeat(4,auto);gap:7px;overflow:visible}
.interventions-view .list-card{padding:10px 11px;min-height:0}
.interventions-view .list-sub{-webkit-line-clamp:3}


/* V24.3 · Historiales móviles: 4 en Hoy; 15 con scroll en históricos. */
.interventions-view>.interventions-filter{--segments:3;width:min(330px,100%)}
.interventions-screen,.direction-abrigos-screen{overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch}
.interventions-view,.direction-abrigos{height:auto!important;min-height:100%;align-content:start}
.interventions-view>.intervention-history-list,.direction-abrigos>.abrigo-mobile-list{display:grid!important;grid-template-rows:none!important;grid-auto-rows:auto;gap:7px;overflow:visible!important;min-height:0}
.intervention-case-search{width:100%;min-height:42px;border:1px solid var(--line);border-radius:13px;background:#fff;display:grid;grid-template-columns:20px minmax(0,1fr);gap:8px;align-items:center;padding:0 11px;color:#64748b}
.intervention-case-search .icon{width:18px;height:18px}
.intervention-case-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:var(--ink);font:inherit;font-size:13px;font-weight:700}
.intervention-case-search input::placeholder{color:#98a2b3;font-weight:650}

/* V24.4 · Acciones posteriores: misma lógica operativa del desktop, adaptada al bottom-sheet móvil. */
.posterior-actions{display:grid;gap:10px;margin-top:4px;padding-top:14px;border-top:1px solid var(--line)}
.posterior-title{font-size:13px;font-weight:900;letter-spacing:.055em;text-transform:uppercase;color:var(--ink)}
.posterior-help{margin-top:-4px;font-size:13px;line-height:1.4;color:var(--muted);font-weight:600}
.posterior-box{display:grid;gap:12px;padding:12px;border:1px solid var(--line);border-radius:14px;background:var(--surface-2)}
.posterior-box[hidden]{display:none!important}

/* V24.5 · Texto asistido móvil: editor incremental, táctil y no destructivo. */
.assist-launch{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-top:-7px}
.assist-launch button{min-height:48px;border:1px solid var(--line-strong);border-radius:14px;background:#fff;color:var(--ink);font-weight:900;display:flex;align-items:center;justify-content:center;gap:8px;padding:0 13px}
.assist-launch-btn{border-color:color-mix(in srgb,var(--accent) 42%,var(--line-strong))!important;background:color-mix(in srgb,var(--accent) 8%,#fff)!important}.assist-mic-btn span:last-child{display:none}.assist-mic-btn .icon{width:22px;height:22px}
.assist-overlay{position:fixed;inset:0;z-index:120}.assist-overlay[hidden]{display:none}.assist-backdrop{position:absolute;inset:0;background:rgba(11,18,32,.58);backdrop-filter:blur(4px)}
.assist-sheet{position:absolute;left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom));max-height:min(72dvh,680px);display:grid;grid-template-rows:auto auto minmax(0,1fr);background:#fff;border:1px solid var(--line-strong);border-radius:26px;box-shadow:0 30px 80px rgba(5,11,20,.36);overflow:hidden}
.assist-handle{width:42px;height:5px;border-radius:999px;background:#cbd5e1;margin:9px auto 2px}.assist-sheet header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 17px 13px;border-bottom:1px solid var(--line)}.assist-sheet header small{font-size:11px;color:var(--accent);font-weight:950;letter-spacing:.08em}.assist-sheet h3{margin:3px 0 0;font-size:21px;line-height:1.1;letter-spacing:-.025em}.assist-done{min-height:42px;border:0;border-radius:12px;background:var(--accent);padding:0 16px;font-weight:950;color:#04131b}.assist-content{overflow:auto;padding:16px 17px 20px;overscroll-behavior:contain}
.assist-type-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.assist-type-grid button,.assist-subjects button,.assist-back,.assist-block-actions button{min-height:48px;border:1px solid var(--line-strong);border-radius:13px;background:#fff;color:var(--ink);font-weight:850;padding:8px 10px}.assist-type-grid button:active,.assist-subjects button:active{transform:scale(.985)}.assist-note{margin:14px 2px 0;color:var(--muted);font-size:13px;line-height:1.4}.assist-back{min-height:40px;padding:0 10px;margin-bottom:14px;color:var(--muted)}
.assist-section{display:grid;gap:8px;margin-bottom:14px}.assist-section>span,.assist-block>span{font-size:12px;font-weight:900;color:#475467;text-transform:uppercase;letter-spacing:.045em}.assist-subjects{display:flex;gap:7px;flex-wrap:wrap}.assist-subjects button{min-height:42px;padding:0 12px}.assist-subjects button.is-active{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 11%,#fff);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 12%,transparent)}
.assist-block{display:grid;gap:8px}.assist-block textarea{width:100%;min-height:126px;max-height:30dvh;border:1px solid var(--line-strong);border-radius:15px;padding:13px;font:inherit;font-size:17px;line-height:1.42;resize:none;outline:none}.assist-block textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 17%,transparent)}.assist-block-actions{display:grid;grid-template-columns:1fr 1.2fr;gap:8px;margin-top:10px}.assist-block-actions button{display:flex;align-items:center;justify-content:center;gap:7px}.assist-block-actions button.primary{background:var(--accent);border-color:var(--accent);color:#04131b}.assist-added{margin-top:10px;padding:9px 11px;border-radius:11px;background:#ecfdf3;color:#067647;font-weight:850;font-size:13px;text-align:center}
@media(max-height:700px){.assist-sheet{max-height:82dvh}.assist-content{padding-top:12px}.assist-block textarea{min-height:100px}}
/* V24.6 · planificación directa desde Agenda + nombre de pila en Texto asistido */
.agenda-create-btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:46px;margin:0 0 12px;border:1px solid color-mix(in srgb,var(--accent) 42%,var(--line));border-radius:14px;background:color-mix(in srgb,var(--accent) 8%,#fff);color:var(--accent-strong,var(--accent));font:inherit;font-weight:900}.agenda-create-btn .icon{width:19px;height:19px}.agenda-create-search{gap:12px}.agenda-create-results{display:grid;gap:8px;max-height:44vh;overflow:auto;padding:2px}.agenda-create-results>p{margin:4px 2px;color:var(--muted);line-height:1.45}.agenda-case-option{display:grid;gap:3px;width:100%;text-align:left;border:1px solid var(--line);border-radius:13px;background:#fff;padding:12px 13px;color:var(--ink)}.agenda-case-option strong{font-size:15px}.agenda-case-option span{font-size:12px;color:var(--muted);font-weight:700}.assist-name{display:grid;gap:6px;margin-top:3px}.assist-name>span{font-size:11px;font-weight:900;color:#667085;text-transform:uppercase;letter-spacing:.04em}.assist-name small{font-size:10px;font-weight:750;text-transform:none;letter-spacing:0}.assist-name input{width:100%;min-height:44px;border:1px solid var(--line-strong);border-radius:12px;background:#fff;color:var(--ink);font:inherit;padding:0 12px;outline:none}.assist-name input:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 12%,transparent)}


/* V24.7 — correcciones móviles puntuales */
.app-toast[hidden]{display:none!important}
.app-toast{cursor:pointer}
.tool-screen.has-create{grid-template-rows:auto auto auto minmax(0,1fr) auto}
.tool-screen.is-dom.has-create{grid-template-rows:auto auto auto auto minmax(0,1fr) auto}
.agenda-create-btn{min-height:46px!important;height:46px!important;margin:0!important;align-self:start}
.assist-block-actions button.is-listening,.assist-mic-btn.is-listening{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 12%,#fff);color:var(--accent-strong,var(--accent))}
.assist-block-actions button.is-listening .icon,.assist-mic-btn.is-listening .icon{animation:assistMicPulse 1s ease-in-out infinite}
@keyframes assistMicPulse{50%{transform:scale(1.18);opacity:.55}}

/* Agenda Sede: jornada completa en una sola lista, sin paginado. */
.agenda-day-list{grid-template-rows:none;grid-auto-rows:auto;align-content:start;overflow-y:auto;overflow-x:hidden;min-height:0;padding-right:2px;-webkit-overflow-scrolling:touch}
.agenda-day-list .list-card{min-height:0}

/* V24.17 — listas profesionales sin paginado: scroll vertical cuando hace falta. */
.paged-list.scroll-list,
.interventions-view>.paged-list.scroll-list,
.professional-abrigos>.paged-list.scroll-list{
  grid-template-rows:none!important;
  grid-auto-rows:auto;
  align-content:start;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  min-height:0;
  padding-right:2px;
  -webkit-overflow-scrolling:touch;
}

/* V24.18 — scroll real sin comprimir tarjetas en Agenda y Casos profesionales. */
.agenda-day-list{
  grid-template-rows:none!important;
  grid-auto-rows:max-content!important;
  align-content:start!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}
.agenda-day-list .list-card{
  min-height:112px!important;
  height:auto!important;
  align-self:start;
  padding:13px 14px;
}
.agenda-day-list .list-main{overflow:visible!important}
.agenda-day-list .list-top{align-items:flex-start}
.agenda-day-list .list-sub{white-space:normal!important;display:block!important;overflow:visible!important;line-height:1.32}
.agenda-day-list .list-meta{margin-top:4px;flex-wrap:wrap}

#caseList.scroll-list{
  grid-template-rows:none!important;
  grid-auto-rows:max-content!important;
  align-content:start!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}
#caseList.scroll-list .list-card{
  min-height:94px!important;
  height:auto!important;
  align-self:start;
  padding:12px 13px;
}
#caseList.scroll-list .list-main{overflow:visible!important}
#caseList.scroll-list .list-sub,#caseList.scroll-list .list-address{white-space:normal!important;display:block!important;overflow:visible!important;line-height:1.32}
#caseList.scroll-list .list-meta{margin-top:4px;flex-wrap:wrap}

/* V24.19 — Alertas profesionales: sin pantalla intermedia y listas legibles con scroll. */
.professional-alert-detail{
  grid-template-rows:auto minmax(0,1fr)!important;
}
.alert-result-list{
  grid-template-rows:none!important;
  grid-auto-rows:max-content!important;
  align-content:start!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  min-height:0;
  padding-right:2px;
  -webkit-overflow-scrolling:touch;
}
.alert-result-list .alert-result-card{
  min-height:104px!important;
  height:auto!important;
  align-self:start;
  padding:12px 13px;
  align-items:start;
}
.alert-result-list .list-main{
  overflow:visible!important;
  min-width:0;
}
.alert-result-list .list-name{
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  line-height:1.25;
}
.alert-result-list .list-sub,
.alert-result-list .list-address{
  white-space:normal!important;
  display:block!important;
  overflow:visible!important;
  text-overflow:clip!important;
  line-height:1.32;
}
.alert-result-list .list-address{
  color:var(--muted);
  font-size:12px;
  font-weight:650;
}
.alert-result-list .list-meta{
  margin-top:5px;
  flex-wrap:wrap;
}
.alert-result-list .list-side-action{
  align-self:center;
}


/* V24.20 — Usuario > Intervenciones: “Todas” pagina por fecha y el día hace scroll. */
.interventions-view.is-date-paged{
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
}
.interventions-view.is-date-paged>.intervention-history-list{
  flex:1 1 auto!important;
  min-height:0!important;
  grid-template-rows:none!important;
  grid-auto-rows:max-content!important;
  align-content:start!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding-right:2px;
  -webkit-overflow-scrolling:touch;
}
.interventions-view.is-date-paged>.pager{flex:0 0 auto!important;margin-top:0}
