:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, Arial, sans-serif;
  color: #172922;
  background: #f1f4ee;
  --surface: #fff;
  --border: #dce5dd;
  --muted: #53635a;
  --green: #215d46;
  --dark: #132923;
  --radius: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #946400; outline-offset: 3px; }
.shell { width: min(100% - 48px, 1120px); margin-inline: auto; }
.header { color: white; background: var(--dark); }
.brand { display: flex; align-items: center; gap: 12px; min-height: 72px; }
.brand small { color: #c1d6c9; display: block; margin-top: 1px; }
.brand-icon {
  display: grid; place-items: center; width: 39px; aspect-ratio: 1;
  border-radius: 13px; color: var(--dark); background: #bbefca; font-weight: 800;
}
.outline {
  margin-left: auto; color: white; background: transparent; border: 1px solid #aac4b4;
  border-radius: 10px; padding: 8px 15px; min-height: 42px;
}
.intro {
  display: flex; justify-content: space-between; align-items: end; gap: 16px;
  margin-block: 40px 28px;
}
.eyebrow {
  margin: 0 0 7px; color: var(--green); font-size: .75rem;
  font-weight: 750; letter-spacing: .09em; text-transform: uppercase;
}
h1, h2, h3 { margin: 0; letter-spacing: -.025em; }
h1 { font-size: clamp(1.8rem, 4.6vw, 3.1rem); line-height: 1.1; }
h2 { font-size: 1.45rem; margin-bottom: 16px; }
h3 { font-size: 1rem; overflow-wrap: anywhere; }
.period-note {
  margin: 0; border-radius: 999px; background: #dfebdf; color: #284b3b;
  padding: 8px 13px; font-size: .82rem; font-weight: 650;
}
.navigation { border-bottom: 1px solid #cbd9cd; margin-bottom: 26px; }
[role="tablist"] { display: flex; flex-wrap: wrap; gap: 4px; }
[role="tab"] {
  padding: 11px 15px; min-height: 44px; background: transparent; color: var(--muted);
  border: 0; border-bottom: 3px solid transparent; font-size: .92rem; font-weight: 650;
}
[role="tab"]:hover { background: #e7eee5; }
[role="tab"][aria-selected="true"] { color: var(--green); border-color: var(--green); }
.panel { padding-bottom: 44px; }
.summary-grid, .history-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card, .entry, .login { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card { min-width: 0; padding: 20px; }
.metric { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; min-height: 113px; }
.metric:first-child { background: #215d46; border-color: #215d46; color: white; }
.amount { font-size: clamp(1.25rem, 3vw, 2rem); font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
.section-note { margin: -4px 0 16px; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.filters label:first-child { flex: 1 1 215px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: .86rem; font-weight: 650; }
input, select {
  min-width: 0; max-width: 100%; min-height: 44px; padding: 9px 12px;
  background: white; color: #172922; border: 1px solid #a7b6ac; border-radius: 9px;
}
.list { display: grid; gap: 8px; }
.entry {
  padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 2fr) repeat(var(--columns, 1), minmax(0, 1fr));
  align-items: center; gap: 12px 18px;
}
.entry p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.entry dl { margin: 0; }
dt { font-size: .77rem; color: var(--muted); }
dd { margin: 4px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.history-grid dl { display: grid; gap: 10px; margin: 15px 0 0; }
.history-grid dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.history-grid dd { margin-top: 0; white-space: nowrap; }
#rota-total .card { margin-bottom: 12px; }
#rota-total p { margin: 4px 0 0; color: var(--muted); }
.login { width: min(100%, 420px); margin: 64px auto; padding: 24px; }
.login h1 { font-size: 1.7rem; margin-bottom: 20px; }
.login form { display: grid; gap: 9px; }
.primary { color: white; background: var(--green); border: 0; border-radius: 9px; min-height: 44px; font-weight: 750; margin-top: 4px; }
#login-status { min-height: 1em; color: var(--muted); margin: 3px 0 0; font-size: .9rem; }
@media (max-width: 820px) {
  .summary-grid, .history-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .shell { width: calc(100% - 28px); }
  .intro { align-items: start; flex-direction: column; margin-block: 27px 17px; gap: 9px; }
  .navigation { margin-bottom: 20px; }
  [role="tab"] { padding-inline: 8px; font-size: .82rem; }
  .summary-grid, .history-grid { gap: 9px; }
  .history-grid { grid-template-columns: 1fr; }
  .card { padding: 14px 11px; }
  .metric { min-height: 107px; gap: 10px; }
  .metric h3 { font-size: .89rem; }
  .entry { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  .entry > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 340px) {
  .summary-grid { grid-template-columns: 1fr; }
  .metric { min-height: auto; }
}
