:root {
  --accent: #F2A33A; --accent-ink: #3a2400;
  --bg: #f5f5f7; --card: #ffffff; --text: #1d1d1f; --muted: #6e6e73; --hairline: #e3e3e8;
  --ok: #1f8a4c; --warn: #b26a00; --bad: #c4301c;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --card: #1c1c1e; --text: #f5f5f7; --muted: #98989f; --hairline: #2c2c2e;
    --ok: #4cd080; --warn: #ffb340; --bad: #ff6b57; --shadow: 0 1px 2px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); line-height: 1.45;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
}
h1 { font-size: 1.75rem; letter-spacing: -.02em; margin: 1.25rem 0 .75rem; }
h2 { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .5rem; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
code { font-size: .8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); font-size: .875rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .75rem;
  padding: .5rem 1rem; background: color-mix(in srgb, var(--card) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--hairline);
}
.topbar .brand { display: flex; align-items: center; gap: .5rem; font-weight: 600; text-decoration: none; }
.topbar nav { display: flex; gap: .25rem; overflow-x: auto; flex: 1; scrollbar-width: none; }
.topbar nav a { padding: .5rem .6rem; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.topbar nav a[aria-current] { color: var(--text); background: var(--bg); }
.who { display: flex; align-items: center; gap: .25rem; margin: 0; font-size: .9rem; }

.page { max-width: 1040px; margin: 0 auto; padding: 0 1rem 3rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 721px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .grid .wide { grid-column: 1 / -1; }
}
.card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1rem; }
.grid .card { margin-bottom: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 520px; }
.card .pad { padding: 1.25rem 1.25rem 0; }
.big { font-size: 2.25rem; font-weight: 700; letter-spacing: -.02em; margin: .1rem 0; font-variant-numeric: tabular-nums; }
.big small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.card.stale .big { color: var(--warn); }
.flag { margin-left: .4rem; padding: .1rem .45rem; border-radius: 99px; background: var(--warn); color: var(--card); font-size: .75rem; font-weight: 600; }

.partners { list-style: none; margin: 0; padding: 0; }
.partners li { padding: .75rem 0; border-top: 1px solid var(--hairline); }
.partners li:first-child { border-top: 0; }
.row-head { display: flex; justify-content: space-between; gap: 1rem; }
.bar { height: 8px; border-radius: 99px; background: var(--hairline); overflow: hidden; margin: .5rem 0; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.figures { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.figures b { color: var(--text); font-weight: 600; }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .75rem; font-weight: 600; color: var(--muted); padding: .75rem 1rem; }
th.num { text-align: right; }
td { padding: .75rem 1rem; border-top: 1px solid var(--hairline); vertical-align: top; }
td.out { color: var(--text); } td.in { color: var(--ok); }
@media (max-width: 720px) { .hide-s { display: none; } }

.badge { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 600; background: var(--hairline); }
.badge.ok { background: #d9f2e3; color: #0b4a26; }
.badge.wait { background: #fde8c4; color: #5c3600; }
.badge.no { background: #fbdcd7; color: #7a1a0e; }
@media (prefers-color-scheme: dark) {
  .badge.ok { background: #123d25; color: #bff0d2; }
  .badge.wait { background: #4a3208; color: #ffd89a; }
  .badge.no { background: #4d1a14; color: #ffc2b8; }
}
.only-s { display: none; }
@media (max-width: 720px) {
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; }
  table.cards thead { display: none; }
  table.cards tr { padding: .75rem 0; border-top: 1px solid var(--hairline); }
  table.cards td { border: 0; padding: .2rem 1.25rem; text-align: left; }
  table.cards td.num { text-align: left; font-size: 1.25rem; font-weight: 700; }
  table.cards td[data-label]::before { content: attr(data-label); display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
  table.cards td.only-s { display: block; font-weight: 600; }
}

label { display: block; font-size: .85rem; font-weight: 500; margin: 1rem 0 .3rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=month], input[type=file], select {
  width: 100%; min-height: 44px; padding: .6rem .75rem; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--hairline); border-radius: 12px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
button, .button {
  min-height: 44px; padding: .55rem 1rem; font: inherit; font-weight: 600; border: 0; border-radius: 12px;
  cursor: pointer; background: var(--accent); color: var(--accent-ink); margin-top: 1rem;
}
button.primary { background: var(--accent); color: var(--accent-ink); }
button.quiet, .button.quiet { background: transparent; color: var(--text); margin-top: 0; padding: .55rem .6rem; }
form.inline, form.decide { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0; }
form.inline select { width: auto; max-width: 14rem; }
form.decide input { flex: 1 1 12rem; width: auto; }
form.decide button { margin-top: 0; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: end; margin-bottom: 1rem; }
.filters label { margin: 0; } .filters .check { display: flex; align-items: center; gap: .4rem; min-height: 44px; }
.filters input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: .5rem 0; }

.error { color: var(--bad); } .success { color: var(--ok); font-weight: 600; }
.notice { padding: .75rem 1rem; border-radius: 12px; background: color-mix(in srgb, var(--accent) 18%, var(--card)); }
#toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); padding: .75rem 1.25rem; border-radius: 99px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); }

main.login { max-width: 360px; margin: 12vh auto 0; padding: 0 1rem; }
main.login .logo { display: block; margin-bottom: 1rem; }
@media (prefers-color-scheme: dark) { main.login .logo { content: url("/static/brand/fourlegis-horizontal-fundo-escuro.svg"); } }
@media (prefers-reduced-motion: no-preference) { button { transition: filter .15s; } button:hover { filter: brightness(.96); } }
