/* ── Global Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary:       #26986B;
  --primary-dark:  #1C6F4F;
  --primary-light: #E1F4EB;
  --primary-xlight:#F4FBF7;
  --accent:        #12B7FF;
  --bg:            #F5F7F9;
  --bg2:           rgba(255,255,255,0.94);
  --bg3:           rgba(255,255,255,0.75);
  --border:        rgba(15,23,42,0.06);
  --border2:       rgba(15,23,42,0.08);
  --text:          #0F1A1A;
  --text2:         #223131;
  --muted:         #5D6B6B;
  --muted2:        #94A3A3;
  --green:         #1CA866;
  --red:           #E44747;
  --amber:         #F5A524;
  --blue:          #2A7BB5;
  --purple:        #6F74F5;
  --teal:          #1A8A9A;
  --orange:        #FF8850;
  --glass-shadow:  0 24px 60px rgba(18,25,32,0.08);
  --card-r:        18px;
  --sidebar-w:     250px;
  --header-h:      58px;
}

html, body {
  height: 100%;
  font-family: 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  background: radial-gradient(circle at top, #F8FCFF 0%, #EDF5F0 45%, #F5F7F9 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  cursor: default;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

#app { display: flex; flex: 1; min-height: 0; gap: 18px; padding: 18px 18px 0; }

/* Footer de página */
#page-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  flex-shrink: 0;
}
.footer-logo {
  height: 16px;
  width: auto;
  opacity: 0.35;
}
.footer-brand {
  font-size: 11px;
  font-weight: 700;
  color: rgba(15,26,26,0.38);
  letter-spacing: .06em;
}
.footer-sep {
  font-size: 11px;
  color: rgba(15,26,26,0.22);
}
.footer-sub {
  font-size: 10.5px;
  color: rgba(15,26,26,0.28);
  letter-spacing: .02em;
}
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-radius: 26px;
  background: #1A1A1F;
  color: rgba(255,255,255,0.88);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.32);
  border: 1px solid rgba(255,255,255,0.06);
  transition: width .25s ease, padding .25s ease;
  position: relative;
  overflow: visible;
}
#main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg3);
  border-radius: 28px;
  padding: 0;
  backdrop-filter: blur(18px);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 14px;
  position: relative;
}
.sidebar-header .user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #26986B, #12B7FF);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.sidebar-header-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
  flex: 1;
}
.sidebar-role-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
  color: rgba(255,255,255,0.38);
  text-transform: uppercase;
}
.sidebar-header .user-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nav */
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }

.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.32);
  letter-spacing: .20em;
  text-transform: uppercase;
  padding: 4px 10px 6px;
}
.nav-separator {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin: 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  color: rgba(255,255,255,0.52);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  background: transparent;
  font-weight: 500;
  font-size: 13px;
  user-select: none;
}
.nav-item-static { cursor: default; font-size: 12px; }
.nav-item-static:hover { background: transparent !important; color: rgba(255,255,255,0.38) !important; }

.nav-item .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: transparent;
  border: none;
}
.nav-item .icon::before { display: none; }

.icon::after {
  content: '';
  display: inline-block;
  width: 17px;
  height: 17px;
  background: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}
.icon-chart::after  { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M4 19h16v2H4zM6 10h2v7H6zm5-4h2v11h-2zm5 6h2v5h-2z"/></svg>'); -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M4 19h16v2H4zM6 10h2v7H6zm5-4h2v11h-2zm5 6h2v5h-2z"/></svg>'); }
.icon-crane::after  { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M3 6h2v12H3zm4-3h2v15H7zm4 5h2v10h-2zm4 3h2v7h-2zm4-6h2v13h-2z"/></svg>'); -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M3 6h2v12H3zm4-3h2v15H7zm4 5h2v10h-2zm4 3h2v7h-2zm4-6h2v13h-2z"/></svg>'); }
.icon-stores::after { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M4 4h16v2l-2 6v8H6v-8L4 6zm4 8v4h2v-4zm6 0v4h2v-4z"/></svg>'); -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M4 4h16v2l-2 6v8H6v-8L4 6zm4 8v4h2v-4zm6 0v4h2v-4z"/></svg>'); }
.icon-info::after   { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>'); -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>'); }
.icon-calendar::after { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"/></svg>'); -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"/></svg>'); }

.nav-label { font-weight: 500; letter-spacing: .01em; line-height: 1; }

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.85);
}
.nav-item.active {
  background: rgba(255,255,255,0.10);
  color: #ffffff;
}
.nav-item.active .icon::after {
  background: #ffffff;
}
.nav-item .icon::after {
  background: rgba(255,255,255,0.52);
}

body.sidebar-collapsed #sidebar {
  width: 72px;
  padding: 20px 10px;
}
body.sidebar-collapsed .sidebar-header-meta,
body.sidebar-collapsed .nav-section-label,
body.sidebar-collapsed .nav-separator,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-item-info,
body.sidebar-collapsed .sidebar-cta,
body.sidebar-collapsed .sidebar-footer {
  display: none;
}
body.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding-bottom: 14px;
  gap: 0;
}
body.sidebar-collapsed .sidebar-header .user-avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}
body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}
body.sidebar-collapsed .nav-item .icon {
  width: 22px;
  height: 22px;
}
body.sidebar-collapsed #main {
  margin-left: 0;
}

/* Topbar */
#topbar {
  min-height: var(--header-h);
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 6px 28px 10px;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(15,23,42,0.05);
}
.sidebar-toggle {
  border: 1px solid rgba(15,23,42,0.12);
  background: rgba(255,255,255,0.9);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  box-shadow: none;
  transition: background .2s ease, border-color .2s ease;
}
.sidebar-toggle:hover {
  background: rgba(38,152,107,0.08);
  border-color: rgba(38,152,107,0.35);
}
.sidebar-collapse {
  position: absolute;
  right: -14px;
  top: 30px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  background: #2A2A32;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.40);
  transition: background .18s ease;
}
.sidebar-collapse:hover {
  background: #363642;
}
.collapse-arrow-img {
  display: none;
}
.sidebar-collapse .collapse-icon {
  display: none;
}
.sidebar-collapse::after {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  background: rgba(255,255,255,0.75);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  transition: transform .25s ease;
  flex-shrink: 0;
}
body.sidebar-collapsed .sidebar-collapse::after {
  transform: rotate(180deg);
}
.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
  flex: 0 0 auto;
  white-space: nowrap;
  margin-top: 4px;
}

.topbar-filters {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-start;
}
.topbar-filters > .btn-tag {
  align-self: flex-end;
  justify-self: flex-end;
  margin-left: auto;
  flex: 0 0 auto;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 150px;
  min-width: 0;
  max-width: 220px;
  position: relative;
}
.filter-group:focus-within {
  flex-basis: 240px;
  max-width: 320px;
  z-index: 2;
}
.filter-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tarjeta CTA inferior */
.sidebar-cta {
  margin-top: auto;
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.sidebar-footer-logo {
  height: 20px;
  width: auto;
  opacity: 0.55;
  margin-bottom: 2px;
}
.sidebar-footer-brand {
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  letter-spacing: .08em;
}
.sidebar-footer-sub {
  font-size: 9px;
  color: rgba(255,255,255,0.22);
  line-height: 1.5;
  letter-spacing: .02em;
  text-align: center;
}
body.sidebar-collapsed .sidebar-footer { display: none; }
.sidebar-cta-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.70);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.sidebar-cta-logout:hover {
  background: rgba(228,71,71,0.18);
  border-color: rgba(228,71,71,0.35);
  color: #ff8080;
}

/* Botón logout heredado (por si JS lo busca por clase) */
.user-logout {
  background: transparent;
  border: none;
  cursor: pointer;
}
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: #fff;
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 18px;
  box-shadow: 0 18px 38px rgba(15,23,42,0.18);
  display: none;
  min-width: 170px;
  padding: 8px;
  z-index: 999;
}
.sidebar-user.open .user-dropdown { display: flex; }
.user-dropdown-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
}
.user-dropdown-item:hover {
  background: rgba(38,152,107,0.12);
  color: var(--primary-dark);
}

select.filter-select {
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 11px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
  width: 100%;
  min-width: 0;
  transition: border-color .18s ease, box-shadow .18s ease;
}
select.filter-select:hover,
select.filter-select:focus {
  border-color: rgba(38,152,107,0.7);
}
.topbar-filters .filter-group:hover select.filter-select,
.topbar-filters .filter-group:focus-within select.filter-select {
  box-shadow: 0 0 0 2px rgba(38,152,107,0.15);
}
select.filter-select.sm { padding: 4px 10px; border-radius: 9px; }

.btn-tag {
  border: 1px solid rgba(15,23,42,0.15);
  background: rgba(255,255,255,0.9);
  color: var(--text2);
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  letter-spacing: .04em;
  box-shadow: none;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.btn-tag:hover {
  background: rgba(38,152,107,0.08);
  border-color: rgba(38,152,107,0.35);
  color: var(--primary-dark);
}
.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

#content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 32px;
  background: rgba(255,255,255,0.6);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* KPI Cards */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); gap: 18px; margin-bottom: 22px; }
.kpi-card {
  background: var(--bg2);
  border-radius: 22px;
  padding: 20px 22px;
  border: 1px solid var(--border2);
  box-shadow: 0 12px 30px rgba(15,18,23,0.08);
  position: relative;
  overflow: hidden;
}
.kpi-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.4);
  pointer-events: none;
}
.kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .15em;
  text-transform: uppercase;
}
.kpi-value { font-size: 30px; font-weight: 700; margin-top: 8px; color: var(--text); }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi-card .kpi-label,
.kpi-card .kpi-value,
.kpi-card .kpi-sub {
  position: relative;
  z-index: 2;
}
.kpi-icon {
  position: absolute;
  right: 12px;
  bottom: -6px;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.08;
  pointer-events: none;
  z-index: 1;
}
.kpi-icon::after {
  content: attr(data-icon);
  font-size: 72px;
  font-weight: 700;
  letter-spacing: .12em;
  color: rgba(26,46,36,0.7);
}

/* Panels & Pills */
.panel {
  background: var(--bg2);
  border-radius: 22px;
  border: 1px solid var(--border2);
  box-shadow: 0 18px 30px rgba(15,18,23,0.08);
  padding: 20px 22px;
  backdrop-filter: blur(12px);
}
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.panel-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  font-size: 11px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(38,152,107,0.08);
  border: 1px solid transparent;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  cursor: pointer;
  transition: all .2s ease;
}
.pill:hover, .pill.active {
  background: rgba(38,152,107,0.18);
  color: var(--primary-dark);
  border-color: rgba(38,152,107,0.25);
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px,1fr)); gap: 18px; margin-bottom: 18px; }
.panel-columns {
  display: flex;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}
.panel-columns .column-left {
  flex: 1.1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.panel-columns .column-left .panel { height: 100%; }
.panel-columns .panel-variacion {
  flex: 0.9;
  display: flex;
  flex-direction: column;
}
.panel-columns .panel-variacion .chart-wrap { flex: 1; }
.panel-donut .donut-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: center;
}
.grid-5-4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; align-items: stretch; }
.grid-6-4 { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; margin-bottom: 18px; align-items: start; }
.grid-5-4 > * { min-width: 0; }
.grid-5-4 .panel { height: 100%; display: flex; flex-direction: column; }
.grid-5-4 .panel .chart-wrap,
.grid-5-4 .panel .table-wrap { flex: 1; }
.grid-5-4 .panel .table-wrap { overflow: auto; }
.mb14 { margin-bottom: 18px; }
.fw700 { font-weight: 700; }

/* Map */
#mapa-container { margin-bottom: 18px; }
.mapa-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.map-stage {
  position: relative;
  min-height: 660px;
}
#holcim-map-wrap {
  width: 100%;
  height: 100%;
  min-height: 660px;
}
.map-legend-side {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 210px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 22px;
  padding: 16px 18px;
  box-shadow: 0 18px 30px rgba(15,18,23,0.15);
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 5;
  max-height: calc(100% - 32px);
  overflow-y: auto;
}
.map-legend-side.active { display: flex; }
.legend-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--muted);
}
.holcim-top-card {
  display: none;
  flex-direction: column;
  gap: 10px;
  min-width: 280px;
  max-width: 320px;
  padding: 16px 20px;
  border-radius: 18px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(13,107,58,0.3);
  box-shadow: 0 10px 24px rgba(15,23,42,0.16);
}
.holcim-top-card .top-card-label {
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #52705F;
  font-weight: 600;
}
.holcim-top-card .top-card-name {
  font-size: 20px;
  font-weight: 700;
  color: #0B3C27;
}
.holcim-top-card .top-card-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #355046;
}
.holcim-top-card .top-card-stat span {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  color: #73807A;
}

.amg-muni-layer .amg-poly {
  pointer-events: auto;
  cursor: pointer;
}
.amg-muni-layer {
  mix-blend-mode: multiply;
}
.holcim-top-card .top-card-stat strong {
  color: #0B3C27;
}
.holcim-region-callout {
  display: none;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin: 10px 0 6px;
  font-size: 12px;
  color: #1A2E24;
}
.holcim-region-callout span {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #556067;
}
.holcim-region-callout strong {
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(26,46,36,0.12);
  background: #F4F8F5;
  color: #1A2E24;
}

.legend-chips { display: flex; flex-direction: column; gap: 8px; }
.legend-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,0.08);
  cursor: pointer;
  transition: all .2s ease;
  font-size: 13px;
  color: var(--text2);
  background: rgba(255,255,255,0.8);
}
.legend-chip:hover { box-shadow: 0 8px 18px rgba(15,18,23,0.08); }
.legend-chip.active {
  border-color: rgba(38,152,107,0.45);
  background: rgba(38,152,107,0.18);
  color: var(--primary-dark);
}
.legend-dot-round {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

#map-svg-wrap {
  width: 100%;
  height: 660px;
  border-radius: 26px;
  background: linear-gradient(145deg, #F8FBFF, #E8F5EE);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(15,23,42,0.05);
}
.mapa-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.map-zoom-group { display: inline-flex; gap: 6px; background: rgba(15,23,42,0.06); padding: 4px; border-radius: 999px; }
.map-zoom-btn {
  border: none;
  background: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 6px 18px rgba(15,23,42,0.14);
  cursor: pointer;
  transition: transform .2s ease;
}
.map-zoom-btn:hover { transform: translateY(-2px); }
.map-zoom-btn.ghost {
  width: auto;
  padding: 0 16px;
  border-radius: 18px;
  background: transparent;
  border: 1px solid rgba(15,23,42,0.08);
  box-shadow: none;
  font-size: 12px;
  letter-spacing: .12em;
}

#map-tooltip {
  display: none;
  position: fixed;
  min-width: 220px;
  background: rgba(15,23,42,0.92);
  color: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 12px;
  pointer-events: none;
  box-shadow: 0 18px 45px rgba(15,23,42,0.35);
  z-index: 9999;
}
#map-tooltip .tt-name {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
#map-tooltip .tt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 5px;
  line-height: 1.5;
}
#map-tooltip .tt-row span:first-child {
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
}
#map-tooltip .tt-row span:last-child {
  font-weight: 600;
  text-align: right;
}
#map-tooltip .tt-score {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(255,255,255,0.15);
}
#map-tooltip .tt-score span:last-child {
  color: #FFA040;
  font-size: 13px;
}

.map-legend { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--muted); }

/* ── Score Oportunidad legend ─────────────────────────────────────── */
.h-score-legend {
  margin-top: 10px;
  padding: 12px 16px;
  background: #F5FBF7;
  border: 1px solid #D3E4DA;
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  font-size: 11.5px;
  color: #2E4A3C;
}
.h-score-gradient-wrap { display: flex; flex-direction: column; gap: 4px; }
.h-score-gradient-bar {
  width: 200px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(to right, #F1F8F4, #CDEBD8, #8BD0A7, #3FA76A, #0D6B3A);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.h-score-gradient-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #446151;
}
.h-score-formula {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 2px solid #E5E7EB;
  padding-left: 14px;
}
.h-score-formula-title { font-weight: 700; color: #111827; font-size: 11px; }
.h-score-formula-body  { color: #567063; font-size: 11px; }
.h-score-example {
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 2px solid #E5E7EB;
  padding-left: 14px;
  color: #446151;
  font-size: 11px;
}
.h-score-ex-badge {
  background: #0D6B3A;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.legend-gradient { height: 10px; width: 140px; border-radius: 999px; }

/* Charts */
.chart-wrap { width: 100%; position: relative; }
.chart-wrap.h220 { height: 220px; }
.chart-wrap.h260 { height: 260px; }
.chart-wrap.h280 { height: 280px; }
.chart-wrap.h300 { height: 300px; }
.chart-wrap.h340 { height: 340px; }
.chart-wrap.h360 { height: 360px; }
.chart-wrap.h380 { height: 380px; }
.chart-wrap.h520 { height: 520px; }
.chart-wrap.h640 { height: 640px; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { padding: 10px 12px; text-transform: uppercase; letter-spacing: .18em; font-size: 10px; color: var(--muted2); border-bottom: 1px solid rgba(15,23,42,0.08); }
.data-table td { padding: 9px 12px; border-bottom: 1px solid rgba(15,23,42,0.05); }
.data-table tr:hover td { background: rgba(38,152,107,0.08); }
.tag { padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.tag.def { background: rgba(38,152,107,0.12); color: var(--primary-dark); }
.tag.rev { background: rgba(18,183,255,0.14); color: #0C7CB6; }
.tag.pre { background: rgba(245,165,36,0.15); color: var(--amber); }

/* Misc text */
.text-up { color: var(--primary); font-weight: 700; }
.text-down { color: var(--red); font-weight: 700; }
.text-muted { color: var(--muted); }

/* Spinner */
.spinner-wrap { display: flex; align-items: center; justify-content: center; height: 200px; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid rgba(15,23,42,0.08); border-top-color: var(--primary); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 999px; }

/* Responsive */
@media (max-width: 1024px) {
  #app { flex-direction: column; height: auto; }
  #sidebar { width: 100%; flex-direction: row; align-items: center; padding: 18px; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  #main { width: 100%; }
}
@media (max-width: 900px) {
  .map-stage { display: flex; flex-direction: column; }
  .map-legend-side {
    position: static;
    width: 100%;
    order: -1;
    margin-bottom: 12px;
  }
  .panel-columns {
    flex-direction: column;
  }
  .panel-donut .donut-grid {
    grid-template-columns: 1fr;
  }
  .grid-5-4 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  #app { padding: 12px; }
  #sidebar { display: none; }
  #main { border-radius: 20px; }
  #topbar { padding: 0 18px; }
  #content { padding: 18px; }
}

/* ── Tab Estrategia Holcim ───────────────────────────────────────────────── */

/* Hero banner */
.holcim-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(120deg, #1A2E24 0%, #26986B 60%, #12B7FF 100%);
  border-radius: 20px;
  padding: 20px 28px;
  margin-bottom: 20px;
  gap: 16px;
}
.holcim-hero-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
}
.hero-sep { opacity: .55; margin: 0 6px; }
.holcim-hero-sub {
  font-size: 11.5px;
  color: rgba(255,255,255,0.65);
  margin-top: 4px;
  letter-spacing: .02em;
}

.pill-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.pill-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(26, 46, 36, 0.55);
  margin-right: 2px;
}

/* Grid layouts */
.grid-6-4 {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 18px;
  margin-bottom: 18px;
}

/* Regiones legend */
.holcim-region-legend {
  display: none;
}
.holcim-amg-region { pointer-events: none; }

/* Cuadrantes scatter */
.holcim-cuadrantes-wrap {
  position: relative;
  min-height: 700px;
}
.holcim-cuadrantes-wrap .chart-wrap {
  margin-top: 80px;
  margin-bottom: 30px;
}
.cuadrante-label {
  position: absolute;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 2;
  pointer-events: none;
  padding: 6px 10px;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(15,23,42,0.12);
}
.cuadrante-label span {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .03em;
  text-transform: none;
  opacity: .82;
}
.cuadrante-label.top-right  { top: 0; right: 28px; text-align: right; color: #0D5C35; background: rgba(209, 243, 224, 0.92); }
.cuadrante-label.top-left   { top: 0; left: 28px;  text-align: left;  color: #0E7A83; background: rgba(208, 241, 244, 0.92); }
.cuadrante-label.bot-right  { bottom: 18px; right: 28px; text-align: right; color: #9A6B2F; background: rgba(255, 239, 210, 0.92); }
.cuadrante-label.bot-left   { bottom: 18px; left: 28px;  text-align: left;  color: #6B7280; background: rgba(233, 236, 243, 0.92); }

/* Tabla ranking */
.score-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.score-bar {
  height: 6px;
  border-radius: 999px;
  min-width: 4px;
  flex-shrink: 0;
}
.score-val {
  font-size: 11px;
  font-weight: 700;
  min-width: 28px;
}
.score-high  { color: var(--green); }
.score-mid   { color: var(--amber); }
.score-low   { color: var(--muted); }

/* Tabla zonas */
#holcim-zonas-tabla {
  overflow-y: auto;
  max-height: 400px;
}
.zona-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.zona-row:last-child { border-bottom: none; }
.zona-row-name {
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.zona-row-estados {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.zona-row-stats {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--text2);
  font-weight: 600;
}

/* icon-target para nav */
.icon-target::after {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Ccircle cx='12' cy='12' r='6' fill='%231A1A1F'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Ccircle cx='12' cy='12' r='6' fill='%231A1A1F'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3C/svg%3E");
}

.score-highlight-layer path {
  fill: none;
  stroke: #FF7A3C;
  stroke-width: 2.2px;
  stroke-linejoin: round;
  stroke-dasharray: 8 4;
  animation: scorePulse 2.4s ease-in-out infinite;
}

@keyframes scorePulse {
  0% { stroke-opacity: 0.15; stroke-width: 2px; }
  50% { stroke-opacity: 0.85; stroke-width: 3.2px; }
  100% { stroke-opacity: 0.15; stroke-width: 2px; }
}

/* ── Heatmap doble capa — leyenda ──────────────────────────────────�