/* সমিতি খাতা — UI. Forest-green theme from the client's reference; --brand is admin-editable. */
:root {
  --brand: #0E6B40;
  --accent: #1F9D57;
  --brand-900: color-mix(in srgb, var(--brand) 72%, #031a10);
  --brand-800: color-mix(in srgb, var(--brand) 86%, #031a10);
  --brand-600: color-mix(in srgb, var(--brand) 82%, #ffffff);
  --brand-100: color-mix(in srgb, var(--brand) 12%, #ffffff);
  --brand-50: color-mix(in srgb, var(--brand) 6%, #ffffff);
  --bg: #F1F6F3;
  --card: #ffffff;
  --ink: #18261F;
  --ink-2: #3A4A42;
  --muted: #6B7C73;
  --line: #E1EAE5;
  --line-2: #EDF2EF;
  --red: #D7352A;
  --red-50: #FDECEA;
  --blue: #2463D6;
  --blue-50: #E8F0FD;
  --orange: #EE8A12;
  --orange-50: #FEF2E2;
  --purple: #7A4CD6;
  --purple-50: #F1EBFD;
  --teal: #0F8A8A;
  --gray-50: #F3F5F4;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 40, 28, .05), 0 4px 14px rgba(16, 40, 28, .04);
  --shadow-lg: 0 18px 50px rgba(10, 40, 25, .18);
  --sidebar-w: 248px;
  --topbar-h: 64px;
  --font: 'Hind Siliguri', 'Noto Sans Bengali', 'Nirmala UI', system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; color: var(--ink); }
p { margin: 0 0 .75rem; }
.ic { width: 20px; height: 20px; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }

/* ---------- App shell ---------- */
.shell { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: linear-gradient(180deg, var(--brand-800), var(--brand-900));
  color: #E9F5EE; display: flex; flex-direction: column;
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); color: #fff; }
.sb-brand:hover { text-decoration: none; }
.sb-logo { width: 40px; height: 40px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.sb-logo img, .sb-logo svg { width: 34px; height: 34px; object-fit: contain; }
.sb-name { font-weight: 700; font-size: 16px; line-height: 1.25; }
.sb-sub { font-size: 12px; opacity: .72; }
.sb-nav { flex: 1; overflow-y: auto; padding: 12px 10px; scrollbar-width: thin; }
.sb-label { font-size: 11.5px; letter-spacing: .02em; opacity: .55; padding: 14px 12px 6px; }
.sb-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0; border-radius: 10px; color: #DDEFE4; font-weight: 500; font-size: 15px; }
.sb-link .ic { opacity: .9; }
.sb-link:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.sb-link.active { background: color-mix(in srgb, var(--accent) 55%, transparent); color: #fff; box-shadow: inset 3px 0 0 #9BE7BB; }
.sb-link .count { margin-left: auto; background: #F9C846; color: #3B2A00; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; }
.sb-foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12.5px; display: flex; align-items: center; gap: 8px; opacity: .85; }
.sb-foot .dot { width: 8px; height: 8px; border-radius: 50%; background: #5BE38F; box-shadow: 0 0 0 3px rgba(91,227,143,.18); }
.sb-foot.offline .dot { background: #F6B13B; box-shadow: 0 0 0 3px rgba(246,177,59,.2); }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
}
.tb-title { display: none; font-weight: 700; font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; position: relative; flex-shrink: 0; }
.tb-btn:hover { background: var(--gray-50); text-decoration: none; }
.tb-btn .badge { position: absolute; top: 6px; right: 6px; min-width: 17px; height: 17px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; }
.tb-menu { display: none; }
.tb-back { display: none; }
.tb-branch { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 6px 0 12px; height: 40px; background: #fff; }
.tb-branch label { font-size: 14px; color: var(--muted); white-space: nowrap; }
.tb-branch select { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--ink); padding: 6px 4px; min-width: 150px; cursor: pointer; }
.tb-branch select:focus { outline: none; }
.tb-branch.fixed { padding-right: 12px; font-weight: 600; }
.tb-spacer { flex: 1; }
.tb-user { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 12px; border: 0; background: transparent; cursor: pointer; font: inherit; color: var(--ink); }
.tb-user:hover { background: var(--gray-50); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-100); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 15px; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 76px; height: 76px; font-size: 30px; }
.avatar.md { width: 46px; height: 46px; font-size: 18px; }
.tb-user .who { text-align: left; line-height: 1.2; }
.tb-user .who b { display: block; font-size: 14px; }
.tb-user .who small { color: var(--muted); font-size: 12px; }

.content { padding: 22px 24px 40px; width: 100%; max-width: 1360px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 24px; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.crumb:hover { color: var(--brand); text-decoration: none; }

.net-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 4px 12px 4px 10px; font-size: 13px; font-weight: 600; background: var(--brand); color: #fff; }
.net-pill .ic { width: 16px; height: 16px; }
.net-pill.off { background: #F7A928; color: #3A2600; }
.net-pill .q { background: rgba(255,255,255,.25); border-radius: 99px; padding: 0 6px; }

/* ---------- Bottom tab bar (phone) ---------- */
.tabbar { display: none; }

/* ---------- Cards & grids ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h2, .card-head h3 { font-size: 16.5px; }
.card-head .link { font-size: 13.5px; font-weight: 600; }
.card-body { padding: 16px 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr) minmax(0, .8fr); }
.g-side { grid-template-columns: minmax(0, 1fr) 340px; }
.g-profile { grid-template-columns: 330px minmax(0, 1fr); }
.stack > * + * { margin-top: 16px; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }

.stat { display: flex; align-items: center; gap: 14px; padding: 18px; }
.stat-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.stat-ic .ic { width: 28px; height: 28px; }
.stat-label { color: var(--muted); font-size: 13.5px; }
.stat-value { font-size: 23px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.stat-note { font-size: 12.5px; color: var(--muted); }
.t-green { background: var(--brand-100); color: var(--brand); }
.t-blue { background: var(--blue-50); color: var(--blue); }
.t-orange { background: var(--orange-50); color: var(--orange); }
.t-red { background: var(--red-50); color: var(--red); }
.t-purple { background: var(--purple-50); color: var(--purple); }
.t-gray { background: var(--gray-50); color: var(--muted); }
.c-green { color: var(--brand) !important; } .c-blue { color: var(--blue) !important; } .c-orange { color: var(--orange) !important; }
.c-red { color: var(--red) !important; } .c-purple { color: var(--purple) !important; } .c-muted { color: var(--muted) !important; }
.c-ink { color: var(--ink) !important; }
.fw { font-weight: 700; } .fs-s { font-size: 13px; } .nowrap { white-space: nowrap; }
.t-right { text-align: right; } .t-center { text-align: center; }

/* Today's transactions list */
.tx-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.tx-row:last-child { border-bottom: 0; }
.tx-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.tx-ic .ic { width: 18px; height: 18px; }
.tx-row .lbl { flex: 1; font-weight: 500; }
.tx-row .amt { font-weight: 700; white-space: nowrap; }

/* Quick actions */
.qa { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid; font-weight: 600; font-size: 14.5px; margin-bottom: 10px; background: #fff; }
.qa:hover { text-decoration: none; filter: brightness(.97); }
.qa .ic { width: 30px; height: 30px; padding: 6px; border-radius: 8px; color: #fff; }
.qa.green { border-color: color-mix(in srgb, var(--brand) 30%, #fff); color: var(--brand); background: var(--brand-50); } .qa.green .ic { background: var(--brand); }
.qa.blue { border-color: #BCD2F7; color: var(--blue); background: var(--blue-50); } .qa.blue .ic { background: var(--blue); }
.qa.orange { border-color: #F8D2A1; color: #C46A00; background: var(--orange-50); } .qa.orange .ic { background: var(--orange); }
.qa.purple { border-color: #D6C6F6; color: var(--purple); background: var(--purple-50); } .qa.purple .ic { background: var(--purple); }

/* Bar chart */
.chart-legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.chart-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; background: var(--brand); vertical-align: -1px; }
.chart-legend span.b::before { background: var(--blue); }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding: 8px 4px 0; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-pair { display: flex; gap: 4px; align-items: flex-end; height: 100%; }
.bar { width: 14px; border-radius: 4px 4px 0 0; background: var(--brand); min-height: 2px; position: relative; }
.bar.b { background: var(--blue); }
.bar-x { display: flex; gap: 10px; padding: 6px 4px 0; }
.bar-x span { flex: 1; text-align: center; font-size: 12.5px; color: var(--muted); }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap; transition: filter .15s, background .15s; text-decoration: none !important; }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: linear-gradient(180deg, var(--brand-600), var(--brand)); color: #fff; box-shadow: 0 2px 6px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-dark { background: var(--brand-800); color: #fff; }
.btn-light { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-light:hover { background: var(--gray-50); }
.btn-soft { background: var(--brand-100); color: var(--brand); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-soft { background: var(--red-50); color: var(--red); }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn-lg { height: 50px; font-size: 16.5px; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--gray-50); color: var(--brand); }
.icon-btn .ic { width: 18px; height: 18px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label, .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.field .err { font-size: 13px; color: var(--red); margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%; height: 44px; border: 1px solid #D5E0DA; border-radius: 10px; padding: 0 12px; font: inherit; font-size: 15px;
  color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.input.money { font-weight: 700; font-size: 17px; }
.input-ic { position: relative; }
.input-ic > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #93A49B; pointer-events: none; }
.input-ic .input { padding-left: 42px; }
.input-ic .trail { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.has-err .input { border-color: var(--red); }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); }
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #CBD6D0; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.seg { display: inline-flex; background: var(--gray-50); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button, .seg label { padding: 6px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--muted); border: 0; background: transparent; cursor: pointer; font-family: inherit; }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg .on, .seg input:checked + span { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg input { display: none; }
.seg label span { display: block; padding: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-weight: 600; color: var(--ink-2); background: #F4F8F6; padding: 11px 14px; white-space: nowrap; border-bottom: 1px solid var(--line); font-size: 14px; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover td { background: #FAFCFB; }
.table .num, .table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: 700; background: #F8FBF9; border-top: 1px solid var(--line); }
.table.compact td, .table.compact th { padding: 8px 10px; }
.table .who { display: flex; align-items: center; gap: 10px; }
.table .who b { display: block; font-weight: 600; }
.table .who small { color: var(--muted); font-size: 12.5px; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
tr.voided td { color: #A3B0A9; text-decoration: line-through; }
tr.voided td.keep { text-decoration: none; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill .ic { width: 14px; height: 14px; }
.pill.green { background: #E2F4E9; color: #127342; border: 1px solid #BFE3CD; }
.pill.red { background: var(--red-50); color: var(--red); border: 1px solid #F5C7C2; }
.pill.orange { background: var(--orange-50); color: #B66300; border: 1px solid #F6D3A6; }
.pill.blue { background: var(--blue-50); color: var(--blue); border: 1px solid #C6D8F8; }
.pill.gray { background: var(--gray-50); color: var(--muted); border: 1px solid var(--line); }
.pill.purple { background: var(--purple-50); color: var(--purple); border: 1px solid #DCCDF8; }

/* Toolbar / filters */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.toolbar .grow { flex: 1; min-width: 220px; }
.toolbar .input { height: 40px; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding: 12px 18px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 34px; height: 34px; border-radius: 8px; display: inline-grid; place-items: center; font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 0 8px; }
.pager a:hover { background: var(--gray-50); text-decoration: none; }
.pager .on { background: var(--brand); color: #fff; }
.pager .dis { color: #B8C4BE; }
.pager .info { margin-right: auto; color: var(--muted); font-weight: 500; }

/* Empty state */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ic { width: 44px; height: 44px; color: #B5C6BD; margin: 0 auto 10px; }
.empty b { display: block; color: var(--ink-2); font-size: 16px; margin-bottom: 4px; }

/* Alerts & flashes */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14.5px; margin-bottom: 16px; border: 1px solid; }
.alert .ic { margin-top: 2px; }
.alert.ok { background: #E7F6EC; border-color: #BCE3CA; color: #0D5E35; }
.alert.err { background: var(--red-50); border-color: #F4C4BF; color: #9C231A; }
.alert.warn { background: #FFF6E0; border-color: #F5DC9B; color: #7A5300; }
.alert.info { background: var(--blue-50); border-color: #C9DAF8; color: #1B4AA0; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.demo-bar { background: linear-gradient(90deg, #13202A, #23343F); color: #E6F0EC; font-size: 13.5px; padding: 8px 24px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.demo-bar b { color: #FFD15C; }
.demo-bar a { color: #8EF0B6; font-weight: 600; }

/* ---------- Profile / detail ---------- */
.profile { text-align: center; padding: 22px 18px 16px; }
.profile .avatar { margin: 0 auto 10px; }
.profile h2 { font-size: 20px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14.5px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { text-align: right; }
.meta-line { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; padding: 4px 0; }
.meta-line .ic { width: 16px; height: 16px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 12px 14px; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; white-space: nowrap; font-size: 14.5px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.tabs.pills { border: 0; padding: 0; gap: 6px; }
.tabs.pills a { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; background: #fff; }
.tabs.pills a.on { background: var(--brand); color: #fff; border-color: var(--brand); }

.big-total { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--brand-50); border: 1px solid color-mix(in srgb, var(--brand) 18%, #fff); margin-bottom: 10px; }
.big-total b { font-size: 20px; }
.progress { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--brand)); border-radius: inherit; }

/* Summary boxes (sheet headers) */
.sum-boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.sum-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.sum-box span { display: block; font-size: 13px; color: var(--muted); }
.sum-box b { font-size: 19px; }

/* Ink colours of the paper books */
.ink-black { color: #141414; font-weight: 600; }
.ink-red { color: var(--red); font-weight: 600; }
.ink-blue { color: var(--blue); }
th.ink-red, th .ink-red { color: var(--red); }

/* Daily account statement */
.statement td { padding: 12px 16px; font-size: 15.5px; }
.statement td:first-child { font-weight: 600; }
.statement tr.total td { background: #F3F8F5; font-weight: 700; font-size: 16.5px; }
.statement tr.cash td { background: var(--brand-50); font-weight: 700; font-size: 17px; color: var(--brand); }
.statement tr.sub td:first-child { padding-left: 34px; font-weight: 500; color: var(--ink-2); }

/* Collection sheet (paper-style grid) */
.sheet-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.sheet { border-collapse: collapse; font-size: 13px; min-width: 100%; font-variant-numeric: tabular-nums; }
.sheet th, .sheet td { border: 1px solid #D9E3DD; padding: 5px 7px; text-align: center; white-space: nowrap; }
.sheet thead th { background: #F2F7F4; font-weight: 600; font-size: 12.5px; position: sticky; top: 0; }
.sheet .nm { text-align: left; min-width: 150px; position: sticky; left: 0; background: #fff; z-index: 1; }
.sheet thead .nm { background: #F2F7F4; z-index: 2; }
.sheet .code { color: var(--muted); font-size: 12px; }
.sheet td.cell { min-width: 62px; line-height: 1.25; }
.sheet td.cell .k { color: #121212; font-weight: 600; display: block; }
.sheet td.cell .l { color: var(--red); font-weight: 600; display: block; font-size: 12px; }
.sheet td.tick { color: #9AAAA2; }
.sheet td.pend { background: #FFF8E6; }
.sheet tfoot td { background: #F7FAF8; font-weight: 700; }
.sheet .bal { background: #FAFCFB; font-weight: 600; }
.sig-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 46px; text-align: center; font-size: 13px; color: var(--ink-2); }
.sig-row div { border-top: 1px solid #9FB0A7; padding-top: 6px; }

/* Collection entry */
.collect-list .ci { display: grid; grid-template-columns: minmax(0, 1fr) 132px 132px; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.collect-list .ci:last-child { border-bottom: 0; }
.ci .nm b { display: block; font-weight: 600; }
.ci .nm small { color: var(--muted); font-size: 12.5px; }
.ci .due { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.ci .due.late { color: var(--red); font-weight: 600; }
.ci .input { height: 40px; text-align: right; font-weight: 700; }
.ci.done { background: #F2FAF5; }
.ci.queued { background: #FFF9E8; }
.ci .state { font-size: 12px; font-weight: 600; }
.collect-head { display: grid; grid-template-columns: minmax(0, 1fr) 132px 132px; gap: 10px; padding: 10px 16px; background: #F4F8F6; font-weight: 600; font-size: 13.5px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.sticky-bar { position: sticky; bottom: 0; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); padding: 12px 16px; display: flex; align-items: center; gap: 12px; z-index: 5; border-radius: 0 0 var(--radius) var(--radius); }
.sticky-bar .tot { flex: 1; font-size: 14px; color: var(--muted); }
.sticky-bar .tot b { color: var(--ink); font-size: 18px; display: block; }

/* Settings list (reference style) */
.set-list a, .set-list .row { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line-2); color: var(--ink); font-weight: 500; }
.set-list a:last-child { border-bottom: 0; }
.set-list a:hover { background: #FAFCFB; text-decoration: none; }
.set-list .ic:first-child { color: var(--brand); }
.set-list .grow { flex: 1; }
.set-list small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.set-list .chev { color: #A5B5AC; }

/* Report cards (monthly) */
.rep-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.rep-card .stat-ic { width: 48px; height: 48px; border-radius: 12px; }
.rep-card .stat-ic .ic { width: 24px; height: 24px; }
.rep-card .grow { flex: 1; }
.rep-card .cnt { font-weight: 700; font-size: 14px; }
.rep-link { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.rep-link:hover { border-color: color-mix(in srgb, var(--brand) 40%, #fff); text-decoration: none; box-shadow: var(--shadow); }
.rep-link b { display: block; }
.rep-link small { color: var(--muted); }

/* Dropdown & modal */
.dd { position: relative; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; display: none; }
.dd.open .dd-menu { display: block; }
.dd-menu a, .dd-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; color: var(--ink); font: inherit; font-size: 14.5px; border: 0; background: none; cursor: pointer; text-align: left; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--gray-50); text-decoration: none; }
.dd-menu .ic { width: 18px; height: 18px; color: var(--muted); }
.dd-menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 6px 0; }
.dd-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.dd-head b { display: block; }
.dd-head small { color: var(--muted); }
.notif { width: 340px; max-width: calc(100vw - 24px); padding: 0; }
.notif .n-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-size: 14px; color: var(--ink); }
.notif .n-item:hover { background: #FAFCFB; text-decoration: none; }
.notif .n-item small { display: block; color: var(--muted); font-size: 12.5px; }
.modal { position: fixed; inset: 0; background: rgba(8, 28, 18, .45); z-index: 80; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; }
.modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-box.wide { max-width: 640px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 18px; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; justify-content: flex-end; }
.toast-zone { position: fixed; z-index: 90; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--brand-900); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14.5px; max-width: 360px; animation: toastIn .2s ease-out; display: flex; gap: 8px; align-items: center; }
.toast.err { background: #8E1F17; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Auth (login) ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 10% 10%, #E2F2E8, transparent), radial-gradient(900px 500px at 100% 100%, #DCEFE3, transparent), var(--bg); }
.auth-card { width: 100%; max-width: 980px; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgba(9, 48, 28, .14); border: 1px solid var(--line); }
.auth-art { position: relative; padding: 44px 36px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 560px; overflow: hidden; background: linear-gradient(180deg, #ffffff 0%, #F2FAF5 100%); }
.auth-art .waves { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: auto; }
.auth-art .brandmark { width: 112px; height: 112px; margin-bottom: 16px; }
.auth-art .brandmark img { width: 100%; height: 100%; object-fit: contain; }
.auth-art h1 { font-size: 30px; color: var(--brand-800); }
.auth-art .tag { color: var(--brand); font-weight: 600; font-size: 17px; margin-top: 6px; }
.auth-art .slogan { color: var(--ink-2); margin-top: 18px; font-size: 15px; }
.auth-art .content-top { position: relative; z-index: 1; margin-top: -80px; }
.auth-form { padding: 52px 44px; display: flex; flex-direction: column; justify-content: center; }
.auth-form h2 { font-size: 26px; margin-bottom: 22px; }
.auth-form .field { margin-bottom: 14px; }
.auth-form .input { height: 50px; }
.auth-form .btn { height: 50px; font-size: 17px; }
.auth-form .forgot { text-align: center; margin-top: 14px; font-size: 14.5px; }
.auth-form .legal { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 30px; }
.demo-box { margin-top: 22px; border: 1px dashed color-mix(in srgb, var(--brand) 40%, #fff); background: var(--brand-50); border-radius: 14px; padding: 14px; }
.demo-box b { display: block; margin-bottom: 4px; }
.demo-box p { font-size: 13.5px; color: var(--ink-2); margin-bottom: 10px; }
.demo-box .demo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-box .demo-btns .btn { height: 42px; font-size: 14px; }

/* Phone home tiles */
.hero-sum { display: none; }
.tiles { display: none; }

/* Mobile list rows */
.m-list { display: none; }
.m-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.m-item:hover { text-decoration: none; background: #FAFCFB; }
.m-item .grow { flex: 1; min-width: 0; }
.m-item b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-item small { color: var(--muted); font-size: 12.5px; }
.m-item .right { text-align: right; font-size: 13px; }
.m-item .right b { font-size: 14.5px; }
.m-item > .ic:last-child { color: #A9B8B0; }
.fab { position: fixed; right: 18px; bottom: 84px; width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: #fff; display: none; place-items: center; box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 45%, transparent); z-index: 25; }
.fab .ic { width: 26px; height: 26px; }

.scrim { display: none; }

/* Member picker */
.picker { position: relative; }
.picker-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 50; max-height: 320px; overflow-y: auto; padding: 4px; }
.picker-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px; font: inherit; cursor: pointer; color: var(--ink); }
.picker-list button:hover, .picker-list button.on { background: var(--brand-50); }
.picker-list button b { display: block; font-weight: 600; }
.picker-list button small { color: var(--muted); font-size: 12.5px; }
.picker-empty { padding: 12px; color: var(--muted); font-size: 14px; }

/* Small utilities */
.d-block { display: block; }
.fw-normal { font-weight: 400; }
.spinning .ic { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ci .queued { font-weight: 600; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: var(--gray-50); padding: 1px 6px; border-radius: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .g-main { grid-template-columns: 1fr 1fr; }
  .g-main > :last-child { grid-column: 1 / -1; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(5, 25, 15, .45); z-index: 35; }
  .main { margin-left: 0; }
  .tb-menu { display: grid; }
  .g-side, .g-profile { grid-template-columns: minmax(0, 1fr); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  body { font-size: 15px; background: #F4F7F5; }
  .topbar { background: linear-gradient(180deg, var(--brand-600), var(--brand)); color: #fff; border: 0; padding: 0 6px 0 4px; height: 58px; gap: 4px; }
  .topbar .tb-btn { color: #fff; }
  .topbar .tb-btn:hover { background: rgba(255,255,255,.12); }
  .topbar .tb-btn .badge { border-color: var(--brand); }
  .tb-title { display: block; padding-left: 4px; }
  .tb-menu { display: none; }
  .tb-back { display: grid; }
  .tb-branch, .tb-user .who, .tb-spacer { display: none; }
  .tb-user { padding: 4px; }
  .tb-user .avatar { width: 32px; height: 32px; background: rgba(255,255,255,.18); color: #fff; }
  .page-head { margin-bottom: 14px; }
  .page-head h1 { display: none; }
  .page-head.keep h1 { display: block; font-size: 20px; }
  .crumb { display: none; }
  .content { padding: 14px 12px 96px; }
  .g-2, .g-3, .g-4, .g-main { grid-template-columns: minmax(0, 1fr); }
  .g-main > :last-child { grid-column: auto; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .card { border-radius: 14px; }
  .card-head { padding: 12px 14px; }
  .card-body { padding: 14px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 20px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(10, 40, 25, .06);
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); font-weight: 600; border: 0; background: none; font-family: inherit; padding: 2px 0; cursor: pointer; position: relative; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .ic { width: 22px; height: 22px; }
  .tabbar .on { color: var(--brand); }
  .tabbar .main-btn .ic { width: 46px; height: 46px; padding: 11px; border-radius: 50%; background: var(--brand); color: #fff; margin-top: -24px; box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 40%, transparent); border: 4px solid #fff; }
  .tabbar .dot { position: absolute; top: 0; right: 30%; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
  .fab { display: grid; }
  .desk-only { display: none !important; }
  .table-wrap.cards-on-phone { display: none; }
  .m-list { display: block; }
  .hero-sum { display: block; }
  .tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .tile { border-radius: 16px; padding: 18px 12px; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; text-align: center; box-shadow: var(--shadow); }
  .tile:hover { text-decoration: none; filter: brightness(1.05); }
  .tile .ic { width: 40px; height: 40px; padding: 8px; border-radius: 12px; background: rgba(255,255,255,.2); }
  .tile.green { background: linear-gradient(160deg, #23A25E, #157A43); }
  .tile.blue { background: linear-gradient(160deg, #3A7BE8, #1E5BC9); }
  .tile.orange { background: linear-gradient(160deg, #F69A35, #E2700C); }
  .tile.purple { background: linear-gradient(160deg, #9168E6, #6D41CC); }
  .tile.teal { background: linear-gradient(160deg, #23A8A0, #12807A); }
  .tile.red { background: linear-gradient(160deg, #EB5A4E, #C93227); }
  .phone-hide { display: none !important; }
  .collect-head { display: none; }
  .sticky-bar { bottom: calc(64px + env(safe-area-inset-bottom)); border-radius: 12px; box-shadow: 0 -6px 18px rgba(10,40,25,.08); }
  .demo-bar > .ic { display: none; }
  .collect-list .ci { grid-template-columns: 1fr 1fr; padding: 12px 14px; }
  .collect-list .ci .nm { grid-column: 1 / -1; }
  .auth { padding: 0; background: #fff; display: block; }
  .auth-card { grid-template-columns: minmax(0, 1fr); border-radius: 0; box-shadow: none; border: 0; }
  .auth-art { min-height: 0; padding: 36px 24px 90px; }
  .auth-art .content-top { margin-top: 0; }
  .auth-art .brandmark { width: 92px; height: 92px; }
  .auth-art h1 { font-size: 25px; }
  .auth-art .slogan { display: none; }
  .auth-form { padding: 8px 22px 36px; margin-top: -40px; position: relative; z-index: 2; }
  .auth-form h2 { font-size: 22px; }
  .toast-zone { left: 12px; right: 12px; bottom: 80px; }
  .demo-bar { padding: 7px 12px; font-size: 12.5px; }
  .sig-row { gap: 10px; font-size: 11.5px; }
  .net-pill.desk { display: none; }
}

@media (min-width: 768px) {
  .phone-only { display: none !important; }
}

/* ---------- Print (receipts, sheets, reports) ---------- */
.print-head { display: none; }
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 12.5px; }
  .sidebar, .topbar, .tabbar, .fab, .no-print, .demo-bar, .toast-zone, .page-head .actions, .toolbar, .pager { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  .print-head { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid #222; padding-bottom: 8px; margin-bottom: 12px; }
  .print-head img, .print-head svg { width: 48px; height: 48px; }
  .print-head h2 { font-size: 18px; }
  .print-head small { display: block; color: #444; }
  .sheet-wrap, .table-wrap { overflow: visible; border: 0; }
  .sheet th, .sheet td { border-color: #777; padding: 3px 4px; }
  .sheet .nm { position: static; }
  .sheet thead th { position: static; }
  .table th { background: #eee !important; }
  .page-head h1 { display: block !important; font-size: 18px; }
  a { color: inherit; text-decoration: none; }
  .m-list { display: none !important; }
  .table-wrap.cards-on-phone { display: block !important; }
  .desk-only { display: block !important; }
}
