/* Página de eventos: filtros | (calendario + agenda) */
.ev-head { padding-block: 32px 16px; display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.ev-head h1 { font-size: 32px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button { border: 1px solid var(--line); background: var(--raised); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13.5px; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.quick button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* Los filtros ocupan SOLO su columna; calendario y agenda van juntos en la otra.
   Así el panel fijo de filtros nunca se monta sobre la agenda al hacer scroll. */
.ev-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; padding-bottom: 56px; align-items: start; }
.ev-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; min-width: 0; }

.filters {
  position: sticky; top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 32px); overflow: auto;
  display: flex; flex-direction: column; gap: 20px; padding-right: 4px;
}
.fgroup h4 { font: 600 11.5px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.fopt { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.fopt:hover { background: var(--surface); }
.fopt input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.fopt .count { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.fopt .hol-sw { width: 10px; height: 10px; border-radius: 3px; background: var(--holiday); }

/* Calendario */
.cal { border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); overflow: hidden; min-width: 0; }
.cal-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cal-bar h2 { font-size: 19px; min-width: 170px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-left: auto; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }

.dow { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.dow span { padding: 8px 10px; font: 600 11px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day {
  min-height: 112px; min-width: 0; padding: 6px; cursor: pointer;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 3px;
}
.day:nth-child(7n) { border-right: 0; }
.day:hover { background: var(--surface); }
.day.out { color: var(--muted); background: color-mix(in srgb, var(--surface) 55%, transparent); }
.day.holiday { background: var(--holiday-soft); }
.day .num { font: 600 13px var(--f-display); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.day.holiday .num { color: var(--holiday); }
.day.today .num { background: var(--accent); color: var(--accent-fg); }
.day.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.day.inrange { background: var(--accent-soft); }
.day .hol { font-size: 10.5px; line-height: 1.2; font-weight: 600; color: var(--holiday); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day .evs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.evchip { display: flex; align-items: center; gap: 5px; font-size: 12px; line-height: 1.3; padding: 2px 6px; border-radius: 6px; background: var(--surface); border: 0; cursor: pointer; text-align: left; width: 100%; min-width: 0; }
.evchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evchip.multi { box-shadow: inset 3px 0 0 var(--c1); }
.evchip:hover { background: var(--accent-soft); }
.more { font-size: 11.5px; color: var(--muted); padding-left: 6px; }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.wcol { border-right: 1px solid var(--line); min-height: 380px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wcol:last-child { border-right: 0; }
.wcol.holiday { background: var(--holiday-soft); }
.wcol .wd { font: 600 12px var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; background: none; border: 0; padding: 4px; text-align: left; cursor: pointer; border-radius: 6px; }
.wcol .wd b { display: block; font: 700 22px var(--f-display); color: var(--fg); letter-spacing: 0; }
.wcol.today .wd b { color: var(--accent); }
.wcol .hol { font-size: 11.5px; font-weight: 600; color: var(--holiday); padding: 0 4px; }
.wcard { border: 1px solid var(--line); border-left: 3px solid var(--c1); border-radius: 8px; padding: 6px 8px; font-size: 12.5px; cursor: pointer; background: var(--raised); text-align: left; min-width: 0; }
.wcard b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.wcard small { color: var(--muted); }

.year { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 18px; }
.mini h3 { font-size: 14px; margin-bottom: 6px; cursor: pointer; }
.mini h3:hover { color: var(--accent); }
.mini .mg { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini .md { font-size: 11px; text-align: center; padding: 3px 0; border-radius: 4px; border: 0; background: none; cursor: pointer; font-variant-numeric: tabular-nums; }
.mini .md.has { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.mini .md.hol { color: var(--holiday); font-weight: 700; box-shadow: inset 0 -2px 0 var(--holiday); }
.mini .md.today { outline: 1.5px solid var(--accent); }

.legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-hol { background: var(--holiday-soft); box-shadow: inset 0 0 0 1.5px var(--holiday); }
.lg-today { background: var(--accent); border-radius: 50% !important; }
.lg-multi { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }

/* Agenda del día o rango */
.agenda {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--raised);
  position: sticky; top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 32px);
  display: flex; flex-direction: column; min-width: 0;
}
.agenda header { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.agenda header h3 { font-size: 17px; margin-top: 6px; }
.agenda .list { overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.hol-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--holiday-soft); color: var(--holiday); font-weight: 600; font-size: 13.5px; }
.arow { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; padding: 10px; border-radius: 10px; cursor: pointer; background: none; border: 0; text-align: left; width: 100%; }
.arow:hover { background: var(--surface); }
.dbadge { border-radius: 10px; text-align: center; padding: 6px 0; background: var(--surface); border: 1px solid var(--line); }
.dbadge b { display: block; font: 700 18px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.dbadge small { font: 600 10.5px var(--f-mono); text-transform: uppercase; color: var(--muted); }
.arow h4 { font-family: var(--f-body); font-size: 14.5px; font-weight: 600; letter-spacing: 0; }
.arow .meta { flex-wrap: wrap; margin-top: 3px; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.filter-toggle { display: none !important; }

@media (max-width: 1180px) {
  .ev-main { grid-template-columns: minmax(0, 1fr); }
  .agenda { position: static; max-height: none; }
}
@media (max-width: 820px) {
  .ev-layout { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; max-height: none; display: none; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--raised); }
  .filters.open { display: flex; }
  .filter-toggle { display: inline-flex !important; }
  .day { min-height: 64px; padding: 4px; }
  .day .hol { display: none; }
  .day .evs { flex-direction: row; flex-wrap: wrap; }
  .day .evchip { width: auto; padding: 0; background: none; box-shadow: none; }
  .day .evchip span { display: none; }
  .day .evchip .dot { width: 7px; height: 7px; }
  .more { display: none; }
  .week { grid-template-columns: minmax(0, 1fr); }
  .wcol { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .year { grid-template-columns: repeat(2, 1fr); }
  .cal-bar h2 { min-width: 0; }
}
.wempty { padding: 4px; }

/* Vista semanal en filas (legible aunque el espacio sea angosto) */
.week { display: flex; flex-direction: column; }
.wrow { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); align-items: start; }
.wrow:last-child { border-bottom: 0; }
.wrow.holiday { background: var(--holiday-soft); }
.wrow .wd { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 1px solid var(--line); border-radius: 12px; padding: 6px 0; cursor: pointer; color: var(--muted); }
.wrow .wd small { font: 600 11px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; }
.wrow .wd b { font: 700 20px/1 var(--f-display); color: var(--fg); font-variant-numeric: tabular-nums; }
.wrow .wd:hover { border-color: var(--accent); }
.wrow.today .wd { background: var(--accent); border-color: var(--accent); }
.wrow.today .wd small, .wrow.today .wd b { color: var(--accent-fg); }
.wevs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; align-items: start; min-width: 0; padding-top: 2px; }
.wevs .hol { grid-column: 1 / -1; display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--holiday); }
.wevs .wcard { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; }
.wevs .wcard b { font-size: 13.5px; line-height: 1.3; }
.wevs .wcard:hover { border-color: var(--accent); border-left-color: var(--c1); }
.wempty { padding: 10px 0; }

/* Atajos de fecha como grupo segmentado */
.quick { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.quick button { border: 0; background: transparent; padding: 7px 14px; color: var(--muted); }
.quick button:hover { color: var(--fg); background: var(--raised); }
.quick button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
@media (max-width: 820px) { .quick { border-radius: 16px; } }

/* Eventos del día en fila deslizable con flechas */
.wscroll { position: relative; min-width: 0; }
.wscroll .wevs { display: flex; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px; }
.wscroll .wevs::-webkit-scrollbar { display: none; }
.wscroll .wevs .wcard { flex: 0 0 220px; scroll-snap-align: start; }
.wscroll .wevs .hol { flex: 0 0 auto; align-self: center; margin-right: 8px; }
.wnav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--raised); box-shadow: var(--shadow); display: none; place-items: center; cursor: pointer; color: var(--fg); }
.wnav.prev { left: -6px; } .wnav.next { right: -6px; }
.wscroll.can-prev .wnav.prev, .wscroll.can-next .wnav.next { display: grid; }
.wnav .ico { width: 16px; height: 16px; }
.add-day { margin-top: 8px; border-style: dashed; color: var(--accent); }
