/* ============================================================
   conexion-selector.css
   Estilos para el módulo ConexionSelector.
   Incluir en todas las páginas que usen conexion-selector.js:
       <link rel="stylesheet" href="js/conexion-selector.css">
   ============================================================ */

/* ── Panel x_panel ────────────────────────────────────────── */
#conexion-selector-wrapper .x_panel {
    border-top: 3px solid #1ABB9C !important;
}

/* ── Grid de tarjetas ─────────────────────────────────────── */
/*
   Anclado a #cs-grid (ID) para ganar a cualquier regla de
   Gentelella/Bootstrap sobre .x_content > div.
*/
#cs-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    padding: 4px;
    width: 100%;
    max-height: 320px;
    overflow-y: auto;
}

@media (max-width: 1200px) {
    #cs-grid {
        grid-template-columns: repeat(auto-fit, minmax(calc(33.33% - 10px), 1fr));
    }
}

@media (max-width: 768px) {
    #cs-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Tarjeta individual ───────────────────────────────────── */
/*
   Ancladas a #conexion-selector-wrapper para superar la
   especificidad de .x_content > div de Gentelella.
*/
#conexion-selector-wrapper .cs-item {
    cursor: pointer;
    user-select: none;
    display: flex;
    flex-direction: column;
}

#conexion-selector-wrapper .cs-box {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 2px solid #dce3ea;
    border-radius: 4px;
    background: #fff;
    transition: border-color .2s, background .2s;
    flex: 1;
}

#conexion-selector-wrapper .cs-item:hover .cs-box {
    border-color: #b2dfd3;
    background-color: #fcfdfe;
}

#conexion-selector-wrapper .cs-item.selected .cs-box {
    border-color: #1ABB9C !important;
    background-color: rgba(26, 187, 156, .05) !important;
}

/* ── Textos dentro de la tarjeta ──────────────────────────── */
#conexion-selector-wrapper .cs-text {
    flex-grow: 1;
    padding-right: 10px;
}

#conexion-selector-wrapper .cs-name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

#conexion-selector-wrapper .cs-desc {
    display: block;
    font-size: 12px;
    color: #73879C;
    margin-top: 2px;
}

/* ── Icono check ──────────────────────────────────────────── */
#conexion-selector-wrapper .cs-check {
    font-size: 20px;
    color: #dce3ea;
    flex-shrink: 0;
    transition: color .2s;
}

#conexion-selector-wrapper .cs-item.selected .cs-check {
    color: #1ABB9C !important;
}

/* ── Footer (hint + acciones) ─────────────────────────────── */
/*
   CRÍTICO: anclado a #conexion-selector-wrapper para superar
   la regla .x_content > div { display:block } de Gentelella,
   que ocultaba el botón "Cargar datos" colapsando cs-actions.
*/
#conexion-selector-wrapper .cs-footer {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #edf1f5;
    flex-wrap: wrap;
    gap: 8px;
}

#conexion-selector-wrapper .cs-hint {
    font-size: 11px;
    color: #73879C;
}

#conexion-selector-wrapper .cs-actions {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

/* ── Botón "Seleccionar todas" ────────────────────────────── */
#cs-btn-masa {
    font-size: 12px;
    font-weight: 600;
    color: #1ABB9C;
    text-decoration: none;
}

#cs-btn-masa:hover {
    color: #148f77;
    text-decoration: underline;
}