:root{
 --verde:#174f37; --verde2:#216a4b; --verde3:#0f3f2b; --amarillo:#d8bd43; --fondo:#f2f5f3;
 --borde:#d6dfd9; --texto:#1e2923; --gris:#66736c; --rojo:#a52a22; --verde-ok:#17613a;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:Arial,Helvetica,sans-serif;background:var(--fondo);color:var(--texto);min-height:100vh}
.header{background:linear-gradient(135deg,var(--verde),var(--verde2));color:white;border-bottom:4px solid var(--amarillo)}
.head-inner{max-width:1050px;margin:auto;padding:20px 15px;display:flex;gap:14px;align-items:center}
.head-copy{min-width:0}
.logo-button{width:70px;height:70px;padding:0;border:0;background:transparent;display:grid;place-items:center;cursor:pointer;flex:0 0 auto;border-radius:16px;-webkit-tap-highlight-color:transparent}
.institution-logo{width:68px;height:68px;object-fit:contain;filter:drop-shadow(0 2px 3px rgba(0,0,0,.15))}
.shield{width:62px;height:62px;border:2px solid white;border-radius:14px;display:grid;place-items:center;font-size:22px;font-weight:800}
.unit{font-size:12px;font-weight:700;letter-spacing:.7px;opacity:.92}
h1{margin:3px 0;font-size:clamp(22px,4vw,32px)}
.header p{margin:0;font-size:14px;opacity:.9}
.wrap{max-width:1050px;margin:20px auto;padding:0 14px 35px}
.card{background:white;border:1px solid var(--borde);border-radius:14px;padding:18px;margin-bottom:15px;box-shadow:0 7px 22px rgba(23,79,55,.08)}
.card h2{margin:0 0 14px;color:var(--verde);font-size:16px}
.grid{display:grid;gap:13px}.grid2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid3{grid-template-columns:repeat(3,minmax(0,1fr))}
label{display:block;font-size:13px;font-weight:700;margin-bottom:6px}
input,select,textarea{width:100%;padding:11px 12px;border:1px solid #c8d3cc;border-radius:9px;font-size:15px;font-family:inherit;outline:none;background:#fff;color:var(--texto)}
input:focus,select:focus,textarea:focus{border-color:var(--verde2);box-shadow:0 0 0 3px rgba(33,106,75,.12)}
input:disabled,select:disabled,textarea:disabled{background:#eef1ef;color:#7c8781;cursor:not-allowed;opacity:.92}
.metric{background:#f8faf9;border:1px solid var(--borde);border-radius:11px;padding:11px}.metric input{text-align:center;font-size:20px;font-weight:700}
.subcard{position:relative;background:#fbfcfb;border:1px solid var(--borde);border-radius:11px;padding:14px;margin-bottom:11px}
.subtitle{font-weight:800;color:var(--verde);margin-bottom:12px}
.remove{position:absolute;right:9px;top:9px;border:0;background:#fff0ee;color:var(--rojo);border-radius:7px;padding:7px 9px;font-weight:700;cursor:pointer}
.badge{background:#e7f0ea;color:var(--verde);border-radius:999px;padding:3px 8px;font-size:12px}
.btn{border:0;border-radius:9px;padding:11px 15px;font-size:14px;font-weight:800;cursor:pointer;transition:.18s ease}
.btn:active{transform:scale(.99)}
.btn:disabled{cursor:not-allowed;opacity:.5;transform:none}
.primary{background:var(--verde);color:white}.secondary{background:#e7f0ea;color:var(--verde)}.light{background:#edf0ee;color:#26362e}.full{width:100%}
.success{background:#e8f5ed;color:#17613a;border:1px solid #b9dfc8}.danger{background:#fff0ee;color:#95231a;border:1px solid #efc4be}
.actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.alert{padding:12px 14px;border-radius:9px;margin-bottom:14px;font-weight:700}.hidden{display:none!important}
.alert.ok{background:#e9f6ee;color:#17613a;border:1px solid #b9dfc8}.alert.error{background:#fff0ee;color:#95231a;border:1px solid #efc4be}
footer{text-align:center;color:var(--gris);font-size:12px;padding:10px 10px 28px}

.status-banner{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:12px;margin:0 0 15px;border:1px solid var(--borde);background:#fff;box-shadow:0 5px 16px rgba(23,79,55,.06)}
.status-banner strong{display:block;font-size:13px;letter-spacing:.3px}.status-banner span:not(.status-dot){display:block;font-size:12px;margin-top:2px;color:#59655f}
.status-dot{width:11px;height:11px;border-radius:50%;background:#9ba49f;box-shadow:0 0 0 4px rgba(155,164,159,.15);flex:0 0 auto}
.status-banner.open{background:#edf8f1;border-color:#bee0ca}.status-banner.open .status-dot{background:#209553;box-shadow:0 0 0 4px rgba(32,149,83,.14)}
.status-banner.closed{background:#fff4f2;border-color:#efc7c1}.status-banner.closed .status-dot{background:#bd392f;box-shadow:0 0 0 4px rgba(189,57,47,.13)}
.status-banner.checking{background:#f5f7f6}
body.service-closed #formArea{position:relative}
body.service-closed #formArea::before{content:"SERVICIO CERRADO";position:fixed;z-index:20;right:14px;bottom:14px;background:rgba(149,35,26,.94);color:#fff;padding:8px 12px;border-radius:999px;font-size:11px;font-weight:800;letter-spacing:.5px;box-shadow:0 5px 15px rgba(0,0,0,.18);pointer-events:none}

.modal{position:fixed;inset:0;z-index:9999;background:rgba(7,26,18,.58);backdrop-filter:blur(5px);display:grid;place-items:center;padding:18px}
.modal-card{position:relative;width:min(440px,100%);background:#fff;border-radius:18px;padding:24px;box-shadow:0 24px 70px rgba(0,0,0,.28)}
.modal-close{position:absolute;right:12px;top:10px;width:36px;height:36px;border:0;border-radius:50%;background:#eef1ef;color:#304038;font-size:24px;cursor:pointer}
.admin-kicker{font-size:11px;font-weight:800;letter-spacing:1px;color:var(--verde2);margin-bottom:5px}.modal-card h2{margin:0 0 18px;color:var(--verde);font-size:22px}
.admin-help{font-size:11px;color:#7a8680;line-height:1.45;margin:10px 0 0}.admin-state-card{display:flex;justify-content:space-between;align-items:center;background:#f5f8f6;border:1px solid var(--borde);border-radius:10px;padding:12px 13px;margin-bottom:12px}.admin-state-card span{font-size:12px;color:#65716b}.admin-state-card strong{font-size:13px;color:var(--verde)}
.admin-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.admin-divider{height:1px;background:#e3e8e5;margin:16px 0}.modal-card .btn+ .btn{margin-top:10px}

@media(max-width:760px){
 .grid2,.grid3{grid-template-columns:1fr}.actions .btn{width:100%}
 .logo-button{width:58px;height:58px}.institution-logo{width:56px;height:56px}.shield{width:52px;height:52px}
 .head-inner{align-items:flex-start}.unit{font-size:11px}h1{line-height:1.05}.header p{font-size:13px}
 .admin-actions{grid-template-columns:1fr}.modal-card{padding:22px 18px}
}
