/* =========================
   LIT-CRM HR CALENDAR (CRM-ALIGNED SPACING FIX)
   ========================= */

.hr-calendar-page {
  display: grid;
  gap: 18px;
}

/* Shared card spacing */
.hr-calendar-hero,
.hr-calendar-admin-card,
.hr-calendar-card,
.hr-calendar-feedback {
  width: 100%;
  padding: 18px 18px 20px;
  box-sizing: border-box;
}

/* ===== HEADERS ===== */

.hr-calendar-kicker {
  color: #166534;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hr-calendar-title,
.hr-calendar-section-title {
  margin: 6px 0 0;
  color: #1e293b;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.hr-calendar-copy,
.hr-calendar-section-copy {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.hr-calendar-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
}

.hr-calendar-status.is-success {
  background: #dcfce7;
  color: #166534;
}

.hr-calendar-status.is-error {
  background: #fee2e2;
  color: #991b1b;
}

/* ===== FORM ===== */

.hr-calendar-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.hr-calendar-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.hr-calendar-field label {
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.hr-calendar-field-wide {
  grid-column: 1 / -1;
}

/* ===== CALENDAR SECTION WRAP ===== */

.hr-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.hr-calendar-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 2px;
}

.hr-calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.hr-calendar-swatch {
  width: 10px;
  height: 10px;
  border-radius: 4px;
  border: 1px solid rgba(15, 23, 42, .08);
}

.hr-calendar-swatch.is-holiday { background: #dcfce7; }
.hr-calendar-swatch.is-absence { background: #e0f2fe; }
.hr-calendar-swatch.is-today { background: #fef3c7; }

/* This is the important wrapper gutter fix */
.hr-calendar-root {
  width: 100%;
  padding: 6px 2px 2px;
  box-sizing: border-box;
}

.hr-cal {
  width: 100%;
}

/* ===== TOOLBAR ===== */

.hr-cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 0 2px;
  box-sizing: border-box;
}

.hr-cal-toolbar .left,
.hr-cal-toolbar .right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hr-cal-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
  text-align: center;
}

.hr-cal-year-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ===== GRID ===== */

.hr-cal-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 8px;
  table-layout: fixed;
  margin: 0;
}

.hr-cal-grid th {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-align: center;
  padding: 0 4px 4px;
}

.hr-cal-cell {
  vertical-align: top;
  padding: 0;
}

.hr-cal-day {
  min-height: 118px;
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 10px 10px 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.hr-cal-day:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.hr-cal-cell.is-other-month .hr-cal-day {
  opacity: .52;
  background: #f8fafc;
}

.hr-cal-cell.is-holiday .hr-cal-day {
  border-color: #b7ebc6;
  background: #f0fdf4;
}

.hr-cal-cell.has-absence .hr-cal-day {
  border-color: #bfdbfe;
}

.hr-cal-cell.is-today .hr-cal-day {
  border-color: #f5d28b;
  background: #fffaf0;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, .08);
}

.hr-cal-daynum {
  font-weight: 700;
  color: #0f172a;
  font-size: 13px;
  line-height: 1;
  margin-bottom: 2px;
}

.hr-cal-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.hr-cal-event,
.hr-cal-more {
  display: block;
  width: 100%;
  border-radius: 7px;
  padding: 5px 7px;
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
  box-sizing: border-box;
}

.hr-cal-event {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
}

.hr-cal-event-holiday {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
  cursor: pointer;
}

.hr-cal-event-holiday:hover,
.hr-cal-event-holiday:focus-visible {
  background: #c8f7d7;
  border-color: #6ee7a1;
}

.hr-cal-event-absence {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
  font-weight: 600;
}

.hr-cal-more {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  border: 1px dashed #cbd5e1;
}

/* ===== MODAL ===== */

.hr-holiday-modal[hidden] {
  display: none;
}

.hr-holiday-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.hr-holiday-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .56);
}

.hr-holiday-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 32px));
  margin: 8vh auto 0;
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .22);
}

.hr-holiday-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 28px;
  cursor: pointer;
}

.hr-holiday-modal-meta {
  color: #166534;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hr-holiday-modal-dialog h2 {
  margin: 0 0 10px;
  color: #1e293b;
  font-size: 20px;
  font-weight: 700;
}

.hr-holiday-modal-note,
.hr-holiday-modal-dialog p {
  color: #475569;
  line-height: 1.7;
}

body.hr-holiday-modal-open {
  overflow: hidden;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 860px) {
  .hr-calendar-hero,
  .hr-calendar-admin-card,
  .hr-calendar-card,
  .hr-calendar-feedback {
    padding: 16px;
  }

  .hr-calendar-form {
    grid-template-columns: 1fr;
  }

  .hr-cal-grid {
    border-spacing: 6px;
  }

  .hr-cal-day {
    min-height: 108px;
    padding: 8px;
  }
}

@media (max-width: 640px) {
  .hr-cal-toolbar {
    align-items: flex-start;
  }

  .hr-cal-title {
    width: 100%;
    order: 3;
    font-size: 18px;
    text-align: left;
  }

  .hr-calendar-root {
    padding: 4px 0 0;
  }

  .hr-cal-grid {
    border-spacing: 5px;
  }

  .hr-cal-day {
    min-height: 96px;
  }
}
/* ---- Holiday list with removal -------------------------------------------- */
.hr-holiday-list { list-style: none; margin: 6px 0 0; padding: 0; }
.hr-holiday-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 2px;
  border-top: 1px solid var(--border, rgba(17,24,39,.10));
}
.hr-holiday-row:first-child { border-top: 0; }
/* A date already gone stays listed but reads as history. */
.hr-holiday-row.is-past { opacity: .55; }
.hr-holiday-date {
  flex: 0 0 96px; font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--text, #111827);
}
.hr-holiday-name { flex: 1 1 auto; min-width: 0; font-size: 14px; }
.hr-holiday-note {
  display: block; font-size: 12px; color: var(--muted, #6b7280);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hr-holiday-delete-form { flex: 0 0 auto; margin: 0; }
.hr-holiday-delete {
  font: inherit; font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
  color: #b42318; background: transparent;
  border: 1px solid rgba(180, 35, 24, .35);
}
.hr-holiday-delete:hover { background: rgba(180, 35, 24, .08); }
.hr-holiday-delete:focus-visible { outline: 2px solid #b42318; outline-offset: 1px; }


/* [2026-08-30] Whether the office actually closes on a calendar entry.
   A national holiday is not automatically a day off here — it is granted, usually
   about a week ahead — so the state has to be visible at a glance and one click
   from being changed. */
.hr-holiday-obs{display:inline-block;padding:2px 8px;border-radius:999px;
  font-size:.62rem;font-weight:800;letter-spacing:.06em;white-space:nowrap;
  background:rgba(100,116,139,.18);color:inherit;opacity:.75;}
.hr-holiday-obs.is-off{background:#dcfce7;color:#166534;opacity:1;}
.hr-holiday-obs-form{display:inline;}
.hr-holiday-obs-btn{background:none;border:0;padding:0 6px;cursor:pointer;
  font:inherit;font-size:.78rem;color:#0369a1;text-decoration:underline;}
.hr-holiday-obs-btn:hover{opacity:.7;}
