:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #1d2733;
  --muted: #64707d;
  --line: #e2e7ec;
  --primary: #0f5c63;
  --primary-ink: #ffffff;
  --primary-soft: #e3f0f0;
  --accent: #d9822b;
  --danger: #b4372f;
  --danger-soft: #fbe9e7;
  --success: #2c7a4b;
  --success-soft: #e5f4ea;
  --warn-soft: #fff4e0;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 0; }

/* ---------- Header navigation ---------- */
.topbar { background: var(--primary); color: var(--primary-ink); position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 0 rgba(0, 0, 0, .08); }
.topbar-inner { max-width: 1540px; margin: 0 auto; display: flex; align-items: center; gap: 20px; padding: 0 20px; min-height: 58px; }
.brand { font-weight: 700; font-size: 16px; color: #fff; white-space: nowrap; display: flex; align-items: center; gap: 9px; }
.brand img { display: block; height: 40px; width: auto; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; font-size: 15px; color: #fff; }
.nav { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.nav > a, .nav-link { color: rgba(255, 255, 255, .8); padding: 8px 13px; border-radius: 7px; white-space: nowrap; font-weight: 500; }
.nav > a:hover, .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.nav > a.active, .nav-link.active { color: #fff; background: rgba(255, 255, 255, .18); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.society-switch select { width: auto; max-width: 230px; text-overflow: ellipsis; background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .28); font-weight: 600; padding: 7px 10px; }
.society-switch select option { color: var(--ink); background: #fff; }
.society-switch a { color: #fff; font-weight: 600; }

/* dropdown menus (Reports, account) */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; user-select: none; }
.menu summary::-webkit-details-marker { display: none; }
.caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: .8; transition: transform .15s; }
.menu[open] .caret { transform: rotate(180deg); }
.menu-pop { position: absolute; left: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(16, 24, 40, .18); padding: 6px; display: grid; gap: 2px; z-index: 40; }
.menu-pop.menu-right { left: auto; right: 0; }
.menu-pop a { display: block; padding: 8px 10px; border-radius: 7px; color: var(--ink); font-weight: 500; }
.menu-pop a small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; margin-top: 1px; }
.menu-pop a:hover, .menu-pop a.active { background: var(--primary-soft); color: var(--primary); }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; gap: 2px; }
.menu-head span { color: var(--muted); font-size: 12px; }
.menu-logout { width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); margin-top: 4px; padding: 10px 10px 8px; font: inherit; font-weight: 500; color: var(--danger); cursor: pointer; border-radius: 0 0 7px 7px; }
.menu-logout:hover { background: var(--danger-soft); }
.user-menu summary { color: #fff; padding: 4px 10px 4px 4px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); }
.user-menu summary:hover { background: rgba(255, 255, 255, .2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.user-name { font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) {
  .topbar-inner { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; row-gap: 6px; }
  .nav { order: 3; width: 100%; }
  .user-name { display: none; }
}
tr.current-row { background: #f6fbfb; }

.container { max-width: 1540px; margin: 0 auto; padding: 24px 20px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- Cards / layout ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card-body { padding: 18px; }
.stack > * + * { margin-top: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 4px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 10px; overflow-x: auto; }
.tab-btn { background: none; border: 0; border-bottom: 3px solid transparent; padding: 14px 16px 11px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--line); font-size: 12px; color: var(--muted); }
.tab-btn.active .count { background: var(--primary-soft); color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 7px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #c5ced6; background: #f9fafb; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #0c4b51; border-color: #0c4b51; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: #efc4bf; }
.btn-whatsapp { color: var(--success); }
.btn-whatsapp:hover { background: var(--success-soft); border-color: #b9dfc6; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-icon { padding: 4px 9px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.inline { display: inline; margin: 0; }

/* ---------- Tables ---------- */
/* Wide tables scroll sideways in their box; the page scrolls down. While a table's heading is above the top
   of the window, app.js shows a copy of it pinned under the top bar (.float-head), and a sideways scrollbar
   pinned to the bottom of the window (.float-scroll), both kept in line with the table. */
.table-wrap { overflow-x: auto; }
.float-head { position: fixed; z-index: 15; overflow: hidden; background: #fafbfc; box-shadow: 0 3px 8px rgba(16, 24, 40, .10); }
.float-head table { table-layout: fixed; }
.float-head th { box-shadow: inset 0 -1px 0 var(--line); }
.float-scroll { position: fixed; bottom: 0; z-index: 15; overflow-x: auto; overflow-y: hidden; height: 17px; background: rgba(250, 251, 252, .96); border-top: 1px solid var(--line); }
.float-scroll > div { height: 1px; }
/* tables inside popups keep their own short scroll box with the heading pinned at its top */
dialog .table-wrap { overflow: auto; max-height: 55vh; }
dialog .table-wrap > table > thead { position: sticky; top: 0; z-index: 3; }
dialog .table-wrap > table > thead th { box-shadow: inset 0 -1px 0 var(--line); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: #fafcfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.idx { color: var(--muted); width: 48px; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.chip { display: inline-block; padding: 2px 8px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-size: 12px; margin: 1px 2px 1px 0; white-space: nowrap; }
.chip.muted { background: var(--line); color: var(--muted); }
.chip.status-active { background: var(--success-soft); color: var(--success); }
.chip.status-paid { background: var(--success-soft); color: var(--success); }
.chip.status-part { background: var(--warn-soft); color: #8a5a12; }
.chip.status-unpaid { background: var(--danger-soft); color: var(--danger); }
.knockoff { margin: 0 18px 16px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.knockoff-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: #fafbfc; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ko-table th, .ko-table td { padding: 6px 10px; font-size: 13px; }
.ko-table td input[type=number] { width: 100px; padding: 4px 6px; text-align: right; }
.ko-table th.center { text-align: center; }
.ko-table th.grp { border-bottom: 1px solid var(--line); }
.ko-table th, .ko-table td { white-space: nowrap; }
.ko-table .ko-grp { background: #f2f8f3; }
.ko-table thead th.ko-grp { background: #e5f4ea; }
.ko-table tr.ko-total td { font-weight: 700; border-top: 2px solid var(--line); }
.ko-table .ko-summary { color: var(--muted); font-weight: 400; }
.modal-body.pay-fields { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .modal-body.pay-fields { grid-template-columns: 1fr 1fr; } }
.ko-table td input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
.ko-table tfoot td { background: #fafbfc; }
dialog { max-height: 94vh; }
.chip.status-deactive { background: var(--danger-soft); color: var(--danger); }
.neg { color: var(--success); }
.due { color: var(--danger); font-weight: 600; }

/* wide invoice register */
.register th, .register td { padding: 8px 10px; font-size: 13px; white-space: nowrap; }
.register th.group-pay { background: #f2f8f3; }
.register th.group-charge { background: #fdf6ee; }
.register tfoot td { font-weight: 700; background: #fafbfc; }
.register .sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; box-shadow: 1px 0 0 var(--line); }
.register thead .sticky { background: #fafbfc; z-index: 2; }   /* corner cell stays above both scroll directions */
.register td.cell-edit { cursor: pointer; text-decoration: underline dotted var(--line); text-underline-offset: 3px; }
.register td.cell-edit:hover { background: #fff8e6; }
.register td.cell-edit.manual { color: #9a5b00; font-style: italic; }
.register .cell-input { width: 96px; padding: 3px 6px; font-size: 13px; text-align: right; }
/* draft page */
.draft-tools p { margin: 0; font-size: 13px; color: var(--muted); max-width: 760px; }
.col-edit { border: 0; background: none; color: var(--primary); cursor: pointer; padding: 0 2px; font-size: 13px; line-height: 1; }
.col-edit:hover { color: var(--accent); }
.col-edit-icon { color: var(--primary); }
#draft-wrap.busy { opacity: .55; pointer-events: none; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 18px; }
.form-grid .span-2 { grid-column: span 2; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #38434f; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 3px; }
.field .errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: var(--danger); font-size: 12px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=month], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #cfd7de; border-radius: 7px; font: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(15, 92, 99, .25); border-color: var(--primary); }
input[readonly] { background: #f4f6f8; color: var(--muted); }
.form-section { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); margin: 0 0 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); background: #fafbfc; border-radius: 0 0 var(--radius) var(--radius); }

/* charges applicable rows */
.charge-rows { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.charge-row { display: grid; grid-template-columns: 1.4fr 1.2fr 1fr 1fr 40px; gap: 10px; padding: 10px 12px; align-items: end; border-bottom: 1px solid var(--line); }
.charge-row:last-child { border-bottom: 0; }
.charge-row.head { background: #fafbfc; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); align-items: center; }
.charge-row.pending .after-pick { visibility: hidden; }
.charge-row.removed { display: none; }
.sup-lines .charge-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 40px; align-items: center; }
.charge-row .errorlist { list-style: none; padding: 0; margin: 3px 0 0; color: var(--danger); font-size: 12px; }
.charge-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: #fafbfc; }
.charge-foot strong { font-variant-numeric: tabular-nums; }

/* ---------- Modal ---------- */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(560px, 94vw); box-shadow: 0 20px 50px rgba(16, 24, 40, .25); }
dialog::backdrop { background: rgba(16, 24, 40, .45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head button { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-body { padding: 18px; display: grid; gap: 14px; }
.modal-body.two-col { grid-template-columns: 1fr 1fr; }
.bulk-preview { margin: 0 18px 16px; padding: 10px 12px; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; max-height: 150px; overflow-y: auto; }
.bulk-preview .label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input[type=checkbox] { width: 18px; height: 18px; margin-top: 8px; accent-color: var(--primary); }
.modal-body + .modal-body { padding-top: 14px; }

/* ---------- Messages ---------- */
.messages { position: fixed; top: 66px; right: 20px; z-index: 50; display: grid; gap: 8px; max-width: 420px; }
.msg { padding: 11px 14px; border-radius: 8px; box-shadow: var(--shadow); border: 1px solid; font-weight: 500; transition: opacity .4s; }
.msg.success { background: var(--success-soft); border-color: #bfe3cb; color: var(--success); }
.msg.error { background: var(--danger-soft); border-color: #efc4bf; color: var(--danger); }
.msg.warning, .msg.info { background: var(--warn-soft); border-color: #f3d7a6; color: #8a5a12; }

/* ---------- Details list (society) ---------- */
.details { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0; }
.details div { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.details dt { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.details dd { margin: 3px 0 0; font-weight: 600; white-space: pre-line; }

.toolbar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.toolbar .field { min-width: 160px; }

@media (max-width: 760px) {
  .charge-row { grid-template-columns: 1fr 1fr; }
  .charge-row.head { display: none; }
  .form-grid .span-2 { grid-column: auto; }
  .modal-body.two-col { grid-template-columns: 1fr; }
}

/* bulk print / WhatsApp */
.bulk-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.bulk-bar #sel-count { font-weight: 600; margin-right: 8px; }
.pick { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.btn.disabled { opacity: .5; pointer-events: none; }
.wa-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.wa-head .actions { margin-left: auto; }
.wa-table td, .wa-table th { padding: 7px 10px; font-size: 13px; white-space: nowrap; }
.wa-table tr.sent td { background: var(--success-soft); }

/* bill register */
.bill-register th { white-space: normal; min-width: 84px; max-width: 110px; line-height: 1.25; vertical-align: bottom; }
.bill-register .sticky { min-width: 72px; max-width: 72px; }
.bill-register .sticky-2 { left: 72px; min-width: 220px; max-width: 280px; white-space: normal; }
.bill-register td.shade, .bill-register th.shade { background: #f1f3f5; font-weight: 600; }
.bill-register td.strong { font-weight: 700; }
.bill-register tbody tr:hover td { background: var(--primary-soft); }
.bill-register th.col-text, .bill-register td.col-text { min-width: 110px; max-width: none; }
.report-collection tr.paid td.col-text, .report-collection tr.paid td.col-amt { background: var(--success-soft); }

/* society payment QR */
.qr-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 14px; margin: 0; }
.qr-box legend { font-size: 13px; font-weight: 600; color: #38434f; padding: 0 4px; }
.qr-choice { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.qr-grid { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start; }
.qr-grid [hidden] { display: none; }
.qr-current { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.qr-current img, .qr-preview img { width: 96px; height: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

/* Excel import */
.import-steps { margin: 0; padding-left: 20px; display: grid; gap: 14px; }
.import-steps .help { font-size: 12px; color: var(--muted); margin-top: 3px; }
.chip.import-new { background: var(--success-soft); color: var(--success); }
.chip.import-updated { background: var(--primary-soft); color: var(--primary); }
.chip.import-unchanged { background: var(--line); color: var(--muted); }
.chip.import-error { background: var(--danger-soft); color: var(--danger); }

/* login & account pages */
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline; }
.auth-page { min-height: 100vh; margin: 0; display: grid; place-items: center; padding: 28px 18px; background: #eef1f4; }
.auth-shell { width: min(1120px, 100%); min-height: min(680px, calc(100vh - 56px)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 18px; padding: 18px; background: var(--surface); border-radius: 30px; box-shadow: 0 24px 60px rgba(16, 24, 40, .10); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.auth-inner { width: min(380px, 100%); }
.auth-brand { display: block; width: 200px; height: auto; margin: 0 auto 26px; }
.auth-title { margin: 0 0 6px; font-size: 32px; font-weight: 800; letter-spacing: -.02em; text-align: center; color: #111827; }
.auth-sub { margin: 0 0 28px; color: var(--muted); font-size: 14px; text-align: center; }
.auth-form { display: grid; gap: 14px; }
.auth-form .field label { font-size: 13px; }
.auth-form input[type=text], .auth-form input[type=password], .auth-form input[type=email] {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px; font: inherit; font-size: 15px; background: #f3f5f7; }
.auth-form input:focus { outline: 3px solid rgba(15, 92, 99, .16); border-color: var(--primary); background: #fff; }
/* login: label sits inside the grey box, above the value */
.fill-field { position: relative; background: #f3f5f7; border: 1px solid transparent; border-radius: 10px; padding: 7px 14px 4px; transition: border-color .15s, background .15s; }
.fill-field:focus-within { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 92, 99, .14); }
.fill-field label { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.2; }
.auth-form .fill-field input { height: 26px; padding: 0; border: 0; background: transparent; font-size: 15px; outline: none; box-shadow: none; }
.fill-field .pw-wrap input { padding-right: 40px !important; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px !important; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #6b7280; padding: 6px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.fill-field .pw-toggle { right: -6px; top: calc(50% - 6px); }
.pw-toggle:hover { color: var(--primary); background: var(--primary-soft); }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; margin-top: -2px; }
.auth-check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.auth-check input { width: 15px; height: 15px; accent-color: var(--primary); margin: 0; }
.auth-row .link-btn { color: #111827; font-weight: 600; text-underline-offset: 3px; }
.auth-submit { width: 100%; justify-content: center; height: 48px; font-size: 15px; font-weight: 600; border-radius: 10px; margin-top: 8px; }
.auth-foot { margin: 22px 0 0; font-size: 13.5px; color: #374151; display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
.auth-foot span { color: var(--primary); font-weight: 600; }
.auth-note { padding: 11px 13px; border-radius: 10px; background: var(--warn-soft); color: #7a4f0f; font-size: 13.5px; margin-bottom: 4px; }
.auth-alert { padding: 11px 13px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; border: 1px solid; }
.auth-alert.error { background: var(--danger-soft); border-color: #efc4bf; color: var(--danger); }
.auth-alert.success { background: var(--success-soft); border-color: #bfe3cb; color: var(--success); }
.auth-alert.info, .auth-alert.warning { background: var(--warn-soft); border-color: #f3d7a6; color: #8a5a12; }
/* photo panel (outline with cut-outs is set by script; rounded box without it) */
.auth-hero { position: relative; overflow: hidden; border-radius: 28px; min-height: 560px; background: #6f8fb0; }
.auth-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 40%; }
.auth-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(200deg, rgba(10, 30, 60, .45) 0%, rgba(10, 30, 60, 0) 38%, rgba(10, 30, 60, 0) 60%, rgba(10, 30, 60, .55) 100%); z-index: 1; }
.auth-hero-text { position: absolute; top: 26px; right: 30px; left: 190px; margin: 0; z-index: 2; color: #fff; text-align: right; font-size: 21px; font-weight: 700; line-height: 1.3; text-shadow: 0 1px 12px rgba(0, 0, 0, .25); }
.auth-hero-points { position: absolute; left: 22px; bottom: 22px; right: 190px; z-index: 2; margin: 0; padding: 14px 16px; list-style: none; display: grid; gap: 8px;
  color: #fff; font-size: 13.5px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28); border-radius: 16px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.auth-hero-points li { display: flex; align-items: center; gap: 9px; }
.auth-hero-points li::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; background: #7cd67a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 10px; border-radius: 22px; }
  .auth-hero { display: none; }
  .auth-main { padding: 26px 14px 22px; }
  .auth-title { font-size: 27px; }
}
.issued { padding: 14px 18px; margin-bottom: 18px; border-left: 4px solid var(--success); display: grid; gap: 10px; }
.issued-creds { display: flex; gap: 22px; align-items: end; flex-wrap: wrap; }
.issued-creds .help { display: block; font-size: 12px; color: var(--muted); }
.issued-creds code { font-size: 16px; font-weight: 700; background: var(--success-soft); padding: 3px 8px; border-radius: 5px; }

/* member ledger */
.ledger-wrap + .ledger-wrap { border-top: 1px solid var(--line); }
.ledger td, .ledger th { padding: 6px 10px; font-size: 13px; vertical-align: top; }
.ledger .d { white-space: nowrap; }
.ledger thead th.grp { text-align: center; border-bottom: 1px solid var(--line); }
.ledger thead th[rowspan] { vertical-align: bottom; }
.ledger .chq { color: var(--muted); font-size: 12px; }
.ledger tr.party td { font-weight: 700; font-size: 14px; text-decoration: underline; background: #fafbfc; }
.ledger tfoot td { font-weight: 700; background: #fafbfc; }

/* WhatsApp API settings */
.wa-setup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .wa-setup { grid-template-columns: 1fr; } }
.wa-setup h2 { font-size: 16px; margin: 0; }
.wa-steps { margin: 0; padding-left: 36px; display: grid; gap: 10px; font-size: 14px; }
.wa-steps ul { margin: 6px 0; padding-left: 18px; }
.wa-template { background: #f6f8fa; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; white-space: pre-wrap; margin: 6px 0; }
