/* Portal da Transparência — AMAS Vilhena */
:root {
  --blue: #0D6EFD; --blue-900: #0A3D91; --blue-50: #EEF4FF; --red: #E52421;
  --ink: #0F172A; --text: #334155; --muted: #64748B; --line: #E2E8F0; --soft: #F8FAFC; --bg: #FFFFFF;
  --in: #1E6FD0; --out: #C2410C;
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
img { max-width: 100%; display: block; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .6em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.05rem; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.section { padding: 56px 16px; }
.band { background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.muted { color: var(--muted); }
.d-block { display: block; }
.nowrap { white-space: nowrap; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mt { margin-top: 40px; }
.in { color: var(--in); }
.out { color: var(--out); }

/* Topo */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { width: 64px; height: auto; }
.brand span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand strong { font-size: 1rem; }
.brand small { color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { color: var(--text); text-decoration: none; font-weight: 500; font-size: .92rem; padding: 8px 12px; border-radius: 8px; }
.nav a:hover { background: var(--soft); color: var(--ink); }
.nav__cta { background: var(--red); color: #fff !important; }
.nav__cta:hover { background: #C81E1B !important; }

/* Hero */
.hero { background: radial-gradient(700px 300px at 90% -10%, rgba(255,255,255,.18), transparent 60%), linear-gradient(125deg, var(--blue-900), var(--blue)); color: #fff; }
.hero__in { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; padding: 64px 16px 56px; }
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.1rem); max-width: 720px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: #BFD5FF; margin: 0 0 12px; }
.lead { font-size: 1.12rem; max-width: 680px; color: #E6EEFF; margin: 0 0 14px; }
.meta { font-size: .86rem; color: #BFD5FF; margin: 0; }
.year { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.year label { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: #BFD5FF; font-weight: 600; }
.year select { font: inherit; font-size: 1.3rem; font-weight: 700; padding: 10px 40px 10px 16px; border-radius: 10px; border: 0; color: var(--ink); background: #fff; cursor: pointer; }

/* Números */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 24px 0 32px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: #fff; display: flex; flex-direction: column; gap: 4px; }
.stat strong { font-size: clamp(1.7rem, 4vw, 2.3rem); color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .92rem; }
.stats--money .stat strong { font-size: clamp(1.25rem, 3vw, 1.6rem); }
.stats--money .stat { flex-direction: column-reverse; justify-content: flex-end; }

/* Projetos */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 24px; }
.project { border: 1px solid var(--line); border-top: 4px solid var(--c, var(--blue)); border-radius: var(--radius); padding: 22px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.project h3 { margin: 0; }
.project p { margin: 0; font-size: .95rem; }
.project__num { margin-top: auto; padding-top: 8px; color: var(--ink); }
.project__num strong { font-size: 1.5rem; }
.project__num small { color: var(--muted); }
.project .bar span { background: var(--c, var(--blue)); }

/* Painéis e barras */
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: #fff; margin-bottom: 16px; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bar { height: 8px; background: #E9EEF5; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hbars li { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; gap: 12px; align-items: center; font-size: .92rem; }
.hbars b { font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; white-space: nowrap; }
.hbars b small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.hbars--money li { grid-template-columns: 1fr; gap: 4px; }
.hbars--money li > span { display: flex; justify-content: space-between; }
.hbars--money li { position: relative; }
.hbars--money b { position: absolute; right: 0; top: 0; }
.note { color: var(--muted); font-size: .84rem; margin: 14px 0 0; }
.legend { display: flex; gap: 16px; font-size: .86rem; color: var(--text); margin-bottom: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: end; height: 200px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.month { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.month__bars { display: flex; gap: 2px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.month__bars span { width: 40%; max-width: 16px; min-height: 0; border-radius: 4px 4px 0 0; }
.month small { color: var(--muted); font-size: .74rem; }
.table-toggle { margin-top: 12px; }
.table-toggle summary { cursor: pointer; color: var(--blue); font-weight: 500; font-size: .9rem; }

/* Tabelas */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 12px 14px; background: var(--soft); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th.num { text-align: right; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.panel .table th { background: transparent; padding-left: 0; }
.panel .table td { padding-left: 0; }

/* Documentos, diretoria, doadores */
.docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.docs a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-decoration: none; color: var(--ink); }
.docs a:hover { border-color: var(--blue); }
.docs a span:last-child { display: flex; flex-direction: column; min-width: 0; }
.docs small { color: var(--muted); }
.docs__ic { width: 40px; height: 40px; border-radius: 10px; background: #FDECEC; color: var(--red); font-weight: 800; font-size: .72rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.board { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.board li { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; display: flex; flex-direction: column; }
.board span { color: var(--muted); font-size: .88rem; }
.donors { color: var(--ink); font-weight: 500; }

/* Doe */
.donate { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; align-items: center; }
.donate p { font-size: 1.08rem; }
.donate__box { border: 2px solid var(--red); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 8px; background: #FFF7F7; }
.donate__box small { text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--red); font-size: .76rem; }
.donate__box strong { font-size: 1.5rem; color: var(--ink); overflow-wrap: anywhere; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 10px; background: var(--red); color: #fff; font-weight: 600; text-decoration: none; align-self: flex-start; }
.btn:hover { background: #C81E1B; color: #fff; }

.foot { background: var(--ink); color: #CBD5E1; font-size: .88rem; }
.foot__in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 24px 16px; }
.foot a { color: #fff; }

@media (max-width: 860px) {
  .nav a:not(.nav__cta) { display: none; }
  .hero__in { flex-direction: column; align-items: flex-start; padding: 44px 16px 40px; }
  .cols, .donate { grid-template-columns: 1fr; }
  .section { padding: 40px 16px; }
  .months { gap: 3px; height: 160px; }
  .month small { font-size: .62rem; }
  .brand small { max-width: 52vw; }
}
@media print {
  .top, .nav, .year, .donate { display: none; }
  .hero { background: none; color: var(--ink); }
  .hero h1, .lead, .meta, .eyebrow { color: var(--ink); }
}

/* Política de privacidade */
.legal { max-width: 820px; line-height: 1.75; }
.legal h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
.legal h3 { margin: 26px 0 8px; font-size: 1.1rem; }
.legal ul { padding-left: 22px; }

/* Aviso de cookies */
.cookie { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 560px; margin: 0 auto; background: var(--ink); color: #E2E8F0; border-radius: 14px; padding: 14px 16px; display: flex; gap: 14px; align-items: center; box-shadow: 0 20px 40px -12px rgba(0,0,0,.35); font-size: .9rem; }
.cookie[hidden] { display: none; }
.cookie p { margin: 0; flex: 1; }
.cookie strong { color: #fff; }
.cookie a { color: #93C5FD; }
.cookie button { font: inherit; font-weight: 600; background: #fff; color: var(--ink); border: 0; border-radius: 9px; padding: 9px 16px; cursor: pointer; flex-shrink: 0; }
@media (max-width: 520px) { .cookie { flex-direction: column; align-items: stretch; } }
