/* Alma Vira-Lata · Prestação de Contas */

:root {
  --bg:        #f5f6f7;
  --surface:   #ffffff;
  --border:    #e2e5e9;
  --text:      #1f2937;
  --muted:     #6b7280;
  --green:     #166534;
  --green-light: #16a34a;
  --green-bg:  #ecfdf5;
  --red:       #b91c1c;
  --red-light: #dc2626;
  --red-bg:    #fef2f2;
  --amber:     #b45309;
  --amber-bg:  #fffbeb;
  --slate:     #475569;
  --slate-bg:  #f1f5f9;
  --restrito:  #92400e;
  --restrito-bg: #fef3c7;
  --livre:     #1e40af;
  --livre-bg:  #dbeafe;
  --radius:    6px;
  --shadow:    0 1px 2px rgba(0, 0, 0, 0.04);
  --num-font:  ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Topbar */
.topbar {
  background: var(--green);
  color: #fff;
  border-bottom: 4px solid #052e16;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}
.brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand .tagline {
  margin: 4px 0 0 0;
  font-size: 13px;
  opacity: 0.88;
}
.updated {
  text-align: right;
  font-size: 13px;
}
.updated .label {
  display: block;
  opacity: 0.7;
  margin-bottom: 2px;
}
.updated .value {
  font-family: var(--num-font);
}

/* Ribbon */
.ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  margin-bottom: 28px;
}
.ribbon .label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.ribbon .value {
  font-weight: 600;
  color: var(--text);
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--slate);
}
.card--in     { border-left-color: var(--green-light); }
.card--out    { border-left-color: var(--red-light); }
.card--balance{ border-left-color: var(--green); }
.card--ratio  { border-left-color: var(--amber); }

.card__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}
.card__value {
  font-family: var(--num-font);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.card--in .card__value     { color: var(--green-light); }
.card--out .card__value    { color: var(--red-light); }
.card--balance .card__value{ color: var(--green); }
.card--ratio .card__value  { color: var(--amber); }
.card__sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

/* Blocks */
.block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.block h2 {
  margin: 0 0 14px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.block--alert {
  background: var(--amber-bg);
  border-color: #fde68a;
}
.block--alert h2 { color: var(--amber); }

/* Recurso bar */
.bar {
  display: flex;
  height: 18px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--border);
}
.bar__seg {
  height: 100%;
  transition: width 0.3s ease;
}
.bar__seg--livre    { background: var(--livre); }
.bar__seg--restrito { background: var(--restrito); }
.legend {
  margin-top: 8px;
  display: flex;
  gap: 24px;
  font-size: 13px;
}
.legend__item { display: inline-flex; align-items: center; gap: 8px; }
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot--livre    { background: var(--livre); }
.dot--restrito { background: var(--restrito); }

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
}
.filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.filters select {
  padding: 7px 9px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  min-width: 150px;
}
.btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: var(--slate-bg); }
.btn--secondary { color: var(--muted); }

/* Chart */
.chart-wrap {
  position: relative;
  height: 360px;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--slate-bg);
}
.table td.num, .table th.num {
  text-align: right;
  font-family: var(--num-font);
  white-space: nowrap;
}
.table--zebra tbody tr:nth-child(even) {
  background: #fafbfc;
}
.table--zebra tbody tr:hover {
  background: var(--slate-bg);
}
.table-wrap {
  max-height: 540px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.table-wrap thead { position: sticky; top: 0; }

/* Tags */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}
.tag--in {
  background: var(--green-bg);
  color: var(--green);
}
.tag--out {
  background: var(--red-bg);
  color: var(--red);
}
.tag--livre {
  background: var(--livre-bg);
  color: var(--livre);
}
.tag--restrito {
  background: var(--restrito-bg);
  color: var(--restrito);
}
.tag--ativ {
  background: var(--green-bg);
  color: var(--green);
}
.tag--estr {
  background: var(--slate-bg);
  color: var(--slate);
}
.tag--estorno {
  background: var(--amber-bg);
  color: var(--amber);
}
.tag--int {
  background: var(--livre-bg);
  color: var(--livre);
}
.tag--entr {
  background: var(--green-bg);
  color: var(--green);
}

/* Inline numbers */
.num-pos { color: var(--green-light); }
.num-neg { color: var(--red-light); }
.muted { color: var(--muted); font-weight: 400; }
.ok { color: var(--green); font-weight: 500; }

/* Footer */
.foot {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 24px 0 40px 0;
}

/* Responsive */
@media (max-width: 720px) {
  .card__value { font-size: 20px; }
  .topbar .container { flex-direction: column; align-items: flex-start; }
  .updated { text-align: left; }
  .filters select { min-width: 120px; }
  .table th, .table td { padding: 6px 8px; font-size: 12px; }
}
