:root {
  --calendar-navy: #0f172a;
  --calendar-blue: #1d4ed8;
}

/* FullCalendar uses its own internal markup, so these rules make it match the site. */
.fc {
  --fc-border-color: #e2e8f0;
  --fc-button-bg-color: #0f172a;
  --fc-button-border-color: #0f172a;
  --fc-button-hover-bg-color: #1e293b;
  --fc-button-hover-border-color: #1e293b;
  --fc-button-active-bg-color: #1d4ed8;
  --fc-button-active-border-color: #1d4ed8;
  --fc-today-bg-color: rgba(29, 78, 216, 0.07);
  font-family: "DM Sans", sans-serif;
}

.fc .fc-toolbar {
  gap: 0.75rem;
  flex-wrap: wrap;
}

.fc .fc-toolbar-title {
  color: var(--calendar-navy);
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.fc .fc-button {
  border-radius: 0.7rem;
  box-shadow: none;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.55rem 0.75rem;
}

.fc .fc-col-header-cell-cushion,
.fc .fc-daygrid-day-number,
.fc .fc-timegrid-axis-cushion,
.fc .fc-timegrid-slot-label-cushion {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.fc .fc-daygrid-day-frame {
  min-height: 6rem;
}

.fc .fc-event {
  border-radius: 0.55rem;
  cursor: pointer;
  overflow: hidden;
  transition: opacity 150ms ease, filter 150ms ease, transform 150ms ease;
}

.fc .fc-event:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
}

/* FullCalendar can render a white inner event surface in some views. Paint
   both layers so every job consistently uses its configured service color. */
.fc .service-color-event,
.fc .service-color-event .fc-event-main {
  background-color: var(--job-service-color, #2563eb) !important;
  color: var(--job-text-color, #ffffff) !important;
}

.fc .calendar-event-content {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.25rem;
  font-size: 0.73rem;
  font-weight: 800;
  line-height: 1.25;
}

.fc .calendar-event-badge {
  display: inline-flex;
  height: 1.15rem;
  width: 1.15rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 0.3rem;
  background: rgba(255,255,255,0.92);
  color: #0f172a;
  font-size: 0.62rem;
  font-weight: 900;
}

.fc .calendar-event-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc .calendar-event-symbol {
  flex: 0 0 auto;
  font-size: 0.7rem;
}

.fc .commercial-event {
  border-width: 2px !important;
  border-color: #0f172a !important;
  box-shadow: inset 3px 0 0 rgba(15, 23, 42, 0.85);
}

.fc .residential-event {
  border-color: rgba(255,255,255,0.95) !important;
  box-shadow: inset 3px 0 0 rgba(255,255,255,0.65);
}

.fc .completed-event {
  opacity: 0.72;
}

.fc .canceled-event {
  opacity: 0.48;
  text-decoration: line-through;
}

.fc .calendar-event-dimmed {
  filter: grayscale(0.75);
  opacity: 0.16 !important;
}

.fc .calendar-event-filter-match {
  filter: saturate(1.2);
  opacity: 1 !important;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.95), 0 2px 7px rgba(15,23,42,0.3);
}

.fc .calendar-day-dimmed {
  background: #f1f5f9 !important;
}

.fc .calendar-day-dimmed .fc-daygrid-day-number {
  color: #cbd5e1;
}

.fc .fc-multimonth {
  border: 0;
}

.fc .fc-multimonth-month {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  overflow: hidden;
}

.fc .fc-multimonth-title {
  color: #0f172a;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .fc .fc-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .fc .fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .fc .fc-toolbar-title {
    text-align: center;
  }

  .fc .fc-daygrid-day-frame {
    min-height: 4.5rem;
  }
}
