/* =========================================================
   INVERSIONES MÚLTIPLES · Calculadora de financiamiento
   Estilos organizados por componente para facilitar ajustes.
   ========================================================= */

/* 1. Variables de marca
   Modifica estos valores para actualizar colores globalmente. */
:root {
    --ink: #292b37;
    --slate: #333645;
    --gold: #e3a327;
    --gold-deep: #966300;
    --gold-light: #fac51e;
    --white: #ffffff;
    --canvas: #f3f4f6;
    --muted: #6b6e78;
    --line: #e4e5e8;

    font-family: "Segoe UI", Arial, sans-serif;
}

/* 2. Base y estructura general */
* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 88% 7%, rgba(227, 163, 39, 0.18), transparent 20rem),
        var(--canvas);
}

/* 3. Pantalla de carga
   Se oculta al terminar de cargar la página mediante JavaScript. */
.page-loader {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 1.25rem;
    background: var(--ink);
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.page-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-logo {
    width: min(220px, 62vw);
    max-height: 88px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    animation: logo-pulse 1s ease-in-out infinite alternate;
}

.loader-line {
    width: 78px;
    height: 3px;
    margin: auto;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.2);
}

.loader-line::after {
    display: block;
    width: 50%;
    height: 100%;
    content: "";
    border-radius: inherit;
    background: var(--gold-light);
    animation: loading 1s ease-in-out infinite;
}

/* 4. Barra de navegación y menú de usuario */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    padding: 0.75rem clamp(1.25rem, 5vw, 5rem);
    color: var(--white);
    background: var(--ink);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.user-menu {
    position: relative;
}

.user-menu summary {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.62rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 0.55rem;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.user-menu summary::-webkit-details-marker {
    display: none;
}

.user-menu summary:hover,
.user-menu[open] summary {
    background: rgba(227, 163, 39, 0.12);
    border-color: var(--gold);
}

.user-menu-chevron {
    width: 17px;
    height: 17px;
    color: var(--gold-light);
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    transition: transform 0.2s ease;
}

.user-menu[open] .user-menu-chevron {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    z-index: 5;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 150px;
    padding: 0.4rem;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 0.55rem;
    box-shadow: 0 12px 24px rgba(24, 26, 35, 0.18);
    animation: reveal 0.16s ease-out;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.7rem;
    color: var(--ink);
    font-size: 0.87rem;
    text-decoration: none;
    border-radius: 0.35rem;
}

.menu-item-icon {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    color: var(--gold-deep);
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.user-dropdown a:hover {
    color: var(--gold-deep);
    background: #fff7e4;
}

/* 5. Contenedor principal de la calculadora */
.page-content {
    display: grid;
    place-items: start center;
    padding: clamp(2rem, 5vw, 4.5rem) 1.2rem;
}

.calc-container {
    width: min(100%, 510px);
    overflow: hidden;
    background: var(--white);
    border: 1px solid rgba(41, 43, 55, 0.1);
    border-radius: 1rem;
    box-shadow: 0 18px 50px rgba(41, 43, 55, 0.13);
    animation: rise-in 0.42s ease-out both;
}

.header {
    padding: 2rem 2rem 1.7rem;
    color: var(--white);
    background: linear-gradient(125deg, var(--ink), var(--slate));
    border-bottom: 4px solid var(--gold);
}

.eyebrow {
    margin: 0 0 0.45rem;
    color: var(--gold-light);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.header h1,
.results h2 {
    margin: 0;
    letter-spacing: -0.025em;
}

.header h1 {
    font-size: clamp(1.45rem, 4vw, 1.8rem);
}

.header > p:not(.eyebrow) {
    margin: 0.65rem 0 0;
    color: #d9dbe0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 6. Formulario y controles */
.calculator-form {
    padding: 1.8rem 2rem 2rem;
}

.field-group + .field-group {
    margin-top: 1.25rem;
}

label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: var(--slate);
    font-size: 0.88rem;
    font-weight: 700;
}

label span {
    color: var(--gold-deep);
}

input,
select {
    width: 100%;
    min-height: 47px;
    padding: 0.7rem 0.8rem;
    color: var(--ink);
    font: inherit;
    outline: none;
    background: #fbfbfc;
    border: 1px solid #d9dbe0;
    border-radius: 0.5rem;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

input::placeholder {
    color: #9a9ca5;
}

input:focus,
select:focus {
    background: var(--white);
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(227, 163, 39, 0.2);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 3.1rem;
}

.password-field .password-toggle {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    width: 36px;
    min-height: 36px;
    padding: 0;
    margin: 0;
    color: var(--gold-deep);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.35rem;
    box-shadow: none;
    transform: translateY(-50%);
}

.password-toggle svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.password-toggle.is-visible::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 1.8px;
    content: "";
    background: currentColor;
    border-radius: 99px;
    transform: translate(-50%, -50%) rotate(-45deg);
}

.password-toggle:hover {
    color: var(--gold-deep);
    background: #fff7e4;
    border-color: rgba(227, 163, 39, 0.45);
    box-shadow: none;
    transform: translateY(-50%);
}

.password-toggle:active {
    box-shadow: none;
    transform: translateY(-50%);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
}

button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 49px;
    padding: 0.75rem 1rem;
    margin-top: 1.65rem;
    color: var(--ink);
    font: inherit;
    font-weight: 800;
    letter-spacing: 0.015em;
    cursor: pointer;
    background: var(--gold-light);
    border: 0;
    border-radius: 0.5rem;
    box-shadow: 0 5px 0 var(--gold-deep);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

button:hover {
    background: var(--gold);
    box-shadow: 0 7px 0 var(--gold-deep);
    transform: translateY(-2px);
}

button:active {
    box-shadow: 0 2px 0 var(--gold-deep);
    transform: translateY(2px);
}

/* 7. Resultado de la cotización */
.results {
    padding: 1.75rem 2rem 2rem;
    background: #fafafa;
    border-top: 1px solid var(--line);
    animation: reveal 0.3s ease-out both;
}

/* Estado inicial y carga de resultados sin recargar la página. */
.results-placeholder {
    color: var(--muted);
    text-align: center;
}

.results-placeholder p,
.results-loading p,
.results-error p {
    margin: 0;
}

.results-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 105px;
    color: var(--slate);
    font-weight: 600;
}

.results-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(227, 163, 39, 0.25);
    border-top-color: var(--gold-deep);
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
}

.results-heading {
    margin-bottom: 1rem;
}

.results h2 {
    font-size: 1.25rem;
}

.res-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    color: var(--muted);
    font-size: 0.9rem;
    border-bottom: 1px dashed #d7d8dd;
}

.res-item strong {
    color: var(--slate);
    white-space: nowrap;
}

.quota-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    margin-top: 1.15rem;
    color: var(--white);
    background: var(--slate);
    border-radius: 0.6rem;
}

.quota-card span {
    font-size: 0.84rem;
}

.quota-card strong {
    color: var(--gold-light);
    font-size: 1.35rem;
    white-space: nowrap;
}

.whatsapp-link {
    display: block;
    margin-top: 1.25rem;
    color: #167a42;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.whatsapp-link:hover {
    color: #0f6033;
    text-decoration: underline;
}

/* Mensaje mostrado cuando el formulario contiene datos inválidos. */
.results-error {
    color: #9d2d2d;
    font-weight: 600;
    background: #fff7f7;
}

/* 8. Página de inicio de sesión */
.login-page {
    display: grid;
    place-items: center;
    padding: 2rem 1.25rem;
}

.login-container {
    width: min(100%, 410px);
}

.login-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.login-logo {
    width: min(220px, 62vw);
    max-height: 88px;
    object-fit: contain;
}

.login-panel {
    padding: 2.2rem;
    background: var(--white);
    border-top: 5px solid var(--gold);
    border-radius: 0.8rem;
    box-shadow: 0 24px 70px rgba(24, 26, 35, 0.3);
    animation: rise-in 0.35s ease-out both;
}

.login-panel h1 {
    margin: 0;
    font-size: 1.65rem;
    letter-spacing: -0.025em;
}

.login-intro {
    margin: 0.55rem 0 1.7rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.login-form .field-group + .field-group {
    margin-top: 1rem;
}

.login-form button {
    margin-top: 1.5rem;
}

.login-error {
    padding: 0.7rem 0.8rem;
    margin: 1rem 0 0;
    color: #9d2d2d;
    font-size: 0.86rem;
    font-weight: 600;
    background: #fff7f7;
    border-left: 3px solid #c54242;
}

/* 9. Panel de administración */
.dashboard-page {
    display: flex;
    min-height: 100vh;
    background: #f5f6f8;
}

.dashboard-sidebar {
    position: fixed;
    z-index: 10;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    width: 248px;
    padding: 1.5rem 1rem;
    color: var(--white);
    background: var(--ink);
}

.dashboard-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    margin-bottom: 2.3rem;
}

.dashboard-brand img {
    width: 150px;
    max-height: 58px;
    object-fit: contain;
}

.dashboard-nav-label {
    padding: 0 0.75rem;
    margin: 0 0 0.7rem;
    color: #a8aab4;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
}

.dashboard-nav {
    display: grid;
    gap: 0.35rem;
}

.dashboard-nav-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 46px;
    padding: 0.7rem 0.8rem;
    color: #e4e5e9;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.55rem;
    transition: color 0.18s ease, background 0.18s ease;
}

.dashboard-nav-link svg,
.dashboard-module-icon svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.dashboard-nav-link:hover,
.dashboard-nav-link.is-active {
    color: var(--white);
    background: rgba(227, 163, 39, 0.2);
}

.dashboard-nav-link.is-active {
    box-shadow: inset 3px 0 var(--gold-light);
}

.dashboard-sidebar-footer {
    margin-top: auto;
    padding: 1rem 0.75rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.dashboard-sidebar-footer a {
    color: #e4e5e9;
    font-size: 0.84rem;
    text-decoration: none;
}

.dashboard-sidebar-footer a:hover {
    color: var(--gold-light);
}

.dashboard-main {
    width: calc(100% - 248px);
    min-width: 0;
    margin-left: 248px;
}

.dashboard-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 88px;
    padding: 1rem clamp(1.25rem, 4vw, 3.5rem);
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.dashboard-breadcrumb {
    margin: 0 0 0.25rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.dashboard-topbar h1 {
    margin: 0;
    font-size: 1.35rem;
}

.dashboard-user-menu summary {
    gap: 0.65rem;
    color: var(--ink);
    border-color: var(--line);
}

.dashboard-avatar {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: var(--ink);
    font-size: 0.8rem;
    background: #fff1ce;
    border-radius: 50%;
}

.dashboard-content {
    width: min(100%, 1440px);
    margin: 0 auto;
    padding: clamp(1.25rem, 3vw, 2.75rem);
}

.dashboard-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 190px;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    overflow: hidden;
    color: var(--white);
    background: linear-gradient(115deg, #292b37, #414457);
    border-radius: 1rem;
    box-shadow: 0 15px 35px rgba(41, 43, 55, 0.13);
}

.dashboard-welcome .eyebrow {
    color: var(--gold-light);
}

.dashboard-welcome h2 {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.dashboard-welcome p:not(.eyebrow) {
    max-width: 520px;
    margin: 0.6rem 0 0;
    color: #e1e2e7;
    line-height: 1.6;
}

.dashboard-welcome-mark {
    display: grid;
    width: 116px;
    height: 116px;
    flex: 0 0 auto;
    place-items: center;
    margin: 0 2rem;
    color: rgba(255, 255, 255, 0.84);
    font-size: 2rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    box-shadow: 0 0 0 14px rgba(255, 255, 255, 0.04), 0 0 0 28px rgba(255, 255, 255, 0.035);
}

.dashboard-modules {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
    margin-top: 1.5rem;
}

.dashboard-module-card {
    display: flex;
    min-height: 220px;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.35rem;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    box-shadow: 0 7px 20px rgba(41, 43, 55, 0.045);
    scroll-margin-top: 1rem;
}

.dashboard-module-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--gold-deep);
    background: #fff4d9;
    border-radius: 0.7rem;
}

.dashboard-module-card h2 {
    margin: 1rem 0 0;
    font-size: 1.05rem;
}

.dashboard-module-card p {
    margin: 0.45rem 0 1rem;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.dashboard-module-status,
.dashboard-module-action {
    margin-top: auto;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.dashboard-module-status {
    padding: 0.35rem 0.55rem;
    background: #f1f2f4;
    border-radius: 99px;
}

.dashboard-module-link {
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-module-link:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: 0 12px 26px rgba(41, 43, 55, 0.1);
}

.dashboard-module-action {
    color: var(--gold-deep);
}

/* 10. Gestión de usuarios */
.management-page {
    width: min(100% - 2.4rem, 1120px);
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4.5rem) 0;
}

.management-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.management-heading h1 {
    margin: 0;
    font-size: clamp(1.6rem, 4vw, 2.3rem);
    letter-spacing: -0.025em;
}

.management-heading p:not(.eyebrow) {
    margin: 0.55rem 0 0;
    color: var(--muted);
}

.back-link {
    color: var(--gold-deep);
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

.management-section {
    padding: 1.6rem;
    margin-top: 1.5rem;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    box-shadow: 0 12px 30px rgba(41, 43, 55, 0.07);
}

.section-heading {
    margin-bottom: 1.2rem;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.2rem;
}

.section-heading p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.user-create-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    align-items: end;
    gap: 1rem;
}

.user-create-form button,
.user-edit-form button,
.user-delete-form button {
    width: auto;
    min-height: 44px;
    margin-top: 0;
    padding-inline: 1rem;
}

.management-message {
    padding: 0.8rem 1rem;
    margin: 0 0 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-left: 3px solid;
}

.management-message-success {
    color: #167a42;
    background: #effaf3;
    border-color: #2c9a5b;
}

.management-message-error {
    color: #9d2d2d;
    background: #fff7f7;
    border-color: #c54242;
}

.users-table-wrapper {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.users-table th,
.users-table td {
    padding: 0.85rem 0.65rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
}

.users-table th {
    color: var(--muted);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.user-edit-form {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
}

.user-edit-form select,
.user-edit-form input {
    min-height: 42px;
}

.user-edit-form input {
    min-width: 190px;
}

.user-edit-form .password-field {
    flex: 1;
    min-width: 190px;
}

.user-edit-form .password-field input {
    min-width: 0;
}

.danger-button {
    color: var(--white);
    background: #c54242;
    box-shadow: 0 5px 0 #8f2727;
}

.danger-button:hover {
    background: #ae3535;
    box-shadow: 0 7px 0 #8f2727;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 11. Animaciones ligeras */
@keyframes loading {
    from {
        transform: translateX(-105%);
    }

    to {
        transform: translateX(210%);
    }
}

@keyframes logo-pulse {
    to {
        opacity: 0.86;
        transform: scale(1.03);
    }
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 12. Diseño responsive */
@media (max-width: 900px) {
    .dashboard-sidebar {
        width: 205px;
        padding-inline: 0.75rem;
    }

    .dashboard-main {
        width: calc(100% - 205px);
        margin-left: 205px;
    }

    .dashboard-modules {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .navbar {
        min-height: 62px;
        padding-inline: 1rem;
    }

    .brand-logo {
        width: 42px;
        height: 42px;
    }

    .header,
    .calculator-form,
    .results {
        padding-inline: 1.25rem;
    }

    .header {
        padding-block: 1.6rem 1.4rem;
    }

    .management-heading {
        display: block;
    }

    .back-link {
        display: inline-block;
        margin-top: 1rem;
    }

    .management-section {
        padding: 1.25rem;
    }

    .user-create-form {
        grid-template-columns: 1fr;
    }

    .user-create-form button {
        width: 100%;
    }

    .res-item {
        font-size: 0.82rem;
    }

    .dashboard-page {
        display: block;
    }

    .dashboard-sidebar {
        position: sticky;
        inset: 0 auto auto;
        width: 100%;
        padding: 0.55rem 0.7rem;
    }

    .dashboard-brand,
    .dashboard-nav-label,
    .dashboard-sidebar-footer {
        display: none;
    }

    .dashboard-nav {
        display: flex;
        gap: 0.35rem;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .dashboard-nav-link {
        min-height: 42px;
        flex: 0 0 auto;
        gap: 0.45rem;
        padding: 0.55rem 0.65rem;
        font-size: 0.78rem;
    }

    .dashboard-nav-link svg {
        width: 17px;
        height: 17px;
    }

    .dashboard-nav-link.is-active {
        box-shadow: inset 0 -2px var(--gold-light);
    }

    .dashboard-main {
        width: 100%;
        margin: 0;
    }

    .dashboard-topbar {
        min-height: 72px;
        padding: 0.75rem 1rem;
    }

    .dashboard-topbar h1 {
        font-size: 1.1rem;
    }

    .dashboard-breadcrumb {
        font-size: 0.7rem;
    }

    .dashboard-user-menu summary {
        gap: 0.4rem;
        padding: 0.4rem;
        font-size: 0.78rem;
    }

    .dashboard-user-menu .user-menu-chevron {
        display: none;
    }

    .dashboard-content {
        padding: 1rem;
    }

    .dashboard-welcome {
        min-height: 0;
        padding: 1.35rem;
        border-radius: 0.8rem;
    }

    .dashboard-welcome-mark {
        width: 58px;
        height: 58px;
        margin: 0 0 0 0.75rem;
        font-size: 1rem;
        box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.04), 0 0 0 14px rgba(255, 255, 255, 0.035);
    }

    .dashboard-modules {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        margin-top: 1rem;
    }

    .dashboard-module-card {
        min-height: 190px;
        padding: 1.15rem;
    }
}

/* Respeta la preferencia de accesibilidad del sistema operativo. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/* Módulo visual de clientes */
.clients-content { max-width: 1440px; }

.clients-heading,
.clients-table-toolbar,
.client-registration-heading,
.client-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.clients-heading { margin-bottom: 1.5rem; }

.clients-heading h2,
.client-registration h2,
.clients-table-toolbar h2 {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 1.7rem);
}

.clients-heading p:not(.eyebrow),
.clients-table-toolbar p {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.client-register-button,
.client-save-button,
.client-cancel-button,
.client-view-button {
    width: auto;
    margin: 0;
    box-shadow: none;
}

.client-register-button {
    min-height: 44px;
    padding: 0.65rem 0.9rem;
    color: var(--ink);
    font-size: 0.86rem;
}

.client-register-button svg,
.client-close-button svg,
.client-search svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.client-register-button.is-active {
    color: var(--white);
    background: var(--slate);
}

.client-registration,
.clients-table-card {
    padding: clamp(1.2rem, 2.5vw, 1.6rem);
    margin-bottom: 1.5rem;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    box-shadow: 0 7px 20px rgba(41, 43, 55, 0.045);
}

.client-registration.is-hidden { display: none; }

.client-registration-heading {
    align-items: flex-start;
    padding-bottom: 1.15rem;
    border-bottom: 1px solid var(--line);
}

.client-close-button {
    display: grid;
    width: 36px;
    min-height: 36px;
    place-items: center;
    padding: 0;
    margin: 0;
    color: var(--muted);
    background: #f4f5f7;
    border: 0;
    border-radius: 0.4rem;
    box-shadow: none;
}

.client-close-button:hover {
    color: var(--ink);
    background: #e9eaed;
    box-shadow: none;
    transform: none;
}

.client-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    padding-top: 1.25rem;
}

.client-form .field-group + .field-group { margin-top: 0; }

.client-form-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 0.25rem;
}

.client-save-button,
.client-cancel-button {
    min-height: 43px;
    padding: 0.6rem 1rem;
}

.client-cancel-button {
    color: var(--slate);
    background: #eef0f3;
}

.client-cancel-button:hover {
    background: #e1e3e7;
    box-shadow: none;
    transform: none;
}

.clients-table-toolbar { margin-bottom: 1.25rem; }
.clients-table-toolbar h2 { font-size: 1.12rem; }

.client-search {
    position: relative;
    display: flex;
    align-items: center;
    width: min(100%, 560px);
    color: var(--muted);
}

.client-search svg {
    position: absolute;
    left: 0.75rem;
    pointer-events: none;
}

.client-search input {
    min-height: 42px;
    padding-left: 2.55rem;
}

.client-action-message {
    padding: 0.7rem 0.8rem;
    margin: 1rem 0;
    font-size: 0.86rem;
    font-weight: 600;
}

.client-action-message.is-success {
    color: #286143;
    background: #f2faf5;
    border-left: 3px solid #4b9b6d;
}

.client-action-message.is-error {
    color: #9d2d2d;
    background: #fff7f7;
    border-left: 3px solid #c54242;
}

.clients-table-wrapper { overflow-x: auto; }

.clients-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.clients-table th,
.clients-table td {
    padding: 1rem 0.75rem;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
}

.clients-table th {
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    background: #fafafb;
}

.clients-table th:first-child { border-radius: 0.45rem 0 0 0.45rem; }
.clients-table th:last-child { border-radius: 0 0.45rem 0.45rem 0; }
.clients-table td:first-child { padding-left: 0.9rem; }
.clients-table tbody tr:hover { background: #fffaf0; }

.client-score-pill,
.client-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 43px;
    padding: 0.28rem 0.5rem;
    font-size: 0.76rem;
    font-weight: 700;
    border-radius: 99px;
}

.client-score-pill { color: var(--gold-deep); background: #fff4d9; }
.status-active { color: #167a42; background: #effaf3; }
.status-pending { color: #956100; background: #fff4d9; }

.client-view-button {
    min-height: 34px;
    padding: 0.35rem 0.65rem;
    color: var(--gold-deep);
    font-size: 0.8rem;
    background: #fff6e3;
    border: 1px solid #f3d48e;
    border-radius: 0.4rem;
}

.client-view-button:hover {
    background: #ffedbf;
    box-shadow: none;
    transform: none;
}

@media (max-width: 900px) {
    .client-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
    .clients-heading,
    .clients-table-toolbar { align-items: stretch; flex-direction: column; }

    .client-register-button,
    .client-search { width: 100%; }

    .client-form { grid-template-columns: 1fr; }

    .client-form-actions { flex-direction: column-reverse; }

    .client-save-button,
    .client-cancel-button { width: 100%; }
}

/* Modal visual de detalle de cliente */
.is-modal-open { overflow: hidden; }

.client-modal {
    position: fixed;
    z-index: 40;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.client-modal.is-hidden { display: none; }

.client-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24, 26, 35, 0.58);
    backdrop-filter: blur(4px);
}

.client-modal-panel {
    position: relative;
    width: min(100%, 980px);
    max-height: min(860px, calc(100vh - 2.5rem));
    overflow: auto;
    background: var(--white);
    border-radius: 1rem;
    box-shadow: 0 24px 70px rgba(24, 26, 35, 0.3);
    animation: rise-in 0.25s ease-out both;
}

.client-modal-header,
.client-modal-identity,
.client-overview,
.client-indicators,
.client-file-card,
.client-history li {
    display: flex;
    align-items: center;
}

.client-modal-header {
    justify-content: space-between;
    gap: 1rem;
    padding: 1.4rem clamp(1.25rem, 3vw, 2rem);
    color: var(--white);
    background: linear-gradient(115deg, var(--ink), var(--slate));
}

.client-modal-identity { gap: 0.9rem; }
.client-modal-avatar {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 800;
    background: var(--gold-light);
    border-radius: 50%;
}

.client-modal-header .eyebrow { margin-bottom: 0.25rem; }
.client-modal-header h2 { margin: 0; font-size: 1.3rem; }
.client-modal-id { margin: 0.25rem 0 0; color: #d9dbe0; font-size: 0.82rem; }

.client-modal-close {
    display: grid;
    width: 36px;
    min-height: 36px;
    place-items: center;
    padding: 0;
    margin: 0;
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0.4rem;
    box-shadow: none;
}

.client-modal-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.client-modal-close:hover { background: rgba(255, 255, 255, 0.22); box-shadow: none; transform: none; }

.client-modal-body { padding: clamp(1.25rem, 3vw, 2rem); }

.client-overview {
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem;
    background: #fff8e9;
    border: 1px solid #f3dfab;
    border-radius: 0.7rem;
}

.client-overview > div { min-width: 0; padding-inline: 0.8rem; border-right: 1px solid #ebd8a7; }
.client-overview > div:last-child { border-right: 0; }
.client-overview span,
.client-overview small { display: block; color: var(--muted); font-size: 0.72rem; }
.client-overview strong { display: block; margin: 0.2rem 0; color: var(--slate); font-size: 1.05rem; }
.client-credit-state { color: #167a42 !important; }

.client-modal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; margin-top: 1.1rem; }
.client-modal-section { padding: 1.15rem; background: #fafafb; border: 1px solid var(--line); border-radius: 0.7rem; }
.client-modal-section h3 { margin: 0 0 1rem; font-size: 0.96rem; }
.client-contact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; margin: 0; }
.client-contact-list dt { color: var(--muted); font-size: 0.72rem; }
.client-contact-list dd { margin: 0.2rem 0 0; color: var(--slate); font-size: 0.82rem; line-height: 1.35; }

.client-indicators { gap: 0.75rem; }
.client-indicators > div { width: 50%; padding: 0.75rem; background: var(--white); border: 1px solid var(--line); border-radius: 0.5rem; }
.client-indicators span, .client-indicators p { display: block; margin: 0; color: var(--muted); font-size: 0.72rem; }
.client-indicators strong { display: block; margin: 0.3rem 0; font-size: 1rem; }
.indicator-low { color: #167a42; }.indicator-high { color: var(--gold-deep); }

.client-history-section, .client-files-section { grid-column: span 1; }
.client-history { display: grid; gap: 0.85rem; padding: 0; margin: 0; list-style: none; }
.client-history li { gap: 0.65rem; }
.history-icon { display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; font-size: 0.7rem; font-weight: 800; border-radius: 50%; }
.history-success { color: #167a42; background: #eaf8ef; }.history-info { color: var(--gold-deep); background: #fff1cf; }
.client-history strong, .client-history small { display: block; }.client-history strong { font-size: 0.8rem; }.client-history small { margin-top: 0.15rem; color: var(--muted); font-size: 0.7rem; }

.client-files { display: grid; gap: 0.55rem; }
.client-file-card { gap: 0.65rem; width: 100%; min-height: 51px; padding: 0.55rem; margin: 0; color: var(--slate); text-align: left; background: var(--white); border: 1px solid var(--line); border-radius: 0.45rem; box-shadow: none; }
.client-file-card:hover { background: #fffaf0; border-color: #f3d48e; box-shadow: none; transform: none; }
.file-icon { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; font-size: 0.62rem; font-weight: 800; border-radius: 0.35rem; }.file-image { color: #7760aa; background: #eeeafd; }.file-pdf { color: #b33939; background: #fff0f0; }
.client-file-card strong, .client-file-card small { display: block; }.client-file-card strong { font-size: 0.78rem; }.client-file-card small { margin-top: 0.1rem; color: var(--muted); font-size: 0.68rem; }

@media (max-width: 650px) {
    .client-modal { padding: 0.75rem; }
    .client-overview { display: grid; grid-template-columns: repeat(2, 1fr); }
    .client-overview > div { padding: 0.5rem; border-right: 0; }
    .client-modal-grid { grid-template-columns: 1fr; }
    .client-contact-list { grid-template-columns: 1fr; }
}

/* Edición visual de la información de contacto del cliente */
.client-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.client-section-heading h3 { margin-bottom: 0; }

.client-contact-edit,
.client-contact-cancel,
.client-contact-save {
    width: auto;
    min-height: 32px;
    padding: 0.35rem 0.6rem;
    margin: 0;
    font-size: 0.74rem;
    box-shadow: none;
}

.client-contact-edit {
    color: var(--gold-deep);
    background: #fff6e3;
    border: 1px solid #f3d48e;
    border-radius: 0.35rem;
}

.client-contact-edit:hover,
.client-contact-cancel:hover {
    box-shadow: none;
    transform: none;
}

.client-contact-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.client-contact-form.is-hidden,
.client-contact-list.is-hidden,
.client-contact-edit.is-hidden { display: none; }

.client-contact-form label {
    margin-bottom: 0.32rem;
    font-size: 0.72rem;
}

.client-contact-form input {
    min-height: 38px;
    padding: 0.55rem 0.6rem;
    font-size: 0.78rem;
}

.client-contact-form-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.25rem;
}

.client-contact-cancel {
    color: var(--slate);
    background: #eef0f3;
}

.client-contact-save { padding-inline: 0.8rem; }

@media (max-width: 650px) {
    .client-contact-form { grid-template-columns: 1fr; }
}

/* Maqueta visual de Gestión de Créditos */
.credits-content { max-width: 1500px; }
.credits-dashboard { overflow-x: clip; }
.credits-heading { margin-bottom: 1.35rem; }
.credits-new-button { flex: 0 0 auto; }
.credits-new-button svg { margin-right: 0.35rem; }

.credit-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.credit-kpi {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    min-height: 132px;
    padding: 1.15rem;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    box-shadow: 0 7px 20px rgba(41, 43, 55, 0.045);
}

.credit-kpi::after {
    position: absolute;
    right: -24px;
    bottom: -32px;
    width: 94px;
    height: 94px;
    content: "";
    background: currentColor;
    border-radius: 50%;
    opacity: 0.035;
}

.credit-kpi-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 0.65rem;
}

.credit-kpi-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.kpi-active { color: #167a42; background: #effaf3; }
.kpi-late { color: #ba4942; background: #fff0ed; }
.kpi-complete { color: #6d56a5; background: #f2effc; }
.kpi-portfolio { color: var(--gold-deep); background: #fff4d9; }
.credit-kpi p { margin: 0 0 0.2rem; color: var(--muted); font-size: 0.78rem; font-weight: 650; }
.credit-kpi strong { display: block; color: var(--ink); font-size: 1.55rem; letter-spacing: -0.04em; }
.credit-kpi small { display: block; margin-top: 0.3rem; color: var(--muted); font-size: 0.76rem; }
.credit-kpi small b { color: var(--slate); }
.credit-kpi-note { position: absolute; right: 1rem; bottom: 1rem; color: #92949c; font-size: 0.67rem; }

.credits-table-card { padding-bottom: 0.75rem; }
.credits-toolbar { display: grid; gap: 1rem; margin-bottom: 1.15rem; }
.credits-search { width: min(100%, 610px); }
.credits-search input { min-height: 44px; }
.credit-filters { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.credit-filter { width: auto; min-height: 34px; flex: 0 0 auto; padding: 0.4rem 0.75rem; margin: 0; color: #666a75; font-size: 0.76rem; font-weight: 650; background: #f5f6f8; border: 1px solid #eceef1; border-radius: 99px; box-shadow: none; }
.credit-filter:hover { color: var(--gold-deep); background: #fff8e9; border-color: #f0d99f; box-shadow: none; transform: none; }
.credit-filter.is-selected { color: #fff; background: var(--ink); border-color: var(--ink); }
.credit-filter span { margin-left: 0.25rem; opacity: 0.72; }
.credits-table-heading { align-items: center; margin: 0 0 0.85rem; }
.credits-table-heading h2 { font-size: 1.08rem; }
.credit-updated { color: #8b8e97; font-size: 0.72rem; }
.credits-table { min-width: 1040px; }
.credits-table th { padding-top: 0.8rem; padding-bottom: 0.8rem; }
.credits-table td { padding-top: 0.78rem; padding-bottom: 0.78rem; }
.credit-customer { display: flex; align-items: center; gap: 0.65rem; }
.credit-customer > span:last-child strong,
.credit-customer > span:last-child small { display: block; }
.credit-customer strong { color: var(--slate); font-size: 0.81rem; }
.credit-customer small { margin-top: 0.16rem; color: #858892; font-size: 0.7rem; }
.credit-avatar { display: inline-grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; color: #4c4f5a; font-size: 0.68rem; font-weight: 800; border-radius: 50%; }
.avatar-gold { background: #fff0c9; }.avatar-blue { color: #4167a0; background: #e8f0ff; }.avatar-violet { color: #71539a; background: #f0e9fa; }.avatar-rose { color: #a65368; background: #ffedf1; }.avatar-green { color: #34764d; background: #e7f6eb; }
.credit-imei { color: #686b75; font-size: 0.76rem; font-variant-numeric: tabular-nums; }
.credit-imei small { display: block; margin-top: 0.15rem; color: #92949c; font-size: 0.65rem; }
.credit-empty-state { padding: 2rem 1rem !important; color: #858892; text-align: center; }
.credits-table [hidden] { display: none; }
.credit-status { display: inline-flex; align-items: center; gap: 0.38rem; padding: 0.32rem 0.55rem; font-size: 0.7rem; font-weight: 700; border-radius: 99px; }
.credit-status i { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.status-credit-active { color: #197346; background: #eaf8ef; }.status-credit-late { color: #ad473e; background: #fff0ed; }.status-credit-recovery { color: #976100; background: #fff4d9; }.status-credit-complete { color: #6e56a5; background: #f1edfa; }.status-credit-recovered { color: #47727e; background: #e9f5f7; }
.credit-money { display: block; color: #40434e; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.credit-bs { display: block; margin-top: 0.15rem; color: #92949c; font-size: 0.65rem; white-space: nowrap; }
.credit-bs em,.credit-preview-summary em { color: #728574; font-size: 0.58rem; font-style: normal; font-weight: 700; }
.credit-delay { display: inline-block; color: #7c7f88; font-size: 0.75rem; }
.delay-late { padding: 0.28rem 0.5rem; color: #ad473e; font-weight: 700; background: #fff0ed; border-radius: 99px; }
.credit-pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.8rem; color: #8b8e97; font-size: 0.72rem; }
.credit-pagination > div { display: flex; gap: 0.3rem; }
.credit-pagination button { width: 31px; min-height: 31px; padding: 0; margin: 0; color: #666a75; font-size: 0.75rem; background: #fff; border: 1px solid var(--line); border-radius: 0.38rem; box-shadow: none; }
.credit-pagination button:hover,.credit-pagination button.is-current { color: #fff; background: var(--ink); border-color: var(--ink); box-shadow: none; transform: none; }
.credit-pagination button:disabled { color: #babcc2; background: #f7f7f8; }

.credit-modal { position: fixed; z-index: 45; inset: 0; display: none; place-items: center; padding: 1.2rem; }
.credit-modal.is-open { display: grid; }
.credit-modal-backdrop { position: absolute; inset: 0; background: rgba(24, 26, 35, 0.62); backdrop-filter: blur(4px); }
.credit-modal-panel { position: relative; display: flex; flex-direction: column; width: min(100%, 1000px); max-height: min(900px, calc(100vh - 2.4rem)); overflow: hidden; background: #fff; border-radius: 1rem; box-shadow: 0 24px 70px rgba(24, 26, 35, 0.3); animation: rise-in 0.22s ease-out both; }
.credit-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.35rem clamp(1.2rem, 3vw, 1.8rem); color: #fff; background: linear-gradient(115deg, var(--ink), var(--slate)); border-bottom: 3px solid var(--gold); }
.credit-modal-header .eyebrow { margin-bottom: 0.25rem; }
.credit-modal-header h2 { margin: 0; font-size: 1.28rem; }
.credit-modal-header p:not(.eyebrow) { margin: 0.35rem 0 0; color: #d8d9de; font-size: 0.78rem; }
.credit-modal-header .client-close-button { flex: 0 0 auto; }
.credit-modal-content { overflow: auto; padding: 1.1rem clamp(1.2rem, 3vw, 1.8rem) 1.35rem; }
.credit-steps { display: flex; align-items: center; gap: 1.5rem; padding: 0 0 1rem; margin-bottom: 0.4rem; border-bottom: 1px solid var(--line); }
.credit-steps span { display: flex; align-items: center; gap: 0.42rem; color: #989aa2; font-size: 0.7rem; font-weight: 650; }
.credit-steps span.is-current { color: var(--gold-deep); }
.credit-steps i { display: grid; width: 22px; height: 22px; place-items: center; color: #737681; font-size: 0.64rem; font-style: normal; background: #f0f1f3; border-radius: 50%; }
.credit-steps .is-current i { color: #fff; background: var(--gold); }
.credit-form-section { padding: 1.1rem 0; border-bottom: 1px solid #eff0f2; }
.credit-section-title { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.9rem; }
.credit-section-number { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; color: var(--gold-deep); font-size: 0.68rem; font-weight: 800; background: #fff4d9; border-radius: 0.55rem; }
.credit-section-title h3,.credit-preview-heading h3 { margin: 0; color: var(--slate); font-size: 0.9rem; }
.credit-section-title p { margin: 0.2rem 0 0; color: #878a93; font-size: 0.7rem; }
.credit-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1rem; }
.credit-form-grid .field-group { min-width: 0; }
.credit-form-grid .field-group + .field-group { margin-top: 0; }
.credit-form-grid label { margin-bottom: 0.32rem; font-size: 0.72rem; }
.credit-form-grid input,.credit-form-grid select { min-height: 39px; padding: 0.55rem 0.65rem; font-size: 0.78rem; }
.credit-field-wide { grid-column: 1 / -1; }
.credit-input-with-icon { position: relative; }
.credit-input-with-icon input { padding-right: 2.4rem; }
.credit-input-with-icon > span { position: absolute; top: 50%; right: 0.8rem; color: #898c95; font-size: 1.1rem; transform: translateY(-50%); }
.credit-field-hint { display: block; margin-top: 0.3rem; color: #92949c; font-size: 0.66rem; }
.credit-autocomplete { position: relative; }
.credit-autocomplete-results { position: absolute; z-index: 20; top: calc(100% + 0.25rem); right: 0; left: 0; max-height: 220px; overflow-y: auto; padding: 0.25rem; background: #fff; border: 1px solid var(--line); border-radius: 0.55rem; box-shadow: 0 10px 24px rgba(24, 26, 35, 0.14); }
.credit-autocomplete-option { display: flex; width: 100%; flex-direction: column; gap: 0.15rem; padding: 0.55rem 0.65rem; color: var(--slate); text-align: left; background: transparent; border: 0; border-radius: 0.35rem; cursor: pointer; }
.credit-autocomplete-option:hover,.credit-autocomplete-option.is-active { background: #f5f2e9; }
.credit-autocomplete-option strong { font-size: 0.75rem; }
.credit-autocomplete-option small,.credit-autocomplete-empty { color: #888b94; font-size: 0.67rem; }
.credit-autocomplete-empty { padding: 0.65rem; }
.credit-client-preview { display: flex; grid-column: 1 / -1; align-items: center; gap: 0.65rem; padding: 0.65rem 0.75rem; background: #fafafb; border: 1px solid var(--line); border-radius: 0.55rem; }
.credit-client-preview > div { min-width: 0; }
.credit-client-preview strong,.credit-client-preview small { display: block; }
.credit-client-preview strong { color: var(--slate); font-size: 0.76rem; }
.credit-client-preview small { margin-top: 0.15rem; color: #888b94; font-size: 0.66rem; }
.credit-score { margin-left: auto; padding: 0.3rem 0.5rem; color: var(--gold-deep); font-size: 0.65rem; font-weight: 700; background: #fff4d9; border-radius: 99px; }
.credit-preview-section { padding: 1.1rem 0 0; }
.credit-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.credit-preview-heading .eyebrow { margin-bottom: 0.2rem; font-size: 0.6rem; }
.credit-preview-pill { padding: 0.34rem 0.55rem; color: #747781; font-size: 0.64rem; background: #f4f5f7; border-radius: 99px; }
.credit-preview-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; padding: 0.7rem; background: #fff9ec; border: 1px solid #f2e4bd; border-radius: 0.6rem; }
.credit-preview-summary > div + div { padding-left: 0.7rem; border-left: 1px solid #eadcb6; }
.credit-preview-summary span,.credit-preview-summary small { display: block; color: #858892; font-size: 0.63rem; }
.credit-preview-summary strong { display: block; margin: 0.18rem 0; color: var(--slate); font-size: 0.88rem; }
.credit-schedule { margin-top: 0.7rem; overflow: hidden; border: 1px solid var(--line); border-radius: 0.55rem; }
.credit-schedule-row { display: grid; grid-template-columns: 0.4fr 1.4fr 1fr 0.9fr; align-items: center; gap: 0.5rem; min-height: 34px; padding: 0.4rem 0.65rem; color: #6f727c; font-size: 0.66rem; border-bottom: 1px solid #f0f1f3; }
.credit-schedule-row:last-of-type { border-bottom: 0; }
.credit-schedule-row strong { color: var(--slate); }
.schedule-head { min-height: 31px; color: #83868f; font-size: 0.59rem; font-weight: 700; text-transform: uppercase; background: #fafafb; }
.schedule-pending { color: #a16b0a; }
.schedule-more { padding: 0.45rem; color: #898c95; font-size: 0.62rem; text-align: center; background: #fafafb; }
.credit-validation { display: flex; align-items: center; gap: 0.55rem; padding: 0.65rem 0.75rem; margin-top: 0.7rem; background: #f3faf5; border: 1px solid #dcefe2; border-radius: 0.55rem; }
.validation-check { display: grid; width: 23px; height: 23px; flex: 0 0 auto; place-items: center; color: #27764a; font-size: 0.72rem; font-weight: 800; background: #dff2e5; border-radius: 50%; }
.credit-validation > span:nth-child(2) { flex: 1; }
.credit-validation strong,.credit-validation small { display: block; }
.credit-validation strong { color: #3d644d; font-size: 0.68rem; }
.credit-validation small { margin-top: 0.12rem; color: #718679; font-size: 0.61rem; }
.validation-ready { color: #2d7d4f; font-size: 0.65rem; font-weight: 700; }
.credit-form-actions { display: flex; justify-content: flex-end; gap: 0.55rem; padding-top: 1rem; }
.credit-form-actions button { min-height: 39px; }

.credit-detail-modal { position: fixed; z-index: 46; inset: 0; display: none; place-items: center; padding: 1.1rem; }
.credit-detail-modal.is-open { display: grid; }
.credit-detail-backdrop { position: absolute; inset: 0; background: rgba(24, 26, 35, 0.64); backdrop-filter: blur(4px); }
.credit-detail-panel { position: relative; display: flex; flex-direction: column; width: min(100%, 1120px); max-height: min(900px, calc(100vh - 2.2rem)); overflow: hidden; background: #f5f6f8; border-radius: 1rem; box-shadow: 0 24px 70px rgba(24, 26, 35, 0.3); animation: rise-in 0.22s ease-out both; }
.credit-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem clamp(1.2rem, 3vw, 1.8rem); color: #fff; background: linear-gradient(115deg, var(--ink), var(--slate)); border-bottom: 3px solid var(--gold); }
.credit-detail-header .eyebrow { margin-bottom: 0.2rem; }
.credit-detail-header h2 { margin: 0; font-size: 1.2rem; }
.credit-detail-header p:not(.eyebrow) { margin: 0.3rem 0 0; color: #d8d9de; font-size: 0.75rem; }
.credit-detail-header .client-close-button { flex: 0 0 auto; }
.credit-detail-body { overflow: auto; padding: 1.15rem clamp(1.1rem, 2.6vw, 1.7rem); }
.credit-detail-layout { display: grid; grid-template-columns: minmax(290px, 0.82fr) minmax(0, 1.18fr); align-items: start; gap: 1rem; }
.credit-detail-primary { display: grid; gap: 1rem; }
.credit-detail-card { min-width: 0; padding: 1.1rem; background: #fff; border: 1px solid #e9eaed; border-radius: 0.8rem; box-shadow: 0 8px 22px rgba(41, 43, 55, 0.045); }
.credit-detail-card-heading { display: flex; align-items: flex-start; gap: 0.65rem; margin-bottom: 0.85rem; }
.credit-detail-card-heading .credit-section-number { width: 29px; height: 29px; }
.credit-detail-card-heading > div { min-width: 0; }
.credit-detail-card-heading p,.credit-reassignment-card > div > p { margin: 0 0 0.35rem; color: #687884; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.09em; }
.credit-detail-card-heading h3 { margin: 0; color: var(--slate); font-size: 0.95rem; }
.credit-detail-card-heading small { display: block; margin-top: 0.23rem; color: #7c8790; font-size: 0.67rem; overflow-wrap: anywhere; }
.credit-detail-card-heading small span { color: #53626c; font-variant-numeric: tabular-nums; }
.credit-detail-facts { display: grid; gap: 0.63rem; }
.credit-detail-facts > div { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; color: #64717a; font-size: 0.76rem; }
.credit-detail-facts strong { color: #30353d; font-size: 0.77rem; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.credit-detail-value { display: grid; justify-items: end; gap: 0.1rem; }
.credit-detail-value small { color: #879199; font-size: 0.57rem; text-align: right; }
.credit-detail-state-label { display: inline-flex; margin-top: 0.15rem; padding: 0.32rem 0.58rem; font-size: 0.72rem; font-weight: 750; border-radius: 99px; }
.credit-state-options { display: flex; flex-wrap: wrap; gap: 0.38rem; }
.credit-state-options span { padding: 0.38rem 0.56rem; color: #66727b; font-size: 0.67rem; font-weight: 700; background: #f4f5f7; border: 1px solid transparent; border-radius: 0.42rem; }
.credit-state-options span.is-current { color: #fff; background: var(--ink); border-color: var(--ink); }
.credit-installments-card .credit-detail-card-heading { margin-bottom: 1rem; }
.credit-installments-list { display: grid; gap: 0.48rem; }
.credit-detail-installment { display: grid; grid-template-columns: 27px minmax(80px, 1fr) minmax(105px, auto) auto; align-items: center; gap: 0.55rem; min-height: 53px; padding: 0.55rem 0.65rem; background: #f7f7f8; border: 1px solid #f0f0f2; border-radius: 0.55rem; }
.installment-indicator { display: grid; width: 22px; height: 22px; place-items: center; font-size: 0.73rem; font-weight: 800; border: 1px solid currentColor; border-radius: 50%; }
.installment-paid { color: #24724b; }.installment-late { color: #bb3c3c; }.installment-pending { color: #7f8a90; border-color: transparent; }.installment-recovered { color: #956300; }
.installment-description strong,.installment-description small,.installment-amount strong,.installment-amount small { display: block; }
.installment-description strong { color: #38414a; font-size: 0.74rem; font-weight: 650; }
.installment-description small { margin-top: 0.16rem; color: #899198; font-size: 0.62rem; }
.installment-amount { text-align: right; }
.installment-amount strong { color: #30353d; font-size: 0.75rem; font-weight: 650; }
.installment-amount small { margin-top: 0.15rem; color: #879199; font-size: 0.57rem; white-space: nowrap; }
.installment-state { padding: 0.28rem 0.48rem; color: #66757d; font-size: 0.61rem; font-weight: 750; white-space: nowrap; background: #e9ecee; border-radius: 99px; }
.installment-state-paid { color: #246f4a; background: #e2f2e8; }.installment-state-late { color: #b53636; background: #ffeded; }.installment-state-pending { color: #697780; background: #e9edef; }.installment-state-recovered { color: #8a5e00; background: #fff1cb; }
.credit-reassignment-card { display: none; max-width: 620px; gap: 0.9rem; padding: 1.1rem; margin: 1rem auto 0; background: #fff; border: 1px solid #e5e7eb; border-radius: 0.8rem; }
.credit-reassignment-card.is-visible { display: grid; }
.credit-reassignment-card > div > p { color: #667680; }
.credit-reassignment-card h3 { margin: 0 0 0.35rem; color: var(--slate); font-size: 0.9rem; }
.credit-reassignment-card > div > span { color: #687780; font-size: 0.75rem; line-height: 1.5; }
.credit-reassignment-card dl { display: grid; gap: 0.52rem; margin: 0; }
.credit-reassignment-card dl > div { display: flex; justify-content: space-between; gap: 0.8rem; font-size: 0.73rem; }
.credit-reassignment-card dt { color: #71808a; }.credit-reassignment-card dd { margin: 0; color: #343b42; font-weight: 650; text-align: right; }
.credit-reassign-button { width: 100%; min-height: 40px; margin: 0; color: #fff; font-size: 0.75rem; background: #173c48; border-radius: 99px; box-shadow: none; }
.credit-reassign-button:disabled { opacity: 0.58; cursor: not-allowed; }
.credit-detail-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; color: #8a9095; font-size: 0.66rem; }
.credit-detail-footer .client-cancel-button { min-height: 35px; padding: 0.45rem 0.8rem; font-size: 0.72rem; }

@media (max-width: 760px) {
    .credits-dashboard { display: block; }
    .credits-dashboard .dashboard-sidebar { position: sticky; inset: 0 auto auto; width: 100%; padding: 0.55rem 0.7rem; }
    .credits-dashboard .dashboard-brand,
    .credits-dashboard .dashboard-nav-label,
    .credits-dashboard .dashboard-sidebar-footer { display: none; }
    .credits-dashboard .dashboard-nav { display: flex; gap: 0.35rem; overflow-x: auto; scrollbar-width: thin; }
    .credits-dashboard .dashboard-nav-link { min-height: 42px; flex: 0 0 auto; gap: 0.45rem; padding: 0.55rem 0.65rem; font-size: 0.78rem; }
    .credits-dashboard .dashboard-nav-link svg { width: 17px; height: 17px; }
    .credits-dashboard .dashboard-nav-link.is-active { box-shadow: inset 0 -2px var(--gold-light); }
    .credits-dashboard .dashboard-main { width: 100%; margin: 0; }
    .credits-dashboard .dashboard-topbar { min-height: 72px; padding: 0.75rem 1rem; }
    .credits-dashboard .dashboard-topbar h1 { font-size: 1.1rem; }
    .credits-dashboard .dashboard-breadcrumb { font-size: 0.7rem; }
    .credits-dashboard .dashboard-user-menu summary { gap: 0.4rem; padding: 0.4rem; font-size: 0.78rem; }
    .credits-dashboard .dashboard-user-menu .user-menu-chevron { display: none; }
    .credits-dashboard .dashboard-content { padding: 1rem; }
}

@media (max-width: 1000px) {
    .credit-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .credit-detail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
    .credit-modal { padding: 0.55rem; }
    .credit-modal-panel { max-height: calc(100vh - 1.1rem); }
    .credit-detail-modal { padding: 0.55rem; }
    .credit-detail-panel { max-height: calc(100vh - 1.1rem); }
    .credit-steps { justify-content: space-between; gap: 0.35rem; }
    .credit-steps span { gap: 0.25rem; font-size: 0.59rem; }
    .credit-detail-installment { grid-template-columns: 24px minmax(0, 1fr) auto; }
    .installment-amount { grid-column: 2; text-align: left; }
    .installment-state { grid-column: 3; grid-row: 1 / span 2; }
}
@media (max-width: 480px) {
    .credits-heading { align-items: stretch; flex-direction: column; }
    .credits-new-button { width: 100%; }
    .credit-kpis { gap: 0.65rem; }
    .credit-kpi { min-height: 116px; gap: 0.55rem; padding: 0.85rem; }
    .credit-kpi-icon { width: 34px; height: 34px; }
    .credit-kpi strong { font-size: 1.25rem; }
    .credit-kpi-note { right: 0.7rem; bottom: 0.65rem; font-size: 0.58rem; }
    .credit-pagination { align-items: flex-start; flex-direction: column; }
    .credit-form-grid { grid-template-columns: 1fr; }
    .credit-field-wide,.credit-client-preview { grid-column: auto; }
    .credit-preview-summary { grid-template-columns: 1fr; }
    .credit-preview-summary > div + div { padding: 0.45rem 0 0; border-top: 1px solid #eadcb6; border-left: 0; }
}

.payments-content { max-width: 1440px; }
.payment-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.payment-form .field-group,
.payment-filters .field-group { min-width: 0; }
.payment-form-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
}
.payment-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.payment-filter-actions {
    display: flex;
    gap: 0.6rem;
    padding-bottom: 1rem;
}
.payment-history-table { min-width: 1120px; }
.payment-status {
    display: inline-flex;
    padding: 0.32rem 0.58rem;
    color: #53636b;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    background: #edf0f2;
    border-radius: 99px;
}
.payment-status-aprobado { color: #286143; background: #e8f5ed; }
.payment-status-revision { color: #865e0a; background: #fff3d4; }
.payment-status-rechazado { color: #9d2d2d; background: #fff0f0; }
.payment-actions { min-width: 185px; }
.payment-actions > a { display: inline-block; margin: 0.2rem 0.4rem 0.2rem 0; }
.payment-review-form { display: inline-flex; gap: 0.35rem; margin-top: 0.2rem; }
.payment-review-form button {
    width: auto;
    min-height: 32px;
    padding: 0.35rem 0.55rem;
    margin: 0;
    font-size: 0.7rem;
    box-shadow: none;
}
.payment-review-form button[value="rechazar"] { color: #8c2c2c; background: #f8eaea; }
.payment-empty-state { padding: 0.8rem; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
    .payment-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .payment-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .payment-form,
    .payment-filters { grid-template-columns: 1fr; }
    .payment-form-actions { justify-content: stretch; }
    .payment-form-actions .client-save-button { width: 100%; }
    .payment-filter-actions { padding: 0; }
}
