/* ============================================================
   Natal Solidário — Projeto Amor e Vida
   Design system v3: vermelho #e51e3b + laranja #f7931e
   Superfícies claras rosadas, raios generosos, hero gradiente
   ============================================================ */

:root {
  --red: #e51e3b;
  --red-deep: #b3122c;
  --orange: #f7931e;
  --orange-deep: #d97a06;
  --grad: linear-gradient(120deg, #d90f2f 0%, #e51e3b 45%, #f7931e 115%);
  --grad-btn: linear-gradient(120deg, #e51e3b 0%, #f7931e 130%);
  --grad-soft: linear-gradient(135deg, rgba(229, 30, 59, 0.08), rgba(247, 147, 30, 0.08));

  --bg: #f8eff0;
  --surface: #ffffff;
  --surface-2: #fdf4ee;
  --ink: #1e1418;
  --ink-soft: #85696e;
  --border: #f2dfda;
  --border-strong: #e8ccc4;

  --thead-bg: #b3122c;

  --chart-red: #e51e3b;
  --chart-orange: #f7931e;
  --chart-green: #2e7d43;
  --chart-neutral: #f0dfd8;

  --ok: #2e7d43;
  --ok-soft: #e7f4ea;
  --warn-soft: #fdeaed;
  --orange-soft: #fef0dd;
  --neutral-soft: #f5ebe7;
  --purple: #7028c9;
  --purple-soft: #f3eafd;

  --radius: 24px;
  --radius-sm: 14px;
  --shadow: 0 4px 24px rgba(150, 40, 30, 0.07);
  --shadow-lift: 0 14px 40px rgba(150, 40, 30, 0.13);
}

[data-theme="dark"] {
  --bg: #171013;
  --surface: #221820;
  --surface-2: #2b1f26;
  --ink: #f6ecee;
  --ink-soft: #b1949a;
  --border: #3b2b31;
  --border-strong: #4e3a41;

  --thead-bg: #8c1024;

  --chart-red: #c62333;
  --chart-orange: #cc7000;
  --chart-green: #46a862;
  --chart-neutral: #3c3034;

  --ok: #57b671;
  --ok-soft: #1f3226;
  --warn-soft: #3c1e24;
  --orange-soft: #3a2b18;
  --neutral-soft: #2e2529;
  --purple: #b492f5;
  --purple-soft: #322145;

  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lift: 0 14px 40px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-size: 15.5px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  transition: background 0.25s ease, color 0.25s ease;
}

/* ---------- Tipografia utilitária ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--red);
}

.eyebrow svg {
  width: 14px;
  height: 14px;
}

/* ---------- Layout ---------- */

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 28px 90px;
}

.container-narrow {
  max-width: 780px;
  padding-bottom: 140px;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  /* "none" (não "translateY(0)") — qualquer transform diferente de none cria um
     novo contexto de empilhamento, o que prendia o menu de downloads atrás das
     seções seguintes mesmo com z-index alto, uma vez que a animação terminava. */
  to {
    opacity: 1;
    transform: none;
  }
}

.fade-in {
  animation: fadeUp 0.5s ease both;
}

.fade-in-1 { animation-delay: 0.06s; }
.fade-in-2 { animation-delay: 0.14s; }
.fade-in-3 { animation-delay: 0.22s; }
.fade-in-4 { animation-delay: 0.3s; }

/* ---------- Header de página ---------- */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.page-header-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  color: inherit;
}

.logo-chip {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: #ffffff;
  border: 2.5px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.logo-chip svg {
  width: 44px;
  height: 44px;
}

.page-header-text h1 {
  margin: 2px 0 4px;
  font-size: 2.35rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.05;
}

.page-header-text p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
}

.nav-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--surface);
  border-radius: 14px;
  padding: 4px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 11px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-tab svg {
  width: 16px;
  height: 16px;
}

.nav-tab:hover {
  color: var(--ink);
}

.nav-tab.ativo {
  background: var(--grad-btn);
  color: #fff;
}

/* ---------- Botões ---------- */

.btn {
  border: none;
  border-radius: 16px;
  padding: 12px 22px;
  font-size: 0.93rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, background 0.18s ease;
  font-family: inherit;
  line-height: 1.2;
}

.btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 8px 22px rgba(229, 30, 59, 0.32);
}

.btn-primary:hover {
  box-shadow: 0 12px 28px rgba(229, 30, 59, 0.42);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
}

.btn-outline {
  background: transparent;
  color: var(--red);
  border: 1.5px solid var(--red);
}

.btn-outline:hover {
  background: var(--warn-soft);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1.5px solid var(--red);
}

.btn-hero-solid {
  background: #ffffff;
  color: var(--red-deep);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.btn-hero-glass {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(4px);
}

.btn-sm {
  padding: 8px 15px;
  font-size: 0.85rem;
  border-radius: 12px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--grad);
  border-radius: 28px;
  padding: 38px 40px;
  color: #fff;
  box-shadow: var(--shadow-lift);
  display: flex;
  align-items: center;
  gap: 34px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.hero::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -110px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 60px solid rgba(255, 255, 255, 0.07);
  pointer-events: none;
}

.hero::before {
  content: "";
  position: absolute;
  right: 130px;
  bottom: -130px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 50px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.hero-main {
  flex: 1.5;
  min-width: 300px;
  position: relative;
  z-index: 1;
}

.hero .eyebrow {
  color: #ffe3d1;
  margin-bottom: 14px;
}

.hero-headline {
  margin: 0 0 12px;
  font-size: 2.3rem;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.5px;
  max-width: 560px;
}

.hero-sub {
  margin: 0 0 24px;
  font-size: 0.98rem;
  opacity: 0.94;
  max-width: 520px;
  line-height: 1.55;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-panel {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 270px;
  max-width: 360px;
  background: rgba(120, 8, 20, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  padding: 24px 26px;
  backdrop-filter: blur(6px);
}

.hero-panel-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.hero-panel-top span {
  font-size: 1rem;
  font-weight: 700;
}

.hero-panel-pct {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
}

.progress-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-fill {
  height: 100%;
  background: #ffffff;
  border-radius: 999px;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 6px;
}

.hero-panel-legenda {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
}

.hero-panel-legenda strong {
  font-weight: 900;
  font-size: 1rem;
}

/* ---------- Próximas ações ---------- */

.prior-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px 30px 10px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.prior-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.prior-head h2 {
  margin: 6px 0 0;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.3px;
}

.chip-agora {
  background: var(--neutral-soft);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 0.8rem;
  font-weight: 700;
}

.prior-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0 28px;
}

.prior-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 4px;
  border-top: 1px solid var(--border);
  background: none;
  border-left: none;
  border-right: none;
  border-bottom: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  width: 100%;
  color: var(--ink);
  transition: transform 0.15s ease;
}

.prior-item:hover {
  transform: translateX(3px);
}

.prior-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.prior-icon svg {
  width: 24px;
  height: 24px;
}

.prior-icon.warn { background: var(--warn-soft); color: var(--red); }
.prior-icon.orange { background: var(--orange-soft); color: var(--orange-deep); }
.prior-icon.roxo { background: var(--purple-soft); color: var(--purple); }
.prior-icon.ok { background: var(--ok-soft); color: var(--ok); }

.prior-info {
  flex: 1;
  min-width: 0;
}

.prior-titulo {
  font-size: 1.02rem;
  font-weight: 800;
  margin-bottom: 3px;
}

.prior-sub {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.prior-item > svg {
  width: 18px;
  height: 18px;
  color: var(--ink-soft);
  flex-shrink: 0;
}

/* ---------- KPI cards ---------- */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.kpi-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon svg {
  width: 24px;
  height: 24px;
}

.kpi-icon.ok { background: var(--ok-soft); color: var(--ok); }
.kpi-icon.warn { background: var(--warn-soft); color: var(--red); }
.kpi-icon.orange { background: var(--orange-soft); color: var(--orange-deep); }
.kpi-icon.neutral { background: var(--neutral-soft); color: var(--ink-soft); }

.kpi-value {
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.05;
}

.kpi-label {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 600;
}

/* ---------- Charts ---------- */

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 10px;
}

.chart-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chart-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.chart-card.wide {
  grid-column: 1 / -1;
}

.chart-card h3 {
  margin: 0 0 16px;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-card h3 svg {
  width: 16px;
  height: 16px;
  color: var(--red);
}

.chart-body {
  display: flex;
  align-items: center;
  gap: 20px;
}

.chart-svg-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-center-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 900;
}

.donut-seg {
  transition: stroke-dasharray 1s cubic-bezier(0.22, 1, 0.36, 1),
    stroke-dashoffset 1s cubic-bezier(0.22, 1, 0.36, 1),
    stroke-width 0.2s ease, filter 0.2s ease;
  cursor: pointer;
}

.donut-seg:hover {
  stroke-width: 21;
  filter: brightness(1.08);
}

.bar-rect {
  transition: y 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.2s ease;
  cursor: pointer;
}

.bar-rect:hover {
  filter: brightness(1.12);
}

.bar-label {
  opacity: 0;
  transition: opacity 0.4s ease 0.6s;
}

.bars-svg.animado .bar-label {
  opacity: 1;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
  min-width: 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.89rem;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 4px;
  flex-shrink: 0;
}

.legend-value {
  margin-left: auto;
  font-weight: 800;
}

.bars-wrap {
  width: 100%;
  overflow-x: auto;
}

.bars-svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Section head ---------- */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 34px 0 16px;
}

.section-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title svg {
  width: 22px;
  height: 22px;
  color: var(--red);
}

/* ---------- Dropdown downloads ---------- */

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow-lift);
  min-width: 270px;
  max-height: min(70vh, 480px);
  overflow-y: auto;
  padding: 10px;
  z-index: 50;
  animation: fadeUp 0.2s ease both;
}

/* Quando não cabe abaixo do botão, abre para cima em vez de sumir da tela. */
.dropdown-menu.abre-para-cima {
  top: auto;
  bottom: calc(100% + 8px);
  animation: fadeDown 0.2s ease both;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.dropdown-menu button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 13px;
  border-radius: 11px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
}

.dropdown-menu button svg {
  width: 16px;
  height: 16px;
  color: var(--red);
  flex-shrink: 0;
}

.dropdown-menu button:hover {
  background: var(--surface-2);
}

.dropdown-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 10px;
}

.dropdown-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-soft);
  padding: 8px 13px 4px;
}

/* ---------- Filtros ---------- */

.filtros-painel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.filtros-busca {
  margin-bottom: 16px;
}

.filtros-busca .input-icon {
  position: relative;
}

.filtros-busca .input-icon svg {
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--ink-soft);
  pointer-events: none;
}

.filtros-busca input {
  width: 100%;
  padding: 14px 18px 14px 46px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filtros-selects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 13px;
}

.filtro-campo label {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--ink-soft);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.filtro-campo select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filtros-busca input:focus,
.filtro-campo select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(229, 30, 59, 0.14);
}

.filtro-campo select:hover {
  border-color: var(--orange);
}

.filtros-rodape {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  min-height: 22px;
}

.filtros-resultado {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.link-limpar {
  border: none;
  background: none;
  color: var(--red);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px;
  font-family: inherit;
}

.link-limpar:hover {
  text-decoration: underline;
}

/* ---------- Tabela ---------- */

.table-wrap {
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

thead th {
  text-align: left;
  padding: 14px 16px;
  background: var(--thead-bg);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  position: sticky;
  top: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  z-index: 5;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}

tbody tr.data-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

tbody tr.data-row:hover {
  background: var(--surface-2);
}

@keyframes destaqueLinha {
  0%, 45% { background: var(--warn-soft); }
  75% { background: var(--orange-soft); }
  100% { background: transparent; }
}

tr.linha-destaque td {
  animation: destaqueLinha 6.5s ease-out;
}

tr.linha-destaque td:first-child {
  box-shadow: inset 4px 0 0 var(--red);
}

@keyframes badgeAquiEntra {
  0% { opacity: 0; transform: translateY(-4px) scale(0.9); }
  6% { opacity: 1; transform: translateY(0) scale(1); }
  88% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-4px) scale(0.9); }
}

.badge-aqui {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--red);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  animation: badgeAquiEntra 6.5s ease forwards;
}

.badge-aqui svg {
  width: 11px;
  height: 11px;
}

.nome-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 320px;
}

.nome-linha {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nome-cell strong {
  font-size: 0.98rem;
}

.nome-acoes {
  display: flex;
  gap: 4px;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

tr.data-row:hover .nome-acoes {
  opacity: 1;
}

.nome-acoes .btn-quick {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.nome-acoes .btn-quick svg {
  width: 14px;
  height: 14px;
}

.tags-row {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
}

.avatar-thumb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-strong);
  vertical-align: middle;
}

.avatar-thumb-vazio {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--grad-soft);
  border: 2px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: var(--red);
  font-weight: 800;
  vertical-align: middle;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.tag svg {
  width: 11px;
  height: 11px;
}

.tag-especial {
  background: var(--purple-soft);
  color: var(--purple);
}

.tag-pendente {
  background: var(--warn-soft);
  color: var(--red);
}

.tag-entregue {
  background: var(--ok-soft);
  color: var(--ok);
}

.tag-apadrinhada {
  background: var(--ok-soft);
  color: var(--ok);
}

.tag-sem-padrinho {
  background: var(--neutral-soft);
  color: var(--ink-soft);
}

.tag-incompleto {
  background: var(--orange-soft);
  color: var(--orange-deep);
}

/* Status do presente como tags clicáveis (pendente = vermelho, entregue = verde) */

.status-toggle {
  display: inline-flex;
  gap: 8px;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-soft);
  transition: all 0.15s ease;
}

.status-tag svg {
  width: 14px;
  height: 14px;
}

.status-tag:hover {
  border-color: var(--border-strong);
  opacity: 0.85;
}

.status-tag[data-value="pendente"].ativo {
  background: var(--warn-soft);
  color: var(--red);
  border-color: var(--red);
}

.status-tag[data-value="entregue"].ativo {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: var(--ok);
}

.acao-btns {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-quick {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--orange-deep);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-quick:hover {
  background: var(--orange-soft);
  transform: translateY(-1px);
}

.btn-quick svg {
  width: 16px;
  height: 16px;
}

.btn-quick.abrir {
  color: var(--red);
}

.btn-quick.abrir:hover {
  background: var(--warn-soft);
}

.btn-quick.excluir {
  color: var(--ink-soft);
}

.btn-quick.excluir:hover {
  background: var(--warn-soft);
  color: var(--red);
  border-color: var(--red);
}

.quick-row td {
  background: var(--surface-2);
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.quick-form {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
  animation: fadeUp 0.25s ease both;
}

.quick-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-soft);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.quick-field input,
.quick-field select {
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  min-width: 190px;
}

.quick-field input:focus,
.quick-field select:focus {
  outline: none;
  border-color: var(--red);
}

.quick-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  padding-bottom: 10px;
}

.quick-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
}

.vazio {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

.vazio svg {
  width: 46px;
  height: 46px;
  color: var(--border-strong);
  margin-bottom: 10px;
}

.vazio p {
  margin: 0;
  font-weight: 600;
}

/* ---------- Página de cadastro ---------- */

.page-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.page-head h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.3px;
}

.page-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.page-head-actions .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.page-head-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
}

.crianca-nav {
  display: flex;
  gap: 8px;
}

.crianca-nav .btn-quick {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.crianca-nav .btn-quick svg {
  width: 18px;
  height: 18px;
}

.crianca-nav .btn-quick:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.toast-sucesso {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  background: var(--ok);
  color: #fff;
  padding: 13px 22px;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  gap: 9px;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-sucesso svg {
  width: 18px;
  height: 18px;
}

.toast-sucesso.visivel {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

fieldset {
  border: none;
  border-radius: var(--radius);
  padding: 22px 24px 24px;
  margin: 0 0 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

legend {
  padding: 5px 16px;
  font-weight: 800;
  font-size: 0.75rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--grad-btn);
  border-radius: 999px;
}

.field {
  margin-bottom: 14px;
}

.field-row {
  display: flex;
  gap: 14px;
}

.field-row .field {
  flex: 1;
}

.field-narrow {
  max-width: 175px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(229, 30, 59, 0.14);
}

.field-hint {
  display: block;
  font-size: 0.76rem;
  color: var(--ink-soft);
  margin-top: 5px;
  min-height: 15px;
}

.field-hint-ok { color: var(--ok); }
.field-hint-erro { color: var(--red); }

.checkbox-field label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.95rem;
  color: var(--ink);
  font-weight: 600;
}

.checkbox-field input {
  width: 17px;
  height: 17px;
  accent-color: var(--red);
}

.form-erro {
  background: var(--warn-soft);
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 13px;
  padding: 12px 15px;
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0 0 16px;
}

.spacer {
  flex: 1;
}

/* Foto */

.foto-field {
  display: flex;
  align-items: center;
  gap: 20px;
}

.foto-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--orange);
}

.foto-preview-vazia {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--grad-soft);
  border: 2px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-align: center;
  font-weight: 600;
}

.foto-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Save bar */

.save-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.1);
  padding: 14px 24px;
  z-index: 30;
}

.save-bar-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Login (tela dividida) ---------- */

.login-body {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.login-split {
  width: 100%;
  max-width: 1120px;
  min-height: 640px;
  background: var(--surface);
  border-radius: 32px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  box-shadow: 0 30px 90px rgba(120, 20, 20, 0.22);
}

.login-lado-marca {
  position: relative;
  overflow: hidden;
  background: var(--grad);
  color: #fff;
  padding: 44px 46px;
  display: flex;
  flex-direction: column;
}

.login-lado-marca::after {
  content: "";
  position: absolute;
  left: -110px;
  top: 30%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 55px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.login-lado-marca::before {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -90px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 50px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.login-marca-topo {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 52px;
  position: relative;
  z-index: 1;
}

.login-marca-topo .logo-chip {
  border: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.login-marca-topo h1 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
}

.login-marca-topo span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  opacity: 0.85;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  margin-bottom: 26px;
  align-self: flex-start;
  position: relative;
  z-index: 1;
}

.login-badge svg {
  width: 14px;
  height: 14px;
}

.login-headline {
  margin: 0 0 18px;
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.8px;
  position: relative;
  z-index: 1;
}

.login-frase {
  margin: 0 0 auto;
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.93;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.login-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 34px 0 18px;
  position: relative;
  z-index: 1;
}

.login-feature {
  background: rgba(120, 8, 20, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.login-feature svg {
  width: 20px;
  height: 20px;
  margin-bottom: 8px;
}

.login-feature strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.login-feature span {
  font-size: 0.78rem;
  opacity: 0.85;
  line-height: 1.4;
}

.login-rodape {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.login-rodape svg {
  width: 15px;
  height: 15px;
}

.login-lado-form {
  padding: 54px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--warn-soft);
  color: var(--red);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  align-self: flex-start;
  margin-bottom: 22px;
}

.login-pill svg {
  width: 13px;
  height: 13px;
}

.login-lado-form h2 {
  margin: 0 0 8px;
  font-size: 2.3rem;
  font-weight: 900;
  letter-spacing: -0.7px;
}

.login-sub {
  margin: 0 0 30px;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.login-label {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  margin-bottom: 9px;
}

.login-campo {
  position: relative;
  margin-bottom: 12px;
}

.login-campo > svg {
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--ink-soft);
  pointer-events: none;
}

.login-campo input {
  width: 100%;
  padding: 15px 52px 15px 48px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  font-size: 1rem;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
}

.login-campo input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(229, 30, 59, 0.14);
}

.btn-olho {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: none;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.btn-olho:hover {
  background: var(--surface-2);
}

.btn-olho svg {
  width: 19px;
  height: 19px;
}

.login-dica {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.login-dica svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.login-btn {
  width: 100%;
  padding: 16px 22px;
  font-size: 1rem;
  border-radius: 16px;
  justify-content: space-between;
}

.login-btn .login-btn-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-divisor {
  height: 1px;
  background: var(--border);
  margin: 28px 0 20px;
}

.login-nota {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.login-nota svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--red);
  margin-top: 1px;
}

/* ---------- Documentos de impressão ---------- */

.print-area {
  display: none;
}

.doc {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #241a1c;
  background: #fff;
  padding: 8px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.doc-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  margin-bottom: 4px;
}

.doc-logo {
  width: 54px;
  height: 54px;
  border-radius: 13px;
  border: 2px solid #e51e3b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-logo svg {
  width: 38px;
  height: 38px;
}

.doc-header-text h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #241a1c;
}

.doc-header-text p {
  margin: 2px 0 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #b3122c;
  font-weight: 700;
}

.doc-rule {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e51e3b, #f7931e);
  margin-bottom: 18px;
}

.doc-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.doc-title-row h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.doc-title-row span {
  font-size: 12px;
  color: #806b66;
  font-weight: 600;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.doc thead th {
  background: #b3122c;
  color: #fff;
  padding: 8px 10px;
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: static;
  border-bottom: 2px solid #f7931e;
}

.doc tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid #eedcd2;
  white-space: normal;
}

.doc tbody tr:nth-child(even) td {
  background: #fdf3ec;
}

.doc tbody td strong {
  color: #b3122c;
}

.doc-footer {
  margin-top: 16px;
  font-size: 11px;
  color: #806b66;
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.doc h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #b3122c;
  margin: 20px 0 8px;
  font-weight: 800;
}

.doc .ficha-tabela th {
  width: 170px;
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid #eedcd2;
  color: #806b66;
  font-weight: 700;
  background: none;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.doc .ficha-foto {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #f7931e;
  margin-bottom: 14px;
}

.tag-sacola {
  width: 400px;
  margin: 30px auto;
  border: 4px solid #e51e3b;
  border-radius: 24px;
  padding: 34px 28px;
  text-align: center;
  background: #fff;
}

.tag-sacola .doc-logo {
  margin: 0 auto 14px;
  width: 64px;
  height: 64px;
}

.tag-sacola .doc-logo svg {
  width: 46px;
  height: 46px;
}

.tag-sacola-selo {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: #b3122c;
  font-weight: 800;
  margin-bottom: 12px;
}

.tag-sacola-nome {
  font-size: 42px;
  font-weight: 900;
  color: #241a1c;
  line-height: 1.1;
  margin-bottom: 12px;
  overflow-wrap: break-word;
}

.tag-sacola-rodape {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e51e3b, #f7931e);
  max-width: 180px;
  margin: 0 auto;
}

.etiqueta {
  width: 360px;
  margin: 30px auto;
  padding: 26px;
  border: 3px dashed #e51e3b;
  border-radius: 18px;
  text-align: center;
  background: #fff;
}

.etiqueta .doc-logo {
  margin: 0 auto 10px;
}

.etiqueta-selo {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #b3122c;
  margin-bottom: 10px;
  font-weight: 800;
}

.etiqueta-nome {
  font-size: 28px;
  font-weight: 900;
  color: #241a1c;
  margin-bottom: 8px;
}

.etiqueta-linha {
  font-size: 13.5px;
  color: #241a1c;
  margin-bottom: 4px;
}

.etiqueta-padrinho {
  margin-top: 10px;
  font-size: 13.5px;
  font-weight: 800;
  color: #b3122c;
}

@media print {
  body * {
    visibility: hidden;
  }
  .print-area,
  .print-area * {
    visibility: visible;
  }
  .print-area {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
  }
}

/* ---------- Responsivo ---------- */

@media (max-width: 980px) {
  .login-split {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .login-lado-marca {
    padding: 34px 30px;
  }
  .login-headline {
    font-size: 2rem;
  }
  .login-lado-form {
    padding: 36px 30px;
  }
}

@media (max-width: 860px) {
  .page-header-text h1 {
    font-size: 1.7rem;
  }
  .hero {
    padding: 28px 26px;
  }
  .hero-headline {
    font-size: 1.7rem;
  }
  .field-row {
    flex-direction: column;
  }
  .field-narrow {
    max-width: none;
  }
  .foto-field {
    flex-direction: column;
    align-items: flex-start;
  }
  .login-features {
    grid-template-columns: 1fr;
  }
}
