/* Fase 9.3 — CSS verbatim de los bloques de estilo de Pages/CCC/Components/Modals/ModalGenerarEstadoCuenta.razor. Igual que hoy, es global mientras el componente está en pantalla:
   se enlaza con <link> donde estaba el bloque. Cambios: @@ → @ y capas D-51. */
/* ─── ModalEstadoCuenta.razor.css ─────────────────────────── */

.ec-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

    .ec-modal-overlay.visible {
        display: flex;
    }

.ec-modal {
    background: #fff;
    border-radius: 14px;
    width: min(95vw, 960px);
    height: min(92vh, 780px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(26, 79, 186, 0.18);
    overflow: hidden;
}

/* Header */
.ec-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1a4fba 0%, #0f3494 100%);
    flex-shrink: 0;
}

.ec-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

    .ec-header-left .fas {
        font-size: 22px;
        color: #f0b429;
    }

.ec-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.ec-subtitle {
    font-size: 12px;
    color: #bfcfef;
    margin-top: 1px;
}

.ec-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ec-btn-icon {
    width: 31px;
    height: 31px;
    border-radius: 6px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: opacity 0.15s;
    color: #fff;
}

    .ec-btn-icon:hover {
        opacity: 0.8;
    }

.ec-btn-print {
    background: #374151;
}

.ec-btn-download {
    background: #1a56db;
}

.ec-btn-email {
    background: #16a34a;
}

.ec-btn-close {
    width: 31px;
    height: 31px;
    border-radius: 6px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .ec-btn-close:hover {
        background: rgba(255,255,255,0.25);
    }

/* Body */
.ec-modal-body {
    flex: 1;
    overflow: hidden;
    background: #f0f4fb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ec-pdf-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Estados loading/error */
.ec-loading, .ec-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #4b5563;
    font-size: 14px;
}

.ec-error {
    color: #dc2626;
}

    .ec-error .fas {
        font-size: 32px;
    }

.ec-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e8eef9;
    border-top-color: #1a4fba;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.ec-spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid #e8eef9;
    border-top-color: #1a4fba;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to

{
    transform: rotate(360deg);
}

}

/* Footer */
.ec-modal-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.ec-total-chip {
    display: flex;
    flex-direction: column;
    padding: 6px 14px;
    border-radius: 8px;
    min-width: 120px;
}

.chip-label {
    font-size: 10px;
    font-weight: 600;
    opacity: 0.8;
}

.chip-value {
    font-size: 14px;
    font-weight: 700;
    margin-top: 1px;
}

.ec-chip-red {
    background: #fef2f2;
    color: #dc2626;
}

.ec-chip-blue {
    background: #e8eef9;
    color: #1a4fba;
}

.ec-chip-dark {
    background: #111827;
    color: #fff;
}

.ec-success-badge {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #16a34a;
    font-size: 13px;
    font-weight: 600;
}

.ec-sending {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4b5563;
    font-size: 13px;
    margin-left: auto;
}
/* ═══ Envío manual por correo ═══════════════════════════════ */
.ec-mail-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(12, 22, 48, 0.46);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ec-mail-modal {
    width: min(520px, 100%);
    max-height: 100%;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(10, 20, 50, 0.30);
    display: flex;
    flex-direction: column;
    position: relative;
}

.ec-mail-head {
    background: linear-gradient(135deg, #1a4fba 0%, #0f3494 100%);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
}

.ec-mail-ico {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex: none;
    background: rgba(255,255,255,0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.ec-mail-title {
    font-size: 14.5px;
    font-weight: 700;
}

.ec-mail-sub {
    font-size: 11.5px;
    color: #c4d4f2;
    margin-top: 1px;
}

.ec-mail-body {
    padding: 16px 18px;
    display: grid;
    gap: 13px;
    overflow-y: auto;
}

.ec-fld {
    display: grid;
    gap: 5px;
}

    .ec-fld label {
        font-size: 11.5px;
        font-weight: 600;
        color: #4b5563;
    }

    .ec-fld input, .ec-fld textarea {
        width: 100%;
        font-family: inherit;
        font-size: 13px;
        color: #1b2436;
        border: 1px solid #d5dded;
        border-radius: 5px;
        padding: 7px 10px;
        background: #fff;
    }

    .ec-fld textarea {
        min-height: 96px;
        resize: vertical;
        line-height: 1.5;
    }

    .ec-fld input:focus, .ec-fld textarea:focus {
        outline: none;
        border-color: #2d6ae0;
        box-shadow: 0 0 0 3px rgba(45,106,224,0.14);
    }

    .ec-fld input.ec-invalid {
        border-color: #dc2626;
        box-shadow: 0 0 0 3px rgba(220,38,38,0.12);
    }

.ec-hint {
    font-size: 11px;
    color: #6b7280;
}

.ec-hint-warn {
    color: #a15c07;
}

.ec-fld-error {
    font-size: 11.5px;
    color: #dc2626;
    font-weight: 600;
}

.ec-attach {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #f0f4fb;
    border: 1px solid #dbe5f7;
    border-radius: 5px;
    padding: 8px 11px;
}

.ec-attach-ico {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    background: #dc2626;
    color: #fff;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.ec-attach-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #1b2436;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ec-attach-size {
    font-size: 11px;
    color: #6b7280;
    margin-left: auto;
    flex: none;
}

.ec-chk {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #374151;
}

    .ec-chk input {
        width: 15px;
        height: 15px;
        accent-color: #1a4fba;
        margin: 0;
    }

.ec-mail-foot {
    padding: 12px 18px;
    border-top: 1px solid #e8edf6;
    background: #fbfcfe;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.ec-btn-txt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    height: 31px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
}

    .ec-btn-txt:hover {
        filter: brightness(1.08);
    }

    .ec-btn-txt:disabled {
        opacity: 0.55;
        cursor: default;
    }

.ec-btn-gray {
    background: #374151;
}

.ec-btn-blue {
    background: #1a56db;
}

/* Overlay bloqueante de envío */
.ec-mail-busy {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(255,255,255,0.93);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.ec-busy-txt {
    font-size: 13px;
    font-weight: 600;
    color: #0f3494;
}

.ec-busy-sub {
    font-size: 11.5px;
    color: #6b7280;
    margin-top: -8px;
}

/* Confirmación */
.ec-mail-done {
    position: absolute;
    inset: 0;
    z-index: 6;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 24px;
    text-align: center;
}

.ec-ring {
    width: 74px;
    height: 74px;
}

    .ec-ring circle {
        fill: none;
        stroke: #16a34a;
        stroke-width: 5;
        stroke-linecap: round;
        stroke-dasharray: 207;
        stroke-dashoffset: 207;
        transform: rotate(-90deg);
        transform-origin: 50% 50%;
        animation: ecRing 0.55s cubic-bezier(0.5,0,0.3,1) forwards;
    }

    .ec-ring path {
        fill: none;
        stroke: #16a34a;
        stroke-width: 6;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-dasharray: 38;
        stroke-dashoffset: 38;
        animation: ecTick 0.32s cubic-bezier(0.4,0,0.2,1) 0.42s forwards;
    }

@keyframes ecRing {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes ecTick {
    to {
        stroke-dashoffset: 0;
    }
}

.ec-done-h {
    font-size: 15.5px;
    font-weight: 700;
    color: #1b2436;
    margin-top: 8px;
    opacity: 0;
    animation: ecRise 0.3s ease 0.62s forwards;
}

.ec-done-p {
    font-size: 12.5px;
    color: #5a6580;
    max-width: 38ch;
    line-height: 1.5;
    opacity: 0;
    animation: ecRise 0.3s ease 0.72s forwards;
}

.ec-done-btn {
    margin-top: 14px;
    opacity: 0;
    animation: ecRise 0.3s ease 0.84s forwards;
}

@keyframes ecRise {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ec-ring circle, .ec-ring path {
        animation-duration: 0.01s;
        animation-delay: 0s;
    }

    .ec-done-h, .ec-done-p, .ec-done-btn {
        animation: none;
        opacity: 1;
    }
}
