/* TransparenciaES - v3 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #fafafa;
  color: #1a1a1a;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ──────────────────────────────────────────
   SITE HEADER · Namespace .site-* para evitar colisiones
   ────────────────────────────────────────── */
.site-header {
  background: #fff;
  border-bottom: 1px solid #ececec;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-logo {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  color: #1a1a1a !important;
  letter-spacing: -0.5px;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}
.site-logo:hover { text-decoration: none; }
.site-logo em {
  font-style: italic;
  font-weight: 500;
  color: #555 !important;
}
.site-logo .site-tagline {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: #999 !important;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: lowercase;
}

/* Nav principal desktop */
.site-nav {
  display: flex;
  gap: 28px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav > li { position: relative; list-style: none; }
.site-nav a,
.site-nav .site-nav-toggle {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #555 !important;
  font-weight: 500;
  padding: 6px 0;
  cursor: pointer;
  white-space: nowrap;
  background: none;
  border: none;
  text-decoration: none;
  position: relative;
}
.site-nav a:hover,
.site-nav .site-nav-toggle:hover { color: #000 !important; text-decoration: none; }
.site-nav a.active::after,
.site-nav li.has-active > .site-nav-toggle::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: #000;
}
.site-nav-chev { font-size: 8px; margin-left: 3px; opacity: 0.6; }

/* Submenu desktop (oculto por defecto, SIEMPRE) */
.site-submenu {
  display: none !important;
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 2px;
  min-width: 240px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  padding: 8px;
  z-index: 1000;
  list-style: none;
}
.site-nav li:hover > .site-submenu,
.site-nav li:focus-within > .site-submenu { display: block !important; }
.site-submenu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 16px;
}
.site-submenu li { list-style: none; }
.site-submenu a {
  display: block;
  padding: 10px 14px;
  color: #333 !important;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.2px;
  text-transform: none !important;
  border-radius: 2px;
}
.site-submenu a::after { display: none !important; }
.site-submenu a:hover { background: #f7f7f7; text-decoration: none; color: #000 !important; }
.site-submenu a.active { background: #f0f0f0; color: #000 !important; font-weight: 500; }

/* Hamburger */
.site-burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1101;
}
.site-burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: #1a1a1a;
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}
.site-burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.site-burger.open span:nth-child(2) { opacity: 0; }
.site-burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile drawer */
.site-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 85%;
  max-width: 340px;
  height: 100vh;
  background: #fff;
  box-shadow: -10px 0 40px rgba(0,0,0,0.08);
  padding: 80px 32px 40px;
  z-index: 1100;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.35s ease;
}
.site-drawer.open { transform: translateX(0); }
.site-drawer .site-drawer-group { margin-bottom: 28px; }
.site-drawer .site-drawer-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  color: #000 !important;
  margin-bottom: 12px;
  font-style: italic;
}
.site-drawer a {
  display: block;
  padding: 12px 0;
  color: #333 !important;
  font-size: 15px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.site-drawer a.active { color: #000 !important; font-weight: 600; }
.site-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1099;
}
.site-overlay.open { display: block; }

/* Breakpoints */
@media (max-width: 1150px) {
  .site-nav { display: none !important; }
  .site-burger { display: block; }
  .site-drawer { display: block; }
  .site-header { padding: 18px 24px; }
}
@media (max-width: 600px) {
  .site-header { padding: 16px 20px; }
  .site-logo { font-size: 21px; }
  .site-logo .site-tagline { display: none; }
}

/* Landing */
.hero {
  text-align: center;
  padding: 100px 20px 60px;
  background: #fff;
}
.hero h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 64px;
  font-weight: 500;
  margin-bottom: 16px;
  letter-spacing: -1.5px;
  line-height: 1.05;
  color: #0a0a0a;
}
.hero h1 em { font-style: italic; font-weight: 500; color: #333; }
.hero p {
  font-size: 18px;
  color: #666;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}
@media (max-width: 600px) { .hero { padding: 60px 20px 40px; } .hero h1 { font-size: 42px; } }
.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}
.section-card {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 4px;
  padding: 28px 24px;
  transition: all 0.25s ease;
  display: block;
  color: inherit;
}
.section-card:hover {
  border-color: #1a1a1a;
  transform: translateY(-3px);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}
.section-card .icon { font-size: 28px; margin-bottom: 16px; opacity: 0.85; }
.section-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 10px;
  color: #0a0a0a;
  letter-spacing: -0.3px;
}
.section-card p { font-size: 14px; color: #666; line-height: 1.55; }

/* Contenedor */
.container { max-width: 1280px; margin: 0 auto; padding: 20px; }
.page-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 40px;
  font-weight: 500;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.page-desc { color: #666; margin-bottom: 28px; font-size: 16px; max-width: 700px; }
@media (max-width: 600px) { .page-title { font-size: 30px; } }

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 16px;
}
.stat .label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat .value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 4px;
}
.stat .sub { font-size: 13px; color: #888; margin-top: 2px; }

/* Chart boxes */
.chart-box {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.chart-box h3 { font-size: 15px; margin-bottom: 12px; color: #333; }
.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

/* Inputs */
.input, input[type=number], input[type=text], input[type=password], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.btn {
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid #d4d4d4;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
}
.btn:hover { background: #f5f5f5; }
.btn.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { background: #dc2626; color: #fff; border-color: #dc2626; }

/* Modal */
.modal-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.modal-bg.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 10px;
  padding: 28px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}
.modal h2 { margin-bottom: 16px; font-size: 22px; }
.modal textarea { font-family: ui-monospace, monospace; font-size: 12px; min-height: 320px; }

/* Mensajes */
.msg { padding: 10px 14px; border-radius: 6px; margin: 8px 0; font-size: 14px; }
.msg.ok { background: #dcfce7; color: #166534; }
.msg.err { background: #fee2e2; color: #991b1b; }
.msg.info { background: #eef6ff; color: #1e40af; border-left: 3px solid #2563eb; }

/* Footer */
.footer {
  text-align: center;
  padding: 24px 20px;
  font-size: 13px;
  color: #666;
  border-top: 1px solid #e5e5e5;
  background: #fff;
  margin-top: 40px;
}
.footer nav { display: inline-block; }
.footer a { margin: 0 8px; }

/* Mapa */
#map { height: 500px; border: 1px solid #e5e5e5; border-radius: 8px; }

/* Tablas */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; border: 1px solid #e5e5e5; }
table th, table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
table th { background: #fafafa; font-weight: 600; font-size: 13px; color: #444; text-transform: uppercase; letter-spacing: 0.3px; }
table tr:last-child td { border-bottom: none; }
table tr:hover { background: #fafafa; }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 28px; }
  .header { flex-direction: column; gap: 10px; padding: 12px; }
  .header nav { width: 100%; justify-content: center; }
  .charts-row { grid-template-columns: 1fr; }
}

/* Utils */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 320px 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.mb-16 { margin-bottom: 16px; }
.mt-16 { margin-top: 16px; }
.muted { color: #888; font-size: 13px; }
.highlight { background: #fef3c7; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
