/* JPA Books. Same family as JPA Pro's dark glass: black-navy backdrop with a blue glow, frosted translucent panels,
   capsule buttons, large titles, Apple system colors (green = money in, red = money out, blue = action).
   Dark is the default; html[data-theme="light"] swaps the tokens (Settings > Appearance). */
:root {
  color-scheme: dark;
  --page: #04060b;
  --page-grad: radial-gradient(60% 50% at 12% 0%, rgba(10, 132, 255, .30), transparent 70%), radial-gradient(45% 40% at 100% 6%, rgba(94, 92, 230, .20), transparent 70%), radial-gradient(55% 45% at 72% 100%, rgba(10, 132, 255, .13), transparent 70%), linear-gradient(180deg, #0b1020, #04060b);
  --ink: #f5f7fb; --ink2: #a6b1c7; --ink3: #7f8aa3;
  --glass: rgba(255, 255, 255, .06); --glass-grad: linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .02) 60%);
  --raised: rgba(255, 255, 255, .09); --raised-hover: rgba(255, 255, 255, .14); --field: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .13); --line2: rgba(255, 255, 255, .07); --line-strong: rgba(255, 255, 255, .30);
  --hi: inset 0 1px 0 rgba(255, 255, 255, .20), inset 0 -1px 0 rgba(255, 255, 255, .04);
  --shadow: 0 14px 40px rgba(0, 0, 0, .42);
  --tint: 10, 132, 255; --blue: #0a84ff; --blue-ink: #4da3ff;
  --green: #30d158; --green-fill: #30d158; --red: #ff5a50; --orange: #ffb340; --g: 48, 209, 88; --r: 255, 69, 58; --o: 255, 159, 10;
  --solid: #0f131c; --th: #131825; --sheet: rgba(26, 29, 38, .82); --hover: rgba(255, 255, 255, .045); --inset: rgba(0, 0, 0, .22); --off: rgba(120, 120, 128, .40);
  --c-in: #30d158; --c-out: #ff5a50;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23a6b1c7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%237f8aa3' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 10.5 3.5 3.5 7.5-8'/%3E%3C/svg%3E");
  /* names the screens already use */
  --text: var(--ink); --muted: var(--ink2); --bg2: var(--raised); --blue-bg: rgba(var(--tint), .18); --red-bg: rgba(var(--r), .16);
}
html[data-theme="light"] {
  color-scheme: light;
  --page: #e6edf9;
  --page-grad: radial-gradient(70% 45% at 10% 0%, rgba(96, 165, 250, .55), transparent 70%), radial-gradient(55% 40% at 100% 12%, rgba(167, 139, 250, .38), transparent 70%), radial-gradient(60% 45% at 62% 100%, rgba(45, 212, 191, .28), transparent 70%), linear-gradient(180deg, #eef3ff, #e3e9f7);
  --ink: #1c1c1e; --ink2: #56607a; --ink3: #7b8499;
  --glass: rgba(255, 255, 255, .52); --glass-grad: linear-gradient(135deg, rgba(255, 255, 255, .60), rgba(255, 255, 255, .18) 60%);
  --raised: rgba(255, 255, 255, .66); --raised-hover: rgba(255, 255, 255, .9); --field: rgba(255, 255, 255, .78);
  --line: rgba(60, 60, 67, .16); --line2: rgba(60, 60, 67, .09); --line-strong: rgba(60, 60, 67, .35);
  --hi: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -1px 0 rgba(255, 255, 255, .3);
  --shadow: 0 12px 34px rgba(37, 99, 235, .13);
  --tint: 0, 122, 255; --blue: #007aff; --blue-ink: #0a63d6;
  --green: #1a8a3c; --green-fill: #34c759; --red: #d92d20; --orange: #a85a00; --g: 52, 199, 89; --r: 255, 59, 48; --o: 255, 149, 0;
  --solid: #eef2fb; --th: #f1f5fd; --sheet: rgba(255, 255, 255, .86); --hover: rgba(0, 0, 0, .035); --inset: rgba(0, 0, 0, .04); --off: rgba(120, 120, 128, .28);
  --c-in: #34c759; --c-out: #ff5a50;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2356607a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%239aa3b5' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 10.5 3.5 3.5 7.5-8'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { background: var(--page); }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--page-grad); }
a { color: var(--blue-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(var(--tint), .45); }

/* the glass itself */
aside.side, .card, .kpi, .eq, .step, .toolbar, .monthnav, .tabs, .seg, .empty, .drop, .group {
  background-color: var(--glass); background-image: var(--glass-grad);
  -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--line); box-shadow: var(--shadow), var(--hi);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .rc-card { background-color: var(--solid); }
  aside.side, .card, .kpi, .eq, .step, .toolbar, .monthnav, .tabs, .seg, .empty, .drop, .group, .modal, .tip, .toast { background-color: var(--solid); }
}

/* ---------------------------------------------------------------- shell */
.layout { display: flex; min-height: 100vh; }
aside.side { width: 236px; flex: 0 0 236px; margin: 14px 0 14px 14px; padding: 18px 12px 14px; border-radius: 28px; position: sticky; top: 14px; height: calc(100vh - 28px); height: calc(100dvh - 28px); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 18px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; background: linear-gradient(145deg, #2a8dff, #0142ba); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .03em; display: grid; place-items: center; box-shadow: 0 8px 20px rgba(var(--tint), .35), inset 0 1px 0 rgba(255, 255, 255, .35); }
/* the company logo (the pool mark only, no name) fills the badge */
.brand .mark { overflow: hidden; }
.brand .mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand b { display: block; font-size: 16px; line-height: 1.25; }
.brand small { display: block; color: var(--ink2); font-size: 12.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 148px; }
aside.side nav { display: flex; flex-direction: column; gap: 3px; min-height: 0; }
aside.side nav a { display: flex; align-items: center; gap: 12px; padding: 0 14px; height: 42px; border-radius: 999px; color: var(--ink); font-weight: 500; border: 1px solid transparent; transition: background-color .15s; }
aside.side nav a svg { width: 19px; height: 19px; flex: 0 0 19px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--blue-ink); }
aside.side nav a .t { flex: 1; }
aside.side nav a:hover { background: var(--raised); text-decoration: none; }
aside.side nav a.active { background: rgba(var(--tint), .62); color: #fff; font-weight: 600; border-color: rgba(255, 255, 255, .22); box-shadow: 0 8px 22px rgba(var(--tint), .30), var(--hi); }
aside.side nav a.active svg { color: #fff; }
.nav-label { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink3); padding: 14px 14px 5px; }
.badge { background: rgba(var(--r), .92); color: #fff; font-size: 12px; border-radius: 999px; padding: 1px 8px; font-weight: 700; line-height: 1.5; }
aside.side .foot { margin-top: auto; font-size: 13px; color: var(--ink2); padding: 12px 14px 2px; border-top: 1px solid var(--line2); }
aside.side .foot a { color: var(--ink2); }
.content { flex: 1; min-width: 0; }
main { max-width: 1280px; margin: 0 auto; padding: 34px 36px 90px; }
main.enter > * { animation: rise .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- type */
h1 { font-size: 34px; line-height: 1.15; letter-spacing: -.022em; font-weight: 700; margin: 0 0 20px; }
h2 { font-size: 20px; margin: 30px 0 12px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 17px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.sub { color: var(--ink2); font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.right { text-align: right; }
.muted { color: var(--ink2); }
.small { font-size: 13px; }
.green { color: var(--green); }
.red { color: var(--red); }
.amber { color: var(--orange); }
.mono { font-variant-numeric: tabular-nums; }
code { background: var(--raised); padding: 1px 6px; border-radius: 6px; font-size: 13px; }

/* ---------------------------------------------------------------- cards */
.card { border-radius: 24px; padding: 22px 24px; }
.card.flush { padding: 0; overflow: clip; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card.flush > .card-head { padding: 20px 24px 0; }
.card.flush > table th:first-child, .card.flush > table td:first-child { padding-left: 24px; }
.card.flush > table th:last-child, .card.flush > table td:last-child { padding-right: 24px; }
.card.flush > table tbody tr:last-child td { border-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { border-radius: 24px; padding: 18px 22px 16px; }
.kpi .k-label { color: var(--ink2); font-size: 13.5px; font-weight: 600; }
.kpi .k-num { font-size: 30px; font-weight: 700; letter-spacing: -.025em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .k-sub { font-size: 13px; color: var(--ink2); min-height: 20px; }
.delta { font-weight: 600; }
.delta.good { color: var(--green); }
.delta.bad { color: var(--red); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.dash-grid.stretch { align-items: stretch; }

.monthnav { display: inline-flex; align-items: center; border-radius: 999px; height: 44px; padding: 0 5px; }
.monthnav b { padding: 0 10px; min-width: 158px; text-align: center; font-weight: 600; }
.monthnav button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: none; font-size: 21px; line-height: 1; color: var(--blue-ink); display: grid; place-items: center; padding: 0 0 3px; }
.monthnav button:hover:not(:disabled) { background: var(--raised-hover); }
.monthnav button:disabled { opacity: .3; cursor: default; }

/* ---------------------------------------------------------------- charts */
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink2); }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
svg.bars { width: 100%; height: auto; display: block; }
svg.bars .grid { stroke: var(--line2); stroke-width: 1; }
svg.bars .ax { fill: var(--ink2); font-size: 12px; font-variant-numeric: tabular-nums; }
svg.bars .b-in { fill: var(--c-in); }
svg.bars .b-out { fill: var(--c-out); }
svg.bars .mcol { cursor: pointer; }
svg.bars .mcol .hit { fill: transparent; transition: fill .15s; }
svg.bars .mcol:hover .hit { fill: var(--hover); }
svg.bars .mcol.on .hit { fill: rgba(var(--tint), .16); }
svg.bars .mlabel { font-weight: 600; fill: var(--ink); font-size: 13px; }
svg.bars .net.pos { fill: var(--green); font-weight: 600; }
svg.bars .net.neg { fill: var(--red); font-weight: 600; }
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
svg.donut { width: 176px; height: 176px; }
svg.donut circle { cursor: pointer; }
svg.donut .d-total { font-size: 20px; font-weight: 700; fill: var(--ink); letter-spacing: -.02em; }
svg.donut .d-cap { font-size: 10.5px; fill: var(--ink2); }
.dl { width: 100%; }
.dl-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 40px; gap: 10px; align-items: center; padding: 8px 8px; font-size: 14px; border-radius: 12px; cursor: pointer; transition: background-color .15s; }
.dl-row:hover { background: var(--hover); }
.dl-row i { width: 10px; height: 10px; border-radius: 50%; }
.dl-row .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-row .a { font-variant-numeric: tabular-nums; font-weight: 600; }
.dl-row .p { color: var(--ink2); font-size: 13px; text-align: right; }
.tip { position: absolute; z-index: 60; background: var(--sheet); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border: 1px solid var(--line); color: var(--ink); padding: 10px 14px; border-radius: 16px; font-size: 13px; line-height: 1.6; pointer-events: none; white-space: nowrap; box-shadow: 0 12px 30px rgba(0, 0, 0, .35), var(--hi); display: none; }
.tip b { font-size: 13.5px; }
.tip .tr { display: flex; justify-content: space-between; gap: 18px; font-variant-numeric: tabular-nums; }

/* grouped rows, like the lists in iPhone Settings */
.group { border-radius: 22px; overflow: clip; }
.group-label { font-size: 12.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink3); padding: 0 18px 8px; margin-top: 26px; }
.group-label:first-child { margin-top: 0; }
.group-note { font-size: 13px; color: var(--ink2); padding: 8px 18px 0; max-width: 760px; }
.g-row { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line2); min-height: 56px; }
.g-row:last-child { border-bottom: 0; }
.g-row .lbl { font-weight: 500; }
.g-row .ctl { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.acct-ico { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px; background: rgba(var(--tint), .22); color: var(--blue-ink); display: grid; place-items: center; }
.acct-ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.g-row .nm { font-weight: 600; }
.g-row .bal { font-weight: 700; font-variant-numeric: tabular-nums; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.step { border-radius: 24px; padding: 22px 24px; }
.step .n { width: 32px; height: 32px; border-radius: 50%; background: rgba(var(--tint), .62); color: #fff; font-weight: 700; display: grid; place-items: center; margin-bottom: 12px; box-shadow: var(--hi); }
.step p { margin: 4px 0 16px; color: var(--ink2); font-size: 14px; }

/* money in - costs = profit */
.eq { display: flex; align-items: stretch; border-radius: 24px; margin-bottom: 16px; overflow: clip; }
.eq .blk { flex: 1; padding: 18px 24px; min-width: 0; }
.eq .blk .l { color: var(--ink2); font-size: 13.5px; font-weight: 600; }
.eq .blk .v { font-size: 30px; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; }
.eq .blk .h { font-size: 13px; color: var(--ink2); min-height: 20px; }
.eq .op { display: grid; place-items: center; color: var(--ink3); font-size: 24px; font-weight: 300; }
.eq .blk.total { background: rgba(var(--tint), .12); border-left: 1px solid var(--line2); }

/* ---------------------------------------------------------------- notices */
.notice { border-radius: 20px; padding: 12px 14px 12px 18px; margin: 0 0 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; border: 1px solid var(--line); background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); box-shadow: var(--hi); min-height: 60px; }
.notice.info { background: rgba(var(--tint), .16); border-color: rgba(var(--tint), .38); }
.notice.warn { background: rgba(var(--o), .14); border-color: rgba(var(--o), .38); }
.notice.bad { background: rgba(var(--r), .14); border-color: rgba(var(--r), .42); }
.notice.good { background: rgba(var(--g), .13); border-color: rgba(var(--g), .36); }

/* ---------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
th { font-size: 12.5px; color: var(--ink2); font-weight: 600; background: var(--th); position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--line); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.tx td { transition: background-color .12s; }
tr.tx:hover td { background: var(--hover); }
tr.tx.pending td { color: var(--ink2); font-style: italic; }
tr.tx.selected td { background: rgba(var(--tint), .15); }
tr.detail td { background: var(--inset); padding: 18px 24px 20px; }
table.txs { table-layout: fixed; }
table.txs td, table.txs th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.txs td { height: 62px; padding-top: 8px; padding-bottom: 8px; }
table.txs td:first-child, table.txs th:first-child, table.txs td:last-child { text-overflow: clip; }
table.txs td.desc { cursor: pointer; }
table.txs td.desc .d-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
table.txs td.desc .cp { color: var(--ink2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
table.txs td.amt { font-weight: 600; }
table.txs tr.detail td { white-space: normal; overflow: visible; height: auto; }
td.acct { font-size: 13.5px; color: var(--ink2); }
td.c-date { color: var(--ink2); font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; background: var(--hover); }
tr.grand td { font-weight: 700; font-size: 18px; border-top: 1px solid var(--line-strong); border-bottom: 0; padding-top: 16px; padding-bottom: 18px; }
tr.section td { font-weight: 600; padding-top: 20px; padding-bottom: 8px; color: var(--ink3); font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid var(--line2); }
tr.clickable { cursor: pointer; }
tr.clickable td { transition: background-color .12s; }
tr.clickable:hover td { background: var(--hover); }
td.ind { padding-left: 24px; }
.cat-chip, .pill { display: inline-block; max-width: 100%; font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--raised); color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.cat-chip.none, .pill.warn { background: rgba(var(--o), .18); color: var(--orange); }
.pill.in { background: rgba(var(--g), .18); color: var(--green); }
.pill.out { background: rgba(var(--r), .18); color: var(--red); }
.pill.blue { background: rgba(var(--tint), .2); color: var(--blue-ink); }

/* ---------------------------------------------------------------- forms */
input[type=text], input[type=search], input[type=number], input[type=date], input[type=password], select, textarea {
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background-color: var(--field); min-height: 40px; color: var(--ink); transition: border-color .15s, box-shadow .15s, background-color .15s; }
input::placeholder, textarea::placeholder { color: var(--ink3); }
select { -webkit-appearance: none; appearance: none; background-image: var(--chev); background-repeat: no-repeat; background-position: right 9px center; background-size: 18px; padding-right: 34px; cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(var(--tint), .9); box-shadow: 0 0 0 3px rgba(var(--tint), .28); }
button:focus-visible, a:focus-visible { outline: 2px solid rgba(var(--tint), .9); outline-offset: 2px; }
input[type=checkbox] { accent-color: var(--blue); }
/* square select box (blue when picked), drawn here so it looks the same in Safari on iPad and on the Mac */
input.sel { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 7px; border: 2px solid var(--line-strong); background: transparent center / 13px no-repeat; vertical-align: middle; cursor: pointer; margin: 0; transition: background-color .15s, border-color .15s; }
input.sel:checked { background-color: rgb(var(--tint)); border-color: rgb(var(--tint)); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 10.5 3.5 3.5 7.5-8'/%3E%3C/svg%3E"); }
/* round "reviewed" check */
input.rev { -webkit-appearance: none; appearance: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line-strong); background: transparent center / 15px no-repeat var(--tick); cursor: pointer; vertical-align: middle; margin: 0; transition: background-color .15s, border-color .15s, transform .15s; }
input.rev:hover { border-color: var(--green-fill); }
input.rev:active { transform: scale(.9); }
input.rev:checked { background-color: var(--green-fill); border-color: var(--green-fill); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='white' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 10.5 3.5 3.5 7.5-8'/%3E%3C/svg%3E"); }
/* on/off switch */
input.switch { -webkit-appearance: none; appearance: none; width: 50px; height: 30px; flex: 0 0 50px; border-radius: 999px; margin: 0; vertical-align: middle; cursor: pointer; background-color: var(--off); background-image: radial-gradient(circle closest-side, #fff 0 92%, transparent 96%); background-size: 26px 26px; background-repeat: no-repeat; background-position: 2px 50%; box-shadow: inset 0 0 0 1px var(--line2); transition: background-color .2s, background-position .2s cubic-bezier(.3, 1.3, .5, 1); }
input.switch:checked { background-color: var(--green-fill); background-position: 22px 50%; }
select.cat { max-width: 100%; width: 100%; }
table.txs select.cat { border-color: transparent; background-color: transparent; font-weight: 500; text-overflow: ellipsis; border-radius: 999px; padding-left: 14px; }
table.txs tr.tx:hover select.cat, table.txs select.cat:focus { border-color: var(--line); background-color: var(--raised); }
table.txs select.cat.uncat { border-color: rgba(var(--o), .55); background-color: rgba(var(--o), .16); color: var(--orange); font-weight: 600; }
textarea { width: 100%; min-height: 64px; }
label.f { display: block; font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: 4px; }
.field { display: flex; flex-direction: column; gap: 2px; }
.search { position: relative; display: block; }
.search input { padding-left: 38px; width: 210px; border-radius: 999px; }
.search svg { position: absolute; left: 13px; top: 50%; width: 17px; height: 17px; margin-top: -8.5px; stroke: var(--ink2); fill: none; stroke-width: 2; stroke-linecap: round; pointer-events: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); border-radius: 999px; padding: 0 18px; font-weight: 600; min-height: 40px; white-space: nowrap; box-shadow: var(--hi); transition: background-color .15s, transform .12s, box-shadow .15s; }
a.btn:hover { text-decoration: none; }
.btn:hover { background: var(--raised-hover); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: rgb(var(--tint)); border-color: rgba(255, 255, 255, .22); color: #fff; box-shadow: 0 8px 22px rgba(var(--tint), .32), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn.primary:hover { background: #2b95ff; }
.btn.outline { color: var(--blue-ink); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: rgba(var(--r), .16); }
.btn.small { padding: 0 13px; min-height: 32px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.block { width: 100%; }

/* segmented controls */
.tabs, .seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; }
.tabs button, .seg button { border: 1px solid transparent; background: none; border-radius: 999px; padding: 0 16px; min-height: 36px; font-weight: 600; color: var(--ink2); font-size: 14px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: background-color .15s, color .15s; }
.tabs button:hover, .seg button:hover { color: var(--ink); }
.tabs button.on, .seg button.on { background: rgba(var(--tint), .62); color: #fff; border-color: rgba(255, 255, 255, .22); box-shadow: 0 6px 16px rgba(var(--tint), .28), var(--hi); }
.tabs button .cnt { background: rgba(var(--r), .92); color: #fff; font-size: 12px; border-radius: 999px; padding: 0 8px; line-height: 1.7; font-weight: 700; }
/* floating rounded toolbar */
.toolbar { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; padding: 6px; border-radius: 26px; }
.toolbar select, .toolbar input[type=date] { border-color: transparent; background-color: transparent; border-radius: 999px; padding-left: 14px; font-weight: 500; min-height: 40px; }
.toolbar select { max-width: 210px; text-overflow: ellipsis; }
.toolbar select:hover { background-color: var(--raised); }
.toolbar .sum { white-space: nowrap; padding: 0 10px 0 6px; }
.toolbar .search input { background-color: var(--inset); border-color: transparent; }
.bulk { background: rgba(var(--tint), .30); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border: 1px solid rgba(var(--tint), .5); color: var(--ink); border-radius: 999px; padding: 7px 8px 7px 18px; display: flex; gap: 8px; align-items: center; margin-bottom: 12px; position: sticky; top: 12px; z-index: 5; box-shadow: var(--shadow), var(--hi); }
.bulk select { width: auto; border-radius: 999px; }
.empty { padding: 48px 30px; text-align: center; color: var(--ink2); border-radius: 24px; }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--sheet); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border: 1px solid var(--line); color: var(--ink); padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 80; box-shadow: 0 12px 34px rgba(0, 0, 0, .4), var(--hi); animation: pop .22s ease both; }
.toast.bad { background: rgba(var(--r), .85); color: #fff; }
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 40; }
.modal { background: var(--sheet); -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%); border: 1px solid var(--line); border-radius: 28px; padding: 26px 28px; width: 580px; max-width: 95vw; max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .5), var(--hi); animation: pop .24s cubic-bezier(.2, .8, .2, 1) both; }
.modal h2 { margin: 0 0 12px; font-size: 24px; letter-spacing: -.015em; }
.modal .field input, .modal .field select { width: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.split-line { display: grid; grid-template-columns: 1fr 140px 32px; gap: 8px; margin-bottom: 8px; align-items: center; }
.split-line input { width: 100%; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 16px; font-size: 14px; flex: 1; max-width: 640px; }
.kv .k { color: var(--ink2); font-weight: 600; font-size: 13px; padding-top: 1px; }
.drop { border-radius: 28px; padding: 50px 30px; text-align: center; color: var(--ink2); border: 1.5px dashed var(--line-strong); transition: background-color .15s, border-color .15s; }
.drop.over { border-color: rgb(var(--tint)); background-color: rgba(var(--tint), .18); }
.drop svg { width: 36px; height: 36px; stroke: var(--blue-ink); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: block; margin: 0 auto 10px; }
.drop b { color: var(--ink); font-size: 17px; }
.modal.wide { width: 860px; }
.jline { display: grid; grid-template-columns: minmax(0, 1fr) 130px 130px 30px; gap: 8px; align-items: center; margin-bottom: 8px; }
.jline select, .jline input { width: 100%; }
.jline.jhead { margin: 16px 0 6px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.clip { display: inline-block; vertical-align: -3px; margin-left: 6px; color: var(--blue-ink); }
.clip svg, .rc-chip svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rc-chip { display: inline-flex; align-items: center; gap: 2px; background: var(--raised); border: 1px solid var(--line); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 13px; max-width: 260px; }
.rc-chip a { display: inline-flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.rc-card { border-radius: 22px; overflow: clip; background-color: var(--glass); background-image: var(--glass-grad); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); border: 1px solid var(--line); box-shadow: var(--shadow), var(--hi); display: flex; flex-direction: column; }
.rc-thumb { display: block; height: 170px; background: var(--inset); overflow: hidden; }
.rc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rc-thumb:hover { text-decoration: none; }
.rc-doc { height: 100%; display: grid; place-items: center; font-weight: 700; font-size: 20px; color: var(--ink2); letter-spacing: .06em; }
.rc-body { padding: 14px 16px 16px; }
.rc-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
aside.side nav { overflow-y: auto; scrollbar-width: none; }
aside.side nav::-webkit-scrollbar { display: none; }
.sortbtn { border: 0; background: none; color: var(--ink2); padding: 3px 6px; font-size: 12px; border-radius: 8px; }
.sortbtn:hover:not(:disabled) { background: var(--raised); color: var(--ink); }
.sortbtn:disabled { opacity: .25; cursor: default; }
details > summary { cursor: pointer; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* fingers (iPad): bigger targets, and 16px fields so Safari does not zoom in when one is tapped */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn.small { min-height: 38px; padding: 0 15px; }
  input[type=text], input[type=search], input[type=number], input[type=date], input[type=password], select, textarea { min-height: 44px; font-size: 16px; }
  input.sel { width: 26px; height: 26px; border-radius: 8px; background-size: 16px; }
  input.rev { width: 38px; height: 38px; background-size: 18px; }
  .sortbtn { padding: 10px 12px; font-size: 14px; }
  aside.side nav a { height: 46px; }
  .tabs button, .seg button { min-height: 40px; }
  .monthnav { height: 50px; }
  .monthnav button { width: 40px; height: 40px; }
  .bulk select { min-height: 38px; }
}

/* ---------------------------------------------------------------- narrower screens (iPad) */
@media (max-width: 1240px) {
  main { padding: 28px 24px 80px; }
  aside.side { width: 212px; flex-basis: 212px; padding-left: 10px; padding-right: 10px; }
  aside.side nav a { padding: 0 9px 0 12px; gap: 10px; }
  .kpis { gap: 12px; }
  .kpi { padding: 16px 16px 14px; border-radius: 22px; }
  .kpi .k-num { font-size: 24px; }
  .dash-grid { gap: 12px; }
  /* the account column folds to nothing (not display:none: an open line spans all seven columns) */
  table.txs col.c-acct { width: 0 !important; }
  table.txs th.c-acct, table.txs td.c-acct { padding-left: 0; padding-right: 0; font-size: 0; }
  .toolbar select { max-width: 150px; }
  .toolbar .sum { font-size: 12.5px; }
}
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  aside.side { width: auto; flex: none; height: auto; position: static; margin: 10px; padding: 8px 10px; flex-direction: row; align-items: center; gap: 8px; overflow-x: auto; border-radius: 999px; }
  .brand { padding: 0 8px 0 0; }
  .brand .bname, .nav-label, aside.side .foot { display: none; }
  aside.side nav { flex-direction: row; }
  aside.side nav a { height: 38px; white-space: nowrap; }
  main { padding: 14px 14px 70px; }
  .dash-grid, .steps { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eq { flex-wrap: wrap; }
  .eq .op { display: none; }
  .eq .blk { flex-basis: 50%; }
  .jline { grid-template-columns: minmax(0, 1fr) 90px 90px 28px; }
}
