/* Layout crítico del calendario — carga síncrona desde index.html.
   Debe coincidir con .datei-page-fill + reglas en ui-datei. */
.datei-calendar-page {
  display: flex;
  flex: 1 1 0%;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 1rem;
}

.datei-calendar-panel {
  display: flex;
  flex: 1 1 0%;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
}

.datei-calendar-toolbar {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 1rem;
}

.datei-cal-page {
  display: flex;
  flex: 1 1 0%;
  flex-direction: row;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
}

.datei-cal-aside {
  display: flex;
  width: 16rem;
  flex: 0 0 16rem;
  align-self: stretch;
  height: 100%;
  max-height: 100%;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0.75rem;
}

.datei-cal-aside-title {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.datei-cal-aside-list {
  flex: 1 1 0%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.datei-cal-main {
  flex: 1 1 0%;
  align-self: stretch;
  height: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.75rem;
}

/* auto-fit: aprovecha el ancho; minmax evita colapsar a 1 col estrecha */
.datei-year-cal {
  display: grid !important;
  gap: 1rem !important;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)) !important;
}
.datei-year-cal--compact {
  gap: 0.5rem !important;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)) !important;
}

@media (max-width: 1023px) {
  .datei-calendar-page {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .datei-cal-page {
    flex: 1 1 auto;
    flex-direction: column;
    overflow: visible;
  }

  .datei-cal-aside {
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    max-height: 40vh;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }

  .datei-cal-main {
    height: auto;
    max-height: none;
    overflow: visible;
  }
}
