@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600&display=swap');

body {
  font-family: 'Fredoka', sans-serif;
  background-color: #fce4ec;
  max-width: 500px;
  margin: 20px auto;
  padding: 10px;
  color: #4a4a4a;
}

.contenedor {
  background: #fff;
  padding: 25px;
  border-radius: 20px;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
  border: 3px solid #ffb6c1;
}

h1 {
  text-align: center;
  color: #ff6f91;
  margin: 0 0 20px;
}

/* Navegación */
.nav-tabs {
  display: flex;
  background: #f8f9fa;
  border-radius: 15px;
  margin-bottom: 20px;
  overflow: hidden;
  border: 2px solid #eee;
}
.nav-tabs button {
  flex: 1;
  padding: 15px;
  font-size: 16px;
  font-family: inherit;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  color: #888;
  transition: 0.3s;
}
.nav-tabs button.activo {
  background: #ff6f91;
  color: #fff;
}

/* Vistas */
.vista {
  display: none;
  animation: fadeIn 0.4s;
}
.vista.activa {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Formulario */
.fila-top {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}
.campo {
  flex: 1;
  display: flex;
  flex-direction: column;
}
label {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 5px;
  color: #ff6f91;
}
input, select {
  padding: 12px;
  border: 2px solid #f0e6ea;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
}
input:focus, select:focus {
  border-color: #ff6f91;
}

/* Categorías */
.categorias {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}
.categorias input[type="radio"] {
  display: none;
}
.categorias label {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  background: #f8f9fa;
  border: 2px solid #eee;
  border-radius: 15px;
  cursor: pointer;
  transition: 0.2s;
  font-size: 11px;
  color: #666;
  width: 85px;
  text-align: center;
}
.categorias label span {
  font-size: 24px;
  margin-bottom: 5px;
}
.categorias input[type="radio"]:checked + label {
  background: #ffe4e1;
  border-color: #ff6f91;
  color: #ff6f91;
  transform: scale(1.05);
}

.fila-botones {
  display: flex;
  gap: 10px;
}
.btn-accion {
  flex: 1;
  padding: 15px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
}
.btn-guardar { background: #845ec2; }
.btn-borrar { background: #ff9671; }

/* Dashboard */
.filtro-mes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  background: #f8f9fa;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid #eee;
}
.filtro-mes select {
  padding: 8px 15px;
  font-weight: bold;
  color: #845ec2;
  border-color: #d5cabd;
}

.dash-tarjetas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}
.tarjeta {
  background: #f9f6f7;
  padding: 15px;
  border-radius: 15px;
  text-align: center;
  border: 2px solid #eee;
}
.tarjeta.destacada {
  grid-column: span 2;
  background: #dff6e3;
  border-color: #00c9a7;
}
.tarjeta-titulo {
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
}
.tarjeta-valor {
  font-size: 22px;
  font-weight: bold;
  color: #333;
}
.tarjeta.destacada .tarjeta-valor {
  font-size: 28px;
  color: #00c9a7;
}

.grafico-contenedor {
  position: relative;
  height: 250px;
  width: 100%;
  background: #fff;
  padding: 10px;
  border-radius: 15px;
  border: 2px dashed #eee;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
}

.historial {
  margin-top: 20px;
  font-size: 14px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 5px;
}
.registro-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #f8f9fa;
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid #eee;
}
.info-registro {
  display: flex;
  flex-direction: column;
}
.monto-registro {
  font-weight: bold;
  font-size: 16px;
}
.btn-eliminar {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 5px;
  opacity: 0.7;
  transition: 0.2s;
}
.btn-eliminar:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Toast de notificación */
#toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: #845ec2;
  color: #fff;
  padding: 12px 25px;
  border-radius: 30px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.toast.eliminado { background: #ff9671; }
.toast.fade-out { animation: fadeOut 0.4s forwards; }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(50px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(20px); }
}
