/* =======================================================
   css/pages.css
   Estilos específicos de cada página / sección de la app:
   filtros, recordatorios, presupuesto, reportes.
   ======================================================= */

/* ── Barra de filtros ──────────────────────────────── */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.filters-bar label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.input-filter {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-filter:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.12);
}

/* ── Recordatorios ─────────────────────────────────── */
.recordatorios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.reminder-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}

.reminder-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Variantes de prioridad */
.reminder-card.alta   { border-left: 3px solid var(--accent-red); }
.reminder-card.media  { border-left: 3px solid var(--accent-yellow); }
.reminder-card.baja   { border-left: 3px solid var(--accent-green); }

/* Recordatorio completado */
.reminder-card.completado {
  opacity: 0.5;
}

.reminder-card.completado .reminder-title {
  text-decoration: line-through;
}

/* Recordatorio vencido */
.reminder-card.vencido {
  border-top: 2px solid var(--accent-red);
}

.reminder-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  padding-right: 56px; /* espacio para el badge */
}

.reminder-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
}

.reminder-date {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}

.reminder-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Badge de prioridad (posicionado en esquina) */
.priority-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.priority-alta  { background: rgba(248,  81, 73, 0.2); color: var(--accent-red); }
.priority-media { background: rgba(210, 153, 34, 0.2); color: var(--accent-yellow); }
.priority-baja  { background: rgba( 63, 185, 80, 0.2); color: var(--accent-green); }

.no-reminders {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 48px 20px;
  font-size: 14px;
}

/* ── Presupuesto / Budget ──────────────────────────── */
.budget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.metas-lista {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 720px;
}

.meta-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0 12px;
}

.meta-acciones {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-btn-completar {
  flex: 1 1 auto;
  justify-content: center;
  text-align: center;
  min-width: 140px;
}

.meta-btn-group {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.budget-item {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.budget-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.budget-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.budget-category {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.budget-amounts {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: right;
}

.budget-amounts strong {
  color: var(--text-primary);
}

.progress-bar-wrapper {
  background: var(--border);
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}

.progress-ok       { background: var(--accent-green); }
.progress-warning  { background: var(--accent-yellow); }
.progress-danger   { background: var(--accent-red); }

.budget-percent {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

.no-budget {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 48px 20px;
  font-size: 14px;
}

/* ── Reportes ──────────────────────────────────────── */
.report-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

/* ── Dashboard: resumen rápido de recordatorios ────── */
.dashboard-reminders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-reminder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.dashboard-reminder-item .dr-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

/* ── Separador visual ──────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ── Empty state general ───────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 14px;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════
   GESTIONAR CATEGORIAS
   ═══════════════════════════════════════════════════════ */
.lista-categorias {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-main);
  font-size: 13px;
}

.cat-item-base {
  opacity: 0.7;
}

.cat-item-nombre {
  flex: 1;
  color: var(--text-primary);
}

.cat-item-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--bg-sidebar);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.cat-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.cat-edit-input {
  flex: 1;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-sidebar);
  color: var(--text-primary);
  font-size: 13px;
}

.nueva-cat-form {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.nueva-cat-form .form-control {
  flex: 1;
}

/* ═══════════════════════════════════════════════════════
   INVERSIONES
   ═══════════════════════════════════════════════════════ */

/* -- Banner fondo de inversiones -- */
.inv-fondo-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  flex-wrap: wrap;
}
.inv-fondo-icono {
  font-size: 28px;
  flex-shrink: 0;
}
.inv-fondo-info {
  flex: 1;
  min-width: 160px;
}
.inv-fondo-titulo {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.inv-fondo-subtitulo {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.inv-fondo-valores {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.inv-fondo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
}
.inv-fondo-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.inv-fondo-val {
  font-size: 15px;
  font-weight: 700;
}
.inv-fondo-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.inv-resumen-card {
  text-align: center;
  padding: 18px 14px;
}

.inv-resumen-icon { font-size: 24px; margin-bottom: 4px; }
.inv-resumen-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.inv-resumen-valor { font-size: 22px; font-weight: 700; color: var(--text-primary); }

.inv-card {
  margin-bottom: 16px;
  padding: 20px;
}

.inv-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.inv-card-nombre {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.inv-card-beneficiario {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.inv-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.inv-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.inv-tipo-badge {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-card-hover);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.inv-card-right {
  text-align: right;
  flex-shrink: 0;
}

.inv-card-sublabel {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.inv-card-capital {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-blue);
}

.inv-card-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.inv-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.inv-stat-valor {
  font-size: 15px;
  font-weight: 700;
}

.inv-card-barra-wrap { margin-bottom: 10px; }

.inv-card-barra-fondo {
  height: 5px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}

.inv-card-barra-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.inv-card-fechas {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.inv-card-nota {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  border-left: 2px solid var(--border);
  padding-left: 8px;
  margin-bottom: 10px;
}

.inv-card-acciones {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.inv-hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.inv-hist-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.inv-hist-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.inv-hist-table tr:last-child td { border-bottom: none; }

/* ═══════════════════════════════════════════════════════
   INGRESOS ESPERADOS DEL MES
   ═══════════════════════════════════════════════════════ */
.resumen-ing-esperado {
  margin-bottom: 16px;
}

.ie-resumen-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ie-resumen-valores {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.ie-resumen-valores strong {
  color: var(--text-primary);
}

.ie-pct {
  font-weight: 700;
  font-size: 15px;
}

.ie-barra-fondo {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}

.ie-barra-progreso {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.lista-ing-esperado {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

/* ── Tarjeta compacta de ingreso esperado ── */
.ie-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.ie-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.ie-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.ie-card-cat {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.3;
}

.ie-card-btns {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  margin-top: -2px;
}

.ie-card-monto {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.ie-card-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.ie-card-unidades {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.ie-card-unidades span {
  font-weight: 400;
  color: var(--text-muted);
}

.ie-card-barra-fondo {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
  margin: 2px 0;
}

.ie-card-barra-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.ie-card-diff {
  font-size: 12px;
  font-weight: 700;
}

.ie-card-nota {
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 4px;
  margin-top: 2px;
}

.ie-badge-ok {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(63,185,80,0.15);
  color: var(--accent-green);
  font-weight: 600;
  margin-left: 4px;
  vertical-align: middle;
}

.ie-sep {
  color: var(--border);
  user-select: none;
}

.ie-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px 0;
  grid-column: 1 / -1;
}
