/* ============================================
   SLICE OF LIFE TRAVEL — DESIGN SYSTEM
   Palette: Deep Rose · Warm Cream · Sage · Gold
   Fonts: Cormorant Garamond + Nunito
   ============================================ */

:root {
  --rose: #C4657A;
  --rose-dark: #A8506A;
  --rose-light: #F0D5DB;
  --rose-pale: #FAF0F2;
  --cream: #FAF6F1;
  --cream-dark: #F0EAE0;
  --sage: #8BA888;
  --sage-dark: #6D8B6A;
  --sage-light: #D4E6D3;
  --gold: #C9A84C;
  --gold-dark: #A88A30;
  --gold-light: #F5EDD6;
  --charcoal: #2C2C2C;
  --charcoal-mid: #4A4A4A;
  --charcoal-soft: #6B6B6B;
  --border: #E8E0D8;
  --border-dark: #D4C9BC;

  --shadow-sm: 0 2px 8px rgba(44,44,44,0.06);
  --shadow-md: 0 4px 20px rgba(44,44,44,0.10);
  --shadow-lg: 0 12px 40px rgba(44,44,44,0.14);

  --radius: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Nunito', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Typography ---- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.2; }
a { color: var(--rose); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--rose-dark); }

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--rose); color: white;
  padding: 10px 24px; border-radius: var(--radius);
  border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  letter-spacing: 0.3px;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(196,101,122,0.3);
}
.btn-primary:hover { background: var(--rose-dark); color: white; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(196,101,122,0.4); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--rose);
  padding: 9px 22px; border-radius: var(--radius);
  border: 1.5px solid var(--rose); cursor: pointer;
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  transition: all 0.2s;
}
.btn-outline:hover { background: var(--rose-pale); color: var(--rose-dark); border-color: var(--rose-dark); }

.btn-ghost {
  display: inline-flex; align-items: center;
  background: transparent; color: var(--charcoal-soft);
  padding: 9px 18px; border-radius: var(--radius);
  border: 1.5px solid var(--border); cursor: pointer;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  transition: all 0.2s;
}
.btn-ghost:hover { background: var(--cream-dark); color: var(--charcoal); }

.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-arrow { font-size: 16px; }

/* ---- Cards ---- */
.card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.card-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--charcoal); }
.card-link { font-size: 13px; color: var(--rose); font-weight: 600; }
.card-subtitle { font-size: 13px; color: var(--charcoal-soft); margin-top: 4px; }

/* ---- Forms ---- */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--charcoal-mid); letter-spacing: 0.3px; }
.form-input {
  background: var(--cream); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
  font-family: var(--font-body); font-size: 14px; color: var(--charcoal);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-input:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(196,101,122,0.12); }
.form-input--disabled { opacity: 0.6; cursor: not-allowed; }
.form-textarea {
  background: var(--cream); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
  font-family: var(--font-body); font-size: 14px; color: var(--charcoal);
  transition: border-color 0.2s; resize: vertical; width: 100%;
}
.form-textarea:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(196,101,122,0.12); }
.form-textarea--code { font-family: 'Courier New', monospace; font-size: 13px; }
.form-input-sm {
  background: var(--cream); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 7px 12px;
  font-family: var(--font-body); font-size: 13px; color: var(--charcoal);
  flex: 1;
}
.form-input-sm:focus { outline: none; border-color: var(--rose); }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-span-2 { grid-column: span 2; }
.form-section { margin-bottom: 32px; }
.form-section-title {
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
  color: var(--charcoal); margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.form-section-hint { font-size: 12px; color: var(--charcoal-soft); margin-bottom: 12px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; padding-top: 8px; }
.form-card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 32px; box-shadow: var(--shadow-sm); max-width: 900px; }

.input-prefix { position: relative; display: flex; align-items: center; }
.input-prefix span { position: absolute; left: 12px; color: var(--charcoal-soft); font-size: 14px; pointer-events: none; z-index: 1; }
.input-prefix .form-input { padding-left: 24px; }

.required { color: var(--rose); }

/* ---- Flash Messages ---- */
.flash {
  padding: 12px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 500;
  margin-bottom: 16px; animation: slideDown 0.3s ease;
}
.flash-error { background: #FEE2E2; color: #B91C1C; border: 1px solid #FECACA; }
.flash-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }

@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Status Badges ---- */
.trip-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.trip-badge--inquiry { background: #FEF3C7; color: #92400E; }
.trip-badge--planning { background: #DBEAFE; color: #1E40AF; }
.trip-badge--confirmed { background: #D1FAE5; color: #065F46; }
.trip-badge--active { background: #F3E8FF; color: #6B21A8; }
.trip-badge--completed { background: var(--sage-light); color: var(--sage-dark); }
.trip-badge--cancelled { background: #F3F4F6; color: #6B7280; }

/* Phase dots */
.trip-phase-dot, .phase-dot--intake { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.phase-dot--planning { background: #60A5FA; }
.phase-dot--pre_trip { background: var(--rose); }
.phase-dot--active { background: var(--sage); }
.phase-dot--post_trip { background: var(--charcoal-soft); }

/* Phase pills */
.trip-phase-pill {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px;
  text-transform: capitalize;
}
.phase-pill--intake { background: var(--gold-light); color: var(--gold-dark); }
.phase-pill--planning { background: #DBEAFE; color: #1E40AF; }
.phase-pill--pre_trip { background: var(--rose-light); color: var(--rose-dark); }
.phase-pill--active { background: var(--sage-light); color: var(--sage-dark); }
.phase-pill--post_trip { background: var(--cream-dark); color: var(--charcoal-soft); }

/* ---- Misc Utilities ---- */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.inline-form { display: inline; }
.back-link { font-size: 13px; color: var(--charcoal-soft); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.back-link:hover { color: var(--rose); }
.booking-ref { font-family: monospace; background: var(--cream-dark); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.notes-text { font-size: 14px; color: var(--charcoal-soft); line-height: 1.7; }
.empty-text { font-size: 14px; color: var(--charcoal-soft); font-style: italic; }

/* ---- Phase Progress ---- */
.phase-progress {
  display: flex; align-items: center; padding: 20px 24px;
}
.phase-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  opacity: 0.4; transition: opacity 0.3s;
}
.phase-step.active, .phase-step.done { opacity: 1; }
.phase-step-dot {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--charcoal-soft); background: white;
  transition: all 0.3s;
}
.phase-step.active .phase-step-dot { border-color: var(--rose); color: var(--rose); background: var(--rose-pale); }
.phase-step.done .phase-step-dot { border-color: var(--sage); color: white; background: var(--sage); }
.phase-step-label { font-size: 11px; font-weight: 600; color: var(--charcoal-soft); white-space: nowrap; text-transform: uppercase; letter-spacing: 0.5px; }
.phase-step.active .phase-step-label { color: var(--rose); }
.phase-step.done .phase-step-label { color: var(--sage-dark); }
.phase-connector { flex: 1; height: 2px; background: var(--border); transition: background 0.3s; min-width: 20px; }
.phase-connector.done { background: var(--sage); }

/* ---- Tabs ---- */
.tab-bar {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 2px solid var(--border); padding-bottom: 0;
}
.tab-btn {
  background: none; border: none; cursor: pointer;
  padding: 10px 18px; font-family: var(--font-body); font-size: 14px; font-weight: 600;
  color: var(--charcoal-soft); border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}
.tab-btn:hover { color: var(--rose); }
.tab-btn.active { color: var(--rose); border-bottom-color: var(--rose); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- Modals ---- */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(44,44,44,0.5); z-index: 1000;
  align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: var(--radius-xl);
  width: 90%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: scaleIn 0.25s ease;
}
.modal-lg { max-width: 760px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px 20px; border-bottom: 1px solid var(--border);
}
.modal-title { font-family: var(--font-display); font-size: 22px; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 18px; color: var(--charcoal-soft); padding: 4px; line-height: 1; }
.modal-body { padding: 24px 28px; }
.modal-footer { display: flex; gap: 12px; justify-content: flex-end; padding: 20px 28px; border-top: 1px solid var(--border); }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---- Checklists ---- */
.checklist-block { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border); margin-bottom: 20px; overflow: hidden; }
.checklist-block-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--cream); border-bottom: 1px solid var(--border); }
.checklist-block-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.checklist-phase-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; text-transform: uppercase; margin-top: 4px; display: inline-block; }
.phase-tag--intake { background: var(--gold-light); color: var(--gold-dark); }
.phase-tag--planning { background: #DBEAFE; color: #1E40AF; }
.phase-tag--pre_trip { background: var(--rose-light); color: var(--rose-dark); }
.phase-tag--active { background: var(--sage-light); color: var(--sage-dark); }
.phase-tag--post_trip { background: var(--cream-dark); color: var(--charcoal-soft); }
.checklist-progress-wrap { display: flex; align-items: center; gap: 10px; }
.checklist-progress-bar { width: 100px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.checklist-progress-fill { height: 100%; background: var(--sage); border-radius: 3px; transition: width 0.4s ease; }
.checklist-progress-text { font-size: 12px; color: var(--charcoal-soft); font-weight: 600; white-space: nowrap; }
.checklist-items { padding: 8px 0; }
.checklist-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 20px; transition: background 0.15s; }
.checklist-item:hover { background: var(--cream); }
.checklist-item.completed { opacity: 0.6; }
.checklist-item.completed .checklist-item-title { text-decoration: line-through; }
.check-btn {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border);
  background: white; cursor: pointer; flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: white;
  transition: all 0.2s;
}
.check-btn:hover { border-color: var(--rose); }
.check-btn.checked { background: var(--sage); border-color: var(--sage); }
.check-indicator { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--charcoal-soft); flex-shrink: 0; }
.checklist-item-title { font-size: 14px; font-weight: 500; color: var(--charcoal); }
.checklist-item-desc { font-size: 12px; color: var(--charcoal-soft); margin-top: 2px; line-height: 1.5; }
.checklist-item-due { font-size: 11px; color: var(--rose); margin-top: 2px; }
.checklist-item-stamp { font-size: 11px; color: var(--sage); margin-top: 3px; font-style: italic; min-height: 14px; transition: opacity 0.2s; }
.req-dot { color: var(--rose); margin-left: 3px; font-weight: 700; }
.add-item-form { display: flex; gap: 8px; padding: 10px 20px; border-top: 1px solid var(--border); background: var(--cream); }
.btn-sm-add { background: var(--rose); color: white; border: none; border-radius: var(--radius); padding: 7px 14px; cursor: pointer; font-size: 16px; font-weight: 700; transition: background 0.2s; }
.btn-sm-add:hover { background: var(--rose-dark); }

/* ---- Itinerary ---- */
.itinerary-date-header { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--charcoal); padding: 16px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.itinerary-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--cream-dark); }
.itinerary-item:last-child { border-bottom: none; }
.itinerary-item-time { width: 48px; font-size: 12px; font-weight: 600; color: var(--charcoal-soft); text-align: right; padding-top: 2px; flex-shrink: 0; }
.itinerary-category-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.cat-dot--flight { background: #60A5FA; }
.cat-dot--hotel { background: var(--rose); }
.cat-dot--transfer { background: var(--gold); }
.cat-dot--activity { background: var(--sage); }
.cat-dot--dining { background: #F59E0B; }
.cat-dot--cruise { background: #8B5CF6; }
.cat-dot--tour { background: #EC4899; }
.cat-dot--other { background: var(--charcoal-soft); }
.itinerary-item-title { font-size: 14px; font-weight: 600; color: var(--charcoal); }
.itinerary-item-desc { font-size: 13px; color: var(--charcoal-soft); margin-top: 2px; }
.itinerary-item-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.itinerary-item-meta span { font-size: 12px; color: var(--charcoal-soft); }
.conf-num { background: var(--cream-dark); padding: 1px 6px; border-radius: 3px; font-family: monospace; }
.item-cost { color: var(--sage-dark); font-weight: 600; }
.btn-icon-delete { background: none; border: none; cursor: pointer; color: var(--charcoal-soft); font-size: 12px; padding: 4px 8px; border-radius: 4px; transition: all 0.2s; }
.btn-icon-delete:hover { background: #FEE2E2; color: #B91C1C; }

/* ---- Commissions ---- */
.commission-list { display: flex; flex-direction: column; gap: 1px; }
.commission-item { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.commission-item-info { flex: 1; }
.commission-item-name { font-size: 14px; font-weight: 600; }
.commission-item-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.commission-item-meta span { font-size: 12px; color: var(--charcoal-soft); }
.commission-item-right { display: flex; align-items: center; gap: 12px; }
.commission-amount { font-size: 16px; font-weight: 700; color: var(--rose); font-family: var(--font-display); }
.commission-amount-cell { font-weight: 700; color: var(--rose); font-family: var(--font-display); font-size: 16px; }
.commission-total-row { display: flex; gap: 24px; padding: 14px 0; font-size: 14px; color: var(--charcoal-soft); border-top: 2px solid var(--border); margin-top: 4px; }
.comm-category { display: inline-block; background: var(--cream-dark); padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; text-transform: capitalize; }
.status-select {
  border: 1.5px solid var(--border); border-radius: var(--radius); padding: 4px 8px;
  font-family: var(--font-body); font-size: 12px; font-weight: 600;
  cursor: pointer; background: white; color: var(--charcoal);
}
.status-select--expected { border-color: var(--gold); color: var(--gold-dark); background: var(--gold-light); }
.status-select--invoiced { border-color: #60A5FA; color: #1E40AF; background: #DBEAFE; }
.status-select--received { border-color: var(--sage); color: var(--sage-dark); background: var(--sage-light); }
.status-select--cancelled { border-color: var(--border); color: var(--charcoal-soft); }

/* ---- Data Table ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table thead th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--charcoal-soft); border-bottom: 2px solid var(--border); background: var(--cream); }
.data-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tbody tr:hover { background: var(--cream); }
.table-link { font-weight: 600; color: var(--rose); }
.table-sub { font-size: 12px; color: var(--charcoal-soft); margin-top: 2px; }

/* ---- Email Log ---- */
.email-log { display: flex; flex-direction: column; gap: 1px; }
.email-log-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.email-log-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; flex-shrink: 0; }
.email-status--sent { background: var(--sage-light); color: var(--sage-dark); }
.email-status--failed { background: #FEE2E2; color: #B91C1C; }
.email-status--pending { background: var(--gold-light); color: var(--gold-dark); }
.email-log-subject { font-size: 14px; font-weight: 600; }
.email-log-meta { font-size: 12px; color: var(--charcoal-soft); margin-top: 2px; }

/* ---- Filters ---- */
.filter-bar { margin-bottom: 20px; }
.filter-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-select { background: white; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 8px 12px; font-family: var(--font-body); font-size: 14px; color: var(--charcoal); cursor: pointer; }
.filter-search { background: white; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 8px 14px; font-family: var(--font-body); font-size: 14px; color: var(--charcoal); width: 260px; }
.filter-search:focus { outline: none; border-color: var(--rose); }
.filter-clear { font-size: 13px; color: var(--charcoal-soft); font-weight: 600; }

/* ---- Info List ---- */
.info-list { display: flex; flex-direction: column; gap: 10px; }
.info-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 14px; }
.info-label { color: var(--charcoal-soft); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; flex-shrink: 0; }

/* ---- Budget Display ---- */
.budget-display { text-align: center; padding: 12px 0; }
.budget-total { font-family: var(--font-display); font-size: 32px; font-weight: 600; color: var(--rose); }
.budget-label { font-size: 12px; color: var(--charcoal-soft); text-transform: uppercase; letter-spacing: 0.5px; }

/* ---- Empty States ---- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--charcoal-soft); }
.empty-icon { font-size: 36px; display: block; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; }
.empty-page { text-align: center; padding: 80px 20px; }
.empty-page-icon { font-size: 48px; display: block; margin-bottom: 16px; opacity: 0.3; }
.empty-page h3 { font-family: var(--font-display); font-size: 24px; margin-bottom: 8px; }
.empty-page p { color: var(--charcoal-soft); font-size: 14px; margin-bottom: 20px; }

/* ---- Variables chip ---- */
.variables-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.var-chip { background: var(--cream-dark); color: var(--charcoal-mid); padding: 4px 10px; border-radius: 4px; font-size: 13px; font-family: monospace; }

/* ---- Template Cards ---- */
.template-phase-section { margin-bottom: 32px; }
.template-phase-heading { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin-bottom: 12px; color: var(--charcoal); }
.template-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }
.template-card { background: white; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; transition: box-shadow 0.2s, border-color 0.2s; }
.template-card:hover { box-shadow: var(--shadow-md); border-color: var(--rose-light); }
.template-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.template-card-icon { font-size: 20px; color: var(--rose); }
.template-trigger-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; background: var(--cream-dark); color: var(--charcoal-soft); text-transform: uppercase; letter-spacing: 0.3px; }
.template-card-name { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.template-card-subject { font-size: 12px; color: var(--charcoal-soft); margin-bottom: 12px; }
.template-card-actions { display: flex; gap: 8px; }

/* Responsive */
@media (max-width: 768px) {
  .form-grid-2, .form-grid-3, .form-row-2 { grid-template-columns: 1fr; }
  .form-span-2 { grid-column: span 1; }
  .phase-progress { overflow-x: auto; }
}

/* ---- Trip Members ---- */
.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.member-card { background: white; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.member-card--dm { border-color: var(--gold); border-width: 2px; }
.member-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; gap: 8px; }
.member-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--charcoal); }
.member-relationship { font-size: 12px; color: var(--charcoal-soft); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.dm-badge { background: var(--gold); color: white; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 20px; white-space: nowrap; letter-spacing: 0.5px; }
.member-card-body { display: flex; flex-direction: column; gap: 4px; }
.member-detail { font-size: 13px; color: var(--charcoal-soft); }
.member-edit-details { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }
.member-edit-details summary { font-size: 12px; color: var(--rose); cursor: pointer; font-weight: 600; letter-spacing: 0.5px; list-style: none; }
.member-edit-details summary::before { content: '▸ '; }
.member-edit-details[open] summary::before { content: '▾ '; }

/* ---- Trip Payments ---- */
.payment-summary-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .payment-summary-row { grid-template-columns: repeat(2, 1fr); } }
.payment-summary-card { background: white; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; text-align: center; }
.payment-summary-card--green { border-color: var(--sage); }
.payment-summary-card--rose { border-color: var(--rose); }
.payment-summary-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--charcoal-soft); margin-bottom: 6px; }
.payment-summary-amount { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--charcoal); }
.payment-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.payment-table th { text-align: left; padding: 8px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--charcoal-soft); border-bottom: 2px solid var(--border); }
.payment-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.payment-row--deposit { background: #f9fdf6; }
.payment-row--credit, .payment-row--adjustment { background: #fffaf6; }
.payment-type-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: capitalize; letter-spacing: 0.3px; }
.payment-type-badge--deposit { background: #d4edda; color: #155724; }
.payment-type-badge--payment { background: #cce5ff; color: #004085; }
.payment-type-badge--credit { background: #fff3cd; color: #856404; }
.payment-type-badge--adjustment { background: #f8d7da; color: #721c24; }
.payment-ref { color: var(--charcoal-soft); font-size: 12px; }
.payment-amount { font-weight: 600; color: var(--charcoal); text-align: right; }
.payment-amount--neg { color: var(--rose); }
.payment-amount--zero { color: var(--sage); }
.payment-notes-row { background: var(--cream); }
.payment-notes { font-size: 12px; color: var(--charcoal-soft); padding: 4px 12px 8px !important; font-style: italic; }
.payment-total-row td { border-top: 2px solid var(--border); font-weight: 600; padding-top: 12px; }
.payment-balance-row td { font-weight: 700; background: var(--cream); }

/* ---- Families page ---- */
.families-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.family-card { display: flex; align-items: center; gap: 16px; background: white; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; text-decoration: none; color: inherit; transition: box-shadow 0.15s, border-color 0.15s; }
.family-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: var(--rose); }
.family-card-icon { font-size: 28px; color: var(--rose); flex-shrink: 0; }
.family-card-body { flex: 1; }
.family-card-name { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--charcoal); }
.family-card-meta { font-size: 12px; color: var(--charcoal-soft); margin-top: 4px; display: flex; gap: 8px; }
.family-card-meta .sep { color: var(--border); }
.family-card-notes { font-size: 12px; color: var(--charcoal-soft); margin-top: 6px; font-style: italic; }
.family-card-arrow { color: var(--charcoal-soft); font-size: 18px; }

/* ---- Family detail ---- */
.family-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 768px) { .family-detail-grid { grid-template-columns: 1fr; } }
.card-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.count-badge { background: var(--rose); color: white; border-radius: 20px; padding: 2px 8px; font-size: 11px; font-weight: 700; margin-left: 6px; }
.family-member-list { display: flex; flex-direction: column; gap: 1px; }
.family-member-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.family-member-row.dm { background: #fffdf5; border-radius: 6px; padding: 10px 8px; }
.family-member-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--rose); color: white; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.family-member-info { flex: 1; }
.family-member-name { font-size: 14px; font-weight: 600; color: var(--charcoal); }
.family-member-sub { font-size: 12px; color: var(--charcoal-soft); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 8px; }
.family-member-actions { display: flex; gap: 6px; }
.family-trip-list { display: flex; flex-direction: column; gap: 1px; }
.family-trip-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.family-trip-row:hover { color: var(--rose); }
.family-trip-name { font-size: 14px; font-weight: 600; }
.family-trip-meta { font-size: 12px; color: var(--charcoal-soft); margin-top: 4px; display: flex; gap: 8px; align-items: center; }
.family-trip-arrow { color: var(--charcoal-soft); font-size: 16px; }
.empty-state-sm { padding: 16px 0; color: var(--charcoal-soft); font-size: 13px; }
.btn-danger { background: #e53e3e; color: white; border: none; border-radius: var(--radius); padding: 8px 16px; cursor: pointer; font-size: 13px; font-weight: 600; transition: background 0.2s; }
.btn-danger:hover { background: #c53030; }
.btn-icon { background: none; border: 1px solid var(--border); border-radius: 6px; width: 28px; height: 28px; cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center; color: var(--charcoal-soft); transition: all 0.15s; }
.btn-icon:hover { border-color: var(--rose); color: var(--rose); }

/* ---- Key Dates ---- */
.key-date-add-form { padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.key-dates-list { display: flex; flex-direction: column; gap: 8px; }
.key-date-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--cream); border-left: 3px solid var(--border); }
.key-date-row.urgent { border-left-color: var(--rose); background: #fff5f5; }
.key-date-row.past { opacity: 0.6; }
.key-date-icon { font-size: 20px; flex-shrink: 0; padding-top: 2px; }
.key-date-info { flex: 1; }
.key-date-label { font-size: 14px; font-weight: 600; color: var(--charcoal); }
.key-date-meta { font-size: 12px; color: var(--charcoal-soft); margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.key-date-notes { font-size: 12px; color: var(--charcoal-soft); font-style: italic; margin-top: 3px; }
.key-date-badge { padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.key-date-badge.today { background: var(--rose); color: white; }
.key-date-badge.urgent { background: #fed7d7; color: #c53030; }
.key-date-badge.upcoming { background: #bee3f8; color: #2b6cb0; }
.key-date-badge.past { background: var(--border); color: var(--charcoal-soft); }

/* ---- Scheduled Emails ---- */
.scheduled-email-list { display: flex; flex-direction: column; gap: 8px; }
.scheduled-email-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--cream); }
.scheduled-email-row.status-sent { opacity: 0.7; }
.scheduled-email-row.status-cancelled { opacity: 0.5; text-decoration: line-through; }
.scheduled-email-icon { font-size: 18px; flex-shrink: 0; padding-top: 2px; }
.scheduled-email-info { flex: 1; }
.scheduled-email-subject { font-size: 14px; font-weight: 600; color: var(--charcoal); }
.scheduled-email-meta { font-size: 12px; color: var(--charcoal-soft); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.scheduled-email-badge { padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: capitalize; }
.scheduled-email-badge.status-pending { background: #bee3f8; color: #2b6cb0; }
.scheduled-email-badge.status-sent { background: #c6f6d5; color: #276749; }
.scheduled-email-badge.status-cancelled { background: var(--border); color: var(--charcoal-soft); }
.scheduled-email-badge.status-failed { background: #fed7d7; color: #c53030; }

/* ---- Family import checkboxes ---- */
.family-import-checkbox { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius); cursor: pointer; font-size: 14px; }
.family-import-checkbox:hover { background: var(--cream); }
.family-import-checkbox input { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }

/* ---- Family assign row ---- */
.family-assign-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hint-text { font-size: 12px; color: var(--charcoal-soft); font-style: italic; }
.section-subtitle { font-size: 13px; font-weight: 600; color: var(--charcoal); margin-bottom: 8px; }
