/* ── Appointments Tab ───────────────────────────────────────── */

.appt-loading {
  text-align: center;
  color: var(--text-muted, #94a3b8);
  padding: 3rem 1rem;
}

/* ── Appointments search bar (replaces heading) ──────────────── */
.appt-search-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 20px;
  font-size: 16px; /* 16px prevents iOS Safari auto-zoom */
  background: var(--bg2, #f8fafc)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 12px center;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.appt-search-input:focus {
  border-color: #6C3CE1;
  box-shadow: 0 0 0 3px rgba(108, 60, 225, 0.10);
}

.appt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.appt-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  margin: 0;
}

.appt-add-btn {
  background: linear-gradient(135deg, #FF5D6C, #e04a58);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.appt-add-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ── Sections ───────────────────────────────────────────────── */

.appt-section {
  margin-bottom: 1rem;
}

.appt-section-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #fff;
  cursor: pointer;
  padding: 0.6rem 1rem;
  user-select: none;
  background: #87ceeb;
  background: linear-gradient(135deg, #87ceeb, #5bbce0);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(91, 188, 224, 0.30);
  margin-bottom: 0;
  border: none;
}
.appt-section-header:hover {
  background: linear-gradient(135deg, #6ec3e8, #47b3d8);
  color: #fff;
  box-shadow: 0 3px 10px rgba(91, 188, 224, 0.40);
}

.appt-section-chevron {
  font-size: 0.85rem;
  opacity: 0.85;
}

.appt-section-count {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.03em;
}

.appt-section-body {
  overflow: hidden;
  padding-top: 6px; /* breathing room between section badge and first card */
}

.appt-section--collapsed .appt-section-body {
  display: none;
}

/* ── Cards ──────────────────────────────────────────────────── */

.appt-card {
  background: var(--card-bg, #fff);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--border, #e2e8f0);
  transition: box-shadow 0.15s;
}
.appt-card:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.appt-card--done {
  opacity: 0.55;
}

.appt-card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.appt-card-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.appt-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text, #0f172a);
  line-height: 1.3;
}

.appt-title--done {
  text-decoration: line-through;
  color: var(--text-muted, #94a3b8);
}

/* ── Date badge ─────────────────────────────────────────────── */

.appt-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 8px;
  padding: 0.2rem 0.55rem;
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
  min-width: 2.4rem;
  flex-shrink: 0;
}

.appt-badge-day {
  font-size: 1rem;
}

.appt-badge-month {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Date+time column: stacks the date chip above the time badge ─────────── */
.appt-date-time-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ── Sky-blue time badge shown below the date chip ───────────────────────── */
.appt-time-badge {
  background: #87ceeb;
  color: #fff;
  font-weight: 700;
  font-size: 0.7rem;
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.appt-badge--health    { background: #FF5D6C; }
.appt-badge--education { background: #6C3CE1; }
.appt-badge--finance   { background: #d97706; }
.appt-badge--social    { background: var(--blue, #6C3CE1); }

/* ── Card meta rows ─────────────────────────────────────────── */

.appt-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.25rem;
}

.appt-notes {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  margin-top: 0.2rem;
  line-height: 1.4;
}

.appt-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
  justify-content: center;
}

.appt-empty {
  text-align: center;
  color: var(--text-muted, #94a3b8);
  padding: 3rem 1rem;
  font-size: 0.9rem;
}

/* ── Card action buttons ────────────────────────────────────── */

.appt-btn {
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border, #e2e8f0);
  background: transparent;
  color: var(--text, #0f172a);
  transition: background 0.12s, border-color 0.12s;
}
.appt-btn:hover {
  background: var(--bg3, #e2e8f0);
}

.appt-btn-done {
  color: #16a34a;
  border-color: #16a34a;
}
.appt-btn-done:hover {
  background: rgba(22, 163, 74, 0.08);
}

.appt-btn-undo {
  color: #d97706;
  border-color: #d97706;
}
.appt-btn-undo:hover {
  background: rgba(217, 119, 6, 0.08);
}

.appt-btn-edit {
  color: #6C3CE1;
  border-color: #6C3CE1;
}
.appt-btn-edit:hover {
  background: rgba(108, 60, 225, 0.08);
}

.appt-btn-delete {
  color: #ef4444;
  border-color: #ef4444;
  background: transparent;
}
.appt-btn-delete:hover {
  background: rgba(239, 68, 68, 0.08);
}

/* ── Modal overlay ──────────────────────────────────────────── */

.appt-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  /* Prevent iOS from scrolling the page behind the overlay */
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

.appt-modal {
  background: var(--card-bg, #fff);
  border-radius: 14px;
  max-width: 520px;
  width: 92vw;
  /* Use dvh so the modal shrinks correctly when the iOS keyboard opens */
  max-height: min(86vh, 86dvh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.appt-modal-header {
  background: linear-gradient(135deg, #FF5D6C, #e04a58);
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 14px 14px 0 0;
  flex-shrink: 0;
}

.appt-modal-title {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

.appt-modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.appt-modal-close:hover {
  color: #fff;
}

.appt-modal-body {
  padding: 1.2rem 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1;
}

.appt-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border, #e2e8f0);
  flex-shrink: 0;
}

.appt-footer-left {
  display: flex;
  align-items: center;
}

.appt-footer-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.appt-btn-cancel {
  background: transparent;
  border: 1px solid var(--border, #e2e8f0);
  color: var(--text-muted, #64748b);
  border-radius: 8px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.appt-btn-cancel:hover {
  background: var(--bg3, #e2e8f0);
}

.appt-btn-save {
  background: #6C3CE1;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.appt-btn-save:hover {
  background: #5a30c0;
}
.appt-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.appt-btn-delete-modal {
  border-radius: 8px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

/* ── Form fields ────────────────────────────────────────────── */

.appt-field {
  margin-bottom: 1rem;
}

.appt-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1rem;
}


.appt-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.appt-required {
  color: #ef4444;
}

.appt-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.appt-input {
  width: 100%;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  /* 16px minimum — prevents iOS Safari auto-zoom on focus */
  font-size: 16px;
  color: var(--text, #0f172a);
  background: var(--bg2, #f8fafc);
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
  box-sizing: border-box;
}
.appt-input:focus {
  border-color: #6C3CE1;
  box-shadow: 0 0 0 3px rgba(108, 60, 225, 0.1);
}

/* ── iOS: force ≥16px on gatherings-form-input fields inside the appointments
   modal to prevent iOS Safari auto-zoom when the input is focused.
   (gatherings.css enforces this for .gatherings-wizard-body; we mirror it here
   for .appt-modal-body which hosts the date, time and location inputs.) ── */
.appt-modal-body .gatherings-form-input {
  font-size: 16px !important;
}

.appt-textarea {
  resize: vertical;
  min-height: 70px;
}

/* ── Type grid ──────────────────────────────────────────────── */

.appt-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.appt-type-category-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #94a3b8);
  margin: 0.5rem 0 0.1rem;
  grid-column: 1 / -1;
}

.appt-type-pill {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  text-align: center;
  font-size: 0.8rem;
  transition: border-color 0.12s, background 0.12s;
  background: var(--bg2, #f8fafc);
  color: var(--text, #0f172a);
  line-height: 1.3;
}
.appt-type-pill:hover {
  border-color: #6C3CE1;
  background: rgba(108, 60, 225, 0.05);
}

.appt-type-pill--active {
  border-color: #6C3CE1;
  background: #f5f3ff;
  color: #6C3CE1;
  font-weight: 600;
}

.appt-type-pill--custom {
  color: var(--text-muted, #94a3b8);
  border-style: dashed;
}

/* ── Custom inputs ──────────────────────────────────────────── */

.appt-custom-inputs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.appt-custom-name {
  flex: 1;
}

.appt-custom-icon {
  width: 70px;
  text-align: center;
}

/* ── Remind pills ───────────────────────────────────────────── */

.appt-remind-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.appt-remind-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 1rem;
  cursor: pointer;
  background: var(--bg2, #f8fafc);
  color: var(--text, #0f172a);
  transition: border-color 0.12s, background 0.12s;
  user-select: none;
}
.appt-remind-pill input[type="checkbox"] {
  accent-color: #6C3CE1;
}
.appt-remind-pill:has(input:checked) {
  border-color: #6C3CE1;
  background: rgba(108, 60, 225, 0.08);
  color: #6C3CE1;
}

/* ── Recurring pills ────────────────────────────────────────── */

.appt-recurring {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.appt-recur-pill {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 1rem;
  cursor: pointer;
  background: var(--bg2, #f8fafc);
  color: var(--text, #0f172a);
  transition: border-color 0.12s, background 0.12s;
  user-select: none;
}
.appt-recur-pill input[type="radio"] {
  /* Styled to look identical to the reminder checkboxes */
  -webkit-appearance: none;
  appearance: none;
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--border, #d1d5db);
  border-radius: 3px;
  background: var(--bg, #fff);
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  margin: 0;
  transition: background 0.12s, border-color 0.12s;
}
.appt-recur-pill input[type="radio"]:checked {
  background: #6C3CE1;
  border-color: #6C3CE1;
}
.appt-recur-pill input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 8px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.appt-recur-pill--active {
  border-color: #6C3CE1;
  border-width: 1px;
  background: rgba(108, 60, 225, 0.08);
  color: #6C3CE1;
  font-weight: 600;
  box-shadow: none;
}

/* ── Dark mode — tied to app theme, NOT OS dark mode preference ── */
/* Uses [data-theme="dark"] / body.dark to match the rest of the app */

[data-theme="dark"] .appt-card,
body.dark .appt-card {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}
[data-theme="dark"] .appt-meta,
[data-theme="dark"] .appt-notes,
[data-theme="dark"] .appt-empty-section,
[data-theme="dark"] .appt-empty-sub,
body.dark .appt-meta,
body.dark .appt-notes,
body.dark .appt-empty-section,
body.dark .appt-empty-sub {
  color: #94a3b8;
}
[data-theme="dark"] .appt-empty-title,
body.dark .appt-empty-title {
  color: #f1f5f9;
}
[data-theme="dark"] .appt-modal,
body.dark .appt-modal {
  background: #1e293b;
  border: 1px solid #334155;
}
[data-theme="dark"] .appt-input,
body.dark .appt-input {
  background: #0f172a;
  color: #f1f5f9;
  border-color: #334155;
}
[data-theme="dark"] .appt-field-row--sticky,
body.dark .appt-field-row--sticky {
  background: #1e293b;
  border-bottom-color: #334155;
}
[data-theme="dark"] .appt-type-pill,
body.dark .appt-type-pill {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}
[data-theme="dark"] .appt-type-pill--active,
body.dark .appt-type-pill--active {
  background: rgba(108, 60, 225, 0.2);
  color: #a78bfa;
  border-color: #6C3CE1;
}
[data-theme="dark"] .appt-remind-pill,
[data-theme="dark"] .appt-recur-pill,
body.dark .appt-remind-pill,
body.dark .appt-recur-pill {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}
[data-theme="dark"] .appt-heading,
body.dark .appt-heading {
  color: #f1f5f9;
}
[data-theme="dark"] .appt-title,
body.dark .appt-title {
  color: #f1f5f9;
}
[data-theme="dark"] .appt-btn,
body.dark .appt-btn {
  color: #f1f5f9;
  border-color: #334155;
}
[data-theme="dark"] .appt-section-count,
body.dark .appt-section-count {
  background: #334155;
  color: #94a3b8;
}

/* ── Enhanced empty state ───────────────────────────────────── */

.appt-empty {
  text-align: center;
  padding: 3rem 1rem;
}

.appt-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.appt-empty-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text, #0f172a);
  margin-bottom: 0.35rem;
}

.appt-empty-sub {
  font-size: 0.85rem;
  color: var(--text-muted, #94a3b8);
}

.appt-empty-section {
  text-align: center;
  color: var(--text-muted, #94a3b8);
  padding: 1.2rem 1rem;
  font-size: 0.85rem;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 480px) {
  .appt-card-top {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .appt-date-badge {
    margin-left: auto;
  }
  .appt-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .appt-field-row {
    grid-template-columns: 1fr;
  }
  .appt-type-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }
  .appt-modal {
    width: 98vw;
    max-height: min(96vh, 96dvh);
  }
}

/* ── Type Select Button ─────────────────────────────────────────────────── */
.appt-type-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border, #d1d5db);
  border-radius: 10px;
  background: var(--bg, #fff);
  color: var(--text, #1f2937);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: left;
}
.appt-type-select-btn:hover {
  border-color: var(--violet, #6C3CE1);
  box-shadow: 0 0 0 3px rgba(108,60,225,0.08);
}
.appt-type-select-chevron {
  font-size: 0.75rem;
  color: var(--muted, #6b7280);
  margin-left: 8px;
  flex-shrink: 0;
}

/* ── Type Picker Overlay ────────────────────────────────────────────────── */
.appt-type-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 600px) {
  .appt-type-picker-overlay {
    align-items: center;
  }
}
.appt-type-picker {
  background: var(--bg, #fff);
  border-radius: 18px 18px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.18);
}
@media (min-width: 600px) {
  .appt-type-picker {
    border-radius: 18px;
    max-height: 70vh;
  }
}
.appt-type-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0;
}
.appt-type-picker-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #1f2937);
}
.appt-type-picker-search-wrap {
  padding: 12px 16px 8px;
  flex-shrink: 0;
}
.appt-type-search-input {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--border, #d1d5db);
  border-radius: 10px;
  font-size: 16px; /* 16px prevents iOS Safari auto-zoom */
  background: var(--bg2, #f8fafc);
  color: var(--text, #1f2937);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
  touch-action: manipulation;
}
.appt-type-search-input:focus {
  border-color: var(--violet, #6C3CE1);
}
.appt-type-picker-list {
  overflow-y: auto;
  flex: 1;
  padding: 4px 12px 16px;
}
.appt-type-picker-cat {
  margin-bottom: 10px;
}
.appt-type-picker-cat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #6b7280);
  padding: 6px 4px 4px;
}
.appt-type-picker-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.appt-type-picker-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 999px;
  background: var(--bg2, #f8fafc);
  color: var(--text, #1f2937);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  min-height: 36px;
}
.appt-type-picker-item:hover {
  border-color: var(--violet, #6C3CE1);
  background: rgba(108,60,225,0.06);
  color: var(--violet, #6C3CE1);
}
.appt-type-picker-item--custom {
  border-style: dashed;
  color: var(--muted, #6b7280);
}
.appt-type-picker-item--custom:hover {
  color: var(--violet, #6C3CE1);
}
.appt-type-picker-icon {
  font-size: 1rem;
  line-height: 1;
}
.appt-type-picker-name {
  line-height: 1.2;
}

/* ── Picker header centred layout ───────────────────────────────────────── */
.appt-type-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0;
}
.appt-type-picker-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #1f2937);
  flex: 1;
  text-align: center;
}
.appt-type-picker-close-spacer {
  width: 32px;
  flex-shrink: 0;
}
/* Remove icon spans if they still appear (belt and braces) */
.appt-type-picker-icon { display: none !important; }
.appt-type-picker-name { display: contents; }

/* ── Main modal header — centred title ──────────────────────────────────── */
.appt-modal-header {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
}
.appt-modal-header-spacer {
  width: 32px;
  flex-shrink: 0;
}
.appt-modal-title {
  flex: 1;
  text-align: center;
}

/* ── Type picker header — gradient fill, white centred title ────────────── */
.appt-type-picker-header--filled {
  background: linear-gradient(135deg, #6C3CE1, #8B5CF6) !important;
  border-bottom: none !important;
  border-radius: 14px 14px 0 0;
}
.appt-type-picker-header--filled .appt-type-picker-title {
  color: #fff !important;
}
.appt-type-picker-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  flex-shrink: 0;
}
.appt-type-picker-close:hover { color: #fff; }

/* ── Flat alphabetical list for type picker ─────────────────────────────── */
.appt-type-picker-list--flat {
  display: flex;
  flex-direction: column;
  padding: 4px 0 12px;
}
.appt-type-list-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 20px;
  border: none;
  border-bottom: 1px solid var(--border, #f0f0f0);
  background: none;
  color: var(--text, #1f2937);
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.1s;
}
.appt-type-list-row:hover {
  background: rgba(108,60,225,0.06);
  color: var(--violet, #6C3CE1);
}
.appt-type-list-row--custom {
  color: var(--muted, #6b7280);
  font-style: italic;
  border-bottom: none;
  margin-top: 4px;
}
.appt-type-list-row--custom:hover {
  color: var(--violet, #6C3CE1);
}

/* ── Emoji trigger & popout ─────────────────────────────────────────────── */
.appt-emoji-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.appt-emoji-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--border, #d1d5db);
  border-radius: 10px;
  background: var(--bg2, #f8fafc);
  font-size: 1.3rem;
  cursor: pointer;
  transition: border-color 0.15s;
  flex-shrink: 0;
}
.appt-emoji-trigger:hover {
  border-color: var(--violet, #6C3CE1);
}
.appt-emoji-popout {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 9200;
  background: var(--bg, #fff);
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  display: grid;
  grid-template-columns: repeat(8, 36px);
  gap: 2px;
  min-width: 300px;
}
.appt-emoji-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  font-size: 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}
.appt-emoji-opt:hover {
  background: rgba(108,60,225,0.1);
}

/* ── Modal header — close-only (no title) ───────────────────────────────── */
.appt-modal-header--close-only {
  background: transparent !important;
  border-radius: 14px 14px 0 0;
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px 0;
}
.appt-modal-header--close-only .appt-modal-close {
  color: var(--muted, #6b7280) !important;
  font-size: 1.5rem;
}
.appt-modal-header--close-only .appt-modal-close:hover {
  color: var(--text, #1f2937) !important;
}

/* ── Custom inputs — hidden by default ──────────────────────────────────── */
.appt-custom-inputs {
  display: none;
}

/* ── Remind & recur pills — centred ────────────────────────────────────── */
.appt-remind-pills {
  justify-content: center;
}
.appt-recurring {
  justify-content: center;
}

/* ── Appointment limit banner ───────────────────────────────────────────── */
.appt-limit-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1.5px solid #f59e0b;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 8px;
}
.appt-limit-banner-text { flex: 1; }
.appt-limit-link {
  color: #b45309;
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
}
.appt-limit-link:hover { color: #92400e; }

/* ── Upgrade CTA button in limit modal ──────────────────────────────────── */
.btn-upgrade-cta {
  background: none;
  border: 1.5px solid var(--border, #d1d5db);
  color: var(--muted, #6b7280);
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.btn-upgrade-cta:hover {
  border-color: var(--violet, #6C3CE1);
  color: var(--violet, #6C3CE1);
}
