@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  color: #193752;
  background: #f2f7fb;
  font-size: 16px;
  --navy: #103c68;
  --blue: #236ba5;
  --yellow: #ffcb35;
  --border: #e0e9f0;
  --muted: #647c90;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue); text-decoration: none; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
button, .button, .house-tile { transition: background .18s, border-color .18s, box-shadow .18s, transform .18s; }
:focus-visible { outline: 3px solid #d79e00; outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; left: 20px; top: -60px; background: white; padding: 12px; z-index: 10; }
.skip-link:focus { top: 10px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; padding: 38px 22px 24px; background: white; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-size: .85rem; font-weight: 700; letter-spacing: .07em; }
.brand-logo { display: block; width: 130px; max-width: 100%; height: auto; object-fit: contain; }
.brand small { display: block; font-size: .64rem; letter-spacing: .3em; color: #ae7b00; margin-top: 5px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 48px; border-radius: 12px 12px 4px 4px; background: var(--navy); color: var(--yellow); font: 700 32px Georgia, serif; flex-shrink: 0; border-bottom: 4px solid var(--yellow); }
.nav-label { color: var(--muted); font-size: .69rem; font-weight: 700; letter-spacing: .13em; margin: 54px 14px 16px; }
nav { display: grid; gap: 8px; }
nav a { display: flex; align-items: center; gap: 14px; color: #60758a; font-size: .9rem; font-weight: 600; border-radius: 10px; padding: 14px; }
nav a:hover { background: #f1f7fc; color: var(--navy); }
nav a[aria-current] { background: var(--navy); color: white; box-shadow: 0 5px 12px #103c681a; }
.nav-icon { font-size: 1.4rem; line-height: 1; color: #829bb0; }
nav a[aria-current] .nav-icon { color: var(--yellow); }
.workspace { margin-left: 248px; }
.topbar { min-height: 80px; border-bottom: 1px solid var(--border); padding: 20px 40px; background: #ffffffb8; display: flex; justify-content: space-between; align-items: center; gap: 20px; font-size: .83rem; color: var(--muted); }
.topbar strong { color: var(--navy); font-weight: 500; }
.topbar-separator { margin: 0 14px; color: #afc0ce; }
.topbar time { white-space: nowrap; }
main { max-width: 1600px; padding: 38px 40px 24px; margin: auto; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 30px; }
.eyebrow { font-size: .66rem; letter-spacing: .15em; font-weight: 700; color: #6b8498; margin: 0 0 10px; }
h1 { font-size: clamp(1.8rem, 3vw, 2.35rem); letter-spacing: -.05em; color: var(--navy); margin: 0; font-weight: 700; }
.intro { margin: 10px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }
h2 { font-size: 1.07rem; margin: 0; color: var(--navy); letter-spacing: -.025em; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; min-height: 42px; padding: 11px 18px; font-weight: 600; font-size: .85rem; white-space: nowrap; }
.primary { background: var(--yellow); color: #173f65; box-shadow: 0 3px 0 #e5ad171a; }
.primary:hover { background: #f4bc20; transform: translateY(-1px); }
.secondary { background: white; color: var(--navy); border-color: #d4e1eb; }
.secondary:hover { background: #edf5fb; border-color: #91b1cb; }
label { display: grid; gap: 9px; min-width: 0; font-size: .85rem; font-weight: 600; }
input, select { width: 100%; min-width: 0; height: 46px; border: 1px solid #cedde8; border-radius: 8px; background: white; color: #21435f; padding: 0 13px; }
input::placeholder { color: #7e93a4; font-weight: 400; }
input:hover, select:hover { border-color: #91b1cb; }
select { padding-right: 34px; appearance: none; background-image: linear-gradient(45deg,transparent 50%,#54718b 50%),linear-gradient(135deg,#54718b 50%,transparent 50%); background-position: calc(100% - 18px) 52%,calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.period-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 22px; border: 1px solid var(--border); border-radius: 13px; background: white; margin-bottom: 24px; }
.period-caption { display: flex; align-items: center; gap: 12px; }
.calendar-mark { width: 42px; height: 42px; display: grid; place-items: center; background: #eaf4fc; color: #3378ae; border-radius: 10px; font-size: 1.6rem; }
.period-caption strong { display: block; font-size: .85rem; }
.period-caption small { display: block; margin-top: 4px; color: var(--muted); font-size: .78rem; }
.period-fields { display: flex; gap: 10px; }
.period-fields select { width: 150px; }
.period-fields input { width: 100px; }
.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; margin-bottom: 24px; }
.stat { border-radius: 14px; border: 1px solid var(--border); background: white; padding: 24px 22px; position: relative; overflow: hidden; }
.stat > span { color: #5b7489; font-size: .875rem; }
.stat > strong { display: flex; align-items: baseline; gap: 9px; font-size: clamp(1.8rem,2.8vw,2.4rem); letter-spacing: -.06em; line-height: 1.3; margin: 15px 0 8px; color: var(--navy); }
.stat strong small { font-weight: 400; font-size: .75rem; letter-spacing: normal; color: #71879a; }
.stat p { margin: 0; font-size: .73rem; line-height: 1.5; color: var(--muted); }
.stat-paid { background: #e8f7ee; border-color: #bce3cc; }
.stat-paid > strong { color: #176b40; }
.stat-paid::after { content: ''; height: 4px; width: 42px; background: #268652; position: absolute; bottom: 0; left: 22px; border-radius: 4px 4px 0 0; }
.stat-accent { background: var(--navy); border-color: var(--navy); }
.stat-accent > span, .stat-accent p { color: #bed6ea; }
.stat-accent > strong { color: var(--yellow); }
.progress-panel { background: white; border: 1px solid var(--border); padding: 22px 24px; border-radius: 13px; margin-bottom: 26px; }
.progress-panel > div { display: flex; justify-content: space-between; gap: 20px; align-items: center; font-size: .85rem; margin-bottom: 14px; }
.progress-panel span { color: var(--muted); font-size: .77rem; }
progress { display: block; width: 100%; height: 9px; border: 0; border-radius: 10px; overflow: hidden; background: #ecf2f7; accent-color: #4087bd; }
progress::-webkit-progress-bar { background: #ecf2f7; }
progress::-webkit-progress-value { background: #4087bd; border-radius: 10px; }
progress::-moz-progress-bar { background: #4087bd; border-radius: 10px; }
.progress-panel p { margin: 13px 0 0; font-size: .78rem; color: var(--muted); }
.panel { border: 1px solid var(--border); border-radius: 14px; background: white; overflow: hidden; box-shadow: 0 3px 12px #103c6803; }
.panel-heading { padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-heading p { color: var(--muted); font-size: .875rem; line-height: 1.5; margin: 6px 0 0; }
.record-toolbar { display: flex; align-items: center; gap: 12px; padding: 0 24px 22px; }
.search-field { flex: 1; max-width: 410px; }
.record-toolbar select { width: 200px; }
.result-count { margin-left: auto; font-size: .77rem; color: var(--muted); white-space: nowrap; }
.table-scroll { overflow: auto; max-height: 620px; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .875rem; white-space: nowrap; }
th { font-size: .7rem; color: #6d8396; letter-spacing: .02em; font-weight: 600; background: #f7fafd; padding: 15px 24px; border-block: 1px solid var(--border); position: sticky; top: 0; }
td { padding: 17px 24px; border-bottom: 1px solid #edf2f6; }
tbody tr:hover { background: #f6fbff; }
.table-house { font-weight: 700; color: var(--navy); }
.muted { color: #8496a6; }
.status { font-size: .875rem; font-weight: 600; padding: 6px 10px; border-radius: 6px; display: inline-block; }
.status-lunas { background: #e3f5e9; color: #176b40; }
.status-belum { background: #f0f3f6; color: #728394; }
.panel-footer { display: flex; justify-content: space-between; gap: 15px; padding: 17px 24px; font-size: .7rem; color: #778d9e; background: #fcfdfe; border-top: 1px solid var(--border); }
.page-footer { margin-top: 28px; display: flex; justify-content: space-between; gap: 20px; font-size: .73rem; color: #7f94a5; }
.service-rule { display: flex; gap: 16px; padding: 20px 24px; border-radius: 13px; border: 1px solid #efdd9c; background: #fff9e8; margin-bottom: 26px; }
.rule-icon { color: #a77800; font-size: 1.7rem; }
.service-rule strong { font-size: .86rem; color: #6c5311; }
.service-rule p { margin: 7px 0 0; font-size: .8rem; line-height: 1.6; color: #8a7541; }
.map-legend { padding: 0 24px 20px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; font-size: .74rem; color: var(--muted); }
.map-legend > span { display: flex; align-items: center; gap: 7px; }
.map-legend small { margin-left: auto; font-size: .7rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; border: 1px solid #cfdae3; }
.legend-dot.paid { background: #268652; border-color: #268652; }
.legend-dot.unpaid { background: #f1f4f7; }
.house-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(115px,1fr)); gap: 10px; padding: 0 24px 24px; }
.house-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border: 1px solid #e0e7ed; border-radius: 10px; background: #f7f9fb; color: #607b91; }
.house-symbol { font-size: 1.7rem; line-height: 1; color: #94aabd; }
.house-tile strong { font-size: .875rem; }
.house-tile > span:last-child { font-size: .875rem; }
.house-tile.eligible { background: #e8f7ee; border-color: #82c69f; color: #176b40; }
.eligible .house-symbol { color: #268652; }
.house-tile:hover { transform: translateY(-3px); border-color: #659ec9; box-shadow: 0 6px 12px #103c6810; }
.house-tile.eligible:hover { border-color: #268652; box-shadow: 0 6px 12px #176b4018; }
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state p { color: var(--muted); font-size: .85rem; }
dialog { width: min(94%,460px); border: 0; border-radius: 18px; padding: 28px; color: #193752; box-shadow: 0 24px 80px #092a5540; }
dialog::backdrop { background: #0c2c4e80; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; }
.dialog-heading h2 { font-size: 1.5rem; }
.dialog-close { background: #eef4f9; color: var(--navy); width: 34px; height: 34px; border: 0; border-radius: 50%; font-size: 1.5rem; }
.dialog-period { color: var(--muted); font-size: .85rem; margin-top: 6px; }
.detail-list { margin: 24px 0; }
.detail-list > div { display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--border); padding: 13px 0; font-size: .82rem; line-height: 1.6; }
dt { color: var(--muted); flex-shrink: 0; }
dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
dialog .button { width: 100%; white-space: normal; }
.payment-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(280px,1fr); gap: 24px; align-items: start; }
.payment-form { padding: 6px; }
.payment-form form { padding: 0 24px 24px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0 28px; }
.months { border: 0; padding: 0; margin: 0 0 28px; min-width: 0; }
.months legend { font-size: .85rem; font-weight: 600; }
.month-heading { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin: 10px 0 17px; }
.month-heading p { font-size: .75rem; color: var(--muted); line-height: 1.5; margin: 0; }
.text-button { padding: 0; background: none; border: 0; color: #276ca1; font-size: .74rem; font-weight: 600; flex-shrink: 0; }
.month-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.month-options label { display: flex; align-items: center; gap: 8px; border: 1px solid #d7e4ee; border-radius: 8px; padding: 14px 10px; cursor: pointer; font-size: .875rem; }
.month-options label:hover { border-color: #649fc9; }
.month-options label:has(input:checked) { background: #e9f4fc; border-color: #4285b7; color: #1c6296; }
.month-options input { appearance: auto; width: 15px; height: 15px; flex-shrink: 0; padding: 0; margin: 0; accent-color: #246da4; }
.payment-submit { width: 100%; min-height: 49px; }
#pesan { font-size: .85rem; line-height: 1.7; margin: 18px 0 0; color: #76580c; }
#pesan:empty { display: none; }
.payment-side { display: grid; gap: 20px; }
.payment-summary { border-radius: 16px; background: var(--navy); padding: 30px; color: white; }
.payment-summary h2 { color: white; margin-top: 15px; }
.payment-summary .eyebrow { color: #a9c9e2; }
.amount { font-size: clamp(2.3rem,4vw,3.3rem); font-weight: 600; letter-spacing: -.06em; margin: 16px 0 6px; line-height: 1.2; color: var(--yellow); }
.unit { margin: 0; font-size: .78rem; color: #bdd5e7; }
.payment-summary .detail-list > div { border-color: #366084; }
.payment-summary dt { color: #b8d1e5; }
.payment-summary .detail-list { margin-bottom: 20px; }
.gateway { font-size: .78rem; color: #bdd5e7; margin: 0; }
.gateway strong { color: white; }
.payment-note { background: #e4f1fc; border: 1px solid #d2e6f6; border-radius: 14px; padding: 24px; }
.payment-note .rule-icon { color: #377ba9; }
.payment-note h3 { font-size: .9rem; margin: 10px 0; }
.payment-note p { font-size: .8rem; color: #617e96; line-height: 1.7; margin: 10px 0; }
.payment-note a { display: inline-block; margin-top: 6px; font-size: .78rem; font-weight: 700; }
.notice { padding: 16px 20px; border-radius: 10px; background: #e6f2fc; margin-bottom: 20px; font-size: .85rem; line-height: 1.6; }
.notice.error { background: #fff0e8; color: #924c2b; }
.sync-toolbar { display: flex; align-items: center; gap: 14px; margin: -8px 0 24px; flex-wrap: wrap; }
.sync-toolbar p, #sinkron-pesan { color: var(--muted); font-size: .75rem; margin: 0; }
.sync-toolbar .button { min-height: 34px; padding: 7px 12px; font-size: .73rem; }
.payment-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px max(24px, calc((100% - 1120px) / 2)); background: white; border-bottom: 1px solid var(--border); }
.payment-page main { max-width: 1200px; padding-top: 44px; }
.payment-page .payment-layout { grid-template-columns: minmax(0,1.5fr) minmax(280px,1fr); }
.payment-page .payment-side { grid-template-columns: 1fr; }
.payment-page .result-main { max-width: 760px; }
.transaction-result { padding: clamp(24px,5vw,48px); text-align: center; }
.result-icon { width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 24px; background: #fff3ce; color: #8b6700; font-size: 2rem; font-weight: 700; }
.result-icon.result-paid { background: #e3f5e9; color: #176b40; }
.transaction-result h1 { font-size: clamp(1.6rem,4vw,2rem); }
.result-description { color: var(--muted); font-size: .9rem; line-height: 1.8; }
.result-details { text-align: left; margin-block: 30px; }
.result-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.logout-form { margin-top: auto; display: grid; gap: 12px; padding-top: 24px; }
.logout-form > span { font-size: .875rem; color: var(--muted); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-main { width: 100%; max-width: 520px; margin: 0; padding: 0; }
.login-main > .brand { justify-content: center; margin-bottom: 28px; }
.login-panel { padding: clamp(24px,5vw,40px); }
.login-panel h1 { font-size: 2rem; }
.login-panel .intro { margin-bottom: 28px; }
.login-panel form { display: grid; gap: 22px; }
.login-panel label { font-size: .875rem; }
.login-panel button { min-height: 48px; }
.login-public-link { display: block; text-align: center; margin-top: 22px; font-size: .875rem; }
.balance-overview { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-radius: 16px; padding: 28px; background: var(--navy); color: white; margin-bottom: 24px; }
.balance-overview .eyebrow { color: #bdd5e7; }
.balance-total { display: block; color: var(--yellow); font-size: clamp(2rem,4vw,3.2rem); letter-spacing: -.05em; overflow-wrap: anywhere; }
.balance-overview p:last-child { color: #bdd5e7; font-size: .875rem; line-height: 1.7; margin-bottom: 0; }
.balance-overview > div { min-width: 0; }
.balance-total.negative { color: #ffb8ae; }
.ledger-stats .stat > strong { display: block; font-size: clamp(1.3rem,1.8vw,1.9rem); overflow-wrap: anywhere; }
.stat-expense { background: #fff4f1; border-color: #f0dcd5; }
.stat-expense > strong, .money-out, .negative { color: #a13e36; }
.money-in { color: #176b40; }
.ledger-form-panel { margin-bottom: 26px; }
.ledger-form-panel form { padding: 0 24px 24px; }
.transaction-type { padding: 0; border: 0; margin: 0 0 22px; }
.transaction-type legend { font-size: .875rem; font-weight: 600; margin-bottom: 12px; }
.transaction-type > div { display: flex; gap: 12px; flex-wrap: wrap; }
.transaction-type label { display: flex; align-items: center; gap: 9px; border: 1px solid #d4e1eb; padding: 12px 18px; border-radius: 9px; cursor: pointer; }
.transaction-type input { width: 16px; height: 16px; margin: 0; accent-color: #176b40; }
.transaction-type label:has(input[value=masuk]:checked) { background: #e8f7ee; border-color: #82c69f; color: #176b40; }
.transaction-type label:has(input[value=keluar]:checked) { background: #fff0e8; border-color: #d69f92; color: #a13e36; }
.transaction-type input[value=keluar] { accent-color: #a13e36; }
.ledger-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ledger-purpose { grid-column: 1 / -1; }
textarea { width: 100%; border: 1px solid #cedde8; border-radius: 8px; background: white; color: #21435f; padding: 12px; font: inherit; line-height: 1.6; resize: vertical; }
textarea::placeholder { color: #7e93a4; font-weight: 400; }
.ledger-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; }
.ledger-form-footer p { font-size: .8rem; color: var(--muted); line-height: 1.6; }
#saldo-pesan { margin: 14px 0 0; font-size: .875rem; line-height: 1.6; color: #92542b; }
#saldo-pesan:empty { display: none; }
.ledger-toolbar { flex-wrap: wrap; }
.ledger-toolbar select { width: auto; min-width: 160px; }
.ledger-table { white-space: normal; min-width: 920px; }
.ledger-table th, .ledger-table td { padding: 16px; }
.ledger-table td { vertical-align: top; }
.ledger-table small { display: block; color: var(--muted); margin-top: 7px; font-size: .73rem; line-height: 1.6; overflow-wrap: anywhere; }
.ledger-table .ledger-description { min-width: 260px; max-width: 380px; line-height: 1.65; overflow-wrap: anywhere; }
.ledger-table .money-in, .ledger-table .money-out, .ledger-running { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ledger-running { font-weight: 700; }
.panel-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.map-main { max-width: 1800px; }
.map-page .payment-header { padding-inline: max(24px,calc((100% - 1720px)/2)); }
.map-paid-count { font-size: .875rem; color: var(--muted); }
.site-legend-check { color: #d92d20; font-weight: 700; font-size: 1.2rem; margin-right: 5px; }
.site-map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 24px; flex-wrap: wrap; }
#cari-rumah-peta { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 520px; }
#cari-rumah-peta label { flex: 1; }
.map-zoom-controls { display: flex; align-items: center; gap: 8px; }
.map-zoom-controls .button { min-width: 40px; padding: 9px 12px; }
#peta-zoom { font-size: .875rem; font-variant-numeric: tabular-nums; min-width: 48px; text-align: center; }
.map-search-feedback { font-size: .875rem; color: var(--muted); line-height: 1.6; padding: 0 24px; margin: 16px 0; }
.site-map-viewport { overflow: auto; max-height: 72vh; border-block: 1px solid var(--border); background: #e5e9e4; cursor: grab; overscroll-behavior: contain; user-select: none; }
.site-map-viewport.is-dragging { cursor: grabbing; }
.site-map-stage { position: relative; width: 1672px; }
.site-map-stage > img { display: block; width: 100%; height: auto; }
.site-marker { position: absolute; transform: translate(-50%,-50%); width: calc(32px * var(--map-scale,1)); height: calc(32px * var(--map-scale,1)); display: grid; place-items: center; padding: 0; border: 1px solid #fda29b; border-radius: 50%; color: #d92d20; background: #fff; font-size: calc(28px * var(--map-scale,1)); font-weight: 700; line-height: 1; box-shadow: 0 2px 5px #431a1955; z-index: 2; cursor: pointer; }
.site-marker:hover, .site-marker:focus-visible { background: #fff1ed; color: #b42318; z-index: 4; }
.site-focus { position: absolute; transform: translate(-50%,-50%); width: calc(48px * var(--map-scale,1)); height: calc(48px * var(--map-scale,1)); border: 3px solid #2167c5; border-radius: 50%; box-shadow: 0 0 0 3px #fff; z-index: 3; pointer-events: none; }
.site-focus > span { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: #103c68; color: white; border-radius: 6px; padding: 5px 8px; white-space: nowrap; font-size: .8rem; box-shadow: 0 2px 6px #102b4433; }
.unmapped-houses { margin-top: 22px; padding: 22px 24px; }
.unmapped-houses summary { cursor: pointer; font-weight: 600; color: var(--navy); font-size: .95rem; }
.unmapped-houses > p { font-size: .875rem; color: var(--muted); line-height: 1.6; }
.unmapped-houses ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 10px; margin: 20px 0 0; padding: 0; }
.unmapped-houses li { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-size: .875rem; }

@media (min-width: 1600px) { main { padding-top: 46px; } }
@media (max-width: 1200px) {
  .sidebar { width: 220px; padding-inline: 16px; }
  .workspace { margin-left: 220px; }
  main, .topbar { padding-left: 24px; padding-right: 24px; }
  .stats { gap: 12px; }
  .stat { padding: 20px 16px; }
  .payment-layout { grid-template-columns: minmax(0,1fr); }
  .payment-side { grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 980px) {
  .logout-form { display: flex; justify-content: flex-end; align-items: center; padding-top: 16px; }
  .payment-page .payment-layout { grid-template-columns: minmax(0,1fr); }
  .sidebar { position: static; width: auto; padding: 18px 24px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar nav { display: flex; gap: 8px; margin-top: 20px; }
  .sidebar nav a { flex: 1; justify-content: center; padding: 12px 8px; font-size: .8rem; gap: 8px; }
  .nav-label { display: none; }
  .brand { font-size: .85rem; }
  .brand-mark { height: 38px; width: 34px; font-size: 25px; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 60px; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .records-panel .panel-heading, .site-map-panel .panel-heading { flex-wrap: wrap; }
  .map-page .payment-header { padding-inline: 16px; }
  .map-page .payment-header .button { font-size: .75rem; padding: 10px; white-space: normal; text-align: center; }
  .site-map-toolbar { padding-inline: 16px; gap: 14px; }
  #cari-rumah-peta { flex-basis: 100%; }
  #cari-rumah-peta input { font-size: .8rem; }
  #cari-rumah-peta .button { padding-inline: 12px; font-size: .8rem; }
  .map-search-feedback { padding-inline: 16px; }
  .site-map-viewport { max-height: 65vh; }
  .unmapped-houses { padding: 20px 16px; }
  .balance-overview { align-items: flex-start; flex-direction: column; padding: 24px; }
  .ledger-form-panel form { padding: 0 16px 20px; }
  .ledger-form-grid { grid-template-columns: 1fr; }
  .ledger-form-footer { align-items: stretch; flex-direction: column; gap: 10px; }
  .ledger-form-footer p { margin: 0; }
  .ledger-toolbar > label { flex: 1; }
  .ledger-toolbar select { width: 100%; min-width: 0; }
  .ledger-records .panel-heading { flex-wrap: wrap; }
  .payment-header { padding: 18px 16px; gap: 12px; }
  .payment-header .button { font-size: .75rem; padding-inline: 10px; }
  .payment-page main { padding-top: 28px; }
  main { padding: 26px 16px 20px; }
  .topbar { padding: 16px; font-size: .71rem; }
  .topbar > span { display: none; }
  .topbar time { margin-left: auto; }
  .sidebar { padding: 16px; }
  .sidebar nav { gap: 5px; }
  .sidebar nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .nav-icon { display: none; }
  .page-heading { align-items: flex-start; margin-bottom: 24px; }
  .page-heading .button { padding-inline: 12px; font-size: .75rem; }
  .intro { font-size: .8rem; }
  .eyebrow { font-size: .58rem; }
  .period-toolbar { align-items: stretch; flex-direction: column; padding: 16px; gap: 16px; }
  .period-fields select, .period-fields input { width: 100%; }
  .period-fields { flex-wrap: wrap; }
  .period-fields > label:first-child { flex: 1; }
  .period-fields > label:first-child { min-width: 120px; }
  .period-fields > label:nth-child(2) { width: 85px; }
  .period-fields .button { padding-inline: 12px; }
  .stat { padding: 18px 14px; }
  .stat > span { font-size: .875rem; }
  .stat strong { font-size: 1.8rem; }
  .stat p { font-size: .67rem; }
  .stat strong small { font-size: .67rem; }
  .progress-panel, .service-rule { padding: 18px; }
  .progress-panel > div { align-items: flex-start; flex-direction: column; gap: 6px; }
  .panel-heading { padding: 20px 16px; align-items: flex-start; }
  .record-toolbar { padding: 0 16px 18px; flex-wrap: wrap; }
  .search-field { max-width: none; flex-basis: 100%; }
  .record-toolbar select { width: 190px; }
  .record-toolbar input { font-size: .8rem; }
  .panel-footer, .page-footer { flex-direction: column; gap: 8px; }
  .panel-footer { padding: 16px; }
  .map-legend { padding-inline: 16px; gap: 12px; }
  .map-legend small { margin-left: 0; width: 100%; }
  .house-grid { padding: 0 16px 20px; gap: 8px; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .house-tile { padding: 13px 4px; }
  .house-tile > span:last-child { font-size: .875rem; }
  .payment-form form { padding: 0 14px 18px; }
  .payment-side { grid-template-columns: 1fr; }
  .payment-summary { padding: 26px; }
  .month-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .month-heading { align-items: flex-start; flex-direction: column; }
  .pair { gap: 12px; }
  .print-button { font-size: .7rem; padding: 8px 10px; }
}
@media print {
  .view-map-button { display: none !important; }
  @page { size: landscape; margin: 10mm; }
  :root, body { background: white; color: #152e44; font-size: 11px; }
  .sidebar, .topbar, .page-footer, .period-toolbar, .record-toolbar, .print-button, dialog, .page-heading > .button, .service-rule, .sync-toolbar, .notice { display: none !important; }
  .workspace { margin: 0; }
  main { max-width: none; padding: 0; }
  .page-heading { margin-bottom: 14px; }
  .stats { grid-template-columns: repeat(4,1fr); gap: 10px; }
  .stat { padding: 10px; background: white; }
  .stat > strong, .stat-accent > strong, .stat-accent p, .stat-accent > span { color: #152e44; }
  .house-grid { grid-template-columns: repeat(10,minmax(0,1fr)); gap: 5px; padding: 10px; }
  .house-symbol { display: none; }
  .house-tile { padding: 8px 3px; break-inside: avoid; }
  .house-tile.eligible { border: 2px solid #268652; }
  .house-tile.ineligible { border: 1px dashed #a6b6c2; }
  .house-tile strong { font-size: 10px; }
  .house-tile > span:last-child { font-size: 8px; }
  .table-scroll { max-height: none; overflow: visible; }
  .panel { box-shadow: none; }
  th { position: static; }
  .panel-footer { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

.transaction-dialog { width: min(640px, calc(100% - 32px)); max-height: 90vh; overflow: auto; }
.transaction-dialog .detail-list dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.transaction-fields { border: 0; margin: 0; padding: 0; display: grid; gap: 16px; }
.transaction-fields + .transaction-fields { margin-top: 16px; }
.transaction-fields small { color: var(--muted); font-size: .75rem; font-weight: 400; line-height: 1.5; }
.transaction-fields textarea { width: 100%; padding: 12px; font: inherit; color: inherit; border: 1px solid #cedde8; border-radius: 8px; resize: vertical; }
.transaction-fields :disabled { background: #f0f3f6; color: var(--muted); }
.transaction-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.transaction-actions .button { width: auto; flex: 1; }
.transaction-row-actions { display: flex; gap: 8px; }
.transaction-row-actions .button { min-height: 34px; padding: 7px 11px; font-size: .78rem; }
.danger { color: #a3202a; background: #fff3f3; border-color: #edb6bb; }
.danger:hover { background: #ffe5e7; }
#transaksi-pesan { font-size: .85rem; line-height: 1.6; white-space: pre-wrap; color: #a3202a; }
@media (max-width: 700px) { .page-heading > .panel-actions { flex-wrap: wrap; } .page-heading:has(.panel-actions) { flex-wrap: wrap; } }
@media print { .transaction-column { display: none; } }
