/* Hub ValidationIssue — accent indigo (réutilise .sh-* / .mh-*) */

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

.vi-hub-page.sh-hub-page,
.vi-hub-page .sh-hub {
    --sh-accent: #4f46e5;
    --sh-accent-2: #6366f1;
    --sh-accent-dark: #3730a3;
    --sh-accent-soft: #eef2ff;
    --sh-accent-ring: rgba(79, 70, 229, .22);
}

.vi-hub-page .sh-header {
    background:
        radial-gradient(1200px 300px at 85% -60%, rgba(255, 255, 255, .14), transparent 60%),
        linear-gradient(120deg, #312e81 0%, #4338ca 45%, #6366f1 100%);
}

.vi-hub-page .mh-kpi-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 28px;
    margin: 0 0 12px;
}

.vi-hub-page .mh-block-title {
    margin: 4px 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #64748b;
}

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

.vi-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;
    font: inherit;
    color: inherit;
}

.vi-hub-page .mh-scard:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.vi-hub-page .mh-scard.is-on {
    background: color-mix(in srgb, var(--mh-tone, #4f46e5) 10%, #fff);
    border-color: var(--mh-tone, #4f46e5);
}

.vi-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;
}

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

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

.vi-hub-page .sh-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
}

.vi-hub-page .ph-filter-bar {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.vi-hub-page .custom-applied-filters-wrap {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.vi-hub-page .vi-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 36px 16px;
    color: #64748b;
    font-size: 13.5px;
}

.vi-hub-page .vi-empty .fas {
    font-size: 22px;
    opacity: .7;
}

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

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

.vi-hub-page .sh-table tbody tr.sh-row:hover {
    background: #f8fafc;
}

.vi-hub-page .sh-table .sh-check-cell {
    width: 36px;
    text-align: center;
    vertical-align: middle;
}

.vi-hub-page .vi-col-acts {
    width: 44px;
    text-align: right;
    white-space: nowrap;
}

.vi-hub-page .mh-row-acts {
    position: relative;
    display: inline-flex;
}

.vi-hub-page .mh-act-menu-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
}

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

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

.vi-hub-page .mh-act-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 8px 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
}

.vi-hub-page .mh-act-item:hover {
    background: #f8fafc;
}

.vi-hub-page .mh-act-item.is-danger {
    color: #b91c1c;
}

.vi-hub-page .sh-header .mh-entity-manager-btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .28);
}

/* ── Détail ─────────────────────────────────────────────── */

.vi-detail-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;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .28);
    white-space: nowrap;
    box-shadow: none;
    margin-left: 0;
}

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

.vi-detail-page .sh-header .sh-icon-btn.sh-header-btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
}

.vi-detail-page .sh-header .vi-btn-ok {
    background: #fff;
    color: #166534;
    border-color: #fff;
}

.vi-detail-page .sh-header .vi-btn-danger {
    background: #fff;
    color: #b91c1c;
    border-color: #fff;
}

.vi-detail-page .sh-header .vi-btn-warn {
    background: #fff;
    color: #b45309;
    border-color: #fff;
}

.vi-detail-page .sh-header .vi-btn-ghost {
    background: transparent;
    color: #fff;
}

.vi-detail-head-text {
    min-width: 0;
}

.vi-detail-actions {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
    max-width: 58%;
}

.vi-detail-page .sh-subtitle .sh-badge {
    vertical-align: middle;
}

.vi-detail-page .vi-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 14px;
    margin-bottom: 14px;
    border: 1px solid transparent;
}

.vi-detail-page .vi-hero.tone-ok {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-color: #a7f3d0;
}

.vi-detail-page .vi-hero.tone-warn {
    background: linear-gradient(135deg, #fffbeb, #ffedd5);
    border-color: #fdba74;
}

.vi-detail-page .vi-hero.tone-danger {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-color: #fca5a5;
}

.vi-detail-page .vi-hero.tone-info {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #93c5fd;
}

.vi-detail-page .vi-hero.tone-neutral {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.vi-hero-ico {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(255, 255, 255, .7);
    flex: 0 0 auto;
}

.vi-hero.tone-ok .vi-hero-ico { color: #15803d; }
.vi-hero.tone-warn .vi-hero-ico { color: #c2410c; }
.vi-hero.tone-danger .vi-hero-ico { color: #b91c1c; }
.vi-hero.tone-info .vi-hero-ico { color: #1d4ed8; }

.vi-hero-label {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.vi-hero-hint {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

.vi-hero-date {
    margin-left: auto;
    text-align: right;
}

.vi-hero-date-lab {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #94a3b8;
}

.vi-hero-date-val {
    font-size: 16px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
}

.vi-split-row {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
    gap: 14px;
    align-items: stretch;
    margin-bottom: 14px;
}

.vi-split-row > .vi-detail-card {
    margin-bottom: 0;
    height: 100%;
}

.vi-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

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

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

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

.vi-detail-row {
    display: grid;
    grid-template-columns: 42% 1fr;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.vi-detail-row dt {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #94a3b8;
    margin: 0;
}

.vi-detail-row dd {
    margin: 0;
    font-size: 13.5px;
    font-weight: 650;
    color: #0f172a;
    word-break: break-word;
}

.vi-prose {
    font-size: 14px;
    line-height: 1.55;
    color: #334155;
    white-space: pre-wrap;
}

.vi-prose-block {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.vi-prose-block.tone-warn {
    background: #fffbeb;
    border-color: #fde68a;
}

.vi-prose-block.tone-danger {
    background: #fef2f2;
    border-color: #fecaca;
}

.vi-prose-block.tone-ok {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.vi-numro {
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #3730a3;
}

.vi-origin-card {
    width: 100%;
    text-align: left;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font: inherit;
    color: inherit;
}

.vi-origin-card:hover {
    background: #e0e7ff;
}

.vi-origin-card strong {
    font-size: 14px;
    color: #1e1b4b;
}

.vi-origin-go {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #4338ca;
}

/* Panneau demande (issue-context) — style Jupiter */
.vi-issue-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.vi-issue-loading,
.vi-issue-empty {
    padding: 16px;
    color: #64748b;
    font-size: 13.5px;
    text-align: center;
}

.vi-issue-empty.is-error {
    color: #b91c1c;
}

.vi-issue-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.vi-issue-ticket {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #3730a3;
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}

.vi-issue-ticket:hover {
    background: #e0e7ff;
    color: #312e81;
    text-decoration: none;
}

.vi-issue-ticket .fa-external-link-alt {
    font-size: 11px;
    opacity: .7;
}

.vi-issue-ticket.is-static {
    cursor: default;
}

.vi-issue-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
}

.vi-issue-title {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
}

.vi-issue-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
}

.vi-issue-meta-item {
    min-width: 0;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
}

.vi-issue-meta-lab {
    font-size: 10.5px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 4px;
}

.vi-issue-meta-val {
    font-size: 13.5px;
    font-weight: 650;
    color: #0f172a;
    word-break: break-word;
    line-height: 1.35;
}

.vi-issue-link {
    color: #4338ca;
    font-weight: 700;
    text-decoration: none;
}

.vi-issue-link:hover {
    text-decoration: underline;
}

.vi-issue-desc {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.vi-issue-desc-lab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.vi-issue-atts .vi-issue-desc-lab {
    border-bottom: 0;
    padding: 0 0 8px;
    background: transparent;
}

.vi-issue-desc-body {
    padding: 12px 14px;
    font-size: 13.5px;
    line-height: 1.55;
    color: #334155;
    max-height: 11rem;
    overflow: auto;
}

.vi-issue-atts {
    padding-top: 2px;
}

.vi-detail-page .vi-detail-atts {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.vi-detail-page .vi-detail-atts .vi-issue-desc-lab {
    margin: 0 0 8px;
}

.vi-detail-page .vi-detail-atts .vi-issue-att .fa-file-pdf {
    color: #b91c1c;
}

.vi-issue-att-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vi-issue-att {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}

.vi-issue-att:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #3730a3;
    text-decoration: none;
}

.vi-issue-att-empty {
    font-size: 12.5px;
    color: #94a3b8;
}

@media (max-width: 720px) {
    .vi-issue-meta {
        grid-template-columns: 1fr;
    }
}

/* Aussi lisible hors hub (fiche Espo classique) */
.field[data-name="issueContextPanel"] .vi-issue-panel,
.cell[data-name="issueContextPanel"] .vi-issue-panel {
    margin-top: 4px;
}

@media (max-width: 1100px) {
    .vi-split-row {
        grid-template-columns: 1fr;
    }

    .vi-detail-actions {
        max-width: 100%;
    }
}

@media (max-width: 960px) {
    .vi-detail-page .vi-hero {
        flex-wrap: wrap;
    }

    .vi-hero-date {
        margin-left: 0;
        text-align: left;
        width: 100%;
    }
}
