/* ===== DESIGN TOKENS ===== */
:root {
  --bg: #0f0e0c;
  --surface: #1a1916;
  --surface-2: #222018;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --text: #e8e0d0;
  --text-muted: #8a7f6e;
  --text-faint: #4a4338;
  --accent: #c9a84c;
  --accent-soft: rgba(201,168,76,0.12);
  --accent-glow: rgba(201,168,76,0.25);
  --green: #4caf87;
  --red: #c94c4c;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 16px rgba(0,0,0,0.4);
  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Inter', sans-serif;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font-family: inherit; }

/* ===== APP LAYOUT ===== */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 220px; min-height: 100vh; background: var(--surface);
  border-right: 1px solid var(--border); padding: 24px 0; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-logo { padding: 0 20px 28px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.logo-text { font-family: var(--font-display); font-size: 17px; letter-spacing: 0.04em; color: var(--accent); }
.sidebar-nav { list-style: none; padding: 0 10px; }
.sidebar-nav li { margin-bottom: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius-sm); font-size: 13.5px; color: var(--text-muted);
  transition: all 0.15s; font-weight: 400;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link--accent { color: var(--accent); }
.nav-link--accent:hover { background: var(--accent-soft); color: var(--accent); }
.nav-icon { font-size: 15px; width: 18px; text-align: center; }

/* Main content */
.main-content { flex: 1; padding: 32px 40px; max-width: 1100px; }

/* ===== DASHBOARD ===== */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; }
.page-title { font-family: var(--font-display); font-size: 28px; font-weight: 400; letter-spacing: 0.01em; }
.page-subtitle { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.back-link { font-size: 13px; color: var(--text-muted); display: block; margin-bottom: 6px; }
.back-link:hover { color: var(--text); }

/* Invitations grid */
.invitations-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px;
}
.invite-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.invite-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }

.invite-card__preview {
  height: 160px; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.invite-card__preview-inner { text-align: center; padding: 16px; }
.preview-event-type { font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 6px; opacity: 0.8; }
.preview-names { font-family: var(--font-display); font-size: 22px; font-weight: 400; line-height: 1.2; }
.preview-date { font-size: 11px; margin-top: 6px; opacity: 0.7; }

.invite-card__info { padding: 16px; }
.invite-card__meta { display: flex; gap: 6px; margin-bottom: 10px; }
.invite-card__title { font-size: 15px; font-weight: 500; margin-bottom: 3px; }
.invite-card__date { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.invite-card__rsvp { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 14px; color: var(--text-muted); }
.rsvp-divider { opacity: 0.3; }
.invite-card__actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Empty state */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state__icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h2 { font-family: var(--font-display); font-size: 24px; font-weight: 400; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 24px; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; padding: 3px 8px;
  border-radius: 20px; font-size: 11px; font-weight: 500; letter-spacing: 0.03em;
}
.badge--active { background: rgba(76,175,135,0.15); color: var(--green); }
.badge--draft { background: var(--surface-2); color: var(--text-muted); }
.badge--anim { background: var(--accent-soft); color: var(--accent); }
.badge--confirmed { background: rgba(76,175,135,0.15); color: var(--green); }
.badge--declined { background: rgba(201,76,76,0.15); color: var(--red); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px;
  border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500;
  cursor: pointer; border: none; transition: all 0.15s; white-space: nowrap;
}
.btn--primary { background: var(--accent); color: #1a1208; }
.btn--primary:hover { background: #d9b85c; }
.btn--outline { background: transparent; border: 1px solid var(--border-hover); color: var(--text); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }
.btn--ghost { background: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--sm { padding: 6px 12px; font-size: 12.5px; }
.btn--full { width: 100%; justify-content: center; }

/* ===== FORM FIELDS ===== */
.field-group { margin-bottom: 18px; }
.field-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; letter-spacing: 0.04em; text-transform: uppercase; }
.field-input {
  width: 100%; padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 14px; transition: border-color 0.15s;
}
.field-input:focus { outline: none; border-color: var(--accent); }
.field-input--sm { width: auto; flex: 1; }
.field-hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }
select.field-input option { background: var(--surface-2); }
textarea.field-input { resize: vertical; }

/* Color row */
.color-row { display: flex; gap: 8px; align-items: center; }
.color-swatch { width: 40px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: pointer; padding: 2px; background: var(--surface-2); flex-shrink: 0; }

/* Toggle */
.toggle-row { display: flex; justify-content: space-between; align-items: center; }
.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 24px; cursor: pointer; transition: 0.2s;
}
.toggle-slider::after {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 16px; height: 16px; background: var(--text-muted); border-radius: 50%; transition: 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--accent-soft); border-color: var(--accent); }
.toggle input:checked + .toggle-slider::after { background: var(--accent); transform: translateX(20px); }

/* ===== RSVP ADMIN ===== */
.rsvp-stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.rsvp-stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; }
.rsvp-stat-card--confirmed { border-color: rgba(76,175,135,0.3); }
.rsvp-stat-card--declined { border-color: rgba(201,76,76,0.2); }
.stat-number { font-family: var(--font-display); font-size: 42px; font-weight: 300; line-height: 1; }
.rsvp-stat-card--confirmed .stat-number { color: var(--green); }
.rsvp-stat-card--declined .stat-number { color: var(--red); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.05em; }

.rsvp-table-wrap { overflow-x: auto; }
.rsvp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rsvp-table th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
.rsvp-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.rsvp-table .row--confirmed td:first-child { border-left: 2px solid var(--green); }
.rsvp-table .row--declined td:first-child { border-left: 2px solid var(--red); }
.msg-cell { color: var(--text-muted); max-width: 200px; }
.date-cell { color: var(--text-faint); font-size: 12px; }

/* ===== SHARE URL ===== */
.share-url-box { display: flex; gap: 8px; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border-hover); color: var(--text);
  padding: 12px 24px; border-radius: 24px; font-size: 13.5px; z-index: 9999;
  box-shadow: var(--shadow); transition: opacity 0.3s;
}
.toast.hidden { opacity: 0; pointer-events: none; }

/* ===== MODAL ===== */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-box { background: var(--surface); border: 1px solid var(--border-hover); border-radius: var(--radius); padding: 36px; max-width: 480px; width: 90%; }
.modal-title { font-family: var(--font-display); font-size: 26px; font-weight: 400; margin-bottom: 8px; }
.modal-text { color: var(--text-muted); margin-bottom: 20px; }
.modal-url-box { display: flex; gap: 8px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== UTILS ===== */
.hidden { display: none !important; }
