/* VIDA · Plataforma — mesma identidade visual do Termo (tokens, tipografia e tom) */
:root {
  --green: #2F4A3A; --sage: #7A8F5A; --beige: #E6D2B3; --terra: #C66A3D; --brown: #8A3F2A;
  --paper: #FAF5EA; --card: #FFFDF8; --ink: #26352C; --muted: #5C695F; --field: #B9A27C;
  --sage-soft: #EEF1E3; --terra-soft: #F8E9DF; --line: rgba(230, 210, 179, .9);
  --shadow: 0 1px 2px rgba(47, 74, 58, .06), 0 10px 26px rgba(47, 74, 58, .06);
  --side-w: 248px; --top-h: 62px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--green); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.ic { width: 20px; height: 20px; flex: none; }

/* ---------- estrutura ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side { background: var(--green); color: #EFE6D2; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; z-index: 40; }
.side .brand { padding: 20px 20px 14px; display: block; }
.side .brand img { width: 150px; height: auto; display: block; }
.side nav { padding: 6px 10px 12px; flex: 1; }
.side .grp { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(239, 230, 210, .55); padding: 14px 12px 6px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #EFE6D2; text-decoration: none; font-weight: 500; font-size: 14.5px; }
.side nav a:hover { background: rgba(255, 255, 255, .08); }
.side nav a.on { background: var(--beige); color: var(--green); font-weight: 700; }
.side .foot { padding: 14px 20px; font-size: 12px; color: rgba(239, 230, 210, .6); border-top: 1px solid rgba(255, 255, 255, .1); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: rgba(250, 245, 234, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .burger { display: none; }
.gsearch { flex: 1; max-width: 460px; position: relative; }
input[type=search].gsearch-in, .gsearch input[type=search] { width: 100%; height: 40px; border: 1.5px solid var(--field); border-radius: 12px; padding: 0 14px 0 38px; background: #fff; font: inherit; color: var(--ink); }
.gsearch .ic { position: absolute; left: 11px; top: 10px; color: var(--muted); width: 18px; height: 18px; }
.top .sp { flex: 1; }
.iconbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--green); text-decoration: none; cursor: pointer; }
.iconbtn .n { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--terra); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.me { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.me .av { width: 36px; height: 36px; border-radius: 50%; background: var(--sage); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.me .nm { line-height: 1.2; font-size: 13.5px; } .me .nm b { display: block; } .me .nm span { color: var(--muted); font-size: 12px; }
.content { padding: 26px 24px 60px; max-width: 1280px; width: 100%; }
.scrim { display: none; }

.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.pagehead h1 { font-size: 24px; line-height: 1.2; color: var(--green); letter-spacing: .01em; }
.pagehead .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.pagehead .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; } .crumbs a { color: var(--muted); }

/* ---------- componentes ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card h2 { font-size: 16px; color: var(--green); margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card h2 small { font-weight: 500; color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 18px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g32 { grid-template-columns: 2fr 1fr; }
.mt { margin-top: 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 0; border-radius: 11px; font: inherit; font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; transition: background .15s, transform .08s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(47, 74, 58, .45); outline-offset: 2px; }
.btn-primary { background: var(--terra); color: #fff; } .btn-primary:hover { background: #B85E33; }
.btn-green { background: var(--green); color: #fff; } .btn-green:hover { background: #243a2d; }
.btn-ghost { background: transparent; color: var(--green); border: 1.5px solid var(--green); } .btn-ghost:hover { background: var(--sage-soft); }
.btn-soft { background: var(--sage-soft); color: var(--green); border: 1.5px solid rgba(122, 143, 90, .5); }
.btn-danger { background: transparent; color: var(--brown); border: 1.5px solid var(--brown); } .btn-danger:hover { background: #FBEEE8; }
.btn-sm { min-height: 32px; padding: 4px 11px; font-size: 13px; border-radius: 9px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--green); text-decoration: underline; cursor: pointer; font: inherit; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; line-height: 1.6; white-space: nowrap; }
.badge-green { background: var(--green); color: #fff; } .badge-sage { background: var(--sage-soft); color: #4C5E34; border: 1px solid rgba(122, 143, 90, .5); }
.badge-terra { background: var(--terra-soft); color: #9A4A25; border: 1px solid rgba(198, 106, 61, .45); } .badge-dark { background: #26352C; color: #fff; }
.badge-muted { background: #EFEADD; color: var(--muted); } .badge-danger { background: var(--brown); color: #fff; }

.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; }
.flash.ok { background: var(--sage-soft); color: #36482A; border: 1px solid rgba(122, 143, 90, .55); }
.flash.err { background: #FBEEE8; color: var(--brown); border: 1px solid rgba(138, 63, 42, .5); }
.flash.warn { background: var(--terra-soft); color: #7B3F1F; border: 1px solid rgba(198, 106, 61, .5); }
.flash button { background: none; border: 0; cursor: pointer; color: inherit; font-size: 18px; line-height: 1; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty b { display: block; color: var(--green); font-size: 16px; margin-bottom: 4px; }

/* tabelas */
.tbl-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; background: #F4EBDA; color: var(--green); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 10px 14px; white-space: nowrap; }
.tbl th a { color: inherit; text-decoration: none; }
.tbl td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover { background: #FBF6EA; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl a.rowlink { font-weight: 700; text-decoration: none; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.pg { padding: 6px 12px; border-radius: 9px; border: 1px solid var(--line); background: #fff; text-decoration: none; font-weight: 600; color: var(--green); }
.pg.cur { background: var(--green); color: #fff; border-color: var(--green); } .pg.off { color: var(--muted); background: transparent; border-color: transparent; }

/* filtros */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.filters .f { display: flex; flex-direction: column; gap: 3px; min-width: 130px; } .filters label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.filters .f.grow { flex: 1; min-width: 200px; }

/* formulários */
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=datetime-local], input[type=number], input[type=search], select, textarea {
  width: 100%; border: 1.5px solid var(--field); border-radius: 11px; padding: 9px 12px; background: #fff; color: var(--ink); font: inherit; min-height: 40px; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); }
.fgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.fld { grid-column: span 12; min-width: 0; } .w-half { grid-column: span 6; } .w-third { grid-column: span 4; } .w-quarter { grid-column: span 3; } .w-two { grid-column: span 8; } .w-full { grid-column: span 12; }
.fld > label { display: block; font-weight: 700; font-size: 13.5px; color: var(--green); margin-bottom: 4px; }
.fld .help { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.fld .err { display: none; color: var(--brown); font-size: 13px; font-weight: 600; margin-top: 3px; }
.fld.invalid .err { display: block; } .fld.invalid input, .fld.invalid select, .fld.invalid textarea { border-color: var(--brown); background: #FFF8F4; }
.req::after { content: " *"; color: var(--terra); }
.chk { display: flex; align-items: center; gap: 10px; padding-top: 24px; font-weight: 600; } .chk input { width: 20px; height: 20px; accent-color: var(--green); }
.formbar { display: flex; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* detalhes */
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; }
.kv dt { color: var(--muted); font-size: 13px; font-weight: 600; } .kv dd { margin: 0; word-break: break-word; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--green); border-color: var(--terra); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: block; }
.kpi .v { font-size: 28px; font-weight: 800; color: var(--green); line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.kpi.accent .v { color: var(--terra); } a.kpi:hover { border-color: var(--sage); }

/* gráficos */
svg.chart { width: 100%; height: auto; display: block; } svg.chart .grid { stroke: #E8DDC5; stroke-width: 1; } svg.chart .ax { fill: var(--muted); font-size: 10.5px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--muted); } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.hbars .hb { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: 10px; align-items: center; margin: 7px 0; font-size: 13.5px; }
.hbars .ht { height: 12px; background: #F0E8D6; border-radius: 6px; overflow: hidden; } .hbars .hf { display: block; height: 100%; border-radius: 6px; } .hbars .hv { font-weight: 700; font-variant-numeric: tabular-nums; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; } .donut { width: 150px; height: 150px; } .donut .dn { font-size: 22px; font-weight: 800; fill: var(--green); }
.dl { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 150px; } .dl li { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13.5px; } .dl li span { flex: 1; } .dl i { width: 10px; height: 10px; border-radius: 3px; }

/* alertas */
.alert-grp + .alert-grp { margin-top: 14px; } .alert-grp h3 { font-size: 13px; color: var(--brown); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.alert-item { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; text-decoration: none; color: inherit; } .alert-item:hover { color: var(--terra); }
.alert-item .d { color: var(--muted); font-size: 12.5px; white-space: nowrap; } .alert-item .d.late { color: var(--brown); font-weight: 700; }

/* linha do tempo */
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--beige); }
.timeline li { position: relative; padding: 0 0 18px 18px; }
.timeline li::before { content: ""; position: absolute; left: -26px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 3px solid var(--sage); }
.timeline li.t-saude::before { border-color: var(--terra); } .timeline li.t-status::before { border-color: var(--green); background: var(--green); } .timeline li.t-adocao::before { border-color: var(--brown); background: var(--brown); }
.timeline .when { font-size: 12.5px; color: var(--muted); } .timeline .ttl { font-weight: 700; } .timeline .desc { color: #3b4a40; font-size: 14px; }

/* fotos */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.gallery .ph { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #EFE6D2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.gallery .main { position: absolute; left: 6px; top: 6px; }
.hero-photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); background: #EFE6D2; display: block; }
.noimg { aspect-ratio: 4/3; border-radius: 16px; background: var(--sage-soft); display: flex; align-items: center; justify-content: center; color: var(--sage); border: 1px dashed var(--sage); }
.noimg .ic { width: 54px; height: 54px; }
.lightbox { position: fixed; inset: 0; background: rgba(20, 30, 24, .88); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; flex-direction: column; gap: 10px; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 10px; } .lightbox .cap { color: #fff; font-size: 14px; } .lightbox button { position: absolute; top: 14px; right: 18px; background: #fff; border: 0; border-radius: 10px; width: 40px; height: 40px; font-size: 22px; cursor: pointer; }

/* kanban / calendário */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(250px, 1fr)); gap: 16px; overflow-x: auto; }
.col { background: #F4EBDA; border-radius: 16px; padding: 12px; min-height: 240px; } .col h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--green); margin: 2px 4px 10px; display: flex; justify-content: space-between; }
.col.over { outline: 2px dashed var(--terra); }
.tcard { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; margin-bottom: 10px; cursor: grab; box-shadow: 0 1px 2px rgba(47, 74, 58, .06); }
.tcard a { font-weight: 700; text-decoration: none; display: block; margin-bottom: 4px; } .tcard .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .tcard.dragging { opacity: .45; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); }
.cal .dow { background: #F4EBDA; padding: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--green); text-align: center; }
.cal .day { min-height: 96px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 5px; font-size: 12.5px; } .cal .day:nth-child(7n+1) { border-left: 0; }
.cal .day.out { background: #F8F2E4; color: #b0a78f; } .cal .day.today { background: var(--terra-soft); } .cal .day .dn { font-weight: 700; display: block; margin-bottom: 3px; }
.cal .ev { display: block; background: var(--sage-soft); border-left: 3px solid var(--sage); border-radius: 4px; padding: 1px 5px; margin-top: 2px; text-decoration: none; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cal .ev.late { border-color: var(--brown); background: #FBEEE8; } .cal .ev.done { opacity: .6; text-decoration: line-through; }

/* estágios da adoção */
.stages { display: flex; gap: 4px; margin: 4px 0 18px; flex-wrap: wrap; }
.stage { flex: 1 1 90px; text-align: center; font-size: 11.5px; padding: 8px 4px; border-radius: 9px; background: #EFEADD; color: var(--muted); font-weight: 600; line-height: 1.25; }
.stage.done { background: var(--sage); color: #fff; } .stage.now { background: var(--terra); color: #fff; }

/* login */
.authwrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; overflow: hidden; }
.authwrap::before { content: ""; position: absolute; width: 460px; height: 460px; top: -190px; right: -170px; border-radius: 50%; background: radial-gradient(circle, rgba(230, 210, 179, .85), rgba(230, 210, 179, 0) 68%); }
.authwrap::after { content: ""; position: absolute; width: 400px; height: 400px; bottom: -170px; left: -150px; border-radius: 50%; background: radial-gradient(circle, rgba(122, 143, 90, .26), rgba(122, 143, 90, 0) 68%); }
.authcard { position: relative; z-index: 1; width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 30px 26px; box-shadow: var(--shadow); text-align: center; }
.authcard img.logo { width: 220px; max-width: 70%; height: auto; margin-bottom: 14px; }
.authcard h1 { font-size: 19px; color: var(--green); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; } .authcard .slogan { color: var(--terra); font-weight: 600; margin-bottom: 22px; }
.authcard form { text-align: left; } .authcard .fld { margin-bottom: 14px; }
.authcard .btn { width: 100%; min-height: 48px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }

/* público */
.pubtop { background: var(--green); color: #fff; padding: 14px 24px; display: flex; align-items: center; gap: 14px; } .pubtop img { height: 48px; width: auto; }
.pubmain { max-width: 1000px; margin: 0 auto; padding: 28px 20px 60px; }

@media (max-width: 1000px) {
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g32 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  #animal-grid { grid-template-columns: 1fr !important; }
  .shell { display: block; }
  .side { position: fixed; left: 0; top: 0; width: 276px; transform: translateX(-100%); transition: transform .22s; box-shadow: 8px 0 30px rgba(0, 0, 0, .25); }
  body.nav-open .side { transform: none; } body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(20, 30, 24, .5); z-index: 35; }
  .top { padding: 0 14px; } .top .burger { display: inline-flex; } .me .nm { display: none; }
  .content { padding: 18px 14px 50px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .fgrid > .fld { grid-column: span 12 !important; }
  .kv { grid-template-columns: 1fr; gap: 0; } .kv dt { margin-top: 10px; }
  .kanban { grid-template-columns: repeat(3, 280px); }
  .cal .day { min-height: 64px; font-size: 11px; } .cal .ev { font-size: 10.5px; }
  .pagehead h1 { font-size: 21px; }
}
@media print { .side, .top, .btn, .filters { display: none !important; } .shell { display: block; } body { background: #fff; } }
