/* Iuran Warga v1.2 — palet ilustrasi warga: hijau hutan, zaitun, krem kertas */
:root{--forest:#304f30;--forest-deep:#263f29;--olive:#5d7046;--paper:#faf7ed;--cream:#eee4c6;--ink:#243726;--line:#dfdccb;--muted:#6c7665}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{min-height:100%}
body{margin:0;min-height:100vh;background:var(--paper);color:var(--ink);font-family:system-ui,-apple-system,"Segoe UI",sans-serif}
.sidebar{width:265px;position:fixed;left:0;top:0;bottom:0;overflow-y:auto;background:linear-gradient(160deg,#3b5a35 0%,#28482d 75%);color:#fff;display:flex;flex-direction:column;z-index:3;box-shadow:3px 0 18px #172c1914}
.sidebar-hero{position:relative;text-align:center}
.community-art{width:100%;height:208px;display:block;object-fit:cover;object-position:center}
.brand{padding:17px 12px 18px;text-align:center;border-bottom:1px solid #d5d8bd77}
.brand b{display:block;font-size:27px;letter-spacing:-.6px}
.brand small{display:block;margin-top:7px;color:#f0e7cf;line-height:1.5;font-size:12px}
.sidebar-nav-slot{padding:17px 12px;flex:1}
.main-nav{display:flex;flex-direction:column;gap:5px;margin:0}
.main-nav button{display:flex;align-items:center;gap:12px;text-align:left;background:transparent;color:#fff;font-size:14px;font-weight:500;padding:13px 15px;border-radius:11px;width:100%;border:0;cursor:pointer}
.main-nav button:hover{background:#ffffff1a}
.main-nav button.active{background:#eee5ca;color:#263f29;box-shadow:0 2px 7px #172c1920;font-weight:700}
.nav-icon{font-size:21px;min-width:22px;text-align:center}
.sidebar-footer{padding:16px;border-top:1px solid #e4e2c255;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px}
.sidebar-footer button{width:auto;background:#e9e0c4;color:#304f30;padding:8px 10px}
main{max-width:none;margin-left:265px;padding:24px clamp(16px,3vw,46px) 70px;min-height:100vh}
.topbar{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:24px}
.eyebrow{font-size:11px;letter-spacing:1.2px;color:var(--olive);font-weight:700}
.topbar-title{font-size:19px;font-weight:700;color:var(--forest)}
.topbar-date{font-size:12px;background:#eee8d7;color:var(--forest);padding:10px 14px;border-radius:24px}
h1{font-size:30px;line-height:1.2;margin:0;color:var(--forest-deep)}
h2{font-size:18px;margin:0 0 20px;color:var(--forest-deep)}
.subtitle{margin:6px 0 0;color:var(--muted);font-size:13px}
.row{display:flex;justify-content:space-between;align-items:center;gap:15px}
.page-title{margin-bottom:22px}
.panel{background:#fffcf5;border:1px solid var(--line);border-radius:17px;padding:23px;margin-bottom:18px;box-shadow:0 5px 16px #403c1b08}
#loginView{max-width:460px;margin:8vh auto;padding:35px}
#loginView h1{margin-bottom:15px}
.grid,.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:17px}
.stats{margin-bottom:20px}
.stat{background:#fffdf7;border:1px solid var(--line);border-radius:15px;padding:20px 21px;box-shadow:0 3px 14px #3e4d2710;font-size:13px;color:#50614a}
.stat strong{display:block;font-size:25px;margin-top:9px;color:#263f29;letter-spacing:-.6px}
.stat:nth-child(2){background:#f1f3e8}
.stat:nth-child(4){background:#f4edda}
form{display:grid;gap:13px}
label{display:grid;gap:6px;font-size:13px;font-weight:500}
input,select{width:100%;padding:12px;border:1px solid #cfcfbf;border-radius:9px;font:inherit;background:#fffefa;color:#243726;min-width:0}
input:focus,select:focus{outline:2px solid #a2ae83;outline-offset:1px}
button{background:var(--forest);color:white;border:0;border-radius:9px;padding:12px 16px;cursor:pointer;font-weight:650;font:inherit}
button:hover{filter:brightness(1.1)}
button:disabled{opacity:.5}
.tag{background:#e6eadf;border-radius:24px;padding:9px 14px;font-size:13px;color:var(--forest);white-space:nowrap}
.tablewrap{overflow:auto}
table{width:100%;border-collapse:collapse;white-space:nowrap}
td,th{text-align:left;border-bottom:1px solid #e3e2d6;padding:13px 11px;font-size:13px}
th{background:#f0f0e4;color:#364b34}
td button{padding:7px 10px;font-size:12px;margin:2px}
#message{position:fixed;right:24px;bottom:20px;z-index:10;background:#e3ecd9;border:1px solid #b8c7a6;padding:12px 18px;border-radius:10px;display:none;box-shadow:0 8px 22px #0002}
.muted{font-size:12px;color:var(--muted)}
@media(max-width:900px){
.sidebar{position:relative;width:100%;height:auto;overflow:visible;display:block}
.sidebar-hero{display:flex;align-items:center;text-align:left;gap:12px;padding:9px 15px}
.community-art{width:60px;height:60px;object-fit:cover;border-radius:10px;flex-shrink:0}
.brand{padding:0;text-align:left;border:0}
.brand b{font-size:21px}
.brand small{font-size:11px;margin-top:1px}
.sidebar-nav-slot{padding:6px 12px 12px}
.main-nav{flex-direction:row;overflow-x:auto;gap:6px;scrollbar-width:thin}
.main-nav button{flex:0 0 auto;width:auto;padding:10px 12px;font-size:12px;white-space:nowrap}
.nav-icon{font-size:16px;min-width:14px}
.sidebar-footer{position:absolute;top:18px;right:12px;border:0;padding:0}
.sidebar-footer span{display:none}
.sidebar-footer button{font-size:11px;padding:8px}
.sidebar-hero{padding-right:85px}
main{margin:0;padding:18px 15px 45px}
.topbar{margin-bottom:17px}
}
@media(max-width:560px){
.topbar-date{display:none}
h1{font-size:25px}
.grid,.stats{grid-template-columns:1fr}
.panel{padding:17px}
#loginView{margin:20px auto;padding:22px}
.stat strong{font-size:23px}
}

/* v1.3 */
.status{display:inline-block;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap}
.status.paid{background:#e0eddb;color:#2e6538}
.status.partial{background:#f8edcf;color:#7b5c19}
.status.unpaid{background:#f5e2d8;color:#8a3f2e}
.filter-label{display:flex;align-items:center;gap:10px;max-width:320px;margin-bottom:14px}
.filter-label select{max-width:190px}
.edit-house-form{margin-top:20px;border-top:1px solid var(--line);padding-top:20px}
.form-actions{display:flex;gap:10px;flex-wrap:wrap}
.form-actions button{width:auto}
button.secondary{background:#e6e2d3;color:#304f30}

/* v1.5 */
.monthly-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:10px;margin:18px 0}
.monthly-summary .stat{padding:15px}
.monthly-summary .stat strong{font-size:19px}
#houseSearch{margin:8px 0 18px}
@media(max-width:560px){.monthly-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.monthly-summary .stat strong{font-size:16px}.panel button{max-width:100%}.tablewrap{overscroll-behavior-x:contain}}

/* Patch v1.5.1 */ — dashboard & login, tanpa perubahan backend */
body.auth-pending .sidebar-nav-slot,body.logged-out .sidebar-nav-slot,
body.auth-pending .sidebar-footer,body.logged-out .sidebar-footer{display:none!important}
body.auth-pending .sidebar,body.logged-out .sidebar{overflow:hidden}
body.auth-pending .sidebar-hero,body.logged-out .sidebar-hero{margin-top:clamp(20px,8vh,110px)}
body.auth-pending #loginView,body.logged-out #loginView{margin:clamp(20px,8vh,110px) auto;max-width:500px}
body.auth-pending main,body.logged-out main{display:flex;flex-direction:column}
body.auth-pending .topbar,body.logged-out .topbar{margin-bottom:0}
body.authenticated #stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
body.authenticated #stats .stat{min-width:0}
body.authenticated #stats .stat:nth-child(5){grid-column:span 2;background:#f7eee0}
body.authenticated #stats .stat strong{font-size:clamp(18px,1.7vw,27px);overflow-wrap:anywhere}
#overviewHelp{margin-top:8px}
.overview-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
.overview-heading h2{margin:0 0 4px}
.overview-heading .muted{margin:0}
.overview-action{width:auto;flex-shrink:0;padding:10px 14px}
@media(max-width:1250px){body.authenticated #stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){body.auth-pending .sidebar-hero,body.logged-out .sidebar-hero{margin-top:0}body.auth-pending .sidebar,body.logged-out .sidebar{min-height:80px}}
@media(max-width:560px){body.authenticated #stats{grid-template-columns:repeat(2,minmax(0,1fr))}body.authenticated #stats .stat:nth-child(5){grid-column:span 2}.overview-heading{align-items:flex-start;flex-direction:column}.overview-action{width:100%}body.logged-out #loginView{margin:24px auto}}

/* Sembunyikan elemen saat logout */
#mainNav[hidden],
#appView[hidden],
#loginView[hidden],
#logout[hidden] {
  display: none !important;
}
