﻿/* Estilos específicos para la página de Refrendo y Desempeño */
.refrendo-root {
    min-height: 100vh;
    background: #f3f6fb;
    color: #1f2937;
    width: 100%;
    display: flex;
    font-family: sans-serif;
}

    /* --- ESTILOS REUTILIZADOS DE SIDEBAR Y HEADER --- */
    .refrendo-root .sidebar {
        width: 250px;
        background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
        color: white;
        padding: 20px 0;
        position: fixed;
        height: 100vh;
        z-index: 100;
        transition: all 0.3s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }

    .refrendo-root .sidebar-header {
        padding: 0 20px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .refrendo-root .logo {
        font-size: 2rem;
        font-weight: 700;
        text-decoration: none;
        background: linear-gradient(45deg, #ffffff, #f0f9ff, #dbeafe);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .refrendo-root .sidebar-nav {
        padding: 20px 0;
    }

    .refrendo-root .nav-item {
        display: flex;
        align-items: center;
        padding: 12px 20px;
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        transition: all 0.3s ease;
        border-left: 4px solid transparent;
        cursor: pointer;
    }

        .refrendo-root .nav-item:hover {
            background: rgba(255, 255, 255, 0.1);
            color: white;
            border-left-color: rgba(255, 255, 255, 0.3);
        }

        .refrendo-root .nav-item.active {
            background: rgba(255, 255, 255, 0.15);
            color: white;
            border-left-color: white;
        }

    .refrendo-root .nav-icon {
        font-size: 1.2rem;
        margin-right: 15px;
        width: 24px;
        text-align: center;
    }

    .refrendo-root .nav-text {
        font-size: 0.95rem;
        font-weight: 500;
    }

    .refrendo-root .main-content-wrapper {
        flex: 1;
        margin-left: 250px;
        transition: all 0.3s ease;
    }

    .refrendo-root .header {
        background: white;
        padding: 15px 0;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .refrendo-root .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .refrendo-root .sidebar-toggle {
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: #1e3a8a;
        display: none;
        padding: 5px 10px;
    }

    .refrendo-root .user-info-container {
        display: flex;
        justify-content: flex-end;
        margin-left: auto;
    }

    .refrendo-root .user-info {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .refrendo-root .user-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: linear-gradient(45deg, #059669, #10b981);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 1.1rem;
        color: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
    }

        .refrendo-root .user-avatar:hover {
            transform: scale(1.1);
            box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
        }

    .refrendo-root .user-details {
        text-align: right;
    }

    .refrendo-root .user-name {
        font-weight: 600;
        font-size: 0.95rem;
    }

    .refrendo-root .user-role {
        font-size: 0.85rem;
        opacity: 0.8;
    }

    .refrendo-root .return-btn {
        background: rgba(220, 38, 38, 0.1);
        border: 1px solid rgba(220, 38, 38, 0.2);
        color: #dc2626;
        padding: 8px 16px;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 600;
        font-size: 0.9rem;
        transition: all 0.3s ease;
    }

        .refrendo-root .return-btn:hover {
            background: rgba(220, 38, 38, 0.2);
            transform: translateY(-2px);
        }

    .refrendo-root .main-content {
        padding: 30px 0;
    }

    .refrendo-root .container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 20px;
    }

    .refrendo-root .page-header {
        background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
        border-radius: 20px;
        padding: 30px 40px;
        margin-bottom: 30px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    }

    .refrendo-root .page-title {
        font-size: 2.2rem;
        font-weight: 700;
        color: #1e3a8a;
        margin-bottom: 10px;
    }

    .refrendo-root .page-subtitle {
        font-size: 1.1rem;
        color: #64748b;
    }

    .refrendo-root .tabs-section {
        margin-bottom: 30px;
    }

    .refrendo-root .tabs-container {
        display: flex;
        border-bottom: 2px solid #e2e8f0;
    }

    .refrendo-root .tab {
        padding: 12px 25px;
        background: none;
        border: none;
        border-bottom: 3px solid transparent;
        font-weight: 600;
        color: #64748b;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 10px;
        transition: all 0.3s ease;
    }

        .refrendo-root .tab.active {
            color: #2563eb;
            border-bottom-color: #2563eb;
        }

        .refrendo-root .tab:hover:not(.active) {
            color: #1e40af;
            border-bottom-color: #cbd5e1;
        }

    .refrendo-root .tab-icon {
        font-size: 1.1rem;
    }

    .refrendo-root .tab-text {
        font-size: 0.95rem;
    }

    /* --- LAYOUT PRINCIPAL CORREGIDO --- */
    .refrendo-root .refrendo-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }

    .refrendo-root .info-column, .refrendo-root .payment-column {
        display: flex;
        flex-direction: column;
        gap: 25px;
    }

    /* Estilo General de Tarjetas */
    .refrendo-root .card {
        background: white;
        border-radius: 16px;
        padding: 25px 30px;
        box-shadow: 0 10px 30px rgba(220, 225, 240, 0.7);
        border: 1px solid #e2e8f0;
    }

    .refrendo-root .card-title {
        font-size: 1.3rem;
        font-weight: 600;
        color: #1e3a8a;
        margin: 0 0 20px 0;
        padding-bottom: 15px;
        border-bottom: 1px solid #e2e8f0;
    }

    /* Buscador */
    .refrendo-root .search-card {
        padding: 20px 30px;
    }

    .refrendo-root .search-wrapper {
        display: flex;
        align-items: flex-end;
        gap: 20px;
    }

    .refrendo-root .form-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex-grow: 1;
    }

        .refrendo-root .form-group label {
            font-size: 0.9rem;
            color: #374151;
            font-weight: 600;
        }

    .refrendo-root .autocomplete-container {
        position: relative;
        width: 100%;
    }

    .refrendo-root .input-with-button {
        display: flex;
    }

    .refrendo-root .form-input {
        padding: 10px 16px;
        border: 2px solid #e5e7eb;
        border-radius: 10px 0 0 10px;
        font-size: 0.95rem;
        background-color: #f9fafb;
        transition: all 0.3s ease;
        width: 100%;
    }

        .refrendo-root .form-input:focus {
            background-color: white;
            border-color: #2563eb;
            box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
            outline: none;
            z-index: 1;
        }

    .refrendo-root .search-btn {
        background: #eef2ff;
        color: #4338ca;
        border: 2px solid #e5e7eb;
        border-left: none;
        padding: 0 15px;
        border-radius: 0 10px 10px 0;
        cursor: pointer;
        transition: all 0.3s ease;
    }

        .refrendo-root .search-btn:hover {
            background: #e0e7ff;
        }

    .refrendo-root .checkbox-group {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding-bottom: 10px;
    }

    .refrendo-root .form-checkbox {
        width: 18px;
        height: 18px;
        accent-color: #2563eb;
    }

    .refrendo-root .checkbox-group label {
        margin-bottom: 0;
    }

    .refrendo-root .autocomplete-list {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1000;
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
        list-style: none;
        padding: 8px;
        margin: 8px 0 0;
        max-height: 200px;
        overflow-y: auto;
    }

        .refrendo-root .autocomplete-list li {
            padding: 10px 15px;
            cursor: pointer;
            border-radius: 8px;
            transition: background-color 0.2s ease;
        }

            .refrendo-root .autocomplete-list li:hover {
                background-color: #f3f6fb;
            }

    /* Info del Cliente y Contrato */
    .refrendo-root .client-name {
        font-size: 1.1rem;
        font-weight: bold;
        color: #1f2937;
        margin: 0 0 5px;
    }

    .refrendo-root .client-address {
        font-size: 0.9rem;
        color: #64748b;
        margin: 0 0 10px;
        line-height: 1.5;
    }

    .refrendo-root .client-user {
        font-size: 0.8rem;
        color: #9ca3af;
        margin: 0;
    }

    .refrendo-root .contract-details-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

        .refrendo-root .contract-details-list li {
            display: flex;
            justify-content: space-between;
            font-size: 0.9rem;
            padding: 8px 0;
            border-bottom: 1px dashed #e2e8f0;
        }

            .refrendo-root .contract-details-list li:last-child {
                border-bottom: none;
            }

        .refrendo-root .contract-details-list strong {
            color: #374151;
        }

        .refrendo-root .contract-details-list span {
            color: #64748b;
        }

    .refrendo-root .item-description {
        font-weight: bold;
        margin: 0 0 15px;
    }

    .refrendo-root .item-location {
        font-size: 0.9rem;
        color: #64748b;
    }

        .refrendo-root .item-location p {
            margin: 0 0 8px;
        }

    .refrendo-root .location-details {
        display: flex;
        gap: 20px;
        background: #f8fafc;
        padding: 10px 15px;
        border-radius: 8px;
        border: 1px solid #f1f5f9;
    }

        .refrendo-root .location-details span {
            font-size: 0.9rem;
        }

        .refrendo-root .location-details strong {
            color: #374151;
        }

    /* Columna de Pagos */
    .refrendo-root .payment-card {
        display: flex;
        flex-direction: column;
        flex-grow: 1;
    }

    .refrendo-root .payment-breakdown {
        list-style: none;
        padding: 0;
        margin: 0 0 20px;
        flex-grow: 1;
    }

        .refrendo-root .payment-breakdown li {
            display: flex;
            justify-content: space-between;
            padding: 12px 15px;
            border-radius: 8px;
            margin-bottom: 5px;
        }

            .refrendo-root .payment-breakdown li:nth-child(odd) {
                background: #f8fafc;
            }

        .refrendo-root .payment-breakdown span:first-child {
            font-weight: 500;
            color: #4b5563;
        }

        .refrendo-root .payment-breakdown span:last-child {
            font-weight: 600;
            color: #1f2937;
        }

    .refrendo-root .payment-total {
        margin-top: auto;
        padding: 20px;
        background: #1e3a8a;
        color: white;
        border-radius: 12px;
        text-align: center;
    }

    .refrendo-root .total-label {
        display: block;
        font-size: 1rem;
        font-weight: 500;
        opacity: 0.8;
    }

    .refrendo-root .total-amount {
        font-size: 2.5rem;
        font-weight: 700;
        display: block;
    }

    /* Botones de Acción Finales */
    .refrendo-root .form-actions {
        display: flex;
        justify-content: flex-end;
        gap: 15px;
    }

    .refrendo-root .cancel-btn, .refrendo-root .submit-btn {
        padding: 12px 25px;
        border-radius: 10px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .refrendo-root .cancel-btn {
        background: #f8fafc;
        color: #64748b;
        border: 2px solid #e2e8f0;
    }

        .refrendo-root .cancel-btn:hover {
            background: #f1f5f9;
            border-color: #cbd5e1;
        }

    .refrendo-root .submit-btn {
        background: linear-gradient(135deg, #059669, #10b981);
        color: white;
        border: none;
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    }

        .refrendo-root .submit-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
        }

/* ===== ESTILOS DEL MODAL DE PAGO ===== */
.payment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: pf-fadeIn 0.3s ease-out;
}

.payment-modal-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 95%;
    max-width: 500px;
    overflow: hidden;
    animation: pf-slideUp 0.4s ease-out;
}

.payment-modal-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.payment-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

.payment-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

    .payment-modal-close:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: rotate(90deg);
    }

.payment-modal-body {
    padding: 30px;
}

.payment-step {
    text-align: center;
}

.payment-total-info {
    font-size: 1.2rem;
    color: #4b5563;
    margin-bottom: 20px;
}

    .payment-total-info strong {
        color: #1e3a8a;
        font-size: 1.4rem;
    }

.step-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e3a8a;
    margin: 0 0 25px 0;
}

.payment-method-selector {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.payment-option {
    flex: 1;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

    .payment-option:hover {
        border-color: #cbd5e1;
    }

    .payment-option.selected {
        border-color: #2563eb;
        background: #f0f5ff;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

    .payment-option input[type="radio"] {
        opacity: 0;
        position: absolute;
    }

.option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.option-icon {
    font-size: 2.5rem;
}

.option-text {
    font-weight: 600;
    color: #374151;
}

.form-input.large-text {
    font-size: 1.5rem;
    text-align: center;
    padding: 15px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding-top: 30px;
    margin-top: 20px;
    border-top: 2px solid #f1f5f9;
}

.success-step {
    padding: 20px 0;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #10b981;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 20px;
    animation: popIn 0.4s ease-out;
}

@keyframes popIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-title {
    font-size: 1.8rem;
    color: #1e3a8a;
    margin-bottom: 10px;
}

.change-info {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 5px;
}

.change-amount {
    font-size: 2.2rem;
    font-weight: 700;
    color: #10b981;
    margin: 0;
}

/* ===== ANIMACIONES ===== */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pf-fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pf-slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .refrendo-root .refrendo-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .refrendo-root .sidebar {
        transform: translateX(-100%);
    }

        .refrendo-root .sidebar.active {
            transform: translateX(0);
        }

    .refrendo-root .main-content-wrapper {
        margin-left: 0;
    }

    .refrendo-root .sidebar-toggle {
        display: block;
    }
}
