/* Liste des affaires — thème cyan (réutilise .sh-* de support-hub) */

body:has(.mh-hub-page) .container,
body:has(.mh-hub-page) #content,
body:has(.mh-hub-page).has-navbar > .content,
body:has(.mh-hub-page)[data-navbar="side"].minimized #content,
body:has(.mh-hub-page)[data-navbar="side"].has-navbar > .content {
    max-width: none !important;
    width: 100%;
}

.mh-hub-page.sh-hub-page,
.mh-hub-page .sh-hub {
    --sh-accent: #0e7490;
    --sh-accent-2: #0891b2;
    --sh-accent-dark: #155e75;
    --sh-accent-soft: #ecfeff;
    --sh-accent-ring: rgba(14, 116, 144, .2);
    --sh-info: #0e7490;
    --sh-info-bg: #ecfeff;
    --sh-info-dot: #06b6d4;
}

.mh-hub-page .sh-header {
    background:
        radial-gradient(1200px 300px at 85% -60%, rgba(255, 255, 255, .14), transparent 60%),
        radial-gradient(600px 220px at 10% 140%, rgba(8, 145, 178, .4), transparent 60%),
        linear-gradient(120deg, #164e63 0%, #0e7490 45%, #0891b2 100%);
}

.mh-hub-page .sh-header .sh-header-btn {
    width: auto;
    height: auto;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    gap: 8px;
    display: inline-flex;
    align-items: center;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .28);
}

.mh-hub-page .sh-header .sh-header-btn:hover {
    background: rgba(255, 255, 255, .24);
    color: #fff;
}

.mh-hub-page .sh-header .mh-entity-manager-btn {
    width: 38px;
    min-width: 38px;
    padding: 0;
    justify-content: center;
}

.mh-hub-page .sh-header .mh-entity-manager-btn.hidden {
    display: none !important;
}

.mh-hub-page .mh-kpi-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 28px;
    margin: 0 0 8px;
}
.mh-hub-page .mh-kpi-col {
    min-width: 0;
}
.mh-hub-page .mh-kpi-col-pilotage {
    flex: 1 1 auto;
}
.mh-hub-page .mh-pilotage {
    margin-bottom: 0;
}

.mh-hub-page .sh-filters .sh-btn.is-on {
    background: #ecfeff;
    border-color: #67e8f9;
    color: #0e7490;
}

.mh-hub-page .mh-filter-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
    margin: -8px 0 14px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.mh-hub-page .mh-filter-panel[hidden] {
    display: none !important;
}

.mh-hub-page .mh-filter-panel select,
.mh-hub-page .mh-filter-panel input[type="date"] {
    height: 34px;
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: #0f172a;
}

.mh-hub-page .mh-filter-date {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

.mh-hub-page .sh-asof-label {
    font-size: 12px;
    color: var(--sh-muted, #64748b);
    margin-right: 6px;
    white-space: nowrap;
}

.mh-hub-page .sh-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mh-hub-page .sh-row-title {
    font-weight: 600;
    color: var(--sh-text, #0f172a);
}

.mh-hub-page .sh-row-sub {
    font-size: 12px;
    color: var(--sh-muted, #64748b);
    margin-top: 2px;
}

.mh-hub-page .sh-muted {
    color: var(--sh-muted, #64748b);
    font-size: 12px;
}

.mh-hub-page .sh-actions {
    white-space: nowrap;
}

.mh-hub-page .sh-btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    min-height: 28px;
}

.mh-hub-page .sh-dropdown {
    position: relative;
}

.mh-hub-page .sh-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 200px;
    background: #fff;
    border: 1px solid #e6e8ef;
    border-radius: 10px;
    padding: 6px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mh-hub-page .sh-dropdown-menu[hidden] {
    display: none !important;
}

.mh-hub-page .sh-dropdown-menu button {
    text-align: left;
    border: 0;
    background: transparent;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    color: #0f172a;
}

.mh-hub-page .sh-dropdown-menu button:hover {
    background: #ecfeff;
}

.mh-hub-page .sh-load-more {
    padding: 14px;
    text-align: center;
}


/* ---- Onglets entité ---- */
.mh-hub-page .mh-tabs {
    display: flex;
    gap: 4px;
    margin: 14px 0 12px;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
}

.mh-hub-page .mh-tab {
    border: 0;
    background: transparent;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 8px 8px 0 0;
}

.mh-hub-page .mh-tab:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.mh-hub-page .mh-tab.is-on {
    color: #0e7490;
    border-bottom-color: #0e7490;
    background: #ecfeff;
}

.mh-hub-page .mh-tab .fas {
    margin-right: 6px;
}

/* ---- Grille (colonnes compactes pour limiter le scroll horizontal) ---- */
.mh-hub-page .sh-table-wrap {
    overflow-x: auto;
}

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

.mh-hub-page .mh-table th {
    padding: 8px 8px;
    font-size: 10.5px;
    letter-spacing: .02em;
}

.mh-hub-page .mh-table td {
    padding: 8px 8px;
    white-space: nowrap;
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mh-hub-page .mh-table th.mh-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.mh-hub-page .mh-table th.mh-sortable:hover,
.mh-hub-page .mh-table th.is-sorted {
    color: #0e7490;
}

.mh-hub-page .mh-table th.num,
.mh-hub-page .mh-table td.num {
    text-align: right;
    max-width: 72px;
    width: 72px;
    font-variant-numeric: tabular-nums;
}

.mh-hub-page .mh-table th.mh-col-classe,
.mh-hub-page .mh-table td.mh-col-classe {
    max-width: 42px;
    width: 42px;
    text-align: center;
    padding-left: 6px;
    padding-right: 6px;
}

.mh-hub-page .mh-table th.mh-col-date,
.mh-hub-page .mh-table td.mh-col-date {
    max-width: 86px;
    width: 86px;
}

.mh-hub-page .mh-table th.mh-col-status,
.mh-hub-page .mh-table td.mh-col-status {
    max-width: 108px;
}

.mh-hub-page .mh-table th.mh-col-link,
.mh-hub-page .mh-table td.mh-col-link,
.mh-hub-page .mh-table th.mh-col-text,
.mh-hub-page .mh-table td.mh-col-text {
    max-width: 112px;
}

.mh-hub-page .mh-table td.mh-col-link.is-main,
.mh-hub-page .mh-table th.mh-col-link.is-main {
    max-width: 132px;
}

.mh-hub-page .mh-chip {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    color: #0e7490;
    background: #cffafe;
    vertical-align: middle;
}

.mh-hub-page .mh-classe {
    display: inline-block;
    min-width: 24px;
    text-align: center;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    background: #e2e8f0;
    color: #334155;
}

.mh-hub-page .mh-classe-a { background: #dcfce7; color: #166534; }
.mh-hub-page .mh-classe-b { background: #dbeafe; color: #1e40af; }
.mh-hub-page .mh-classe-c { background: #fef3c7; color: #92400e; }
.mh-hub-page .mh-classe-d { background: #fee2e2; color: #991b1b; }

.mh-hub-page .mh-create-btn {
    background: #fff;
    color: #0e7490;
    border-color: #fff;
}

.mh-hub-page .sh-header .mh-create-btn:hover {
    background: #ecfeff;
    color: #155e75;
}

/* ---- Filtres statut (style CRM compact : compteur + libellé) ---- */
.mh-hub-page .mh-block-title {
    margin: 4px 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #64748b;
}
@media (max-width: 900px) {
    .mh-hub-page .mh-kpi-row {
        flex-direction: column;
        gap: 8px;
    }
}

.mh-hub-page .mh-status-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mh-hub-page .mh-scard {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 8px;
    text-align: left;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
    min-height: 0;
    box-shadow: none;
}

.mh-hub-page .mh-scard:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: none;
    transform: none;
}

.mh-hub-page .mh-scard.is-on {
    background: color-mix(in srgb, var(--mh-tone, #0e7490) 10%, #fff);
    border-color: var(--mh-tone, #0e7490);
    box-shadow: none;
}

.mh-hub-page .mh-scard-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: var(--mh-tone, #64748b);
    font-variant-numeric: tabular-nums;
}

.mh-hub-page .mh-scard-label {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

.mh-hub-page .mh-scard.tone-total { --mh-tone: #0e7490; }
.mh-hub-page .mh-scard.tone-ok { --mh-tone: #15803d; }
.mh-hub-page .mh-scard.tone-info { --mh-tone: #0369a1; }
.mh-hub-page .mh-scard.tone-warn { --mh-tone: #b45309; }
.mh-hub-page .mh-scard.tone-danger { --mh-tone: #b91c1c; }
.mh-hub-page .mh-scard.tone-neutral { --mh-tone: #64748b; }

.mh-hub-page .sh-kpi.tone-ok .sh-kpi-icon { background: #dcfce7; color: #15803d; }
.mh-hub-page .sh-kpi.tone-info .sh-kpi-icon { background: #e0f2fe; color: #0369a1; }
.mh-hub-page .sh-kpi.tone-warn .sh-kpi-icon { background: #fef3c7; color: #b45309; }
.mh-hub-page .sh-kpi.tone-danger .sh-kpi-icon { background: #fee2e2; color: #b91c1c; }

.mh-hub-page .mh-status-end {
    margin-top: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ── Modal Statistiques (CClientMission) ─────────────────────────── */
.modal.ccm-stats-modal-wrap .dialog.ccm-stats-dialog,
.dialog.ccm-stats-dialog {
    max-width: 980px;
    width: calc(100vw - 32px);
}
.ccm-stats-modal {
    padding: 4px 2px 8px;
}
.ccm-stats-head-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: 10px;
    border-radius: 8px;
    background: #ecfeff;
    color: #0e7490;
    vertical-align: middle;
}
.ccm-stats-head-txt {
    display: inline-flex;
    flex-direction: column;
    vertical-align: middle;
    line-height: 1.2;
}
.ccm-stats-head-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}
.ccm-stats-head-sub {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}
.ccm-stats-modal .ccm-stats-sub {
    margin: 0 0 14px;
    font-size: 12.5px;
    color: #64748b;
}
.ccm-stats-modal .ccm-stats-grid,
.mh-hub-page .ccm-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
@media (max-width: 960px) {
    .ccm-stats-modal .ccm-stats-grid,
    .mh-hub-page .ccm-stats-grid {
        grid-template-columns: 1fr;
    }
}
.ccm-stats-loading,
.ccm-stats-empty {
    grid-column: 1 / -1;
    padding: 28px 12px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}
.ccm-stats-modal .ccm-chart,
.mh-hub-page .ccm-chart {
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    min-width: 0;
}
.ccm-stats-modal .ccm-chart-wide,
.mh-hub-page .ccm-chart-wide {
    grid-column: 1 / -1;
}
.ccm-stats-modal .ccm-chart-title,
.mh-hub-page .ccm-chart-title {
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #334155;
    margin-bottom: 10px;
}
.ccm-stats-modal .ccm-bars,
.mh-hub-page .ccm-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ccm-stats-modal .ccm-bar-row,
.mh-hub-page .ccm-bar-row {
    display: grid;
    grid-template-columns: 118px 1fr 36px;
    align-items: center;
    gap: 8px;
}
.ccm-stats-modal .ccm-bar-lab,
.mh-hub-page .ccm-bar-lab {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ccm-stats-modal .ccm-bar-track,
.mh-hub-page .ccm-bar-track {
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.ccm-stats-modal .ccm-bar-fill,
.mh-hub-page .ccm-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: #64748b;
    min-width: 0;
    transition: width .25s ease;
}
.ccm-stats-modal .ccm-bar-fill.tone-ok,
.mh-hub-page .ccm-bar-fill.tone-ok { background: #16a34a; }
.ccm-stats-modal .ccm-bar-fill.tone-info,
.mh-hub-page .ccm-bar-fill.tone-info { background: #0284c7; }
.ccm-stats-modal .ccm-bar-fill.tone-warn,
.mh-hub-page .ccm-bar-fill.tone-warn { background: #d97706; }
.ccm-stats-modal .ccm-bar-fill.tone-danger,
.mh-hub-page .ccm-bar-fill.tone-danger { background: #dc2626; }
.ccm-stats-modal .ccm-bar-fill.tone-neutral,
.mh-hub-page .ccm-bar-fill.tone-neutral { background: #64748b; }
.ccm-stats-modal .ccm-bar-n,
.mh-hub-page .ccm-bar-n {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.ccm-stats-modal .ccm-legend,
.mh-hub-page .ccm-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin: -2px 0 12px;
}
.ccm-stats-modal .ccm-legend-item,
.mh-hub-page .ccm-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}
.ccm-stats-modal .ccm-legend-swatch,
.mh-hub-page .ccm-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: #64748b;
    display: inline-block;
}
.ccm-stats-modal .ccm-legend-swatch.tone-ok,
.mh-hub-page .ccm-legend-swatch.tone-ok { background: #16a34a; }
.ccm-stats-modal .ccm-legend-swatch.tone-info,
.mh-hub-page .ccm-legend-swatch.tone-info { background: #0284c7; }
.ccm-stats-modal .ccm-legend-swatch.tone-warn,
.mh-hub-page .ccm-legend-swatch.tone-warn { background: #d97706; }
.ccm-stats-modal .ccm-legend-swatch.tone-danger,
.mh-hub-page .ccm-legend-swatch.tone-danger { background: #dc2626; }
.ccm-stats-modal .ccm-legend-swatch.tone-neutral,
.mh-hub-page .ccm-legend-swatch.tone-neutral { background: #64748b; }
.ccm-stats-modal .ccm-groups,
.mh-hub-page .ccm-groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
@media (max-width: 720px) {
    .ccm-stats-modal .ccm-groups,
    .mh-hub-page .ccm-groups {
        grid-template-columns: 1fr;
    }
}
.ccm-stats-modal .ccm-group,
.mh-hub-page .ccm-group {
    min-width: 0;
}
.ccm-stats-modal .ccm-group-bars,
.mh-hub-page .ccm-group-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 110px;
    padding: 0 4px 2px;
    border-bottom: 1px solid #e2e8f0;
}
.ccm-stats-modal .ccm-gbar,
.mh-hub-page .ccm-gbar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 4px;
    min-width: 0;
}
.ccm-stats-modal .ccm-gbar-fill,
.mh-hub-page .ccm-gbar-fill {
    width: 100%;
    max-width: 28px;
    border-radius: 4px 4px 2px 2px;
    background: #64748b;
    min-height: 0;
    transition: height .25s ease;
}
.ccm-stats-modal .ccm-gbar-fill.tone-ok,
.mh-hub-page .ccm-gbar-fill.tone-ok { background: #16a34a; }
.ccm-stats-modal .ccm-gbar-fill.tone-info,
.mh-hub-page .ccm-gbar-fill.tone-info { background: #0284c7; }
.ccm-stats-modal .ccm-gbar-fill.tone-warn,
.mh-hub-page .ccm-gbar-fill.tone-warn { background: #d97706; }
.ccm-stats-modal .ccm-gbar-fill.tone-danger,
.mh-hub-page .ccm-gbar-fill.tone-danger { background: #dc2626; }
.ccm-stats-modal .ccm-gbar-fill.tone-neutral,
.mh-hub-page .ccm-gbar-fill.tone-neutral { background: #94a3b8; }
.ccm-stats-modal .ccm-gbar-n,
.mh-hub-page .ccm-gbar-n {
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    font-variant-numeric: tabular-nums;
}
.ccm-stats-modal .ccm-group-lab,
.mh-hub-page .ccm-group-lab {
    margin-top: 8px;
    text-align: center;
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
}
