:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #10b981;
    --bg-body: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --white: #ffffff;
}

body {
    background-color: var(--bg-body);
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--text-main);
    margin: 0;
    padding: 20px;
}

h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

/* --- CONTROLES Y FILTROS --- */
.filtros-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.grupo-bases {
    display: flex;
    gap: 0.5rem;
    background: #eef2ff;
    padding: 4px;
    border-radius: 10px;
}

.btn-base {
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    transition: all 0.2s;
}

.btn-base.active {
    background: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    color: var(--primary);
}

.grupo-controles {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.control-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

select, .ver-options {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    outline: none;
}

.ver-options {
    display: flex;
    gap: 1rem;
}

.ver-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
}

/* --- LISTA DE PROSPECTOS --- */
.prospecto-item {
    background: var(--white);
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: transform 0.1s;
}

.prospecto-row {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
}

.col-id { width: 40px; color: var(--text-muted); font-size: 0.75rem; font-weight: 600; }

.col-nombre { flex: 2; position: relative; }
.nombre-txt { font-weight: 700; font-size: 0.95rem; }

.btn-i {
    border: none; background: #f1f5f9; border-radius: 6px;
    padding: 2px 6px; font-size: 0.8rem; cursor: pointer; margin-left: 8px;
}

.badge-cat {
    background: #f1f5f9; color: var(--text-muted);
    padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600;
}

.btn-whatsapp {
    background: var(--success);
    color: var(--white) !important;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.2s;
}

.btn-whatsapp:hover { opacity: 0.9; }

.col-fecha span {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- SELECTORES DE ESTADO --- */
.estado-selector {
    width: 130px;
    font-weight: 600;
    border: none !important;
    cursor: pointer;
}

.status-pendiente { background-color: #f1f5f9 !important; color: #475569; }
.status-recibido { background-color: #fef9c3 !important; color: #854d0e; } /* Amarillo suave */
.status-interesado { background-color: #dcfce7 !important; color: #166534; } /* Verde suave */
.status-novalido { background-color: #fee2e2 !important; color: #991b1b; } /* Rojo suave */

@media (max-width: 800px) {
    /* 1. FILTROS: Bases arriba, Ordenar y Ver apilados debajo */
    .filtros-container { 
        flex-direction: column; 
        align-items: stretch; 
        gap: 15px; 
    }

    .grupo-controles { 
        flex-direction: column; 
        align-items: flex-start;
        gap: 12px;
        width: 100%;
    }

    .control-item {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* 2. TARJETA DEL SALÓN: Estructura de filas */
    .prospecto-row {
        display: flex;
        flex-wrap: wrap; 
        padding: 15px;
        gap: 10px;
    }

    /* Fila Superior: ID y Nombre al 100% */
    .col-id { width: auto !important; }
    .col-nombre { 
        flex: 1 1 100% !important; 
        width: 100% !important;
        border-bottom: 1px solid var(--border);
        margin-bottom: 5px;
        padding-bottom: 5px;
    }

    /* LÍNEA 1: Categoría (Tipo) a la izquierda, Enviar a la derecha */
    .col-cat { 
        flex: 1 1 50% !important; 
        width: auto !important;
        min-width: 0 !important;
    }
    .col-ws { 
        flex: 0 0 auto !important; 
        width: auto !important;
        text-align: right;
        min-width: 0 !important;
    }

    /* LÍNEA 2: Fecha a la izquierda, Estado a la derecha */
    .col-fecha {
        flex: 1 1 45% !important;
        width: 45% !important;
        min-width: 0 !important;
        margin-top: 5px;
    }
    .col-estado {
        flex: 1 1 45% !important;
        width: 45% !important;
        min-width: 0 !important;
        margin-top: 5px;
    }

    /* Ajuste de elementos internos para que llenen su espacio */
    .estado-selector, .col-fecha span {
        width: 100% !important;
        box-sizing: border-box;
    }
}