:root {
  --brand: #2c7a4b;
  --brand-dark: #1f5c38;
  --brand-light: #eaf5ee;
  --ingreso: #27ae60;
  --gasto: #e74c3c;
  --radius: 1rem;
  --radius-sm: 0.65rem;
  --shadow: 0 2px 10px rgba(15, 40, 25, 0.06);
  --shadow-hover: 0 10px 24px rgba(15, 40, 25, 0.12);
}

body {
  background-color: #f4f6f5;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #26332c;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.text-brand { color: var(--brand) !important; }

/* ── Navbar ─────────────────────────────────────────────── */
.app-navbar {
  background: linear-gradient(100deg, var(--brand-dark), var(--brand) 130%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.app-navbar .navbar-brand {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.app-navbar .nav-link {
  color: rgba(255, 255, 255, 0.82) !important;
  border-radius: 999px;
  padding: 0.4rem 0.9rem !important;
  margin: 0 0.1rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.app-navbar .nav-link:hover {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.1);
}

.app-navbar .nav-link.active {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.18);
  font-weight: 600;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-summary {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.card-summary .value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

.stat-icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.stat-icon.ingreso { background: rgba(39, 174, 96, 0.12); color: var(--ingreso); }
.stat-icon.gasto   { background: rgba(231, 76, 60, 0.12); color: var(--gasto); }
.stat-icon.balance { background: var(--brand-light); color: var(--brand); }

/* ── Botones ────────────────────────────────────────────── */
.btn-brand {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  box-shadow: 0 2px 8px rgba(44, 122, 75, 0.25);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-brand:hover {
  background-color: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
  box-shadow: 0 4px 14px rgba(44, 122, 75, 0.35);
}

.btn-brand:active { transform: translateY(1px); }

.btn-outline-secondary, .btn-outline-danger {
  border-radius: 999px;
}

/* ── Icono de categoría / fondo ─────────────────────────── */
.cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: #fff;
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.cat-icon.cat-icon-sm {
  width: 1.6rem;
  height: 1.6rem;
  font-size: 0.8rem;
}

.cat-icon.cat-icon-lg {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.25rem;
}

.cat-row {
  display: inline-flex;
  align-items: center;
}

.badge-color-dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  margin-right: 0.4rem;
}

/* ── Selector de iconos ─────────────────────────────────── */
.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.icon-picker input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.icon-picker label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.6rem;
  border: 1px solid #dfe6e2;
  color: #6c8578;
  cursor: pointer;
  transition: all 0.12s ease;
  font-size: 1.05rem;
}

.icon-picker label:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.icon-picker input[type="radio"]:checked + label {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ── Progreso ───────────────────────────────────────────── */
.progress {
  height: 0.65rem;
  border-radius: 999px;
  background-color: #e9ede9;
}

.progress-bar {
  border-radius: 999px;
}

/* ── Tablas ─────────────────────────────────────────────── */
.table > :not(caption) > * > * {
  border-bottom-color: #eef1ee;
}

.table-hover > tbody > tr:hover > * {
  background-color: #f7faf8;
}

/* ── Estado vacío ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: #8a978f;
}

.empty-state i {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.6rem;
  opacity: 0.6;
}

/* ── Login / Registro ───────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 40%),
              linear-gradient(135deg, var(--brand-dark), var(--brand));
  position: relative;
  overflow: hidden;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  border-radius: 1.25rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  position: relative;
  z-index: 1;
}

.auth-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  background: var(--brand-light);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 0.75rem;
}

/* ── Fondos: tarjeta compacta ───────────────────────────── */
.fondo-chip {
  border: 1px solid #eef1ee;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  height: 100%;
}
