*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020617;
  color: #e5e7eb;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  background: radial-gradient(circle at top left, #1e293b, #0D1826 55%, #020617 100%);
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.header-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.logo-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0D1826, #1e293b);
  border: 1px solid rgba(200, 169, 107, 0.6);
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: #9ca3af;
}

.tagline {
  font-size: 0.86rem;
  color: #e5e7eb;
  max-width: 320px;
}

.main {
  flex: 1;
  padding: 1.5rem;
}

.card-main {
  max-width: 1160px;
  margin: 0 auto;
  background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.12), rgba(15, 23, 42, 0.96));
  border-radius: 1.25rem;
  border: 1px solid rgba(15, 23, 42, 0.9);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65);
  padding: 1.8rem 1.8rem 1.4rem;
}

.intro h1 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.intro p {
  margin: 0 0 1.3rem;
  font-size: 0.92rem;
  color: #cbd5f5;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.4rem;
}

.col {
  min-width: 0;
}

.form h2,
.sheet h2 {
  margin: 0 0 0.7rem;
  font-size: 1.05rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}

.field label {
  font-weight: 500;
}

.field input,
.field select {
  border-radius: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
}

.field input::placeholder {
  color: #6b7280;
}

.lgpd label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #e5e7eb;
}

.lgpd input[type="checkbox"] {
  margin-top: 0.15rem;
}

.msg-erro {
  font-size: 0.82rem;
  color: #fecaca;
}

.hidden {
  display: none !important;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.4rem;
}

.btn-primary,
.btn-secondary {
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.btn-primary {
  background: linear-gradient(135deg, #C8A96B, #facc15);
  color: #111827;
  font-weight: 600;
  box-shadow: 0 10px 26px rgba(200, 169, 107, 0.55);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 32px rgba(200, 169, 107, 0.7);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.btn-secondary[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.disclaimer {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 0.7rem;
}

.sheet-intro {
  font-size: 0.9rem;
  color: #cbd5f5;
  margin-top: 0.1rem;
  margin-bottom: 0.8rem;
}

.table-wrapper {
  max-height: 320px;
  overflow: auto;
  margin-bottom: 0.8rem;
}

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

.table th,
.table td {
  padding: 0.45rem 0.4rem;
  border-bottom: 1px solid rgba(30, 64, 175, 0.35);
}

.table th {
  text-align: left;
  font-weight: 500;
  color: #cbd5f5;
}

.table td {
  color: #e5e7eb;
}

.table tfoot td {
  font-weight: 600;
}

.input-gasto {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  padding: 0.35rem 0.45rem;
  font-size: 0.86rem;
}

/* Chart card agora com foco em legibilidade de cores */
.chart-card {
  margin-top: 0.8rem;
  padding: 0.9rem 0.9rem 0.75rem;
  border-radius: 0.9rem;
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.chart-card h3 {
  margin: 0 0 0.3rem;
  font-size: 0.98rem;
  color: #e5e7eb;
}

.chart-note {
  margin: 0 0 0.7rem;
  font-size: 0.8rem;
  color: #cbd5f5;
}

.chart-wrapper {
  background: #0b1120;
  border-radius: 0.75rem;
  padding: 0.6rem;
}

.hint {
  margin-top: 0.7rem;
  font-size: 0.8rem;
  color: #cbd5f5;
}

.footer {
  padding: 0.9rem 1.5rem 1.3rem;
  text-align: center;
  font-size: 0.75rem;
  color: #6b7280;
}

/* WhatsApp FAB */
.whatsapp-fab {
  position: fixed;
  right: 1.3rem;
  bottom: 1.3rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  background: #22c55e;
  color: #022c22;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 16px 40px rgba(34, 197, 94, 0.4);
}

/* Responsive */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .main {
    padding: 1rem;
  }

  .card-main {
    padding: 1.3rem 1.1rem 1rem;
  }

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

  .tagline {
    max-width: 100%;
  }

  .whatsapp-fab {
    padding-inline: 0.8rem;
  }
}
