*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 1.5rem;
  font-family: system-ui, sans-serif;
  background: #0f1117;
  color: #e0e0e0;
  min-height: 100vh;
}

h1 {
  margin: 0 0 1rem;
  font-size: 2.2rem;
  font-weight: 500;
  color: #a0a8c0;
  letter-spacing: 0.04em;
}

#status {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
  min-height: 1.2em;
}

#status.error { color: #e06c75; }

#calendar-container {
  background: #1a1d27;
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid #2a2d3a;
}

/* FullCalendar dark theme overrides */
:root {
  --fc-border-color: #2a2d3a;
  --fc-button-bg-color: #2a2d3a;
  --fc-button-border-color: #3a3d4a;
  --fc-button-hover-bg-color: #3a3d4a;
  --fc-button-hover-border-color: #4a4d5a;
  --fc-button-active-bg-color: #4a4d5a;
  --fc-button-text-color: #c0c8d8;
  --fc-today-bg-color: rgba(100, 120, 200, 0.12);
  --fc-event-bg-color: #4a6fa5;
  --fc-event-border-color: #3a5f95;
  --fc-event-text-color: #ffffff;
  --fc-page-bg-color: #1a1d27;
  --fc-neutral-bg-color: #1a1d27;
  --fc-list-event-hover-bg-color: #2a2d3a;
}

.fc .fc-toolbar-title { color: #c0c8d8; font-size: 1.1rem; }
.fc .fc-col-header-cell-cushion { color: #8090a8; text-decoration: none; }
.fc .fc-daygrid-day-number { color: #8090a8; text-decoration: none; }
.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number { color: #ffffff; }
.fc-theme-standard td, .fc-theme-standard th { border-color: #2a2d3a; }

/* Modal */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

#modal-overlay.open {
  display: flex;
}

#modal {
  background: #1a1d27;
  border: 1px solid #2a2d3a;
  border-radius: 10px;
  padding: 1.5rem;
  width: min(480px, 90vw);
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

#modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #8090a8;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

#modal-close:hover { background: #2a2d3a; color: #e0e0e0; }

#modal-title {
  margin: 0 2rem 1.25rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #e0e0e0;
  line-height: 1.3;
}

.modal-fields {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.9rem;
}

.modal-label {
  color: #8090a8;
  white-space: nowrap;
  padding-top: 1px;
}

.modal-value {
  color: #c0c8d8;
  word-break: break-word;
  white-space: pre-wrap;
}

.fc-list-event-title-text {
  font-weight: 500;
  color: #c0c8d8;
}

.fc-list-event-detail {
  font-size: 0.8rem;
  color: #8090a8;
  margin-top: 0.15rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* SVG */
#path1, #path3 { fill: #CCFFFF; }
#path4 { fill: #6666FF }