/* =========================================
1. ESTILOS GENERALES
========================================= */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #cfc3dd;
    text-align: center;
    margin: 0;
    padding: 10px;
}

h1, h2 {
    color: #7b2cbf;
    margin-bottom: 5px;
}

input {
    width: 90%;
    padding: 12px;
    margin: 8px;
    border-radius: 12px;
    border: 1px solid #ddd;
    box-sizing: border-box;
    font-size: 16px;
}

button {
    width: 90%;
    padding: 15px;
    margin: 15px auto; 
    display: block;    
    border: none;
    border-radius: 25px;
    background: linear-gradient(90deg, #6a00f4, #9d4edd);
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.oculto { display: none !important; }

/* =========================================
2. CHIPS
========================================= */
.chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 15px 0;
}

.chip {
    background: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    border: 1px solid #ccc;
    font-size: 14px;
}

.chip.activo {
    background: #6a00f4;
    color: white;
}

/* =========================================
3. FILAS (TABLA)
========================================= */
.fila {
    display: grid;
    background: #fff;
    margin: 6px auto;
    max-width: 700px;
    padding: 8px 10px;
    border-radius: 12px;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    gap: 6px;
    font-size: 13px;
}

/* CLIENTES */
.fila-cliente {
    grid-template-columns: 40px 1fr 90px 90px;
}

/* CUENTAS */
.fila-cuenta {
    grid-template-columns: 35px 1.5fr 1fr 80px 115px; 
}

.fila div {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 35px;
    word-break: break-word;
}

/* =========================================
4. CABECERA
========================================= */
.cabecera {
    background: #6a00f4 !important;
    color: white;
    font-weight: bold;
    border-radius: 10px;
}

.fila-cliente div:first-child {
    display: none;
}

.cabecera.fila-cuenta div:first-child {
    visibility: hidden;
}

/* =========================================
5. ACCIONES
========================================= */
.acciones {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.acciones span {
    cursor: pointer;
    font-size: 18px;
}

/* =========================================
6. BOTÓN FIJO
========================================= */
.btn-fijo {
    position: sticky;
    bottom: 15px;
    width: 90% !important;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.pagina {
    padding-bottom: 80px;
}

/* =========================================
7. MODAL (CORREGIDO)
========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    max-width: 90%;
    width: 350px;
    border: 3px solid #e0d4f5;
}

.modal-buttons {
    display: flex;
    justify-content: center; /* Cambiado de space-between a center */
    gap: 15px;               /* Espacio entre botones */
    margin-top: 20px;
}

.modal-buttons button {
    margin: 0;
    width: auto;             /* Cambiado de 48% a auto */
    min-width: 110px;        /* Ancho mínimo para consistencia */
    padding: 10px 20px;
    border-radius: 15px;
}

.btn-cancel { background: #e0e0e0; color: #555; }
.btn-confirm { background: #6a00f4; color: white; }

/* =========================================
8. MÓVIL
========================================= */
@media (max-width: 600px) {
    .fila {
        padding: 8px 4px;
        gap: 4px; 
        margin: 6px auto;
        max-width: 96%;
    }

    .fila-cliente { 
        grid-template-columns: 1.2fr 1fr 90px; 
    }

    .fila-cuenta { 
        grid-template-columns: 20px 1.5fr 1fr 45px 75px;
    }

    .fila div { 
        font-size: 10.5px;
        padding: 2px;
        display: flex;
        justify-content: center !important; 
        align-items: center;
        text-align: center !important;
        word-break: break-all; 
        min-width: 0; 
    }

    .cabecera {
        font-size: 11px;
        padding: 10px 4px;
    }

    .acciones {
        display: flex;
        justify-content: center;
        gap: 5px;
        flex-wrap: nowrap;
    }

    .acciones span {
        font-size: 15px; 
    }
}

/* =========================================
9. TABLET / LAPTOP
========================================= */
@media (min-width: 601px) {
    .fila {
        padding: 12px 15px;
        gap: 10px;
        max-width: 750px;
    }

    .fila div {
        font-size: 14px;
        word-break: normal !important;
        overflow-wrap: normal !important;
        white-space: nowrap;
    }

    .fila-cliente {
        grid-template-columns: 1.5fr 1fr 1fr;
    }

    .fila-cuenta {
        grid-template-columns: 40px 2fr 1.5fr 1fr 120px;
    }

    .acciones {
        gap: 12px;
    }

    .acciones span {
        font-size: 18px;
    }
}

/* =========================================
10. CATÁLOGO SELECCIÓN
========================================= */
.foto-wrapper {
    position: relative;
    width: 45%;
    max-width: 150px;
    cursor: pointer;
}

.foto-wrapper img {
    width: 100%;
    height: 150px;
    border-radius: 8px;
    border: 2px solid #ccc;
    object-fit: cover;
    transition: all 0.2s ease-in-out;
    display: block;
}

.foto-wrapper.seleccionada img {
    border: 3px solid #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.check-foto {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: transparent;
    pointer-events: none;
    transition: all 0.2s;
    z-index: 10;
}

.foto-wrapper.seleccionada .check-foto {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

/* =========================================
11. BOTÓN BORRAR EN CATÁLOGO
========================================= */
.foto-wrapper {
    position: relative;
    width: 45%;
    max-width: 150px;
    cursor: pointer;
    margin-bottom: 10px;
}

.borrar-foto {
    position: absolute;
    bottom: -10px; 
    right: -10px;  
    width: 32px;
    height: 32px;
    background: #fff;
    border: 2px solid #d90429;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 20;
    transition: transform 0.1s;
}

.borrar-foto:active {
    transform: scale(0.9);
}