/* Bank Accounting Service portal */

:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --brand: #0f6e66;
  --brand-hover: #0b5852;
  --brand-soft: #e7f3f1;
  --success: #15803d;
  --success-soft: #e7f6ec;
  --warning: #a16207;
  --warning-soft: #fdf6e3;
  --danger: #b91c1c;
  --danger-soft: #fdecec;
  --info: #1d4ed8;
  --info-soft: #eaf0fe;
  --neutral: #475569;
  --neutral-soft: #eef2f6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --chart-in: #0f6e66;
  --chart-out: #94a3b8;
  --chart-cash: #1d4ed8;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 0.25rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
h3 { font-size: 0.98rem; margin: 0 0 0.6rem; }
p { margin: 0 0 0.75rem; }
.muted { color: var(--muted); }
.small { font-size: 0.84rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.in { color: var(--success); }
.negative { color: var(--danger); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Top bar ---- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar__inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  background:
    linear-gradient(to top, #fff 0 0) 6px 15px / 3px 6px no-repeat,
    linear-gradient(to top, #fff 0 0) 11.5px 11px / 3px 10px no-repeat,
    linear-gradient(to top, #fff 0 0) 17px 7px / 3px 14px no-repeat,
    linear-gradient(135deg, var(--brand), #16a394);
}
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--ink-2); padding: 7px 12px; border-radius: 8px; font-weight: 500; font-size: 0.94rem; white-space: nowrap; }
.nav a:hover { background: var(--neutral-soft); text-decoration: none; }
.nav a.is-active { color: var(--brand); background: var(--brand-soft); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 0.72rem; line-height: 18px; text-align: center; }
.usermenu { display: flex; align-items: center; gap: 12px; margin-left: auto; font-size: 0.9rem; color: var(--ink-2); }
.usermenu form { margin: 0; }
.usermenu__client { font-weight: 600; }
.switcher select { padding: 5px 8px; font-size: 0.88rem; width: auto; }

/* ---- Page ---- */
.page { max-width: 1200px; margin: 0 auto; padding: 28px 20px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 0.2rem 0 0; color: var(--muted); }
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 8px 20px 32px; }
.narrow { max-width: 760px; }
.narrow-card { max-width: 820px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 12px; }
.section-title h2 { margin: 0; }

/* ---- Cards and layout ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.page > .card + .card, .page > .card + .grid, .page > .grid + .card, .page > .grid + .grid, .page > .callout + .grid, .page > .kpis + .callout { margin-top: 20px; }
.stack > * + * { margin-top: 20px; }
.card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.card__head h2 { margin: 0; }
.grid { display: grid; gap: 20px; }
.grid + .grid, .grid + .card, .card + .grid { margin-top: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
.subform { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.spaced { margin-top: 14px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: none; }

.next-step { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.next-step__body { flex: 1; min-width: 240px; }
.next-step h2 { margin-bottom: 0.25rem; }
.submit-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.submit-card > div { flex: 1; min-width: 220px; }
.submit-card h2 { margin-bottom: 0.25rem; }
.submit-card p { margin: 0; }

/* ---- KPI tiles ---- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpis--compact { margin-bottom: 14px; }
.kpis--compact .kpi { box-shadow: none; background: var(--bg); padding: 12px 14px; }
.kpi__label { font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 650; }
.kpi__value { font-size: 1.5rem; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpis--compact .kpi__value { font-size: 1.2rem; }
.kpi__meta { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th.num { text-align: right; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tfoot td { font-weight: 650; border-top: 2px solid var(--line-2); padding-top: 10px; }
.table--compact td { padding: 7px 8px; }
.bar-cell { width: 35%; }
.txn-table select { min-width: 210px; padding: 6px 8px; font-size: 0.86rem; }
.txn-table input[type="text"] { min-width: 120px; padding: 6px 8px; font-size: 0.86rem; }
.txn-desc { max-width: 360px; }
.txn-desc small { display: block; color: var(--muted); }

/* ---- Badges & tags ---- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 650; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--lg { font-size: 0.86rem; padding: 4px 12px; }
.badge--success { color: var(--success); background: var(--success-soft); }
.badge--warning { color: var(--warning); background: var(--warning-soft); }
.badge--danger { color: var(--danger); background: var(--danger-soft); }
.badge--info { color: var(--info); background: var(--info-soft); }
.badge--neutral { color: var(--neutral); background: var(--neutral-soft); }
.tag { font-size: 0.72rem; padding: 1px 7px; border-radius: 4px; background: var(--neutral-soft); color: var(--neutral); font-weight: 650; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 0.92rem; font-weight: 600;
  line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--neutral-soft); text-decoration: none; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-hover); }
.btn--danger { color: var(--danger); border-color: #f1c4c4; }
.btn--danger:hover { background: var(--danger-soft); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--sm { padding: 5px 10px; font-size: 0.82rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.stack form + form, aside form + form, aside .btn--block + form, aside form + .btn--block { margin-top: 10px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions--end { justify-content: flex-end; }
.inline-form { display: inline; margin: 0; }
.inline-details { display: inline-block; position: relative; }
.inline-details summary { list-style: none; }
.inline-details summary::-webkit-details-marker { display: none; }
.inline-details[open] form { position: absolute; right: 0; top: 34px; z-index: 5; width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12); text-align: left; }
.segmented { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.segmented a { padding: 7px 14px; font-size: 0.88rem; color: var(--ink-2); font-weight: 500; }
.segmented a + a { border-left: 1px solid var(--line-2); }
.segmented a.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.segmented a:hover { text-decoration: none; }

/* ---- Forms ---- */
.form-stack > div, .form-stack > fieldset { margin-bottom: 14px; }
.form-stack label, .form-row label { display: block; font-weight: 600; font-size: 0.86rem; margin-bottom: 5px; color: var(--ink-2); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"],
input[type="file"], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px;
  font: inherit; font-size: 0.95rem; color: var(--ink); background: #fff;
}
input[type="file"] { padding: 7px; background: var(--bg); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(15, 110, 102, 0.25); border-color: var(--brand); }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brand); }
.helptext { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.helptext ul { margin: 4px 0 0; padding-left: 18px; }
.errorlist { list-style: none; margin: 4px 0 0; padding: 0; color: var(--danger); font-size: 0.85rem; }
.errorlist.nonfield { background: var(--danger-soft); padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; }
.form-stack > div:has(> input[type="checkbox"]) { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.form-stack > div:has(> input[type="checkbox"]) label { margin: 0; font-weight: 500; }
.form-stack > div:has(> input[type="checkbox"]) .helptext { width: 100%; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: start; margin-bottom: 12px; }
.form-row > div { margin-bottom: 0; }
.form-inline { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.form-inline > div { margin: 0; min-width: 220px; }
.formats { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-2); }
.formats ul { margin: 6px 0 0; padding-left: 18px; }
.formats li { margin-bottom: 3px; }

/* ---- Flash messages & callouts ---- */
.flashes { display: grid; gap: 8px; margin-bottom: 18px; }
.flash { padding: 11px 14px; border-radius: 8px; border: 1px solid; font-size: 0.92rem; }
.flash--success { color: var(--success); background: var(--success-soft); border-color: #bfe3cb; }
.flash--error { color: var(--danger); background: var(--danger-soft); border-color: #f1c4c4; }
.flash--warning { color: var(--warning); background: var(--warning-soft); border-color: #f0dca8; }
.flash--info { color: var(--info); background: var(--info-soft); border-color: #c9d8fb; }
.callout { border-radius: var(--radius); padding: 12px 16px; border: 1px solid; margin: 14px 0; font-size: 0.92rem; }
.callout--warning { color: #7c4a03; background: var(--warning-soft); border-color: #f0dca8; }
.callout--info { color: var(--ink-2); background: var(--info-soft); border-color: #c9d8fb; }

/* ---- Checklist & progress ---- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: none; }
.checklist__label { flex: 1; }
.check { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; }
.check--done { background: var(--success); border-color: var(--success); }
.check--done::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.checklist-details { margin-top: 14px; }
.checklist-details summary { cursor: pointer; color: var(--muted); font-size: 0.88rem; }
.progress { height: 8px; background: var(--neutral-soft); border-radius: 99px; overflow: hidden; margin-top: 8px; max-width: 420px; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.bar { height: 8px; background: var(--neutral-soft); border-radius: 99px; overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* ---- Charts ---- */
.charts h3 { margin-bottom: 10px; }
.chart { position: relative; height: 250px; }

/* ---- Messages ---- */
.thread { display: flex; flex-direction: column; gap: 12px; max-height: 520px; overflow-y: auto; margin-bottom: 20px; padding-right: 4px; }
.msg { max-width: 78%; align-self: flex-start; padding: 10px 14px; border-radius: 12px; background: var(--neutral-soft); }
.msg--mine { align-self: flex-end; background: var(--brand-soft); }
.msg__meta { font-size: 0.75rem; color: var(--muted); margin-bottom: 3px; }

/* ---- Statement review ---- */
.sticky-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 0 0; margin-top: 8px; background: var(--surface); border-top: 1px solid var(--line); }
.balance-check { text-align: right; }
dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; font-size: 0.92rem; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; }
details summary { cursor: pointer; }
.steps { padding-left: 20px; margin: 0 0 16px; }
.steps li { margin-bottom: 8px; }

/* ---- Sign-in pages ---- */
body.auth-page { background: linear-gradient(180deg, #e9f3f1 0%, var(--bg) 340px); }
.auth { max-width: 460px; margin: 32px auto 0; }
.auth__card { padding: 32px; }
.auth__card h1 { font-size: 1.4rem; }
.auth__links { margin-top: 16px; text-align: center; font-size: 0.9rem; }
.auth__note { margin-top: 16px; text-align: center; color: var(--muted); font-size: 0.82rem; }
.qr { display: flex; justify-content: center; margin: 12px 0; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.qr svg { width: 200px; height: 200px; }
.secret { font-family: var(--mono); letter-spacing: 0.08em; background: var(--neutral-soft); padding: 6px 10px; border-radius: 6px; word-break: break-all; }
.codes { list-style: none; margin: 16px 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: var(--mono); font-size: 1.02rem; }
.codes li { background: var(--neutral-soft); padding: 8px; border-radius: 6px; text-align: center; }
.prose h2 { margin-top: 18px; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 20px; }

/* ---- Empty states ---- */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty h1, .empty h2 { color: var(--ink); }

/* ---- Small screens ---- */
@media (max-width: 1100px) {
  .grid--main { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .topbar__inner { gap: 16px; }
  .usermenu__client, .usermenu__name { display: none; }
}
@media (max-width: 900px) {
  .grid--2, .grid--main { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .topbar__inner { height: auto; flex-wrap: wrap; gap: 8px 16px; padding: 10px 16px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .usermenu__name { display: none; }
  .page { padding: 20px 16px 40px; }
  .card { padding: 16px; }
  .auth__card { padding: 22px; }
  .msg { max-width: 92%; }
}
