/* Holiday calendar – same grid feel as working hours, public holidays + absences */
.holiday-calendar {
  max-width: min(960px, 100%);
  font-family: 'Josefin Sans', sans-serif;
  font-size: clamp(0.875rem, 0.82rem + 0.28vw, 1.0625rem);
}

@media (min-width: 1536px) {
  .holiday-calendar {
    max-width: min(1120px, 100%);
  }
}

.hc-month-title {
  font-weight: 600;
  min-width: 0;
  flex: 1 1 10rem;
  text-align: center;
  color: var(--hr-text, #333);
  overflow-wrap: anywhere;
}

.hc-loading {
  padding: 2rem;
  text-align: center;
  color: #6c757d;
}

.hc-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.hc-cell {
  min-width: 0;
  min-height: clamp(5.5rem, 4.75rem + 2vw, 6.75rem);
  padding: 10px;
  border-radius: 10px;
  border: 2px solid #e2e2e2;
  transition: border-color 0.15s ease, background 0.15s ease;
  overflow: hidden;
  box-sizing: border-box;
}

.hc-header {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--hr-primary, #00573C);
  min-height: auto;
  min-width: 0;
  padding: 10px;
  background: var(--hr-panel, #F8F5F0) !important;
  border-color: rgba(0, 87, 60, 0.15) !important;
  text-align: center;
  overflow-wrap: anywhere;
}

.hc-empty {
  background: #f5f5f5;
  border-color: #e8e8e8;
}

/* Weekday with nothing on it – subtle tint so grid doesn’t look blank */
.hc-day {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fafafa;
}

/* Weekend – clearly distinct */
.hc-day.hc-weekend {
  background: #d8d8d8;
  border-color: #c5c5c5;
}
.hc-day.hc-weekend .hc-day-num {
  color: #666;
}
.hc-day.hc-weekend .hc-day-label {
  color: #777;
  font-size: 0.7rem;
  margin-top: 2px;
}

/* Public holiday day */
.hc-day.hc-publicholiday {
  background: rgba(108, 117, 125, 0.18);
  border-color: rgba(108, 117, 125, 0.4);
}
.hc-day.hc-publicholiday.hc-weekend {
  background: rgba(108, 117, 125, 0.25);
}

.hc-day-public {
  margin-top: 2px;
  margin-bottom: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.hc-badge-ph {
  font-size: 0.7rem;
  font-weight: 500;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
  text-align: left;
  hyphens: auto;
}

.hc-day-num {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

/* Day with employee absences */
.hc-day.hc-has-absence {
  border-color: rgba(13, 110, 253, 0.35);
  background: rgba(13, 110, 253, 0.06);
}

.hc-day-absence-btn {
  margin-top: auto;
  padding: 4px 6px;
  border: 1px solid rgba(13, 110, 253, 0.3);
  border-radius: 6px;
  background: rgba(13, 110, 253, 0.08);
  cursor: pointer;
  text-align: left;
  font-size: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
  align-self: stretch;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.hc-day-absence-btn:hover {
  background: rgba(13, 110, 253, 0.15);
  border-color: rgba(13, 110, 253, 0.5);
}
.hc-day-absence-btn .badge {
  font-size: 0.75rem;
  font-weight: 500;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
  text-align: left;
  display: inline-block;
}

.hc-day.hc-today {
  border-color: var(--hr-accent, #BFA253);
  box-shadow: 0 0 0 2px rgba(191, 162, 83, 0.35);
}

/* Optional label in empty cells so grid feels less empty */
.hc-day-label {
  font-size: 0.7rem;
  color: #999;
  margin-top: 4px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.2;
}
.hc-day-label-working {
  color: #bbb;
}

/* Legend and summary below calendar */
.hc-footer {
  padding-top: 4px;
  border-top: 1px solid #eee;
}
.hc-legend {
  font-size: 0.85rem;
  color: #555;
}
.hc-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}
.hc-legend-weekend {
  background: #d8d8d8;
}
.hc-legend-ph {
  background: rgba(108, 117, 125, 0.35);
}
.hc-legend-absence {
  background: rgba(13, 110, 253, 0.25);
}

/* Modal for "who is absent" */
.hc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  padding: 16px;
}

.hc-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 87, 60, 0.12);
  border: 1px solid rgba(191, 162, 83, 0.2);
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-sizing: border-box;
}

.hc-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 16px 20px;
  border-bottom: 1px solid #e9ecef;
}

.hc-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--hr-primary, #00573C);
  min-width: 0;
  overflow-wrap: anywhere;
}

.hc-modal-body {
  padding: 20px;
}

.hc-absence-item {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
}

.hc-absence-item strong {
  overflow-wrap: anywhere;
}

.hc-absence-item:last-child {
  border-bottom: none;
}

@media (max-width: 900px) {
  .hc-grid {
    gap: 6px;
  }
  .hc-cell {
    padding: 6px 5px;
  }
  .hc-header {
    padding: 6px 4px;
    font-size: 0.72rem;
  }
}
