/* ==========================================================================
   Shared month / year calendar — used by both the public site and the portal.
   ========================================================================== */

.cal { background: #fff; border: 1px solid var(--line, #e4e9ee); border-radius: 14px; overflow: hidden; }

.cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line, #e4e9ee);
}
.cal__title { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }
.cal__nav { display: flex; align-items: center; gap: 6px; }

.cal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--line, #e4e9ee);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}
.cal__btn:hover { background: #f4f7fa; border-color: #cfd8e2; }
.cal__btn--today { width: auto; padding: 0 12px; font-size: .85rem; font-weight: 700; }

.cal__dow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: #f7f9fb;
  border-bottom: 1px solid var(--line, #e4e9ee);
}
.cal__dow span {
  padding: 9px 10px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7a8896;
}

.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }

.cal__day {
  min-height: 108px;
  padding: 7px 8px;
  border-right: 1px solid var(--line, #e4e9ee);
  border-bottom: 1px solid var(--line, #e4e9ee);
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
}
.cal__day:nth-child(7n) { border-right: 0; }
.cal__day--out { background: #fbfcfd; }
.cal__day--out .cal__num { color: #b8c2cc; }
.cal__day--weekend { background: #fcfdfe; }
.cal__day--past .cal__ev { opacity: .62; }

.cal__num {
  font-size: .82rem;
  font-weight: 700;
  color: #45566a;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.cal__day--today .cal__num { background: #e4002b; color: #fff; }

.cal__ev {
  display: block;
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.25;
  padding: 5px 7px;
  border-radius: 6px;
  background: #eef2f6;
  color: #1f2d3d;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-left: 3px solid #94a3b8;
}
.cal__ev:hover { background: #e2e8f0; }
.cal__ev--open { border-left-color: #16a34a; }
.cal__ev--multi { border-left-color: #e4002b; }
.cal__ev--more { background: none; color: #7a8896; font-weight: 700; cursor: default; }
.cal__ev--more:hover { background: none; }

.cal__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 16px;
  border-top: 1px solid var(--line, #e4e9ee);
  font-size: .8rem;
  color: #6b7a8a;
}
.cal__legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal__legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ------------------------------------------------------------- year view */

.calyear { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

.calmini {
  border: 1px solid var(--line, #e4e9ee);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.calmini:hover { border-color: #e4002b; box-shadow: 0 6px 18px rgba(16, 30, 46, .08); }
.calmini__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.calmini__name { font-size: .9rem; font-weight: 800; }
.calmini__count { font-size: .72rem; font-weight: 800; color: #7a8896; }
.calmini__count--has { color: #e4002b; }
.calmini__dow, .calmini__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.calmini__dow span { font-size: .58rem; font-weight: 800; color: #a9b4bf; text-align: center; }
.calmini__day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: .66rem; font-weight: 600; color: #45566a;
  border-radius: 5px;
}
.calmini__day--out { color: transparent; }
.calmini__day--has { background: #e4002b; color: #fff; font-weight: 800; }
.calmini__day--today { box-shadow: inset 0 0 0 2px #0b1622; }

@media (max-width: 900px) {
  .calyear { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal__day { min-height: 78px; padding: 5px; }
  .cal__ev { font-size: .66rem; padding: 3px 5px; }
}
@media (max-width: 560px) {
  .calyear { grid-template-columns: minmax(0, 1fr); }
  .cal__day { min-height: 62px; }
  .cal__ev { font-size: 0; height: 8px; padding: 0; border-radius: 3px; border-left: 0; }
  .cal__dow span { font-size: .62rem; padding: 7px 4px; }
}
