:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #1d3035;
  background: #f1f4f2;
  font-synthesis: none;
  line-height: 1.5;
  --paper: #fff;
  --line: #dce6e1;
  --muted: #526661;
  --brand: #176857;
  --nav: #142e36;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--brand); }
button, input, textarea, select { font: inherit; }
button, .button { cursor: pointer; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #17463d; padding: 8px 12px; font-weight: 600; text-decoration: none; }
button:hover, .button:hover { background: #eaf5ef; }
button:disabled { cursor: wait; opacity: .6; }
button.primary { background: #176857; border-color: #176857; color: white; }
button.primary:hover { background: #104c41; }
:focus-visible { outline: 3px solid #b66d16; outline-offset: 2px; }
input, select, textarea { border: 1px solid #a9bcb4; background: white; color: #203630; padding: 8px 10px; border-radius: 6px; min-width: 0; max-width: 100%; }
textarea { width: 100%; resize: vertical; }
label { display: grid; gap: 5px; color: #304942; font-size: .87rem; font-weight: 650; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 4vw, 2.45rem); letter-spacing: -.04em; line-height: 1.15; }
h2 { font-size: 1.16rem; letter-spacing: -.015em; line-height: 1.25; }
h3 { font-size: 1rem; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .87rem; }
.num, td.amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.initial { padding: 36px; }
.skip { position: absolute; top: -100px; background: white; padding: 10px; }
.skip:focus { top: 10px; left: 10px; z-index: 10; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 234px minmax(0, 1fr); }
.sidebar { background: var(--nav); color: #e7eeec; padding: 25px 15px; display: flex; flex-direction: column; gap: 31px; min-height: 100vh; position: sticky; top: 0; align-self: start; }
.brand { display: grid; justify-items: start; gap: 7px; padding-inline: 7px; }
.brand-logo { display: block; width: 148px; max-width: 100%; height: auto; padding: 8px 10px; background: #fff; border-radius: 7px; }
.brand small { font-size: .75rem; color: #bdd0cb; line-height: 1.35; }
.nav { display: grid; gap: 4px; }
.nav a { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 7px; color: #d9e6e3; text-decoration: none; font-size: .89rem; }
.nav a:hover { background: #203e47; }
.nav a[aria-current=page] { background: #285249; color: #fff; font-weight: 700; }
.nav svg { width: 17px; height: 17px; flex-shrink: 0; }
.profile { margin-top: auto; display: grid; justify-items: start; gap: 8px; padding: 10px 7px 0; border-top: 1px solid #375058; font-size: .8rem; color: #c6d7d3; overflow-wrap: anywhere; }
.profile button { background: transparent; border-color: #496562; color: #e7eeec; font-size: .8rem; }
.profile p { color: #aabbba; }
.main { min-width: 0; width: 100%; max-width: 1570px; margin: 0 auto; padding: 24px 33px 55px; }
.mode { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; font-size: .81rem; color: var(--muted); padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.mode strong { color: var(--brand); }
.pagehead { display: flex; justify-content: space-between; align-items: end; gap: 14px; flex-wrap: wrap; margin: 24px 0 20px; }
.pagehead p { margin-top: 7px; }
.filters, .actions { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; }
.filters select { padding-block: 6px; font-size: .88rem; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 3px #183e3507; }
.metric { padding: 14px 15px; color: inherit; display: grid; gap: 5px; text-decoration: none; min-width: 0; align-content: start; }
a.metric:hover { border-color: #508b78; background: #fafffc; }
.metric .name { font-size: .85rem; font-weight: 650; color: #405a54; }
.metric strong { font-size: clamp(1.05rem, 2.1vw, 1.65rem); font-weight: 740; letter-spacing: -.035em; }
.metric small { font-size: .76rem; color: var(--muted); }
.panel { min-width: 0; padding: 17px 18px; margin-bottom: 14px; scroll-margin-top: 18px; }
.panel > h2 { margin-bottom: 10px; }
.panel > p { margin-bottom: 10px; }
.pair { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; }
.chart { width: 100%; height: auto; display: block; color: #49605a; }
.legend { display: flex; gap: 13px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); padding: 5px 0; }
.dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 2px; margin-right: 5px; }
.dot.green { background: #267965; }
.dot.sand { background: #c18343; }
.attention { list-style: none; padding: 0; margin: 0; }
.attention li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.attention li:last-child { border-bottom: 0; }
.attention a { font-weight: 650; text-decoration: none; }
.attention a:hover { text-decoration: underline; }
.status { display: inline-block; padding: 2px 7px; background: #e9f2ed; color: #245146; border-radius: 5px; font-size: .75rem; line-height: 1.4; }
.status.warn { background: #fff2d8; color: #764514; }
.notice, .error, .success { border: 1px solid #e4cea6; padding: 9px 11px; margin: 8px 0 12px; border-radius: 7px; background: #fff7e9; color: #674519; overflow-wrap: anywhere; }
.error { background: #fff0ef; border-color: #ecc3be; color: #852d26; }
.success { background: #e8f5ef; border-color: #acd3c3; color: #23624e; }
.table-scroll { overflow: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: 9px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid #e7eeea; }
th { background: #f8faf8; color: #38534d; font-weight: 700; white-space: nowrap; }
th button { border: 0; padding: 0; background: transparent; font-size: inherit; }
td.amount, th.amount { text-align: right; }
td { overflow-wrap: anywhere; }
#saldi td:first-child { min-width: 118px; }
#saldi td:last-child { min-width: 155px; }
tr:last-child td { border-bottom: 0; }
.table-tools { margin: 10px 0; }
.pager { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 9px; color: var(--muted); font-size: .8rem; }
.pager button { padding: 4px 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 11px; align-items: end; margin: 10px 0; }
[hidden] { display: none !important; }
.form-stack { display: grid; gap: 10px; }
.check { border-top: 1px solid var(--line); padding: 10px 0; scroll-margin-top: 16px; }
.check summary { cursor: pointer; font-weight: 650; }
.check summary .status { margin-left: 7px; }
.check-body { display: grid; gap: 8px; padding-top: 8px; }
.history-entry { border-left: 2px solid #bbd6ca; padding-left: 10px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.login { width: min(100%, 425px); padding: 24px; }
.login .brand { padding: 0; margin-bottom: 22px; }
.login .brand small { color: var(--muted); }
.login h1 { margin-bottom: 10px; }
.login form { margin-top: 18px; }
.mobile-menu { display: none; }
@media (max-width: 1100px) {
  .layout { grid-template-columns: 205px minmax(0, 1fr); }
  .main { padding-inline: 20px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .layout { display: block; }
  .sidebar { position: static; min-height: auto; display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 13px; }
  .nav, .profile { display: none; grid-column: 1 / -1; }
  .sidebar[data-open=true] .nav, .sidebar[data-open=true] .profile { display: grid; }
  .mobile-menu { display: block; align-self: start; font-size: .83rem; }
  .main { padding: 14px 12px 32px; }
  .pagehead { margin-block: 17px; }
  .pair { grid-template-columns: 1fr; gap: 0; }
  .panel { padding: 13px; }
  .cards { gap: 7px; }
  .metric { padding: 11px 9px; }
}
