/* ============================================= */
/* SOLICITUD DE PRÉSTAMO - DISEÑO PROFESIONAL    */
/* ============================================= */

:root {
    --primary: #1266f1;
    --primary-dark: #0a4bc7;
    --primary-deeper: #093d9e;
    --primary-light: color-mix(in srgb, var(--primary) 8%, transparent);
    --primary-glow: color-mix(in srgb, var(--primary) 15%, transparent);
    --bg: #f0f4f8;
    --bg-card: #ffffff;
    --text-primary: #1a2332;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border: #e2e8f0;
    --border-light: #edf2f7;
    --input-bg: #f7f9fc;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --orange: #F58E27;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-primary: 0 4px 20px color-mix(in srgb, var(--primary) 25%, transparent);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- GLOBAL ---- */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--primary);
    color: #fff;
}

/* ---- LAYOUT ---- */
.app-container .main-container {
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
    min-height: 100vh;
    background: var(--bg);
}

.app-container .main-container .form-container {
    width: 100% !important;
    max-width: 920px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

/* ---- HEADER CON GRADIENTE ---- */
.top-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, var(--primary-deeper) 100%);
    padding: 40px 24px 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: -24px;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    box-shadow: 0 8px 32px color-mix(in srgb, var(--primary) 30%, transparent);
}

.top-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.top-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.top-header .header-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.top-header .header-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.top-header .subtitle-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.top-header .company-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Ocultar sidebar antiguo y header mobile antiguo */
.right-sidebar {
    display: none !important;
}

.company-info-mobile {
    display: none !important;
}

/* ---- SECCIONES / CARDS ---- */
.personal-info-sect,
.loan-info-sect {
    background: var(--bg-card) !important;
    margin-bottom: 24px;
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light) !important;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    animation: fadeInUp 0.5s ease backwards;
}

.personal-info-sect:hover,
.loan-info-sect:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.personal-info-sect {
    animation-delay: 0.1s;
}

.loan-info-sect {
    animation-delay: 0.2s;
}

/* ---- TÍTULOS DE SECCIÓN ---- */
.sect-title {
    color: var(--primary);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    padding-bottom: 12px;
    position: relative;
    display: inline-block;
}

.sect-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 3px;
}

.basic-title {
    color: var(--primary);
    font-size: 16px;
    font-weight: 600;
}

/* ---- LABELS ---- */
.form-group label {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}

/* ---- INPUTS & SELECTS ---- */
.form-group input,
.form-group select {
    background-color: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    min-height: 48px;
    font-size: 14.5px;
    color: var(--text-primary);
    transition: var(--transition);
    padding: 10px 14px;
    width: 100%;
}

.form-group input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.form-group input:focus,
.form-group select:focus {
    border: 1.5px solid var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    background-color: #fff;
    outline: none;
    transition: var(--transition);
}

.form-group input:hover:not(:focus),
.form-group select:hover:not(:focus) {
    border-color: #cbd5e0;
}

/* Input group (monto) */
.input-group .input-group-text {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-weight: 600;
    padding: 0 16px;
}

.input-group .form-control {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
}

/* ---- FOTO DE PERFIL ---- */
.profile-photo {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 4%, transparent), color-mix(in srgb, var(--primary) 8%, transparent));
    border: 2px dashed color-mix(in srgb, var(--primary) 30%, transparent);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    padding: 28px;
    transition: var(--transition);
    animation: fadeInUp 0.5s ease backwards;
}

.profile-photo:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 6%, transparent), color-mix(in srgb, var(--primary) 12%, transparent));
}

.form-group-cont {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.form-group-cont span {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---- CAMPO REQUERIDO ---- */
.required-field {
    color: var(--danger);
    font-weight: 600;
}

/* ---- BOTÓN ENVIAR ---- */
.enviarP {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    border: none !important;
    border-radius: var(--radius-sm) !important;
    padding: 16px 48px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px;
    color: #fff !important;
    width: 100%;
    max-width: 400px;
    margin: 16px auto 0 !important;
    display: block !important;
    box-shadow: var(--shadow-primary);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.enviarP:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px color-mix(in srgb, var(--primary) 35%, transparent);
}

.enviarP:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--primary) 30%, transparent);
}

/* ---- BOTÓN CALCULAR ---- */
.calcularP {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    border: none !important;
    border-radius: var(--radius-sm) !important;
    padding: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px;
    box-shadow: var(--shadow-primary);
    transition: var(--transition);
    width: 100%;
    margin: 20px auto;
}

.calcularP:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px color-mix(in srgb, var(--primary) 35%, transparent);
}

/* ---- GARANTÍA ---- */
.warranty button {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    border: none !important;
    border-radius: var(--radius-sm) !important;
    text-transform: uppercase;
    height: 48px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: var(--transition);
    box-shadow: var(--shadow-primary);
}

.warranty button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px color-mix(in srgb, var(--primary) 35%, transparent);
}

/* ============================================= */
/* ---- DATATABLE PROFESIONAL ----               */
/* ============================================= */

/* -- Contenedor principal -- */
#no-more-tables {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.5s ease backwards;
    animation-delay: 0.3s;
}

/* -- Wrapper del DataTable -- */
#no-more-tables .dataTables_wrapper {
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* -- Barra superior (longitud + búsqueda) -- */
#no-more-tables .dataTables_wrapper .dataTables_length,
#no-more-tables .dataTables_wrapper .dataTables_filter {
    padding: 20px 24px 16px;
}

#no-more-tables .dataTables_wrapper .dataTables_length {
    float: left;
}

#no-more-tables .dataTables_wrapper .dataTables_filter {
    float: right;
}

#no-more-tables .dataTables_wrapper .dataTables_length label,
#no-more-tables .dataTables_wrapper .dataTables_filter label {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

#no-more-tables .dataTables_wrapper .dataTables_length select {
    background-color: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 13.5px;
    color: var(--text-primary);
    min-height: 36px;
    transition: var(--transition);
    outline: none;
    cursor: pointer;
    -webkit-appearance: auto;
}

#no-more-tables .dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

#no-more-tables .dataTables_wrapper .dataTables_filter input {
    background-color: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 13.5px;
    color: var(--text-primary);
    min-height: 36px;
    transition: var(--transition);
    outline: none;
    margin-left: 8px;
    min-width: 200px;
}

#no-more-tables .dataTables_wrapper .dataTables_filter input::placeholder {
    color: var(--text-muted);
}

#no-more-tables .dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background-color: #fff;
}

/* -- Tabla -- */
#tblCuotas {
    border-radius: 0;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    width: 100% !important;
    margin-bottom: 0 !important;
}

/* -- Encabezado con gradiente -- */
#tblCuotas thead {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 60%, var(--primary-deeper) 100%);
}

#tblCuotas thead th {
    color: #fff !important;
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 16px 14px;
    border: none !important;
    white-space: nowrap;
    position: relative;
}

#tblCuotas thead th::after {
    display: none;
}

#tblCuotas thead th.sorting,
#tblCuotas thead th.sorting_asc,
#tblCuotas thead th.sorting_desc {
    cursor: pointer;
    background-image: none !important;
}

#tblCuotas thead th.sorting_asc::before,
#tblCuotas thead th.sorting_desc::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 6px;
    vertical-align: middle;
}

#tblCuotas thead th.sorting_asc::before {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 5px solid rgba(255, 255, 255, 0.8);
}

#tblCuotas thead th.sorting_desc::before {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255, 255, 255, 0.8);
}

/* -- Cuerpo de la tabla -- */
#tblCuotas tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid var(--border-light);
}

#tblCuotas tbody tr:last-child {
    border-bottom: none;
}

#tblCuotas tbody tr:nth-child(even) {
    background-color: rgba(247, 249, 252, 0.5);
}

#tblCuotas tbody tr:nth-child(odd) {
    background-color: #fff;
}

#tblCuotas tbody tr:hover {
    background-color: var(--primary-light) !important;
    transform: scale(1.002);
}

#tblCuotas tbody td {
    padding: 13px 14px;
    font-size: 13.5px;
    color: var(--text-primary);
    border: none !important;
    vertical-align: middle;
    transition: var(--transition);
}

#tblCuotas tbody td.text-right {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Columna "A PAGAR" destacada */
#tblCuotas tbody td.bg-heavy-rain,
#tblCuotas thead th.bg-heavy-rain {
    background: color-mix(in srgb, var(--primary) 6%, transparent) !important;
    font-weight: 700;
    color: var(--primary-dark);
}

#tblCuotas thead th.bg-heavy-rain {
    background: rgba(0, 0, 0, 0.1) !important;
    color: #fff !important;
}

/* Fila especial (bg-tempting-azure) */
#tblCuotas tbody tr.bg-tempting-azure {
    background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 4%, transparent), color-mix(in srgb, var(--primary) 8%, transparent)) !important;
    border-left: 3px solid var(--primary);
}

/* -- Footer (totales) -- */
#tblCuotas tfoot {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 3%, transparent), color-mix(in srgb, var(--primary) 6%, transparent));
    border-top: 2px solid var(--primary);
}

#tblCuotas tfoot th {
    padding: 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
    border: none !important;
}

/* -- Scroll vertical personalizado -- */
.dataTables_scrollBody {
    border-bottom: 1px solid var(--border-light);
}

.dataTables_scrollBody::-webkit-scrollbar {
    width: 6px;
}

.dataTables_scrollBody::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 6px;
}

.dataTables_scrollBody::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: 6px;
}

.dataTables_scrollBody::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* -- Info (Mostrando X de Y entradas) -- */
#no-more-tables .dataTables_wrapper .dataTables_info {
    padding: 16px 24px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    float: left;
}

/* -- Paginación -- */
#no-more-tables .dataTables_wrapper .dataTables_paginate {
    padding: 16px 24px;
    float: right;
    display: flex;
    align-items: center;
    gap: 4px;
}

#no-more-tables .dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm) !important;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary) !important;
    background: transparent !important;
    border: 1.5px solid var(--border) !important;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none !important;
    margin: 0 2px;
}

#no-more-tables .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary-light) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 15%, transparent);
}

#no-more-tables .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    border-color: transparent !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 30%, transparent);
}

#no-more-tables .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-deeper)) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 40%, transparent);
}

#no-more-tables .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border-light) !important;
    color: var(--text-muted) !important;
}

#no-more-tables .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    background: transparent !important;
    transform: none;
    box-shadow: none;
}

/* -- Botones (Imprimir, Excel, etc.) -- */
#no-more-tables .dt-buttons,
.dataTables_wrapper .dt-buttons {
    padding: 0;
    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

#no-more-tables .dt-buttons .dt-button,
.dataTables_wrapper .dt-buttons .dt-button,
#no-more-tables .dt-buttons .btn,
#no-more-tables .dt-buttons .btn.btn-default,
#no-more-tables .dt-buttons .btn.btn-secondary,
.dataTables_wrapper .dt-buttons .btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    border: none !important;
    border-radius: var(--radius-sm) !important;
    color: #fff !important;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 20%, transparent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    line-height: 1.4;
}

#no-more-tables .dt-buttons .dt-button:hover,
.dataTables_wrapper .dt-buttons .dt-button:hover,
#no-more-tables .dt-buttons .btn:hover,
.dataTables_wrapper .dt-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--primary) 35%, transparent);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-deeper)) !important;
}

#no-more-tables .dt-buttons .dt-button:active,
.dataTables_wrapper .dt-buttons .dt-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 20%, transparent);
}

/* Variante outline para botón Copiar */
#no-more-tables .dt-buttons .btn.btn-default.buttons-copy,
#no-more-tables .dt-buttons .btn.btn-secondary.buttons-copy,
#no-more-tables .dt-buttons .btn.buttons-copy {
    background: transparent !important;
    background-image: none !important;
    border: 1.5px solid var(--primary) !important;
    color: var(--primary) !important;
    box-shadow: none;
}

#no-more-tables .dt-buttons .btn.btn-default.buttons-copy:hover,
#no-more-tables .dt-buttons .btn.btn-secondary.buttons-copy:hover,
#no-more-tables .dt-buttons .btn.buttons-copy:hover {
    background: var(--primary-light) !important;
    background-image: none !important;
    color: var(--primary-dark) !important;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 15%, transparent);
}

/* -- Processing indicator -- */
#no-more-tables .dataTables_processing,
.dataTables_wrapper .dataTables_processing {
    background: rgba(255, 255, 255, 0.95) !important;
    border: none !important;
    border-radius: var(--radius-md);
    padding: 20px 40px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

/* -- Empty table message -- */
#tblCuotas tbody td.dataTables_empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
    font-style: italic;
}

/* -- Barra inferior (info + paginación) -- */
#no-more-tables .dataTables_wrapper::after {
    content: '';
    display: table;
    clear: both;
}

/* ---- ANIMACIÓN DE ENTRADA ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================= */
/* ---- RESPONSIVE ---- */
/* ============================================= */

/* ---- TABLET ---- */
@media (max-width: 1024px) {
    .form-container {
        max-width: 100%;
        padding: 0 16px 48px;
    }

    .personal-info-sect,
    .loan-info-sect {
        padding: 24px;
    }

    .top-header {
        padding: 32px 20px 40px;
    }

    .top-header .company-title {
        font-size: 24px;
    }

    /* Tabla tablet */
    #no-more-tables .dataTables_wrapper .dataTables_length,
    #no-more-tables .dataTables_wrapper .dataTables_filter {
        padding: 16px 16px 12px;
    }

    #no-more-tables .dataTables_wrapper .dataTables_info {
        padding: 12px 16px;
    }

    #no-more-tables .dataTables_wrapper .dataTables_paginate {
        padding: 12px 16px;
    }

    #no-more-tables .dt-buttons,
    .dataTables_wrapper .dt-buttons {
        padding: 12px 16px 0;
    }
}

/* ---- MOBILE ---- */
@media (max-width: 480px) {
    .form-container {
        padding: 0 12px 40px;
    }

    .personal-info-sect,
    .loan-info-sect {
        padding: 20px 16px;
        margin-bottom: 16px;
        border-radius: var(--radius-md);
    }

    .top-header {
        padding: 28px 16px 36px;
        border-radius: 0 0 20px 20px;
    }

    .top-header .company-title {
        font-size: 22px;
    }

    .top-header .subtitle-title {
        font-size: 11px;
        letter-spacing: 2px;
    }

    .top-header .header-icon {
        width: 48px;
        height: 48px;
    }

    .enviarP {
        max-width: 100% !important;
        border-radius: var(--radius-sm) !important;
    }

    .form-group {
        margin-bottom: 1.5rem;
    }

    .sect-title {
        font-size: 18px;
    }

    .profile-photo {
        padding: 20px 16px;
    }

    /* Tabla mobile */
    #no-more-tables {
        border-radius: var(--radius-md);
        margin-top: 16px;
    }

    #no-more-tables .dataTables_wrapper .dataTables_length,
    #no-more-tables .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: center;
        padding: 12px 12px 8px;
    }

    #no-more-tables .dataTables_wrapper .dataTables_filter input {
        min-width: 0;
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
    }

    #no-more-tables .dataTables_wrapper .dataTables_filter label {
        flex-direction: column;
        align-items: stretch;
    }

    #no-more-tables .dataTables_wrapper .dataTables_info {
        float: none;
        text-align: center;
        padding: 12px;
        font-size: 12px;
    }

    #no-more-tables .dataTables_wrapper .dataTables_paginate {
        float: none;
        justify-content: center;
        padding: 8px 12px 16px;
        flex-wrap: wrap;
    }

    #no-more-tables .dataTables_wrapper .dataTables_paginate .paginate_button {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 0 8px;
    }

    #tblCuotas thead th {
        padding: 12px 8px;
        font-size: 10.5px;
        letter-spacing: 0.4px;
    }

    #tblCuotas tbody td {
        padding: 10px 8px;
        font-size: 12.5px;
    }

    #no-more-tables .dt-buttons,
    .dataTables_wrapper .dt-buttons {
        padding: 12px 12px 0;
        justify-content: center;
    }

    #no-more-tables .dt-buttons .dt-button,
    .dataTables_wrapper .dt-buttons .dt-button,
    #no-more-tables .dt-buttons .btn,
    .dataTables_wrapper .dt-buttons .btn {
        padding: 8px 16px;
        font-size: 12px;
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 375px) {
    .top-header .company-title {
        font-size: 20px;
    }
}

@media (max-width: 320px) {
    .personal-info-sect,
    .loan-info-sect {
        padding: 16px 12px;
    }
}

/* =========================================================================
   REFINAMIENTOS (2026-10) — sin tocar la personalizacion de cada institucion.
   Todo lo que aqui lleva color sale de las variables que fija la vista con el
   diseño configurado en PrestaCloud (--primary, --primary-dark, --bg,
   --text-primary, --radius-*). Nada de colores de marca fijos.
   ========================================================================= */

/* Encabezado: el logo ya no se ve roto. Si la imagen no carga, la vista lo
   oculta y deja el icono por defecto (ver onerror en la vista). */
.top-header .header-logo {
    display: block;
    max-height: 56px;
    max-width: 220px;
    margin: 0 auto 12px;
    object-fit: contain;
    border-radius: 6px;
    position: relative;
    z-index: 1;
}
.top-header .header-icon[hidden] { display: none; }
.top-header .company-title { overflow-wrap: anywhere; }

/* Mensaje de bienvenida: una tarjeta mas, alineada con el formulario y
   apoyada sobre el borde del encabezado igual que el resto. */
.welcome-msg {
    position: relative;
    z-index: 2;
    width: calc(100% - 48px);
    max-width: 872px;
    margin: 0 auto 4px;
    padding: 16px 22px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: 0.94rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}
.welcome-msg + .form-container { margin-top: 0; }

/* La zona de la foto se apoya sobre el encabezado: con fondo translucido se
   transparentaba la sombra azul. Ahora es una superficie solida. */
.profile-photo {
    position: relative;
    z-index: 2;
    background-color: var(--bg-card) !important;
    background-image: linear-gradient(135deg,
        color-mix(in srgb, var(--primary) 4%, transparent),
        color-mix(in srgb, var(--primary) 8%, transparent)) !important;
}

/* Etiquetas un punto mas legibles. El color sigue siendo el gris de siempre
   (--text-secondary): las tarjetas son blancas, y con un color de texto claro
   configurado (#fff, #0ff...) las etiquetas quedaban blanco sobre blanco. */
.form-group label {
    font-size: 0.875rem;
}

/* Foco visible y del color de la marca en todo lo interactivo. */
.form-control:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    /* Tono oscurecido: con un color de marca muy claro el foco seguia visible. */
    border-color: color-mix(in srgb, var(--primary) 70%, #000) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent) !important;
    outline: none;
}
button:focus-visible,
.enviarP:focus-visible,
.calcularP:focus-visible,
.frecuency__content--button:focus-visible,
#profile-container:focus-visible {
    outline: 3px solid color-mix(in srgb, color-mix(in srgb, var(--primary) 70%, #000) 70%, transparent);
    outline-offset: 2px;
}

/* Frecuencia: con UNA sola opcion permitida no hay nada que elegir, asi que
   se muestra como una etiqueta compacta y no como una barra-boton. */
.frecuency__content > .frecuency__content--button:only-child {
    flex: 0 0 auto;
    min-width: 0;
    padding: 8px 18px;
    cursor: default;
}

/* Firma: ocupa la fila entera; encajada junto a otro campo quedaba estrecha. */
.form-group:has(> #signature-pad),
.form-group:has(.signature-pad) {
    flex: 0 0 100%;
    max-width: 100%;
}

/* Jerarquia de botones: "Enviar solicitud" es la accion principal; "Calcular"
   es secundaria (contorno). El tono se oscurece un 30% para que se lea sobre
   la tarjeta blanca aunque el color de marca sea muy claro (p.ej. #ffffff). */
.calcularP {
    background: var(--bg-card) !important;
    color: color-mix(in srgb, var(--primary) 70%, #000) !important;
    border: 1.5px solid color-mix(in srgb, var(--primary) 70%, #000) !important;
    box-shadow: none !important;
}
.calcularP:hover {
    background: color-mix(in srgb, var(--primary) 6%, var(--bg-card)) !important;
    transform: none;
}

/* Campos de archivo nativos con el mismo lenguaje que el resto. */
.form-group input[type="file"] { padding: 8px 10px; cursor: pointer; }
.form-group input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 6px 14px;
    border: 1.5px solid color-mix(in srgb, var(--primary) 70%, #000);
    border-radius: var(--radius-sm);
    background: transparent;
    color: color-mix(in srgb, var(--primary) 70%, #000);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* Telefonos: margen lateral parejo y el encabezado menos alto. */
@media (max-width: 576px) {
    .app-container .main-container .form-container { padding: 0 14px 48px; }
    .welcome-msg { width: calc(100% - 28px); padding: 14px 16px; }
    .top-header { padding: 32px 18px 44px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Objetivos tactiles de al menos 44px y textos auxiliares legibles en movil. */
.clear-signature,
.frecuency__content--button { min-height: 44px; }
.profile-photo span,
.form-group-cont span { font-size: 0.8125rem; }

/* Navegadores sin color-mix (Safari <= 16.1, Chrome <= 110): con var() dentro,
   la declaracion no cae a la anterior sino que queda invalida. Se da el tono
   oscuro de la marca de forma explicita. */
@supports not (color: color-mix(in srgb, red, red)) {
    .calcularP {
        color: var(--primary-dark) !important;
        border: 1.5px solid var(--primary-dark) !important;
    }
    .form-group input[type="file"]::file-selector-button {
        color: var(--primary-dark);
        border-color: var(--primary-dark);
    }
}

/* =========================================================================
   PANTALLA DE CARGA (application/views/v2/request_loan/_loader.php)
   Fondo, colores y fuente de la institucion. La medalla CSS es la version
   inmediata; con three.js (.sol-loader--3d) la sustituye la medalla 3D.
   ========================================================================= */
html.sol-cargando, html.sol-cargando body { overflow: hidden; }

.sol-loader {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(60% 50% at 50% 40%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 70%),
        var(--bg);
    transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.5s;
}
.sol-loader--fuera { opacity: 0; visibility: hidden; pointer-events: none; }

.sol-loader__centro {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 420px;
    width: 100%;
}

.sol-loader__escena {
    position: relative;
    width: 240px;
    height: 240px;
    perspective: 700px;
}
.sol-loader__lienzo { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.sol-loader--3d .sol-loader__medalla { display: none; }

/* Version CSS: misma medalla, girando sobre su eje vertical. */
.sol-loader__medalla {
    position: absolute;
    inset: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow:
        inset 0 0 0 6px color-mix(in srgb, #fff 45%, transparent),
        0 18px 40px -12px color-mix(in srgb, var(--primary-dark) 60%, transparent);
    animation: sol-girar 2.4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.sol-loader__medalla span {
    color: #fff;
    font-weight: 700;
    font-size: 54px;
    letter-spacing: -0.02em;
    text-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.sol-loader__nombre {
    margin: 8px 0 4px;
    font-size: clamp(1.15rem, 4.5vw, 1.5rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    overflow-wrap: anywhere;
    animation: sol-aparecer 0.6s cubic-bezier(0.22, 1, 0.36, 1) both 0.1s;
}
.sol-loader__texto {
    margin: 0 0 18px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    animation: sol-aparecer 0.6s cubic-bezier(0.22, 1, 0.36, 1) both 0.2s;
}

.sol-loader__barra {
    position: relative;
    width: 160px;
    height: 4px;
    border-radius: 999px;
    overflow: hidden;
    background: color-mix(in srgb, var(--primary) 15%, transparent);
}
.sol-loader__barra span {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    animation: sol-barra 1.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes sol-girar {
    0%   { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}
@keyframes sol-barra {
    0%   { left: -40%; }
    100% { left: 100%; }
}
@keyframes sol-aparecer {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

@media (max-width: 576px) {
    .sol-loader__escena { width: 200px; height: 200px; }
    .sol-loader__medalla { inset: 40px; }
    .sol-loader__medalla span { font-size: 46px; }
}

@media (prefers-reduced-motion: reduce) {
    .sol-loader__medalla, .sol-loader__barra span { animation: none; }
}
.sol-loader__medalla span:not(:empty) { font-size: clamp(34px, 9vw, 54px); }
