:root {
  /* Paleta do Residencial Nova Itaboraí (CRNI): verde-petroleo escuro,
     verde vivo e um dourado de destaque — extraida da identidade real do
     condominio para dar consistencia entre o site do empreendimento e o
     sistema. */
  --bg: #fcfbf8;
  --ink: #0f3d34;
  --muted: #5c7a73;
  --accent: #16a249;
  --accent-dark: #0f3d34;
  --accent-bright: #1ec25a;
  --accent-soft: #e7f3ea;
  --gold: #e0b800;
  --gold-soft: #fbf3d3;
  --panel: #ffffff;
  --shadow: 0 24px 60px rgba(15, 61, 52, 0.16);
  --band-primary: #fcfbf8;
  --band-secondary: #12493e;
  --band-secondary-text: #f2f7f5;
  --band-light: #f0f4f3;
  --border-soft: #d7e5e1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 96px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.band {
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.band--primary {
  background: linear-gradient(135deg, #fdfcf9 0%, #f5f9f6 55%, #eef6f1 100%);
}

.band--secondary {
  background: linear-gradient(160deg, #12493e 0%, #0a2e26 100%);
  color: var(--band-secondary-text);
}

.band--secondary h2,
.band--secondary p,
.band--secondary span {
  color: var(--band-secondary-text);
}

.band--light {
  background: var(--band-light);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 32px;
  align-items: center;
}

.hero__text h1 {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: clamp(2.2rem, 3vw, 3.3rem);
  margin: 12px 0 16px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 560px;
}

.hero__panel {
  background: var(--panel);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #d7e5e1;
}

.hero__panel label {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.hero__panel select {
  padding: 12px 40px 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background-color: #ffffff;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a249' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.hero__panel select:hover,
.hero__panel select:focus {
  border-color: var(--accent);
  outline: none;
}

.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.meta .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  background: var(--panel);
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: var(--accent);
  opacity: 0.7;
}

.card .card__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-dark);
  margin-bottom: 12px;
}

.card .card__icon svg {
  width: 18px;
  height: 18px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
}

.card .value {
  font-size: 1.7rem;
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.card .hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.card.highlight {
  border: 1px solid #e8d68a;
  background: linear-gradient(135deg, var(--gold-soft) 0%, #ffffff 65%);
}

.card.highlight::before {
  background: var(--gold);
  opacity: 1;
}

.card.highlight .card__icon {
  background: var(--gold-soft);
  color: #8a6d00;
}

.chart {
  border-radius: 22px;
  padding: 24px;
}

.chart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.chart__header h2 {
  margin: 0 0 6px;
}

.chart__header p {
  margin: 0;
  color: var(--muted);
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.legend__line {
  width: 32px;
  height: 3px;
  background: var(--accent-bright);
  border-radius: 999px;
}

.chart__area {
  margin-top: 18px;
  width: 100%;
  height: 220px;
}

#saldoSpark {
  width: 100%;
  height: 220px;
}

.table {
  border-radius: 22px;
  padding: 24px;
}

.table__header h2 {
  margin: 0 0 6px;
}

.table__header p {
  margin: 0 0 16px;
  color: var(--muted);
}

.table__wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #d7e5e1;
  font-size: 0.95rem;
}

th {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.data-row button.expand {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.chevron {
  color: var(--accent);
  font-weight: 700;
}

.detail-row td {
  background: #f3f8f5;
  border-bottom: 1px solid #d7e5e1;
}

.detail {
  padding: 12px 8px;
}

.detail h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--accent-dark);
}

.detail-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  border: 1px solid #bcd8ce;
  background: #eaf5ee;
  color: #12493e;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.filter.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.subtotais {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.subtotal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f7f3e8;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.detail ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.detail li {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 10px;
  align-items: center;
  background: #ffffff;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 8px 20px rgba(15, 61, 52, 0.08);
}

.detail li.empty {
  grid-template-columns: 1fr;
  text-align: center;
  color: var(--muted);
  box-shadow: none;
  background: transparent;
}

/* .detail li tem 2 classes de especificidade e vencia o .hidden generico
   (1 classe) — o filtro marcava o item como escondido mas ele continuava
   com display:grid. Esta regra garante que o filtro realmente esconda. */
.detail li.hidden {
  display: none;
}

.tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}

.tag--ajuste {
  background: #f6e6cf;
  color: #8a5a14;
}

.tag--despesa {
  background: #f7d7d3;
  color: #7c2c24;
}

.tag--receita {
  background: #d9f1dd;
  color: #1c6b36;
}

.tag--group {
  background: #edf1e3;
  color: #445343;
}

.detail .name {
  font-weight: 600;
}

.detail .value {
  font-weight: 700;
}

.detail .error {
  color: #b03b2f;
}

.detail .loading {
  color: var(--muted);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-info {
  font-size: 0.9rem;
  color: var(--muted);
}

/* !important de proposito: .hidden e uma classe utilitaria que precisa
   sempre vencer, independente de quantas outras classes com "display"
   proprio o elemento tambem tenha (ja pegamos 2 bugs por causa disso). */
.hidden {
  display: none !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 61, 52, 0.18);
}

.btn.ghost {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--accent);
}

.btn.ghost:hover {
  background: var(--accent-soft);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Home / landing */
.hero--center {
  grid-template-columns: 1fr;
  text-align: center;
  justify-content: center;
}

.hero--center .lead {
  margin-left: auto;
  margin-right: auto;
}

.hero--compact h2 {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  color: var(--ink);
  margin: 0 0 8px;
}

.hero--compact .lead {
  margin-top: 0;
}

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

.brand__mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.hero-illustration {
  position: relative;
  margin: 32px auto 0;
  width: min(220px, 55%);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-illustration__logo {
  width: 82%;
  height: 82%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
  animation: hero-breathe 5s ease-in-out infinite;
}

.hero-illustration__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed var(--accent);
  opacity: 0.55;
  animation: hero-spin 24s linear infinite;
}

.hero-illustration__ring::before {
  content: "";
  position: absolute;
  top: -5px;
  left: calc(50% - 5px);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
}

@keyframes hero-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.035);
  }
}

@keyframes hero-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-illustration__logo,
  .hero-illustration__ring {
    animation: none;
  }
}

.cards--features {
  margin-top: -8px;
}

.cards--features .card__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-dark);
  margin-bottom: 12px;
}

.cards--features .card__icon svg {
  width: 19px;
  height: 19px;
}

.cards--features h3 {
  text-transform: none;
  letter-spacing: normal;
  font-size: 1.1rem;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-weight: 800;
}

.home-actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

/* Selecao de perfil no login */
.selected-role-badge {
  display: inline-block;
  margin: 0 auto 10px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.role-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.role-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  background: var(--panel);
  border: 2px solid var(--border-soft);
  border-radius: 18px;
  padding: 22px 20px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.role-card:hover {
  transform: translateY(-2px);
}

.role-card:hover,
.role-card.active {
  border-color: var(--accent);
}

.role-card .role-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-dark);
  margin-bottom: 4px;
}

.role-card .role-card__icon svg {
  width: 20px;
  height: 20px;
}

.role-card strong {
  font-size: 1.05rem;
}

.role-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.login-form {
  max-width: 380px;
  margin: 28px auto 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.login-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-form .error {
  color: #b03b2f;
  font-size: 0.9rem;
  min-height: 1.2em;
}

.reserva-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  align-items: end;
  margin-top: 16px;
}

.reserva-form label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.reserva-form input,
.reserva-form select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
}

.reserva-form input:focus,
.reserva-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.reserva-form button {
  align-self: end;
}

.reserva-item-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.reserva-item-card strong {
  display: block;
  margin-bottom: 4px;
}

.reserva-item-card__meta {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-pill--pendente {
  background: var(--gold-soft);
  color: #7a5b00;
}

.status-pill--confirmada {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.status-pill--negada,
.status-pill--cancelada {
  background: #f6dcd8;
  color: #9a2f22;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent-dark);
}

.back-link--button {
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  cursor: pointer;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.home-card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 30px 70px rgba(15, 61, 52, 0.2);
}

.home-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
}

.home-card__title {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
}

.home-card__hint {
  font-size: 0.88rem;
  color: var(--muted);
}

.mobile-list {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.mobile-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(15, 61, 52, 0.08);
}

.mobile-card summary {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

.mobile-card summary::-webkit-details-marker {
  display: none;
}

.summary-values {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.mobile-detail {
  margin-top: 12px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .chart__header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 24px 16px 72px;
  }

  .band {
    padding: 22px 18px;
  }

  .hero__text h1 {
    font-size: 2.2rem;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 18px;
  }

  .table__wrap {
    display: none;
  }

  .mobile-list {
    display: flex;
  }

  .detail li {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .detail .value {
    justify-self: flex-end;
  }
}
