/* ============================================================
   Wedding Plans — stylesheet
   Layout: sidebar kiri (rail ikon di mobile, melebar di desktop)
   Dashboard dirancang muat 1 layar tanpa scroll di semua ukuran.
   ============================================================ */

:root {
    --rose: #5b7eb5;
    --rose-deep: #3b5998;
    --rose-soft: #e4edf7;
    --blush: #f5f7fc;
    --gold: #c9a86a;
    --gold-soft: #f3ead7;
    --ink: #2c3a4a;
    --muted: #7a8b9e;
    --line: #dfe5f0;
    --white: #ffffff;
    --green: #6fae8f;
    --shadow: 0 10px 30px rgba(59, 89, 152, 0.12);
    --shadow-sm: 0 4px 14px rgba(59, 89, 152, 0.10);
    --radius: 20px;
    --radius-sm: 14px;

    /* Lebar sidebar — dipakai juga sebagai offset konten utama */
    --nav-w: 60px;              /* mobile: rail ikon */
    --gap: 10px;
    --pad-x: 12px;

    /* Tinggi aman untuk notch/home-indicator di iOS */
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-l: env(safe-area-inset-left, 0px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background:
        radial-gradient(1200px 500px at 10% -10%, var(--rose-soft), transparent 60%),
        radial-gradient(1000px 500px at 110% 10%, var(--gold-soft), transparent 55%),
        var(--blush);
    color: var(--ink);
    min-height: 100dvh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, canvas, svg { max-width: 100%; }

.serif { font-family: 'Playfair Display', Georgia, serif; }

/* ============================================================
   SIDEBAR  (menggantikan bottom-nav)
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: calc(var(--nav-w) + var(--safe-l));
    padding: calc(10px + var(--safe-t)) 0 calc(10px + var(--safe-b)) var(--safe-l);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 50;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 0;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar .brand .ring { font-size: 1.5rem; line-height: 1; }
.sidebar .brand .brand-text { display: none; font-family: 'Playfair Display', serif; font-weight: 700; color: var(--rose-deep); font-size: 1.02rem; white-space: nowrap; }

.sidebar .nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    margin-top: 6px;
    padding: 0 6px;
    flex: 1;
    min-height: 0;
}
.sidebar .nav-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 9px 0;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 500;
    transition: background .18s ease, color .18s ease;
    min-height: 42px;
}
.sidebar .nav-links a .ic { font-size: 1.2rem; line-height: 1; }
.sidebar .nav-links a .lbl { display: none; white-space: nowrap; }
.sidebar .nav-links a:hover { background: var(--rose-soft); color: var(--rose-deep); }
.sidebar .nav-links a.active { background: var(--rose-soft); color: var(--rose-deep); font-weight: 700; }

.sidebar .nav-foot {
    width: 100%;
    padding: 0 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    border-top: 1px solid var(--line);
    padding-top: 8px;
}
.sidebar .nav-foot .who { display: none; font-size: .72rem; color: var(--muted); text-align: center; line-height: 1.3; }
.sidebar .nav-foot form { width: 100%; }
.logout-btn {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--muted);
    padding: 8px 0;
    font-family: inherit;
    font-size: .75rem;
    cursor: pointer;
    min-height: 38px;
    transition: color .18s ease, border-color .18s ease;
}
.logout-btn .lbl { display: none; }
.logout-btn:hover { color: var(--rose-deep); border-color: var(--rose); }

/* ============================================================
   SHELL / TOPBAR
   ============================================================ */
.app-shell {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 10px var(--pad-x) calc(20px + var(--safe-b));
    padding-left: calc(var(--nav-w) + var(--safe-l) + var(--pad-x));
}

.topbar {
    display: none;              /* di mobile disembunyikan demi ruang vertikal */
    align-items: center;
    justify-content: space-between;
    padding: 10px 2px 6px;
    gap: 12px;
}
.topbar .page-title { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: var(--ink); }
.topbar .who { font-size: .85rem; color: var(--muted); }

/* ============================================================
   ALERT — toast melayang, tidak menggeser layout
   ============================================================ */
.alert {
    position: fixed;
    top: calc(10px + var(--safe-t));
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    width: calc(100% - var(--nav-w) - 24px);
    max-width: 420px;
    background: #eaf6f0;
    color: #2f6b52;
    border: 1px solid #cfe8dc;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: .84rem;
    box-shadow: var(--shadow-sm);
    animation: toastIn .35s ease both;
}
.alert.error { background: #fdecec; color: #b4534f; border-color: #f5d1d0; }
.alert.hiding { animation: toastOut .3s ease both; }

/* ============================================================
   KOMPONEN UMUM
   ============================================================ */
.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: var(--gap); }
.card-title {
    font-size: .7rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: 1fr; }     /* mobile-first: selalu 1 kolom */
.grid-3 { grid-template-columns: 1fr; }

.hero {
    background: linear-gradient(135deg, var(--rose), var(--rose-deep));
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: none;
    padding: 14px 16px;
}
.hero::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(400px 160px at 80% -20%, rgba(255,255,255,.25), transparent 70%);
    pointer-events: none;
}
.hero .couple { font-family: 'Playfair Display', serif; font-size: clamp(1.15rem, 4.5vw, 1.9rem); line-height: 1.15; }
.hero .subtitle { opacity: .9; font-size: clamp(.7rem, 2.6vw, .85rem); }
.countdown { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.count-num { font-size: clamp(1.7rem, 8vw, 2.6rem); font-weight: 700; font-family: 'Playfair Display', serif; line-height: 1; }
.count-label { font-size: clamp(.7rem, 2.6vw, .85rem); opacity: .9; }
.hero .date-line { margin-top: 4px; font-size: clamp(.68rem, 2.5vw, .82rem); opacity: .9; }

.big-amount { font-size: clamp(1.15rem, 5vw, 1.75rem); font-weight: 700; font-family: 'Playfair Display', serif; color: var(--rose-deep); line-height: 1.2; }
.target-amount { color: var(--muted); font-size: clamp(.68rem, 2.6vw, .82rem); }
.progress { height: 8px; background: var(--rose-soft); border-radius: 999px; overflow: hidden; margin: 8px 0 5px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--rose)); border-radius: 999px; position: relative; }
.progress-meta { display: flex; justify-content: space-between; gap: 8px; font-size: clamp(.66rem, 2.5vw, .78rem); color: var(--muted); }

.stat { text-align: center; }
.stat .val { font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.stat .lbl { font-size: .74rem; color: var(--muted); }

.contrib-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.contrib-row:last-child { border-bottom: none; }
.avatar {
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center; font-size: .85rem; flex-shrink: 0;
    background: linear-gradient(135deg, var(--rose), var(--rose-deep));
}
.avatar.pria { background: linear-gradient(135deg, #7fa8d9, #5f7fb7); }
.avatar.wanita { background: linear-gradient(135deg, var(--rose), var(--rose-deep)); }
.contrib-row .name { font-weight: 600; font-size: .84rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contrib-row .amt { margin-left: auto; font-weight: 700; color: var(--rose-deep); font-size: .84rem; white-space: nowrap; }

.pocket {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 7px;
    transition: box-shadow .2s ease, transform .2s ease;
}
.pocket:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.pocket .picon {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    background: var(--blush); display: grid; place-items: center; font-size: 1rem;
}
.pocket .pmeta { flex: 1; min-width: 0; }
.pocket .pname { font-weight: 600; font-size: .84rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pocket .pbal { color: var(--rose-deep); font-weight: 700; font-size: .85rem; white-space: nowrap; }
.pocket .ptarget { font-size: .7rem; color: var(--muted); }

.badge { padding: 1px 7px; border-radius: 999px; font-size: .62rem; font-weight: 600; white-space: nowrap; }
.badge.shared { background: #e7f3ee; color: var(--green); }
.badge.private { background: #f0eaf3; color: #8e6ea8; }
.badge.wedding { background: var(--gold-soft); color: var(--gold); }
.badge.owner { background: var(--rose-soft); color: var(--rose-deep); }

.btn {
    background: linear-gradient(135deg, var(--rose), var(--rose-deep));
    color: #fff; border: none; border-radius: 999px;
    padding: 10px 18px; font-family: inherit; font-weight: 600; font-size: .88rem;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 40px;
    transition: filter .18s ease, box-shadow .18s ease;
}
.btn:hover { filter: brightness(1.05); box-shadow: var(--shadow-sm); }
.btn.ghost { background: var(--white); color: var(--rose-deep); border: 1px solid var(--rose); }
.btn.sm { padding: 7px 13px; font-size: .8rem; min-height: 34px; }
.btn.block { width: 100%; }
.btn.danger { background: #fff; color: #c96; border: 1px solid var(--line); }
.btn.danger:hover { color: #d16b6b; border-color: #eebfbf; }

label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 5px; }
input, select {
    width: 100%; padding: 11px 13px; font-family: inherit; font-size: 16px; /* 16px: cegah zoom otomatis iOS */
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--white); color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--rose-soft); border-color: var(--rose); }
.field { margin-bottom: 12px; }
.row-2 { display: grid; grid-template-columns: 1fr; gap: 10px; }

.chip-toggle { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-toggle label {
    flex: 1; min-width: 110px; text-align: center; margin: 0;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 10px 8px; cursor: pointer; font-size: .84rem; color: var(--ink);
}
.chip-toggle input { display: none; }
.chip-toggle input:checked + span { color: var(--rose-deep); font-weight: 700; }
.chip-toggle label:has(input:checked) { border-color: var(--rose); background: var(--rose-soft); }

.tx { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tx:last-child { border-bottom: none; }
.tx .tx-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: .9rem; }
.tx-ico.in { background: #e7f3ee; color: var(--green); }
.tx-ico.out { background: #fdecec; color: #c96; }
.tx .tx-main { flex: 1; min-width: 0; }
.tx .tx-name { font-weight: 600; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; }
.tx .tx-sub { font-size: .72rem; color: var(--muted); }
.tx .tx-amt { font-weight: 700; font-size: .85rem; white-space: nowrap; }
.tx .tx-amt.in { color: var(--green); }
.tx .tx-amt.out { color: #c96; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 2px 8px; }
.section-head h2 { font-family: 'Playfair Display', serif; font-size: clamp(1rem, 3.6vw, 1.25rem); color: var(--ink); }
.empty { text-align: center; color: var(--muted); padding: 18px; font-size: .84rem; }

/* ---------- Login (tanpa sidebar) ---------- */
.login-wrap { min-height: 100dvh; width: 100%; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; text-align: center; }
.login-card .ring-big { font-size: 3rem; }
.login-card h1 { font-family: 'Playfair Display', serif; color: var(--rose-deep); margin: 8px 0 2px; font-size: clamp(1.4rem, 6vw, 1.8rem); }
.login-card p.sub { color: var(--muted); font-size: .86rem; margin-bottom: 20px; }
.login-card form { text-align: left; }

/* ============================================================
   DASHBOARD — muat 1 layar, tidak scroll
   ============================================================ */
.page-dash { height: 100dvh; overflow: hidden; }
.page-dash .app-shell {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-top: calc(8px + var(--safe-t));
    padding-bottom: calc(8px + var(--safe-b));
    overflow: hidden;
}

.dash {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto 1fr;   /* hero | metrik+chart | kantong (sisa ruang) */
    gap: var(--gap);
    overflow: hidden;
}

.dash-metrics { display: grid; grid-template-columns: 1fr; gap: var(--gap); min-height: 0; }

/* Kartu chart: tinggi ikut ruang tersisa, canvas mengisi penuh */
.chart-card { display: flex; flex-direction: column; min-height: 0; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.chart-tabs { display: flex; gap: 4px; }
.chart-tabs button {
    border: 1px solid var(--line); background: var(--white); color: var(--muted);
    border-radius: 999px; padding: 4px 10px; font-family: inherit; font-size: .68rem;
    cursor: pointer; min-height: 26px;
}
.chart-tabs button.on { background: var(--rose-soft); color: var(--rose-deep); border-color: var(--rose); font-weight: 700; }
.chart-box { position: relative; flex: 1; min-height: 90px; }
.chart-box canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.chart-box[hidden] { display: none; }

/* Daftar kantong: header tetap, list scroll di dalam kartunya sendiri */
.dash-pockets { display: flex; flex-direction: column; min-height: 0; }
.dash-pockets .section-head { margin: 0 2px 6px; flex-shrink: 0; }
.pocket-list {
    flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    padding-right: 2px;
    -webkit-overflow-scrolling: touch;
}
.pocket-list::-webkit-scrollbar { width: 4px; }
.pocket-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }

/* Strip kontribusi ringkas (mobile) */
.contrib-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.contrib-chip {
    display: flex; align-items: center; gap: 7px;
    background: var(--blush); border: 1px solid var(--line);
    border-radius: 999px; padding: 4px 11px 4px 4px; min-width: 0;
}
.contrib-chip .avatar { width: 24px; height: 24px; font-size: .72rem; }
.contrib-chip .cname { font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contrib-chip .camt { font-size: .78rem; font-weight: 700; color: var(--rose-deep); white-space: nowrap; }

/* ============================================================
   BREAKPOINT
   ============================================================ */

/* --- HP kecil (≤360px): rapatkan lagi --- */
@media (max-width: 360px) {
    :root { --nav-w: 52px; --pad-x: 9px; --gap: 8px; }
    .card { padding: 11px; }
    .pocket { padding: 7px 9px; }
    .pocket .picon { width: 30px; height: 30px; font-size: .9rem; }
    .sidebar .nav-links a { min-height: 38px; padding: 7px 0; }
}

/* --- HP landscape / layar pendek: kompres tinggi --- */
@media (max-height: 560px) and (max-width: 1023px) {
    .hero { padding: 9px 12px; }
    .count-num { font-size: 1.4rem; }
    .hero .subtitle, .hero .date-line { display: none; }
    .chart-box { min-height: 70px; }
    .card { padding: 10px; }
}

/* --- Tablet (≥600px): dua kolom mulai masuk --- */
@media (min-width: 600px) {
    :root { --pad-x: 16px; --gap: 12px; }
    .row-2 { grid-template-columns: 1fr 1fr; }
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .dash-metrics { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
    .alert { width: calc(100% - var(--nav-w) - 40px); }
}

/* --- Sidebar melebar + topbar muncul (≥768px) --- */
@media (min-width: 768px) {
    :root { --nav-w: 208px; --pad-x: 22px; }
    .sidebar { align-items: stretch; padding-left: calc(10px + var(--safe-l)); padding-right: 10px; }
    .sidebar .brand { justify-content: flex-start; padding: 8px 8px 4px; }
    .sidebar .brand .brand-text { display: block; }
    .sidebar .nav-links { padding: 0; }
    .sidebar .nav-links a { justify-content: flex-start; padding: 10px 12px; font-size: .86rem; }
    .sidebar .nav-links a .lbl { display: block; }
    .sidebar .nav-foot { padding: 8px 0 0; }
    .sidebar .nav-foot .who { display: block; margin-bottom: 6px; }
    .logout-btn .lbl { display: block; }
    .topbar { display: flex; }
    .card { padding: 16px; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* --- Desktop (≥1024px): dashboard 3 kolom, kedua chart tampil --- */
@media (min-width: 1024px) {
    :root { --gap: 14px; }
    .dash { grid-template-rows: auto minmax(0, 1fr) minmax(0, 1.1fr); }
    .dash-metrics { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
    .chart-tabs { display: none; }          /* tak perlu tab: dua chart tampil bersama */
    .chart-box[hidden] { display: block; }  /* paksa tampil, override atribut hidden */
    .hero { padding: 18px; }
}

/* --- Layar lebar (≥1440px) --- */
@media (min-width: 1440px) {
    :root { --pad-x: 32px; }
    .app-shell { max-width: 1400px; }
}

/* --- Hormati preferensi kurangi animasi --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============================================================
   ANIMASI
   ============================================================ */
@keyframes fadeUp   { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn  { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@keyframes shimmer  { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes bounceIn { 0% { opacity: 0; transform: scale(.4); } 60% { opacity: 1; transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes toastIn  { from { opacity: 0; transform: translate(-50%, -16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOut { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -16px); } }
@keyframes ripple   { to { transform: scale(4); opacity: 0; } }

.card.anim { animation: fadeUp .4s ease both; }
.card.anim:nth-child(2) { animation-delay: .06s; }
.card.anim:nth-child(3) { animation-delay: .12s; }
.card.anim:nth-child(4) { animation-delay: .18s; }
.hero.anim { animation: scaleIn .45s ease both; }
.pocket.anim { animation: fadeUp .35s ease both; }
.pocket.anim:nth-child(2) { animation-delay: .05s; }
.pocket.anim:nth-child(3) { animation-delay: .1s; }
.pocket.anim:nth-child(4) { animation-delay: .15s; }
.tx.anim { animation: fadeUp .3s ease both; }
.tx.anim:nth-child(2) { animation-delay: .04s; }
.tx.anim:nth-child(3) { animation-delay: .08s; }
.tx.anim:nth-child(4) { animation-delay: .12s; }

.ripple {
    position: absolute; border-radius: 50%;
    background: rgba(255,255,255,.45);
    transform: scale(0); animation: ripple .55s ease-out;
    pointer-events: none;
}

.progress > span::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
    background-size: 200% 100%; animation: shimmer 2s ease-in-out infinite;
}

.sidebar .nav-links a.active .ic { animation: bounceIn .45s ease; }

/* ============================================================
   MODAL
   ============================================================ */
dialog {
    margin: 0 !important;
    position: fixed !important;
    top: 50% !important; left: 50% !important;
    transform: translate(-50%, -50%) !important;
    border: none; border-radius: var(--radius); padding: 20px;
    width: min(94vw, 440px);
    max-height: min(88dvh, 720px);
    overflow-y: auto;
    box-shadow: var(--shadow); color: var(--ink); background: var(--white);
    opacity: 0; transition: opacity .22s ease;
    outline: none;
}
dialog[open] { opacity: 1; }
dialog::backdrop { background: rgba(44, 58, 74, .45); backdrop-filter: blur(2px); }
dialog h3 { font-family: 'Playfair Display', serif; margin-bottom: 14px; color: var(--rose-deep); font-size: 1.1rem; }
.dialog-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.dialog-actions > * { flex: 1 1 130px; }

.tx-log-header { text-align: center; margin-bottom: 6px; }
.tx-log-header .picon-big { font-size: 2.2rem; }
.tx-log-header .pname-log { font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.tx-log-header .pbal-log { font-size: 1.35rem; font-weight: 700; color: var(--rose-deep); }
.tx-log-header .ptarget-log { font-size: .76rem; color: var(--muted); }
.tx-log-progress { height: 8px; background: var(--rose-soft); border-radius: 999px; margin: 10px 0; overflow: hidden; }
.tx-log-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--rose)); border-radius: 999px; }
.tx-log-list { max-height: min(46dvh, 320px); overflow-y: auto; margin-top: 12px; border-top: 1px solid var(--line); }
.tx-log-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .85rem; }
.tx-log-item:last-child { border-bottom: none; }
.tx-log-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; font-size: .82rem; }
.tx-log-ico.in { background: #e7f3ee; color: var(--green); }
.tx-log-ico.out { background: #fdecec; color: #c96; }
.tx-log-main { flex: 1; min-width: 0; }
.tx-log-main .tx-log-user { font-size: .72rem; color: var(--muted); }
.tx-log-amt { font-weight: 700; white-space: nowrap; }
.tx-log-amt.in { color: var(--green); }
.tx-log-amt.out { color: #c96; }
.tx-log-empty { text-align: center; color: var(--muted); padding: 18px; font-size: .84rem; }

/* efek tekan */
.btn:active, .btn.ghost:active { transform: scale(.96); transition: transform .1s; }
.logout-btn:active { transform: scale(.94); }
.pocket:active { transform: scale(.99); background: var(--blush); }

/* ---------- Wadah chart: 1 grafik (mobile, via tab) → 2 grafik (desktop) ---------- */
.chart-body { flex: 1; min-height: 0; display: flex; gap: 8px; }
.chart-body > .chart-box { flex: 1; }
@media (min-width: 1024px) {
    .chart-body { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* ---------- Halaman non-dashboard: beri ruang napas di bawah ---------- */
body:not(.page-dash) .app-shell { padding-bottom: calc(28px + var(--safe-b)); }

/* ---------- Tabel/daftar panjang tidak boleh mendorong layout melebar ---------- */
.tx, .pocket, .contrib-row { max-width: 100%; }
.pagination, nav[role="navigation"] { display: flex; flex-wrap: wrap; gap: 6px; font-size: .82rem; }

/* ============================================================
   MODAL DETAIL KANTONG — bagian tambahan
   ============================================================ */
.pocket.clickable { cursor: pointer; }
.pocket.clickable:hover { border-color: var(--rose); }

.pocket-modal { width: min(94vw, 480px); }

.tx-log-badges { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; margin: 6px 0 8px; }

/* Ringkasan masuk / keluar / jumlah transaksi */
.tx-log-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    margin-top: 12px; padding: 10px; border-radius: var(--radius-sm);
    background: var(--blush); border: 1px solid var(--line);
    text-align: center;
}
.tx-log-stats .lbl { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tx-log-stats .val { font-size: .82rem; font-weight: 700; color: var(--ink); margin-top: 1px; word-break: break-word; }
.tx-log-stats .val.in { color: var(--green); }
.tx-log-stats .val.out { color: #c96; }

.tx-log-section-title {
    font-size: .66rem; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted); font-weight: 600; margin: 14px 0 6px;
}

/* Baris "terakhir diisi / dikeluarkan" */
.tx-log-last { display: flex; flex-direction: column; gap: 7px; }
.last-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); background: var(--white);
}
.last-row.muted { opacity: .6; }
.last-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; font-size: .82rem; }
.last-ico.in { background: #e7f3ee; }
.last-ico.out { background: #fdecec; }
.last-main { flex: 1; min-width: 0; }
.last-label { font-size: .8rem; font-weight: 600; color: var(--ink); }
.last-sub { font-size: .7rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.last-amt { font-weight: 700; font-size: .84rem; white-space: nowrap; }
.last-amt.in { color: var(--green); }
.last-amt.out { color: #c96; }

/* Riwayat lengkap dipendekkan karena modal kini berisi lebih banyak bagian */
.pocket-modal .tx-log-list { max-height: min(32dvh, 240px); margin-top: 0; border-top: none; }

@media (max-width: 360px) {
    .tx-log-stats { grid-template-columns: 1fr 1fr; }
    .tx-log-stats > :last-child { grid-column: span 2; }
}

/* ============================================================
   PERSIAPAN PERNIKAHAN
   ============================================================ */

/* ---------- Kartu ringkasan ---------- */
.prep-hero { padding: 16px; }
.prep-hero-main { display: flex; align-items: center; gap: 16px; }

/* Ring progres (SVG, tanpa JS) */
.ring-wrap { position: relative; flex-shrink: 0; width: 96px; height: 96px; display: grid; place-items: center; }
.ring-chart { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-chart circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.ring-bg { stroke: var(--rose-soft); }
.ring-fg { stroke: var(--rose-deep); transition: stroke-dasharray .6s ease; }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.15; }
.ring-label strong { display: block; font-family: 'Playfair Display', serif; font-size: 1.15rem; color: var(--rose-deep); }
.ring-label span { font-size: .58rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.prep-figures { flex: 1; min-width: 0; }
.pf-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 3px 0; }
.pf-lbl { font-size: .76rem; color: var(--muted); }
.pf-val { font-family: 'Playfair Display', serif; font-weight: 700; font-size: clamp(.95rem, 3.4vw, 1.25rem); white-space: nowrap; }
.pf-val.ok { color: var(--rose-deep); }
.pf-bar { height: 8px; background: var(--rose-soft); border-radius: 999px; overflow: hidden; margin: 8px 0 6px; }
.pf-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--rose)); border-radius: 999px; }
.pf-note { font-size: .74rem; color: var(--muted); }
.pf-note strong { color: var(--rose-deep); }

/* Tiga tile angka */
.prep-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.tile {
    background: var(--blush); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 9px 6px; text-align: center;
}
.tile .t-val { font-size: .95rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.tile .t-val.ok { color: var(--green); }
.tile .t-val.warn { color: #c08a4e; }
.tile .t-lbl { font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

/* Chip per kategori */
.prep-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.prep-cat {
    display: inline-flex; flex-direction: column; gap: 1px;
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 5px 11px;
}
.prep-cat .pc-name { font-size: .72rem; font-weight: 600; color: var(--ink); }
.prep-cat .pc-meta { font-size: .64rem; color: var(--muted); }

.prep-hint { font-size: .76rem; color: var(--muted); margin: 0 4px 10px; }

/* ---------- Tabel persiapan ---------- */
.table-card { padding: 0; overflow: hidden; }
.wtable { width: 100%; border-collapse: collapse; font-size: .86rem; }

.wtable th {
    text-align: left; font-size: .62rem; text-transform: uppercase; letter-spacing: .07em;
    color: var(--muted); font-weight: 700; padding: 10px 14px;
    background: var(--blush); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.wtable td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.wtable tbody tr:last-child td { border-bottom: none; }
.wtable tbody tr { transition: background .15s ease; }
.wtable tbody tr:hover { background: #fbfcfe; }
.wtable .ta-r { text-align: right; }

.wtable .c-cat, .wtable .c-st { width: 1%; white-space: nowrap; }
.wtable .c-cost { width: 1%; white-space: nowrap; }
.wtable .c-act { width: 1%; white-space: nowrap; }

.wt-name { font-weight: 600; color: var(--ink); line-height: 1.3; }
.wt-sub { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.wt-cost { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wtable tr.is-done .wt-name { text-decoration: line-through; }
.wtable tr.is-done { opacity: .62; }

.wt-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.icon-btn {
    width: 32px; height: 32px; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--white); border: 1px solid var(--line);
    border-radius: 9px; cursor: pointer; font-size: .8rem; line-height: 1;
    transition: border-color .15s ease, background .15s ease;
}
.icon-btn:hover { border-color: var(--rose); background: var(--rose-soft); }
.icon-btn.danger:hover { border-color: #eebfbf; background: #fdecec; }
.icon-btn:active { transform: scale(.94); }

.wtable tfoot td {
    padding: 12px 14px; background: var(--blush);
    font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); font-weight: 700; border-top: 1px solid var(--line);
}
.wtable tfoot .wt-cost.total {
    font-family: 'Playfair Display', serif; font-size: 1.05rem;
    text-transform: none; letter-spacing: 0; color: var(--rose-deep);
}

/* Pil kategori & status */
.pill {
    display: inline-block; padding: 3px 9px; border-radius: 999px;
    font-size: .66rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.pill.cat-booking { background: #eef2fb; color: #4b68a8; border-color: #dde5f6; }
.pill.cat-beli    { background: #fdf1e7; color: #b5763c; border-color: #f6e2ce; }
.pill.cat-sewa    { background: #eaf5f0; color: #3f8467; border-color: #d6ebe0; }
.pill.cat-lainnya { background: #f2f1f5; color: #756f80; border-color: #e5e3ea; }
.pill.st-rencana  { background: #f2f1f5; color: #756f80; border-color: #e5e3ea; }
.pill.st-dipesan  { background: var(--gold-soft); color: #a5813d; border-color: #ecdcbe; }
.pill.st-lunas    { background: #e7f3ee; color: #3f8467; border-color: #cfe8dc; }

/* ---------- Layar sempit: tabel jadi kartu ---------- */
@media (max-width: 767px) {
    .prep-hero-main { gap: 12px; }
    .ring-wrap { width: 78px; height: 78px; }
    .ring-label strong { font-size: .95rem; }
    .pf-row { flex-direction: column; align-items: flex-start; gap: 0; padding: 2px 0; }

    .wtable, .wtable tbody, .wtable tr, .wtable td { display: block; width: 100%; }
    .wtable thead, .wtable tfoot { display: none; }

    .wtable tr {
        position: relative;
        padding: 12px 14px;
        border-bottom: 1px solid var(--line);
    }
    .wtable tr:last-child { border-bottom: none; }
    .wtable td { border: none; padding: 0; }

    /* Nama item diberi ruang di kanan supaya tidak tertimpa tombol aksi */
    .wtable td[data-label="Item"] { padding-right: 78px; }

    /* Kategori & status berdampingan sebagai pil */
    .wtable td[data-label="Kategori"],
    .wtable td[data-label="Status"] {
        display: inline-block; width: auto; margin: 8px 6px 0 0;
    }

    /* Biaya jadi baris tersendiri dengan label */
    .wtable td[data-label="Perkiraan Biaya"] {
        text-align: left; margin-top: 8px;
        display: flex; align-items: baseline; gap: 7px;
    }
    .wtable td[data-label="Perkiraan Biaya"]::before {
        content: attr(data-label);
        font-size: .6rem; text-transform: uppercase; letter-spacing: .06em;
        color: var(--muted); font-weight: 700;
    }
    .wtable td[data-label="Perkiraan Biaya"].wt-cost { font-size: 1rem; color: var(--rose-deep); }

    /* Tombol aksi ditempel di pojok kanan atas kartu */
    .wtable .c-act { position: absolute; top: 10px; right: 12px; width: auto; }
}

@media (max-width: 380px) {
    .prep-tiles { grid-template-columns: 1fr 1fr; }
    .prep-tiles .tile:last-child { grid-column: span 2; }
}

/* ---------- Layar lebar: ringkasan jadi dua kolom ---------- */
@media (min-width: 900px) {
    .prep-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: center; }
    .prep-hero-main { grid-row: 1; }
    .prep-tiles { margin-top: 0; grid-row: 1; grid-column: 2; }
    .prep-cats { grid-column: 1 / -1; margin-top: 0; }
    .ring-wrap { width: 112px; height: 112px; }
    .ring-label strong { font-size: 1.35rem; }
}
