:root {
  --primary: #008080;
  --accent: #000000;
  --bg: #f8f9fa;
  --text: #343a40;
  --white: #fff;
  --border-radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

header {
  background: var(--primary);
  color: var(--white);
  padding: 1rem;
  text-align: center;
}

main {
  flex: 1;
  padding: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Formulario */
.card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

label {
  display: block;
  margin-top: 0.75rem;
  font-weight: 500;
}

input {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.25rem;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 1rem;
}

button {
  width: 100%;
  padding: 0.75rem;
  margin-top: 1.25rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

button[type="submit"] {
  background: var(--primary);
  color: white;
}

/* Resultados */
#resultadoPanel {
  margin-top: 1.5rem;
}

.resumen-grid {
  display: grid;
  gap: 1.5rem;
}

/* Wallet */
.wallet-card {
  background: linear-gradient(135deg, #007b8f, #00b4a9);
  color: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  height: 100%;
}

.wallet-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.wallet-card .amount {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0.75rem 0;
}

.wallet-card p {
  margin-bottom: 0.5rem;
}

/* Gráfico */
.chart-container {
  position: relative;
  width: 100%;
  min-height: 280px;
  margin: 0.5rem 0;
}

/* Texto de ahorro */
.ahorro-texto {
  font-size: 1rem;
  background: rgba(255,255,255,0.9);
  border-radius: 6px;
  padding: 0.75rem;
  margin: 0.75rem 0;
  text-align: center;
}

.ahorro-texto.alerta {
  color: #dc3545;
  font-weight: 600;
}

footer {
  text-align: center;
  padding: 1rem;
  background: #e9ecef;
  font-size: 0.875rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  main {
    padding: 1.5rem;
  }

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

  .chart-container {
    min-height: 320px;
  }
}

@media (min-width: 992px) {
  .card {
    padding: 1.75rem;
  }

  .wallet-card {
    padding: 1.75rem;
  }

  .chart-container {
    min-height: 340px;
  }
}

.hidden {
  display: none;
}

.btn-secondary {
  background: var(--accent);
  color: white;
  width: auto;
  padding: 0.5rem 1.25rem;
  margin-top: 0;
}

.volver-box {
  text-align: center;
  margin-top: 1rem;
}
.btn-detalle{
  background: var(--accent);
  color: white;
  width: auto;
  padding: 0.5rem 1.25rem;
  margin-top: 0;
}
