* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
  height: 100vh;
  overflow: hidden;
}

#app {
  display: flex;
  height: 100vh;
}

/* ── Sidebar ── */
#sidebar {
  background: #ffffff;
  border-right: 1px solid #e0e0e0;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#sidebar h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
}

.section-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 8px 0;
}

.sidebar-spacer {
  flex: 1;
}

/* ── User Cards ── */
.user-card {
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.user-card:hover {
  background: #f9fafb;
}

.user-card.selected {
  border-color: currentColor;
  background: #f0f4ff;
}

.pt-card {
  border-color: rgba(99, 102, 241, 0.4);
  color: #6366f1;
}

.pt-card.selected {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.06);
}

.user-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 16px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.user-delete-btn:hover {
  color: #ef4444;
  background: #fef2f2;
}

/* ── User dropdown (slots + availability) ── */
.user-dropdown {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
  display: none;
}

.user-card.selected .user-dropdown {
  display: block;
}

.slot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
  color: #6b7280;
}

.slot-item .slot-label {
  flex: 1;
}

.slot-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #d1d5db;
  font-size: 14px;
  padding: 0 4px;
}

.slot-remove-btn:hover {
  color: #ef4444;
}

.availability-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 11px;
  color: #9ca3af;
}

.availability-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #d1d5db;
  font-size: 12px;
  padding: 0 4px;
}

.availability-remove-btn:hover {
  color: #ef4444;
}

.user-dropdown .btn-small {
  margin-top: 4px;
}

.btn-reset {
  width: 100%;
  margin-top: 6px;
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fecaca;
  font-size: 11px;
  padding: 4px 8px;
}

.btn-reset:hover {
  background: #fee2e2;
  color: #dc2626;
}

.slot-section-label,
.avail-section-label {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
  margin-bottom: 2px;
}

/* ── Group Slots ── */
.group-slots-title {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.group-slot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
  color: #6b7280;
}

.group-slot-label {
  flex: 1;
}

.participant-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 13px;
  cursor: pointer;
}

.participant-checkbox input {
  margin: 0;
}

.participant-checkbox .user-color-dot {
  width: 10px;
  height: 10px;
}

#dialog-group-fields select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 4px;
}

/* ── Buttons ── */
.btn {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  transition: background 0.15s;
}

.btn-add {
  width: 100%;
  background: #f3f4f6;
  color: #374151;
  border: 1px dashed #d1d5db;
}

.btn-add:hover {
  background: #e5e7eb;
}

.btn-small {
  font-size: 11px;
  padding: 4px 8px;
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

.btn-small:hover {
  background: #e5e7eb;
}

.btn-schedule {
  width: 100%;
  background: #6366f1;
  color: white;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 8px;
}

.btn-schedule:hover {
  background: #4f46e5;
}

/* ── Calendar ── */
#calendar-container {
  padding: 16px;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

#calendar {
  flex: 1;
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* FullCalendar overrides */
.fc {
  height: 100% !important;
}

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

.fc .fc-col-header-cell {
  background: #fafafa;
  font-size: 13px;
  font-weight: 500;
}

.fc .fc-timegrid-slot {
  height: 6px;
}

.fc .fc-highlight {
  background: rgba(59, 130, 246, 0.15);
}

/* ── Dialog ── */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.dialog-overlay.hidden {
  display: none;
}

.dialog {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 360px;
  max-width: 90vw;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.dialog h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.dialog-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dialog-body label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dialog-body input,
.dialog-body select {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
}

.dialog-slot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.dialog-slot-row select {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12px;
}

.dialog-slot-row .slot-remove-btn {
  font-size: 16px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.btn-cancel {
  background: #f3f4f6;
  color: #374151;
}

.btn-cancel:hover {
  background: #e5e7eb;
}

.btn-confirm {
  background: #6366f1;
  color: white;
}

.btn-confirm:hover {
  background: #4f46e5;
}

/* ── Sidebar toggle (hamburger) ── */
.sidebar-toggle {
  background: none;
  border: none;
  font-size: 20px;
  padding: 6px 8px;
  cursor: pointer;
  color: #374151;
  margin-bottom: 8px;
  border-radius: 6px;
  align-self: flex-start;
}

.sidebar-toggle:hover {
  background: #f3f4f6;
}

/* ── Sidebar collapse/expand ── */
#sidebar {
  width: 48px;
  min-width: 48px;
  overflow: hidden;
  transition: width 0.25s ease, min-width 0.25s ease;
}

#sidebar > *:not(.sidebar-toggle) {
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

#sidebar.open {
  width: 300px;
  min-width: 300px;
  padding: 20px 16px;
  overflow-y: auto;
}

#sidebar.open > *:not(.sidebar-toggle) {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.2s ease 0.1s;
}

#calendar-container {
  flex: 1;
}

/* ── Language toggle ── */
.lang-toggle {
  display: flex;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #d1d5db;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  align-self: flex-end;
  flex-shrink: 0;
}

.lang-btn {
  padding: 4px 10px;
  border: none;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  transition: background 0.15s, color 0.15s;
}

.lang-btn:not(:last-child) {
  border-right: 1px solid #d1d5db;
}

.lang-btn.active {
  background: #6366f1;
  color: #fff;
}

.lang-btn:hover:not(.active) {
  background: #f3f4f6;
}

/* ── Footer ── */
.app-footer {
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  margin: 2em 0;
}

/* ── Calendar info banner ── */
.calendar-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: #1e40af;
  margin-top: 6px;
}
