/* ========================================
   LISTAS (inicio, generación, ...)
======================================== */

.lista {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.lista-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    color: var(--text);
    border-top: 1px solid var(--border);
    transition: var(--transition);
}

.lista-row:first-child { border-top: 0; }

.lista-row:hover {
    background: #f8fbff;
    color: var(--text);
}

.lista-icon {
    flex: 0 0 40px;
    height: 40px;
    border-radius: 10px;
    background: #eff6ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.lista-main {
    flex: 1;
    min-width: 0;
}

.lista-title {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lista-sub {
    color: var(--muted);
    font-size: 13px;
}

.lista-cta {
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
}

.lista-vacia {
    text-align: center;
    color: var(--muted);
    padding: 36px 16px;
}

.lista-vacia i {
    font-size: 30px;
    display: block;
    margin-bottom: 6px;
}

.lista-acciones {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.lista-filtro {
    max-width: 360px;
}

@media (max-width: 480px) {
    .lista-row { padding: 12px 14px; }
    .lista-cta { display: none; }
}

/* Fila con enlace principal (stretched-link) y botones propios */
.lista-row { position: relative; }
.lista-acciones { position: relative; z-index: 2; }

/* ENCABEZADO DE PÁGINA */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.page-migas {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 4px;
}

.page-migas a { color: var(--muted); }
.page-migas a:hover { color: var(--primary); }

.page-title {
    font-size: 26px;
    font-weight: 800;
    margin: 0;
}

.page-sub {
    color: var(--muted);
    margin: 2px 0 0;
}

.page-acciones {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-volver { color: #475569; border-color: #cbd5e1; background: #fff; }
.btn-volver:hover { color: #1e293b; background: #f1f5f9; border-color: #94a3b8; }

/* NIVEL ACADÉMICO */
.nivel {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
}
.nivel-secundaria   { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.nivel-preparatoria { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.nivel-universidad  { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.nivel-otro         { background: #f8fafc; color: #64748b; border-color: #e2e8f0; border-style: dashed; }

/* ========================================
   FORMULARIOS: colores por acción
   verde = crear/guardar · ámbar = editar · gris = cancelar/volver
======================================== */
.form-icon.form-icon-crear  { background: linear-gradient(135deg, #16a34a, #22c55e); }
.form-icon.form-icon-editar { background: linear-gradient(135deg, #d97706, #f59e0b); }

.field-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 4px;
}

.form-bloque {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    transition: var(--transition);
}

.form-bloque-titulo {
    font-weight: 700;
    margin-bottom: 4px;
}

.form-bloque.apagado {
    opacity: .45;
}

.form-o {
    text-align: center;
    color: var(--muted);
    font-weight: 600;
    margin: 12px 0;
}

.aviso-pendiente { color: var(--warning); }

/* Columna de estado/dinero en listas */
.lista-dinero {
    text-align: right;
    flex-shrink: 0;
    min-width: 140px;
}

/* ESTADOS EN UNA LÍNEA (filtro discreto) */
.estados-linea {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 4px;
    font-size: 13px;
}

.estado-op {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    background: none;
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--muted);
    cursor: pointer;
}

.estado-op b { color: var(--text); font-weight: 600; }
.estado-op:hover { background: #eef2f7; }
.estado-op.activo { background: #e2e8f0; color: var(--text); }
.estado-op.alerta, .estado-op.alerta b { color: var(--danger); }

.estado-op .punto {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, .12);
}

@media (max-width: 576px) {
    .lista-row { flex-wrap: wrap; }
    .lista-dinero { order: 3; width: 100%; min-width: 0; text-align: left; padding-left: 54px; }
}


/* ========================================
   ESTILO V1 sobre el acomodo de v2
   (tarjetas redondeadas con sombra, títulos grandes,
   íconos en cuadro azul, botones de 14px de radio)
======================================== */

/* Encabezados de página */
.page-head { align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.page-title, .home-title { font-size: 34px; font-weight: 700; line-height: 1.15; margin-bottom: 6px; }
.page-sub, .home-sub { font-size: 15px; }
.page-migas { font-size: 14px; margin-bottom: 10px; color: var(--muted); }
.page-migas a { color: var(--primary); font-weight: 600; }
.page-migas a:hover { color: var(--primary-hover); }

/* Botones de encabezado y acciones */
.page-acciones .btn,
.home-head .btn {
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 600;
}
.page-acciones .btn-success,
.home-head .btn-success { box-shadow: 0 8px 20px rgba(22, 163, 74, .22); }
.page-acciones .btn:hover,
.home-head .btn:hover { transform: translateY(-1px); }
.btn-volver { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-volver:hover { background: #f8fafc; color: var(--text); border-color: #cbd5e1; }

/* Buscador del inicio */
.home-search .input-group { border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.home-search .form-control, .home-search .input-group-text { border-color: var(--border); padding-top: 12px; padding-bottom: 12px; }
.home-search .btn { padding-left: 22px; padding-right: 22px; font-weight: 600; }

/* Listas como tarjeta v1 */
.lista {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 8px;
}
.lista-row {
    border-top: 0;
    border-radius: 16px;
    padding: 14px 16px;
    gap: 16px;
}
.lista-row + .lista-row { margin-top: 2px; }
.lista-row:hover { background: #f8fbff; }
.lista-row + .lista-row::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 82px;
    right: 16px;
    border-top: 1px solid #f1f5f9;
}
.lista-icon {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    border-radius: 14px;
    font-size: 20px;
}
.lista-title { font-weight: 700; font-size: 16px; }
.lista-sub { font-size: 13px; }
.lista-cta { font-size: 14px; }
.lista-filtro .form-control, .lista-filtro .input-group-text { border-radius: 14px; }
.lista-filtro .input-group-text { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.lista-filtro .form-control { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* Vacío como empty-state v1 */
.lista-vacia { padding: 48px 20px; }
.lista-vacia > i {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: 24px;
    background: #eff6ff;
    color: var(--primary);
    font-size: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Botones de fila (editar) como table-action-btn v1 */
.accion-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.accion-btn.editar { background: #fef3c7; color: #b45309; }
.accion-btn.editar:hover { background: #fde68a; color: #92400e; }

/* Línea de estados del grupo como pastillas */
.estado-op { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 6px 12px; }
.estado-op:hover { background: #f8fafc; }
.estado-op.activo { background: #111827; border-color: #111827; color: #fff; }
.estado-op.activo b { color: #fff; }
.estados-linea { gap: 6px; margin-bottom: 14px !important; }

/* Bloques dentro de formularios como selection-card v1 */
.form-bloque { border-radius: 20px; padding: 22px; background: #fcfdff; }

@media (max-width: 576px) {
    .page-title, .home-title { font-size: 26px; }
    .lista-row + .lista-row::before { left: 16px; }
}
