/* ============================================================
   TABLEAU DYNAMIQUE V2 — CSS
   Generateur de tableau moderne pour CMS Sitecrea
   ============================================================ */

/* --- Conteneur global --- */
.tableau_v2_conteneur {
    width: 100%;
    margin: 10px 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #333;
}

/* --- Chargement --- */
.tableau_v2_chargement {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px 50px;
    margin: 30px auto;
    max-width: 320px;
    background: rgba(0, 0, 0, 0.75);
    border: 2px solid #000;
    border-radius: 14px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    backdrop-filter: blur(4px);
}

/* Loader spinner ultra moderne */
.tableau_v2_loader_spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    position: relative;
    animation: tableau_v2_spin 0.9s linear infinite;
}
.tableau_v2_loader_spinner::before,
.tableau_v2_loader_spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}
.tableau_v2_loader_spinner::before {
    inset: 0;
    border: 3px solid rgba(255, 255, 255, 0.15);
}
.tableau_v2_loader_spinner::after {
    inset: 0;
    border: 3px solid transparent;
    border-top-color: #fff;
    border-right-color: rgba(255, 255, 255, 0.6);
}

@keyframes tableau_v2_spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Barre d infos (nb resultats + selecteur par page) --- */
.tableau_v2_info_bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f5f7fa;
    border: 1px solid #dce1e8;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    font-size: 13px;
    color: #666;
}
.tableau_v2_info_bar_total {
    font-weight: bold;
    color: #333;
}
.tableau_v2_select_par_page {
    padding: 3px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
    cursor: pointer;
    width: auto;
    max-width: 70px;
}
.tableau_v2_select_par_page:focus {
    outline: none;
    border-color: #3498db;
}

/* --- Table principale --- */
.tableau_v2_table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #dce1e8;
    background: #fff;
}

/* --- En-tete --- */
.tableau_v2_entete {
    background: #2d323e;
}
.tableau_v2_th {
    padding: 10px 8px 8px 8px;
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    text-align: left;
    vertical-align: top;
    border-right: 1px solid #3d4250;
}
.tableau_v2_th:last-child {
    border-right: none;
}
.tableau_v2_th_contenu {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    margin-bottom: 4px;
    min-height: 20px;
    white-space: nowrap;
}
.tableau_v2_th_actions {
    width: 1%;
    white-space: nowrap;
}

/* --- Boutons de tri --- */
.tableau_v2_btn_trie {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    opacity: 0.4;
    font-size: 11px;
    transition: opacity 0.2s, background 0.2s;
    user-select: none;
}
.tableau_v2_btn_trie:hover {
    opacity: 0.8;
    background: rgba(255,255,255,0.15);
}
.tableau_v2_btn_trie_actif {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    opacity: 1;
    font-size: 11px;
    background: rgba(255,255,255,0.2);
    user-select: none;
}
.tableau_v2_btn_trie_actif:hover {
    background: rgba(255,255,255,0.3);
}

/* --- Champ de recherche dans le header --- */
.tableau_v2_entete input.tableau_v2_champ_recherche,
.tableau_v2_entete input.tableau_v2_champ_recherche[type="text"] {
    width: 100% !important;
    box-sizing: border-box;
    padding: 2px 6px !important;
    height: 24px !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    border-radius: 4px;
    font-size: 12px !important;
    font-family: Arial, Helvetica, sans-serif;
    background: rgba(255,255,255,0.12) !important;
    color: #fff !important;
    outline: none;
    text-align: left !important;
    transition: background 0.2s, border-color 0.2s;
}
.tableau_v2_entete input.tableau_v2_champ_recherche::placeholder {
    color: rgba(255,255,255,0.35);
}
.tableau_v2_entete input.tableau_v2_champ_recherche:focus {
    background: rgba(255,255,255,0.12) !important;
    border-color: rgba(255,255,255,0.4) !important;
}

/* --- Lignes du tableau --- */
.tableau_v2_ligne_paire {
    background: #fff;
    transition: background 0.15s;
}
.tableau_v2_ligne_impaire {
    background: #f8f9fb;
    transition: background 0.15s;
}
.tableau_v2_ligne_paire:hover,
.tableau_v2_ligne_impaire:hover {
    background: #e3f2fd;
}

/* --- Cellules --- */
.tableau_v2_cellule {
    padding: 6px 10px;
    border-bottom: 1px solid #eaedf2;
    border-right: 1px solid #eaedf2;
    text-align: left;
    font-size: 13px;
    vertical-align: middle;
}
.tableau_v2_cellule:last-child {
    border-right: none;
}
.tableau_v2_cellule_actions {
    white-space: nowrap;
    padding: 4px 6px;
}
.tableau_v2_cellule_actions {
    text-align: center;
}
.tableau_v2_btn_action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    vertical-align: middle;
    margin: 0 2px;
}
.tableau_v2_btn_action:hover {
    transform: scale(1.12);
}
.tableau_v2_btn_action svg {
    width: 16px;
    height: 16px;
}
.tableau_v2_btn_action_modifier {
    background: #e8f4fd;
    color: #2980b9;
}
.tableau_v2_btn_action_modifier:hover {
    background: #d0e9f9;
}
.tableau_v2_btn_action_supprimer {
    background: #fde8e8;
    color: #c0392b;
}
.tableau_v2_btn_action_supprimer:hover {
    background: #f9d0d0;
}
.tableau_v2_btn_action_voir {
    background: #e8fde8;
    color: #27ae60;
}
.tableau_v2_btn_action_voir:hover {
    background: #d0f9d0;
}
.tableau_v2_btn_action_profil {
    background: #f0e8fd;
    color: #7d3c98;
}
.tableau_v2_btn_action_profil:hover {
    background: #e0d0f9;
}
.tableau_v2_btn_action_exporter {
    background: #fdf5e8;
    color: #b7950b;
}
.tableau_v2_btn_action_exporter:hover {
    background: #f9ecd0;
}
.tableau_v2_btn_action_simuler {
    background: #e8f8fd;
    color: #1a5276;
}
.tableau_v2_btn_action_simuler:hover {
    background: #d0eef9;
}
.tableau_v2_btn_action_decaler {
    background: #e8e8fd;
    color: #4a4a8a;
}
.tableau_v2_btn_action_decaler:hover {
    background: #d0d0f9;
}
.tableau_v2_btn_action_activer {
    background: #d4edda;
    color: #155724;
}
.tableau_v2_btn_action_activer:hover {
    background: #c3e6cb;
}
.tableau_v2_btn_action_desactiver {
    background: #f8d7da;
    color: #721c24;
}
.tableau_v2_btn_action_desactiver:hover {
    background: #f1b0b7;
}

/* --- Lien cliquable dans les cellules --- */
.tableau_v2_lien {
    color: #2980b9;
    text-decoration: none;
    word-break: break-all;
}
.tableau_v2_lien:hover {
    text-decoration: underline;
    color: #1a5276;
}

/* --- Images dans le tableau --- */
.tableau_v2_image {
    max-height: 50px;
    max-width: 80px;
    border-radius: 3px;
}

/* --- Badges booleens --- */
.tableau_v2_badge_oui {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    background: #d4edda;
    color: #155724;
    font-size: 12px;
    font-weight: bold;
}
.tableau_v2_badge_non {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    background: #f8d7da;
    color: #721c24;
    font-size: 12px;
    font-weight: bold;
}

/* --- Etat vide --- */
.tableau_v2_vide {
    padding: 30px;
    text-align: center;
    color: #999;
    font-style: italic;
    font-size: 14px;
}

/* --- Erreur --- */
.tableau_v2_erreur {
    padding: 20px;
    text-align: center;
    color: #c0392b;
    background: #fdf0ef;
    border: 1px solid #e6b0aa;
    border-radius: 6px;
    margin: 10px 0;
}

/* --- Pagination --- */
.tableau_v2_pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
    background: #f5f7fa;
    border: 1px solid #dce1e8;
    border-top: none;
    border-radius: 0 0 6px 6px;
}
.tableau_v2_page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #dce1e8;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.tableau_v2_page:hover {
    background: #e3f2fd;
    border-color: #90caf9;
}
.tableau_v2_page_active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #2d323e;
    border-radius: 4px;
    background: #2d323e;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    cursor: default;
    user-select: none;
}
.tableau_v2_page_desactive {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #f5f5f5;
    color: #ccc;
    font-size: 13px;
    cursor: default;
    user-select: none;
}

/* --- Drag-Drop --- */
.tableau_v2_ligne_draggable {
    cursor: grab;
}
.tableau_v2_ligne_draggable:active {
    cursor: grabbing;
}
.tableau_v2_ligne_drag_active {
    opacity: 0.4;
    background: #e3f2fd !important;
}
.tableau_v2_ligne_drag_over {
    border-top: 3px solid #1976d2 !important;
}

/* --- Image dans tableau (grandes) --- */
.image_dans_tab_big {
    max-width: 120px;
    max-height: 80px;
    object-fit: contain;
}
