/* Base layout */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Roboto", sans-serif;
  background: #f5f5fb;
  color: #18181b;
}

body {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.app-shell {
  width: 100%;
  max-width: 1200px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

/* Top bar */

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  margin-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: linear-gradient(135deg, #c7a4ff, #7c3aed);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 600;
  font-size: 15px;
}

.brand-subtitle {
  font-size: 12px;
  color: #71717a;
}

/* Controls bar */

.controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0;
}

.controls-left,
.controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.current-label {
  font-size: 14px;
  color: #4b5563;
}

/* Buttons */

.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.primary-button {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #ffffff;
  padding: 8px 16px;
  box-shadow: 0 6px 14px rgba(124, 58, 237, 0.35);
}

.primary-button.small {
  padding: 6px 10px;
  font-size: 12px;
}

.ghost-button {
  background: #ffffff;
  color: #4b5563;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
}

.danger-button {
  background: #fee2e2;
  color: #b91c1c;
  padding: 6px 12px;
}

.icon-button {
  background: transparent;
  color: #6b7280;
  padding: 0 6px;
  font-size: 22px;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(124, 58, 237, 0.4);
}

.ghost-button:hover {
  background: #f9fafb;
}

.danger-button:hover {
  background: #fecaca;
}

/* Inputs */

.select-input {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  font-size: 13px;
  color: #374151;
}

/* Calendar wrapper */

.calendar-wrapper {
  flex: 1;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
  padding: 8px;
  overflow: hidden;
}

/* FullCalendar height */

#calendar {
  width: 100%;
  height: calc(100vh - 180px);
}

/* FullCalendar overrides */

.fc {
  font-size: 12px;
}

.fc .fc-toolbar-title {
  font-size: 14px;
}

.fc .fc-timegrid-slot {
  height: 1.7em;
}

.fc .fc-day-today {
  background: #f5f3ff;
}

.fc .fc-timegrid-axis-cushion {
  font-size: 10px;
}

.fc .fc-event {
  border-radius: 10px;
  padding: 2px 4px;
  border: none;
}

/* Modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
}

.modal-panel {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
  padding: 16px 18px;
  z-index: 10;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-header h2 {
  margin: 0;
  font-size: 16px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 12px;
  color: #6b7280;
}

.field input,
.field textarea,
.field select {
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  font-size: 13px;
  font-family: inherit;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spacer {
  flex: 1;
}

/* Floating action button */

.fab-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #ffffff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(124, 58, 237, 0.5);
  cursor: pointer;
}

/* Mobile tweaks */

@media (max-width: 768px) {
  .app-shell {
    padding: 8px;
  }

  .top-bar {
    padding: 10px 12px;
  }

  #calendar {
    height: calc(100vh - 220px);
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .controls-left,
  .controls-right {
    justify-content: space-between;
  }
}