/* Rapport CRA — hub style Préfacture / Mission */

.cra-hub-page.sh-hub-page,
.cra-hub-page .sh-hub {
    --sh-accent: #0e7490;
    --sh-accent-2: #0891b2;
    --sh-accent-dark: #155e75;
    --sh-accent-soft: #cffafe;
    --sh-accent-ring: rgba(14, 116, 144, .22);
}

.cra-hub-page .sh-header {
    background:
        radial-gradient(1200px 300px at 85% -60%, rgba(255, 255, 255, .14), transparent 60%),
        linear-gradient(120deg, #164e63 0%, #0e7490 45%, #0891b2 100%);
}

.cra-hub-page .cra-hub-month-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, .12);
    border-radius: 10px;
}

.cra-hub-page .cra-hub-period-select {
    height: 32px;
    border: 1px solid rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .95);
    color: #0f172a;
    border-radius: 8px;
    padding: 0 8px;
    font-size: 13px;
    font-weight: 600;
}

.cra-hub-page .cra-hub-period-chip {
    display: none;
}

.cra-hub-page .cra-hub-filters {
    align-items: flex-end;
    gap: 10px;
}

.cra-hub-page .cra-hub-filter {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.cra-hub-page .cra-hub-filter select,
.cra-hub-page .cra-hub-filter input[type="search"] {
    min-width: 120px;
    height: 34px;
    border-radius: 8px;
}

.cra-hub-page .cra-hub-filter-client input[type="search"] {
    min-width: 180px;
}

.cra-hub-page .cra-hub-filter-types .cra-type-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cra-hub-page .cra-type-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #fff;
    color: #0e7490;
    font-size: 12.5px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    user-select: none;
}

.cra-hub-page .cra-type-chip input {
    margin: 0;
    cursor: pointer;
}

.cra-hub-page .cra-type-chip.is-on {
    background: #0e7490;
    border-color: #0e7490;
    color: #fff;
}

.cra-hub-page .cra-hub-list-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.cra-hub-page .cra-hub-list-meta .right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 13px;
}

.cra-hub-page .cra-hub-pager {
    display: inline-flex;
    gap: 4px;
}

.cra-hub-page .cra-hub-table {
    table-layout: auto;
    width: 100%;
    font-size: 14px;
}

.cra-hub-page .cra-hub-table th,
.cra-hub-page .cra-hub-table td {
    padding: 7px 8px;
    vertical-align: middle;
}

.cra-hub-page .cra-hub-table th {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.cra-hub-page .cra-hub-table .sh-check-cell,
.cra-hub-page .cra-hub-table .cra-col-check {
    width: 36px;
    max-width: 36px;
    text-align: center;
}

.cra-hub-page .cra-hub-table td.mh-col-text.is-main,
.cra-hub-page .cra-hub-table td.mh-col-link {
    white-space: normal;
    word-break: break-word;
    min-width: 120px;
}

.cra-hub-page .cra-hub-table th.mh-col-avatar,
.cra-hub-page .cra-hub-table td.mh-col-avatar {
    width: 88px;
    min-width: 88px;
    max-width: 100px;
    text-align: center;
    overflow: visible;
    text-overflow: unset;
    white-space: nowrap;
}

.cra-hub-page .cra-hub-table th.cra-col-commercial,
.cra-hub-page .cra-hub-table td.cra-col-commercial {
    width: 118px;
    min-width: 118px;
    max-width: none;
    text-align: center;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap;
}

.cra-hub-page .cra-ext-link {
    color: #0e7490;
    text-decoration: none;
}

.cra-hub-page .cra-ext-link:hover {
    text-decoration: underline;
}

.cra-hub-page .cra-ext-link::after,
.cra-hub-page a.cra-ext-link[target="_blank"]::after,
.cra-hub-page .cra-hub-table a[target="_blank"]::after {
    display: none !important;
    content: none !important;
}

.cra-hub-page .cra-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.cra-hub-page .cra-type-externe { background: #cffafe; color: #155e75; }
.cra-hub-page .cra-type-portage { background: #fef3c7; color: #92400e; }
.cra-hub-page .cra-type-interne { background: #d1fae5; color: #065f46; }

.cra-hub-page .cra-consultant-cell-inner {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.25;
}

.cra-hub-page .cra-consultant-name {
    font-weight: 600;
    color: #0f172a;
    text-decoration: none;
}

.cra-hub-page .cra-consultant-name:hover {
    color: #0e7490;
}

.cra-hub-page .cra-consultant-entit {
    display: inline-block;
    width: fit-content;
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
}

.cra-hub-page .cra-consultant-entit-consult-it {
    background: #dbeafe;
    color: #1d4ed8;
}

.cra-hub-page .cra-consultant-entit-menisys {
    background: #fce7f3;
    color: #be185d;
}

/* Saisie / J. ouvrés : la règle globale td.num (max 88px + ellipsis) coupait « 19,5 j ». */
.mh-hub-page.cra-hub-page .mh-table.cra-hub-table th.cra-col-saisie,
.mh-hub-page.cra-hub-page .mh-table.cra-hub-table td.cra-col-saisie,
.mh-hub-page.cra-hub-page .mh-table.cra-hub-table th.cra-col-jours,
.mh-hub-page.cra-hub-page .mh-table.cra-hub-table td.cra-col-jours {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    max-width: none;
    width: auto;
}

.mh-hub-page.cra-hub-page .mh-table.cra-hub-table th.cra-col-saisie,
.mh-hub-page.cra-hub-page .mh-table.cra-hub-table td.cra-col-saisie {
    min-width: 148px;
}

.mh-hub-page.cra-hub-page .mh-table.cra-hub-table th.cra-col-jours,
.mh-hub-page.cra-hub-page .mh-table.cra-hub-table td.cra-col-jours {
    min-width: 96px;
}

.cra-hub-page .cra-saisie-cell {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-weight: 600;
    white-space: nowrap;
}

.cra-hub-page .cra-saisie-pct { font-size: 14px; min-width: 42px; }
.cra-hub-page .cra-saisie-sep { color: #94a3b8; font-weight: 400; }
.cra-hub-page .cra-saisie-days { font-size: 13px; font-weight: 500; color: #334155; }
.cra-hub-page .cra-pct-ok .cra-saisie-pct { color: #15803d; }
.cra-hub-page .cra-pct-mid .cra-saisie-pct { color: #b45309; }
.cra-hub-page .cra-pct-low .cra-saisie-pct,
.cra-hub-page .cra-pct-missing .cra-saisie-pct,
.cra-hub-page .cra-pct-missing .cra-saisie-days { color: #b91c1c; }

.cra-hub-page .cra-hub-table tbody tr.cra-missing { background: #fef2f2; }
.cra-hub-page .cra-hub-table tbody tr.cra-soumis { background: #dbeafe; }
.cra-hub-page .cra-hub-table tbody tr.cra-missing:hover { background: #fecaca; }
.cra-hub-page .cra-hub-table tbody tr.cra-soumis:hover { background: #bfdbfe; }

.cra-hub-page .cra-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.cra-hub-page .cra-pill-ok { background: #dcfce7; color: #15803d; }
.cra-hub-page .cra-pill-ko { background: #fee2e2; color: #991b1b; }
.cra-hub-page .cra-pill-soumis { background: #2563eb; color: #fff; }
.cra-hub-page .cra-pill-neutral { background: #e2e8f0; color: #475569; }

.cra-hub-page .cra-actions-cell {
    white-space: nowrap;
    text-align: right;
    position: relative;
    z-index: 2;
    pointer-events: auto;
}

.cra-hub-page .cra-actions-cell .btn-link {
    padding: 2px 6px;
    pointer-events: auto;
    cursor: pointer;
}

.cra-hub-page .cra-hub-table tfoot td {
    border-top: 2px solid #dee2e6;
    background: #f8f9fa;
    font-weight: 700;
}

/* Cartes KPI — alignées, lisibles, hauteur homogène. */
.cra-hub-page .rent-wb-kpis {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 16px;
}

@media (max-width: 1400px) {
    .cra-hub-page .rent-wb-kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .cra-hub-page .rent-wb-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.cra-hub-page .rent-wb-kpi {
    display: flex;
    flex-direction: column;
    min-height: 118px;
    padding: 14px 14px 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: box-shadow .15s ease, border-color .15s ease, transform .1s ease;
}

.cra-hub-page .rent-wb-kpi .label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: .03em;
    margin: 0 28px 10px 0;
    line-height: 1.25;
    min-height: 28px;
}

.cra-hub-page .rent-wb-kpi .label .fas {
    margin-right: 4px;
}

.cra-hub-page .rent-wb-kpi .value {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.15;
    letter-spacing: -.02em;
    margin-top: auto;
}

.cra-hub-page .rent-wb-kpi .sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    line-height: 1.3;
    min-height: 16px;
}

.cra-hub-page .rent-wb-kpi .tag {
    top: 10px;
    right: 10px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 3px 7px;
    border-radius: 999px;
}

.cra-hub-page .rent-wb-cra-progress {
    height: 4px;
    margin-top: 8px;
    background: #fee2e2;
    border-radius: 999px;
}

.cra-hub-page .rent-wb-kpi.accent-cra-missing {
    border-top: 3px solid #dc2626;
    background: linear-gradient(180deg, #fef2f2 0%, #fff 42%);
}

.cra-hub-page .rent-wb-kpi.accent-sou {
    border-top: 3px solid #2563eb;
}

.cra-hub-page .rent-wb-kpi.accent-ca,
.cra-hub-page .rent-wb-kpi.accent-cra,
.cra-hub-page .rent-wb-kpi.accent-ext,
.cra-hub-page .rent-wb-kpi.accent-por,
.cra-hub-page .rent-wb-kpi.accent-int {
    border-top-width: 3px;
}

.cra-hub-page .rent-wb-kpi-clickable {
    cursor: pointer;
}

.cra-hub-page .rent-wb-kpi-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
    border-color: #cbd5e1;
}

.cra-hub-page .rent-wb-kpi-clickable.active {
    outline: none;
    border-color: #0891b2;
    box-shadow: 0 0 0 2px rgba(8, 145, 178, .28);
}
