/* Lendora interface. Dark by default, with a light theme; every colour comes from the tokens below. */

@font-face {
  font-family: 'Inter';
  src: url('../../fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0b0b0d;
  --rail: #121315;
  --main: #0f1012;
  --card: #161719;
  --card-2: #1c1d20;
  --card-3: #232428;
  --line: rgba(255, 255, 255, .06);
  --line-2: rgba(255, 255, 255, .11);
  --text: #ececee;
  --muted: #8d8e95;
  --faint: #5f6066;
  --accent: #8e7cc3;
  --accent-soft: rgba(142, 124, 195, .16);
  --accent-text: #b9abe6;
  --gold: #b5a21c;
  --gold-soft: rgba(181, 162, 28, .16);
  --good: #5fb08f;
  --good-soft: rgba(95, 176, 143, .15);
  --bad: #e0716b;
  --bad-soft: rgba(224, 113, 107, .15);
  --warn: #d9a441;
  --warn-soft: rgba(217, 164, 65, .15);
  --info: #5b9ed9;
  --info-soft: rgba(91, 158, 217, .15);
  --on-accent: #17131f;
  --shadow: 0 24px 60px rgba(0, 0, 0, .45);
  --radius: 22px;
  --radius-sm: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

:root[data-theme='light'] {
  --bg: #e9e8ee;
  --rail: #ffffff;
  --main: #f4f3f8;
  --card: #ffffff;
  --card-2: #f1f0f6;
  --card-3: #e7e5ef;
  --line: rgba(20, 18, 40, .07);
  --line-2: rgba(20, 18, 40, .14);
  --text: #17161d;
  --muted: #6c6b76;
  --faint: #9a99a4;
  --accent: #6f5db0;
  --accent-soft: rgba(111, 93, 176, .12);
  --accent-text: #5a4999;
  --gold: #8f7f0c;
  --gold-soft: rgba(143, 127, 12, .13);
  --good: #2f8a67;
  --good-soft: rgba(47, 138, 103, .12);
  --bad: #c4443d;
  --bad-soft: rgba(196, 68, 61, .1);
  --warn: #a8741a;
  --warn-soft: rgba(168, 116, 26, .12);
  --info: #2f75b5;
  --info-soft: rgba(47, 117, 181, .12);
  --on-accent: #ffffff;
  --shadow: 0 20px 50px rgba(40, 30, 90, .14);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -.015em; line-height: 1.2; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }
.ico { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.hide { display: none !important; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 16px; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 20px; }
.mb { margin-bottom: 20px; }

/* ---------- shell ---------- */

.app { display: grid; grid-template-columns: 290px minmax(0, 1fr); min-height: 100vh; padding: 14px; gap: 14px; transition: grid-template-columns .25s var(--ease); }
.app.is-collapsed { grid-template-columns: 84px minmax(0, 1fr); }

.rail {
  position: sticky; top: 14px; height: calc(100vh - 28px);
  display: flex; flex-direction: column;
  background: var(--rail); border: 1px solid var(--line); border-radius: 28px;
  overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 24px 26px 20px; font-size: 24px; letter-spacing: -.02em; border-bottom: 1px solid var(--line); min-height: 84px; }
.brand-mark { width: 36px; height: 36px; flex: none; color: var(--text); }
.brand-name { white-space: nowrap; font-weight: 500; }

.rail-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 18px 16px; scrollbar-width: thin; scrollbar-color: var(--card-3) transparent; }
.nav { display: grid; gap: 6px; }
.nav a { display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 18px; border-radius: 16px; color: var(--muted); transition: background .18s, color .18s; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--card-2); }
.nav a.on { background: var(--card-3); color: var(--text); }
.nav .count { margin-left: auto; font-size: 12px; background: var(--accent-soft); color: var(--accent-text); border-radius: 20px; padding: 2px 9px; }

.rail-title { display: flex; align-items: center; justify-content: space-between; margin: 24px 4px 8px; padding: 18px 14px 0; border-top: 1px solid var(--line); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.rail-title button, .rail-title a { display: grid; place-items: center; width: 28px; height: 28px; border: 0; background: none; color: var(--muted); border-radius: 8px; }
.rail-title button:hover, .rail-title a:hover { color: var(--text); background: var(--card-2); }
.spaces { display: grid; gap: 2px; padding: 0 4px; }
.spaces a { display: flex; align-items: center; gap: 16px; height: 44px; padding: 0 16px; border-radius: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spaces a:hover { background: var(--card-2); }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--dot, var(--accent)); }
.spaces .none { padding: 8px 16px; font-size: 13px; color: var(--faint); }

.rail-offer { margin: 12px 16px 16px; padding: 14px; border: 1px solid var(--line); background: var(--main); border-radius: 22px; }
.rail-offer .art { height: 110px; border-radius: 14px; background: radial-gradient(circle at 70% 30%, var(--accent-soft), transparent 60%), var(--card-2); display: grid; place-items: center; overflow: hidden; margin-bottom: 14px; position: relative; }
.rail-offer .art .badge { position: absolute; left: 10px; top: 10px; }
.rail-offer h4 { font-size: 20px; margin-bottom: 4px; }
.rail-offer p { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; line-height: 1.45; }
.rail-offer .price { font-size: 22px; margin-bottom: 12px; }
.rail-offer .price small { font-size: 12px; color: var(--muted); }

.rail-foot { display: none; padding: 16px; border-top: 1px solid var(--line); }

/* collapsed rail: icons only */
.is-collapsed .brand { padding-inline: 0; justify-content: center; }
.is-collapsed .brand-name, .is-collapsed .nav a span, .is-collapsed .nav .count, .is-collapsed .spaces a span, .is-collapsed .rail-offer, .is-collapsed .rail-title span, .is-collapsed .spaces .none { display: none; }
.is-collapsed .nav a, .is-collapsed .spaces a { justify-content: center; padding: 0; }
.is-collapsed .rail-title { justify-content: center; padding-inline: 0; }
.is-collapsed .rail-title button, .is-collapsed .rail-title a { display: none; }
.is-collapsed .rail-foot { display: block; }

.scrim { display: none; }

.canvas { min-width: 0; background: var(--main); border: 1px solid var(--line); border-radius: 28px; padding: 28px 34px 40px; }

.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.topbar h1 { font-size: 34px; font-weight: 400; letter-spacing: -.025em; }
.topbar .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.topbar .tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }

.search { position: relative; }
.search input { width: 300px; height: 52px; border: 1px solid var(--line); background: var(--card-2); border-radius: 26px; padding: 0 18px 0 52px; outline: none; transition: border-color .15s, width .2s; }
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--accent); width: 340px; }
.search .ico { position: absolute; left: 18px; top: 16px; color: var(--muted); }
.search-results { position: absolute; right: 0; top: 60px; width: 380px; z-index: 30; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); padding: 8px; display: none; }
.search-results.open { display: block; }
.search-results a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; }
.search-results a:hover { background: var(--card-3); }
.search-results .none { padding: 14px; color: var(--muted); font-size: 14px; }

.icon-btn { position: relative; display: grid; place-items: center; width: 50px; height: 50px; border: 1px solid var(--line); background: var(--card-2); color: var(--muted); border-radius: 50%; transition: color .15s, background .15s; }
.icon-btn:hover { color: var(--text); background: var(--card-3); }
.icon-btn .pip { position: absolute; top: 12px; right: 13px; min-width: 9px; height: 9px; border-radius: 9px; background: var(--gold); border: 2px solid var(--card-2); }

.avatar { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--card-3); color: var(--text); font-weight: 600; font-size: 15px; overflow: hidden; border: 2px solid var(--line-2); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 36px; height: 36px; font-size: 12px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }

/* popups */
.pop { position: relative; }
.pop-menu { position: absolute; z-index: 40; min-width: 270px; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--shadow); padding: 18px; display: none; }
.pop.open > .pop-menu { display: block; }
.pop-menu.right { right: 0; top: calc(100% + 10px); }
.pop-menu.up { left: 0; bottom: calc(100% + 12px); }
.pop-menu .who { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.pop-menu .who b { display: block; font-weight: 500; font-size: 18px; }
.pop-menu .who span { color: var(--muted); font-size: 13px; }
.pop-menu .item { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 11px 4px; border: 0; background: none; font-size: 16px; text-align: left; color: var(--text); }
.pop-menu .item:hover { color: var(--accent-text); }
.pop-menu .item .ico { width: 16px; height: 16px; color: var(--muted); }
.pop-menu hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.pop-menu .note { padding: 8px 4px 2px; color: var(--gold); font-size: 15px; display: flex; justify-content: space-between; align-items: center; }

/* ---------- cards ---------- */

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.card-head h2, .card-head h3 { font-size: 24px; font-weight: 400; }
.card-head .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.split.wide { grid-template-columns: minmax(0, 1fr) 420px; }

.stat { display: flex; flex-direction: column; gap: 12px; }
.stat .label { color: var(--muted); font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stat .value { font-size: 40px; font-weight: 500; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .foot { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px 16px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 6px; }
.stat .foot .glyph { display: grid; place-items: center; width: 58px; height: 58px; flex: none; border-radius: 18px; background: var(--gold); color: #1a1706; }
.stat .foot .glyph.violet { background: var(--accent); color: var(--on-accent); }
.stat .foot .glyph .ico { width: 26px; height: 26px; }
.stat .foot b { display: block; font-weight: 400; font-size: 15px; }
.stat .foot p { margin: 2px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.stat .foot .btn { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 1500px) { .stat .foot { grid-template-columns: auto minmax(0, 1fr) auto; } .stat .foot .btn { grid-column: auto; } }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 11px; border-radius: 20px; background: var(--card-3); color: var(--muted); white-space: nowrap; }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.badge.violet { background: var(--accent-soft); color: var(--accent-text); }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge .ico { width: 13px; height: 13px; }

/* ---------- buttons ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 14px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font-size: 15px; font-weight: 500; transition: background .15s, border-color .15s, transform .15s, opacity .15s; white-space: nowrap; }
.btn:hover { background: var(--card-2); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1a1706; }
.btn.danger { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.btn.quiet { border-color: transparent; background: var(--card-2); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.link { color: var(--accent-text); }
.link:hover { text-decoration: underline; }

/* ---------- forms ---------- */

.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field > label, .label { font-size: 13.5px; color: var(--muted); }
.field .hint { font-size: 12.5px; color: var(--faint); }
.field .err { font-size: 13px; color: var(--bad); }
.input, select.input, textarea.input, .field input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']), .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 0 16px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); border-radius: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea, .field textarea { padding: 14px 16px; min-height: 110px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field input[type='file'] { padding: 12px; border: 1px dashed var(--line-2); border-radius: 14px; width: 100%; background: var(--card-2); }
.field select, select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238d8e95' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 44px; }
.field .check, .check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); }
.check input { margin-top: 3px; accent-color: var(--accent); width: 17px; height: 17px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.fields .full { grid-column: 1 / -1; }
input[type='range'] { width: 100%; accent-color: var(--accent); height: 28px; }
.input-affix { position: relative; }
.input-affix > span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-affix input { padding-left: 38px !important; }
.hp { position: absolute; left: -9999px; }

.alert { display: flex; gap: 12px; padding: 14px 18px; border-radius: 16px; margin-bottom: 18px; font-size: 14.5px; line-height: 1.5; background: var(--card-2); border: 1px solid var(--line); }
.alert .ico { margin-top: 2px; }
.alert.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.alert.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.alert.info { background: var(--info-soft); color: var(--info); border-color: transparent; }

/* ---------- tables and lists ---------- */

.table-wrap { overflow-x: auto; }
.table th { text-align: left; font-weight: 400; font-size: 13px; color: var(--muted); padding: 0 16px 14px; white-space: nowrap; }
.table td { padding: 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr.click { cursor: pointer; }
.table tbody tr.click:hover td { background: var(--card-2); }
.table th.r, .table td.r { text-align: right; }
.table.compact th, .table.compact td { padding-left: 10px; padding-right: 10px; }
.table.compact td { padding-top: 12px; padding-bottom: 12px; }

.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.tile { display: grid; place-items: center; width: 54px; height: 54px; flex: none; border-radius: 16px; background: var(--card-3); color: var(--text); }
.tile .ico { width: 24px; height: 24px; }
.tile.violet { background: var(--accent-soft); color: var(--accent-text); }
.tile.gold { background: var(--gold-soft); color: var(--gold); }
.tile.good { background: var(--good-soft); color: var(--good); }
.tile.bad { background: var(--bad-soft); color: var(--bad); }
.list-row .title { font-size: 18px; font-weight: 400; }
.list-row .meta { color: var(--muted); font-size: 13px; }
.list-row .amount { font-size: 18px; font-variant-numeric: tabular-nums; }
.pill-date { background: var(--accent-soft); color: var(--accent-text); border-radius: 20px; padding: 5px 14px; font-size: 14px; }

.progress { height: 6px; border-radius: 6px; background: var(--card-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 6px; background: var(--bar, var(--accent)); }
.steps { display: flex; gap: 8px; margin-bottom: 26px; }
.steps div { flex: 1; padding-top: 12px; border-top: 3px solid var(--card-3); font-size: 13px; color: var(--faint); }
.steps div.done { border-color: var(--accent); color: var(--muted); }
.steps div.now { border-color: var(--accent); color: var(--text); }

.tabs { display: flex; gap: 6px; padding: 5px; background: var(--card-2); border-radius: 16px; width: fit-content; max-width: 100%; overflow-x: auto; margin-bottom: 22px; }
.tabs a, .tabs button { padding: 9px 18px; border-radius: 12px; border: 0; background: none; color: var(--muted); font-size: 14.5px; white-space: nowrap; }
.tabs a.on, .tabs button.on { background: var(--card-3); color: var(--text); }

.kv { display: grid; gap: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.kv > div:first-child { border-top: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { text-align: right; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .ico { width: 36px; height: 36px; margin: 0 auto 12px; color: var(--faint); }
.empty h3 { color: var(--text); font-weight: 400; margin-bottom: 6px; font-size: 20px; }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 22px; }
.pager a, .pager span { min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 12px; border-radius: 11px; background: var(--card-2); color: var(--muted); font-size: 14px; }
.pager .on { background: var(--accent); color: var(--on-accent); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.filters .input, .filters select { min-height: 44px; width: auto; border-radius: 12px; }

/* ---------- loan card and charts ---------- */

.loan-card { position: relative; overflow: hidden; border-radius: 22px; padding: 24px; min-height: 210px; background: var(--c, var(--gold)); color: #17140a; display: flex; flex-direction: column; justify-content: space-between; }
.loan-card::before, .loan-card::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.loan-card::before { width: 170px; height: 170px; right: -50px; bottom: -70px; }
.loan-card::after { width: 110px; height: 110px; right: 40px; bottom: -60px; background: rgba(0, 0, 0, .08); }
.loan-card .top { display: flex; justify-content: space-between; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; position: relative; }
.loan-card .no { letter-spacing: .25em; font-size: 15px; position: relative; }
.loan-card .bal small { display: block; font-size: 13px; opacity: .75; }
.loan-card .bal b { font-size: 34px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; position: relative; }
.loan-card.violet { color: #14101d; }
.loan-card.light { color: #17161d; }
.dots { display: flex; gap: 6px; margin-top: 14px; }
.dots i { width: 8px; height: 8px; border-radius: 8px; background: var(--card-3); transition: width .2s; }
.dots i.on { width: 30px; background: var(--faint); }
.carousel { position: relative; }
.carousel-track { display: grid; }
.carousel-track > * { grid-area: 1 / 1; opacity: 0; pointer-events: none; transition: opacity .3s; }
.carousel-track > .on { opacity: 1; pointer-events: auto; }

.chart { position: relative; width: 100%; min-height: 220px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 12.5px; }
.chart .grid line { stroke: var(--line); stroke-dasharray: 3 5; }
.chart .tip { position: absolute; pointer-events: none; z-index: 5; background: var(--card-3); border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 11px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -120%); opacity: 0; transition: opacity .12s; }
.chart .tip b { display: block; font-size: 14px; font-weight: 500; }
.chart .tip.on { opacity: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 4px; margin-right: 7px; background: var(--c); }
.donut { display: grid; place-items: center; position: relative; }
.donut .mid { position: absolute; text-align: center; }
.donut .mid b { display: block; font-size: 26px; font-weight: 500; }
.donut .mid span { font-size: 13px; color: var(--muted); }

.goal { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card-2); }
.goal + .goal { margin-top: 10px; }
.goal .meta { flex: 1; min-width: 0; }
.goal .meta b { font-weight: 400; font-size: 17px; display: block; }
.goal .meta span { color: var(--muted); font-size: 13px; }
.goal .progress { margin-top: 10px; }

/* ---------- auth and public layouts ---------- */

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.auth-art { position: relative; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(900px 500px at 15% 10%, var(--accent-soft), transparent 60%), radial-gradient(700px 500px at 90% 95%, var(--gold-soft), transparent 60%), var(--rail); border-right: 1px solid var(--line); overflow: hidden; }
.auth-art h1 { font-size: 52px; line-height: 1.04; letter-spacing: -.035em; font-weight: 400; max-width: 560px; margin-bottom: 18px; }
.auth-art h1 em { font-style: normal; color: var(--accent-text); }
.auth-art p { color: var(--muted); max-width: 460px; font-size: 17px; }
.auth-points { display: grid; gap: 14px; margin-top: 34px; }
.auth-points div { display: flex; align-items: center; gap: 14px; color: var(--text); }
.auth-points .tile { width: 44px; height: 44px; border-radius: 14px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 28px; background: var(--main); }
.auth-box { width: 100%; max-width: 440px; }
.auth-box h2 { font-size: 34px; font-weight: 400; margin-bottom: 8px; }
.auth-box .lead { color: var(--muted); margin-bottom: 28px; }
.auth-box .alt { margin-top: 22px; color: var(--muted); text-align: center; font-size: 14.5px; }

.site-head { position: sticky; top: 0; z-index: 30; backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 28px; height: 78px; }
.site-head nav { display: flex; gap: 6px; margin-left: 20px; }
.site-head nav a { padding: 9px 16px; border-radius: 12px; color: var(--muted); font-size: 15px; }
.site-head nav a:hover, .site-head nav a.on { color: var(--text); background: var(--card-2); }
.site-head .tools { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.hero { padding: 88px 0 64px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(40px, 5.4vw, 70px); line-height: 1.02; letter-spacing: -.04em; font-weight: 400; margin-bottom: 22px; }
.hero h1 em { font-style: normal; color: var(--accent-text); }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 540px; margin-bottom: 32px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.section { padding-block: 64px; }
.section h2 { font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -.03em; font-weight: 400; margin-bottom: 14px; }
.section .lead { color: var(--muted); max-width: 640px; font-size: 17px; margin-bottom: 36px; }
.feature { padding: 26px; }
.feature .tile { margin-bottom: 18px; }
.feature h3 { font-size: 21px; margin-bottom: 8px; font-weight: 400; }
.feature p { color: var(--muted); margin: 0; font-size: 15px; }
.site-foot { border-top: 1px solid var(--line); padding: 44px 0; color: var(--muted); font-size: 14px; }
.site-foot .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.site-foot h4 { color: var(--text); font-weight: 500; font-size: 14px; margin-bottom: 12px; }
.site-foot a { display: block; padding: 4px 0; }
.site-foot a:hover { color: var(--text); }
.disclosure { font-size: 12.5px; color: var(--faint); border-top: 1px solid var(--line); margin-top: 32px; padding-top: 20px; }

.calc { padding: 30px; }
.calc .out { display: grid; gap: 0; margin-top: 18px; }
.calc .big { font-size: 46px; letter-spacing: -.03em; font-weight: 500; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }

.chat { display: flex; flex-direction: column; gap: 12px; max-height: 520px; overflow-y: auto; padding: 4px 2px 12px; }
.bubble { max-width: 82%; padding: 12px 16px; border-radius: 18px; background: var(--card-2); border: 1px solid var(--line); white-space: pre-wrap; line-height: 1.55; font-size: 15px; }
.bubble.me { align-self: flex-end; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chat-form { display: flex; gap: 10px; margin-top: 12px; }
.chat-form input { flex: 1; min-height: 52px; border-radius: 26px; padding: 0 22px; border: 1px solid var(--line-2); background: var(--card-2); outline: none; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 80; background: var(--card-3); border: 1px solid var(--line-2); border-radius: 16px; padding: 14px 20px; box-shadow: var(--shadow); animation: rise .3s var(--ease); }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .split.wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .app, .app.is-collapsed { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; }
  .rail { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; height: auto; width: 296px; border-radius: 0 28px 28px 0; transform: translateX(-105%); transition: transform .25s var(--ease); }
  .app.drawer .rail { transform: none; }
  .app.is-collapsed .brand-name, .app.is-collapsed .nav a span, .app.is-collapsed .spaces a span, .app.is-collapsed .rail-title span { display: inline; }
  .app.is-collapsed .nav a, .app.is-collapsed .spaces a { justify-content: flex-start; padding: 0 18px; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 55; }
  .app.drawer .scrim { display: block; }
  .canvas { border-radius: 0; border: 0; padding: 20px 18px 40px; }
  .menu-btn { display: grid; }
  .topbar { flex-wrap: wrap; }
  .topbar h1 { font-size: 26px; }
  .search input, .search input:focus { width: 100%; }
  .search { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 48px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .site-head nav { display: none; }
  .site-foot .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .g2, .g3, .g4, .fields { grid-template-columns: minmax(0, 1fr); }
  .stat .value { font-size: 32px; }
  .stat .foot { flex-wrap: wrap; }
  .stat .foot .btn { margin-left: 0; }
  .card { padding: 20px; border-radius: 20px; }
  .table th, .table td { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .rail, .topbar .tools, .btn, .tabs { display: none !important; } .app { display: block; padding: 0; } .canvas { border: 0; padding: 0; background: #fff; color: #000; } }

/* Payment gateways in Settings: one collapsible row each, so a long list stays easy to scan */
.gateway { border-top: 1px solid var(--line); }
.gateway > summary { display: flex; align-items: center; gap: 14px; padding: 14px 0; cursor: pointer; list-style: none; }
.gateway > summary::-webkit-details-marker { display: none; }
.gateway > summary::after { content: ""; width: 8px; height: 8px; margin-left: 4px; border: solid var(--muted, currentColor); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; opacity: .6; }
.gateway[open] > summary::after { transform: rotate(-135deg); }
.gateway-body { padding: 4px 0 20px 54px; }
@media (max-width: 640px) { .gateway-body { padding-left: 0; } }
