
/* =========================================
   BCMM - Cahiers des Charges Minières
   ========================================= */

.bcmm-ccm-table {
    width: 100%;
    margin: 30px 0;
    color: #263445;
    font-family: inherit;
}

.ccm-wrapper {
    width: 100%;
}

/* Header */

.ccm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.ccm-heading h2 {
    margin: 0 0 8px;
    color: #17365d;
    font-size: 25px;
    font-weight: 700;
}

.ccm-heading p {
    margin: 0;
    color: #687789;
    font-size: 14px;
}

.ccm-counter {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    border: 1px solid #dce4ed;
    border-radius: 6px;
    background: #f8fafc;
    white-space: nowrap;
}

.ccm-counter strong {
    color: #17365d;
    font-size: 20px;
}

.ccm-counter span {
    color: #687789;
    font-size: 13px;
}

/* Toolbar */

.ccm-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 18px;
}

.ccm-search {
    flex: 1;
    min-width: 200px;
}

.ccm-search input,
.ccm-filters select {
    width: 100%;
    height: 43px;
    padding: 0 13px;
    border: 1px solid #dce3eb;
    border-radius: 5px;
    background: #fff;
    color: #263445;
    font-size: 14px;
    outline: none;
}

.ccm-search input:focus,
.ccm-filters select:focus {
    border-color: #315b89;
    box-shadow: 0 0 0 2px rgba(49, 91, 137, 0.10);
}

.ccm-filters {
    display: flex;
    gap: 10px;
}

.ccm-filters select {
    min-width: 150px;
}

/* Table */

.ccm-table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e1e7ee;
    border-radius: 6px;
}

.ccm-table {
    width: 100%;
    min-width: 950px;
    border-collapse: collapse;
    background: #fff;
    font-size: 13px;
}

.ccm-table th {
    padding: 15px 12px;
    background: #f3f6fa;
    color: #34465b;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.ccm-table td {
    padding: 14px 12px;
    border-top: 1px solid #edf0f4;
    color: #4b5969;
    vertical-align: middle;
}

.ccm-table tbody tr:hover {
    background: #f8fafc;
}

.ccm-table td:first-child {
    color: #263c56;
    font-weight: 600;
}

.ccm-empty {
    padding: 35px !important;
    text-align: center;
    color: #7b8794 !important;
}

/* Badges */

.ccm-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.ccm-badge-document {
    background: #eaf0f8;
    color: #294c75;
}

.ccm-badge-permis {
    background: #edf5ef;
    color: #34734a;
}

/* Document link */

.ccm-document-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #24558b;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.ccm-document-link:hover {
    color: #17365d;
    text-decoration: underline;
}

/* Footer */

.ccm-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: 18px;
}

.ccm-results {
    color: #687789;
    font-size: 13px;
}

.ccm-pagination {
    display: flex;
    gap: 5px;
}

/* Responsive */

@media (max-width: 768px) {
    .ccm-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .ccm-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .ccm-filters {
        width: 100%;
    }

    .ccm-filters select {
        min-width: 0;
        flex: 1;
    }

    .ccm-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .ccm-heading h2 {
        font-size: 21px;
    }

    .ccm-filters {
        flex-direction: column;
    }
}

/* =========================================
   Tri des colonnes
   ========================================= */

.ccm-table th[data-sort] {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.ccm-table th[data-sort]:hover {
    background: #e8edf4;
}

.ccm-table th[data-sort]::after {
    content: " ↕";
    color: #a0acba;
    font-size: 11px;
}

.ccm-table th[data-sort].ccm-sorted::after {
    content: attr(data-sort-label);
    color: #24558b;
}

/* =========================================
   Pagination
   ========================================= */

.ccm-footer-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.ccm-page-size {
    height: 34px;
    padding: 0 8px;
    border: 1px solid #dce3eb;
    border-radius: 4px;
    background: #fff;
    color: #46566a;
    font-size: 12px;
}

.ccm-pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.ccm-page-button {
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid #dce3eb;
    border-radius: 4px;
    background: #fff;
    color: #34465b;
    font-size: 13px;
    cursor: pointer;
}

.ccm-page-button:hover:not(:disabled) {
    border-color: #315b89;
    color: #24558b;
}

.ccm-page-button.active {
    border-color: #17365d;
    background: #17365d;
    color: #fff;
}

.ccm-page-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ccm-page-dots {
    padding: 0 4px;
    color: #7b8794;
}

@media (max-width: 480px) {
    .ccm-footer-left {
        align-items: flex-start;
        flex-direction: column;
    }

    .ccm-pagination {
        width: 100%;
    }
}
