/* Wedding planner — panel
   Palet: pandan (utama), nila (pria), jambu (wanita), kunyit (pihak lain). */
:root {
  --bg: #eef0ea;
  --surface: #ffffff;
  --sunken: #f6f7f3;
  --ink: #1d2b24;
  --muted: #5e6b63;
  --faint: #8a948d;
  --line: #d6dcd3;
  --line-strong: #b9c2b6;
  --pandan: #2e5e4a;
  --pandan-dark: #224737;
  --pandan-tint: #e0eadf;
  --groom: #34548a;
  --groom-tint: #e3e9f3;
  --bride: #b04a6a;
  --bride-tint: #f5e4ea;
  --other: #9a7b3e;
  --other-tint: #f1ead9;
  --progress: #b97a12;
  --progress-tint: #f8ecd3;
  --done: #2b7a52;
  --done-tint: #dcefe3;
  --todo-tint: #ebedea;
  --danger: #b3372f;
  --danger-tint: #f8e1de;
  --radius-s: 6px;
  --radius-m: 10px;
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --side: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-optical-sizing: auto;
}
a { color: var(--pandan); text-underline-offset: 2px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--pandan); outline-offset: 2px; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--side) 1fr; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 16px 16px;
  background: var(--pandan-dark);
  color: #e6efe8;
}
.side a { color: inherit; text-decoration: none; }
.brand { padding: 0 8px 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-names { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.brand-count { margin-top: 6px; font-size: 13px; color: #a9c3b4; }
.brand-count strong { color: #fff; font-size: 26px; font-weight: 700; display: block; line-height: 1.1; letter-spacing: -0.02em; }
.nav { margin-top: 14px; display: grid; gap: 2px; }
.nav-group { margin: 14px 8px 4px; font-size: 12px; color: #8fae9c; }
.nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: var(--radius-s);
  font-size: 14.5px; color: #d3e2d8;
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a[aria-current="page"] { background: #f2f5ef; color: var(--pandan-dark); font-weight: 600; }
.nav .badge { background: var(--progress); color: #fff; font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.side-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; }
.side-foot .who { color: #fff; font-weight: 600; }
.side-foot .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.link-btn { background: none; border: 0; padding: 0; color: #a9c3b4; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: #fff; }

.topbar { display: none; }
.main { min-width: 0; padding: 28px clamp(16px, 3.4vw, 44px) 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(24px, 2.6vw, 32px); }
.page-head p { color: var(--muted); margin-top: 4px; max-width: 62ch; }
.stack { display: grid; gap: 20px; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.panel-head h2 { font-size: 17px; }
.panel-body { padding: 16px 18px 18px; }
.panel + .panel { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }

/* ---------- Ledger (ringkasan biaya) ---------- */
.ledger { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); }
.ledger-total { padding: 20px 22px; border-right: 1px solid var(--line); }
.ledger-total .label { color: var(--muted); font-size: 13.5px; }
.ledger-total .amount { font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-top: 4px; }
.ledger-total .sub { margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.ledger-total .sub b { color: var(--ink); font-weight: 600; }
.target-note { margin-top: 10px; font-size: 13px; padding: 6px 9px; border-radius: var(--radius-s); background: var(--sunken); display: inline-block; }
.target-note.over { background: var(--danger-tint); color: var(--danger); }
.ledger-split { padding: 20px 22px; }
.split-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--todo-tint); }
.split-bar span { display: block; height: 100%; width: 0; }
.split-bar .g { background: var(--groom); }
.split-bar .b { background: var(--bride); }
.split-bar .o { background: var(--other); }
.split-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.split-legend div { border-left: 3px solid var(--c); padding-left: 10px; }
.split-legend .who { font-size: 13px; color: var(--muted); }
.split-legend .amt { font-weight: 650; font-size: 17px; }
.split-legend .pct { font-size: 12.5px; color: var(--faint); }
.progress-line { margin-top: 18px; display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--muted); }
.progress-line .track { flex: 1; height: 6px; border-radius: 99px; background: var(--todo-tint); overflow: hidden; }
.progress-line .track span { display: block; height: 100%; width: 0; background: var(--done); }

/* ---------- Filter & toolbar ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a {
  padding: 6px 11px; border-radius: 99px; font-size: 13.5px; text-decoration: none;
  color: var(--muted); border: 1px solid transparent;
}
.tabs a:hover { color: var(--ink); border-color: var(--line); }
.tabs a[aria-current="true"] { background: var(--ink); color: #fff; }
.tabs a .c { opacity: .7; margin-left: 4px; }
.search { display: flex; gap: 6px; }
.search input { width: 200px; }

/* ---------- Item table ---------- */
.items { width: 100%; border-collapse: collapse; }
.items th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--sunken); }
.items td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.items tr:last-child td { border-bottom: 0; }
.items .right { text-align: right; }
.item-title { font-weight: 600; }
.item-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.item-meta .late { color: var(--danger); font-weight: 600; }
.items tr.is-done .item-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.payer { font-size: 13.5px; }
.mini-split { display: flex; height: 4px; width: 90px; border-radius: 99px; overflow: hidden; margin-top: 5px; background: var(--todo-tint); }
.mini-split span { width: 0; }
.mini-split .g { background: var(--groom); }
.mini-split .b { background: var(--bride); }
.mini-split .o { background: var(--other); }
.parts { font-size: 12px; color: var(--muted); margin-top: 3px; }
.amount-cell { font-weight: 650; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.status-select {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 4px 26px 4px 10px; border-radius: 99px; border: 1px solid transparent; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 13px) 52%, calc(100% - 9px) 52%;
  background-size: 4px 4px; background-repeat: no-repeat;
}
.st-todo { background-color: var(--todo-tint); color: #4f5a53; }
.st-progress { background-color: var(--progress-tint); color: #8a5a07; }
.st-done { background-color: var(--done-tint); color: #1f6141; }
.pill { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.pill.pending { background: var(--progress-tint); color: #8a5a07; }
.pill.verified { background: var(--done-tint); color: #1f6141; }
.pill.rejected { background: var(--danger-tint); color: var(--danger); }
.pill.off { background: var(--todo-tint); color: var(--muted); }
.pill.on { background: var(--pandan-tint); color: var(--pandan-dark); }
.who-groom { color: var(--groom); }
.who-bride { color: var(--bride); }

.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- Forms ---------- */
label, .field-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 5px; }
.hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="time"],
input[type="number"], input[type="url"], input[type="search"], select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pandan); outline-offset: 0; border-color: var(--pandan); }
input[type="file"] { font: inherit; font-size: 14px; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.error { color: var(--danger); font-size: 13px; margin-top: 4px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; font-size: 14.5px; cursor: pointer; margin: 0; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--pandan); flex: none; }
.check small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.money { position: relative; }
.money span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.money input { padding-left: 34px; font-variant-numeric: tabular-nums; }

.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented label { margin: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: inline-block; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 99px;
  font-size: 13.5px; font-weight: 500; cursor: pointer; background: #fff;
}
.segmented input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.segmented input:focus-visible + span { outline: 2px solid var(--pandan); outline-offset: 2px; }

.share-box { margin-top: 10px; padding: 12px; border-radius: var(--radius-s); background: var(--sunken); border: 1px solid var(--line); }
.share-box[hidden] { display: none; }
.share-box input[type="range"] { width: 100%; accent-color: var(--groom); }
.share-labels { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  padding: 10px 15px; border-radius: var(--radius-s); border: 1px solid transparent;
  background: var(--pandan); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--pandan-dark); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--sunken); }
.btn.small { padding: 7px 10px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--danger); border-color: #e3b9b4; }
.btn.danger:hover { background: var(--danger-tint); }
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

details.adder { border-bottom: 1px solid var(--line); }
details.adder > summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
details.adder > summary::-webkit-details-marker { display: none; }
details.adder > summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--pandan); }
details.adder[open] > summary::after { content: "–"; }
details.adder .panel-body { padding-top: 0; }

/* ---------- Flash ---------- */
.flash { margin-bottom: 18px; padding: 11px 14px; border-radius: var(--radius-s); background: var(--done-tint); color: #1f5139; font-size: 14px; border: 1px solid #b9dcc7; }
.flash.err { background: var(--danger-tint); color: var(--danger); border-color: #ecc1bb; }

/* ---------- Dashboard ---------- */
.countdown-hero { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 22px; }
.countdown-hero .days { font-size: clamp(40px, 6vw, 64px); font-weight: 750; letter-spacing: -0.04em; line-height: .95; }
.countdown-hero .date { color: var(--muted); margin-top: 6px; }
.status-trio { display: grid; grid-template-columns: repeat(3, auto); gap: 22px; }
.status-trio div { font-size: 13px; color: var(--muted); }
.status-trio b { display: block; font-size: 24px; color: var(--ink); font-weight: 700; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.list li:last-child { border-bottom: 0; }
.quote-list li { display: block; }
.quote-list .by { font-weight: 600; font-size: 14px; }
.quote-list p { color: var(--muted); font-size: 14px; margin-top: 2px; }

.toggle-list { display: grid; gap: 14px; }
.page-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- Events, banks, gifts ---------- */
.event-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--line); align-items: start; }
.event-date { font-weight: 700; line-height: 1.2; }
.event-date small { display: block; font-weight: 500; color: var(--muted); }
.event-row h3 { font-size: 16px; }
.bank-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); }
.bank-row .acct { font-size: 18px; font-weight: 650; letter-spacing: .02em; }
details.inline-edit > summary { cursor: pointer; color: var(--pandan); font-size: 13.5px; font-weight: 600; list-style: none; }
details.inline-edit > summary::-webkit-details-marker { display: none; }
details.inline-edit[open] { grid-column: 1 / -1; }
details.inline-edit .edit-body { margin-top: 12px; padding: 14px; background: var(--sunken); border-radius: var(--radius-s); }

.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; padding: 16px; }
.gift { border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; display: flex; flex-direction: column; background: #fff; }
.gift-img { aspect-ratio: 4 / 3; background: var(--sunken); display: block; }
.gift-img img { width: 100%; height: 100%; object-fit: cover; }
.gift-body { padding: 12px 14px; display: grid; gap: 4px; flex: 1; }
.gift-body .from { font-weight: 650; }
.gift-foot { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

.comment-row { padding: 14px 18px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.comment-row.is-hidden { background: var(--sunken); }
.comment-row.is-hidden .msg { color: var(--faint); }
.msg { white-space: pre-line; margin-top: 4px; overflow-wrap: anywhere; }

.cover-preview { width: 160px; aspect-ratio: 3 / 4; border-radius: 80px 80px var(--radius-s) var(--radius-s); overflow: hidden; background: var(--sunken); border: 1px solid var(--line); }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line); align-items: center; }
.pagination a, .pagination span { padding: 5px 10px; border-radius: var(--radius-s); font-size: 13.5px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.pagination span.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination span.disabled { color: var(--faint); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(320px, 460px); }
.auth-art { background: var(--pandan-dark); color: #e6efe8; padding: 48px; display: flex; flex-direction: column; justify-content: flex-end; position: relative; overflow: hidden; }
.auth-art::before {
  content: ""; position: absolute; inset: 0; opacity: .14;
  background-color: #cfe0d4;
  -webkit-mask: url("../img/kawung.svg") 0 0 / 64px 64px repeat;
  mask: url("../img/kawung.svg") 0 0 / 64px 64px repeat;
}
.auth-art h1 { position: relative; font-size: clamp(32px, 4vw, 52px); max-width: 14ch; letter-spacing: -0.03em; }
.auth-art p { position: relative; margin-top: 12px; max-width: 42ch; color: #b5cbbd; }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 40px clamp(20px, 5vw, 56px); background: var(--surface); }
.auth-form h2 { font-size: 24px; margin-bottom: 22px; }
.auth-form .btn { width: 100%; padding: 12px; margin-top: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 40;
    transform: translateX(-100%); transition: transform .22s ease;
  }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .scrim { position: fixed; inset: 0; background: rgba(15,25,20,.45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 20; padding: 10px 16px;
    background: var(--pandan-dark); color: #fff;
  }
  .topbar .t-names { font-weight: 700; }
  .topbar .t-days { font-size: 12.5px; color: #a9c3b4; }
  .menu-btn { background: rgba(255,255,255,.1); border: 0; color: #fff; font: inherit; font-weight: 600; padding: 8px 12px; border-radius: var(--radius-s); cursor: pointer; }
  .main { padding-top: 20px; }
  .ledger { grid-template-columns: 1fr; }
  .ledger-total { border-right: 0; border-bottom: 1px solid var(--line); }
  .grid-2 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 32px 24px; min-height: 200px; }
}
@media (max-width: 720px) {
  .items thead { display: none; }
  .items, .items tbody, .items tr, .items td { display: block; width: 100%; }
  .items tr {
    display: grid; grid-template-columns: 1fr auto; gap: 6px 12px;
    padding: 14px; border-bottom: 1px solid var(--line);
  }
  .items td { padding: 0; border: 0; }
  .items td.c-title { grid-column: 1 / 2; }
  .items td.c-amount { grid-column: 2 / 3; grid-row: 1; text-align: right; }
  .items td.c-pic, .items td.c-payer { grid-column: 1 / -1; font-size: 13.5px; }
  .items td.c-pic:empty { display: none; }
  .items td.c-pic::before { content: "PIC: "; color: var(--muted); }
  .items td.c-status { grid-column: 1 / 2; }
  .items td.c-actions { grid-column: 2 / 3; }
  .split-legend { grid-template-columns: 1fr 1fr; }
  .search, .search input { width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .event-row { grid-template-columns: 1fr; gap: 6px; }
  .status-trio { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
.c-groom { --c: var(--groom); }
.c-bride { --c: var(--bride); }
.c-other { --c: var(--other); }
.form-sub { font-size: 15px; margin: 18px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.cover-preview { margin-bottom: 14px; }
.panel-head + .panel-body.small { padding-top: 4px; padding-bottom: 12px; }
.bank-row .pill { margin-top: 4px; }
[hidden] { display: none !important; }
.slug-input { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: #fff; overflow: hidden; }
.slug-input span { display: flex; align-items: center; padding: 0 10px; background: var(--sunken); color: var(--muted); font-size: 14px; border-right: 1px solid var(--line); white-space: nowrap; }
.slug-input input { border: 0; border-radius: 0; min-width: 0; }
.slug-input:focus-within { outline: 2px solid var(--pandan); border-color: var(--pandan); }
.slug-input input:focus { outline: none; }
.hint.block, .field > .hint { display: block; margin-top: 4px; }
@media (max-width: 480px) { .slug-input span { font-size: 12.5px; padding: 0 7px; } }
.auth-brand { position: absolute; top: 28px; left: 32px; color: #fff; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; z-index: 1; }
.auth-switch { margin-top: 18px; font-size: 14.5px; color: var(--muted); }
.auth-form .auth-switch .btn { width: auto; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 900px) { .auth-brand { top: 20px; left: 24px; } .auth-art { padding-top: 64px; } }

/* ---------- Rundown ---------- */
.btn .count { margin-left: 6px; background: rgba(255,255,255,.22); border-radius: 99px; padding: 1px 7px; font-size: 12px; }
.rd-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 8px 16px; padding: 14px 18px; border-top: 1px solid var(--line); align-items: start; }
.rd-row.is-live { background: var(--progress-tint); box-shadow: inset 3px 0 0 var(--progress); }
.rd-row.is-off .rd-title { color: var(--muted); }
.rd-time { font-weight: 700; font-size: 16px; line-height: 1.2; }
.rd-time small { display: block; font-weight: 500; font-size: 12.5px; color: var(--muted); }
.rd-title { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rd-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rd-actions .btn[disabled] { opacity: .35; cursor: default; }
.rd-row details.inline-edit { grid-column: 2 / -1; }
.unit-input { display: flex; align-items: stretch; }
.unit-input input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.unit-input span { display: flex; align-items: center; padding: 0 11px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--radius-s) var(--radius-s) 0; background: var(--sunken); color: var(--muted); font-size: 14px; }
.notice-box { padding: 10px 12px; border-radius: var(--radius-s); background: var(--progress-tint); color: #6b4706; font-size: 13.5px; margin-top: 6px; }
@media (max-width: 720px) {
  .rd-row { grid-template-columns: 64px minmax(0, 1fr); }
  .rd-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .rd-row details.inline-edit { grid-column: 1 / -1; }
}

/* ---------- Foto ---------- */
.photo-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); margin-top: 14px; }
.photo-slot { padding: 18px; display: grid; gap: 14px; align-content: start; }
.photo-slot + .photo-slot { border-left: 1px solid var(--line); }
.slot-frame { aspect-ratio: 3 / 4; max-width: 220px; width: 100%; border-radius: 110px 110px 12px 12px; overflow: hidden; background: var(--sunken); border: 1px solid var(--line); display: grid; place-items: center; }
.slot-frame.slot-cover { border-radius: 12px; }
.slot-frame img { width: 100%; height: 100%; object-fit: cover; }
.slot-frame.is-empty span { color: var(--faint); font-size: 13.5px; }
.slot-body { display: grid; gap: 8px; }
.slot-body input[type="file"] { max-width: 100%; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 0 18px 18px; }
.gallery-grid figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; background: #fff; }
.gallery-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.gallery-grid form { padding: 8px; }
.gallery-upload input[type="file"] { margin-top: 4px; }
@media (max-width: 900px) {
  .photo-slots { grid-template-columns: 1fr; }
  .photo-slot + .photo-slot { border-left: 0; border-top: 1px solid var(--line); }
  .photo-slot { grid-template-columns: 120px 1fr; }
}
.captcha-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.captcha-row img { border-radius: var(--radius-s); border: 1px solid var(--line); background: #f7f4ee; }
.captcha-refresh { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--pandan); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.captcha input { max-width: 220px; text-transform: uppercase; letter-spacing: .15em; }

/* ---------- Perbaikan HP: konten tidak boleh melebar ke kanan ---------- */
.stack { grid-template-columns: minmax(0, 1fr); }
.stack > *, .grid-2 > *, .grid-3 > *, .panel, .photo-slot, .slot-body { min-width: 0; }
input[type="file"] { width: 100%; max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gallery-grid { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
@media (max-width: 900px) {
  .photo-slots { grid-template-columns: minmax(0, 1fr); }
  .photo-slot { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 480px) {
  .photo-slot { grid-template-columns: minmax(0, 1fr); }
  .slot-frame { max-width: 150px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 14px 14px; gap: 10px; }
}
.ledger > *, .auth > * { min-width: 0; }
.ledger-total .amount { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .ledger, .auth { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Perbaikan HP: menu samping & tombol Keluar tidak tertutup bar browser ---------- */
.side { height: 100vh; height: 100dvh; }
@media (max-width: 900px) {
  .side {
    height: 100vh; height: 100dvh;
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
  .side-foot { padding-bottom: 8px; }
  .side-foot .row { padding: 6px 0; }
  .side-foot .link-btn { padding: 8px 12px; border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius-s); text-decoration: none; color: #fff; }
}

/* ---------- Catatan item: Lihat detail / Tutup detail ---------- */
.item-notes { margin-top: 6px; }
.item-notes > summary { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none; font-size: 12.5px; font-weight: 600; color: var(--pandan); }
.item-notes > summary::-webkit-details-marker { display: none; }
.item-notes > summary::before { content: "▸"; font-size: 11px; transition: transform .15s; }
.item-notes[open] > summary::before { transform: rotate(90deg); }
.item-notes .when-open { display: none; }
.item-notes[open] .when-open { display: inline; }
.item-notes[open] .when-closed { display: none; }
.notes-body { margin-top: 6px; padding: 9px 11px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-s); max-width: 52ch; }
.notes-body p { font-size: 13.5px; white-space: pre-line; overflow-wrap: anywhere; }
.notes-body small { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .item-notes > summary::before { transition: none; } }
[hidden] { display: none !important; }
