:root {
    color-scheme: light;
    font-family: 'Instrument Sans', system-ui, sans-serif;
    color: #1b2927;
    background: #f3f5f2;
    --line: #dbe4df;
    --muted: #51635e;
    --green: #17634e;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--green); text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid #247c66; outline-offset: 3px; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.top { background: #fff; border-bottom: 1px solid var(--line); }
.bar, .heading, .filter, .pager { display: flex; align-items: center; gap: 12px; }
.bar, .heading { justify-content: space-between; }
.bar { min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-weight: 750; }
.brand span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #194f41; color: white; }
main.shell { padding: 34px 0 48px; }
h1 { font-size: clamp(1.65rem, 4vw, 2.35rem); letter-spacing: -.045em; margin: 0; line-height: 1.15; }
h2 { font-size: 1.18rem; margin: 0 0 20px; }
.heading { margin-bottom: 24px; flex-wrap: wrap; }
.summary, .columns { display: grid; gap: 16px; }
.summary { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.columns { grid-template-columns: minmax(0, 1fr) minmax(310px, .48fr); align-items: start; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; min-width: 0; }
.summary span, .filter label, small, .empty { color: var(--muted); }
.summary strong { display: block; margin-top: 8px; font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.04em; overflow-wrap: anywhere; }
.net { background: #194f41; color: #fff; border-color: #194f41; }
.net span { color: #daede6; }
.income { color: var(--green); }
.expense { color: #9e442c; }
.count { margin-left: .35rem; color: var(--muted); font-weight: 500; font-size: .85em; }
.fields, label { display: grid; gap: 7px; }
.fields { gap: 14px; }
label { font-size: .9rem; font-weight: 650; min-width: 0; }
input, select, textarea, button { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-width: 0; }
input, select, textarea { width: 100%; background: #fbfcfb; color: inherit; }
textarea { resize: vertical; }
.quiet { background: #fff; color: inherit; white-space: nowrap; }
.primary { background: var(--green); color: #fff; font-weight: 700; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .91rem; }
th, td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td:first-child, .amount { white-space: nowrap; }
td strong, small { display: block; overflow-wrap: anywhere; }
small { margin-top: 4px; }
.amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.empty { padding: 20px 0; }
.pager { margin-top: 16px; }
.login { max-width: 480px; margin: 24px auto; }
.login h1 { margin: 12px 0 24px; }
.notice { border-radius: 8px; padding: 12px 16px; background: #dbeee3; }
.error { background: #f9e5df; color: #823721; padding-left: 36px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 780px) {
    .columns { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
    .shell { width: calc(100% - 28px); }
    .summary { grid-template-columns: 1fr; gap: 8px; }
    .card { padding: 16px; }
}

.module-nav { background: #fff; border-bottom: 1px solid var(--line); }
.module-nav .shell { display: flex; gap: 22px; overflow-x: auto; }
.module-nav a {
    flex: 0 0 auto;
    padding: 13px 2px 10px;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    font-weight: 650;
    text-decoration: none;
}
.module-nav a[aria-current="page"] { border-color: var(--green); color: var(--green); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.button { display: inline-flex; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.form-width { max-width: 560px; }
.movement { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.document-meta, .document-line { display: grid; gap: 12px; }
.document-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.document-lines { border-top: 1px solid var(--line); }
.document-line { grid-template-columns: minmax(0, 2fr) minmax(0, .65fr) minmax(0, 1fr) minmax(0, .65fr) auto; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--line); }
.document-meta dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.document-meta dt { color: var(--muted); }
.document-totals { display: grid; grid-template-columns: auto auto; justify-content: end; gap: 8px 18px; }
.document-totals dd { margin: 0; text-align: right; }
.document-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
button:disabled { opacity: .5; cursor: default; }
@media (max-width: 700px) {
    .document-meta { grid-template-columns: 1fr; }
    .document-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .document-line label:first-child { grid-column: 1 / -1; }
}
@media print {
    body { background: white; color: black; }
    .top, .module-nav, .document-toolbar, .notice { display: none; }
    main.shell { width: auto; padding: 0; }
    .document-paper { border: 0; padding: 0; }
    .document-paper .scroll { overflow: visible; }
    .document-paper tr { break-inside: avoid; }
}
