/* ============================================================
   WEDDING PLANNER — Avian & Feby
   CSS: Mobile-first, iOS-safe, Android-compatible
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --rose: #C2785A;
  --rose-light: #F5EDE8;
  --rose-mid: #E8BBA8;
  --rose-dark: #8B4E35;
  --gold: #B8963E;
  --gold-light: #F7F0E1;
  --gold-mid: #DFC07A;
  --sage: #6B8C72;
  --sage-light: #EBF1EC;
  --ink: #2A2017;
  --muted: #8A7B6A;
  --border: #E8DDD4;
  --bg: #FDFAF7;
  --card: #FFFFFF;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --r: 16px;
  --rs: 8px;
  /* Safe area support (iPhone notch, Dynamic Island) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* ── Base ── */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%; /* Prevent iOS font size adjustment */
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
}
/* iOS height fix */
html { height: -webkit-fill-available; }

/* All inputs inherit font to prevent browser override */
input, select, textarea, button {
  font-family: inherit;
  /* Minimum font-size 16px pada input MENCEGAH auto-zoom iOS Safari */
  font-size: 16px;
}

/* ── App Loader ── */
.app-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.app-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-logo {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--rose-dark);
  letter-spacing: 0.03em;
}
.loader-logo span { color: var(--gold); font-style: italic; }
.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--rose-mid);
  border-top-color: var(--rose-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ── Floating Petals ── */
.petals-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.petal {
  position: absolute;
  top: -60px;
  width: 12px;
  height: 12px;
  border-radius: 50% 0 50% 0;
  opacity: 0;
  animation: petalFall linear infinite;
  will-change: transform, opacity;
}
.petal:nth-child(odd) { border-radius: 0 50% 0 50%; }
@keyframes petalFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(110vh) rotate(700deg); opacity: 0; }
}

/* ── Header ── */
.site-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  /* Safe area top padding (iPhone notch) */
  padding-top: var(--safe-top);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 1px 20px rgba(139, 78, 53, 0.06);
  /* Fallback background jika backdrop-filter tidak support */
}
@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: rgba(253, 250, 247, 0.98); }
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  gap: 1rem;
}
.logo {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--rose-dark);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.logo span { color: var(--gold); font-style: italic; }

/* Header progress bar */
.header-progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 0;
  overflow: hidden;
}
.header-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--rose-dark), var(--gold));
  border-radius: 0 2px 2px 0;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-stats { display: flex; gap: 1.25rem; align-items: center; }
.hstat { text-align: center; }
.hstat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: transform 0.2s ease;
}
.hstat-val.bump { transform: scale(1.25); }
.hstat-lbl {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.hstat-sep { width: 1px; height: 30px; background: var(--border); }

/* ── Quote Card ── */
.quote-wrapper {
  max-width: 1100px;
  margin: 1.5rem auto 0;
  padding: 0 1.25rem;
  animation: fadeSlideDown 0.7s ease both;
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.quote-card {
  background: linear-gradient(135deg, var(--rose-light) 0%, var(--gold-light) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem 2rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(184, 150, 62, 0.10), 0 1px 4px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}
/* Shimmer sweep */
.quote-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg);
  animation: shimmer 7s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { left: -120%; }
  20%  { left: 220%;  }
  100% { left: 220%;  }
}
.quote-ornament {
  font-size: 28px;
  color: var(--gold-mid);
  margin-bottom: 6px;
  display: block;
  animation: floatOrn 3s ease-in-out infinite;
}
@keyframes floatOrn {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}
.quote-arabic {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--rose-dark);
  margin-bottom: 10px;
  line-height: 1.7;
  font-weight: 600;
}
.quote-translation {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
}
.quote-source {
  font-size: 11px;
  color: var(--rose-dark);
  margin-top: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.8;
}

/* ── Sync Status ── */
#sync-status {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  right: max(20px, var(--safe-right));
  background: rgba(42, 32, 23, 0.85);
  color: white;
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 12px;
  z-index: 1000;
  display: none;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: syncPop 0.25s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
@keyframes syncPop {
  from { transform: scale(0.9) translateY(8px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* ── Finance Dashboard ── */
.finance-dash {
  max-width: 1100px;
  margin: 1.5rem auto 1rem;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.fin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem;
  box-shadow: 0 2px 12px rgba(42, 32, 23, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: box-shadow 0.3s, transform 0.2s;
}
.fin-card:hover { box-shadow: 0 4px 20px rgba(42,32,23,0.08); }
.fin-lbl {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  font-weight: 700;
}
.fin-val {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}
/* Input dana tabungan — font-size 16px mencegah auto-zoom iOS */
.fin-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--sage);
  padding: 0;
  border-bottom: 1.5px dashed var(--sage);
  cursor: text;
  border-radius: 0;
  -webkit-appearance: none;
  box-shadow: none;
  min-width: 80px;
}
.fin-card.highlight { background: var(--gold-light); border-color: var(--gold-mid); }
.fin-card.highlight .fin-val { color: var(--rose-dark); }
.fin-card.success { background: var(--sage-light); border-color: var(--sage); }
.fin-card.success .fin-val { color: var(--sage); }

/* ── Phase Navigation ── */
.phase-nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem 0.75rem;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.phase-nav::-webkit-scrollbar { display: none; }
.ph-btn {
  flex-shrink: 0;
  padding: 11px 20px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  scroll-snap-align: start;
  /* Touch target minimum 44px */
  min-height: 44px;
  -webkit-user-select: none;
  user-select: none;
}
.ph-btn:hover { border-color:var(--rose-mid); color:var(--rose-dark); transform:translateY(-1px); }
.ph-btn.active {
  background: var(--rose-dark);
  border-color: var(--rose-dark);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 78, 53, 0.35);
  transform: translateY(-1px);
}
.ph-btn.complete { background: var(--sage-light); border-color: var(--sage); color: var(--sage); }

/* ── Main Content ── */
.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  /* Safe area bottom untuk iPhone home indicator */
  padding-bottom: calc(5rem + var(--safe-bottom));
}

/* Tip box */
.tip {
  background: var(--gold-light);
  border-left: 4px solid var(--gold);
  border-radius: 4px var(--r) var(--r) 4px;
  padding: 1rem 1.25rem;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px rgba(184, 150, 62, 0.08);
}
.tip em { color: var(--rose-dark); font-style: italic; font-weight: 700; font-family: var(--font-display); font-size: 17px; }

/* Phase header */
.phase-hd { display: flex; align-items: center; gap: 16px; margin-bottom: 1rem; }
.phase-ico-wrap {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
.phase-hd-text h2 { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.phase-hd-text p { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* Phase progress bar */
.phase-progress-wrap { margin-bottom: 1.5rem; }
.phase-progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.phase-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--sage), var(--sage-light));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.phase-progress-label {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  margin-top: 5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ── Task Cards ── */
.task-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 1.5rem; }
.task-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
  animation: cardSlideUp 0.35s ease both;
}
@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.task-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.07); border-color: var(--rose-mid); }
.task-card.done { opacity: 0.65; background: #fafaf9; }
.task-card.done .tname-input { text-decoration: line-through; color: var(--muted); }

.task-main { display: flex; gap: 14px; align-items: flex-start; width: 100%; }

/* Checkbox — min 44x44 touch target */
.cb {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin-top: 3px;
  background: var(--bg);
  transition: all 0.2s ease;
  position: relative;
}
/* Pseudo-element memperluas touch target */
.cb::after {
  content: '';
  position: absolute;
  inset: -8px;
}
.cb.on { background: var(--sage); border-color: var(--sage); }
.cb.on svg { opacity: 1; transform: scale(1); }
.cb svg {
  width: 14px; height: 14px;
  stroke: white; stroke-width: 3;
  fill: none;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

.task-body { flex: 1; min-width: 0; }

/* Input teks tugas — font-size 16px (iOS no-zoom) */
.tname-input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: 700;
  width: 100%;
  color: var(--ink);
  line-height: 1.4;
  padding: 0;
  box-shadow: none;
  -webkit-appearance: none;
  touch-action: manipulation;
}

.task-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.tag-select {
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 99px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1.5px solid var(--border);
  background-color: var(--bg);
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  min-height: 36px;
}
.tag-select:focus { border-color: var(--rose-mid); }
.tag-venue    { background:#E6F1FB; color:#185FA5; border-color:transparent; }
.tag-catering { background:#EAF3DE; color:#3B6D11; border-color:transparent; }
.tag-decor    { background:#FBEAF0; color:#993556; border-color:transparent; }
.tag-doc      { background:#F1EFE8; color:#5F5E5A; border-color:transparent; }
.tag-fashion  { background:#FAEEDA; color:#854F0B; border-color:transparent; }
.tag-entertain{ background:#E1F5EE; color:#0F6E56; border-color:transparent; }
.tag-foto     { background:#EEEDFE; color:#3C3489; border-color:transparent; }
.tag-custom   { background:#F1EFE8; color:#5F5E5A; border-color:transparent; }

.pay-badge { font-size: 11px; padding: 5px 11px; border-radius: 6px; font-weight: 700; letter-spacing: 0.04em; }
.badge-lunas { background: var(--sage); color: white; }
.badge-dp    { background: #E8A040; color: white; }
.badge-belum { background: #E74C3C; color: white; }

.budget-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.budget-field {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 8px 12px; font-weight: 600;
  min-height: 40px;
}
.budget-field.calculated { background: var(--sage-light); border-color: var(--sage); color: var(--sage); }
.budget-field input {
  background: transparent; border: none; outline: none;
  font-size: 15px; color: var(--ink); width: 110px;
  text-align: right; font-weight: 700;
  border-radius: 0; box-shadow: none; -webkit-appearance: none;
  touch-action: manipulation;
}
.budget-field.calculated input { color: var(--sage); pointer-events: none; }
.label-biaya { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }

.note-input {
  width: 100%;
  background: transparent; border: none; outline: none;
  font-size: 14px; color: var(--muted);
  margin-top: 12px; line-height: 1.6;
  padding: 0; border-radius: 0; box-shadow: none; -webkit-appearance: none;
  touch-action: manipulation;
}

.task-actions {
  margin-top: 12px;
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}
.btn-text {
  background: none; border: none;
  font-size: 13px; font-weight: 700;
  cursor: pointer; transition: color 0.2s;
  padding: 8px 4px; /* 44px touch dari parent */
  min-height: 36px;
}
.btn-toggle { color: var(--rose-dark); }
.btn-toggle:hover { color: var(--rose); }
.btn-del { color: #C4B9AD; }
.btn-del:hover { color: #C0392B; }

/* Task extended section */
.task-ext {
  display: none;
  margin-top: 16px;
  background: #FDFBF9;
  border-radius: var(--r);
  padding: 16px;
  border: 1px solid var(--border);
}
.task-ext.show { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ext-label {
  font-size: 12px; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  margin-bottom: 10px; display: flex;
  justify-content: space-between;
  letter-spacing: 0.05em;
}

/* ── Sub-item Inputs — iOS-safe border ── */
.sub-item input[type="text"],
.main-link-wrap input[type="text"] {
  width: 100%;
  font-size: 16px; /* KRITIS: mencegah auto-zoom iOS */
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background-color: #FFFFFF;
  color: var(--ink);
  font-weight: 500;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  touch-action: manipulation;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.sub-item input[type="text"]:focus,
.main-link-wrap input[type="text"]:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(194, 120, 90, 0.15);
}

/* Link & BUKA buttons */
.link-btn, .sub-link-wrap a {
  background: var(--sage);
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 0 18px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
  border: none; cursor: pointer;
  min-height: 44px;
  min-width: 70px;
}
.link-btn:hover, .sub-link-wrap a:hover { background: #5a7860; }
.link-btn:active, .sub-link-wrap a:active { transform: scale(0.96); }
.link-btn.disabled { background: var(--border); color: var(--muted); pointer-events: none; }

.main-link-wrap {
  display: flex; gap: 10px;
  margin-bottom: 16px; padding-bottom: 16px;
  border-bottom: 1px dashed var(--border);
  align-items: stretch;
}

.sub-list { display: flex; flex-direction: column; gap: 12px; }
.sub-item {
  display: flex; gap: 10px; align-items: flex-start;
  background: #FFFFFF; padding: 14px;
  border-radius: 12px; border: 1.5px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  transition: border-color 0.2s;
}
.sub-item:hover { border-color: var(--rose-mid); }
.sub-col { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.sub-row { display: flex; gap: 10px; align-items: stretch; width: 100%; }
.sub-price-group { display: flex; gap: 10px; flex-shrink: 0; }
.sub-price-group input[type="text"] { width: 130px; }
.sub-link-wrap { display: flex; gap: 10px; flex: 1; min-width: 0; align-items: stretch; }
.sub-link-wrap a { display: none; }
.sub-link-wrap.has-link a { display: flex; }

.sub-btn-del {
  color: #C4B9AD; background: none; border: none; font-size: 16px;
  cursor: pointer; padding: 8px; border-radius: 6px;
  transition: all 0.2s; display: flex; align-items: center; justify-content: center;
  min-width: 36px; min-height: 44px;
}
.sub-btn-del:hover { background: #FDEDEC; color: #C0392B; }

.add-sub-btn {
  width: 100%; padding: 13px;
  margin-top: 12px;
  border: 1.5px dashed var(--rose-mid);
  border-radius: 8px;
  background: var(--rose-light); color: var(--rose-dark);
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  min-height: 48px;
}
.add-sub-btn:hover { background: #F1E0D6; }

.add-task-btn {
  width: 100%; padding: 17px;
  border: 2px dashed var(--border); border-radius: var(--r);
  background: transparent; color: var(--muted);
  font-size: 15px; font-weight: 700;
  cursor: pointer; margin-bottom: 1.5rem;
  transition: all 0.25s;
  min-height: 56px;
}
.add-task-btn:hover { border-color: var(--rose-mid); color: var(--rose-dark); background: var(--rose-light); }

/* Navigation previous/next */
.nav-row { display: flex; justify-content: space-between; gap: 10px; }
.nav-btn {
  padding: 14px 28px; border-radius: var(--r);
  border: 1.5px solid var(--border); background: var(--card);
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: all 0.2s; box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  min-height: 52px;
}
.nav-btn.primary { background: var(--rose-dark); border-color: var(--rose-dark); color: white; }
.nav-btn.primary:hover { background: var(--rose); transform: translateY(-2px); box-shadow: 0 6px 14px rgba(139, 78, 53, 0.28); }
.done-msg { font-family: var(--font-display); font-size: 22px; color: var(--sage); font-style: italic; align-self: center; font-weight: 700; }

/* ── Celebration Badge (semua task selesai) ── */
.phase-done-banner {
  background: linear-gradient(135deg, var(--sage-light), var(--gold-light));
  border: 1.5px solid var(--sage);
  border-radius: var(--r);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.5s ease;
}
.phase-done-banner h3 { font-family: var(--font-display); font-size: 24px; color: var(--sage); font-weight: 700; margin-bottom: 4px; }
.phase-done-banner p  { font-size: 13px; color: var(--muted); }

/* ── Confetti ── */
.confetti-container { position: fixed; inset: 0; pointer-events: none; z-index: 9000; overflow: hidden; }
.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px; height: 10px;
  border-radius: 2px;
  opacity: 0;
  animation: confettiDrop linear forwards;
  will-change: transform, opacity;
}
@keyframes confettiDrop {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg) scale(0.5); opacity: 0; }
}

/* ── Custom Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(42, 32, 23, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 8000;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal-box {
  background: var(--card);
  border-radius: 20px;
  padding: 2rem;
  max-width: 340px; width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: scale(0.9);
  transition: transform 0.25s ease;
}
.modal-overlay.show .modal-box { transform: scale(1); }
.modal-icon { font-size: 40px; margin-bottom: 12px; display: block; }
.modal-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.modal-body { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 1.5rem; }
.modal-actions { display: flex; gap: 10px; }
.modal-btn {
  flex: 1; padding: 14px; border-radius: 12px;
  font-size: 15px; font-weight: 700;
  border: none; cursor: pointer; transition: all 0.2s;
  min-height: 50px;
}
.modal-btn-cancel { background: var(--bg); border: 1.5px solid var(--border); color: var(--muted); }
.modal-btn-cancel:hover { background: var(--border); }
.modal-btn-confirm { background: #C0392B; color: white; }
.modal-btn-confirm:hover { background: #a93226; transform: translateY(-1px); }

/* ================================================================
   RESPONSIVE BREAKPOINTS
   ================================================================ */

/* Large tablet/Desktop */
@media (min-width: 1024px) {
  .finance-dash { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .fin-val { font-size: 18px; }
  .phase-nav { padding-top: 1.25rem; }
}

/* Tablet (768px – 1023px) iPad */
@media (min-width: 768px) and (max-width: 1023px) {
  .finance-dash { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .fin-card { padding: 1.25rem; }
}

/* Below tablet */
@media (max-width: 767px) {
  .finance-dash { grid-template-columns: 1fr 1fr; gap: 8px; }
  .fin-card { padding: 1rem; }
  .fin-val { font-size: 15px; }
  .fin-lbl { font-size: 9px; }
}

/* Small phone */
@media (max-width: 374px) {
  .logo { font-size: 21px; }
  .finance-dash { grid-template-columns: 1fr 1fr; gap: 6px; }
  .fin-card { padding: 0.75rem; }
  .fin-val { font-size: 14px; }
  .quote-arabic { font-size: 18px; }
  .fin-input { font-size: 14px; }
}

/* Mobile — task card layout */
@media (max-width: 600px) {
  .task-main { flex-direction: row; } /* Keep row on mobile */
  .sub-row { flex-direction: column; gap: 8px; }
  .sub-price-group { width: 100%; flex-direction: row; }
  .sub-price-group input[type="text"] { width: 50%; }
  .quote-arabic { font-size: 20px; }
  .tip { font-size: 13px; }
  .task-card { padding: 1rem; }
}

/* iOS landscape — handle viewport height */
@media (max-height: 500px) and (orientation: landscape) {
  .quote-wrapper { display: none; }
  .finance-dash { margin-top: 0.75rem; }
}

/* iPad landscape specifics */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
  .finance-dash { gap: 14px; }
}

/* ── Fase Pasca Nikah — warna teal (opsional) ── */
.ph-btn.pasca-active {
  background: #2C7A8C;
  border-color: #2C7A8C;
  color: #fff;
  box-shadow: 0 4px 14px rgba(44, 122, 140, 0.35);
  transform: translateY(-1px);
}
.phase-pasca-tip {
  background: #E8F4F8;
  border-left: 4px solid #2C7A8C;
}
.phase-pasca-tip em { color: #2C7A8C; }

/* Badge opsional di label fase Pasca Nikah */
.pasca-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #E8F4F8;
  color: #2C7A8C;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid #9ED0DB;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-left: 8px;
  vertical-align: middle;
}