/* Hub Ma présence — pleine largeur + bandeau sh-header (comme Holiday / CClientMission) */

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

.jp-me-hub-page.sh-hub-page,
.jp-me-hub-page .sh-hub {
    --sh-accent: #1d4ed8;
    --sh-accent-2: #2563eb;
    --sh-accent-dark: #1e3a8a;
    --sh-accent-soft: #eff4ff;
    --sh-accent-ring: rgba(29, 78, 216, .2);
    /* Même police que Externe / CClientMission (MissionHub) */
    font-family: var(--jp-font, 'Lexend Deca', system-ui, sans-serif);
    color: var(--sh-text, #0f172a);
    -webkit-font-smoothing: antialiased;
}

.jp-me-hub-page .sh-title {
    font-family: var(--jp-font, 'Lexend Deca', system-ui, sans-serif);
    font-weight: 700;
    letter-spacing: -.02em;
}
.jp-me-hub-page .sh-subtitle,
.jp-me-hub-page .sh-crumb {
    font-family: inherit;
}

.jp-me-hub-page .jp-pres-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 180px;
    padding: 40px 20px;
    text-align: center;
    color: #1e3a8a;
}
.jp-me-hub-page .jp-pres-loading.is-inline {
    min-height: 0;
    padding: 24px 12px;
    gap: 10px;
}
.jp-me-hub-page .jp-pres-loading strong {
    font-size: 14px;
    font-weight: 650;
    letter-spacing: .01em;
    color: #1e3a8a;
}
.jp-me-hub-page .jp-pres-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid #dbeafe;
    border-top-color: #1d4ed8;
    border-right-color: #60a5fa;
    animation: jp-pres-spin .75s linear infinite;
    flex: none;
}
.jp-me-hub-page .jp-pres-loading.is-inline .jp-pres-spinner {
    width: 32px;
    height: 32px;
    border-width: 2.5px;
}

.jp-me-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(29, 78, 216, .35), transparent 60%),
        linear-gradient(120deg, #1e3a8a 0%, #1d4ed8 45%, #3b82f6 100%);
}

.jp-me-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);
}
.jp-me-hub-page .sh-header .sh-header-btn:hover {
    background: rgba(255, 255, 255, .24);
    color: #fff;
}

.jp-me-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.jp-me-header-actions .jp-me-date {
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .12);
    color: #fff;
    padding: 0 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color-scheme: dark;
}

.jp-me-header-actions .sh-header-btn:disabled { opacity: .45; cursor: default; }
@keyframes jp-pres-spin { to { transform: rotate(360deg); } }

/* ── Corps de page ── */
.jp-me {
    --ink: #0f172a;
    --mut: #64748b;
    --line: #e6ebf3;
    --soft: #f6f8fc;
    --brand: #1d4ed8;
    --brand-soft: #eff4ff;
    --on: #16a34a;
    display: grid;
    gap: 16px;
    padding: 16px 0 28px;
    color: var(--ink);
    font-family: var(--jp-font, 'Lexend Deca', system-ui, sans-serif);
}
.jp-me-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    min-width: 0;
}
.jp-me-card-h {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.jp-me-card-h h3 { margin: 0; font-size: 15px; font-weight: 700; color: #1e3a8a; letter-spacing: -.01em; }
.jp-me .mut { color: var(--mut); font-size: 12px; }
.jp-me-empty { padding: 24px 12px; text-align: center; color: var(--mut); font-size: 14px; }

/* ── 1 · Journée ── */
.jp-me-day { position: relative; border-top: 4px solid var(--st); transition: opacity .15s; }
.jp-me-day.is-busy { opacity: .55; }
.jp-me-day-h { display: flex; gap: 16px; align-items: flex-start; }
.jp-me-ic {
    flex: none;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--st);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 6px 16px -6px var(--st);
}
.jp-me-ic.dash { background: #fff; color: var(--st); box-shadow: inset 0 0 0 3px var(--st); }
.jp-me-ic.live { animation: jpMeLive 1.6s ease-in-out infinite; }
@keyframes jpMeLive { 0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .45); } 50% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } }
.jp-me-day-t { min-width: 0; flex: 1; }
.jp-me-when { font-size: 12px; color: var(--mut); text-transform: capitalize; }
.jp-me-when b { color: var(--brand); text-transform: none; }
.jp-me-day-t h2 { margin: 2px 0 4px; font-size: 24px; font-weight: 700; color: var(--stfg); letter-spacing: -.02em; line-height: 1.2; }
.jp-me-day-t p { margin: 0 0 10px; color: #334155; font-size: 14px; }
.jp-me-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.jp-me-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.jp-me-chip.ghost { background: var(--soft); color: #334155; box-shadow: inset 0 0 0 1px var(--line); }
.jp-me-chip.ghost .fas { color: var(--mut); font-size: 11px; }
.jp-me-chip.sm { padding: 2px 9px; font-size: 11px; }

.jp-me-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0 6px; }
.jp-me-kpi { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; min-width: 0; }
.jp-me-kpi span { display: block; font-size: 11px; color: var(--mut); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.jp-me-kpi b { display: block; font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.jp-me-kpi em { font-style: normal; font-size: 12px; color: var(--mut); }
.jp-me-kpi em.bad { color: #be123c; font-weight: 600; }
.jp-me-kpi em.ok { color: #15803d; font-weight: 600; }

/* Frise (grande dans la journée, petite dans le tableau et l'infobulle) */
.jp-me-tl { position: relative; }
.jp-me-tl .track { position: relative; height: 10px; border-radius: 6px; background: #edf1f7; }
.jp-me-tl .win { position: absolute; top: -4px; bottom: -4px; border-radius: 4px; }
.jp-me-tl .win.in { background: rgba(34, 197, 94, .13); }
.jp-me-tl .win.out { background: rgba(59, 130, 246, .13); }
.jp-me-tl .seg { position: absolute; top: 0; bottom: 0; border-radius: 6px; }
.jp-me-tl .seg.on { background: var(--on, #16a34a); }
.jp-me-tl .seg.on.live { background: linear-gradient(90deg, #16a34a, #22c55e); }
.jp-me-tl .seg.away { background: repeating-linear-gradient(45deg, #fdba74 0 4px, #ffedd5 4px 8px); }
.jp-me-tl .seg.full { opacity: .75; }
.jp-me-tl .pin { position: absolute; top: -3px; width: 2px; height: 16px; margin-left: -1px; border-radius: 1px; }
.jp-me-tl .pin.in { background: #15803d; }
.jp-me-tl .pin.out { background: #b91c1c; }
.jp-me-tl .now { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: var(--brand, #1d4ed8); }
.jp-me-tl.big { margin: 26px 0 4px; }
.jp-me-tl.big .track { height: 18px; border-radius: 9px; }
.jp-me-tl.big .seg { border-radius: 9px; }
.jp-me-tl.big .pin { top: -6px; height: 30px; width: 3px; margin-left: -1.5px; }
.jp-me-tl.big .pin b, .jp-me-tl.big .now b {
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    color: inherit;
}
.jp-me-tl.big .pin.in b { color: #15803d; }
.jp-me-tl.big .pin.out b { color: #b91c1c; top: calc(100% + 2px); bottom: auto; }
.jp-me-tl.big .now { top: -10px; bottom: -10px; }
.jp-me-tl.big .now b { color: var(--brand); top: calc(100% + 2px); bottom: auto; }
.jp-me-tl .axis { position: relative; height: 26px; margin-top: 8px; }
.jp-me-tl .axis span { position: absolute; top: 8px; transform: translateX(-50%); font-size: 10px; color: #94a3b8; }
.jp-me-tl .axis span:first-child { transform: none; }
.jp-me-tl .axis span:last-child { transform: translateX(-100%); }

.jp-me-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11px; color: var(--mut); margin-top: 2px; }
.jp-me-legend span { display: inline-flex; align-items: center; gap: 6px; }
.jp-me-legend .lg { width: 18px; height: 8px; border-radius: 4px; display: inline-block; }
.jp-me-legend .lg.on { background: #16a34a; }
.jp-me-legend .lg.away { background: repeating-linear-gradient(45deg, #fdba74 0 3px, #ffedd5 3px 6px); }
.jp-me-legend .lg.win { background: linear-gradient(90deg, rgba(34, 197, 94, .25), rgba(59, 130, 246, .25)); }
.jp-me-legend .lg.now { width: 3px; height: 12px; background: var(--brand); }

.jp-me-sessions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.jp-me-sessions span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    padding: 4px 4px 4px 10px;
    border-radius: 999px;
    background: #f0fdf4;
    color: #166534;
    box-shadow: inset 0 0 0 1px #bbf7d0;
}
.jp-me-sessions span b { background: #fff; border-radius: 999px; padding: 1px 8px; font-weight: 700; }
.jp-me-sessions span.open { background: #dcfce7; }
.jp-me-sessions span.odd { background: #fff7ed; color: #9a3412; box-shadow: inset 0 0 0 1px #fed7aa; }

.jp-me-notes { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.jp-me-notes li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; padding: 8px 12px; border-radius: 10px; }
.jp-me-notes li .fas { margin-top: 2px; }
.jp-me-notes li.warn { background: #fff7ed; color: #9a3412; box-shadow: inset 0 0 0 1px #fed7aa; }
.jp-me-notes li.info { background: var(--brand-soft); color: #1e3a8a; box-shadow: inset 0 0 0 1px #c7d7fe; }

.jp-me-nobadge { display: flex; gap: 16px; align-items: center; }
.jp-me-nobadge > .fas { font-size: 30px; color: #94a3b8; }
.jp-me-nobadge p { margin: 4px 0 0; color: var(--mut); }

/* ── 2 · Score + calendrier ── */
.jp-me-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.jp-me-score-b { display: flex; gap: 22px; align-items: center; }
.jp-me-ring { position: relative; width: 136px; height: 136px; flex: none; }
.jp-me-ring svg { width: 100%; height: 100%; }
.jp-me-ring > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.jp-me-ring b { font-size: 36px; font-weight: 700; color: #1e3a8a; line-height: 1; }
.jp-me-ring span { font-size: 11px; color: var(--mut); margin-top: 2px; }
.jp-me-comp { flex: 1; min-width: 0; display: grid; gap: 10px; }
.jp-me-lv { font-size: 16px; font-weight: 700; }
.jp-me-cmp > div:first-child { display: flex; justify-content: space-between; font-size: 13px; }
.jp-me-cmp > div:first-child b { font-variant-numeric: tabular-nums; }
.jp-me-cmp .bar { height: 7px; border-radius: 4px; background: #eef1f6; margin: 4px 0 3px; overflow: hidden; }
.jp-me-cmp .bar i { display: block; height: 100%; border-radius: 4px; }
.jp-me-cmp em { font-style: normal; font-size: 11px; color: var(--mut); }
.jp-me-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.jp-me-mini div { background: var(--soft); border-radius: 10px; padding: 8px 12px; border: 1px solid var(--line); }
.jp-me-mini span { display: block; font-size: 11px; color: var(--mut); }
.jp-me-mini b { font-size: 18px; }
.jp-me-mini em { display: block; font-style: normal; font-size: 11px; color: var(--mut); }

.jp-me-calg { display: grid; gap: 6px; }
.jp-me-calg .wk { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.jp-me-calg .wk.hd span { font-size: 11px; color: var(--mut); text-align: center; font-weight: 600; }
.jp-me-calg .cd {
    height: 38px;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    transition: transform .12s;
}
.jp-me-calg button.cd { cursor: pointer; }
.jp-me-calg button.cd:hover { transform: translateY(-2px); }
.jp-me-calg .cd.none { background: repeating-linear-gradient(45deg, #f4f6fa 0 4px, #fff 4px 8px); color: #a0a9b8; box-shadow: inset 0 0 0 1px var(--line); }
.jp-me-calg .cd.none .fas { font-size: 8px; color: #f59e0b; }
.jp-me-calg .cd.x { visibility: hidden; }
.jp-me-calg .cd.today::after { content: ''; position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.jp-me-calg .cd.sel { outline: 2px solid var(--brand); outline-offset: 2px; }
.jp-me-callg { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 11px; color: var(--mut); }
.jp-me-callg span { display: inline-flex; align-items: center; gap: 6px; }
.jp-me-callg i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.jp-me-callg i.none { background: repeating-linear-gradient(45deg, #eef1f6 0 3px, #fff 3px 6px); box-shadow: inset 0 0 0 1px var(--line); }

/* ── 3 · Historique ── */
.jp-me-range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.jp-me-pill {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 5px 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
}
.jp-me-pill:hover { border-color: var(--brand); color: var(--brand); }
.jp-me-range label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mut); margin: 0 0 0 4px; font-weight: 500; }
.jp-me-range input[type="date"] { height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 12px; color: var(--ink); }
.jp-me-scroll { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.jp-me-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.jp-me-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--mut);
    font-weight: 600;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.jp-me-table td { padding: 10px; border-bottom: 1px solid #f0f3f8; vertical-align: middle; }
.jp-me-table tbody tr { cursor: pointer; transition: background .12s; }
.jp-me-table tbody tr:hover { background: #f8faff; }
.jp-me-table tbody tr.sel { background: var(--brand-soft); }
.jp-me-table tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.jp-me-table .tlc { width: 26%; min-width: 180px; }
.jp-me-table .why { color: var(--mut); font-size: 12px; min-width: 200px; }
.jp-me-table .why .fas { color: var(--brand); margin-left: 4px; }
.jp-me-table .late { color: #be123c; font-weight: 700; font-size: 12px; }
.jp-me .nw { white-space: nowrap; font-variant-numeric: tabular-nums; }
.jp-me .tag { display: inline-block; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 1px 8px; font-size: 10px; font-weight: 700; }

/* ── Infobulle ── */
.jp-me-tip {
    position: fixed;
    z-index: 1060;
    width: 300px;
    max-width: calc(100vw - 16px);
    background: #fff;
    color: #0f172a;
    border: 1px solid #e3e8ef;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, .18);
    padding: 12px 14px;
    font-family: var(--jp-font, 'Lexend Deca', system-ui, sans-serif);
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity .12s, transform .12s, visibility .12s;
    left: 0;
    top: 0;
}
.jp-me-tip.on { opacity: 1; visibility: visible; transform: none; }
.jp-me-tip > b { display: block; font-size: 13px; text-transform: capitalize; margin-bottom: 4px; }
.jp-me-tip .st { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.jp-me-tip .st i { width: 9px; height: 9px; border-radius: 50%; }
.jp-me-tip p { margin: 4px 0 8px; color: #475467; }
.jp-me-tip dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0 0 10px; }
.jp-me-tip dt { color: #64748b; font-weight: 500; }
.jp-me-tip dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.jp-me-tip ul { margin: 8px 0 0; padding-left: 16px; color: #1e3a8a; }

/* ── Petits écrans ── */
@media (max-width: 1100px) {
    .jp-me-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
    .jp-me { padding: 12px 0 20px; gap: 12px; }
    .jp-me-card { padding: 14px; border-radius: 14px; }
    .jp-me-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .jp-me-ic { width: 48px; height: 48px; font-size: 20px; border-radius: 12px; }
    .jp-me-day-t h2 { font-size: 20px; }
    .jp-me-tl.big .pin b { display: none; }
    .jp-me-score-b { flex-direction: column; align-items: stretch; }
    .jp-me-ring { margin: 0 auto; }
    .jp-me-mini { grid-template-columns: minmax(0, 1fr); }
    .jp-me-scroll { margin: 0 -14px; padding: 0 14px; }
    /* La pastille « Plage · entrée … · sortie … » ne tenait pas sur une ligne : la page défilait de côté. */
    .jp-me-day-t { min-width: 0; }
    .jp-me-tags .jp-me-chip { white-space: normal; max-width: 100%; line-height: 1.35; }
}
