:root{
  --green-900:#0B3D33; --green-800:#14574A; --green-600:#0F6B57; --green-700:#0A4F40;
  --green-100:#E3F1EC; --gold:#E3B04B; --amber-bg:#FFF1D6; --amber-fg:#7A4A00;
  --red:#B3261E; --red-bg:#FDE5E3; --ink:#14201C; --muted:#4B5B55; --line:#E1E7E3; --ground:#F4F6F3; --card:#fff;
}
*{box-sizing:border-box}
html,body{margin:0;font-family:'Plus Jakarta Sans',system-ui,sans-serif;background:var(--ground);color:var(--ink);font-size:14px}
a{color:var(--green-600)}
h1{margin:0;font-size:24px} h2{margin:0;font-size:17px}
.boot{padding:40px;text-align:center;color:var(--muted)}
#blazor-error-ui{display:none;position:fixed;bottom:0;left:0;right:0;background:var(--amber-bg);padding:12px 20px;z-index:99}
#blazor-error-ui .dismiss{cursor:pointer;margin-left:12px}

/* Staff shell */
.shell{display:flex;min-height:100vh}
/* The menu stays put while the page scrolls: only its list scrolls, and only when it is longer than the window. */
.side{flex:0 0 240px;width:240px;position:sticky;top:0;height:100vh;background:var(--green-900);color:#D9EAE4;padding:16px 10px 10px;display:flex;flex-direction:column;gap:4px;z-index:40}
.brand{display:flex;align-items:center;gap:10px;padding:4px 10px 12px}
.brand .logo{width:32px;height:32px;border-radius:8px;background:var(--gold);color:var(--green-900);font-weight:700;display:flex;align-items:center;justify-content:center;flex:0 0 32px}
.brand b{color:#fff;display:block;line-height:1.2} .brand small{color:#9CC4B8;font-size:12px}
.navlist{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:2px;padding-bottom:8px;scrollbar-width:thin}
.navgroup{margin:14px 10px 4px;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#7FB3A4}
.navgroup:first-child{margin-top:4px}
.side a.nav{display:flex;align-items:center;gap:12px;padding:8px 10px 8px 14px;border-radius:8px;text-decoration:none;color:#C5DDD5;font-weight:500}
.side a.nav.active{background:var(--green-800);color:#fff;font-weight:600}
.side a.nav:hover{background:#12493D}
.grow{flex:1}
.sideshade{display:none}
.topbar{position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:12px;margin:-24px -32px 0;padding:10px 32px;background:var(--green-800);color:#fff;box-shadow:0 2px 6px rgba(0,0,0,.18)}
.topname{display:none;font-weight:600;color:#fff}
.menubtn{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.35);border-radius:8px;padding:6px 8px;cursor:pointer;color:#fff;display:flex}
.menubtn:hover,.userbtn:hover{background:rgba(255,255,255,.22)}
.usermenu{position:relative}
.userbtn{display:flex;align-items:center;gap:8px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.35);border-radius:999px;padding:3px 12px 3px 3px;cursor:pointer;font:inherit;color:#fff}
.uavatar{width:32px;height:32px;flex:0 0 32px;border-radius:50%;background:var(--gold);color:var(--green-900);font-weight:700;display:flex;align-items:center;justify-content:center;font-size:13px}
.uname{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.menu-shade{position:fixed;inset:0;z-index:50}
.menu-pop{color:var(--ink);position:absolute;right:0;top:calc(100% + 6px);z-index:51;min-width:230px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.15);padding:6px;display:flex;flex-direction:column}
.menu-pop .who{padding:8px 10px 10px;border-bottom:1px solid var(--line);margin-bottom:4px;display:flex;flex-direction:column}
.menu-pop .who small{color:var(--muted)}
.menu-pop a,.menu-pop button{display:block;text-align:left;background:transparent;border:0;padding:8px 10px;border-radius:6px;font:inherit;color:inherit;text-decoration:none;cursor:pointer}
.menu-pop a:hover,.menu-pop button:hover{background:var(--green-100)}
/* Wide screens: the menu is open and the button hides it. Narrow screens: the menu is hidden and the button slides it over the page. */
@media (min-width:901px){.shell.toggled .side{display:none}}
@media (max-width:900px){
  .side{position:fixed;left:0;top:0;bottom:0;transform:translateX(-100%);transition:transform .2s;box-shadow:none}
  .shell.toggled .side{transform:none;box-shadow:0 0 30px rgba(0,0,0,.4)}
  .shell.toggled .sideshade{display:block;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:35}
  .topname{display:inline}
  .uname{display:none}
  .userbtn{padding:4px 8px 4px 4px}
  .content{padding:16px}
  .topbar{margin:-16px -16px 0;padding:8px 16px}
}
.content{flex:1 1 0;min-width:0;padding:24px 32px;display:flex;flex-direction:column;gap:20px}
.row{display:flex;flex-wrap:wrap;gap:24px;align-items:flex-start}
.col-main{flex:2 1 520px;min-width:0;display:flex;flex-direction:column;gap:20px}
.col-side{flex:1 1 320px;min-width:0;display:flex;flex-direction:column;gap:20px}
.head{display:flex;flex-wrap:wrap;gap:16px;align-items:center;justify-content:space-between}
.sub{color:var(--muted);margin-top:4px}

.card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:20px}
.card h2{margin-bottom:12px}
.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.kpi .label{color:var(--muted);font-size:13px} .kpi .value{font-size:26px;font-weight:700;margin:6px 0}
.tone-ok{color:var(--green-600)} .tone-warn{color:#9A5B00} .tone-neutral{color:var(--muted)} .tone-danger{color:var(--red)}
@media (max-width:900px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}

table{width:100%;border-collapse:collapse}
.tablewrap{overflow-x:auto}
th{text-align:left;color:var(--muted);font-size:12px;font-weight:600;padding:8px 6px;white-space:nowrap}
td{padding:11px 6px;border-top:1px solid #E8EDE9}
td.num,th.num{text-align:right}
tr.click{cursor:pointer} tr.click:hover{background:#F7FAF8}
.chip{display:inline-block;padding:4px 10px;border-radius:99px;font-size:12px;font-weight:600;background:var(--green-100);color:var(--green-700)}
.chip.warn{background:var(--amber-bg);color:var(--amber-fg)} .chip.danger{background:var(--red-bg);color:#8E1F18} .chip.gray{background:#E8EDE9;color:var(--muted)}

button.btn,a.btn{height:44px;padding:0 18px;border-radius:10px;border:1px solid var(--green-600);background:#fff;color:var(--green-600);font:inherit;font-weight:700;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
button.btn.primary,a.btn.primary{background:var(--green-600);color:#fff}
button.btn.danger{border-color:var(--red);color:var(--red)}
button.btn:disabled{opacity:.5;cursor:not-allowed}
.btns{display:flex;gap:10px;flex-wrap:wrap}
input.in,select.in,textarea.in{height:44px;border:1px solid #D5DDD8;border-radius:10px;padding:0 12px;font:inherit;background:#fff;width:100%}
textarea.in{height:auto;padding:10px;resize:vertical}
label.f{display:block;font-size:13px;color:var(--muted);margin:10px 0 4px}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.grid4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.k{color:var(--muted);font-size:12px} .v{font-weight:700;font-size:16px;margin-top:2px}
.note{padding:12px 14px;background:var(--ground);border-radius:10px;color:var(--muted);font-size:13px}
.alert{padding:12px 14px;border-radius:10px;margin:0;scroll-margin-top:72px;scroll-margin-bottom:16px}
.alert.warn{background:var(--amber-bg);color:var(--amber-fg)} .alert.err{background:var(--red-bg);color:#8E1F18} .alert.ok{background:var(--green-100);color:var(--green-700)}
.list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:10px;vertical-align:middle}
.dot.ok{background:var(--green-600)} .dot.warn{background:#D08A00} .dot.danger{background:#C0392B}
.bars{display:flex;align-items:flex-end;gap:12px;height:140px}
.bars .bar{flex:1;display:flex;flex-direction:column;align-items:center;gap:6px;justify-content:flex-end;height:100%}
.bars .bar div.fill{width:100%;background:#A9CFC3;border-radius:6px 6px 0 0}
.bars .bar.last div.fill{background:var(--green-600)}
.bars .bar span{font-size:12px;color:var(--muted)}
.check{display:flex;gap:12px;justify-content:space-between;flex-wrap:wrap;margin-bottom:10px}
.tick{display:inline-flex;width:22px;height:22px;border-radius:50%;align-items:center;justify-content:center;font-weight:700;font-size:13px;margin-right:10px}
.tick.Pass{background:var(--green-100);color:var(--green-700)} .tick.Review{background:var(--amber-bg);color:var(--amber-fg)} .tick.Fail{background:var(--red-bg);color:#8E1F18}
.steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:14px}
.steps li{display:flex;gap:12px}
.steps .n{flex:none;width:26px;height:26px;border-radius:50%;background:#E8EDE9;color:var(--muted);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:12px}
.steps .n.done{background:var(--green-600);color:#fff} .steps .n.cur{background:var(--gold);color:var(--ink)}
.switch{flex:none;width:56px;height:32px;border-radius:99px;border:0;padding:3px;background:#8A9892;display:flex;justify-content:flex-start;cursor:pointer}
.switch.on{background:var(--green-600);justify-content:flex-end}
.switch span{width:26px;height:26px;border-radius:50%;background:#fff;display:block}
.policy{display:flex;flex-direction:column;gap:12px}
.policy .top{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}
.effect{padding:12px 14px;border-radius:10px;background:var(--green-100);color:var(--green-700);font-size:13px}
.effect.off{background:var(--amber-bg);color:var(--amber-fg)}
.seg{display:flex;gap:10px;flex-wrap:wrap}
.seg button{height:44px;padding:0 16px;border-radius:10px;border:1px solid var(--green-600);background:#fff;color:var(--green-600);font:inherit;font-weight:600;cursor:pointer}
.seg button.on{background:var(--green-600);color:#fff}
.banner{background:var(--green-100);border:1px solid #BFDDD3;border-radius:14px;padding:16px 20px;display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.banner.bad{background:var(--red-bg);border-color:#E8C9C6}
.exit{border-color:#E8C9C6} .exit h2{color:#8E1F18}

/* Login */
.login{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:16px;background:var(--green-900)}
.login .box{background:#fff;border-radius:16px;padding:28px;width:100%;max-width:400px;display:flex;flex-direction:column;gap:6px}
.login .hint{font-size:12px;color:var(--muted);margin-top:10px;line-height:1.6}

/* Member app */
.phone-wrap{min-height:100vh;display:flex;justify-content:center;background:#DDE3DF}
.phone{width:100%;max-width:430px;min-height:100vh;background:var(--ground);display:flex;flex-direction:column;position:relative}
.phone .top{background:var(--green-900);color:#fff;padding:28px 20px 72px;display:flex;justify-content:space-between;align-items:flex-start}
.phone .top.small{padding:16px 8px 16px;align-items:center;gap:4px;justify-content:flex-start}
.phone .top.small h1{font-size:18px}
.phone .top .who small{color:#9CC4B8;font-size:13px;display:block}
.phone .top .who b{font-size:22px;display:block;margin-top:4px}
.phone .body{padding:16px;display:flex;flex-direction:column;gap:14px;flex:1}
.phone .hero{margin:-52px 16px 0;background:#fff;border-radius:16px;padding:18px;box-shadow:0 6px 20px rgba(11,61,51,.12)}
.phone .hero .big{font-size:30px;font-weight:700;margin:2px 0 12px}
.phone .mini{display:flex;gap:12px}
.phone .mini div{flex:1;background:var(--ground);border-radius:10px;padding:10px}
.phone .actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:14px 16px 0}
.phone .actions a{min-height:76px;border:1px solid var(--line);background:#fff;border-radius:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;font-weight:600;color:var(--ink);text-decoration:none}
.phone .tabs{display:flex;border-top:1px solid var(--line);background:#fff;padding:6px 8px 12px;position:sticky;bottom:0}
.phone .tabs a{flex:1;min-height:48px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;text-decoration:none;font-size:11px;font-weight:600;color:var(--muted)}
.phone .tabs a.active{color:var(--green-600)}
.phone .progress{height:8px;background:#E8EDE9;border-radius:4px;margin:12px 0 8px;overflow:hidden}
.phone .progress div{height:100%;background:var(--green-600)}
.phone ul.tx{list-style:none;margin:0;padding:0;background:#fff;border:1px solid var(--line);border-radius:14px;overflow:hidden}
.phone ul.tx li{display:flex;justify-content:space-between;gap:8px;padding:12px 16px;border-top:1px solid #EEF2EF}
.phone ul.tx li:first-child{border-top:0}
.phone .footer{padding:12px 16px 20px;background:#fff;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:10px}
.phone .footer .btn{height:50px;border-radius:12px;font-size:16px;width:100%}
.phone .seg button{flex:1}

@media print{
  .side,.topbar,.sideshade,.btns,.seg,.no-print,button,input,select,label.f,#blazor-error-ui{display:none !important}
  .shell{display:block}
  body{background:#fff}
  .card{box-shadow:none;border:0;padding:0}
  .tablewrap{overflow:visible}
}

/* Customer statement: landscape page, details box and title above a black-headed table, oldest entry first. */
/* One page rule for the whole document: a named page only applied to the first printed page. Landscape suits the member card too. */
@page{size:A4 landscape;margin:10mm}
.stmt-doc{background:#fff;padding:16px;border:1px solid var(--line);border-radius:12px;margin-top:12px}
.stmt-top{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap;margin-bottom:14px}
.stmt-info{border-collapse:separate;border-spacing:0 3px;font-size:12px}
.stmt-info th{text-align:left;background:#F1F3F2;padding:5px 12px;width:150px;border:1px solid #E1E4E2}
.stmt-info td{padding:5px 12px;font-weight:700;border:1px solid #E1E4E2;min-width:190px}
.stmt-title{text-align:right}
.stmt-society{font-weight:800;color:var(--green-800);font-size:15px}
.stmt-label{margin-top:34px;font-size:15px}
.stmt-name{color:var(--green-600);font-size:20px;font-weight:600}
.stmt-table{width:100%;border-collapse:collapse;font-size:11px}
.stmt-table th{background:#000;color:#fff;font-weight:600;padding:6px 8px;text-align:center;border:1px solid #000}
.stmt-table td{border:1px solid #B8BDBB;padding:5px 8px;vertical-align:top}
.stmt-table tbody tr:nth-child(even){background:#F2F2F2}
.stmt-table td.num{text-align:right;white-space:nowrap}
.stmt-foot{display:flex;gap:24px;justify-content:flex-end;margin-top:10px;font-size:12px;flex-wrap:wrap}
@media print{.stmt-doc{border:0;padding:0;margin:0}.stmt-table th{-webkit-print-color-adjust:exact;print-color-adjust:exact}.stmt-table tbody tr:nth-child(even){-webkit-print-color-adjust:exact;print-color-adjust:exact}}

@media print{.stmt-break{break-after:page;page-break-after:always}}
.stmt-break{margin-bottom:24px}

/* Tables read line by line: visible cell borders, alternate row shading, row highlight on hover. */
table.lined{border:1px solid #C9D3CD}
table.lined th{background:#EAF0EC;color:var(--ink);border:1px solid #C9D3CD;padding:8px 10px}
table.lined td{border:1px solid #D5DDD8;padding:9px 10px;vertical-align:top}
table.lined tbody tr:nth-child(even){background:#F5F8F6}
table.lined tbody tr:hover{background:#E6F0EB}
table.lined tr.click:hover{background:#DCEBE4}
table.lined tfoot td{background:#EAF0EC;font-weight:700}
@media print{table.lined th,table.lined tbody tr:nth-child(even){-webkit-print-color-adjust:exact;print-color-adjust:exact}}

pre.audit-json{background:#F5F8F6;border:1px solid #D5DDD8;border-radius:8px;padding:8px 10px;font-size:12px;white-space:pre-wrap;word-break:break-word;margin:4px 0 10px}

/* Pop-up dialog */
.modal-back{position:fixed;inset:0;background:rgba(15,23,42,.45);display:flex;align-items:center;justify-content:center;padding:16px;z-index:1000}
.modal-box{background:#fff;border-radius:12px;box-shadow:0 20px 50px rgba(0,0,0,.3);max-width:640px;width:100%;max-height:85vh;overflow:auto;padding:20px}
.modal-box.confirm-box{max-width:460px}
@media print{.modal-back{display:none}}

/* Member picture */
.avatar{width:64px;height:64px;border-radius:50%;object-fit:cover;flex:none;background:#e5e7eb}
.avatar.ph{display:flex;align-items:center;justify-content:center;font-weight:700;color:#475569;font-size:20px}

/* A date field with a Today button beside it */
.dtrow{display:flex;gap:8px;align-items:center}
.dtrow input.in{flex:1 1 auto;min-width:0}
.dtrow .btn{height:44px;padding:0 14px;white-space:nowrap;flex:0 0 auto}

/* Tabs inside a page (Society policies) */
.subtabs{display:flex;gap:4px;flex-wrap:wrap;border-bottom:1px solid var(--line);margin:0 0 16px}
.subtab{background:none;border:0;border-bottom:3px solid transparent;padding:10px 14px;font:inherit;font-weight:600;color:var(--muted);cursor:pointer;min-height:44px;display:inline-flex;align-items:center;gap:6px}
.subtab:hover{color:var(--ink)}
.subtab.on{color:var(--green-600);border-bottom-color:var(--green-600)}
.subtab .dot{width:8px;height:8px;border-radius:50%;background:#d97706;display:inline-block}
.ntf-ev{border-top:1px solid var(--line);padding:14px 0}
.ntf-ev:first-of-type{border-top:0}
.ntf-ph code{background:#f1f5f2;border-radius:4px;padding:1px 5px;font-size:12px;margin-right:4px;display:inline-block}

/* The security PIN is masked with CSS instead of type=password, so browsers and password managers do not offer to save or fill it. */
.pin-mask { -webkit-text-security: disc; text-security: disc; letter-spacing: .15em; }

.mono { font-family: ui-monospace, Consolas, monospace; }

/* Simple member card: one line per transaction */
.txn { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; padding:10px 0; border-bottom:1px solid var(--line, #e5e7eb); }
.txn-main { min-width:0; flex:1 1 auto; overflow-wrap:anywhere; }
.txn-amt { text-align:right; flex:0 0 auto; white-space:nowrap; }
.tag { display:inline-block; font-size:11px; font-weight:600; padding:1px 8px; border-radius:999px; margin-right:6px; }
.tag-credit { background:#e3f4ec; color:#0b5a3a; }
.tag-debit { background:#fbe9e2; color:#8a2c0d; }
@media print { .txn { break-inside:avoid; } }

/* Toggle rows (ToggleRow): label and detail on the left, the switch on the right */
.trow{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:10px 0}
.trow .tmain{min-width:0;flex:1 1 auto}
.trow .tlabel{font-weight:600}
.trow.dis{opacity:.6}
.switch:disabled{cursor:not-allowed}
.switch:focus-visible{outline:3px solid var(--green-600);outline-offset:2px}

/* Society rules document (policies printed as a document) */
.rules-doc{max-width:820px;margin:0 auto}
.rules-title{text-align:center;margin-bottom:18px}
.rules-group{margin-top:20px}
.rules-group h2{border-bottom:2px solid var(--green-600);padding-bottom:4px}
.rule{padding:8px 0;border-bottom:1px solid var(--line);break-inside:avoid}
.rule-top{display:flex;justify-content:space-between;gap:16px}
.rule-val{font-weight:700;white-space:nowrap}
.rules-sign{display:flex;gap:48px;margin-top:56px;break-inside:avoid}
.rules-sign>div{flex:1;font-size:13px;color:var(--muted)}
.rules-sign .line{border-bottom:1px solid #000;height:36px;margin-bottom:4px}
@media print{.rules-group{break-inside:auto}.rules-group h2{break-after:avoid}.rules-doc{max-width:none}}
.q-choices{margin:6px 0 0 4px;display:grid;gap:3px}
