:root {
  --verde: #285c43;
  --verde-osc: #153d30;
  --fondo: #f8f9f5;
  --tarjeta: #fbfcf9;
  --texto: #172a22;
  --muted: #748078;
  --borde: #e2e8e0;
  --amarillo: #e2a800;
  --rojo: #c0392b;
  --azul: #2471a3;
  --salvia: #e9eddf;
  --lima: #d5d786;
  --radio: 14px;
  --sombra: 0 3px 14px rgba(29,62,43,.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: "DM Sans", "Segoe UI", system-ui, Arial, sans-serif;
  background: var(--fondo); color: var(--texto);
}
h1, h2, h3, .brand strong { font-family: Manrope, "DM Sans", sans-serif; }
header.top {
  background: rgba(252,253,251,.95); backdrop-filter: blur(12px);
  color: var(--verde-osc); padding: 0 5%; height: 72px;
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid #eff1ec; box-shadow: var(--sombra);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--verde-osc); }
.logo { width: 36px; height: 36px; flex: 0 0 36px; }
.brand-txt strong { font-size: 19px; font-weight: 800; letter-spacing: -.8px; display: block; line-height: 1; }
.brand-txt small { font-size: 8px; letter-spacing: 1.15px; display: block; color: #77837a; font-weight: 700; margin-top: 3px; }
header.top h1 { font-size: 1.35rem; margin: 0; }
header.top p { margin: 0; font-size: .85rem; opacity: .9; }
/* Menú hamburguesa con panel desplegable */
.hamb {
  margin-left: auto; background: #fff; border: 1px solid var(--borde);
  border-radius: 12px; width: 46px; height: 42px; padding: 9px 11px;
  display: flex; flex-direction: column; justify-content: space-between; cursor: pointer;
}
.hamb span { display: block; height: 3px; border-radius: 2px; background: var(--verde-osc); transition: transform .2s, opacity .2s; }
.hamb[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamb[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamb[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
nav.menu {
  display: none; position: absolute; top: 72px; right: 4%; left: auto; min-width: 230px;
  background: #fff; border: 1px solid var(--borde); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(21,61,48,.16); padding: 8px; flex-direction: column; gap: 2px;
}
nav.menu.abierto { display: flex; }
nav.menu a {
  color: #46554b; text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: 11px 14px; border-radius: 10px;
}
nav.menu a:hover { background: var(--salvia); color: var(--verde-osc); }
nav.menu a.activo { background: var(--verde); color: #fff; }
/* Hero */
.hero {
  position: relative; overflow: hidden; background: var(--salvia);
  border-radius: 18px; padding: 40px 5%; margin: 14px 0;
  display: flex; gap: 24px; justify-content: space-between; align-items: center; flex-wrap: wrap;
}
.hero-copy { position: relative; z-index: 1; max-width: 520px; }
.eyebrow { font-size: 10px; letter-spacing: 1.55px; font-weight: 700; color: #63764d; display: flex; align-items: center; gap: 8px; }
.live-dot { height: 8px; width: 8px; border-radius: 50%; background: #7caa58; box-shadow: 0 0 0 4px #d8e3ca; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); line-height: 1.15; letter-spacing: -1px; color: #193b2e; margin: 14px 0 10px; }
.hero h1 em { font-style: italic; }
.hero-copy p { color: #3d4f45; margin: 0 0 16px; }
.hero-cta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hero-link { color: var(--verde-osc); font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--lima); }
.hero-note { margin-top: 14px; font-size: .85rem; color: #5c6b5e; }
.hero-aside {
  position: relative; z-index: 1; background: #fbfdfb; border: 1px solid var(--borde);
  border-radius: 16px; padding: 20px; min-width: 220px; max-width: 260px; box-shadow: var(--sombra);
}
.aside-top { display: flex; justify-content: space-between; font-size: 9px; letter-spacing: 1.2px; font-weight: 700; color: #77837a; }
.aside-number { font: 800 2.6rem Manrope, sans-serif; color: var(--verde-osc); }
.aside-label { font-size: .85rem; color: var(--muted); }
.aside-line { height: 1px; background: var(--borde); margin: 12px 0; }
.aside-text { font-size: .85rem; color: #3d4f45; }
.hero-sun {
  position: absolute; right: 6%; top: -70px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, #f4efc8 0 42%, #e9eddf 72%); opacity: .9;
}
main { max-width: 1100px; margin: 0 auto; padding: 18px 14px 60px; }
.aviso {
  background: #fff8e1; border: 1px solid #f0d27a; color: #6b5300;
  border-radius: var(--radio); padding: 12px 14px; font-size: .9rem; margin: 14px 0;
}
.modo-demo {
  background: #eef4ff; border: 1px solid #b9cdf5; color: #1d3f8f;
  border-radius: var(--radio); padding: 10px 14px; font-size: .88rem; margin: 14px 0;
}
.panel {
  background: var(--tarjeta); border: 1px solid var(--borde);
  border-radius: 18px; padding: 18px; margin: 14px 0;
  box-shadow: var(--sombra);
}
.panel h2 { color: var(--verde-osc); letter-spacing: -.4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat {
  border: 1px solid var(--borde); border-top: 4px solid var(--verde); border-radius: 12px;
  padding: 12px; text-align: center; background: #fff;
}
.stat b { display: block; font-size: 1.7rem; font-family: Manrope, sans-serif; color: var(--verde-osc); }
.stat span { font-size: .85rem; color: var(--muted); }
#mapa { height: 62vh; min-height: 380px; border-radius: var(--radio); border: 1px solid var(--borde); z-index: 1; scroll-margin-top: 90px; }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; align-items: center; }
.filtros select, .filtros label { font-size: .9rem; }
select, input, textarea {
  border: 1px solid var(--borde); border-radius: 10px; padding: 10px; font-size: 1rem; width: 100%;
}
button {
  background: var(--verde); color: #fff; border: none; border-radius: 999px;
  padding: 12px 22px; font-size: 1rem; font-weight: 700; cursor: pointer;
  font-family: "DM Sans", sans-serif;
}
button.sec { background: #fff; color: var(--verde-osc); border: 1.5px solid var(--verde); }
button.peligro { background: var(--rojo); }
button:hover { filter: brightness(.95); }
button:focus-visible, a:focus-visible { outline: 3px solid #a9c193; outline-offset: 2px; }
.btn-flotante {
  position: fixed; right: 18px; bottom: 18px; z-index: 1200;
  border-radius: 999px; padding: 15px 20px; font-size: 1rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.modal-fondo {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 2000;
  display: none; align-items: flex-start; justify-content: center; padding: 18px; overflow: auto;
}
.modal-fondo.abierto { display: flex; }
.modal {
  background: #fff; border-radius: 16px; max-width: 620px; width: 100%;
  padding: 18px; margin: auto;
}
.modal h2 { margin-top: 0; }
.campo { margin: 10px 0; }
.campo small { color: var(--muted); }
.error { color: var(--rojo); font-weight: 600; font-size: .92rem; min-height: 1.2em; }
.ok { color: var(--verde); font-weight: 600; }
.mini-mapa { height: 220px; border-radius: 12px; border: 1px solid var(--borde); z-index: 1; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { border-bottom: 1px solid var(--borde); padding: 8px; text-align: left; vertical-align: top; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; color: #fff;
  font-size: .78rem; font-weight: 700;
}
.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tarjeta { border: 1px solid var(--borde); border-radius: 12px; padding: 12px; background: #fff; }
.tarjeta h3 { margin: 0 0 6px; font-size: 1rem; }
.tarjeta p { font-size: .9rem; color: #33463b; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 26px 12px; }
.leyenda { display: flex; gap: 12px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin: 6px 0 10px; }
.leyenda i { display: inline-block; width: 13px; height: 13px; border-radius: 50%; margin-right: 5px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); vertical-align: baseline; }
#lightbox img { max-height: 70vh; object-fit: contain; }
img.preview { max-width: 100%; border-radius: 10px; margin-top: 8px; }
@media (max-width: 640px) {
  header.top h1 { font-size: 1.1rem; }
  main { padding: 10px 8px 50px; }
  .hero { padding: 22px 14px; margin: 8px 0; }
  .hero h1 { margin: 8px 0 6px; }
  .hero-aside { max-width: none; width: 100%; padding: 12px 14px; }
  .aside-number { font-size: 1.8rem; }
  .panel { padding: 12px; margin: 8px 0; }
  /* Stats compactos: 4 mini-tarjetas en una fila, sin scroll largo */
  .stats { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .stat { padding: 6px 2px; border-top-width: 3px; }
  .stat b { font-size: 1.05rem; }
  .stat span { font-size: .62rem; }
  #mapa { height: 52vh; min-height: 300px; }
  .aviso, .modo-demo { font-size: .8rem; padding: 8px 10px; margin: 8px 0; }
  .btn-flotante { right: 12px; bottom: 12px; padding: 13px 16px; }
}
