/* ── SatuCerita Dashboard — Design by Claude Design ─────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=DM+Sans:wght@300;400;500&display=swap');

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

:root {
  --sage: #3d4f3e;
  --sage-light: #4e6350;
  --sage-dark: #2a3829;
  --gold: #c9a96e;
  --gold-light: #dfc28e;
  --gold-pale: #f5edd8;
  --cream: #faf7f2;
  --cream-dark: #f0ebe0;
  --warm-white: #fffdf9;
  --text-dark: #1c2017;
  --text-mid: #4a4a3a;
  --text-muted: #8a8a78;
  --border: rgba(201,169,110,0.18);
  --border-strong: rgba(201,169,110,0.35);
  --shadow-sm: 0 1px 4px rgba(61,79,62,0.07);
  --shadow-md: 0 4px 20px rgba(61,79,62,0.10);
  --shadow-lg: 0 12px 40px rgba(61,79,62,0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

html, body { height: 100%; background: var(--cream); }

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

/* NOISE TEXTURE OVERLAY */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* LAYOUT */
.layout { display: flex; height: 100vh; overflow: hidden; position: relative; z-index: 1; }

/* MOBILE TOPBAR (hidden on desktop) */
.mobile-topbar { display: none; }
.drawer-backdrop { display: none; }

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--sage-dark);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 180% 80% at 50% -10%, rgba(201,169,110,0.12) 0%, transparent 60%),
    linear-gradient(180deg, var(--sage-dark) 0%, #1e2a1f 100%);
  pointer-events: none;
}

.sidebar::after {
  content: '';
  position: absolute;
  bottom: 80px;
  right: -20px;
  width: 140px;
  height: 200px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 200' fill='none'%3E%3Cpath d='M70 180 Q40 140 50 100 Q60 60 70 40' stroke='%23c9a96e' stroke-width='1' stroke-opacity='0.2' fill='none'/%3E%3Cpath d='M70 160 Q30 130 25 95' stroke='%23c9a96e' stroke-width='1' stroke-opacity='0.15' fill='none'/%3E%3Cellipse cx='35' cy='85' rx='22' ry='14' transform='rotate(-30 35 85)' fill='%23c9a96e' fill-opacity='0.07'/%3E%3Cpath d='M70 140 Q100 110 110 75' stroke='%23c9a96e' stroke-width='1' stroke-opacity='0.15' fill='none'/%3E%3Cellipse cx='105' cy='65' rx='20' ry='13' transform='rotate(25 105 65)' fill='%23c9a96e' fill-opacity='0.07'/%3E%3Cpath d='M70 120 Q45 100 38 72' stroke='%23c9a96e' stroke-width='0.8' stroke-opacity='0.12' fill='none'/%3E%3Cellipse cx='30' cy='60' rx='18' ry='11' transform='rotate(-45 30 60)' fill='%23c9a96e' fill-opacity='0.06'/%3E%3C/svg%3E");
  opacity: 0.6;
  pointer-events: none;
}

.sidebar-logo { padding: 28px 24px 20px; position: relative; z-index: 1; }

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

.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 16px;
  color: var(--sage-dark); font-weight: 600; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(201,169,110,0.4);
}

.logo-text {
  font-family: var(--font-display); font-size: 22px; font-weight: 400;
  color: var(--gold-light); letter-spacing: 0.04em;
}

.sidebar-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,169,110,0.25), transparent);
  margin: 0 24px 8px; position: relative; z-index: 1;
}

.sidebar-nav {
  flex: 1; padding: 8px 12px; position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 2px;
}

.nav-label {
  font-size: 9px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(201,169,110,0.5); padding: 16px 12px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.2s ease;
  color: rgba(255,255,255,0.55); font-size: 13.5px; font-weight: 400;
  text-decoration: none; position: relative;
  border: none; background: none; width: 100%; text-align: left;
}

.nav-item:hover { color: rgba(255,255,255,0.85); background: rgba(201,169,110,0.08); }

.nav-item.active { color: var(--gold-light); background: rgba(201,169,110,0.14); }

.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--gold); border-radius: 0 2px 2px 0;
}

.nav-icon {
  width: 18px; height: 18px; opacity: 0.8; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

.nav-icon svg { width: 16px; height: 16px; }

.sidebar-footer {
  padding: 16px 12px; position: relative; z-index: 1;
  border-top: 1px solid rgba(201,169,110,0.12);
}

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background 0.2s;
}

.user-card:hover { background: rgba(201,169,110,0.08); }

.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 14px;
  color: var(--sage-dark); font-weight: 600; flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }

.user-name {
  font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.user-role { font-size: 11px; color: rgba(201,169,110,0.6); margin-top: 1px; }

.logout-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; color: rgba(255,255,255,0.35); font-size: 12.5px;
  transition: all 0.2s; border: none; background: none; width: 100%; margin-top: 2px;
  font-family: var(--font-body);
}

.logout-btn:hover { color: rgba(255,255,255,0.65); background: rgba(255,255,255,0.04); }

/* ── MAIN CONTENT ────────────────────────────────────── */
.main { flex: 1; overflow-y: auto; background: var(--cream); position: relative; }

.main::-webkit-scrollbar { width: 5px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb { background: rgba(201,169,110,0.3); border-radius: 4px; }

.main-inner { width: 100%; padding: 40px 48px; animation: fadeUp 0.5s ease both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── PAGE HEADER ─────────────────────────────────────── */
.page-header {
  margin-bottom: 36px;
  animation: fadeUp 0.5s 0.05s ease both;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}

.page-header > div:first-child { flex: 1; min-width: 0; }

.page-eyebrow {
  font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 6px;
}

.page-title {
  font-family: var(--font-display); font-size: 38px; font-weight: 400;
  color: var(--text-dark); line-height: 1.1; letter-spacing: -0.01em;
}

.page-title em { font-style: italic; color: var(--sage); }

/* ── INFO CARDS GRID ─────────────────────────────────── */
.info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 24px; animation: fadeUp 0.5s 0.1s ease both;
}

.info-card {
  background: var(--warm-white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px;
  display: flex; align-items: center; gap: 16px;
  transition: all 0.25s ease; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  text-decoration: none; color: inherit; cursor: default;
}

button.info-card { border: 1px solid var(--border); background: var(--warm-white); cursor: pointer; }

.info-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0; transition: opacity 0.25s;
}

.info-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.info-card:hover::before { opacity: 1; }

.info-card-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--gold-pale); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--gold);
}

.info-card-icon svg { width: 16px; height: 16px; }
.info-card-body { flex: 1; min-width: 0; }

.info-card-label {
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 4px;
}

.info-card-value {
  font-family: var(--font-display); font-size: 20px; font-weight: 500;
  color: var(--text-dark); letter-spacing: 0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.info-card-value.mono { font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--sage); }

/* ── COUPLE HERO CARD ────────────────────────────────── */
.couple-card {
  background: var(--warm-white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 32px; margin-bottom: 24px;
  box-shadow: var(--shadow-sm); animation: fadeUp 0.5s 0.15s ease both;
  position: relative; overflow: hidden;
}

.couple-card::after {
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(201,169,110,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.couple-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 16px;
}

.couple-eyebrow {
  font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 6px;
}

.couple-names {
  font-family: var(--font-display); font-size: 42px; font-weight: 400;
  color: var(--text-dark); letter-spacing: -0.01em; line-height: 1;
}

.couple-names .ampersand { color: var(--gold); font-style: italic; font-weight: 300; }

.couple-meta { display: flex; gap: 20px; margin-top: 10px; flex-wrap: wrap; }

.couple-meta-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-muted);
}

.couple-meta-item svg { width: 16px; height: 16px; color: var(--gold); flex-shrink: 0; }

.edit-detail-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 100px;
  background: var(--gold-pale); border: 1px solid var(--border-strong);
  color: var(--sage-dark); font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
  text-decoration: none; font-family: var(--font-body);
}

.edit-detail-btn:hover { background: var(--gold); color: white; border-color: var(--gold); }

/* ── COUNTDOWN ───────────────────────────────────────── */
.countdown-row {
  display: flex; gap: 12px; padding-top: 20px; border-top: 1px solid var(--border);
}

.countdown-item {
  flex: 1; text-align: center; background: var(--cream);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 8px;
}

.countdown-item.highlight {
  background: var(--gold-pale); border-color: var(--border-strong);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

.countdown-num {
  font-family: var(--font-display); font-size: 32px; font-weight: 500;
  color: var(--sage); line-height: 1; display: block;
}

.countdown-label {
  font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); margin-top: 4px; display: block;
}

/* ── QUICK ACTIONS ───────────────────────────────────── */
.actions-section { animation: fadeUp 0.5s 0.2s ease both; margin-bottom: 24px; }

.section-title {
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}

.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.actions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.action-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 20px 16px;
  background: var(--warm-white); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: all 0.25s ease;
  color: var(--text-mid); box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden; text-decoration: none;
  font-family: var(--font-body);
}

.action-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(201,169,110,0.06) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.25s;
}

.action-btn:hover {
  border-color: var(--border-strong); box-shadow: var(--shadow-md);
  transform: translateY(-2px); color: var(--sage-dark);
}

.action-btn:hover::before { opacity: 1; }

.action-btn.primary {
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-light) 100%);
  border-color: transparent; color: white;
}

.action-btn.primary:hover {
  background: linear-gradient(135deg, var(--sage-dark) 0%, var(--sage) 100%); color: white;
}

.action-btn.primary::before { display: none; }

.action-btn-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--gold-pale); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); transition: all 0.25s;
}

.action-btn.primary .action-btn-icon {
  background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.2); color: var(--gold-light);
}

.action-btn:hover .action-btn-icon { background: var(--gold); border-color: var(--gold); color: white; }

.action-btn.primary:hover .action-btn-icon {
  background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.3); color: white;
}

.action-btn-icon svg { width: 16px; height: 16px; }

.action-btn-label { font-size: 12.5px; font-weight: 500; text-align: center; line-height: 1.3; }

/* ── STATS ROW ───────────────────────────────────────── */
.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  animation: fadeUp 0.5s 0.25s ease both;
}

.stat-card {
  background: var(--warm-white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow-sm); transition: all 0.25s;
}

.stat-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }

.stat-label {
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 8px;
}

.stat-num {
  font-family: var(--font-display); font-size: 36px; font-weight: 400;
  color: var(--text-dark); line-height: 1; margin-bottom: 4px;
}

.stat-sub { font-size: 12px; color: var(--text-muted); }

.stat-bar { height: 3px; background: var(--cream-dark); border-radius: 2px; margin-top: 12px; overflow: hidden; }

.stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
  border-radius: 2px; transition: width 1s ease;
}

/* ── BUTTONS ─────────────────────────────────────────── */
.btn-outline {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 100px;
  background: transparent; border: 1px solid var(--border-strong);
  color: var(--text-mid); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; font-family: var(--font-body);
  text-decoration: none;
}

.btn-outline:hover { background: var(--cream-dark); border-color: var(--sage); color: var(--sage); }

.btn-solid {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 100px;
  background: var(--sage); border: 1px solid transparent;
  color: white; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; font-family: var(--font-body);
}

.btn-solid:hover { background: var(--sage-dark); }

.btn-save {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 100px;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-light) 100%);
  border: none; color: white; font-family: var(--font-body);
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(61,79,62,0.25);
}

.btn-save:hover {
  background: linear-gradient(135deg, var(--sage-dark) 0%, var(--sage) 100%);
  box-shadow: 0 6px 20px rgba(61,79,62,0.32); transform: translateY(-1px);
}

/* Legacy button aliases */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 100px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; font-family: var(--font-body);
  text-decoration: none; border: 1px solid transparent;
}
.btn-primary { background: linear-gradient(135deg, var(--sage) 0%, var(--sage-light) 100%); color: white; border-color: transparent; }
.btn-primary:hover { background: linear-gradient(135deg, var(--sage-dark) 0%, var(--sage) 100%); color: white; }
.btn-danger { background: #fef2f2; color: #9b2020; border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 5px 14px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 14px; }
.btn-full { width: 100%; justify-content: center; }

/* ── EDITOR HEADER ───────────────────────────────────── */
.edit-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; animation: fadeUp 0.5s 0.05s ease both;
  flex-wrap: wrap; gap: 16px;
}

.edit-header-actions { display: flex; gap: 10px; }

/* ── EDITOR TABS ─────────────────────────────────────── */
.tab-bar, .tab-nav {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  margin-bottom: 28px; overflow-x: auto; scrollbar-width: none;
  animation: fadeUp 0.5s 0.1s ease both;
}

.tab-bar::-webkit-scrollbar, .tab-nav::-webkit-scrollbar { display: none; }

.tab-item, .tab-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border: none; background: none;
  color: var(--text-muted); font-size: 13px; font-weight: 400;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-family: var(--font-body);
}

.tab-item:hover, .tab-btn:hover { color: var(--text-mid); }

.tab-item.active, .tab-btn.active {
  color: var(--sage); border-bottom-color: var(--gold); font-weight: 500;
}

.tab-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; flex-shrink: 0;
}
.tab-icon svg { width: 16px; height: 16px; }
.tab-btn.active .tab-icon { color: var(--gold); }

.tab-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); opacity: 0.7; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── FORMS ───────────────────────────────────────────── */
.form-section, .card, .form-card {
  background: var(--warm-white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 32px;
  margin-bottom: 16px; box-shadow: var(--shadow-sm);
  animation: fadeUp 0.5s 0.15s ease both;
}

.form-section-header, .card-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.form-section-header.has-actions, .card-header.has-actions { justify-content: space-between; }

.form-section-icon {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--gold-pale); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; color: var(--gold);
  flex-shrink: 0;
}

.form-section-title {
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-mid);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.form-field, .form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-row .form-group, .form-grid .form-field, .form-grid .form-group { margin-bottom: 0; }
.form-field.full, .form-group.full { grid-column: 1 / -1; }

.form-label, .form-group label {
  font-size: 12px; font-weight: 500; color: var(--text-mid); letter-spacing: 0.01em;
}

.form-label span, label .required { color: var(--gold); margin-left: 2px; }

.form-input,
.form-group input,
.form-group select,
.form-group textarea,
select.form-input,
textarea.form-input {
  padding: 10px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--cream);
  font-family: var(--font-body); font-size: 13.5px; color: var(--text-dark);
  outline: none; transition: all 0.2s; width: 100%;
}

.form-input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold); background: var(--warm-white);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.12);
}

.form-input::placeholder,
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

/* Legacy form layout */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

.form-actions { display: flex; gap: 10px; margin-top: 20px; align-items: center; }

/* ── PHOTO UPLOAD ─────────────────────────────────────── */
.photo-upload { display: flex; gap: 14px; align-items: stretch; grid-column: 1 / -1; }

.photo-preview {
  width: 90px; min-height: 90px; border-radius: var(--radius-sm);
  background: var(--cream-dark); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; flex-shrink: 0; color: var(--text-muted); font-size: 11px; text-align: center;
}

.photo-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }

.photo-upload-zone, .file-upload-area {
  flex: 1; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: var(--cream); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; transition: all 0.2s; padding: 24px; color: var(--text-muted);
  position: relative;
}

.file-upload-area input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

.photo-upload-zone:hover, .file-upload-area:hover {
  border-color: var(--gold); background: var(--gold-pale); color: var(--gold);
}

.photo-upload-label, .file-upload-hint {
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}

.photo-upload-sub, .file-upload-hint span { font-size: 11px; color: var(--text-muted); }

.file-upload-area.compact { padding: 16px; min-height: 80px; }

/* Editor image preview */
.image-field-group {}
.image-preview-row { display: flex; align-items: flex-start; gap: 14px; }
.image-preview-thumb {
  width: 80px; height: 80px; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--border); flex-shrink: 0;
}
.image-preview-empty {
  width: 80px; height: 80px; border-radius: var(--radius-sm);
  border: 2px dashed var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-muted); text-align: center; flex-shrink: 0;
}

/* ── SAVE BAR ────────────────────────────────────────── */
.save-bar {
  position: sticky; bottom: 0; background: var(--warm-white);
  border-top: 1px solid var(--border); padding: 14px 48px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 -4px 20px rgba(61,79,62,0.07); z-index: 10;
}

.save-bar-hint { font-size: 12.5px; color: var(--text-muted); font-style: italic; }

/* ── GUESTS TABLE ────────────────────────────────────── */
.guests-table-wrap {
  background: var(--warm-white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden; animation: fadeUp 0.5s 0.15s ease both;
}

.table-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table-toolbar {
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

.search-wrap { position: relative; }
.search-wrap svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}

.search-input {
  padding: 9px 14px 9px 36px; border: 1px solid var(--border-strong);
  border-radius: 100px; background: var(--cream); font-family: var(--font-body);
  font-size: 13px; color: var(--text-dark); outline: none; transition: all 0.2s; width: 240px;
}

.search-input:focus {
  border-color: var(--gold); background: var(--warm-white);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.12);
}

table { width: 100%; border-collapse: collapse; }

thead th {
  padding: 12px 20px; text-align: left; font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted);
  background: var(--cream); border-bottom: 1px solid var(--border);
}

tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--cream); }

tbody td { padding: 14px 20px; font-size: 13.5px; color: var(--text-dark); vertical-align: middle; }

/* ── BADGES ──────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 100px; font-size: 11.5px; font-weight: 500;
}

.badge.hadir, .badge-success {
  background: #edf7f0; color: #2d7a4f; border: 1px solid #b6e4ca;
}

.badge.belum, .badge-gray {
  background: var(--gold-pale); color: #8a6d3b; border: 1px solid var(--border-strong);
}

.badge.tidak {
  background: #fef2f2; color: #9b3939; border: 1px solid #fecaca;
}

.badge-purple { background: #f3f0fe; color: #6c3fc5; border: 1px solid #d4c5f9; }

.badge-dot {
  width: 5px; height: 5px; border-radius: 50%; background: currentColor; display: inline-block;
}

/* ── LINK CELL ───────────────────────────────────────── */
.link-cell { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.link-code {
  font-family: monospace; font-size: 12.5px; color: var(--sage);
  background: var(--cream); padding: 3px 8px; border-radius: 5px;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── EMPTY STATE ─────────────────────────────────────── */
.empty-state {
  padding: 52px 32px; text-align: center;
  color: var(--text-muted); font-size: 13.5px;
}

/* ── FLASH BARS ──────────────────────────────────────── */
.flash-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 48px; font-size: 13px; font-weight: 500;
  animation: fadeUp 0.3s ease both;
}

.flash-bar.success { background: #edf7f0; color: #1a5c35; border-bottom: 1px solid #b6e4ca; }
.flash-bar.error   { background: #fef2f2; color: #9b2020; border-bottom: 1px solid #fecaca; }

/* ── AUTH LAYOUT ─────────────────────────────────────── */
.auth-layout {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 24px; position: relative; z-index: 1;
}

.auth-card {
  background: var(--warm-white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px 44px;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex; align-items: center; gap: 10px;
  justify-content: center; margin-bottom: 28px;
}

.auth-logo .logo-icon { width: 40px; height: 40px; font-size: 18px; }
.auth-logo .logo-text { font-size: 28px; }

.auth-title {
  font-family: var(--font-display); font-size: 28px; font-weight: 400;
  text-align: center; color: var(--text-dark); margin-bottom: 8px;
}

.auth-sub { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 4px; }

/* ── ADMIN STATS ─────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-bottom: 24px; animation: fadeUp 0.5s 0.1s ease both;
}

.stats-grid .stat-card { display: flex; align-items: center; gap: 16px; }

.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.stat-icon svg { width: 20px; height: 20px; }
.stat-icon-blue { background: #eff6ff; color: #3b82f6; border: 1px solid #bfdbfe; }
.stat-icon-green { background: #edf7f0; color: #2d7a4f; border: 1px solid #b6e4ca; }
.stat-icon-purple { background: #f3f0fe; color: #6c3fc5; border: 1px solid #d4c5f9; }

.stat-info { flex: 1; }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 500; color: var(--text-dark); }

/* ── EDITOR DYN CARDS ────────────────────────────────── */
.dyn-card {
  background: var(--cream); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 20px; margin-bottom: 14px; position: relative;
}

.dyn-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dyn-card-title { font-size: 13px; font-weight: 600; color: var(--text-mid); }
.dyn-card-actions { display: flex; gap: 6px; }

.story-img-preview {
  width: 80px; height: 80px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border);
}

.story-img-empty {
  width: 80px; height: 80px; border-radius: 6px;
  border: 2px dashed var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-muted); text-align: center;
}

/* ── TEMPLATE GRID (admin) ───────────────────────────── */
.template-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px; animation: fadeUp 0.5s 0.1s ease both;
}

.template-card {
  background: var(--warm-white); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: all 0.25s;
}

.template-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }

/* ── CHECKBOX ────────────────────────────────────────── */
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-mid); cursor: pointer;
}

.checkbox-label input[type="checkbox"] { accent-color: var(--sage); width: 15px; height: 15px; }

/* ── TEXT UTILITIES ──────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.hint { font-size: 11.5px; color: var(--text-muted); font-weight: 400; }
.required { color: var(--gold); }

code {
  font-family: monospace; font-size: 12px; color: var(--sage);
  background: var(--cream); padding: 2px 6px; border-radius: 4px;
}

/* ── RESPONSIVE ───────────────────────────────────────── */

/* Wide desktop */
@media (min-width: 1400px) {
  .main-inner { padding: 48px 64px; }
  .actions-grid { grid-template-columns: repeat(4, minmax(0, 260px)); }
}

@media (max-width: 1100px) {
  .main-inner { padding: 36px 40px; }
  .couple-names { font-size: 36px; }
}

@media (max-width: 960px) {
  .sidebar { width: 210px; min-width: 210px; }
  .main-inner { padding: 32px 32px; }
  .couple-names { font-size: 32px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ── MOBILE / TABLET (≤768px) ───────────────────── */
@media (max-width: 768px) {
  /* Topbar visible */
  .mobile-topbar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 50;
    height: 56px; padding: 0 16px;
    background: var(--sage-dark); color: var(--gold-light);
    border-bottom: 1px solid rgba(201,169,110,0.18);
    box-shadow: 0 1px 12px rgba(0,0,0,0.10);
  }
  .mobile-menu-btn {
    background: none; border: none; color: var(--gold-light);
    padding: 8px; cursor: pointer; display: flex;
    border-radius: 6px; transition: background 0.15s;
  }
  .mobile-menu-btn:hover { background: rgba(201,169,110,0.12); }
  .mobile-logo {
    display: flex; align-items: center; gap: 10px; flex: 1;
    font-family: var(--font-display); font-size: 20px; color: var(--gold-light);
  }
  .mobile-logo .logo-icon {
    width: 28px; height: 28px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: 14px;
    color: var(--sage-dark); font-weight: 600;
  }
  .mobile-logout-form { display: flex; }
  .mobile-logout-btn {
    background: none; border: none; color: rgba(255,255,255,0.55);
    padding: 8px; cursor: pointer; display: flex;
    border-radius: 6px; transition: all 0.15s;
  }
  .mobile-logout-btn:hover { color: var(--gold-light); background: rgba(201,169,110,0.12); }

  /* Drawer backdrop */
  .drawer-backdrop {
    display: block; position: fixed; inset: 0;
    background: rgba(15,22,16,0.55); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 90;
  }
  .drawer-backdrop.drawer-open { opacity: 1; pointer-events: auto; }

  /* Layout flow */
  .layout { flex-direction: column; height: auto; min-height: calc(100vh - 56px); overflow: visible; }

  /* Sidebar = drawer */
  .sidebar {
    position: fixed; top: 0; left: 0;
    width: 280px; min-width: 0; height: 100vh;
    transform: translateX(-100%); transition: transform 0.28s ease;
    z-index: 100; box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  }
  .sidebar.drawer-open { transform: translateX(0); }
  .sidebar::after { display: none; }

  .sidebar-nav { padding: 12px 12px; }
  .sidebar-footer { padding: 12px; }

  /* Main */
  .main { height: auto; overflow-y: visible; flex: 1; min-height: 0; }
  .main-inner { padding: 24px 18px; }

  /* Headings */
  .page-title { font-size: 28px; }
  .page-header { margin-bottom: 22px; }
  .page-eyebrow { font-size: 10.5px; }

  /* Cards */
  .info-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 18px; }
  .info-card { padding: 18px 20px; }
  .info-card-icon { width: 40px; height: 40px; }
  .info-card-value { font-size: 18px; }

  /* Couple */
  .couple-card { padding: 22px 22px; margin-bottom: 18px; }
  .couple-names { font-size: 26px; }
  .couple-card-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .edit-detail-btn { align-self: flex-start; }
  .couple-meta { gap: 14px; }

  /* Countdown */
  .countdown-row { flex-wrap: wrap; gap: 8px; padding-top: 16px; }
  .countdown-item { flex: 1 1 calc(50% - 4px); min-width: 0; padding: 10px 6px; }
  .countdown-num { font-size: 26px; }

  /* Actions */
  .actions-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .action-btn { padding: 16px 12px; }
  .action-btn-icon { width: 36px; height: 36px; }

  /* Stats */
  .stats-row { grid-template-columns: 1fr; gap: 10px; }
  .stats-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Editor header */
  .edit-header { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
  .edit-header-actions { flex-wrap: wrap; gap: 8px; }
  .edit-header .page-title { font-size: 26px !important; }

  /* Tabs become icon-only chips on mobile */
  .tab-bar, .tab-nav {
    padding: 4px 0; margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
  }
  .tab-btn, .tab-item {
    padding: 10px 12px; font-size: 12px; gap: 6px;
    border-bottom-width: 2px;
  }
  .tab-label { display: none; }
  .tab-btn.active .tab-label, .tab-item.active .tab-label {
    display: inline; font-size: 12px;
  }
  .tab-btn.active, .tab-item.active { padding: 10px 14px; }

  /* Forms */
  .form-section, .card, .form-card { padding: 22px 20px; margin-bottom: 14px; }
  .form-section-header, .card-header { margin-bottom: 18px; padding-bottom: 14px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .form-row { grid-template-columns: 1fr; gap: 0; margin-bottom: 0; }
  .form-row .form-group { margin-bottom: 14px; }
  .form-field, .form-group { margin-bottom: 14px; }
  .form-input, .form-group input, .form-group select, .form-group textarea { font-size: 14px; }

  /* Image upload becomes stacked on tiny screens */
  .image-preview-row { flex-wrap: wrap; gap: 10px; }
  .file-upload-area { width: 100%; }

  /* Dynamic cards */
  .dyn-card { padding: 16px; }

  /* Save bar */
  .save-bar { padding: 14px 18px; }
  .save-bar-hint { font-size: 11.5px; }

  /* Tables → horizontal scroll */
  .table-scroll-wrap { margin: 0; }
  table { min-width: 580px; }
  thead th, tbody td { padding: 10px 14px; font-size: 12.5px; }
  .table-toolbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 16px; }
  .search-input { width: 100%; }

  /* Auth */
  .auth-card { padding: 32px 26px; }
}

/* ── SMALL MOBILE (≤480px) ──────────────────────── */
@media (max-width: 480px) {
  .main-inner { padding: 18px 14px; }
  .page-title { font-size: 24px; }
  .edit-header .page-title { font-size: 22px !important; }

  .couple-card { padding: 18px 18px; }
  .couple-names { font-size: 22px; line-height: 1.15; }
  .couple-names .ampersand { display: inline-block; padding: 0 2px; }
  .countdown-num { font-size: 22px; }
  .countdown-item { padding: 8px 6px; }

  .info-card { padding: 16px 18px; gap: 12px; }
  .info-card-icon { width: 36px; height: 36px; }

  .action-btn { padding: 14px 10px; gap: 8px; }
  .action-btn-icon { width: 32px; height: 32px; }
  .action-btn-label { font-size: 11.5px; }

  .stat-card { padding: 16px 18px; }
  .stat-num { font-size: 28px; }

  .form-section, .card, .form-card { padding: 18px 16px; }

  .save-bar { flex-direction: column; gap: 10px; align-items: stretch; padding: 12px 14px; }
  .btn-save { justify-content: center; }

  .auth-card { padding: 28px 22px; }
  .auth-title { font-size: 24px; }

  .flash-bar { padding: 11px 16px; font-size: 12.5px; }

  .mobile-topbar { height: 52px; padding: 0 12px; }
  .mobile-logo { font-size: 18px; }

  .sidebar { width: 84vw; max-width: 300px; }

  .tab-btn, .tab-item { padding: 9px 10px; }
  .tab-icon { width: 14px; height: 14px; }
  .tab-icon svg { width: 14px; height: 14px; }
}

/* Hide topbar / drawer on desktop, ensure sidebar sticky */
@media (min-width: 769px) {
  .mobile-topbar, .drawer-backdrop { display: none !important; }
  .sidebar { transform: none !important; }
}
