/* Calendar view (/calendario) */

.calendar-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin: 4px 0 18px;
  font-size: 13px;
  color: #555;
}

.calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.cal-dot {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  display: inline-block;
}

.cal-dot-enabled {
  background-color: #fff;
  border: 1px solid var(--color6);
}

.cal-dot-holiday {
  background-color: #fce8e8;
  border: 1px solid #c62828;
}

/* PSP calendar legend dots: circles, to match the dots shown on each day */
.cal-dot-exam,
.cal-dot-session {
  border-radius: 50%;
}

.cal-dot-exam {
  background-color: #e07b00;
}

.cal-dot-session {
  background-color: #2a6fb0;
}

.calendar-legend-hint {
  color: #888;
  font-style: italic;
}

/* months grid: responsive columns */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  padding-bottom: 24px;
}

.calendar-month {
  border: 1px solid var(--color6);
  border-radius: var(--radius, 10px);
  background-color: #fff;
  box-shadow: var(--shadow-sm, 0 1px 4px rgba(0, 0, 0, 0.06));
  padding: 12px;
}

.calendar-month-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color1);
  text-align: center;
  margin-bottom: 10px;
}

.calendar-week-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}

.calendar-wd {
  font-size: 11px;
  font-weight: 600;
  color: #999;
  text-align: center;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-day {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #333;
  background-color: #eef1f3;
  border: 1px solid #dde3e7;
  border-radius: 5px;
  cursor: pointer;
  transition: var(--transition, all 0.15s ease);
  font-family: inherit;
}

.calendar-day:hover {
  background-color: var(--color3);
  border-color: var(--color2);
}

.calendar-day:focus {
  outline: none;
}

.calendar-day:disabled {
  opacity: 0.5;
  cursor: default;
}

.calendar-day-empty {
  background: none;
  border: none;
  cursor: default;
  pointer-events: none;
}

/* past days: read-only, lighter */
.calendar-day-past {
  opacity: 0.65;
  cursor: default;
  color: #888;
}

.calendar-day-past:hover {
  background-color: #eef1f3;
  border-color: #dde3e7;
}

/* a past holiday keeps the red tint but faded */
.calendar-day-past.calendar-day-holiday:hover {
  background-color: #fce8e8;
  border-color: #c62828;
}

/* holiday / disabled day */
.calendar-day-holiday {
  background-color: #fce8e8;
  border-color: #c62828;
  color: #c62828;
  font-weight: 600;
}

.calendar-day-holiday:hover {
  background-color: #f9d9d9;
  border-color: #c62828;
}

/* event days (exam / info session): the day stays neutral and the event type is
   shown with a colored dot below the number, so a day can carry both at once. */
.calendar-day-exam,
.calendar-day-session {
  font-weight: 600;
  color: #333;
}

/* dots row, pinned to the bottom-center so the number stays centered */
/* smaller day number to leave room for the dots + "+N" badges below */
.calendar-day-num {
  font-size: 11px;
  line-height: 1;
}

.calendar-day-dots {
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}

.calendar-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.calendar-dot-exam {
  background-color: #e07b00; /* orange: PSP exam */
}

.calendar-dot-session {
  background-color: #2a6fb0; /* blue: info session (charla) */
}

/* read-only field (exam date popup) */
.input-static {
  font-size: 14px;
  color: #333;
  padding: 8px 2px;
  font-weight: 500;
}

/* PSP exams calendar: days are created from the top buttons, so a plain day has
   no special cursor. days that hold an exam or a session show the pointer (edit). */
.psp-calendar .calendar-day {
  cursor: default;
}

.psp-calendar .calendar-day-exam,
.psp-calendar .calendar-day-session {
  cursor: pointer;
}

.psp-calendar .calendar-day-empty,
.psp-calendar .calendar-day-past,
.psp-calendar .calendar-day:disabled {
  cursor: default;
}

/* day selector popup (cspp): list of the day's events, each with a delete X */
.day-events {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-event {
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-event-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background-color: #f5f7f8;
  border: 1px solid #dde3e7;
  border-radius: var(--radius, 6px);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: #333;
  text-align: left;
  transition: var(--transition, all 0.15s ease);
}

.day-event-main:hover {
  background-color: #eef1f3;
  border-color: var(--color2);
}

.day-event-main:focus {
  outline: none;
}

.day-event-edit,
.day-event-del {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  border: 1px solid #dde3e7;
  border-radius: var(--radius, 6px);
  cursor: pointer;
  transition: var(--transition, all 0.15s ease);
}

.day-event-edit {
  color: var(--color1, #294552);
}

.day-event-edit:hover {
  background-color: var(--color3, #e4eef2);
  border-color: var(--color2, #A6C5D3);
}

.day-event-del {
  color: var(--errorColor, #c62828);
}

.day-event-del:hover {
  background-color: #fbeaea;
  border-color: var(--errorColor, #c62828);
}

.day-event-edit:focus,
.day-event-del:focus {
  outline: none;
}

/* year navigation (chevrons): prev / year / next. only two years available. */
.year-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.year-nav-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  border: 1px solid var(--color6, #c7d4d9);
  border-radius: var(--radius, 6px);
  color: var(--color1, #294552);
  cursor: pointer;
  transition: var(--transition, all 0.15s ease);
}

.year-nav-btn:hover:not(:disabled) {
  background-color: var(--color3, #e4eef2);
  border-color: var(--color2, #A6C5D3);
}

.year-nav-btn:focus {
  outline: none;
}

.year-nav-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.year-nav-value {
  min-width: 48px;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  color: #4a4a4a;
}
