.legend {
  margin-bottom: 1rem;
}

.legend span {
  margin: 0 10px;
  font-weight: bold;
}

.P::before { content: "● "; color: green; }
.A::before { content: "● "; color: red; }
.R::before { content: "● "; color: blue; }
.H::before { content: "● "; color: orange; }

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  max-width: 100%;
  margin: 0 auto;
}

.day-name, .date-box {
  background: white;
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.day-name {
  background-color: #e4e6eb;
  font-weight: bold;
}

.date-box {
  height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.date-box.today {
  border: 2px solid #007bff;
}

.date {
  font-size: 1.1em;
  font-weight: bold;
}

.status {
  font-size: 1.4em;
  font-weight: bold;
}

.status.P { color: green; }
.status.A { color: red; }
.status.R { color: blue; }
.status.H { color: orange; }

@media (max-width: 600px) {
  .calendar {
    font-size: 0.8em;
  }
}

.status-p { color: green; font-weight: bold; }
.status-h { color: orange; font-weight: bold; }
.status-r { color: blue; font-weight: bold; }
.status-a { color: red; font-weight: bold; }


/* ===============================
   CALENDAR CARD – BASE
================================ */
.calendar-card {
  width: 100%;
}

.calendar-month {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* ===============================
   LEGEND – RESPONSIVE
================================ */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
}

.legend span {
  margin: 0;
}

/* ===============================
   CALENDAR GRID – BASE
================================ */
.calendar-wrapper {
  width: 100%;
  overflow: hidden;
}

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

/* ===============================
   MOBILE (≤576px)
================================ */
@media (max-width: 576px) {
  .calendar-card {
    padding: 1rem !important;
    border-radius: 10px;
  }

  .calendar-header h4 {
    font-size: 1.05rem;
  }

  .calendar-header button {
    padding: 5px 8px;
  }

  .legend {
    font-size: 0.75rem;
    gap: 8px;
  }

  /* Compact grid */
  .calendar {
    gap: 4px;
  }

  .day-name {
    font-size: 0.65rem;
    padding: 6px 4px;
    text-align: center;
  }

  .date-box {
    height: 60px;
    padding: 6px;
  }

  .date {
    font-size: 0.8rem;
  }

  .status {
    font-size: 0.85rem;
  }

  /* Today highlight */
  .date-box.today {
    border-width: 1.5px;
  }
}

/* ===============================
   SMALL PHONES (≤400px)
================================ */
@media (max-width: 400px) {
  .date-box {
    height: 52px;
    padding: 4px;
  }

  .status {
    font-size: 0.75rem;
  }
}

/* ===============================
   TABLET (≤768px)
================================ */
@media (max-width: 768px) {
  .calendar {
    gap: 5px;
  }

  .date-box {
    height: 70px;
  }
}

/* ===============================
   LARGE SCREENS
================================ */
@media (min-width: 1200px) {
  .date-box {
    height: 95px;
  }
}
