/* Hub Contracttype — réutilise .sh-* (support/contact hub) */

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

.ct-hub-page.sh-hub-page,
.ct-hub-page .sh-hub {
    --sh-accent: #0d9488;
    --sh-accent-2: #14b8a6;
    --sh-accent-dark: #0f766e;
    --sh-accent-soft: #f0fdfa;
    --sh-accent-ring: rgba(13, 148, 136, .22);
}

.ct-hub-page .sh-header {
    background:
        radial-gradient(1200px 300px at 85% -60%, rgba(255, 255, 255, .16), transparent 60%),
        radial-gradient(600px 220px at 10% 140%, rgba(13, 148, 136, .35), transparent 60%),
        linear-gradient(120deg, #134e4a 0%, #0f766e 45%, #14b8a6 100%);
}

.ct-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);
}

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

.ct-hub-page .sh-header .sh-btn:not(.sh-btn-ghost) {
    background: #fff;
    color: var(--sh-accent-dark);
    border-color: #fff;
}

.ct-header-actions,
.ct-detail-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ct-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
}

.ct-hub-page .sh-kpi {
    align-items: center;
    min-height: 78px;
}

.ct-hub-page .sh-kpi-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ct-hub-page .sh-kpi-value {
    display: block;
    font-size: 22px;
    font-weight: 750;
    line-height: 1.15;
    color: #0f172a;
}

.ct-hub-page .sh-kpi-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-hub-page .sh-kpi.is-on {
    border-color: var(--sh-accent);
    box-shadow: 0 0 0 2px var(--sh-accent-ring);
}

.ct-hub-page .sh-kpi.ct-kpi-on .sh-kpi-icon {
    background: #dcfce7;
    color: #166534;
}

.ct-hub-page .sh-kpi.ct-kpi-off .sh-kpi-icon {
    background: #fee2e2;
    color: #b91c1c;
}

.ct-list {
    display: flex;
    flex-direction: column;
}

.ct-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
    cursor: pointer;
    background: #fff;
}

.ct-row:hover {
    background: #f8fafc;
}

.ct-row:last-child {
    border-bottom: 0;
}

.ct-row.is-off {
    opacity: .78;
    background: #fafafa;
}

.ct-row.is-off .ct-row-name,
.ct-row.is-off .ct-row-meta,
.ct-detail-page.is-off .sh-title,
.ct-detail-card.is-off .ct-detail-name {
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    text-decoration-color: #94a3b8;
    color: #64748b;
}

.ct-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ct-row-ico {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #f0fdfa;
    color: #0d9488;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.ct-row-ico.is-off {
    background: #f1f5f9;
    color: #94a3b8;
}

.ct-row-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ct-row-meta {
    font-size: 12.5px;
    color: #64748b;
    margin-top: 2px;
}

.ct-row-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.ct-row-acts {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ct-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ct-icon-btn:hover {
    border-color: #99f6e4;
    color: #0d9488;
    background: #f0fdfa;
}

.ct-go {
    color: #94a3b8;
    font-size: 12px;
}

.ct-badge {
    display: inline-flex;
    font-size: 10.5px;
    font-weight: 750;
    letter-spacing: .03em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f0fdfa;
    color: #0f766e;
    text-decoration: none !important;
}

.ct-badge.is-code {
    background: #f1f5f9;
    color: #475569;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 650;
}

.ct-badge.is-off {
    background: #fee2e2;
    color: #b91c1c;
}

.ct-badge.is-on {
    background: #dcfce7;
    color: #166534;
}

.ct-chip {
    display: inline-flex;
    font-size: 11px;
    font-weight: 650;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
}

.ct-chip.is-on {
    background: #ccfbf1;
    color: #0f766e;
}

.ct-chip.is-muted {
    background: #f8fafc;
    color: #94a3b8;
}

.ct-empty {
    padding: 40px 16px;
    text-align: center;
    color: #64748b;
}

.ct-empty .fas {
    font-size: 28px;
    color: #94a3b8;
    margin-bottom: 10px;
}

.ct-empty p {
    margin: 0 0 14px;
    font-weight: 600;
}

.ct-more {
    padding: 12px;
    text-align: center;
}

.ct-more-end {
    color: #94a3b8;
    font-size: 12.5px;
    font-weight: 600;
}

/* ---- Fiche détail ---- */
.ct-detail-page .ct-detail-head-text {
    min-width: 0;
}

.ct-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, .9fr);
    gap: 14px;
    align-items: start;
}

.ct-detail-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

@media (max-width: 900px) {
    .ct-detail-grid {
        grid-template-columns: 1fr;
    }
}

.ct-detail-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.ct-detail-card-h {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 12px;
}

.ct-detail-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.ct-detail-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #f0fdfa;
    color: #0d9488;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex: none;
}

.ct-detail-name {
    font-size: 20px;
    font-weight: 750;
    color: #0f172a;
}

.ct-detail-sub {
    font-size: 13.5px;
    color: #64748b;
    margin-top: 4px;
    font-weight: 600;
}

.ct-detail-p {
    margin: 0 0 8px;
    color: #334155;
    line-height: 1.5;
    font-size: 13.5px;
    white-space: pre-wrap;
}

.ct-detail-dl {
    margin: 0;
}

.ct-detail-row {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13.5px;
}

.ct-detail-row:last-child {
    border-bottom: 0;
}

.ct-detail-row dt {
    margin: 0;
    color: #94a3b8;
    font-weight: 650;
}

.ct-detail-row dd {
    margin: 0;
    color: #0f172a;
    font-weight: 600;
    word-break: break-word;
}

/* ---- Édition en place ---- */
.ct-hub-page .sh-header .ct-btn-primary,
.ct-hub-page .sh-header .sh-btn.ct-btn-primary {
    background: #fff !important;
    color: var(--sh-accent-dark) !important;
    border-color: #fff !important;
    font-weight: 700;
}

.ct-hub-page .sh-header .ct-btn-primary:hover,
.ct-hub-page .sh-header .sh-btn.ct-btn-primary:hover {
    filter: brightness(1.05);
}

.ct-card-spacer {
    flex: 1;
}

.ct-detail-card-h {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ct-card-edit {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #0f766e;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ct-card-edit:hover {
    background: #f0fdfa;
    border-color: #99f6e4;
}

.ct-edit-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f0fdfa, #ecfeff);
    border: 1px solid #99f6e4;
    color: #0f766e;
}

.ct-edit-banner .fas {
    font-size: 18px;
    margin-top: 2px;
}

.ct-edit-banner strong {
    display: block;
    font-size: 14px;
}

.ct-edit-banner-hint {
    font-size: 12.5px;
    color: #64748b;
    font-weight: 500;
    margin-top: 2px;
}

.ct-detail-card.is-editing {
    border-color: #99f6e4;
    box-shadow: 0 0 0 1px rgba(13, 148, 136, .08);
}

.ct-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ct-edit-grid.is-stack {
    grid-template-columns: 1fr;
}

@media (max-width: 700px) {
    .ct-edit-grid {
        grid-template-columns: 1fr;
    }
}

.ct-edit-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ct-edit-field.is-wide {
    grid-column: 1 / -1;
}

.ct-edit-field.is-hidden,
.ct-edit-grid .is-hidden {
    display: none !important;
}

.ct-edit-field > span {
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.ct-edit-field .form-control {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13.5px;
    box-shadow: none;
    height: auto;
}

.ct-edit-field .form-control:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, .16);
}

.ct-edit-field textarea.form-control {
    min-height: 72px;
    resize: vertical;
    line-height: 1.45;
}

.ct-edit-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.ct-edit-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 650;
    color: #334155;
    margin: 0;
    cursor: pointer;
}

.ct-edit-check input {
    accent-color: #0d9488;
    width: 16px;
    height: 16px;
}

.ct-edit-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

/* ---- Table liste (colonnes Entity Manager) ---- */
.ct-hub-page .sh-table-wrap {
    overflow-x: auto;
}

.ct-hub-page .ct-table th {
    white-space: nowrap;
}

.ct-hub-page .ct-table tr.sh-row {
    cursor: pointer;
}

.ct-hub-page .ct-table tr.sh-row.is-off > td {
    opacity: .78;
    background: #fafafa;
}

.ct-hub-page .ct-table tr.sh-row.is-off .ct-cell-name,
.ct-hub-page .ct-table tr.sh-row.is-off .ct-cell-muted,
.ct-hub-page .ct-table tr.sh-row.is-off .ct-cell-num {
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    text-decoration-color: #94a3b8;
    color: #64748b;
}

.ct-hub-page .ct-cell-name {
    font-weight: 700;
    color: #0f172a;
}

.ct-hub-page .ct-cell-muted {
    color: #64748b;
    font-size: 12.5px;
}

.ct-hub-page .ct-cell-num {
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    color: #0f172a;
}

.ct-hub-page .mh-col-acts {
    width: 48px;
    text-align: center;
    padding-left: 4px;
    padding-right: 8px;
    overflow: visible;
}

.ct-hub-page .mh-row-acts {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ct-hub-page .mh-act-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
}

.ct-hub-page .mh-act-menu-btn:hover,
.ct-hub-page .mh-row-acts.is-open .mh-act-menu-btn {
    background: #f0fdfa;
    border-color: #99f6e4;
    color: #0f766e;
}

.ct-hub-page .mh-act-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 10050;
    min-width: 176px;
    padding: 6px 0;
    margin: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.ct-hub-page .mh-row-acts.is-open .mh-act-menu {
    display: block;
}

.ct-hub-page .mh-act-item,
.mh-act-menu.is-portal .mh-act-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    border: 0;
    background: transparent;
    color: #0f172a;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
}

.ct-hub-page .mh-act-item .fas,
.mh-act-menu.is-portal .mh-act-item .fas {
    width: 14px;
    color: #64748b;
    font-size: 12px;
}

.ct-hub-page .mh-act-item:hover,
.mh-act-menu.is-portal .mh-act-item:hover {
    background: #f0fdfa;
}

.mh-act-menu.is-portal {
    display: block !important;
    min-width: 176px;
    padding: 6px 0;
    margin: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}
