/* Liste / grille des مناظرات */

.poste-view-toolbar {
    margin-bottom: 14px;
}

.poste-view-toolbar .btn-group .btn {
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
}

.poste-view-toolbar .btn-group .btn.active {
    background: #1f5f8b;
    border-color: #1f5f8b;
    color: #fff;
}

/* --- Vue liste --- */
.poste-list-table {
    margin-bottom: 0;
    background: #fff;
}

.poste-list-table thead th {
    text-align: center;
    vertical-align: middle;
    font-weight: 700;
    font-size: 14px;
    background: #f0f5f9;
    color: #1f5f8b;
    border-bottom: 2px solid #c9d9e6;
    white-space: nowrap;
    padding: 12px 10px;
}

.poste-list-table tbody td {
    vertical-align: middle;
    font-size: 15px;
    line-height: 1.45;
    padding: 12px 12px;
    border-color: #e8edf2;
}

.poste-list-table tbody tr:hover {
    background: #f7fbfe;
}

.poste-list-table tbody td.poste-col-titre {
    text-align: right;
    max-width: 240px;
    word-wrap: break-word;
    font-weight: 600;
    color: #1a2a36;
}

.poste-list-table tbody td.poste-col-num {
    text-align: center;
    white-space: nowrap;
    color: #3d5163;
}

.poste-actions-cell {
    text-align: center;
    white-space: nowrap;
    width: 1%;
    min-width: 168px;
}

.poste-actions {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.poste-actions .btn {
    flex: 0 0 auto;
    margin: 0;
    padding: 7px 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    border-radius: 7px;
}

.poste-actions .btn-primary {
    background: #1f5f8b;
    border-color: #1f5f8b;
}

.poste-actions .btn-primary:hover {
    background: #174e75;
    border-color: #174e75;
}

.poste-actions .btn-default {
    border-color: #c5d3e0;
    color: #1f5f8b;
}

/* --- Vue grille --- */
.poste-results-row > .gridView {
    width: 100%;
}

.gridView {
    display: flex;
    flex-wrap: wrap;
    margin-right: -10px;
    margin-left: -10px;
}

.gridView > .poste-card-col {
    float: none;
    display: flex;
    padding-right: 10px;
    padding-left: 10px;
    margin-bottom: 20px;
}

.gridView .poste-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    margin-bottom: 0;
    padding: 0;
    border: 1px solid #d7e3ee;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(31, 95, 139, 0.07);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.gridView .poste-card:hover {
    box-shadow: 0 6px 18px rgba(31, 95, 139, 0.14);
    transform: translateY(-2px);
}

.gridView .poste-card .caption {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 16px 16px 18px;
    text-align: right;
}

.gridView .poste-card-title {
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e4ebf2;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    color: #1a2a36;
    min-height: 2.9em;
}

.gridView .poste-card-meta {
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.55;
    color: #3d5163;
}

.gridView .poste-card-meta b {
    font-weight: 700;
    color: #1f5f8b;
}

.gridView .poste-card-footer {
    margin-top: auto;
    padding-top: 14px;
}

.gridView .poste-card-footer .poste-actions {
    justify-content: flex-start;
    width: 100%;
}

.gridView-empty {
    width: 100%;
    padding: 24px;
    text-align: center;
    color: #5a6c7d;
    font-size: 16px;
}

/* Panneau recherche */
.poste-search-well {
    background: #fff;
    border: 1px solid #dce4ec;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(31, 95, 139, 0.06);
    padding: 16px 16px 18px;
}

.poste-search-well h4 {
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 14px;
    color: #1f5f8b;
    font-size: 17px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8edf2;
}

.poste-search-well .row_margin {
    margin-bottom: 10px;
}

.poste-search-well .form-control {
    border-radius: 8px;
    border-color: #c9d9e6;
    box-shadow: none;
}

.poste-search-well .form-control:focus {
    border-color: #1f5f8b;
    box-shadow: 0 0 0 3px rgba(31, 95, 139, 0.12);
}

/* Conteneur table : évite le débordement horizontal */
.poste-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.poste-list-table {
    width: 100%;
    max-width: 100%;
}

/* Tablette : boutons un peu plus compacts, wrap autorisé */
@media (max-width: 991px) {
    .poste-actions-cell {
        min-width: 0;
        white-space: normal;
    }

    .poste-actions {
        flex-wrap: wrap;
        gap: 6px;
        white-space: normal;
    }

    .poste-actions .btn {
        padding: 6px 10px;
        font-size: 13px;
    }

    .poste-list-table tbody td.poste-col-titre {
        max-width: none;
    }

    .poste-search-actions {
        flex-wrap: wrap;
    }
}

/* Mobile : cartes plein largeur, actions accessibles, pas de scroll horizontal */
@media (max-width: 767px) {
    .poste-view-toolbar {
        display: none;
    }

    .poste-results-row {
        margin-left: 0;
        margin-right: 0;
    }

    .listeView {
        display: none !important;
    }

    .gridView {
        display: flex !important;
        margin-left: 0;
        margin-right: 0;
    }

    .gridView > .poste-card-col {
        width: 100%;
        float: none;
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 14px;
    }

    .gridView .poste-card {
        border-radius: 10px;
        box-shadow: 0 1px 6px rgba(31, 95, 139, 0.08);
    }

    .gridView .poste-card:hover {
        transform: none;
    }

    .gridView .poste-card .caption {
        padding: 14px 14px 16px;
    }

    .gridView .poste-card-title {
        font-size: 15px;
        min-height: 0;
        margin-bottom: 10px;
        padding-bottom: 8px;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .gridView .poste-card-meta {
        font-size: 13px;
        margin-bottom: 4px;
        word-break: break-word;
    }

    .gridView .poste-card-footer {
        padding-top: 12px;
    }

    .gridView .poste-card-footer .poste-actions,
    .poste-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 8px;
        flex-wrap: wrap;
        white-space: normal;
    }

    .poste-actions .btn {
        display: block;
        width: 100%;
        text-align: center;
        padding: 10px 12px;
        font-size: 14px;
        white-space: normal;
    }

    .poste-search-well {
        margin-bottom: 16px;
        padding: 14px;
    }

    .poste-search-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .poste-search-actions .poste-btn {
        width: 100%;
        min-width: 0;
    }

    .poste-pager > li > a,
    .poste-pager > li > span {
        padding: 6px 10px;
    }
}
