.ape-page-fix,
.ape-page-fix * {
    box-sizing: border-box;
}

.ape-page-fix .card,
.ape-page-fix .card-body,
.ape-page-fix .content {
    max-width: none !important;
}

.ape-page-fix .card-top-tab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ape-page-fix .card-top-tab ul {
    margin: 0;
    padding-left: 0;
}

.ape-page-fix .card-top-tab-item-paleblue,
.ape-page-fix .card-top-tab-item-green {
    font-size: 15px !important;
    padding: 10px 22px !important;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #AF322D;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.export-btn:hover {
    background: #8f2723;
    color: #fff;
}

.ape-page-fix .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ape-grid,
.naf-grid {
    width: 100%;
    min-width: 900px;
    margin-bottom: 3rem;
    border-radius: 5px;
    box-shadow: 0px 3px 12px #EAEAEA;
    background: #fff;
    overflow: hidden;
}

.ape-grid-header,
.ape-grid-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px 150px;
    align-items: stretch;
    width: 100%;
}

.naf-grid-header,
.naf-grid-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
}

.ape-grid-header > div,
.naf-grid-header > div {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #EAEAEA;
    border-right: 1px solid #EAEAEA;
    background: #fff;
    display: flex;
    align-items: center;
}

.ape-grid-header > div:first-child {
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    text-align: center;
}

.ape-grid-header > div:nth-child(2),
.ape-grid-header > div:nth-child(3),
.naf-grid-header > div {
    justify-content: center;
    text-align: center;
}

.ape-grid-header > div:last-child,
.naf-grid-header > div:last-child {
    border-right: none;
}

.ape-grid-row > div,
.naf-grid-row > div {
    padding: 0.75rem;
    border-bottom: 1px solid #EAEAEA;
    border-right: 1px solid #EAEAEA;
    font-size: 16px;
    line-height: 1.25;
    min-width: 0;
}

.ape-grid-row > div:last-child,
.naf-grid-row > div:last-child {
    border-right: none;
}

.ape-grid-body .ape-grid-row:last-child > div,
.naf-grid-body .naf-grid-row:last-child > div {
    border-bottom: none;
}

.ape-code-cell,
.naf-code-cell,
.naf-corr-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.ape-effectif-cell,
.ape-action-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.ape-row-link {
    color: #67809b;
    text-decoration: none;
    font-size: 16px;
    overflow-wrap: anywhere;
}

.ape-row-link:hover {
    color: #AF322D;
    text-decoration: underline;
}

.corr-title {
    font-size: 14px;
    background: #fff7ed;
    color: #9a3412;
    border: 0.5px solid #fed7aa;
    border-radius: 4px;
    padding: 3px 9px;
    font-weight: 500;
    vertical-align: middle;
}

.corr-bands-wrap {
    margin-top: 4px;
    width: 100%;
    max-width: 100%;
}

.corr-band {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 3px 8px;
    border-left: 3px solid #c2410c;
    background: #fff7ed;
    border-radius: 0 4px 4px 0;
    margin-bottom: 2px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.corr-band-code {
    font-size: 14px;
    font-weight: 600;
    color: #9a3412;
    white-space: nowrap;
    text-decoration: none;
    flex: 0 0 auto;
}

a.corr-band-code:hover {
    text-decoration: underline;
}

.corr-band-name {
    font-size: 14px;
    color: #c2410c;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

.corr-extra {
    display: none;
    flex-direction: column;
}

.corr-extra.open {
    display: flex;
}

.corr-toggle {
    display: inline-block !important;
    font-size: 11px !important;
    color: #c2410c !important;
    cursor: pointer !important;
    padding: 3px 0 0 0 !important;
    background: none !important;
    border: none !important;
    text-align: left !important;
    margin: 0 !important;
    box-shadow: none !important;
    max-width: none !important;
    font-family: inherit !important;
    line-height: 1.4 !important;
}

.corr-toggle:hover {
    text-decoration: underline;
}

.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #4b5563;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.action-link:hover {
    color: #AF322D;
    text-decoration: underline;
}

.empty-corr {
    font-size: 11px;
    display: block;
    margin-top: 3px;
    color: #9e9e9e;
}

.grid-empty,
.grid-error,
.grid-loading {
    padding: 2rem;
    text-align: center;
    color: #9e9e9e;
    border-bottom: 1px solid #EAEAEA;
}

.grid-error {
    color: #AF322D;
}

.ape-grid-header .badge,
.ape-grid-header button {
    margin: 0 !important;
    max-width: none !important;
    box-shadow: none !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
}

#sortApeBtn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 !important;
    max-width: none !important;
    width: auto !important;
    min-width: 165px;
    padding: 6px 12px !important;
    white-space: nowrap !important;
    overflow: visible !important;
    font-size: 14px !important;
    border-radius: 12px !important;
}

.ape-search-bar {
    margin-bottom: 1.5rem;
}

.ape-search-wrap {
    position: relative;
    width: 100%;
    margin: 0 0 0.5rem 0;
}

.ape-search-wrap input[type="search"] {
    padding: 0.8rem 1rem;
    font-size: 15px;
    border-radius: 100px;
    border: none;
    box-shadow: 0px 3px 12px #EAEAEA;
    width: 100%;
    font-family: inherit;
}

.ape-search-wrap input[type="search"]:focus {
    outline: none;
    box-shadow: 2px 3px 10px #B9D3FF;
}

.ape-search-wrap .search-btn {
    flex: 0 0 auto;
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.8rem 1rem;
    background-color: transparent;
    border: none;
    color: #AF322D;
    font-size: 1rem;
    box-shadow: none;
    cursor: pointer;
    margin-bottom: 0;
}

.ape-search-count {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    padding-left: 0.25rem;
}

.ape-search-count span {
    font-weight: 600;
    color: #374151;
}

.ape-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.ape-pagination-info {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0;
}

.ape-pagination-info span {
    font-weight: 600;
    color: #374151;
}

.ape-pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.ape-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #4b5563;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    margin-bottom: 0 !important;
    box-shadow: none !important;
}

.ape-page-btn:hover {
    background: #f9fafb;
    color: #4b5563;
    text-decoration: none;
    box-shadow: none !important;
}

.ape-page-btn.disabled {
    color: #d1d5db;
    background: #f9fafb;
    border-color: #f3f4f6;
    cursor: not-allowed;
    pointer-events: none;
}

.ape-page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #4b5563;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    margin-bottom: 0 !important;
    box-shadow: none !important;
}

.ape-page-num:hover {
    background: #f9fafb;
    color: #4b5563;
    text-decoration: none;
    box-shadow: none !important;
}

.ape-page-num.active {
    color: #fff;
    background: #5da7b4;
    border-color: #5da7b4;
    font-weight: 700;
    cursor: default;
    pointer-events: none;
}

.naf-page-num.active {
    background: #27aa00;
    border-color: #27aa00;
}

@media screen and (max-width: 991px) {
    .ape-grid,
    .naf-grid {
        min-width: 760px;
    }

    .ape-grid-header,
    .ape-grid-row {
        grid-template-columns: minmax(0, 1fr) 175px 135px;
    }

    .corr-band-name {
        display: none;
    }
}