/* ============================================
   COMPROBANTES.CSS - Estilos del módulo
   ============================================ */

/* ---- BODY ---- */
.pf-body {
    background: #f0f2f5;
}

/* ============================================
   MAIN
   ============================================ */
.pf-main {
    padding-top: 80px;
    padding-bottom: 90px;
}

/* ============================================
   PAGE TITLE
   ============================================ */
.pf-page-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a3a5c;
    letter-spacing: 0.01em;
    text-align: center;
}

.pf-page-title i {
    color: #198754;
}

/* ============================================
   HERO SECTION
   ============================================ */
.pf-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
    border-left: 5px solid #198754;
    flex-wrap: wrap;
}

.pf-hero-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #146c43, #198754);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.35);
}

.pf-hero-icon i {
    font-size: 1.4rem;
    color: #fff;
}

.pf-hero-content {
    flex: 1;
    min-width: 0;
}

.pf-hero-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a3a5c;
    margin: 0 0 3px 0;
    line-height: 1.2;
}

.pf-hero-subtitle {
    font-size: 0.82rem;
    color: #6c757d;
    margin: 0;
}

.pf-hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Badge de pendientes */
.pf-badge-pendientes {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 2px solid #198754;
    border-radius: 20px;
    padding: 4px 12px;
    animation: pf-pulse 2.5s ease-in-out infinite;
}

.pf-badge-pendientes #pf-badge-numero {
    font-size: 1rem;
    font-weight: 800;
    color: #198754;
    line-height: 1;
}

.pf-badge-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #198754;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@keyframes pf-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.25); }
    50%       { box-shadow: 0 0 0 5px rgba(25, 135, 84, 0); }
}

/* Boton consultar */
.pf-btn-consultar {
    background: linear-gradient(135deg, #198754, #146c43);
    border: none;
    color: #fff;
    border-radius: 8px;
    padding: 9px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(25, 135, 84, 0.35);
    white-space: nowrap;
}

.pf-btn-consultar:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.45);
}

.pf-btn-consultar:active:not(:disabled) {
    transform: scale(0.97);
}

.pf-btn-consultar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   PANEL LISTADO
   ============================================ */
.pf-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
    overflow: hidden;
}

.pf-estado {
    font-size: 0.8rem;
    color: #6c757d;
    padding: 10px 20px 0;
    min-height: 0;
}

.pf-estado:empty {
    padding: 0;
}

.pf-listado {
    padding: 8px 12px 12px;
}

/* ---- Cards de comprobante ---- */
.pf-card {
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 1px solid #e8edf2;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    animation: pf-slideIn 0.3s ease-out both;
}

.pf-card:last-child {
    margin-bottom: 0;
}

.pf-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 58, 92, 0.12);
    border-color: #1a6fb5;
}

.pf-card:active {
    transform: scale(0.99);
}

.pf-card--cargando {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.pf-card--cargando .pf-card-arrow i {
    animation: pf-spin 0.7s linear infinite;
}

@keyframes pf-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes pf-slideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pf-card-accent {
    width: 5px;
    min-width: 5px;
    align-self: stretch;
    background: linear-gradient(180deg, #198754, #146c43);
    flex-shrink: 0;
}

.pf-card-body {
    flex: 1;
    min-width: 0;
    padding: 13px 12px;
}

.pf-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.pf-card-id {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.pf-card-codigo {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a3a5c;
    white-space: nowrap;
    background: rgba(26, 111, 181, 0.08);
    padding: 2px 8px;
    border-radius: 5px;
    flex-shrink: 0;
}

.pf-card-nombre {
    font-size: 0.9rem;
    color: #324637;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pf-card-amounts {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pf-card-importe {
    font-size: 1rem;
    font-weight: 700;
    color: #198754;
}

.pf-card-dto {
    font-size: 0.75rem;
    font-weight: 600;
    background: #6c757d;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
}

.pf-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 7px;
    font-size: 0.76rem;
    color: #868e96;
}

.pf-card-meta span i {
    color: #adb5bd;
}

.pf-card-nota {
    font-style: italic;
    color: #6c757d;
}

.pf-card-arrow {
    padding: 0 14px;
    color: #c8d0da;
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: color 0.15s, transform 0.15s;
}

.pf-card:hover .pf-card-arrow {
    color: #1a6fb5;
    transform: translateX(3px);
}

/* ---- Cargando ---- */
.pf-cargando {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 20px;
    color: #6c757d;
    font-size: 0.9rem;
}

.pf-cargando-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(26, 111, 181, 0.2);
    border-top-color: #1a6fb5;
    border-radius: 50%;
    animation: pf-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

/* ---- Vacío ---- */
.pf-vacio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 52px 20px;
    text-align: center;
}

.pf-vacio-icon {
    font-size: 3rem;
    color: #ced4da;
    margin-bottom: 14px;
    display: block;
}

.pf-vacio-icon--ok {
    color: #198754;
}

.pf-vacio-texto {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    margin: 0 0 5px 0;
}

.pf-vacio-sub {
    font-size: 0.82rem;
    color: #868e96;
    margin: 0;
}

/* ---- Error item ---- */
.pf-error-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    color: #dc3545;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================
   MODAL ACCION COMPROBANTE
   ============================================ */
.pf-modal-accion {
    border: none;
    border-radius: 14px;
    overflow: hidden;
}

.pf-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1a3a5c 0%, #1a6fb5 100%);
}

.pf-modal-header-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pf-modal-header-icon i {
    font-size: 1.2rem;
    color: #fff;
}

.pf-modal-header-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 2px 0;
    line-height: 1.2;
}

.pf-modal-header-sub {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
}

/* Grid de campos */
.pf-modal-body-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 8px 0;
}

.pf-modal-field {
    display: flex;
    flex-direction: column;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f2f5;
}

.pf-modal-field:nth-child(odd) {
    border-right: 1px solid #f0f2f5;
}

.pf-modal-field--full {
    grid-column: 1 / -1;
    border-right: none;
}

.pf-modal-field:last-child,
.pf-modal-field:nth-last-child(2):not(.pf-modal-field--full) {
    border-bottom: none;
}

.pf-modal-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #868e96;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 3px;
}

.pf-modal-label i {
    color: #adb5bd;
    margin-right: 4px;
}

.pf-modal-value {
    font-size: 0.92rem;
    color: #212529;
    font-weight: 500;
    word-break: break-word;
}

.pf-modal-codigo {
    font-weight: 700;
    color: #1a3a5c;
    font-size: 1rem;
}

.pf-modal-cliente {
    color: #1a3a5c;
}

.pf-modal-importe {
    font-size: 1.15rem;
    font-weight: 800;
    color: #198754;
}

.pf-modal-nota {
    font-style: italic;
    color: #495057;
}

/* Footer del modal */
.pf-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    gap: 12px;
    flex-wrap: wrap;
}

.pf-modal-footer-aviso {
    font-size: 0.76rem;
    color: #868e96;
    margin: 0;
    display: flex;
    align-items: center;
}

.pf-modal-footer-aviso i {
    color: #ffc107;
}

.pf-modal-footer-btns {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

/* Botón Rechazar */
.pf-btn-rechazar {
    display: inline-flex;
    align-items: center;
    padding: 10px 22px;
    background: #fff;
    border: 2px solid #dc3545;
    color: #dc3545;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    letter-spacing: 0.01em;
}

.pf-btn-rechazar:hover:not(:disabled) {
    background: #dc3545;
    color: #fff;
    box-shadow: 0 4px 14px rgba(220, 53, 69, 0.4);
    transform: translateY(-1px);
}

.pf-btn-rechazar:active:not(:disabled) {
    transform: scale(0.97);
}

.pf-btn-rechazar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Botón Autorizar */
.pf-btn-autorizar {
    display: inline-flex;
    align-items: center;
    padding: 10px 26px;
    background: linear-gradient(135deg, #198754, #146c43);
    border: none;
    color: #fff;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 3px 10px rgba(25, 135, 84, 0.4);
    letter-spacing: 0.01em;
}

.pf-btn-autorizar:hover:not(:disabled) {
    background: linear-gradient(135deg, #1da862, #198754);
    box-shadow: 0 5px 16px rgba(25, 135, 84, 0.5);
    transform: translateY(-1px);
}

.pf-btn-autorizar:active:not(:disabled) {
    transform: scale(0.97);
}

.pf-btn-autorizar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   MODAL ANÁLISIS DEL CLIENTE
   ============================================ */
.pf-modal-analisis {
    margin: 0 20px 20px;
    padding: 16px 18px;
    background: rgba(25, 135, 84, 0.05);
    border: 1px solid rgba(25, 135, 84, 0.2);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pf-modal-analisis-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1a3a5c;
}

.pf-modal-analisis-header i {
    color: #198754;
    font-size: 1rem;
}

.pf-analisis-bloque {
    background: #fff;
    border: 1px solid #e8edf2;
    border-radius: 8px;
    padding: 11px 14px;
}

.pf-analisis-bloque--mora {
    border-color: rgba(220, 53, 69, 0.2);
    background: rgba(220, 53, 69, 0.03);
}

.pf-analisis-frase {
    font-size: 0.83rem;
    color: #495057;
    line-height: 1.6;
    margin: 0;
}

.pf-analisis-frase strong {
    color: #1a3a5c;
    font-weight: 700;
}

.pf-analisis-valor-alerta {
    color: #dc3545 !important;
}

@media (max-width: 576px) {
    .pf-modal-analisis {
        margin: 0 12px 16px;
    }
}

/* ============================================
   SCROLL-TO-ACCEPT HINT
   ============================================ */
.pf-scroll-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(to top, rgba(26, 58, 92, 0.07), transparent);
    color: #1a6fb5;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: opacity 0.35s ease, max-height 0.35s ease;
    overflow: hidden;
    max-height: 60px;
    opacity: 1;
}

.pf-scroll-hint.pf-scroll-hint--oculto {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
}

.pf-scroll-hint-icon {
    animation: pf-bounce 1.1s ease-in-out infinite;
}

@keyframes pf-bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(4px); }
}

/* Botones bloqueados por scroll-gate */
.pf-btn-rechazar.pf-scroll-locked,
.pf-btn-autorizar.pf-scroll-locked {
    opacity: 0.38;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   FOOTER
   ============================================ */
.pf-footer {
    height: 52px;
    background: #1a2a3a;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
}

.pf-footer-brand {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pf-footer-sep {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.15);
}

.pf-footer-link {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.pf-footer-link:hover {
    color: rgba(255,255,255,0.9);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 576px) {
    .pf-hero {
        padding: 16px;
        gap: 12px;
    }

    .pf-hero-icon {
        width: 42px;
        height: 42px;
    }

    .pf-hero-icon i {
        font-size: 1.1rem;
    }

    .pf-hero-title {
        font-size: 1rem;
    }

    .pf-hero-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .pf-modal-body-grid {
        grid-template-columns: 1fr;
    }

    .pf-modal-field:nth-child(odd) {
        border-right: none;
    }

    .pf-modal-field--full {
        grid-column: 1;
    }

    .pf-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .pf-modal-footer-btns {
        margin-left: 0;
    }

    .pf-btn-rechazar,
    .pf-btn-autorizar {
        flex: 1;
        justify-content: center;
    }

    .pf-card-top {
        flex-direction: column;
        gap: 6px;
    }

    .pf-card-amounts {
        margin-left: 0;
    }
}

