:root {
  color-scheme: light;
  --paper: #f8f8f3;
  --white: #fff;
  --ink: #1d2b26;
  --muted: #53655d;
  --pine: #18392f;
  --mint: #e5efe6;
  --border: #dce4dc;
  --soft: #eef1ea;
  --amber: #f6ecda;
  --danger: #a43f31;
  --shadow: 0 8px 24px #283d2e08;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 15px/1.55 system-ui, -apple-system, 'Segoe UI', sans-serif;
}
a { color: var(--pine); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid #58916a; outline-offset: 3px; }
.header { color: #fff; background: var(--pine); }
.header-inner {
  max-width: 1240px;
  min-height: 66px;
  margin: auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 25px;
}
.header a { color: #fff; text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; font-weight: 700; }
.brand-logo { display: block; width: 38px; height: 38px; object-fit: contain; flex-shrink: 0; }
.nav { display: flex; gap: 5px; flex-wrap: wrap; }
.nav a, .logout { display: inline-block; padding: 6px 9px; border-radius: 6px; }
.nav a[aria-current="page"], .nav a:hover, .logout:hover { background: #2f5145; }
.account { margin-left: auto; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.account-name { color: #e4f1e9; font-size: .86rem; }
.account-full {
  display: block;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-short { display: none; }
.environment {
  padding: 1px 5px;
  border: 1px solid #a2bbad;
  border-radius: 4px;
  color: #f0f4e9;
  margin-left: -12px;
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .08em;
}
.logout { background: transparent; border: 0; color: #fff; cursor: pointer; }
.main { max-width: 1240px; margin: auto; padding: 32px 24px 48px; }
h1, h2, h3, p { margin: 0; }
h1, .balance { font-family: Georgia, 'Times New Roman', serif; font-weight: 500; letter-spacing: -.035em; line-height: 1.1; }
h1 { font-size: clamp(2.05rem, 4.5vw, 3.1rem); }
h2 { font-size: 1.24rem; letter-spacing: -.025em; line-height: 1.25; }
h3 { font-size: 1rem; }
.heading { margin-bottom: 22px; display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.heading p, .muted { color: var(--muted); }
.heading p { margin-top: 7px; }
.stack { display: grid; gap: 18px; }
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.section-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.section-title p { width: 100%; }
.hero { background: var(--mint); border-color: #cfdece; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.hero .balance { font-size: clamp(2.25rem, 5vw, 3.7rem); margin: 5px 0; }
.number { font-variant-numeric: tabular-nums; white-space: nowrap; }
.positive { color: #245b3c; }
.negative { color: var(--danger); }
.caption { color: var(--muted); font-size: .88rem; }
.layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); align-items: start; gap: 18px; }
.layout > * { min-width: 0; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 13px;
  background: var(--white);
  color: var(--pine);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.button:hover { background: var(--soft); }
.button-primary { background: var(--pine); color: #fff; border-color: var(--pine); }
.button-primary:hover { background: #2f5145; }
.button-small { min-height: 35px; padding: 5px 9px; font-size: .86rem; }
.button-danger { color: var(--danger); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { background: transparent; border-color: transparent; }
.tab.selected { background: var(--mint); border-color: #cfdece; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span { grid-column: 1 / -1; }
label { display: grid; gap: 4px; font-weight: 650; font-size: .9rem; }
label small { color: var(--muted); font-weight: 400; }
input, textarea, select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  display: block;
  color: var(--ink);
  background: #fff;
  border: 1px solid #bbc8bf;
  border-radius: 8px;
  padding: 7px 9px;
}
input[type="file"] { min-height: auto; }
textarea { resize: vertical; min-height: 74px; }
fieldset { border: 1px solid var(--border); border-radius: 9px; margin: 0; padding: 12px; min-width: 0; }
legend { padding: 0 5px; font-weight: 650; font-size: .9rem; }
fieldset.form-grid { align-items: center; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); align-items: end; gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.stat { border-radius: 9px; padding: 12px; background: var(--soft); }
.stat strong { display: block; margin-top: 3px; font-size: clamp(.99rem, 2.1vw, 1.3rem); }
.stat-total { background: var(--mint); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
thead th { background: var(--soft); color: var(--muted); font-size: .78rem; font-weight: 700; }
thead th:first-child { border-top-left-radius: 6px; }
thead th:last-child { border-top-right-radius: 6px; }
tbody tr:hover { background: #fafbf8; }
th.numeric, td.numeric { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.cell-date { white-space: nowrap; }
td.description { min-width: 180px; }
td .caption { display: block; }
details summary { color: var(--pine); cursor: pointer; }
.notice { padding: 10px 13px; color: var(--pine); background: var(--mint); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; }
.notice.error { color: var(--danger); background: #fff0eb; border-color: #ecd3cb; }
.notice.warn { background: var(--amber); color: #624819; }
.empty { padding: 20px 12px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 8px; }
.login-panel { max-width: 440px; margin: 30px auto 0; }
.login-panel h1 { font-size: 2.3rem; }
.denominations { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 9px; }
.flash { margin-bottom: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; gap: 4px 12px; padding-top: 8px; padding-bottom: 8px; }
  .nav { order: 3; width: 100%; }
  .environment { margin-left: 0; }
}
@media (max-width: 540px) {
  .main { padding: 24px 12px 36px; }
  .header-inner { padding-left: 12px; padding-right: 12px; }
  .card { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .account-full { display: none; }
  .account-short { display: inline; }
}
@media print {
  body { background: white; }
  .header, .no-print, .flash { display: none; }
  .main { padding: 0; width: 100%; }
  .card { box-shadow: none; padding: 0; border: 0; }
  .table-wrap { overflow: visible; }
}
.skip-link {
  position: absolute;
  top: -4rem;
  left: 12px;
  padding: 8px 12px;
  border-radius: 7px;
  background: #fff;
  z-index: 2;
}
.skip-link:focus { top: 6px; }
.narrow { max-width: 670px; }
.mb { margin-bottom: 14px; }
.flow-table { margin-top: 12px; }
.metadata { margin-top: 9px; }
.amount-input { max-width: 230px; }
.form-footer { margin-top: 14px; }
.heading .caption { margin-top: 2px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li + li { border-top: 1px solid var(--border); }
.timeline li { padding: 9px 0; }
.timeline li:first-child { padding-top: 0; }
#main:focus { outline: none; }
.layout > .card .table-wrap { margin-top: 10px; }
.stats + .table-wrap .flow-table { margin-top: 0; }
[data-denomination-total] { font-weight: 700; }
