:root {
  --cens-green-950: #00351f;
  --cens-green-900: #004b2d;
  --cens-green-800: #006b3f;
  --cens-green-700: #007a3d;
  --cens-green-600: #129447;
  --cens-lime: #a7c957;
  --cens-yellow: #f3c623;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --surface-card: rgba(255, 255, 255, .92);
  --line: #dce8e1;
  --line-strong: #c4d5cc;
  --text: #11251b;
  --muted: #64746c;
  --muted-2: #8a9891;
  --danger: #dc3545;
  --shadow-sm: 0 8px 20px rgba(0, 75, 45, .08);
  --shadow-md: 0 18px 50px rgba(0, 75, 45, .13);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --cell-min: 124px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(167, 201, 87, .18), transparent 34rem),
    linear-gradient(180deg, #eef7f1 0%, #ffffff 72%);
  color: var(--text);
}

button, select, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .72; }

.app-shell {
  width: min(1840px, 100%);
  margin: 0 auto;
  padding: clamp(12px, 2vw, 28px);
}

.hero-card,
.filters-card,
.calendar-card,
.side-panel,
.legend-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface-card);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: clamp(18px, 2vw, 28px);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(0, 53, 31, .96), rgba(0, 122, 61, .94)),
    radial-gradient(circle at 100% 0%, rgba(243, 198, 35, .35), transparent 30%);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.hero-card::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 42px solid rgba(255,255,255,.08);
}
.hero-left { display: flex; align-items: center; gap: 16px; min-width: 0; position: relative; z-index: 1; }
.brand-badge {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
  font-weight: 900;
  letter-spacing: -.04em;
}
.eyebrow {
  margin: 0 0 5px;
  letter-spacing: .085em;
  text-transform: uppercase;
  font-size: .72rem;
  font-weight: 900;
  color: inherit;
  opacity: .75;
}
h1 { margin: 0; font-size: clamp(1.45rem, 3vw, 2.55rem); line-height: 1.08; letter-spacing: -.03em; }
.hero-subtitle { margin: 8px 0 0; opacity: .82; font-weight: 500; }
.hero-actions { display: flex; gap: 10px; position: relative; z-index: 1; }
.metric-card {
  min-width: 112px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.22);
  text-align: center;
}
.metric-card span { display: block; font-size: 1.55rem; font-weight: 900; line-height: 1; }
.metric-card small { display: block; margin-top: 4px; opacity: .82; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: .68rem; }

.filters-card {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(120px, 160px) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
}
.filter-field { min-width: 0; }
.filter-field label {
  display: block;
  margin: 0 0 7px;
  font-size: .75rem;
  font-weight: 900;
  color: var(--cens-green-800);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.filter-field select,
.secondary-button,
.ghost-button {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.filter-field select:focus {
  border-color: var(--cens-green-600);
  box-shadow: 0 0 0 4px rgba(18,148,71,.12);
}
.filter-buttons { display: flex; gap: 8px; align-items: end; }
.secondary-button, .ghost-button { width: auto; padding-inline: 18px; font-weight: 900; white-space: nowrap; }
.secondary-button { color: white; border-color: var(--cens-green-800); background: var(--cens-green-800); }
.secondary-button:hover { transform: translateY(-1px); box-shadow: 0 10px 18px rgba(0, 107, 63, .18); }
.ghost-button { color: var(--cens-green-800); background: var(--surface-soft); }

.multi-select { position: relative; }
.multi-trigger { display: flex; align-items: center; justify-content: space-between; text-align: left; gap: 10px; }
#municipioSummary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { font-size: 1.4rem; color: var(--cens-green-800); line-height: 1; }
.multi-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  left: 0;
  width: min(520px, 92vw);
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: none;
}
.multi-select.open .multi-menu { display: block; animation: dropdown .16s ease-out; }
@keyframes dropdown { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.multi-actions { display: flex; gap: 8px; margin: 10px 0; }
.multi-actions button { border: 0; border-radius: 999px; padding: 7px 12px; background: var(--surface-soft); color: var(--cens-green-800); font-weight: 900; }
.multi-options { max-height: 280px; overflow: auto; display: grid; gap: 6px; padding-right: 4px; }
.multi-option { display: flex; align-items: center; gap: 10px; padding: 10px 9px; border-radius: 12px; font-weight: 650; color: var(--text); }
.multi-option:hover { background: var(--surface-soft); }
.multi-option input { accent-color: var(--cens-green-700); width: 16px; height: 16px; }

.content-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  gap: 16px;
  align-items: stretch;
}
.calendar-card { min-width: 0; overflow: hidden; }
.calendar-toolbar { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 12px; padding: 16px 18px 10px; }
.month-heading { text-align: center; min-width: 0; }
.calendar-toolbar h2 { margin: 0; font-size: clamp(1.25rem, 2vw, 1.9rem); color: var(--cens-green-950); letter-spacing: -.03em; }
.nav-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, var(--cens-green-800), var(--cens-green-600));
  font-size: 1.9rem;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 20px rgba(0, 107, 63, .18);
}
.nav-button:hover { filter: brightness(1.03); transform: translateY(-1px); }
.weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekdays { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f2f7f4; }
.weekdays span { padding: 13px 8px; text-align: center; font-weight: 900; color: var(--cens-green-950); }
.calendar-grid { min-height: calc(6 * var(--cell-min)); }
.day-cell {
  min-height: var(--cell-min);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px;
  background: white;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 6px;
  overflow: hidden;
  transition: background .18s ease, box-shadow .18s ease;
}
.day-cell:nth-child(7n) { border-right: 0; }
.day-cell.outside { background: #d7ddd9; color: #95a09a; }
.day-cell.has-events { background: #ffefb1; }
.day-cell.selected { background: #d5f3f0; box-shadow: inset 0 0 0 2px var(--cens-green-700); }
.day-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.day-number {
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 900;
  padding: 2px 5px;
  border-radius: 9px;
  min-width: 28px;
  text-align: left;
}
.day-number:not(:disabled):hover { background: rgba(0, 131, 62, .1); }
.event-count {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--cens-green-800);
  color: white;
  font-size: .72rem;
  font-weight: 900;
  box-shadow: 0 5px 10px rgba(0,75,45,.18);
}
.event-stack { display: grid; align-content: start; gap: 5px; min-height: 0; overflow: auto; padding-right: 2px; }
.event-pill {
  border: 1px solid currentColor;
  border-left-width: 4px;
  border-radius: 10px;
  padding: 6px 8px;
  font-size: .72rem;
  font-weight: 850;
  line-height: 1.12;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(255,255,255,.75);
  transition: transform .16s ease, box-shadow .16s ease;
}
.event-pill:hover { transform: translateY(-1px); box-shadow: 0 6px 12px rgba(0,0,0,.08); }

.side-panel { padding: 0; min-height: 520px; overflow: hidden; background: #f7faf8; display: flex; flex-direction: column; }
.side-header { padding: 18px 18px 14px; border-bottom: 1px solid var(--line); background: white; }
.side-header h3 { margin: 0; color: var(--cens-green-950); font-size: 1.28rem; letter-spacing: -.02em; }
#selectedDayHint { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }
.side-events { padding: 14px; overflow: auto; display: grid; align-content: start; gap: 12px; flex: 1; }
.empty-state { color: var(--muted); font-weight: 650; }
.event-card {
  border-radius: var(--radius-lg);
  border: 2px solid var(--line);
  padding: 14px;
  background: white;
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
  position: relative;
  overflow: hidden;
}
.event-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--type-color, var(--cens-green-800));
}
.event-card.selected-event { box-shadow: 0 14px 26px rgba(0,75,45,.12); }
.event-card h4 { margin: 0 0 10px 6px; font-size: 1rem; color: var(--text); line-height: 1.16; }
.event-card p { margin: 6px 0 0 6px; color: var(--muted); font-size: .9rem; }
.type-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: .74rem; font-weight: 900; margin: 10px 0 0 6px; }
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 7px; }

.legend-card { margin-top: 16px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.legend-card h3 { margin: 0; color: var(--cens-green-950); }
.legend-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 10px; background: white; font-weight: 800; color: var(--text); font-size: .85rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--type-color); }

@media (max-width: 1180px) {
  .content-grid { grid-template-columns: 1fr; }
  .side-panel { min-height: 320px; }
  :root { --cell-min: 118px; }
}
@media (max-width: 860px) {
  .hero-card { align-items: flex-start; flex-direction: column; }
  .hero-actions { width: 100%; }
  .metric-card { flex: 1; }
  .filters-card { grid-template-columns: 1fr 1fr; }
  .filter-buttons { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr; }
  .calendar-card { overflow-x: auto; }
  .weekdays, .calendar-grid { min-width: 840px; }
  .legend-card { align-items: flex-start; flex-direction: column; }
  .legend-list { justify-content: flex-start; }
}
@media (max-width: 520px) {
  .app-shell { padding: 10px; }
  .brand-badge { width: 48px; height: 48px; border-radius: 16px; }
  .hero-left { align-items: flex-start; }
  .filters-card { grid-template-columns: 1fr; }
  .filter-buttons { grid-template-columns: 1fr; }
  .calendar-toolbar { padding-inline: 12px; grid-template-columns: 42px 1fr 42px; }
  .nav-button { width: 40px; height: 40px; }
}

/* =========================================================
   Ajuste PRO: vista desktop sin scroll inicial
   Objetivo: que el schedule mensual completo se vea al abrir
   en pantallas de PC, usando el alto disponible del viewport.
   ========================================================= */
@media (min-width: 1181px) and (min-height: 700px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    height: 100dvh;
    width: min(1880px, 100%);
    padding: 10px 14px;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 10px;
  }

  .hero-card,
  .filters-card,
  .content-grid,
  .legend-card {
    margin-top: 0;
  }

  .hero-card {
    min-height: 82px;
    padding: 12px 18px;
    border-radius: 22px;
  }

  .brand-badge {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: .95rem;
  }

  h1 {
    font-size: clamp(1.35rem, 1.8vw, 2rem);
  }

  .hero-subtitle {
    margin-top: 4px;
    font-size: .9rem;
  }

  .metric-card {
    min-width: 96px;
    padding: 10px 12px;
  }

  .metric-card span {
    font-size: 1.25rem;
  }

  .filters-card {
    padding: 10px 14px;
    border-radius: 20px;
    grid-template-columns: 180px 130px auto;
  }

  .filter-field label {
    margin-bottom: 5px;
    font-size: .68rem;
  }

  .filter-field select,
  .secondary-button,
  .ghost-button {
    height: 40px;
    border-radius: 13px;
  }

  .content-grid {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) minmax(310px, 390px);
    gap: 12px;
    align-items: stretch;
  }

  .calendar-card {
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 22px;
  }

  .calendar-toolbar {
    flex: 0 0 auto;
    padding: 8px 12px 7px;
    grid-template-columns: 40px 1fr 40px;
  }

  .calendar-toolbar h2 {
    font-size: clamp(1.15rem, 1.5vw, 1.55rem);
  }

  .calendar-toolbar .eyebrow {
    margin-bottom: 2px;
    font-size: .62rem;
  }

  .nav-button {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    font-size: 1.55rem;
  }

  .weekdays {
    flex: 0 0 30px;
  }

  .weekdays span {
    padding: 7px 6px;
    font-size: .78rem;
  }

  .calendar-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(0, 1fr));
  }

  .day-cell {
    min-height: 0;
    padding: 5px;
    gap: 4px;
  }

  .day-number {
    min-width: 24px;
    padding: 1px 5px;
    font-size: .78rem;
  }

  .event-count {
    min-width: 21px;
    height: 21px;
    font-size: .66rem;
  }

  .event-stack {
    gap: 3px;
    overflow: hidden;
  }

  .event-pill {
    padding: 4px 6px;
    border-left-width: 3px;
    border-radius: 8px;
    font-size: .64rem;
    line-height: 1.05;
  }

  .side-panel {
    min-height: 0;
    border-radius: 22px;
  }

  .side-header {
    padding: 12px 14px 10px;
  }

  .side-header h3 {
    font-size: 1.05rem;
  }

  #selectedDayHint {
    margin-top: 5px;
    font-size: .8rem;
  }

  .side-events {
    padding: 10px;
    gap: 9px;
  }

  .event-card {
    padding: 11px;
    border-radius: 18px;
  }

  .event-card h4 {
    font-size: .9rem;
    margin-bottom: 7px;
  }

  .event-card p {
    font-size: .8rem;
    margin-top: 4px;
  }

  .type-badge {
    padding: 4px 8px;
    font-size: .68rem;
    margin-top: 7px;
  }

  .legend-card {
    padding: 8px 14px;
    border-radius: 20px;
  }

  .legend-card h3 {
    font-size: .95rem;
  }

  .legend-item {
    padding: 6px 9px;
    font-size: .76rem;
  }
}

/* Pantallas de PC más bajas: prioriza calendario y oculta la leyenda para evitar scroll */
@media (min-width: 1181px) and (max-height: 760px) {
  .app-shell {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .legend-card {
    display: none;
  }

  .hero-card {
    min-height: 70px;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .filters-card {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .brand-badge {
    width: 42px;
    height: 42px;
  }

  .hero-subtitle {
    display: none;
  }

  .metric-card small {
    display: none;
  }
}

/* En tablet y celular sí permitimos scroll natural */
@media (max-width: 1180px) {
  html,
  body {
    min-height: 100%;
    overflow: auto;
  }
}

/* =========================================================
   Layout PRO v2: filtros en columna derecha + calendario dominante
   - El lienzo ocupa exactamente la pantalla en PC.
   - La columna derecha contiene filtros arriba y eventos abajo.
   - Tipografías, botones y celdas escalan con el viewport.
   ========================================================= */
:root {
  --ui-gap: clamp(8px, 1.1vw, 14px);
  --ui-pad: clamp(8px, 1.1vw, 16px);
  --hero-h: clamp(66px, 9vh, 104px);
  --legend-h: clamp(40px, 5.6vh, 62px);
  --toolbar-h: clamp(44px, 6.4vh, 68px);
  --week-h: clamp(26px, 3.5vh, 38px);
  --side-w: clamp(320px, 24vw, 430px);
  --fs-xs: clamp(.58rem, .55vw + .35rem, .72rem);
  --fs-sm: clamp(.66rem, .55vw + .42rem, .86rem);
  --fs-md: clamp(.78rem, .6vw + .48rem, 1rem);
  --fs-lg: clamp(1rem, 1vw + .56rem, 1.38rem);
}

@media (min-width: 1181px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    height: 100dvh;
    width: min(1920px, 100%);
    padding: var(--ui-gap);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: var(--ui-gap);
  }

  .hero-card,
  .content-grid,
  .legend-card {
    margin-top: 0;
  }

  .hero-card {
    min-height: 0;
    height: var(--hero-h);
    padding: clamp(8px, 1.1vh, 14px) clamp(14px, 1.3vw, 22px);
    border-radius: clamp(18px, 1.3vw, 24px);
  }

  .brand-badge {
    width: clamp(40px, 4.6vh, 58px);
    height: clamp(40px, 4.6vh, 58px);
    border-radius: clamp(14px, 1vw, 18px);
    font-size: clamp(.82rem, .9vw, 1rem);
  }

  h1 {
    font-size: clamp(1.25rem, 1.7vw, 2.2rem);
  }

  .hero-subtitle {
    margin-top: 3px;
    font-size: var(--fs-sm);
  }

  .metric-card {
    min-width: clamp(78px, 6.2vw, 108px);
    padding: clamp(7px, .8vh, 12px) clamp(9px, .9vw, 14px);
    border-radius: clamp(13px, 1vw, 16px);
  }

  .metric-card span {
    font-size: clamp(1rem, 1.35vw, 1.45rem);
  }

  .metric-card small {
    font-size: var(--fs-xs);
  }

  .content-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--side-w);
    gap: var(--ui-gap);
    align-items: stretch;
  }

  .calendar-card,
  .side-panel {
    min-height: 0;
    height: 100%;
    border-radius: clamp(18px, 1.2vw, 24px);
  }

  .calendar-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .calendar-toolbar {
    flex: 0 0 var(--toolbar-h);
    padding: clamp(6px, .75vh, 10px) clamp(10px, .9vw, 16px);
    grid-template-columns: clamp(34px, 2.5vw, 44px) 1fr clamp(34px, 2.5vw, 44px);
  }

  .calendar-toolbar h2 {
    font-size: clamp(1.05rem, 1.35vw, 1.75rem);
  }

  .calendar-toolbar .eyebrow {
    margin-bottom: 1px;
    font-size: var(--fs-xs);
  }

  .nav-button {
    width: clamp(34px, 2.5vw, 44px);
    height: clamp(34px, 2.5vw, 44px);
    border-radius: clamp(11px, .9vw, 15px);
    font-size: clamp(1.28rem, 1.8vw, 1.85rem);
  }

  .weekdays {
    flex: 0 0 var(--week-h);
  }

  .weekdays span {
    padding: 0 6px;
    display: grid;
    place-items: center;
    font-size: var(--fs-xs);
  }

  .calendar-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(0, 1fr));
  }

  .day-cell {
    min-height: 0;
    padding: clamp(4px, .45vw, 8px);
    gap: clamp(3px, .35vw, 6px);
  }

  .day-number {
    min-width: clamp(22px, 1.7vw, 30px);
    padding: 1px 5px;
    font-size: var(--fs-xs);
  }

  .event-count {
    min-width: clamp(18px, 1.45vw, 24px);
    height: clamp(18px, 1.45vw, 24px);
    font-size: clamp(.56rem, .48vw + .32rem, .72rem);
  }

  .event-stack {
    gap: clamp(2px, .32vw, 5px);
    overflow: hidden;
  }

  .event-pill {
    padding: clamp(3px, .35vw, 6px) clamp(5px, .45vw, 8px);
    border-left-width: 3px;
    border-radius: clamp(7px, .62vw, 10px);
    font-size: clamp(.55rem, .5vw + .30rem, .72rem);
    line-height: 1.05;
  }

  .side-panel {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
    background: #f7faf8;
  }

  .filters-card {
    margin-top: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    background: #ffffff;
    padding: clamp(10px, 1vh, 14px);
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(8px, .8vh, 12px);
  }

  .filter-row {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(90px, .75fr);
    gap: 8px;
    align-items: end;
  }

  .filter-field label {
    margin-bottom: 4px;
    font-size: var(--fs-xs);
  }

  .filter-field select,
  .secondary-button,
  .ghost-button {
    height: clamp(34px, 4.6vh, 42px);
    border-radius: clamp(11px, .8vw, 14px);
    font-size: var(--fs-sm);
  }

  .full-button {
    width: 100%;
    justify-content: center;
  }

  .side-header {
    padding: clamp(10px, 1vh, 14px) clamp(12px, 1vw, 16px);
  }

  .side-header h3 {
    font-size: clamp(.98rem, .9vw, 1.2rem);
  }

  #selectedDayHint {
    margin-top: 4px;
    font-size: var(--fs-xs);
  }

  .side-events {
    min-height: 0;
    padding: clamp(8px, .8vw, 12px);
    gap: clamp(8px, .8vh, 12px);
    overflow: auto;
  }

  .event-card {
    padding: clamp(9px, .8vw, 13px);
    border-radius: clamp(16px, 1vw, 20px);
  }

  .event-card h4 {
    font-size: clamp(.82rem, .72vw, 1rem);
    margin-bottom: 7px;
  }

  .event-card p {
    font-size: var(--fs-xs);
    margin-top: 4px;
  }

  .type-badge {
    padding: 4px 8px;
    font-size: var(--fs-xs);
    margin-top: 7px;
  }

  .legend-card {
    min-height: 0;
    height: var(--legend-h);
    padding: clamp(7px, .7vh, 11px) clamp(12px, 1vw, 16px);
    border-radius: clamp(16px, 1.1vw, 21px);
    overflow: hidden;
  }

  .legend-card h3 {
    font-size: clamp(.82rem, .8vw, 1rem);
  }

  .legend-item {
    padding: 5px 9px;
    font-size: var(--fs-xs);
  }
}

/* En pantallas muy bajas, se conserva todo visible compactando más. */
@media (min-width: 1181px) and (max-height: 760px) {
  :root {
    --hero-h: 64px;
    --legend-h: 0px;
    --toolbar-h: 42px;
    --week-h: 25px;
  }

  .legend-card {
    display: none;
  }

  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .hero-card {
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .hero-subtitle,
  .metric-card small {
    display: none;
  }

  .brand-badge {
    width: 38px;
    height: 38px;
  }

  h1 {
    font-size: clamp(1.1rem, 1.45vw, 1.65rem);
  }

  .filters-card {
    padding: 8px 10px;
    gap: 7px;
  }

  .side-header {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

/* Pantallas medianas: filtros arriba del panel antes de eventos, pero con scroll natural. */
@media (max-width: 1180px) {
  .side-panel {
    display: flex;
    flex-direction: column;
  }

  .filters-card {
    margin-top: 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
    display: grid;
    grid-template-columns: 1fr;
  }

  .filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .full-button {
    width: 100%;
  }
}


/* Ajuste solicitado: sin filtros de mes/año; botón único para días con varios eventos */
.event-pill-summary {
  color: #ffffff !important;
  border-color: var(--cens-green-800) !important;
  background: linear-gradient(135deg, var(--cens-green-800), var(--cens-green-600)) !important;
  text-align: center;
  border-left-width: 1px;
}
.event-pill-summary:hover {
  box-shadow: 0 8px 14px rgba(0, 107, 63, .18);
}
@media (min-width: 1181px) {
  .side-panel {
    grid-template-rows: auto minmax(0, 1fr);
  }
}
