/* lud-style.css - UI Kit MAESTRO (Blindado + Responsive + Estético) */

/* --- 1. CONTENEDOR PRINCIPAL FLUIDO --- */
.lud-card {
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 16px !important;
    padding: 25px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05) !important;
    font-family: 'Roboto', 'Segoe UI', sans-serif !important;
    /* CLAVE: Ancho fluido para adaptarse a columnas y móviles */
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto 20px auto !important;
    color: #333 !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
}

/* --- 2. CABECERA --- */
.lud-header {
    border-bottom: 1px solid #f0f0f0 !important;
    padding-bottom: 15px !important;
    margin-bottom: 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important; /* Permite bajar elementos si falta espacio */
    gap: 10px !important;
}
.lud-header h3 {
    margin: 0 !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
}

/* --- 3. COMPONENTES: BADGES Y ETIQUETAS --- */
.lud-badge {
    padding: 6px 12px !important;
    border-radius: 20px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    display: inline-block !important;
}
.lud-badge.pendiente { background: #ffebee !important; color: #c62828 !important; }
.lud-badge.aldia, .lud-badge.activo { background: #e8f5e9 !important; color: #2e7d32 !important; }

/* --- 4. SECCIÓN MI AHORRO (RESUMEN) --- */
.lud-balance-section {
    text-align: center !important;
    margin-bottom: 25px !important;
    padding: 15px !important;
    background: #fcfcfc !important; /* Fondo muy sutil */
    border-radius: 12px !important;
    border: 1px solid #f9f9f9 !important;
}
.lud-label {
    display: block !important;
    color: #757575 !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    margin-bottom: 5px !important;
}
.lud-amount {
    display: block !important;
    font-size: 2.4rem !important; /* Grande pero seguro */
    font-weight: 800 !important;
    color: #2e7d32 !important;
    letter-spacing: -1px !important;
    line-height: 1.1 !important;
    word-break: break-word !important; /* Evita desbordes en móviles pequeños */
}

/* --- 5. GRILLA DE DETALLES Y ALERTAS --- */
.lud-details-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 15px !important;
    background: #fafafa !important;
    padding: 15px !important;
    border-radius: 12px !important;
    border: 1px solid #f5f5f5 !important;
    margin-top: 20px !important;
}
/* En móviles muy pequeños, hacemos que sea 1 sola columna */
@media (max-width: 360px) {
    .lud-details-grid { grid-template-columns: 1fr !important; }
}

.lud-detail-item strong {
    display: block !important;
    font-size: 0.75rem !important;
    color: #616161 !important;
    text-transform: uppercase !important;
    margin-bottom: 4px !important;
}
.lud-detail-item span {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #212121 !important;
}

/* Cajas de Estado (Deuda/Éxito) */
.lud-alert, .lud-debt-box, .lud-success-box {
    padding: 15px 20px !important;
    border-radius: 12px !important;
    margin-bottom: 20px !important;
    font-size: 0.95rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.lud-debt-box { background: #fff3e0 !important; border: 1px solid #ffe0b2 !important; color: #e65100 !important; }
.lud-debt-row { display: flex !important; justify-content: space-between !important; margin-bottom: 6px !important; font-size: 0.9rem !important; }
.lud-debt-total { display: flex !important; justify-content: space-between !important; font-weight: 800 !important; margin-top: 10px !important; padding-top: 10px !important; border-top: 1px dashed #ffcc80 !important; font-size: 1.1rem !important; color: #d84315 !important; }

.lud-success-box, .lud-alert.success { 
    background: #e8f5e9 !important; border: 1px solid #c8e6c9 !important; color: #1b5e20 !important; 
    display: flex !important; gap: 10px !important; align-items: center !important;
}
.lud-alert.error { background: #ffebee !important; border: 1px solid #ffcdd2 !important; color: #b71c1c !important; }

/* Caja de Sugerencia (Azul) */
.lud-suggestion {
    background: #e1f5fe !important;
    border: 1px dashed #039be5 !important;
    border-radius: 10px !important;
    padding: 20px !important;
    text-align: center !important;
    margin-bottom: 25px !important;
    color: #01579b !important;
}
.lud-sug-amount { font-size: 1.8rem !important; font-weight: 800 !important; margin: 10px 0 !important; color: #0277bd !important; }

/* --- 6. FORMULARIOS (Inputs y Botones Bonitos) --- */
.lud-form-group { margin-bottom: 25px !important; }

input.lud-input, textarea.lud-input { 
    width: 100% !important;
    padding: 14px 16px !important;
    border: 2px solid #eeeeee !important;
    border-radius: 10px !important;
    font-size: 1rem !important;
    color: #212121 !important;
    background: #fafafa !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    min-height: 50px !important;
    font-family: inherit !important;
}
input.lud-input:focus, textarea.lud-input:focus {
    border-color: #1565c0 !important;
    background: #fff !important;
    outline: none !important;
}

button.lud-btn {
    width: 100% !important;
    padding: 16px !important;
    background-color: #1565c0 !important; 
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 10px rgba(21, 101, 192, 0.3) !important;
    transition: transform 0.1s ease !important;
    margin-top: 10px !important;
}
button.lud-btn:hover {
    background-color: #0d47a1 !important;
    transform: translateY(-2px) !important;
}

/* --- 7. RADIO CARDS (Selección Moderna) --- */
.lud-radio-group { display: flex !important; flex-direction: column !important; gap: 12px !important; }
.lud-radio-card input[type="radio"] { position: absolute !important; opacity: 0 !important; width:0 !important; height:0 !important; }
.lud-radio-card {
    display: flex !important; /* Flex para alinear check y texto */
    position: relative !important;
    border: 2px solid #eeeeee !important;
    border-radius: 10px !important;
    padding: 15px 15px 15px 50px !important; /* Espacio para el check */
    cursor: pointer !important;
    transition: all 0.2s !important;
    background: #fff !important;
    align-items: center !important;
}
.lud-radio-card::before { /* El círculo del check */
    content: '' !important;
    position: absolute !important;
    left: 15px !important;
    height: 20px !important;
    width: 20px !important;
    border: 2px solid #bdbdbd !important;
    border-radius: 50% !important;
    background: #fff !important;
}
.lud-radio-card:has(input:checked) { border-color: #1565c0 !important; background-color: #e3f2fd !important; }
.lud-radio-card:has(input:checked)::before { border-color: #1565c0 !important; background-color: #1565c0 !important; box-shadow: inset 0 0 0 4px #fff !important; }

.lud-radio-title { font-weight: 700 !important; color: #333 !important; font-size: 1rem !important; display: block !important; }
.lud-radio-desc { font-size: 0.85rem !important; color: #757575 !important; line-height: 1.3 !important; display: block !important; }

/* --- 8. HISTORIAL DE MOVIMIENTOS --- */
.lud-history-list { display: flex !important; flex-direction: column !important; gap: 15px !important; }

.lud-history-item {
    border: 1px solid #eee !important;
    border-radius: 12px !important;
    padding: 15px !important;
    background: #fff !important;
    display: flex !important;
    flex-direction: column !important; /* CLAVE: Apila elementos verticalmente */
    gap: 12px !important;
}

/* Fila Superior: Icono + Datos + Monto */
.lud-hist-top {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    width: 100% !important;
    gap: 10px !important;
}

.lud-hist-date-group {
    display: flex !important;
    gap: 12px !important;
    align-items: center !important;
    flex: 1 !important;
}

.hist-icon {
    font-size: 1.4rem !important;
    background: #f5f5f5 !important;
    min-width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
}

.hist-date { font-weight: 700 !important; color: #333 !important; font-size: 0.95rem !important; }
.hist-status { font-size: 0.75rem !important; font-weight: 600 !important; margin-top: 2px !important; }
.hist-total { font-size: 1.1rem !important; font-weight: 800 !important; color: #333 !important; white-space: nowrap !important; }

/* Colores de Estado */
.status-pending { color: #f57c00 !important; }
.status-approved { color: #2e7d32 !important; }
.status-rejected { color: #c62828 !important; }

/* Nota Usuario */
.lud-hist-note {
    font-size: 0.85rem !important;
    color: #616161 !important;
    background: #fafafa !important;
    padding: 10px !important;
    border-radius: 8px !important;
    border: 1px solid #f0f0f0 !important;
}
.pref-tag {
    background: #e3f2fd !important; color: #1565c0 !important;
    padding: 2px 6px !important; border-radius: 4px !important;
    font-weight: 700 !important; font-size: 0.75rem !important;
    margin-right: 5px !important;
}

/* Recibo de Desglose (Verde) */
.lud-hist-breakdown {
    background: #f1f8e9 !important;
    border: 1px dashed #a5d6a7 !important;
    padding: 12px !important;
    border-radius: 8px !important;
    font-size: 0.85rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.lud-hist-breakdown strong { color: #2e7d32 !important; text-transform: uppercase !important; display: block !important; margin-bottom: 5px !important; font-size: 0.8rem !important; letter-spacing: 0.5px !important; }
.lud-hist-breakdown ul { margin: 0 !important; padding: 0 !important; list-style: none !important; }
.lud-hist-breakdown li { display: flex !important; justify-content: space-between !important; padding: 3px 0 !important; border-bottom: 1px dotted #c8e6c9 !important; color: #33691e !important; }
.lud-hist-breakdown li:last-child { border-bottom: none !important; }
.lud-hist-breakdown li::before { content: '•' !important; margin-right: 5px !important; color: #558b2f !important; }

/* --- 9. AJUSTES PARA MÓVILES (Responsividad Extrema) --- */
@media (max-width: 480px) {
    .lud-card { padding: 20px !important; border-radius: 12px !important; }
    .lud-amount { font-size: 2rem !important; }
    .lud-hist-top { flex-wrap: wrap !important; } /* Si el nombre es largo, el precio baja */
    .hist-total { margin-left: auto !important; } /* Empuja precio a la derecha */
}
