:root {
  --bg: #fdfaf3;
  --surface: #fffdf8;
  --surface-alt: #f5eee0;
  --text: #322620;
  --muted: #706057;
  --ink: #382b26;
  --primary: #b85d69;
  --primary-hover: #9c4a55;
  --accent: #4c7355;
  --danger: #b83b3b;
  --border: #382b26;
  --border-soft: #d7ccbc;
  --radius: 16px 20px 15px 22px / 20px 14px 22px 16px;
  --radius-sm: 12px 15px 11px 14px / 14px 10px 15px 12px;
  --shadow: 3px 4px 0 #382b26;
  --shadow-sm: 2px 3px 0 #382b26;
}

[data-theme="dark"] {
  --bg: #1c1716;
  --surface: #27201e;
  --surface-alt: #342b28;
  --text: #f3eadc;
  --muted: #b5a79a;
  --ink: #e4d6c3;
  --primary: #d17480;
  --primary-hover: #b85d69;
  --accent: #6ea378;
  --danger: #e06c6c;
  --border: #e4d6c3;
  --border-soft: #594b45;
  --shadow: 3px 4px 0 #0b0908;
  --shadow-sm: 2px 3px 0 #0b0908;
}

[data-theme="dark"] body {
  background-image: radial-gradient(#382e2b 1px, transparent 1px);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #1e1817;
  color: var(--text);
}

[data-theme="dark"] .nav-item.active {
  background: #3d2529;
  color: #f09aa5;
}

[data-theme="dark"] .badge-ok { background: #213b27; color: #9ad4a4; }
[data-theme="dark"] .badge-warn { background: #3f3118; color: #f0cb7a; }
[data-theme="dark"] .badge-bad { background: #422020; color: #f29b9b; }
[data-theme="dark"] .btn-danger { background: #422020; color: #f29b9b; }

@media (max-width: 820px) {
  [data-theme="dark"] .topbar {
    background: rgba(28, 23, 22, 0.92);
  }
}

/* --- Rich Exclusive: Full Neumorphism (Soft UI) Theme (Light & Dark) --- */
[data-ui-style="neumorphism"] {
  --bg: #e6eaf0;
  --surface: #e6eaf0;
  --surface-alt: #dfe4ec;
  --text: #2a3140;
  --muted: #667085;
  --ink: rgba(255, 255, 255, 0.55);
  --primary: #c94b6b;
  --primary-hover: #b03a59;
  --accent: #2e8b57;
  --danger: #d64545;
  --border: rgba(255, 255, 255, 0.55);
  --border-soft: rgba(163, 177, 198, 0.35);
  --radius: 20px;
  --radius-sm: 14px;
  --neu-out: 8px 8px 16px #c5cbd6, -8px -8px 16px #ffffff;
  --neu-out-sm: 4px 4px 9px #c5cbd6, -4px -4px 9px #ffffff;
  --neu-in: inset 4px 4px 8px #c5cbd6, inset -4px -4px 8px #ffffff;
  --shadow: var(--neu-out);
  --shadow-sm: var(--neu-out-sm);
}

[data-ui-style="neumorphism"] body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  background-image: none;
}

[data-ui-style="neumorphism"] h1,
[data-ui-style="neumorphism"] h2,
[data-ui-style="neumorphism"] h3,
[data-ui-style="neumorphism"] h4,
[data-ui-style="neumorphism"] .brand-title,
[data-ui-style="neumorphism"] .stat-value,
[data-ui-style="neumorphism"] .price-tag {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.025em;
  font-weight: 700;
}

[data-ui-style="neumorphism"] .brand-title { font-size: 1.25rem; }
[data-ui-style="neumorphism"] h2 { font-size: 1.35rem; }
[data-ui-style="neumorphism"] h3 { font-size: 1.05rem; }
[data-ui-style="neumorphism"] .stat-value { font-size: 1.55rem; font-variant-numeric: tabular-nums; }

[data-ui-style="neumorphism"] .card,
[data-ui-style="neumorphism"] .sidebar,
[data-ui-style="neumorphism"] .modal,
[data-ui-style="neumorphism"] .stat-card,
[data-ui-style="neumorphism"] .table-wrap,
[data-ui-style="neumorphism"] .topbar,
[data-ui-style="neumorphism"] .promo-banner,
[data-ui-style="neumorphism"] .toast,
[data-ui-style="neumorphism"] .info-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--neu-out);
}

[data-ui-style="neumorphism"] .stat-card,
[data-ui-style="neumorphism"] .table-wrap,
[data-ui-style="neumorphism"] .promo-banner,
[data-ui-style="neumorphism"] .info-banner,
[data-ui-style="neumorphism"] .toast {
  border-radius: var(--radius-sm);
  box-shadow: var(--neu-out-sm);
}

[data-ui-style="neumorphism"] .topbar {
  padding: 16px 22px;
  margin-bottom: 22px;
}

[data-ui-style="neumorphism"] .topbar-left {
  gap: 14px;
}

[data-ui-style="neumorphism"] .topbar h1 {
  margin-bottom: 3px;
}

@media (max-width: 768px) {
  html {
    font-size: 13.5px;
  }
  body {
    font-size: 0.92rem;
  }
  [data-ui-style="neumorphism"] .topbar {
    padding: 12px 14px;
    margin-bottom: 16px;
  }
}

[data-ui-style="neumorphism"] .sidebar {
  border-radius: 0;
  border-top: none;
  border-bottom: none;
  border-left: none;
}

[data-ui-style="neumorphism"] .field label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
}

[data-ui-style="neumorphism"] input,
[data-ui-style="neumorphism"] select,
[data-ui-style="neumorphism"] textarea {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  box-shadow: var(--neu-in);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

[data-ui-style="neumorphism"] input:focus,
[data-ui-style="neumorphism"] select:focus,
[data-ui-style="neumorphism"] textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--neu-in), 0 0 0 2px rgba(201, 75, 107, 0.18);
}

[data-ui-style="neumorphism"] .btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--neu-out-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

[data-ui-style="neumorphism"] .btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

[data-ui-style="neumorphism"] .btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--neu-in);
}

[data-ui-style="neumorphism"] .btn-primary {
  background: linear-gradient(145deg, #d85a79, #b53f5e);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  box-shadow: 4px 4px 10px #c5cbd6, -4px -4px 10px #ffffff;
}

[data-ui-style="neumorphism"] .btn-primary:active:not(:disabled) {
  box-shadow: inset 3px 3px 6px #8f2d47, inset -3px -3px 6px #e66e8d;
}

[data-ui-style="neumorphism"] .btn-ghost {
  box-shadow: none;
  border-color: transparent;
  background: transparent;
}

[data-ui-style="neumorphism"] .btn-ghost:hover:not(:disabled) {
  box-shadow: var(--neu-out-sm);
}

[data-ui-style="neumorphism"] .btn-danger {
  color: #b91c1c;
}

[data-ui-style="neumorphism"] .nav-item {
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 500;
  transition: box-shadow 0.16s ease, color 0.16s ease;
}

[data-ui-style="neumorphism"] .nav-item:hover {
  box-shadow: var(--neu-out-sm);
}

[data-ui-style="neumorphism"] .nav-item.active {
  background: var(--bg);
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--neu-in);
}

[data-ui-style="neumorphism"] .badge {
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: 2px 2px 5px #c5cbd6, -2px -2px 5px #ffffff;
  font-weight: 600;
}

[data-ui-style="neumorphism"] th {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-soft);
}

[data-ui-style="neumorphism"] td {
  border-bottom: 1px solid var(--border-soft);
}

[data-ui-style="neumorphism"] .progress-track {
  border: none;
  background: var(--bg);
  box-shadow: var(--neu-in);
  border-radius: 999px;
}

[data-theme="dark"][data-ui-style="neumorphism"] {
  --bg: #232730;
  --surface: #232730;
  --surface-alt: #282d38;
  --text: #e6eaf2;
  --muted: #98a2b3;
  --ink: rgba(255, 255, 255, 0.06);
  --primary: #e06b88;
  --primary-hover: #c94b6b;
  --accent: #4ade80;
  --danger: #f87171;
  --border: rgba(255, 255, 255, 0.05);
  --border-soft: rgba(255, 255, 255, 0.07);
  --neu-out: 8px 8px 16px #181b22, -8px -8px 16px #2e333e;
  --neu-out-sm: 4px 4px 9px #181b22, -4px -4px 9px #2e333e;
  --neu-in: inset 4px 4px 8px #181b22, inset -4px -4px 8px #2e333e;
  --shadow: var(--neu-out);
  --shadow-sm: var(--neu-out-sm);
}

[data-theme="dark"][data-ui-style="neumorphism"] body {
  background-color: var(--bg);
  background-image: none;
}

[data-theme="dark"][data-ui-style="neumorphism"] input,
[data-theme="dark"][data-ui-style="neumorphism"] select,
[data-theme="dark"][data-ui-style="neumorphism"] textarea {
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text);
}

[data-theme="dark"][data-ui-style="neumorphism"] .btn-primary {
  box-shadow: 4px 4px 10px #181b22, -4px -4px 10px #2e333e;
}

[data-theme="dark"][data-ui-style="neumorphism"] .btn-danger {
  color: #fca5a5;
}

[data-theme="dark"][data-ui-style="neumorphism"] .badge {
  box-shadow: 2px 2px 5px #181b22, -2px -2px 5px #2e333e;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  background-image: radial-gradient(#e0d6c5 1px, transparent 1px);
  background-size: 20px 20px;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

body.drawer-open {
  overflow: hidden;
}

h1, h2, h3, .brand-title {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.svg-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Brand */
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--border-soft);
  flex-shrink: 0;
}

.auth-brand .brand-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 8px;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-logo-dark {
  display: none;
}

[data-theme="dark"] .brand-logo-light {
  display: none;
}

[data-theme="dark"] .brand-logo-dark {
  display: block;
}

/* Loading Shimmer Animation for Cards & Tables */
@keyframes shimmerSweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes loadingPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}

.main-content.is-loading .card,
.main-content.is-loading .stat-card {
  position: relative;
  overflow: hidden;
}

.main-content.is-loading .card::after,
.main-content.is-loading .stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.28) 50%, transparent 100%);
  animation: shimmerSweep 1.15s ease-in-out infinite;
  pointer-events: none;
  z-index: 3;
}

[data-theme="dark"] .main-content.is-loading .card::after,
[data-theme="dark"] .main-content.is-loading .stat-card::after {
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
}

.main-content.is-loading .table-wrap tbody,
.main-content.is-loading .stat-value {
  animation: loadingPulse 1.1s ease-in-out infinite;
}

/* Auth */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
}

.auth-wrapper.with-pricing {
  align-items: stretch;
  max-width: 1640px;
  padding: 20px 14px;
  gap: 18px;
  margin: 0 auto;
}

.auth-wrapper.with-pricing .auth-card {
  flex-shrink: 0;
  width: 340px;
  display: flex;
  flex-direction: column;
}

.pricing-showcase {
  flex: 1;
  min-width: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
}

.pricing-showcase .pricing-grid {
  flex: 1;
  padding: 0;
}

@media (min-width: 1180px) {
  .pricing-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }
}

.pricing-card.is-konglo {
  background: linear-gradient(155deg, #171126 0%, #261942 52%, #130e20 100%);
  border-color: #d4af37;
  color: #faf5ff;
  box-shadow: 0 8px 24px rgba(38, 25, 66, 0.32), inset 0 1px 0 rgba(251, 191, 36, 0.28);
}

.pricing-card.is-konglo:hover {
  border-color: #fbbf24;
  box-shadow: 0 6px 0 #d4af37, 0 12px 30px rgba(212, 175, 55, 0.28);
}

.pricing-card.is-konglo .pricing-sub {
  color: #cbb8e8;
}

.pricing-card.is-konglo .price-block {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(251, 191, 36, 0.45);
}

.pricing-card.is-konglo .price-tag {
  color: #fde68a;
}

.pricing-card.is-konglo .price-tag.is-promo {
  color: #4ade80;
}

.pricing-card.is-konglo .pricing-features li::before {
  color: #fbbf24;
}

.pricing-card.is-konglo .pricing-cta {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #fde68a;
  color: #1e1204;
  font-weight: 700;
}

.pricing-ribbon.is-konglo {
  background: linear-gradient(110deg, #6d28d9 0%, #a855f7 35%, #fbbf24 70%, #6d28d9 100%);
  background-size: 200% 100%;
  color: #fff;
  animation: goldShimmer 3s linear infinite;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.mobile-only-tablet {
  display: none;
}

@media (max-width: 980px) {
  .mobile-only-tablet {
    display: inline-block;
  }

  .auth-wrapper.with-pricing {
    flex-direction: column;
    align-items: center;
  }

  .auth-wrapper.with-pricing .auth-card {
    position: static;
  }
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: stretch;
  padding: 12px 0;
}

.pricing-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  margin: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pricing-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 6px 0 var(--primary);
}

.pricing-card.is-best-seller:hover {
  border-color: #f59e0b;
}

@keyframes goldShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes goldPulse {
  0%, 100% { box-shadow: 0 6px 0 #d97706, 0 0 18px rgba(251, 191, 36, 0.28); }
  50% { box-shadow: 0 6px 0 #f59e0b, 0 0 28px rgba(251, 191, 36, 0.55); }
}

.pricing-card.is-best-seller {
  border-color: #f59e0b;
  background: linear-gradient(155deg, rgba(254, 243, 199, 0.72) 0%, rgba(253, 230, 138, 0.35) 50%, rgba(255, 251, 235, 0.85) 100%);
  background-size: 200% 200%;
  animation: goldPulse 2.8s ease-in-out infinite;
  z-index: 2;
}

[data-theme="dark"] .pricing-card.is-best-seller {
  background: linear-gradient(155deg, #3a2b12 0%, #2b2114 48%, #473312 100%);
}

@media (min-width: 768px) {
  .pricing-card.is-best-seller {
    z-index: 2;
  }
}

.pricing-ribbon.is-best-seller {
  background: linear-gradient(110deg, #b45309 0%, #f59e0b 25%, #fef08a 45%, #fbbf24 65%, #b45309 100%);
  background-size: 200% 100%;
  color: #451a03;
  animation: goldShimmer 2.6s linear infinite;
}

.pricing-ribbon {
  position: absolute;
  top: 22px;
  right: -42px;
  width: 168px;
  padding: 5px 0;
  text-align: center;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  transform: rotate(35deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 2;
}

.pricing-ribbon.is-promo {
  background: linear-gradient(135deg, #ef4444, #be123c);
}

.pricing-ribbon.is-default {
  background: linear-gradient(135deg, #16a34a, #15803d);
}

.pricing-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding-right: 48px;
}

.pricing-card-head h4 {
  margin: 0;
  font-size: 1.2rem;
}

.pricing-sub {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.price-block {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1.5px dashed var(--border);
}

.price-duration {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.price-discount-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
}

.pricing-features li {
  position: relative;
  padding-left: 22px;
  line-height: 1.35;
}

.pricing-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary);
  font-weight: 800;
}

.pricing-cta {
  margin-top: auto;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, filter 0.22s ease;
}

.pricing-cta::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
  pointer-events: none;
}

.pricing-cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(190, 18, 60, 0.28);
  filter: brightness(1.05);
}

.pricing-cta:hover::after {
  left: 140%;
}

.pricing-cta:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 6px rgba(190, 18, 60, 0.2);
}

.badge-promo {
  background: linear-gradient(135deg, #e11d48, var(--primary));
  color: #fff;
  border-color: var(--ink);
  white-space: nowrap;
}

.promo-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #fbe9ec, #fde2e7);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 12px 18px;
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--primary);
  text-align: center;
}

.ai-planner-card {
  margin-bottom: 18px;
  border-color: var(--primary);
}

.ai-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Digital Guest Invitation + Check-In */
#guest-scanner-view[data-invite-themed="true"] {
  background-color: var(--inv-bg);
  background-image: none;
  color: var(--inv-text);
}

#guest-scanner-view[data-invite-themed="true"] .invite-card {
  background: var(--inv-card);
  border-color: var(--inv-border);
  color: var(--inv-text);
}

#guest-scanner-view[data-invite-themed="true"] .muted {
  color: var(--inv-muted);
}

#guest-scanner-view[data-invite-themed="true"] .invite-eyebrow,
#guest-scanner-view[data-invite-themed="true"] .invite-ornament,
#guest-scanner-view[data-invite-themed="true"] .invite-countdown {
  color: var(--inv-accent);
}

#guest-scanner-view[data-invite-themed="true"] .btn-primary {
  background: var(--inv-accent);
  border-color: var(--inv-border);
  color: #fff;
}

#guest-scanner-view[data-invite-font="script"] .invite-couple { font-family: 'Caveat', cursive; font-size: 2.5rem; }
#guest-scanner-view[data-invite-font="serif"] .invite-couple { font-family: Georgia, 'Times New Roman', serif; letter-spacing: -0.01em; }
#guest-scanner-view[data-invite-font="classic"] .invite-couple { font-family: Georgia, serif; letter-spacing: 0.03em; text-transform: uppercase; font-size: 1.75rem; }
#guest-scanner-view[data-invite-font="sans"] .invite-couple { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; }

.invite-ornament {
  font-size: 1.35rem;
  line-height: 1;
  margin-top: 4px;
}

.template-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (min-width: 768px) {
  .template-picker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1180px) {
  .template-picker-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
  }
}

.tpl-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-soft);
  background: var(--surface-alt);
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.tpl-item:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.tpl-item.active {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.28);
}

.tpl-item.active .tpl-cat {
  color: #166534;
}

[data-theme="dark"] .tpl-item.active {
  background: #143321;
  border-color: #4ade80;
  color: #dcfce7;
}

[data-theme="dark"] .tpl-item.active .tpl-cat {
  color: #86efac;
}

.tpl-swatch {
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border: 1px solid rgba(128, 128, 128, 0.25);
  font-weight: 700;
  font-size: 0.8rem;
}

.tpl-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tpl-name {
  font-weight: 700;
  font-size: 0.85rem;
}

.tpl-cat {
  font-size: 0.74rem;
  color: var(--muted);
}

.invite-card {
  max-width: 520px;
  text-align: center;
}

.invite-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-top: 6px;
}

.invite-couple {
  font-size: 2.1rem;
  margin: 4px 0 6px;
}

.invite-countdown {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

.invite-guest-box {
  margin: 18px 0 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1.5px dashed var(--border-soft);
}

.invite-to {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.invite-guest-box h3 {
  margin: 0 0 4px;
}

.invite-quote {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 16px;
}

.invite-rundown {
  text-align: left;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
}

.invite-rundown h4 {
  margin: 0 0 10px;
  text-align: center;
}

.invite-rundown-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.invite-rundown-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 0.88rem;
}

.invite-rundown-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.invite-checkin-box {
  padding-top: 14px;
  border-top: 1.5px dashed var(--border-soft);
  text-align: center;
}

.invite-checkin-box h4 {
  margin: 0;
}

[data-theme="dark"] .promo-banner {
  background: linear-gradient(135deg, #3d2529, #4a232b);
  color: #f9b4c0;
}

.price-tag {
  font-family: 'Caveat', cursive;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.05;
}

.price-tag.is-promo {
  font-size: 2.35rem;
  color: #16a34a;
}

[data-theme="dark"] .price-tag.is-promo {
  color: #4ade80;
}

.price-original {
  font-size: 0.98rem;
  font-weight: 600;
  color: #ef4444;
  text-decoration: line-through;
  text-decoration-color: #ef4444;
  text-decoration-thickness: 2px;
}

[data-theme="dark"] .price-original {
  color: #f87171;
  text-decoration-color: #f87171;
}

.price-promo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.howto-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.auth-brand {
  text-align: center;
  margin-bottom: 20px;
}

.auth-brand h1 {
  font-size: 2rem;
  margin-top: 8px;
}

.auth-brand p {
  font-size: 0.9rem;
  color: var(--muted);
}

.mode-banner {
  background: #fff6e6;
  border: 1px solid #f0d7a7;
  color: #7a5210;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 18px;
}

.auth-tab {
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}

.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.auth-form, .form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-footer {
  margin-top: 18px;
  text-align: center;
}

/* Inputs & Buttons */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
}

input, select, textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  background: #fff;
  color: var(--text);
}

input[type="date"],
input[type="time"] {
  display: block;
  -webkit-appearance: none;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: 'Patrick Hand', 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: var(--surface);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--surface-alt);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--surface-alt);
  border-color: var(--ink);
  color: var(--text);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.88rem;
}

.btn-danger {
  background: #fdecec;
  color: var(--danger);
}

.btn-danger:hover {
  background: #fad5d5;
}

.btn-full {
  width: 100%;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* App Layout */
.app-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--surface);
  border-right: 2px solid var(--ink);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-title {
  font-family: 'Caveat', cursive;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.05;
}

.brand-sub {
  font-size: 0.82rem;
  color: var(--muted);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 9px 12px;
  border: 2px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  font-family: 'Patrick Hand', 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.nav-item:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.nav-item.active {
  background: #fbe9ec;
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
  color: var(--primary);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.main-content {
  padding: 28px 32px;
  width: 100%;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-only {
  display: none;
}

.menu-toggle {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  width: 40px;
  height: 40px;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(44, 36, 32, 0.45);
  z-index: 55;
}

.sidebar-brand-text {
  flex: 1;
  min-width: 0;
}

.topbar h2 {
  font-size: 2rem;
  line-height: 1.1;
}

/* Wedding Plans */
.plan-intro {
  margin-bottom: 20px;
}

.plan-intro h3 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (min-width: 1180px) {
  .plans-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.plan-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.plan-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.plan-card-head h3 {
  font-size: 1.5rem;
}

.plan-budget-total {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

.plan-section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 6px;
}

.plan-preview-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.86rem;
}

.plan-preview-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 5px;
  border-bottom: 1px dashed var(--border);
}

.plan-preview-list li strong,
.plan-preview-list li .muted {
  white-space: nowrap;
  flex-shrink: 0;
}

.plan-preview-list li:last-child {
  border-bottom: none;
}

.plan-card-footer {
  margin-top: auto;
  padding-top: 6px;
}

/* Cards & Grids */
.card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.stat-value {
  font-size: 1.45rem;
  color: var(--text);
}

.stat-sub {
  font-size: 0.82rem;
  color: var(--accent);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

/* Tables & Toolbars */
.panel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filters input, .filters select {
  width: auto;
  min-width: 180px;
}

.table-wrap {
  padding: 0;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1.5px dashed var(--border-soft);
}

th {
  font-family: 'Patrick Hand', 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: var(--text);
  background: var(--surface-alt);
  border-bottom: 2px solid var(--ink);
}

tr:last-child td {
  border-bottom: none;
}

/* Badges & Lists */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  font-family: 'Patrick Hand', 'Plus Jakarta Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.badge-ok { background: #e6f2e7; color: #2b5c30; }
.badge-warn { background: #fff3d6; color: #855a07; }
.badge-bad { background: #fde8e8; color: #9c2727; }
.badge-neutral { background: var(--surface-alt); color: var(--muted); }

.mini-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.dash-check-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  cursor: pointer;
}

.mini-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
  font-size: 0.9rem;
}

.mini-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(44, 36, 32, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.confirm-backdrop {
  z-index: 120;
}

.danger-card {
  margin-top: 20px;
}

.activity-card {
  margin-top: 20px;
}

.audit-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 3px;
}

.receipt-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: underline;
  margin-top: 4px;
}

.installment-box {
  margin-top: 6px;
  padding: 6px 8px;
  background: var(--surface-alt);
  border: 1.5px dashed var(--border-soft);
  border-radius: 8px;
  font-size: 0.78rem;
}

.installment-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}

.installment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

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

/* Toast */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #e6f2e7;
  color: #214a26;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 10px 16px;
  font-family: 'Patrick Hand', 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.toast.error {
  background: #fde8e8;
  color: #8c2020;
}

[data-theme="dark"] .toast {
  background: #213b27;
  color: #b7e6bf;
}

[data-theme="dark"] .toast.error {
  background: #422020;
  color: #f5b3b3;
}

/* QR Check-in */
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.qr-img {
  width: 240px;
  height: 240px;
  padding: 12px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.qr-url-box {
  width: 100%;
  font-size: 0.8rem;
  word-break: break-all;
  background: var(--surface-alt);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.5px dashed var(--ink);
}

.checkin-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 16px 0;
}

.checkin-success h3 {
  font-size: 2rem;
  color: var(--accent);
}

.action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

#qr-reader {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}

/* Responsive */
@media (max-width: 820px) {
  .mobile-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100dvh;
    width: 270px;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow);
    overflow-y: auto;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    padding: 0 16px calc(24px + env(safe-area-inset-bottom));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(250, 247, 244, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin: 0 -16px 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
  }

  .topbar h2 {
    font-size: 1.45rem;
  }

  .topbar .muted {
    font-size: 0.8rem;
  }

  .topbar-actions .btn {
    padding: 8px 12px;
    font-size: 0.82rem;
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-value {
    font-size: 1.15rem;
  }

  .plans-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .plan-preview-list li span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .grid-2 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .panel-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .filters {
    width: 100%;
  }

  .filters input,
  .filters select,
  .panel-toolbar > .btn {
    width: 100%;
    min-width: 0;
  }

  /* Responsive Card-Table */
  .table-wrap {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }

  table, thead, tbody, th, td, tr {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
  }

  tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--border);
    text-align: right;
    font-size: 0.88rem;
  }

  tbody td::before {
    content: attr(data-label);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    text-align: left;
    flex-shrink: 0;
  }

  tbody td.td-actions {
    border-bottom: none;
    padding-top: 10px;
    padding-bottom: 0;
    justify-content: flex-end;
    gap: 8px;
  }

  tbody td.td-actions .action-btns {
    justify-content: flex-end;
  }

  tbody td.td-actions::before {
    display: none;
  }

  tbody tr.empty-row td {
    justify-content: center;
    text-align: center;
    border-bottom: none;
    padding: 16px 0;
  }

  tbody tr.empty-row td::before {
    display: none;
  }

  /* Mobile Modal Bottom Sheet */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    max-width: 100%;
    max-height: 88vh;
    border-radius: 16px 16px 0 0;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  }

  .toast-container {
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 16px;
  }
}
