:root {
  --ink:#142c25;
  --muted:#4c655a;
  --pine:#124b3d;
  --deep:#0e3027;
  --leaf:#17634e;
  --mint:#dff2e6;
  --gold:#eac381;
  --sand:#fbf2df;
  --surface:#f5f7f3;
  --line:#dfe7dd;
  --white:#fff;
  --danger:#a52c29;
  color:var(--ink);
  font:16px/1.5 "Geist","Aptos",system-ui,sans-serif;
  background:var(--surface);
}
*,*::before,*::after { box-sizing:border-box; }
[hidden] { display:none!important; }
body,h1,h2,p { margin:0; }
button,input,select,textarea { font:inherit; color:inherit; }
button,a,summary { -webkit-tap-highlight-color:transparent; }
a { color:inherit; }
:focus-visible { outline:3px solid #3a936c; outline-offset:3px; }
h1,h2 { line-height:1.13; letter-spacing:-.035em; font-weight:750; }
h1 { font-size:clamp(2rem,4vw,3.1rem); }
h2 { font-size:1.24rem; }
svg { width:1.25rem; height:1.25rem; flex:none; }
.button,.icon-button {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  border:1px solid transparent; border-radius:9px; padding:9px 14px;
  min-height:41px; background:transparent; cursor:pointer; text-decoration:none;
  line-height:1.2; font-weight:680; font-size:.93rem; text-align:center;
}
.button.primary { background:var(--pine); color:white; border-color:var(--pine); }
.button.primary:hover { background:var(--leaf); }
.button.quiet { background:white; border-color:#cad8cd; color:var(--pine); }
.button.quiet:hover { background:#e8f5ec; }
.button.small { min-height:0; padding:5px 0; color:#c5edda; text-decoration:underline; font-size:.85rem; }
.button:disabled { opacity:.55; cursor:wait; }
.button.full { width:100%; }
.icon-button { width:42px; height:42px; padding:0; }
.icon-button:hover { background:var(--mint); }
.skip { position:fixed; left:12px; top:10px; transform:translateY(-200%); z-index:20; padding:8px 14px; background:white; }
.skip:focus { transform:none; }
.eyebrow { font-size:.86rem; font-weight:760; letter-spacing:.13em; text-transform:uppercase; color:var(--leaf); }
label { display:grid; gap:6px; font-size:.92rem; font-weight:670; min-width:0; }
input,textarea,select { min-width:0; width:100%; padding:9px 11px; border:1px solid #bfcfc2; border-radius:8px; background:#fff; font-weight:450; }
select { appearance:none; padding-right:29px; background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23124b3d' stroke-width='1.7'/%3E%3C/svg%3E") no-repeat right 10px center/11px; }
input:read-only { background:#f2f6f0; }
input[type=file],input[type=checkbox] { background:white; }
input[type=checkbox] { width:16px; height:16px; accent-color:var(--pine); }
textarea { min-height:85px; resize:vertical; }
.form-error { color:var(--danger); font-size:.92rem; font-weight:650; }
.form-error:empty { display:none; }

.gate { min-height:100svh; display:grid; grid-template-columns:minmax(360px,1.22fr) minmax(365px,.78fr); background:#fff; }
.gate-photo {
  display:flex; flex-direction:column; min-height:620px; justify-content:space-between;
  padding:clamp(25px,5vw,76px); color:#fff9ee;
  background:linear-gradient(145deg,#07271eed 5%,#0a3026a8 43%,#0a302655 70%,#0a3026c5),url('/capa.webp') 65% center/cover var(--deep);
}
.gate-mark { display:flex; align-items:center; gap:13px; font-weight:720; }
.gate-mark img { border:1px solid #8caa90; border-radius:14px; }
.gate-copy { padding-bottom:7vh; }
.gate-copy h1 { font:500 clamp(3.6rem,7.5vw,7.4rem)/.98 Georgia,serif; letter-spacing:-.06em; }
.gate-copy p { margin-top:14px; max-width:28ch; color:#e2eee5; font-size:1.11rem; }
.gate-in { display:grid; place-items:center; padding:37px; min-width:0; }
.gate-form { width:min(100%,380px); }
.gate-form h2 { font-size:clamp(1.8rem,3.5vw,2.5rem); margin:8px 0 10px; }
.gate-form > p:not(.eyebrow) { color:var(--muted); margin-bottom:20px; }
.gate-form form { display:grid; gap:16px; }
.password-field { position:relative; }
.password-field input { padding-right:79px; }
.text-button { position:absolute; inset:0 9px 0 auto; border:0; background:none; color:var(--leaf); cursor:pointer; font-weight:740; font-size:.85rem; }
.switch-account { display:inline-block; margin-top:18px; color:var(--muted); font-size:.88rem; }

.layout { display:grid; grid-template-columns:238px minmax(0,1fr); min-height:100vh; }
.side {
  position:sticky; top:0; align-self:start; height:100dvh; display:flex; flex-direction:column;
  gap:28px; padding:24px 14px 17px; color:#eef8ee; background:var(--deep); overflow:auto;
}
.brand { display:flex; align-items:center; gap:10px; padding:0 8px; color:#fff6e5; text-decoration:none; font-size:1.29rem; font-weight:760; letter-spacing:-.04em; }
.brand small { display:block; font-size:.8rem; font-weight:500; color:#b9d2c4; letter-spacing:.025em; }
.side nav { display:grid; gap:4px; }
.side nav a { display:flex; align-items:center; gap:10px; padding:10px 9px; border:1px solid transparent; border-radius:9px; color:#e2f3e8; text-decoration:none; font-size:.94rem; }
.side nav a:hover,.side nav a[aria-current] { background:#1c5546; }
.side nav a[aria-current] { border-color:#397660; border-left:3px solid var(--gold); padding-left:7px; color:#fff; }
.side-profile { margin-top:auto; padding:13px 8px 0; border-top:1px solid #3d6558; overflow-wrap:anywhere; }
.side-profile .profile-name { font-weight:730; }
.side-profile small { color:#c1d9cb; }
.side-profile .button { background:none; color:#e2f3e8; border:0; padding:6px 10px 6px 0; font-size:.875rem; text-decoration:underline; }
.workspace { min-width:0; }
.top { min-height:65px; padding:10px clamp(15px,3vw,35px); background:#fff; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; gap:10px; }
.top-label,.top-actions { display:flex; align-items:center; gap:7px; }
.top-label { font-weight:690; color:var(--muted); }
.menu { display:none; }
.content { width:min(100%,1460px); margin:auto; padding:26px clamp(15px,3vw,35px) 48px; }
.page-head { display:flex; gap:14px; justify-content:space-between; align-items:flex-end; margin-bottom:24px; }
.page-head p,.panel-head > span { margin-top:5px; color:var(--muted); }
.month { align-self:flex-end; min-width:157px; }
.metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:13px; margin-bottom:18px; }
.metric {
  min-width:0; display:grid; align-content:start; gap:4px; padding:15px 13px;
  background:white; border:1px solid var(--line); border-radius:15px;
  box-shadow:0 7px 25px #16372906;
}
.metric p { font-weight:690; }
.metric strong { font-size:clamp(1.12rem,2.15vw,2rem); line-height:1.22; letter-spacing:-.045em; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.metric small,.subtext { color:var(--muted); font-size:.83rem; }
.metric-icon { display:grid; place-items:center; width:35px; height:35px; margin-bottom:4px; border-radius:8px; background:var(--mint); color:var(--leaf); }
.amber .metric-icon { color:#8a5414; background:var(--sand); }
.overview-grid { display:grid; grid-template-columns:minmax(0,1.58fr) minmax(288px,1fr); align-items:stretch; gap:17px; margin-bottom:18px; }
.panel { min-width:0; background:#fff; padding:17px; border:1px solid var(--line); border-radius:15px; }
.content > .panel+.panel { margin-top:17px; }
.panel-head { display:flex; justify-content:space-between; align-items:center; gap:11px; margin-bottom:15px; }
.panel-head > span { margin:0; font-size:.85rem; }
.giving { padding:19px; border-radius:15px; color:#f5fff6; background:radial-gradient(ellipse at 90% 0,#1c5947,transparent 70%),var(--deep); }
.giving h2 { color:#ffdfaa; }
.giving p,.giving-note { color:#d5e7da; font-size:.9rem; margin:6px 0 8px; }
.giving-note { display:block; margin:9px 0 0; }
.allocation-line { display:flex; justify-content:space-between; align-items:center; gap:9px; padding:9px 0; border-bottom:1px solid #d0eada39; }
.allocation-line small,.allocation-line button { display:block; }
.allocation-line small { color:#c3decc; }
.allocation-line strong { font-size:1.08rem; color:#ffdfaa; }
.allocation-line div:last-child { text-align:right; }
.allocation-line.final { font-weight:720; }
.legend { display:flex; flex-wrap:wrap; gap:9px 13px; color:var(--muted); white-space:nowrap; font-size:.85rem; }
.legend i { display:inline-block; width:15px; height:2px; vertical-align:middle; background:#217b5f; }
.legend .gold { background:#b77b22; }
.legend .dashed { background:repeating-linear-gradient(90deg,#526b62 0 4px,transparent 4px 6px); }
.chart { width:100%; height:auto; min-height:170px; display:block; }
.chart line { stroke:#e6eee6; }
.chart text { fill:#405a4d; font:12px system-ui,sans-serif; }
.chart polyline { fill:none; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
.chart .line-in,.chart .line-pending-in { stroke:#217b5f; }
.chart .line-out,.chart .line-pending-out { stroke:#b77b22; }
.chart .line-pending-out,.chart .line-pending-in { stroke-dasharray:5 6; stroke-width:2; }
.empty { border:1px dashed #c4d4c8; color:var(--muted); padding:25px 12px; border-radius:10px; text-align:center; }
.chart-empty { min-height:200px; display:grid; place-items:center; }
.forecast { padding-top:10px; border-top:1px solid var(--line); color:var(--muted); }
.forecast strong { color:var(--pine); padding-left:7px; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; text-align:left; font-size:.9rem; }
th { background:#f2f6f0; color:#355648; font-weight:710; }
th,td { padding:9px 10px; border-bottom:1px solid #e8eee7; overflow-wrap:anywhere; }
td .subtext { display:block; margin-top:1px; }
td .button { font-size:.82rem; white-space:nowrap; min-height:32px; padding:5px 8px; }
.row-actions { display:flex; gap:5px; flex-wrap:wrap; }
.tag { display:inline-block; font-size:.85rem; padding:3px 7px; border-radius:20px; background:#edf1ee; font-weight:640; white-space:nowrap; }
.tag.positive { background:#e4f4e9; color:#22543e; }
.tag.risk { background:#fbe9e4; color:#8e322a; }
.filters { display:grid; grid-template-columns:1.1fr repeat(3,1fr) auto auto; gap:9px; align-items:end; margin-bottom:14px; }
.bill-filters { grid-template-columns:minmax(165px,235px) minmax(155px,210px) auto; justify-content:start; }
.pager,.tabs { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.pager { justify-content:flex-end; margin-top:14px; color:var(--muted); }
.tabs { margin-bottom:15px; }
.admin-info { margin-bottom:12px; color:var(--muted); }
summary { cursor:pointer; }
pre { max-width:min(450px,70vw); white-space:pre-wrap; word-break:break-word; }
dialog { max-width:min(550px,calc(100% - 24px)); width:100%; max-height:90dvh; border:1px solid var(--line); border-radius:17px; padding:19px; color:var(--ink); box-shadow:0 18px 70px #061f2755; }
dialog::backdrop { background:#0c251db0; }
dialog form { display:grid; gap:12px; }
.modal-head,.modal-actions { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.modal-actions { justify-content:flex-end; margin-top:4px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.span { grid-column:1/-1; }
.check { display:flex; align-items:center; gap:7px; }
.modal-note { color:var(--muted); }
.notice { position:fixed; z-index:30; inset:auto 18px 18px auto; width:max-content; max-width:calc(100% - 36px); display:none; padding:11px 15px; border-radius:9px; background:var(--deep); color:white; box-shadow:0 8px 23px #12382d40; }
.notice.shown { display:block; }
.notice.error { background:#862c28; }

@media(max-width:1150px) {
  .layout { grid-template-columns:195px minmax(0,1fr); }
  .filters { grid-template-columns:1fr 1fr 1fr; }
  .overview-grid { grid-template-columns:minmax(0,1.3fr) minmax(265px,1fr); }
  .panel-head { flex-wrap:wrap; }
}
@media(max-width:850px) {
  .layout { display:block; }
  .side { display:none; position:fixed; height:auto; max-height:calc(100dvh - 63px); inset:63px auto auto 0; z-index:10; width:min(280px,90vw); box-shadow:12px 15px 25px #04271e33; }
  .nav-open .side { display:flex; }
  .top { position:sticky; top:0; z-index:8; min-height:63px; }
  .menu { display:inline-flex; }
  table { min-width:640px; }
}
@media(max-width:620px) {
  .gate { grid-template-columns:1fr; }
  .gate-photo { min-height:238px; padding:18px; }
  .gate-mark img { width:39px; height:39px; }
  .gate-copy { padding:25px 0 5px; }
  .gate-copy h1 { font-size:3.4rem; }
  .gate-copy p { margin-top:7px; font-size:.97rem; }
  .gate-in { align-items:start; padding:24px 19px 38px; }
  .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .metric { padding:11px; }
  .metric strong { font-size:clamp(1.13rem,4.1vw,1.6rem); }
  .overview-grid { grid-template-columns:1fr; gap:11px; }
  .content { padding:19px 12px 38px; }
  .top { padding:8px 11px; }
  .top-label > span { display:none; }
  .page-head { align-items:flex-start; flex-direction:column; margin-bottom:16px; }
  .month { align-self:flex-start; }
  .panel,.giving { padding:12px; }
  .filters { grid-template-columns:1fr 1fr; }
  .filters .button { min-height:42px; }
}
@media(max-width:390px) {
  .form-grid,.filters { grid-template-columns:1fr; }
}

.balance-summary { font-weight:730; margin-bottom:12px; }
