:root {
  --bg: #f7f9fc;
  --card: #ffffff;
  --text: #0d1b2f;
  --muted: #64748b;
  --line: #dce4ef;
  --navy: #09275f;
  --blue: #1368ff;
  --green: #16c084;
  --red: #dc4c64;
  --shadow: 0 18px 45px rgba(18, 37, 63, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(247, 249, 252, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.app-mode .topbar {
  display: none;
}

.brand,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.brand-logo,
.sidebar-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.main-nav {
  display: flex;
  gap: 14px;
  color: var(--muted);
}

.main-nav a {
  padding: 8px 4px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius);
  padding: 11px 15px;
  color: var(--text);
  background: #e9eef6;
  cursor: pointer;
  font-weight: 700;
}

.button.primary {
  color: white;
  background: var(--blue);
}

.button.large {
  min-width: 210px;
  padding: 15px 22px;
  font-size: 16px;
}

.button.ghost {
  background: white;
  border: 1px solid var(--line);
}

.button.light {
  color: var(--blue);
  background: white;
}

.button.google {
  width: 100%;
  color: white;
  background: var(--navy);
}

.button.full {
  width: 100%;
}

.screen {
  display: none;
  padding: 28px;
}

#inicio {
  padding-top: 18px;
}

.screen.active {
  display: block;
}

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

.public-hero {
  max-width: 980px;
  margin: 88px auto 72px;
  text-align: center;
}

.public-hero h1 {
  max-width: 860px;
  margin: 12px auto;
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: 0;
}

.public-hero > p:not(.eyebrow) {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.45;
}

.public-hero .hero-actions,
.public-hero .trust-row {
  justify-content: center;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 30px;
  align-items: start;
  max-width: 1160px;
  margin: 0 auto 20px;
}

.hero-copy {
  padding-top: 42px;
}

.hero-copy h1 {
  max-width: 690px;
  margin: 12px 0;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-copy p,
.pricing-head p {
  max-width: 650px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.eyebrow {
  color: var(--blue);
  font-weight: 800;
}

.hero-actions,
.trust-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.landing-section {
  max-width: 1160px;
  margin: 76px auto;
}

.section-head {
  max-width: 820px;
  margin: 0 auto 36px;
  text-align: center;
}

.section-head h2,
.why-section h2 {
  margin: 0 0 12px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.1;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 20px;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 22px;
  border-radius: 14px;
  color: var(--blue);
  background: #eaf2ff;
  font-weight: 900;
}

.feature-grid article strong {
  display: block;
  margin-bottom: 10px;
  font-size: 22px;
}

.feature-grid article p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.step-grid article {
  padding: 30px;
  border-radius: var(--radius);
  background: white;
  text-align: center;
}

.step-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 22px;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  font-size: 24px;
  font-weight: 900;
}

.step-grid strong {
  display: block;
  margin-bottom: 10px;
  font-size: 20px;
}

.step-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.why-section {
  text-align: center;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 54px;
  max-width: 980px;
  margin: 36px auto 0;
  text-align: left;
}

.why-grid p {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0;
  color: #29415f;
  font-size: 20px;
  line-height: 1.45;
}

.why-grid span {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 3px;
  border: 2px solid var(--green);
  border-radius: 50%;
  background: radial-gradient(circle, var(--green) 0 35%, transparent 38%);
}

.auth-strip {
  margin: 82px -28px -28px;
  padding: 72px 28px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--navy));
  text-align: center;
}

.auth-strip h2 {
  margin: 0 0 14px;
  font-size: 40px;
}

.auth-strip p {
  margin: 0 0 30px;
  font-size: 20px;
}

.auth-page {
  min-height: 100vh;
  background: var(--bg);
}

.auth-shell {
  display: grid;
  justify-items: center;
  gap: 22px;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 34px 22px 60px;
}

.auth-brand-logo {
  width: 86px;
  height: 86px;
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.auth-heading {
  text-align: center;
}

.auth-heading h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 48px);
}

.auth-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 22px;
}

.auth-card {
  width: min(100%, 620px);
  margin-top: 18px;
  padding: 42px 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin: 0 0 28px;
  font-size: 30px;
}

.auth-page-form {
  display: grid;
  gap: 22px;
}

.auth-page-form label {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.auth-page-form input,
.auth-page-form select {
  padding: 16px 18px;
  font-size: 18px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.text-button {
  border: 0;
  padding: 0;
  color: var(--blue);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.auth-submit {
  margin-top: 8px;
  padding: 16px 18px;
  font-size: 18px;
}

.auth-switch {
  margin: 22px 0 0;
  text-align: center;
  color: var(--muted);
}

.auth-switch a {
  color: var(--blue);
  font-weight: 800;
}

.register-only {
  display: none;
}

.register-mode .register-only {
  display: grid;
}


.trust-row span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: white;
  font-size: 14px;
}

.login-card,
.panel,
.welcome-panel,
.metric-card,
.feature-grid article,
.price-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.login-card {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-actions {
  display: grid;
  gap: 8px;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.form-message[data-type="success"] {
  color: #0f9f6e;
}

.form-message[data-type="error"] {
  color: var(--red);
}

.session-card {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.session-card span {
  color: var(--muted);
  font-size: 12px;
}

.session-card strong {
  font-size: 14px;
}

.welcome-panel {
  margin-bottom: 14px;
  padding: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #eef5ff 100%);
}

.welcome-panel span {
  display: block;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.welcome-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.welcome-panel p {
  margin: 6px 0 0;
  color: var(--muted);
}

.link-button {
  justify-self: start;
  border: 0;
  padding: 0;
  color: var(--blue);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.login-logo {
  width: 70px;
  height: 70px;
  border-radius: 18px;
}

.login-card h2,
.pricing-head h2,
.page-head h2 {
  margin: 6px 0;
}

.login-card p,
.panel p,
.muted,
.price-card p {
  color: var(--muted);
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--muted);
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

label {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: white;
}

.feature-grid,
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 1160px;
  margin: 28px auto;
}

.feature-grid article,
.price-card {
  padding: 20px;
}

.app-layout {
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
}

.app-layout.active {
  display: grid;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: calc(100vh - 110px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.sidebar-brand {
  margin-bottom: 12px;
}

.sidebar-brand span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.nav-button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  padding: 12px;
  text-align: left;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.nav-button.active,
.nav-button:hover {
  color: var(--text);
  background: #edf4ff;
}

.workspace {
  min-width: 0;
  max-width: 1240px;
  margin: 0 auto;
}

.page-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.metric-card {
  position: relative;
  min-height: 142px;
  padding: 26px;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 10px 0 0;
  font-size: 30px;
  line-height: 1;
}

.metric-card small {
  position: absolute;
  top: 28px;
  right: 26px;
  color: #0f9f6e;
  font-weight: 800;
}

.metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  border-radius: 10px;
  font-weight: 900;
}

.metric-icon.blue {
  color: var(--blue);
  background: #eaf2ff;
}

.metric-icon.green {
  color: var(--green);
  background: #e9fbf5;
}

.metric-icon.red {
  color: var(--red);
  background: #fff0f3;
}

.metric-icon.violet {
  color: #7c3aed;
  background: #f2eaff;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.panel-grid,
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.85fr);
  gap: 14px;
  margin-top: 14px;
}

.panel {
  padding: 18px;
  min-width: 0;
}

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

.dashboard-actions select {
  width: auto;
  min-width: 160px;
}

.dashboard-panel {
  margin-top: 24px;
  padding: 28px;
}

.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 14px 0 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.legend.center {
  justify-content: center;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
}

.dot.green {
  background: var(--green);
}

.dot.red {
  background: var(--red);
}

.dot.violet {
  background: #7c3aed;
}

.capital-chart {
  position: relative;
  height: 340px;
  overflow: hidden;
  border: 1px solid #eef2f7;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(100, 116, 139, 0.08) 1px, transparent 1px) 0 0 / 16.66% 100%,
    linear-gradient(180deg, rgba(100, 116, 139, 0.08) 1px, transparent 1px) 0 0 / 100% 25%,
    #fff;
}

.area-fill {
  position: absolute;
  inset: 0;
  opacity: 0.72;
  clip-path: polygon(0 76%, 18% 80%, 34% 83%, 50% 78%, 66% 76%, 82% 36%, 100% 38%, 100% 100%, 0 100%);
}

.area-fill.green {
  background: linear-gradient(180deg, rgba(22, 192, 132, 0.45), rgba(22, 192, 132, 0.03));
  border-top: 4px solid var(--green);
}

.area-fill.violet {
  clip-path: polygon(0 88%, 18% 91%, 36% 96%, 56% 98%, 74% 92%, 88% 70%, 100% 18%, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.28), rgba(124, 58, 237, 0.03));
  border-top: 4px solid #7c3aed;
}

.area-fill.red {
  clip-path: polygon(0 63%, 16% 67%, 34% 66%, 50% 72%, 66% 61%, 82% 62%, 100% 72%, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(220, 76, 100, 0.18), rgba(220, 76, 100, 0.02));
  border-top: 3px solid rgba(220, 76, 100, 0.8);
}

.pnl-section {
  margin-top: 44px;
}

.page-head.compact {
  margin-top: 0;
}

.pnl-metrics {
  margin-bottom: 22px;
}

.monthly-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(70px, 1fr));
  align-items: end;
  gap: 18px;
  height: 320px;
  padding: 28px 18px 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(100, 116, 139, 0.08) 1px, transparent 1px) 0 0 / 100% 25%,
    white;
}

.month-group {
  display: grid;
  gap: 10px;
  align-items: end;
  height: 100%;
  text-align: center;
}

.month-bars {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 8px;
  height: 100%;
}

.bar {
  width: 24px;
  min-height: 2px;
  border-radius: 6px 6px 0 0;
}

.bar.income {
  background: var(--green);
}

.bar.expense {
  background: var(--red);
}

.net-dot {
  position: absolute;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14);
}

.chart {
  display: flex;
  align-items: end;
  gap: 12px;
  height: 260px;
  padding: 20px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
}

.chart span {
  flex: 1;
  min-width: 12px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--green), var(--blue));
}

.chart-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.status-list {
  display: grid;
  gap: 10px;
}

.empty-state {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.empty-state p,
.empty-table {
  color: var(--muted);
}

.empty-state p {
  margin: 6px 0 0;
}

.empty-table {
  padding: 24px 10px;
  text-align: center;
}

.status-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.status-item:last-child {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--blue);
  background: #eaf2ff;
  font-size: 12px;
  font-weight: 800;
}

.status-select {
  width: auto;
  min-width: 142px;
  padding: 7px 10px;
  border-color: #cfe0f6;
  color: var(--blue);
  background: #eaf2ff;
  font-size: 13px;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
}

.form-stack {
  display: grid;
  gap: 8px;
}

.is-hidden {
  display: none !important;
}

.account-create-panel,
.movement-create-panel {
  align-self: start;
}

.account-create-panel .form-stack,
.movement-create-panel .form-stack {
  margin-top: 18px;
}

.row-action-cell {
  width: 42px;
  text-align: right;
}

.delete-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: var(--red);
  background: #fff0f3;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}

.delete-row:hover {
  color: white;
  background: var(--red);
}

.pricing-head {
  max-width: 920px;
  margin: 40px auto 24px;
  text-align: center;
}

.pricing-head p {
  margin-left: auto;
  margin-right: auto;
}

.pricing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.price-card strong {
  display: block;
  margin: 12px 0;
  font-size: 26px;
}

.price-card ul {
  padding-left: 18px;
  color: var(--muted);
}

.price-card .button {
  margin-top: 18px;
}

.price-card.highlighted {
  border-color: rgba(19, 104, 255, 0.5);
  transform: translateY(-6px);
}

.price-card.selected {
  border-color: var(--blue);
  box-shadow: 0 18px 45px rgba(19, 104, 255, 0.14);
}

.plan-checkout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.8fr) auto;
  align-items: end;
  gap: 18px;
  max-width: 1160px;
  margin: 18px auto 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}

.plan-checkout h3,
.payment-summary h2,
.payment-card h3 {
  margin: 0 0 8px;
}

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

.plan-checkout label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

.plan-checkout select {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.payment-screen {
  min-height: 100vh;
}

.payment-brand {
  max-width: 1080px;
  margin: 0 auto 24px;
}

.payment-shell {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 18px;
  max-width: 1080px;
  margin: 0 auto;
}

.payment-summary,
.payment-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}

.payment-summary > strong {
  display: block;
  margin: 18px 0 10px;
  font-size: 32px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.summary-row span,
.pay-option small {
  color: var(--muted);
}

.pay-option {
  display: flex;
  gap: 14px;
  padding: 16px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  cursor: pointer;
}

.pay-option:has(input:checked) {
  border-color: var(--blue);
  background: #edf4ff;
}

.pay-option input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.pay-option span {
  display: grid;
  gap: 4px;
}

.payment-card .button {
  margin-top: 14px;
}

.money-hidden .money {
  color: var(--muted) !important;
}

.money-hidden .money::after {
  content: "****";
}

.money-hidden .money {
  font-size: 0;
}

.money-hidden .money::after {
  font-size: 28px;
}

@media (max-width: 900px) {
  .main-nav {
    display: none;
  }

  .hero,
  .app-layout:target,
  .app-layout.active,
  .panel-grid,
  .split,
  .feature-grid,
  .step-grid,
  .why-grid,
  .pricing-grid,
  .plan-checkout,
  .payment-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .hero-copy {
    padding-top: 12px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .topbar,
  .screen {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    gap: 12px;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .public-hero {
    margin: 42px auto 48px;
  }

  .public-hero h1 {
    font-size: 42px;
  }

  .public-hero > p:not(.eyebrow) {
    font-size: 18px;
  }

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

  .hero-copy h1 {
    font-size: 42px;
  }

  .auth-card {
    padding: 28px 20px;
  }

  .label-row {
    display: grid;
  }
}
