
:root{
  --bg:#f5f7f9;
  --card:#fff;
  --text:#19222c;
  --muted:#718091;
  --line:#e5eaf0;
  --green:#8dbd36;
  --green-dark:#6f9d22;
  --yellow:#f1d12c;
  --red:#e33d30;
  --blue:#4d78cc;
  --navy:#17212c;
  --shadow:0 12px 32px rgba(26,40,58,.08);
  --radius:24px;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
button,input,select{font:inherit}
button,a{touch-action:manipulation}
a{text-decoration:none;color:inherit}
img{max-width:100%}
.shell{min-height:100vh}
.topbar{
  min-height:72px;display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:10px 18px;background:rgba(255,255,255,.93);backdrop-filter:blur(14px);
  border-bottom:1px solid var(--line);position:sticky;top:0;z-index:50
}
.brand{display:flex;align-items:center;gap:12px;min-width:0}
.brand img{width:48px;height:48px;border-radius:15px;object-fit:contain;background:white}
.brand strong{display:block;font-size:16px;line-height:1.1}
.brand small{display:block;color:var(--muted);margin-top:3px;font-size:11px}
.top-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.btn{
  border:0;border-radius:16px;min-height:44px;padding:0 14px;font-weight:800;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;gap:8px
}
.btn-primary{background:linear-gradient(145deg,var(--blue),#315cae);color:white}
.btn-install{background:linear-gradient(145deg,var(--green),var(--green-dark));color:white}
.btn-green{background:linear-gradient(145deg,#93c93d,var(--green-dark));color:white}
.btn-red{background:linear-gradient(145deg,#ed5045,#cc3026);color:white}
.btn-dark{background:var(--navy);color:white}
.btn-soft{background:white;color:var(--text);box-shadow:0 6px 16px rgba(0,0,0,.05)}
.btn:disabled{opacity:.45;cursor:not-allowed}
.icon-btn{width:44px;height:44px;padding:0;border-radius:15px;background:white;border:0;box-shadow:0 6px 16px rgba(0,0,0,.05);display:grid;place-items:center}
.icon-btn svg,.btn svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.app-layout{display:grid;grid-template-columns:250px minmax(0,1fr);min-height:calc(100vh - 72px)}
.sidebar{
  padding:18px 14px;border-right:1px solid var(--line);background:#fff;position:sticky;top:72px;height:calc(100vh - 72px)
}
.side-title{font-size:11px;text-transform:uppercase;letter-spacing:.12em;color:#95a0ac;font-weight:900;margin:8px 10px 12px}
.nav-list{display:grid;gap:7px}
.nav-item{
  border:0;background:transparent;border-radius:16px;padding:13px 14px;text-align:left;font-weight:800;color:#4b5a6a;cursor:pointer;
  display:flex;align-items:center;gap:10px
}
.nav-item.active{background:#eef4e4;color:#557c18}
.nav-item svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.content{padding:22px;width:min(1180px,100%);margin:0 auto}
.content-view{display:none}.content-view.active{display:block}
.hero{max-width:620px;margin:4vh auto 0;text-align:center}
.hero-logo{width:92px;height:92px;margin:0 auto 16px;border-radius:28px;background:white;padding:9px;box-shadow:var(--shadow)}
.hero-logo img{width:100%;height:100%;object-fit:contain}
.eyebrow{display:inline-flex;align-items:center;gap:8px;background:white;border-radius:999px;padding:8px 12px;color:#607083;font-size:13px;font-weight:900;box-shadow:0 5px 16px rgba(0,0,0,.04)}
.dot{width:8px;height:8px;border-radius:50%;background:var(--green)}
h1{font-size:clamp(36px,7vw,58px);letter-spacing:-2px;line-height:1.02;margin:16px 0 8px}
.lead{color:var(--muted);font-size:18px;margin:0 0 22px}
.emergency-actions{display:grid;gap:14px}
.emergency-main{
  min-height:160px;border:0;border-radius:30px;color:white;font-weight:900;font-size:28px;cursor:pointer;
  display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;box-shadow:var(--shadow)
}
.emergency-main svg{width:36px;height:36px;fill:none;stroke:white;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.emergency-main.location{background:linear-gradient(145deg,var(--blue),#315cae)}
.emergency-main.call{background:linear-gradient(145deg,#ed5045,#cf3027)}
.emergency-main:disabled{opacity:.43;filter:grayscale(.2);box-shadow:none;cursor:not-allowed}
.secondary-number{display:grid;grid-template-columns:1fr;gap:10px;width:100%}
.secondary-number .btn{width:100%;min-height:54px}
.status-box{margin-top:14px;background:white;border-radius:20px;padding:14px;box-shadow:0 7px 18px rgba(0,0,0,.04);display:none}
.status-box.show{display:block}
.success{display:inline-flex;align-items:center;gap:7px;background:#edf8e4;color:#4f7d13;border-radius:999px;padding:8px 11px;font-weight:900;font-size:12px}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:#5d6b79;font-size:13px}
.caller-map-card{display:none;background:white;border-radius:24px;box-shadow:var(--shadow);overflow:hidden;margin-top:16px}
.caller-map-card.show{display:block}
.caller-map-head{padding:14px 16px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:10px}
.caller-map-head h3{margin:0;font-size:18px}
.caller-map-head p{margin:4px 0 0;color:var(--muted);font-size:13px}
.call-status-pill{display:inline-flex;align-items:center;gap:7px;border-radius:999px;padding:8px 11px;background:#eef4e4;color:#557c18;font-size:12px;font-weight:900}
.install-tip{font-size:12px;color:var(--muted);margin-top:4px}
.stacked-actions{display:grid;gap:12px}
.live-units-list{padding:14px;display:grid;gap:10px}
.auto-track-note{color:var(--muted);font-size:13px}
.full-top-action{width:100%;min-height:58px;border-radius:18px;font-size:18px}

.plan-tabs{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 16px}
.plan-tab{border:1px solid var(--line);background:white;color:#536171;border-radius:16px;min-height:46px;padding:0 15px;font-weight:800;cursor:pointer;box-shadow:0 5px 14px rgba(0,0,0,.035)}
.plan-tab.active{background:#eef4e4;color:#557c18;border-color:#dce8c7}
.plan-panel{display:none}
.plan-panel.active{display:block}
.plan-card{background:white;border-radius:24px;padding:20px;box-shadow:var(--shadow);margin-bottom:14px}
.plan-card h3{margin:0 0 14px;font-size:22px;letter-spacing:-.35px}
.plan-feature-list{display:grid;gap:11px;margin:0;padding:0;list-style:none}
.plan-feature-list li{position:relative;padding-left:27px;color:#4f5d6c;line-height:1.55}
.plan-feature-list li::before{content:"✓";position:absolute;left:0;top:0;color:var(--green-dark);font-weight:900}
.important-list{display:grid;gap:12px;margin:0;padding:0;list-style:none}
.important-list li{background:#fff8e1;border-left:4px solid var(--yellow);border-radius:12px;padding:13px 14px;color:#4d5660;line-height:1.55}
.plan-footer-note{margin-top:14px;padding:14px 16px;background:#eef4e4;border-radius:16px;color:#557c18;font-weight:800}
.section-title{margin:4px 0 18px}
.section-title h2{margin:0;font-size:32px;letter-spacing:-.9px}
.section-title p{margin:5px 0 0;color:var(--muted)}
.info-card{background:white;border-radius:24px;padding:20px;box-shadow:var(--shadow);margin-bottom:14px}
.info-card h3{margin:0 0 12px}
.info-card p,.info-card li{color:#4f5d6c;line-height:1.65}
.price-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.price-row{display:flex;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px dashed #dfe5eb}
.price-row:last-child{border-bottom:0}
.page{width:min(1220px,calc(100% - 24px));margin:0 auto;padding:20px 0 44px}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;margin-bottom:16px}
.page-head h1{font-size:34px;margin:0;letter-spacing:-1px}
.page-head p{margin:4px 0 0;color:var(--muted)}
.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}
select{min-height:44px;border:1px solid var(--line);border-radius:14px;background:white;padding:0 12px;font-weight:800;color:var(--text)}
.grid-main{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(330px,.7fr);gap:16px}
.panel{background:white;border-radius:26px;box-shadow:var(--shadow);overflow:hidden}
.panel-head{padding:15px 17px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:10px}
.panel-head h3{margin:0;font-size:18px}
.map{height:470px;width:100%}
.map-lg{height:560px;width:100%}
.map-footer{padding:12px 16px;border-top:1px solid var(--line);display:flex;flex-wrap:wrap;gap:8px}
.chip{display:inline-flex;align-items:center;gap:7px;border-radius:999px;padding:8px 10px;background:#f2f5f8;color:#586777;font-size:12px;font-weight:900}
.chip .dot{width:8px;height:8px}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}
.stat{background:white;border-radius:20px;padding:15px;box-shadow:0 7px 18px rgba(0,0,0,.04)}
.stat small{display:block;color:var(--muted);font-weight:800}.stat strong{display:block;font-size:28px;margin-top:4px}
.list{display:grid;gap:10px;padding:14px}
.card{border:1px solid var(--line);border-radius:20px;padding:14px}
.card-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.card h4{margin:0 0 5px;font-size:16px}
.meta{font-size:13px;color:var(--muted);line-height:1.45}
.badge{border-radius:999px;padding:7px 9px;font-weight:900;font-size:10px;white-space:nowrap}
.badge.NEW{background:#fff6dd;color:#8c5c00}.badge.EN_ROUTE{background:#e9f0ff;color:#2f5598}.badge.ON_SCENE{background:#e8f8ef;color:#116d45}.badge.CLOSED{background:#eef1f4;color:#65707d}
.card-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.card-actions .btn{min-height:40px;padding:0 11px;font-size:13px}
.history-table{width:100%;border-collapse:collapse}
.history-table th,.history-table td{padding:11px 12px;border-bottom:1px solid var(--line);text-align:left;font-size:13px}
.history-table th{color:#667482;background:#f8fafb;position:sticky;top:0}
.history-wrap{max-height:360px;overflow:auto}
.live-unit{padding:13px;border:1px solid var(--line);border-radius:17px;margin-bottom:9px}
.live-unit b{display:block;margin-bottom:4px}
.empty{padding:30px 18px;text-align:center;color:var(--muted)}
.ambulance-layout{display:grid;gap:14px}
.ambulance-map-card{background:white;border-radius:28px;box-shadow:var(--shadow);overflow:hidden}
.ambulance-map-head{padding:12px 15px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:10px}
.full-nav{min-height:72px;width:100%;border:0;border-radius:22px;background:var(--navy);color:white;font-size:21px;font-weight:900;display:flex;align-items:center;justify-content:center;gap:10px}
.full-nav svg{width:24px;height:24px;fill:none;stroke:white;stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round}
.action-row{display:grid;grid-template-columns:1fr auto;gap:10px}
.mobile-menu{display:none}
.toast{position:fixed;left:50%;bottom:20px;transform:translateX(-50%) translateY(16px);background:#17212c;color:white;padding:12px 15px;border-radius:14px;font-weight:800;opacity:0;pointer-events:none;transition:.2s;z-index:100}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
@media(max-width:950px){
  .grid-main{grid-template-columns:1fr}
  .price-grid{grid-template-columns:1fr}
}
@media(max-width:760px){
  .topbar{height:auto;min-height:68px}
  .brand small{display:none}
  .top-actions{margin-left:auto}
  .app-layout{grid-template-columns:1fr;min-height:0}
  .sidebar{position:fixed;left:0;top:0;bottom:0;width:280px;height:100vh;z-index:90;transform:translateX(-102%);transition:.22s;box-shadow:12px 0 28px rgba(0,0,0,.12);padding-top:82px}
  .sidebar.show{transform:translateX(0)}
  .mobile-menu{display:grid}
  .content{padding:16px}
  .hero{margin-top:2vh}
  .emergency-main{min-height:145px;font-size:27px}
  .secondary-number{grid-template-columns:1fr}
  .stats{grid-template-columns:1fr 1fr}
  .page-head{align-items:flex-start;flex-direction:column}
  .map{height:390px}.map-lg{height:440px}
  .action-row{grid-template-columns:1fr}
}

.plan-link-card{background:white;border-radius:22px;padding:18px;box-shadow:var(--shadow)}
.external-link-btn{display:inline-flex;align-items:center;gap:10px;padding:12px 16px;border-radius:16px;background:linear-gradient(145deg,var(--blue),#315cae);color:white;font-weight:800;margin-top:12px}
.modal-backdrop{position:fixed;inset:0;background:rgba(10,18,28,.42);backdrop-filter:blur(4px);display:none;align-items:center;justify-content:center;z-index:5000;padding:16px}
.modal-backdrop.show{display:flex}
.modal-card{position:relative;z-index:5001;width:min(420px,100%);background:white;border-radius:28px;padding:24px;box-shadow:0 18px 50px rgba(0,0,0,.18);text-align:center}
.modal-icon{width:76px;height:76px;border-radius:24px;display:grid;place-items:center;background:#eef4e4;color:#557c18;margin:0 auto 14px;font-size:38px}
.modal-card h3{margin:0 0 8px;font-size:28px;letter-spacing:-.8px}
.modal-card p{margin:0 0 18px;color:var(--muted);line-height:1.5}
.modal-actions{display:grid;gap:10px}
.map-note{font-size:13px;color:var(--muted)}
.leaflet-div-icon.ambulance-icon,.leaflet-div-icon.user-icon,.leaflet-div-icon.emergency-icon{background:transparent;border:0}
.marker-chip{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:white;box-shadow:0 8px 18px rgba(0,0,0,.18);font-size:20px;border:3px solid var(--blue)}
.marker-chip.user{border-color:var(--green)}
.marker-chip.emergency{border-color:var(--red)}
.event-type-badge{display:inline-flex;align-items:center;padding:6px 8px;border-radius:999px;background:#f2f5f8;color:#5a6877;font-size:11px;font-weight:900}

.faq-list{display:grid;gap:12px;max-width:980px}
.faq-item{background:white;border:1px solid var(--line);border-radius:18px;overflow:hidden;box-shadow:0 7px 18px rgba(0,0,0,.035)}
.faq-question{width:100%;min-height:64px;border:0;background:white;color:var(--text);padding:14px 18px;text-align:left;display:flex;align-items:center;justify-content:space-between;gap:16px;font-weight:900;font-size:16px;cursor:pointer}
.faq-question:hover{background:#fbfcfd}
.faq-chevron{width:28px;height:28px;border-radius:10px;display:grid;place-items:center;background:#eef4e4;color:#557c18;flex:0 0 auto;transition:.18s transform}
.faq-item.open .faq-chevron{transform:rotate(90deg)}
.faq-answer{display:none;padding:0 18px 18px;color:#536171;line-height:1.6}
.faq-item.open .faq-answer{display:block}
.central-status-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:16px}
.status-panel{background:white;border-radius:24px;box-shadow:var(--shadow);overflow:hidden;min-width:0}
.status-panel .panel-head{background:#fbfcfd}
.status-count{min-width:30px;height:30px;border-radius:999px;display:grid;place-items:center;background:#eef2f6;color:#536171;font-size:12px;font-weight:900}
.status-panel.pending .status-count{background:#fff6dd;color:#8c5c00}
.status-panel.attending .status-count{background:#e9f0ff;color:#2f5598}
.status-panel.done .status-count{background:#e8f8ef;color:#116d45}
.map-focus-flash{animation:mapFocus .75s ease}
@keyframes mapFocus{0%{box-shadow:0 0 0 0 rgba(77,120,204,.3)}50%{box-shadow:0 0 0 8px rgba(77,120,204,.12)}100%{box-shadow:var(--shadow)}}
.tracking-wait{background:#f4f6f8;color:#647181}
@media(max-width:980px){.central-status-grid{grid-template-columns:1fr}}

.timing-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:14px 0 18px}
.timing-card{background:white;border-radius:18px;padding:14px;box-shadow:0 7px 18px rgba(0,0,0,.04);border:1px solid var(--line)}
.timing-card small{display:block;color:var(--muted);font-weight:800;font-size:11px;text-transform:uppercase;letter-spacing:.04em}
.timing-card strong{display:block;margin-top:5px;font-size:17px;line-height:1.2}
.incident-times{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:12px}
.incident-time{background:#f7f9fb;border-radius:12px;padding:9px 10px;font-size:12px;color:#596777}
.incident-time b{display:block;color:var(--text);margin-top:3px;font-size:13px}
@media(max-width:900px){.timing-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.timing-grid{grid-template-columns:1fr 1fr}.incident-times{grid-template-columns:1fr}}

.admin-config-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.admin-box{border:1px solid var(--line);border-radius:20px;padding:16px;background:#fbfcfd;display:grid;gap:9px}
.admin-box h4{margin:0 0 4px;font-size:18px}
.field-label{font-size:12px;font-weight:900;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.admin-input{width:100%;min-height:44px;border:1px solid var(--line);border-radius:14px;background:white;padding:0 12px;font:inherit;color:var(--text)}
.unit-status-toggle{min-width:120px}
@media(max-width:760px){.admin-config-grid{grid-template-columns:1fr}}

.central-module-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 16px}
.central-module-tab{min-height:52px;border:1px solid var(--line);background:white;color:#566575;border-radius:17px;font:inherit;font-weight:900;cursor:pointer;box-shadow:0 6px 18px rgba(0,0,0,.035)}
.central-module-tab.active{background:linear-gradient(145deg,var(--blue),#315cae);color:white;border-color:transparent;box-shadow:0 10px 24px rgba(49,92,174,.18)}
.central-module-view{display:none}
.central-module-view.active{display:block}
.central-page{padding-top:10px}
@media(max-width:700px){.central-module-tabs{top:72px;gap:6px}.central-module-tab{min-height:46px;border-radius:14px;font-size:13px;padding:0 8px}}

.history-head-with-filter{align-items:flex-end;gap:16px;flex-wrap:wrap}
.history-filter-wrap{display:flex;align-items:center;gap:10px;margin-left:auto}
.history-filter-wrap label{font-size:12px;font-weight:900;color:#687788;text-transform:uppercase;letter-spacing:.04em}
.history-unit-filter{min-width:220px;width:auto;margin:0}
@media(max-width:700px){.history-filter-wrap{width:100%;margin-left:0;display:grid;gap:6px}.history-unit-filter{width:100%;min-width:0}}

.compact-head{margin-bottom:10px}
.ambulance-top-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.ambulance-action-btn,.ambulance-nav-btn{min-height:72px;width:100%;border-radius:22px;font-size:20px;font-weight:900}
.ambulance-nav-btn{margin:0}
@media (max-width:700px){
  .compact-head{display:none}
  .toolbar{margin-bottom:10px}
  .ambulance-top-actions{grid-template-columns:1fr 1fr;gap:10px}
  .ambulance-action-btn,.ambulance-nav-btn{min-height:112px;border-radius:20px;padding:12px;font-size:18px;line-height:1.1;text-align:center}
  .ambulance-nav-btn{flex-direction:column;gap:8px}
  .ambulance-nav-btn svg{width:28px;height:28px}
}

/* Ambulancia compacta */
.ambulance-page{padding-top:14px}
.ambulance-unit-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.unit-title-select{appearance:none;-webkit-appearance:none;border:0;background:transparent;color:var(--text);font-size:28px;font-weight:900;letter-spacing:-.6px;padding:4px 34px 4px 0;max-width:75%;cursor:pointer;background-image:linear-gradient(45deg,transparent 50%,#667380 50%),linear-gradient(135deg,#667380 50%,transparent 50%);background-position:calc(100% - 13px) 52%,calc(100% - 7px) 52%;background-size:6px 6px,6px 6px;background-repeat:no-repeat}
.ambulance-gps-state{flex:0 0 auto}
@media(max-width:720px){
  .ambulance-page{padding-top:10px}
  .ambulance-unit-head{align-items:flex-start;flex-direction:column;gap:5px;margin-bottom:10px}
  .unit-title-select{font-size:23px;max-width:100%;width:100%;padding:2px 34px 2px 0}
  .ambulance-gps-state{font-size:12px;padding:6px 10px}
}

/* Selección persistente de ambulancia */
.ambulance-unit-identity{display:flex;flex-direction:column;gap:6px;width:100%}
.ambulance-unit-title{font-size:28px;font-weight:900;letter-spacing:-.6px;line-height:1.08}
.ambulance-unit-subline{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.change-unit-btn{border:0;background:transparent;color:#667380;font:inherit;font-size:13px;font-weight:800;padding:4px 2px;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.unit-select-modal.show{display:flex}
.unit-select-card{text-align:left}
.unit-select-card .modal-icon,.unit-select-card h3,.unit-select-card>p{text-align:center}
.unit-modal-label{display:block;margin:6px 0 7px;color:#667380;font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.05em}
.unit-modal-select{width:100%;min-height:56px;border:1px solid var(--line);border-radius:16px;background:white;padding:0 14px;font:inherit;font-weight:800;margin-bottom:14px}
@media(max-width:700px){
  .ambulance-unit-title{font-size:22px}
  .ambulance-unit-subline{gap:8px}
  .change-unit-btn{font-size:12px}
}

.leaflet-container{z-index:1}
.unit-select-modal{z-index:5000!important}
.unit-select-card{z-index:5001!important}

.notification-optin-card{background:white;border:1px solid var(--line);border-radius:24px;padding:20px;display:grid;grid-template-columns:auto 1fr auto;gap:16px;align-items:center;box-shadow:var(--shadow)}
.notification-optin-icon{width:58px;height:58px;border-radius:18px;display:grid;place-items:center;background:#eef4e4;font-size:28px}
.notification-optin-copy h3{margin:0 0 6px}.notification-optin-copy p{margin:0;color:var(--muted);line-height:1.55}
.push-support-note{font-size:12px;color:var(--muted);margin-top:8px}.push-support-note.error{color:#b33a32}
.public-notifications-list{display:grid;gap:10px;padding:14px}.public-notification-item{border:1px solid var(--line);border-radius:16px;padding:14px;background:#fff}
.public-notification-item h4{margin:0 0 5px}.public-notification-item p{margin:0;color:var(--muted);line-height:1.5}.public-notification-meta{margin-top:8px;font-size:12px;color:#7c8996}
.push-admin-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.push-admin-card{background:#fff;border:1px solid var(--line);border-radius:20px;padding:18px}
.push-admin-card h4{margin:0 0 14px}.push-admin-card textarea{min-height:110px;resize:vertical}.push-admin-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}.push-admin-stat{font-size:36px;font-weight:950;margin:4px 0}.push-admin-muted{color:var(--muted);font-size:13px}
.notification-log{display:grid;gap:8px;margin-top:12px}.notification-log-row{border-top:1px solid var(--line);padding-top:10px}.notification-log-row b{display:block}.notification-log-row small{color:var(--muted)}
@media(max-width:760px){.notification-optin-card{grid-template-columns:auto 1fr}.notification-optin-card .btn{grid-column:1/-1;width:100%}.push-admin-grid{grid-template-columns:1fr}}

.btn-danger{background:#fff1ef;color:#c7372f;border:1px solid #f1c5c1}
.unit-row-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
.unit-edit-modal{text-align:left}
.unit-edit-modal h3{margin-bottom:18px}
.unit-edit-modal .field-label{display:block;margin-top:12px}
.unit-edit-actions{margin-top:18px}

.notifications-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:16px}
.notification-textarea{resize:vertical;min-height:120px;padding-top:14px}
.notification-ready-note{margin-top:10px;color:var(--muted);font-size:12px;line-height:1.45}
.notification-status-card{display:flex;align-items:flex-start;gap:12px;padding:15px;border:1px solid var(--line);border-radius:16px;background:#f8fafc}
.notification-status-card small{display:block;color:var(--muted);margin-top:4px;line-height:1.4}
.notification-status-dot{width:12px;height:12px;border-radius:50%;background:#f0a020;flex:0 0 auto;margin-top:4px;box-shadow:0 0 0 5px rgba(240,160,32,.12)}
.notification-preview{margin-top:16px;padding:18px;border-radius:18px;background:white;border:1px solid var(--line);box-shadow:0 8px 20px rgba(0,0,0,.04)}
.notification-preview-label{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:900;margin-bottom:10px}
.notification-preview strong{font-size:18px}
.notification-preview p{margin:8px 0 0;color:var(--muted);line-height:1.45}
@media(max-width:900px){.notifications-grid{grid-template-columns:1fr}}

@media(max-width:760px){.central-module-tabs{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.central-module-tab{min-height:52px}}

@media (max-width: 760px){
  .public-topbar{
    display:grid !important;
    grid-template-columns:auto 1fr auto;
    align-items:center;
    gap:10px;
  }
  .public-topbar .public-menu-left{
    display:grid !important;
    grid-column:1;
    grid-row:1;
  }
  .public-topbar .brand{
    grid-column:2;
    grid-row:1;
    min-width:0;
  }
  .public-topbar .top-actions{
    grid-column:3;
    grid-row:1;
    width:auto !important;
    justify-content:flex-end !important;
  }
}

/* ===== EMMA v22 ===== */
.auth-locked .shell{display:none!important}
.auth-gate{position:fixed;inset:0;z-index:2147483647;background:linear-gradient(160deg,#f7faf4,#eef4e4);display:none;align-items:center;justify-content:center;padding:18px}
.auth-locked .auth-gate{display:flex}
.auth-card{width:min(420px,100%);background:#fff;border-radius:28px;padding:26px;box-shadow:0 22px 65px rgba(31,45,61,.18)}
.auth-card .auth-logo{width:76px;height:76px;object-fit:contain;display:block;margin:0 auto 16px}
.auth-card h1{font-size:28px;margin:0 0 6px;text-align:center}
.auth-card>p{margin:0 0 20px;text-align:center;color:var(--muted)}
.auth-field{display:grid;gap:6px;margin-top:12px}
.auth-field span{font-size:12px;font-weight:900;color:#536171;text-transform:uppercase;letter-spacing:.5px}
.auth-field input{min-height:50px;border:1px solid var(--line);border-radius:15px;padding:0 14px;font:inherit}
.auth-pin{letter-spacing:8px;font-weight:900;font-size:20px}
.auth-error{min-height:20px;color:#c83f3f;font-size:13px;margin-top:10px;text-align:center}
.auth-submit{width:100%;margin-top:10px;min-height:50px;justify-content:center}
.logout-btn{white-space:nowrap}
.cooldown-note{font-size:13px;font-weight:800;color:#6e7a87;margin-top:8px;min-height:20px}
.notification-history-actions{display:flex;justify-content:center;padding-top:12px}
.export-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.export-status-card{margin-top:14px;padding:14px;border:1px solid var(--line);border-radius:16px;background:#f8fafb}
.btn-danger{background:linear-gradient(145deg,#e85c5c,#c83f3f)!important;color:#fff!important;border-color:transparent!important}
.archive-table td{vertical-align:middle}
@media(max-width:760px){
  .top-actions .logout-btn{padding:0 10px;font-size:12px}
  .auth-card{padding:20px;border-radius:22px}
}

/* ===== EMMA v24 - botones grandes Ambulancia ===== */
.ambulance-top-actions{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:12px!important;
  width:100%!important;
  align-items:stretch!important;
}
.ambulance-top-actions .ambulance-action-btn,
.ambulance-top-actions .ambulance-nav-btn{
  width:100%!important;
  min-width:0!important;
  min-height:96px!important;
  height:96px!important;
  border-radius:18px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  font-size:18px!important;
  font-weight:900!important;
  padding:12px!important;
}
.ambulance-top-actions .ambulance-nav-btn svg{
  width:28px!important;
  height:28px!important;
  margin-right:8px!important;
  flex:0 0 auto!important;
}
@media(max-width:760px){
  .ambulance-top-actions{
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
  }
  .ambulance-top-actions .ambulance-action-btn,
  .ambulance-top-actions .ambulance-nav-btn{
    min-height:96px!important;
    height:96px!important;
    font-size:15px!important;
    border-radius:16px!important;
    padding:10px 8px!important;
  }
}

/* ===== EMMA v25 - modernización usuario + primera acción ambulancia ===== */

/* Botones públicos */
.emergency-main{
  position:relative;
  overflow:hidden;
  isolation:isolate;
  border:1px solid rgba(255,255,255,.22)!important;
  box-shadow:
    0 18px 34px rgba(29,49,78,.13),
    inset 0 1px 0 rgba(255,255,255,.26)!important;
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.emergency-main::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  background:linear-gradient(180deg,rgba(255,255,255,.13),rgba(255,255,255,0) 45%);
  pointer-events:none;
}
.emergency-main:not(:disabled):hover{
  transform:translateY(-2px);
  box-shadow:
    0 22px 40px rgba(29,49,78,.18),
    inset 0 1px 0 rgba(255,255,255,.3)!important;
}
.emergency-main:not(:disabled):active{transform:translateY(1px) scale(.995)}
.emergency-main.location{
  background:linear-gradient(145deg,#6387ca 0%,#426dbd 55%,#315ba9 100%)!important;
}
.emergency-main.call{
  background:linear-gradient(145deg,#ff5a4e 0%,#e94035 55%,#cb2d26 100%)!important;
}
.emergency-icon-wrap{
  width:48px;height:48px;border-radius:16px;
  display:grid;place-items:center;
  background:rgba(255,255,255,.14);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18);
}
.emergency-icon-wrap svg{width:27px!important;height:27px!important}
.alt-call-btn{
  min-height:62px!important;
  border:0!important;
  border-radius:18px!important;
  background:linear-gradient(145deg,#f8d365,#eab53a)!important;
  color:#17212c!important;
  box-shadow:0 10px 22px rgba(190,139,22,.20)!important;
  font-weight:950!important;
  font-size:16px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:10px!important;
  transition:transform .18s ease, box-shadow .18s ease!important;
}
.alt-call-btn svg{
  width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round;
}
.alt-call-btn:not(:disabled):hover{transform:translateY(-1px);box-shadow:0 14px 28px rgba(190,139,22,.27)!important}
.alt-call-btn:disabled{opacity:.43;box-shadow:none!important}
.cooldown-note{padding:0 8px}

/* Tarjeta pendiente: Aceptar grande a la derecha */
.pending-emergency-card{
  grid-template-columns:minmax(0,1fr) minmax(150px,.95fr)!important;
  align-items:stretch!important;
  gap:9px!important;
}
.pending-emergency-info{
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:10px;
  min-width:0;
}
.pending-emergency-info .pending-map{
  width:100%;
  min-height:44px;
}
.pending-accept-large{
  width:100%!important;
  min-height:112px!important;
  height:100%!important;
  border-radius:16px!important;
  font-size:16px!important;
  font-weight:950!important;
  line-height:1.05!important;
  padding:12px!important;
  justify-content:center!important;
  text-align:center!important;
}

/* Antes de aceptar: Cómo llegar ocupa todo el ancho.
   Después de aceptar vuelve al 50/50 actual. */
.ambulance-top-actions.preview-mode{
  grid-template-columns:1fr!important;
}
.ambulance-top-actions.preview-mode .ambulance-nav-btn{
  grid-column:1 / -1!important;
  width:100%!important;
  min-height:100px!important;
}
@media(max-width:760px){
  .pending-emergency-card{
    grid-template-columns:minmax(0,1fr) minmax(145px,.95fr)!important;
  }
  .pending-accept-large{min-height:108px!important;font-size:15px!important}
  .ambulance-top-actions.preview-mode .ambulance-nav-btn{
    min-height:96px!important;
  }
  .alt-call-btn{min-height:60px!important}
}

/* ===== EMMA v26 fixes ===== */

/* Respeta el estado oculto definido por Ambulancia JS.
   Evita el botón verde vacío antes de aceptar. */
.ambulance-top-actions .ambulance-action-btn[style*="display:none"],
.ambulance-top-actions .ambulance-action-btn[style*="display: none"],
.ambulance-top-actions .ambulance-nav-btn[style*="display:none"],
.ambulance-top-actions .ambulance-nav-btn[style*="display: none"]{
  display:none!important;
}

/* En modo previo solo queda Cómo llegar y ocupa el 100%. */
.ambulance-top-actions.preview-mode{
  grid-template-columns:1fr!important;
}
.ambulance-top-actions.preview-mode .ambulance-nav-btn{
  grid-column:1/-1!important;
  width:100%!important;
}

/* Cuando no hay una emergencia activa, las llamadas se perciben claramente bloqueadas. */
#mainCall:disabled,
#altCall:disabled{
  cursor:not-allowed!important;
  filter:saturate(.45)!important;
  opacity:.48!important;
  box-shadow:none!important;
}

/* ===== EMMA v27 test/protection ===== */
.pending-map{
  border:2px solid #18222d!important;
  color:#18222d!important;
  background:#fff!important;
  font-weight:900!important;
  box-shadow:0 2px 0 rgba(24,34,45,.08)!important;
}
.pending-map:hover{
  background:#f5f7f8!important;
}

/* Reduce text selection on internal operational views */
body[data-required-role]{
  -webkit-user-select:none;
  user-select:none;
}
body[data-required-role] input,
body[data-required-role] textarea,
body[data-required-role] select{
  -webkit-user-select:text;
  user-select:text;
}

/* ===== EMMA v28 - destino de emergencia + recorrido con pines ===== */
.emma-emergency-pin-wrap{
  background:transparent!important;
  border:0!important;
}
.emma-emergency-pin{
  width:34px;
  height:34px;
  border-radius:50% 50% 50% 0;
  transform:rotate(-45deg);
  background:#e53935;
  border:3px solid #fff;
  box-shadow:0 4px 12px rgba(0,0,0,.32);
  display:grid;
  place-items:center;
}
.emma-emergency-pin span{
  display:block;
  transform:rotate(45deg);
  color:#fff;
  font-size:18px;
  line-height:1;
  font-weight:950;
}

.route-pins-modal{z-index:2400!important}
.route-pins-card{
  width:min(420px,calc(100vw - 32px));
  text-align:center;
}
.route-pins-card h3{margin:0 0 8px}
.route-pins-card p{margin:0 0 18px;color:var(--muted)}
.route-pins-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.route-pins-actions .btn{
  min-height:56px;
  justify-content:center;
}
.route-pins-cancel{
  width:100%;
  margin-top:10px;
  justify-content:center;
}

.route-history-pin-wrap{
  background:transparent!important;
  border:0!important;
}
.route-history-pin{
  width:13px;
  height:13px;
  border-radius:50%;
  background:#285da8;
  border:2px solid #fff;
  box-shadow:0 2px 6px rgba(0,0,0,.35);
}
.route-history-pin.start{background:#78ad2c}
.route-history-pin.end{background:#e53935}

/* ===== EMMA v35 - filtros por fecha en Históricos ===== */
.history-head-with-filter{align-items:flex-end!important;gap:12px!important}
.export-toolbar{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}
.history-filter-wrap{display:grid;gap:5px}
.history-filter-wrap label{font-size:11px;font-weight:900;color:#65727e;text-transform:uppercase;letter-spacing:.45px}
.history-date-filter{min-width:150px}
#clearHistoryFiltersBtn{min-height:44px}
@media(max-width:760px){
  .history-head-with-filter{align-items:stretch!important;flex-direction:column!important}
  .export-toolbar{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .export-toolbar #exportExcelBtn,
  .export-toolbar #clearHistoryFiltersBtn{grid-column:1/-1;width:100%;justify-content:center}
  .history-filter-wrap{min-width:0}
  .history-filter-wrap .admin-input{width:100%;min-width:0}
}

/* ===== EMMA v36 - Llamada de fijo ===== */
.landline-entry-wrap{
  margin:0 0 12px;
}
.landline-call-btn{
  width:100%!important;
  min-height:72px!important;
  border:2px solid #17212c!important;
  border-radius:18px!important;
  background:linear-gradient(145deg,#fff6dc,#ffe49a)!important;
  color:#17212c!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:13px!important;
  box-shadow:0 9px 20px rgba(111,83,18,.13)!important;
}
.landline-call-btn .landline-call-icon{
  width:44px;height:44px;border-radius:14px;
  display:grid;place-items:center;
  background:#17212c;color:#fff;
  font-size:25px;line-height:1;
}
.landline-call-btn>span:last-child{
  display:grid;text-align:left;gap:2px;
}
.landline-call-btn strong{
  font-size:17px;letter-spacing:.25px;
}
.landline-call-btn small{
  font-size:12px;font-weight:750;opacity:.72;
}
.landline-call-btn:disabled{
  opacity:.42!important;
  filter:grayscale(.3);
  box-shadow:none!important;
}

.landline-modal{
  z-index:2147483645!important;
  padding:10px!important;
}
.landline-modal.show{display:flex!important}
.landline-modal-card{
  width:min(1050px,calc(100vw - 20px));
  max-height:calc(100dvh - 20px);
  overflow:auto;
  background:#fff;
  border-radius:24px;
  padding:16px;
  box-shadow:0 25px 80px rgba(12,26,42,.28);
  position:relative;
  z-index:2147483647!important;
}
.landline-modal-head{
  display:flex;align-items:flex-start;justify-content:space-between;gap:16px;
  margin-bottom:12px;
}
.landline-modal-head h3{margin:2px 0 4px;font-size:24px}
.landline-modal-head p{margin:0;color:var(--muted)}
.landline-kicker{
  font-size:11px;font-weight:950;letter-spacing:.8px;color:#a36f00;
}
.landline-close-btn{
  width:42px;height:42px;border:0;border-radius:14px;
  background:#edf1f4;color:#17212c;
  font-size:28px;line-height:1;cursor:pointer;
}
.landline-search-row{
  display:grid;grid-template-columns:1fr auto;gap:8px;margin-bottom:8px;
}
.landline-search-box{
  min-height:50px;border:2px solid #d5dde3;border-radius:15px;
  display:flex;align-items:center;gap:9px;padding:0 12px;background:#fff;
}
.landline-search-box:focus-within{border-color:#17212c}
.landline-search-box svg{
  width:21px;height:21px;fill:none;stroke:#52606d;stroke-width:2;
}
.landline-search-box input{
  border:0;outline:0;width:100%;font:inherit;background:transparent;
}
.landline-search-btn{min-width:110px;justify-content:center}
.landline-search-results{
  display:grid;gap:6px;margin-bottom:8px;
}
.landline-result-item{
  border:1px solid var(--line);border-radius:12px;background:#fff;
  padding:9px 11px;text-align:left;cursor:pointer;
}
.landline-result-item:hover{border-color:#17212c;background:#f7f9fa}
.landline-result-item strong,.landline-result-item small{display:block}
.landline-result-item small{margin-top:2px;color:var(--muted);font-size:11px}
.landline-searching{
  padding:9px 12px;border-radius:11px;background:#f5f7f8;
  font-size:12px;color:var(--muted);
}

.landline-map-wrap{
  position:relative;border:1px solid var(--line);border-radius:18px;overflow:hidden;
}
.landline-map{
  width:100%;
  height:min(55vh,520px);
  min-height:360px;
  z-index:0!important;
}
.landline-map-help{
  position:absolute;z-index:500;left:50%;bottom:12px;transform:translateX(-50%);
  background:rgba(23,33,44,.92);color:#fff;
  border-radius:999px;padding:7px 13px;
  font-size:12px;font-weight:900;white-space:nowrap;
  pointer-events:none;
}
.landline-selected-card{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:12px 13px;margin-top:10px;border:1px solid var(--line);
  border-radius:15px;background:#f8fafb;
}
.landline-selected-card>div{display:grid;gap:3px;min-width:0}
.landline-selected-card small{font-size:10px;font-weight:950;color:#677581}
.landline-selected-card strong{font-size:13px;overflow-wrap:anywhere}
.landline-selected-card .chip.success{
  background:#e9f5dc;color:#44720d;
}
.landline-reference-field{
  display:grid;gap:6px;margin-top:10px;
}
.landline-reference-field span{
  font-size:11px;font-weight:950;color:#65727e;text-transform:uppercase;
}
.landline-reference-field input{
  min-height:48px;border:1px solid var(--line);border-radius:14px;
  padding:0 12px;font:inherit;
}
.landline-modal-actions{
  display:grid;grid-template-columns:1fr 1.4fr;gap:9px;margin-top:12px;
}
.landline-modal-actions .btn{
  min-height:56px;justify-content:center;font-size:15px;font-weight:950;
}

.landline-pin-wrap{background:transparent!important;border:0!important}
.landline-pin{
  width:35px;height:35px;border-radius:50% 50% 50% 0;
  transform:rotate(-45deg);
  background:#e53935;border:3px solid #fff;
  box-shadow:0 4px 12px rgba(0,0,0,.32);
  display:grid;place-items:center;
}
.landline-pin span{
  transform:rotate(45deg);color:#fff;font-size:18px;font-weight:950;
}

@media(max-width:760px){
  .landline-call-btn{min-height:68px!important}
  .landline-modal{padding:0!important;align-items:stretch!important}
  .landline-modal-card{
    width:100vw;max-height:100dvh;min-height:100dvh;
    border-radius:0;padding:12px;
  }
  .landline-modal-head h3{font-size:20px}
  .landline-modal-head p{font-size:12px}
  .landline-search-row{grid-template-columns:1fr}
  .landline-search-btn{width:100%}
  .landline-map{height:48vh;min-height:330px}
  .landline-map-help{font-size:11px}
  .landline-modal-actions{
    position:sticky;bottom:-12px;background:#fff;
    padding:10px 0 12px;margin-top:10px;
  }
}

/* ===== EMMA v37 - Origen de emergencia ===== */
.source-badge{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:3px 8px;
  border-radius:999px;
  font-size:10px;
  font-weight:950;
  letter-spacing:.25px;
  white-space:nowrap;
  vertical-align:middle;
}
.source-badge.APP{
  background:#e8f1ff;
  color:#315f9e;
  border:1px solid #c8dcfa;
}
.source-badge.LANDLINE{
  background:#fff0c8;
  color:#875b00;
  border:1px solid #e7c86e;
}

/* ===== EMMA v39 - menú móvil con cierre visible ===== */
.menu-overlay{display:none;}

@media(max-width:760px){
  body.menu-open{overflow:hidden!important;}

  #mobileMenu{
    position:relative!important;
    z-index:3005!important;
    flex:0 0 auto!important;
  }

  #mobileMenu.open{
    position:fixed!important;
    top:calc(env(safe-area-inset-top, 0px) + 12px)!important;
    left:12px!important;
    width:44px!important;
    height:44px!important;
    border-radius:14px!important;
    background:#fff!important;
    box-shadow:0 8px 28px rgba(20,31,43,.18)!important;
  }

  #mobileMenu.open svg,
  #mobileMenu.open span{
    opacity:0!important;
  }

  #mobileMenu.open::before,
  #mobileMenu.open::after{
    content:"";
    position:absolute;
    left:11px;
    top:21px;
    width:22px;
    height:2.5px;
    border-radius:999px;
    background:#17212c;
    opacity:1!important;
  }

  #mobileMenu.open::before{transform:rotate(45deg)}
  #mobileMenu.open::after{transform:rotate(-45deg)}

  #sidebar{z-index:3000!important;}

  .menu-overlay{
    display:block;
    position:fixed;
    inset:0;
    z-index:2990;
    background:rgba(15,25,35,.32);
    opacity:0;
    pointer-events:none;
    transition:opacity .18s ease;
  }

  .menu-overlay.show{
    opacity:1;
    pointer-events:auto;
  }
}

/* ===== EMMA v40 - cierre garantizado dentro del menú móvil ===== */
.sidebar-close-btn{
  display:none;
}

@media(max-width:760px){
  /* El botón vive dentro del sidebar, por lo que nunca queda detrás del panel. */
  .sidebar-close-btn{
    display:grid!important;
    position:absolute!important;
    top:14px!important;
    left:14px!important;
    width:44px!important;
    height:44px!important;
    border-radius:14px!important;
    z-index:10!important;
    background:#fff!important;
    color:#17212c!important;
    box-shadow:0 6px 18px rgba(20,31,43,.13)!important;
  }

  .sidebar-close-btn svg{
    width:22px!important;
    height:22px!important;
    fill:none!important;
    stroke:currentColor!important;
    stroke-width:2.3!important;
    stroke-linecap:round!important;
    stroke-linejoin:round!important;
  }

  /* Más espacio arriba para que Información no choque con el botón. */
  #sidebar{
    padding-top:74px!important;
  }

  /* El hamburguesa del header puede quedar oculto mientras el panel está abierto:
     usamos el que está dentro del menú, que es siempre accesible. */
  body.menu-open .public-topbar #mobileMenu{
    visibility:hidden!important;
  }
}

/* ===== EMMA v41 - botón ACEPTAR EMERGENCIA más visible ===== */
.pending-accept-large{
  font-size:32px!important;
  font-weight:900!important;
  line-height:1.05!important;
  letter-spacing:.4px!important;
  text-transform:uppercase!important;
}

@media(max-width:760px){
  .pending-accept-large{
    font-size:clamp(16px,4.4vw,20px)!important;
    line-height:1.15!important;
    min-width:0;
    white-space:normal;
    overflow-wrap:anywhere;
  }
}


/* ===== EMMA v42 - Tus datos obligatorios ===== */
.user-data-card{max-width:760px}
.user-data-card .form-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.user-data-card .field,
.user-data-modal-card .field{display:flex;flex-direction:column;gap:7px;text-align:left;margin-bottom:14px}
.user-data-card .field span,
.user-data-modal-card .field span{font-weight:700;color:var(--ink,#17324d)}
.user-data-card input,
.user-data-modal-card input{
  width:100%;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:12px;
  min-height:48px;padding:11px 13px;font:inherit;background:#fff;color:#172033;outline:none
}
.user-data-card input:focus,
.user-data-modal-card input:focus{border-color:#4d78cc;box-shadow:0 0 0 3px rgba(77,120,204,.12)}
.user-data-help{margin:2px 0 16px;color:#64748b;font-size:.92rem}
.user-data-modal-card{max-width:520px}
.user-data-modal-card>p{margin-bottom:18px}
.user-data-modal-icon{background:#eef5ff}
.user-data-save-btn{width:100%;justify-content:center;margin-top:4px}
.user-data-error{min-height:21px;color:#b42318;font-size:.9rem;margin:-4px 0 8px;text-align:left}
.user-data-required-modal{z-index:3000}
body.user-data-required-open{overflow:hidden}
body.user-data-required-open .user-data-required-modal{pointer-events:auto}

@media(max-width:700px){
  .user-data-card .form-grid{grid-template-columns:1fr}
  .user-data-modal-card{width:calc(100% - 28px);max-width:none}
}


/* ===== EMMA v43 - Vía pública / Domicilio ===== */
.incident-place-modal{z-index:3200}
.incident-place-modal-card{max-width:560px}
.incident-place-modal-card>p{margin:4px 0 18px;color:#64748b}
.incident-place-modal-options{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.incident-place-choice{
  min-height:112px;border:2px solid #d8e0ea;border-radius:16px;background:#fff;
  padding:18px 14px;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:7px;cursor:pointer;font:inherit;color:#17324d
}
.incident-place-choice strong{font-size:21px;font-weight:900}
.incident-place-choice small{font-size:12px;color:#64748b;line-height:1.3}
.incident-place-choice:hover{border-color:#4d78cc;background:#f6f9ff}
.incident-place-cancel{width:100%;justify-content:center;margin-top:14px}

.incident-place-block{
  margin:14px 0 6px;padding:14px;border:1px solid var(--line);border-radius:14px;background:#f8fafc
}
.incident-place-label{display:block;font-weight:900;color:#64748b;margin-bottom:9px;letter-spacing:.35px}
.incident-place-options{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.incident-place-btn{
  min-height:48px;border:2px solid #d6dee8;border-radius:12px;background:#fff;
  font-weight:900;color:#17324d;cursor:pointer
}
.incident-place-btn.selected{border-color:#4d78cc;background:#eaf1ff;color:#214f9c}

@media(max-width:600px){
  .incident-place-modal-options{grid-template-columns:1fr}
  .incident-place-choice{min-height:88px}
}


/* ===== AmbuApp v44 - limpieza de menú / Acerca de ===== */
.ambuapp-about-link{
  margin-top:10px;
  border-top:1px solid rgba(148,163,184,.28);
  padding-top:15px;
  text-decoration:none;
}
.ambuapp-about-link:hover{text-decoration:none}

.ambuapp-footer-credit{
  position:fixed;
  right:14px;
  bottom:9px;
  z-index:20;
  font-size:11px;
  color:#94a3b8;
  background:rgba(255,255,255,.88);
  padding:4px 7px;
  border-radius:7px;
  pointer-events:none;
}

@media(max-width:760px){
  .ambuapp-footer-credit{
    position:static;
    text-align:center;
    margin:18px 0 10px;
    background:transparent;
  }
}


/* ===== AmbuApp v45 - cuentas individuales de ambulancia ===== */
.admin-help{
  font-size:12px;
  line-height:1.4;
  color:#64748b;
  margin:-4px 0 12px;
}
.muted-inline{font-weight:400;color:#94a3b8;font-size:12px}


/* ===== AmbuApp v50 - selector, salida y contenido por prestador ===== */
.provider-selector-card{max-width:620px}
.provider-selector-card>p{color:#64748b;margin-top:4px}
.provider-selector-list{display:grid;gap:14px;margin-top:16px}
.provider-locality-group{border:1px solid #e2e8f0;border-radius:14px;padding:14px;text-align:left}
.provider-locality-group>strong{display:block;margin-bottom:10px}
.provider-buttons{display:flex;gap:8px;flex-wrap:wrap}
.provider-custom-content{white-space:normal;line-height:1.65}
#publicExitBtn{white-space:nowrap}
@media(max-width:600px){
  .provider-buttons{display:grid;grid-template-columns:1fr}
  .provider-buttons .btn{width:100%}
}


/* ===== AmbuApp v51 - actualización obligatoria ===== */
.app-update-modal{
  z-index:99999!important;
  background:rgba(15,23,42,.72)!important;
}
.app-update-modal.show{
  display:flex!important;
  pointer-events:auto!important;
}
.app-update-card{
  max-width:480px;
  text-align:center;
  padding:28px!important;
}
.app-update-icon{
  width:70px;
  height:70px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin:0 auto 14px;
  background:#eef5ff;
  color:#3167c6;
  font-size:40px;
  font-weight:900;
}
.app-update-card h3{
  font-size:25px;
  margin:0 0 9px;
}
.app-update-card p{
  color:#64748b;
  line-height:1.5;
  margin:0 0 20px;
}
.app-update-btn{
  width:100%;
  min-height:54px;
  justify-content:center;
  font-size:18px;
  font-weight:900;
}
body.app-update-required{
  overflow:hidden!important;
}


/* ===== Emergencia Local v59 - instalación pública obligatoria ===== */
.mandatory-install-modal{
  z-index:99990!important;
  background:rgba(15,23,42,.74)!important;
}
.mandatory-install-modal.show{
  display:flex!important;
  pointer-events:auto!important;
}
.mandatory-install-card{
  max-width:480px;
  text-align:center;
  padding:28px!important;
}
.mandatory-install-icon{
  width:96px;
  height:96px;
  object-fit:contain;
  border-radius:22px;
  margin:0 auto 14px;
  background:#fff;
}
.mandatory-install-card h3{font-size:27px;margin:0 0 9px}
.mandatory-install-card p{color:#64748b;line-height:1.5;margin:0 0 20px}
.mandatory-install-card small{display:block;color:#94a3b8;margin-top:12px}
.mandatory-install-btn{
  width:100%;
  min-height:56px;
  justify-content:center;
  font-size:18px;
  font-weight:900;
}
body.mandatory-install-required{overflow:hidden!important}
.pwa-update-banner{position:fixed;right:16px;bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:1200;width:min(360px,calc(100vw - 32px));box-sizing:border-box;padding:18px;background:#fff;color:#182b3b;border:1px solid #dfe7ee;border-radius:18px;box-shadow:0 8px 30px #182b3b26;font-family:inherit}
.pwa-update-banner>strong{display:block;font-size:16px;line-height:1.4}
.pwa-update-banner>p{margin:6px 0 14px;font-size:14px;line-height:1.5;color:#536777}
.pwa-update-actions{display:flex;gap:10px;flex-wrap:wrap}
.pwa-update-actions .btn{flex:1;min-height:44px;padding:10px 14px;font-size:14px}
.pwa-update-actions .btn:disabled{opacity:.65;cursor:wait}

/* Ambulancia móvil: mantener las acciones de cabecera juntas. */
@media(max-width:760px){
  body[data-required-role="ambulance"] .topbar{
    flex-wrap:wrap;
    gap:8px;
    padding:10px 12px;
  }
  body[data-required-role="ambulance"] .topbar .brand{
    flex:1 1 180px;
    overflow-wrap:anywhere;
  }
  body[data-required-role="ambulance"] .topbar .top-actions{
    flex:0 0 auto;
    flex-wrap:nowrap;
    gap:8px;
    margin-left:auto;
  }
  body[data-required-role="ambulance"] .topbar .top-actions .btn{
    padding:0 10px;
    font-size:14px;
    min-height:44px;
    white-space:nowrap;
  }
}

/* Instalación pública junto a Salir, sin comprimir nombre ni menú. */
@media(max-width:760px){
  .public-topbar .brand{grid-column:2 / 4;}
  .public-topbar .top-actions{
    grid-column:2 / 4;
    grid-row:2;
    flex-wrap:nowrap;
    gap:8px;
  }
  .public-topbar .top-actions .btn{font-size:14px;white-space:nowrap;min-height:44px;}
}

@media(max-width:760px){
 body.install-actions-hidden .public-topbar .brand{grid-column:2;grid-row:1;}
 body.install-actions-hidden .public-topbar .top-actions{grid-column:3;grid-row:1;}
}

.availability-notice{margin:8px 0;padding:14px 16px;border-radius:14px;background:#fff6dd;color:#664600;font-size:16px;line-height:1.45;text-align:left;}
.availability-notice[hidden]{display:none;}

.delay-actions{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0;}
.delay-actions .btn{white-space:normal;line-height:1.3;padding:12px;min-height:48px;flex:1 1 160px;}
.delay-status{padding:10px;border-radius:12px;background:#fff6dd;color:#664600;line-height:1.4;}
.pending-emergency-card>.pending-emergency-info{grid-column:1;grid-row:1;}
.pending-emergency-card>.pending-accept{grid-column:2;grid-row:1;}
.pending-emergency-card>.pending-delay,.pending-emergency-card>.delay-status{grid-column:1 / -1;}
#requestDelayNotice[hidden]{display:none;}

.badge.PAUSED{background:#fff0c2;color:#694b00}.badge.RETURNING{background:#e3efff;color:#234e8a}
#pausedAttentionPanel[hidden],#pauseAttentionBtn[hidden]{display:none;}

/* Señal visible sin destellos rápidos; se detiene al enviar o bloquear el botón. */
@keyframes locationAttentionPulse{0%,100%{transform:scale(1);filter:brightness(1);outline-color:transparent}50%{transform:scale(1.035);filter:brightness(1.4);outline-color:#234e8a}}
#sendLocation.location-attention:not(:disabled){outline:4px solid transparent;outline-offset:4px;animation:locationAttentionPulse 1.4s ease-in-out infinite;}
@media(prefers-reduced-motion:reduce){#sendLocation.location-attention:not(:disabled){animation:none;outline-color:#234e8a;}}

.app-version{display:block;margin-top:6px;font-size:11px;font-weight:400;opacity:.75;}

/* Separación clara de los dos pasos, también con el pulso activo. */
.emergency-actions{gap:16px;}
.emergency-step{display:flex;align-items:center;gap:10px;text-align:left;font-size:15px;font-weight:700;color:#44546a;}
.emergency-step span{display:grid;place-items:center;flex:0 0 30px;height:30px;border-radius:50%;background:#e6edf6;color:#28559c;font-size:14px;}
.emergency-step.location-step{margin-top:22px;padding-top:22px;border-top:1px solid #dce4ee;}
#sendLocation{margin:4px 0 8px;}
.emergency-actions .cooldown-note{font-size:14px;line-height:1.5;}
#pwaUpdateMessage:empty{display:none;}

/* Inicio compacto: mantiene tamaño táctil y permite crecer con avisos activos. */
#view-inicio .hero{margin-top:8px;}
#view-inicio h1{font-size:clamp(20px,6vw,32px);letter-spacing:-.8px;line-height:1.2;margin:6px 0 10px;}
#view-inicio .lead{font-size:15px;line-height:1.4;margin-bottom:16px;}
#view-inicio .emergency-actions{gap:12px;}
#view-inicio .emergency-main{min-height:110px;min-height:clamp(88px,16svh,125px);font-size:clamp(21px,5.8vw,28px);border-radius:24px;gap:8px;padding:12px;}
#view-inicio .emergency-main svg{width:30px;height:30px;}
#view-inicio .emergency-step{font-size:14px;}
#view-inicio .emergency-step span{flex-basis:26px;height:26px;font-size:13px;}
#view-inicio .location-step{margin-top:8px;padding-top:14px;}
#view-inicio .secondary-number .btn{min-height:48px;}
#locationCooldownNote:empty{display:none;}
@media(max-width:760px){
 body:has(#view-inicio.active) .content{padding-top:10px;padding-bottom:8px;}
 body:has(#view-inicio.active) .ambuapp-footer-credit{margin-top:8px;}
}

/* Inicio ocupa la altura disponible, sin empujar la firma fuera de pantalla. */
body:has(#view-inicio.active) .shell{display:flex;flex-direction:column;min-height:100svh;}
body:has(#view-inicio.active) .app-layout{min-height:0;flex:1;}
#view-inicio .hero{margin-top:clamp(16px,3svh,28px);}
#view-inicio h1{font-size:clamp(23px,6.8vw,36px);letter-spacing:-1px;}
body:has(#view-inicio.active) .ambuapp-footer-credit{position:static;text-align:center;margin:8px 0;padding-bottom:env(safe-area-inset-bottom,0px);background:transparent;}
@media(max-height:700px){#view-inicio .hero{margin-top:10px;}#view-inicio .emergency-actions{gap:9px;}#view-inicio .location-step{margin-top:4px;padding-top:10px;}}

/* Espacio entre título y acciones, aun sin texto secundario. */
.pwa-update-banner>strong{margin:2px 0 16px;padding-right:4px;}
.pwa-update-banner{padding:20px;}

#sendLocation[hidden],.location-step[hidden],#publicCancellation[hidden]{display:none!important;}
.cancellation-panel{margin:12px 0;padding:12px;border:1px solid #dce4ee;border-radius:16px;background:#fff;}
.cancellation-panel:empty{display:none;}
.cancellation-alert{padding:12px;border-radius:12px;background:#fff1c2;color:#654900;font-weight:700;}
.badge.CANCELLED{background:#f4e4e4;color:#8a3030;}

/* Inicio ciudadano: la firma forma parte del alto disponible, no queda fuera del shell. */
.public-app .ambuapp-footer-credit{position:static;text-align:center;margin:0;padding:8px 12px calc(8px + env(safe-area-inset-bottom,0px));background:transparent;flex:none;line-height:1.35;}
.public-app .app-version{margin-top:3px;}
.public-app .public-topbar{flex:none;}
@media(max-width:760px){
 .public-app .public-topbar{grid-template-columns:44px minmax(0,1fr) auto;gap:8px;padding:10px 12px;}
 .public-app .public-topbar .brand{grid-column:2;grid-row:1;gap:8px;}
 .public-app .public-topbar .brand img{width:36px;height:36px;border-radius:10px;}
 .public-app .public-topbar .brand strong{font-size:clamp(13px,3.7vw,16px);overflow-wrap:anywhere;}
 .public-app .public-topbar .top-actions{grid-column:3;grid-row:1;}
 .public-app .public-topbar .top-actions .btn{padding:0 10px;font-size:12px;}
 .public-app .public-topbar .top-actions:has([data-install-app][style*="display: none"]),
 .public-app.install-actions-hidden .public-topbar .top-actions{display:none;}
 .public-app .public-topbar:has(.top-actions [data-install-app][style*="display: none"]),
 .public-app.install-actions-hidden .public-topbar{grid-template-columns:44px minmax(0,1fr);}
}
/* El ajuste de una pantalla se aplica al inicio sin seguimiento ni avisos adicionales.
   Nunca se recortan errores, mapas o contenido cuando se amplía el texto. */
body.public-app:has(#view-inicio.active):not(:has(.caller-map-card.show)):not(:has(#locationCooldownNote:not(:empty))) .shell{height:100dvh;min-height:480px;}
body.public-app:has(#view-inicio.active):not(:has(.caller-map-card.show)):not(:has(#locationCooldownNote:not(:empty))) .app-layout{flex:1;min-height:0;}
body.public-app:has(#view-inicio.active):not(:has(.caller-map-card.show)):not(:has(#locationCooldownNote:not(:empty))) .content{display:flex;flex-direction:column;padding:clamp(10px,2dvh,20px) 16px 8px;min-height:0;}
body.public-app:has(#view-inicio.active):not(:has(.caller-map-card.show)):not(:has(#locationCooldownNote:not(:empty))) #view-inicio{flex:1;display:flex;flex-direction:column;min-height:0;}
body.public-app:has(#view-inicio.active):not(:has(.caller-map-card.show)):not(:has(#locationCooldownNote:not(:empty))) #view-inicio .hero{width:100%;margin:0 auto;flex:1;display:flex;flex-direction:column;min-height:0;}
body.public-app:has(#view-inicio.active) .ambuapp-footer-credit{margin:0;}
#view-inicio h1{margin:clamp(8px,2dvh,18px) 0 10px;font-size:clamp(23px,6.5vw,36px);}
#view-inicio .lead{margin:0 0 clamp(10px,2dvh,18px);font-size:clamp(12px,3.8vw,15px);}
body.public-app:has(#view-inicio.active):not(:has(.caller-map-card.show)):not(:has(#locationCooldownNote:not(:empty))) .emergency-actions{flex:1;min-height:0;max-height:466px;display:grid;grid-template-rows:26px minmax(70px,1fr) clamp(44px,8dvh,60px) 32px minmax(70px,1fr);gap:10px;}
#view-inicio .emergency-step{font-size:clamp(12px,3.7vw,14px);}
body.public-app:has(#view-inicio.active):not(:has(.caller-map-card.show)):not(:has(#locationCooldownNote:not(:empty))) #view-inicio .emergency-main{min-height:0;height:100%;max-height:150px;padding:10px;gap:6px;}
body.public-app:has(#view-inicio.active):not(:has(.caller-map-card.show)):not(:has(#locationCooldownNote:not(:empty))) #view-inicio .location-step{margin:0;padding-top:6px;}
body.public-app:has(#view-inicio.active):not(:has(.caller-map-card.show)):not(:has(#locationCooldownNote:not(:empty))) #sendLocation{margin:0;}
#view-inicio .secondary-number .btn{min-height:44px!important;height:100%;}
@media(min-width:761px){.public-app .sidebar{height:calc(100dvh - 120px);overflow-y:auto;}}
@media(max-height:600px){
 #view-inicio h1{margin:6px 0;font-size:clamp(22px,6vw,28px);}
 #view-inicio .lead{margin-bottom:8px;}
 #view-inicio .emergency-main{font-size:22px;}
 #view-inicio .emergency-main svg{width:24px;height:24px;}
}

/* 60.26: layout explícito sobre el viewport visible, con pie dentro de la grilla. */
body.public-app.home-fit .shell{display:grid!important;grid-template-rows:auto minmax(0,1fr) auto;height:var(--public-viewport,100dvh)!important;min-height:460px!important;}
body.public-app.home-fit .app-layout{height:100%;min-height:0!important;}
body.public-app.home-fit .content{height:100%;min-height:0;padding:8px 16px!important;display:flex;flex-direction:column;}
body.public-app.home-fit #view-inicio{height:100%;min-height:0;display:flex;flex-direction:column;}
body.public-app.home-fit #view-inicio .hero{display:grid!important;grid-template-rows:auto auto minmax(0,1fr);width:100%;height:100%;min-height:0;margin:0 auto!important;}
body.public-app.home-fit #view-inicio .emergency-actions{min-height:0;max-height:480px;grid-template-rows:24px minmax(64px,1fr) clamp(44px,7dvh,56px) 30px minmax(64px,1fr);gap:10px;}
body.public-app.home-fit .ambuapp-footer-credit{padding:5px 10px calc(5px + env(safe-area-inset-bottom,0px))!important;line-height:1.2;font-size:10px;}
body.public-app.home-fit .app-version{margin-top:2px;font-size:10px;}
.public-app .public-topbar .top-actions{display:flex!important;}
@media(max-width:760px){
 .public-app .public-topbar,.public-app.install-actions-hidden .public-topbar,.public-app .public-topbar:has(.top-actions [data-install-app][style*="display: none"]){grid-template-columns:44px minmax(0,1fr) auto;}
 .public-app .public-topbar .top-actions{gap:5px;}
 .public-app .public-topbar .top-actions .btn{font-size:11px;padding:0 8px;}
 .public-app .public-topbar .brand img{width:30px;height:30px;}
 .public-app .public-topbar .brand strong{font-size:13px;}
}
@media(max-width:370px){.public-app .public-topbar .brand img{display:none;}}
