:root {
  --theme-primary: #043270;
  --theme-primary-dark: #03295c;
  --theme-primary-soft: rgba(4, 50, 112, 0.11);
  --theme-primary-mid: rgba(4, 50, 112, 0.72);
  --calendar-border: #e5e7eb;
  --calendar-muted: #64748b;
  --calendar-text: #1f2937;
  --calendar-surface: #ffffff;
}

#main.container.calendar-page {
  max-width: 1240px;
  padding: 4.5rem 1.5rem 3.5rem;
}

.outlook-card {
  background: var(--calendar-surface);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.09);
  overflow: hidden;
}

.calendar-card-header {
  align-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--calendar-border);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1.35rem 1.6rem;
}

.calendar-eyebrow {
  color: var(--theme-primary);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 0.22rem;
  text-transform: uppercase;
}

.calendar-card-header h2 {
  color: var(--calendar-text);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
}

.calendar-create-action {
  align-items: center;
  background: var(--theme-primary);
  border: 1px solid var(--theme-primary);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(4, 50, 112, 0.18);
  color: #ffffff !important;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.9rem;
  font-weight: 800;
  gap: 0.45rem;
  height: 40px;
  justify-content: center;
  line-height: 1;
  padding: 0 1rem;
  text-decoration: none !important;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.calendar-create-action:hover,
.calendar-create-action:focus {
  background: var(--theme-primary-dark) !important;
  border-color: var(--theme-primary-dark) !important;
  box-shadow: 0 12px 26px rgba(4, 50, 112, 0.3);
  color: #ffffff !important;
  filter: brightness(1.04);
  transform: translateY(-2px);
}

.calendar-create-action:active {
  box-shadow: 0 6px 14px rgba(4, 50, 112, 0.2);
  transform: translateY(0);
}

.calendar-create-action i,
.calendar-create-action span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
}

.calendar-source {
  align-items: center;
  background: var(--theme-primary-soft);
  border: 1px solid rgba(4, 50, 112, 0.22);
  border-radius: 999px;
  color: var(--theme-primary);
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 800;
  gap: 0.45rem;
  padding: 0.48rem 0.8rem;
  white-space: nowrap;
}

.calendar-body {
  padding: 1.35rem;
}

#calendar {
  background: #ffffff;
  border: 1px solid var(--calendar-border);
  border-radius: 8px;
  min-height: 620px;
  overflow: hidden;
  position: relative;
}

#calendar.is-loading::after {
  align-items: center;
  background: rgba(255, 255, 255, 0.76);
  color: var(--theme-primary);
  content: "Loading calendar...";
  display: flex;
  font-weight: 800;
  inset: 0;
  justify-content: center;
  position: absolute;
  z-index: 5;
}

.fc {
  border: 0 !important;
  color: var(--calendar-text);
  font-family: inherit;
}

.fc .fc-toolbar.fc-header-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--calendar-border);
  gap: 0.8rem;
  margin: 0;
  padding: 1rem 1.15rem;
}

.fc .fc-toolbar-title {
  color: var(--calendar-text);
  font-size: 1.32rem;
  font-weight: 850;
}

.fc .fc-button {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 7px !important;
  box-shadow: none !important;
  color: #334155 !important;
  font-size: 0.9rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  min-height: 40px;
  padding: 0.47rem 0.78rem !important;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease !important;
}

.fc .fc-button:hover,
.fc .fc-button:focus {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
  color: #ffffff !important;
}

.fc .fc-prev-button,
.fc .fc-next-button {
  background: var(--theme-primary-soft) !important;
  border-color: transparent !important;
  color: var(--theme-primary) !important;
}

.fc .fc-icon {
  color: inherit !important;
  font-size: 1.05rem !important;
}

.fc .fc-col-header-cell {
  background: #f8fafc !important;
  border-color: var(--calendar-border) !important;
  padding: 0.75rem 0 !important;
}

.fc .fc-col-header-cell-cushion {
  color: #475569 !important;
  font-size: 0.84rem;
  font-weight: 850 !important;
  letter-spacing: 0.04em;
  text-decoration: none !important;
  text-transform: uppercase;
}

.fc .fc-daygrid-day {
  background: #ffffff;
}

.fc .fc-daygrid-day.fc-day-today {
  background: var(--theme-primary-soft) !important;
}

.fc .fc-daygrid-day-number {
  color: #334155 !important;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 0.52rem 0.65rem !important;
  text-decoration: none !important;
}

.fc .fc-day-other .fc-daygrid-day-number {
  color: #94a3b8 !important;
}

.fc-daygrid-event {
  border: 0 !important;
  border-radius: 6px !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
  cursor: pointer;
  justify-content: center !important;
  margin: 0 0.22rem 0.22rem !important;
  padding: 0.14rem 0.32rem !important;
}

.fc-daygrid-event-dot {
  display: none !important;
}

.fc-event-title {
  color: #ffffff !important;
  display: block;
  font-size: 0.875rem !important;
  font-weight: 800 !important;
  overflow: hidden;
  text-align: center !important;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.fc .fc-daygrid-more-link {
  color: var(--theme-primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.fc .fc-list {
  border: 0 !important;
}

.fc .fc-list-day-cushion {
  background: #f8fafc !important;
  border-bottom: 1px solid var(--calendar-border);
  padding: 0.85rem 1rem !important;
}

.fc .fc-list-day-text,
.fc .fc-list-day-side-text {
  color: var(--calendar-text) !important;
  font-weight: 850 !important;
  text-decoration: none !important;
}

.fc .fc-list-event {
  cursor: pointer;
}

.fc .fc-list-event:hover td {
  background: var(--theme-primary-soft) !important;
}

.fc .fc-list-event-title,
.fc .fc-list-event-time {
  color: var(--calendar-text);
  font-size: 0.96rem;
}

.fc .fc-list-event-dot {
  border-color: var(--theme-primary) !important;
}

.fc .fc-popover {
  border: 1px solid var(--calendar-border);
  border-radius: 8px;
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.swal2-backdrop-show {
  backdrop-filter: blur(18px);
  background: rgba(4, 50, 112, 0.56) !important;
}

.modern-swal-popup.calendar-event-popup {
  border-radius: 8px !important;
}

.calendar-modal-title {
  color: var(--calendar-text);
  font-size: 1.08em;
  font-weight: 850;
  text-align: center;
}

.calendar-modal-body {
  color: var(--calendar-muted);
  text-align: left;
}

.calendar-modal-body p {
  align-items: baseline;
  display: flex;
  gap: 0.55rem;
  margin: 0 0 0.75rem;
}

.calendar-modal-body i {
  color: var(--theme-primary);
  min-width: 1rem;
}

.calendar-modal-body hr {
  border: 0;
  border-top: 1px solid var(--calendar-border);
  margin: 1rem 0;
}

.calendar-modal-description {
  line-height: 1.55;
  max-height: 250px;
  overflow-y: auto;
}

@media screen and (max-width: 980px) {
  #main.container.calendar-page {
    padding: 4.25rem 1rem 2.5rem;
  }

  .calendar-body {
    padding: 1rem;
  }

  .fc .fc-toolbar.fc-header-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .fc .fc-toolbar-chunk {
    width: 100%;
  }

  .fc .fc-toolbar-chunk:last-child {
    display: flex;
    justify-content: flex-start;
  }
}

@media screen and (max-width: 700px) {
  #main.container.calendar-page {
    padding: 4rem 0.75rem 2rem;
  }

  .calendar-card-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.05rem;
  }

  .calendar-card-header h2 {
    font-size: 1.25rem;
  }

  .calendar-create-action {
    width: 100%;
  }

  .calendar-source {
    font-size: 0.78rem;
  }

  .calendar-body {
    padding: 0.75rem;
  }

  #calendar {
    min-height: 480px;
  }

  .fc .fc-toolbar-title {
    font-size: 1.05rem;
  }

  .fc .fc-toolbar.fc-header-toolbar {
    padding: 0.82rem;
  }

  .fc .fc-button {
    font-size: 1rem !important;
    min-height: 42px;
    padding: 0.42rem 0.58rem !important;
  }

  .fc .fc-button-group {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .fc .fc-button-group > .fc-button {
    border-radius: 7px !important;
    margin-left: 0 !important;
  }

  .fc .fc-list-event-title,
  .fc .fc-list-event-time {
    font-size: 0.9rem;
  }
}
