/* ───────────────────────────────────────────────────────────────────
   Thème du back-office — LinkedIn Vendredi
   Chargé après le CSS de Filament, sans étape de build.
   ─────────────────────────────────────────────────────────────────── */

:root {
    --vd-bg: #f5f7fb;
    --vd-card: #ffffff;
    --vd-border: #e6e9f0;
    --vd-text: #0f172a;
    --vd-muted: #64748b;
    --vd-primary: #2563eb;
    --vd-primary-soft: #eaf0ff;
    --vd-sidebar: #0b1220;
    --vd-sidebar-text: #aab4c8;
    --vd-sidebar-active: rgba(255, 255, 255, .08);
    --vd-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
    --vd-radius: 14px;
}
.dark {
    --vd-bg: #0b1220;
    --vd-card: #111a2e;
    --vd-border: #1e293b;
    --vd-text: #e2e8f0;
    --vd-muted: #8b97ab;
    --vd-primary-soft: rgba(37, 99, 235, .18);
    --vd-sidebar: #070d19;
    --vd-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
}

/* ── Fond & structure ───────────────────────────────────────────── */
.fi-body { background: var(--vd-bg) !important; }
.fi-main { padding-top: .5rem; }

/* ── Sidebar sombre ─────────────────────────────────────────────── */
.fi-sidebar {
    background: var(--vd-sidebar) !important;
    border-inline-end: 1px solid rgba(255, 255, 255, .06) !important;
}
.fi-sidebar-header { background: var(--vd-sidebar) !important; box-shadow: none !important; border-bottom: 1px solid rgba(255,255,255,.06); }
.fi-sidebar .fi-logo { color: #fff; }
.fi-sidebar-group-label { color: #5f6b80 !important; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.fi-sidebar-item-btn { color: var(--vd-sidebar-text) !important; border-radius: 10px; transition: background .15s, color .15s; }
.fi-sidebar-item-btn .fi-icon { color: #7b879c !important; }
.fi-sidebar-item-btn:hover { background: rgba(255,255,255,.05) !important; color: #fff !important; }
.fi-sidebar-item-btn:hover .fi-icon { color: #fff !important; }
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: linear-gradient(135deg, #2563eb, #4f46e5) !important;
    color: #fff !important;
    box-shadow: 0 6px 16px -6px rgba(37, 99, 235, .6);
}
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-icon,
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label,
.fi-sidebar-item.fi-active .fi-sidebar-item-label { color: #fff !important; }
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label { font-weight: 600; }
.fi-sidebar-item-label { font-weight: 500; }
.fi-sidebar-group-collapse-btn, .fi-sidebar-group-btn { color: #7b879c !important; }
.fi-sidebar-open-collapse-sidebar-btn, .fi-sidebar-close-collapse-sidebar-btn { color: #7b879c !important; }
.fi-sidebar-footer { background: var(--vd-sidebar) !important; }

/* ── Topbar ─────────────────────────────────────────────────────── */
.fi-topbar { background: rgba(255,255,255,.75) !important; backdrop-filter: blur(10px); box-shadow: none !important; border-bottom: 1px solid var(--vd-border) !important; }
.dark .fi-topbar { background: rgba(11,18,32,.75) !important; }
.fi-topbar nav { box-shadow: none !important; }

/* ── En-tête de page ────────────────────────────────────────────── */
.fi-header-heading { font-size: 1.5rem !important; letter-spacing: -.02em; font-weight: 700 !important; }
.fi-header-subheading { color: var(--vd-muted); text-transform: capitalize; }

/* ── Cartes, sections, tableaux ─────────────────────────────────── */
.fi-section, .fi-ta-ctn, .fi-wi-stats-overview-stat, .fi-wi-chart, .gm-card, .fi-fo-tabs, .fi-in-section {
    border-radius: var(--vd-radius) !important;
    box-shadow: var(--vd-shadow) !important;
    border: 1px solid var(--vd-border) !important;
    background: var(--vd-card) !important;
}
.fi-section-header, .fi-ta-header { border-bottom: 1px solid var(--vd-border); }
.fi-ta-header-cell { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--vd-muted); }
.fi-ta-row:hover { background: var(--vd-primary-soft) !important; }
.fi-ta-row { transition: background .12s; }
.fi-btn { border-radius: 10px !important; }
.fi-badge { border-radius: 999px !important; font-weight: 600; }
.fi-input-wrp, .fi-select-input, .fi-fo-field-wrp .fi-input-wrp { border-radius: 10px !important; }

/* ── KPI ────────────────────────────────────────────────────────── */
.fi-wi-stats-overview-stat { padding: 1.15rem 1.25rem !important; position: relative; overflow: hidden; }
.fi-wi-stats-overview-stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--vd-primary); opacity: .9; }
.fi-wi-stats-overview-stat.kpi-ok::before { background: #16a34a; }
.fi-wi-stats-overview-stat.kpi-ko::before { background: #dc2626; }
.fi-wi-stats-overview-stat-label { font-size: .78rem !important; color: var(--vd-muted) !important; font-weight: 500; }
.fi-wi-stats-overview-stat-value { font-size: 2rem !important; font-weight: 700 !important; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.fi-wi-stats-overview-stat-description { font-size: .75rem !important; }
.fi-wi-stats-overview-stat-label-ctn .fi-icon { color: var(--vd-primary); }

/* ── Gamification ───────────────────────────────────────────────── */
.gm-widget { --pad: 1.25rem; }
.gm-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .gm-grid { grid-template-columns: 1.1fr 1.3fr 1fr; } .gm-grid-2 { grid-template-columns: 1.1fr 1fr; } }

/* Bloc replié : la gamification se déplie d'un clic, le résumé tient sur une ligne. */
.gm-sante-ok { color: #16a34a; font-size: .72rem; }
.gm-fold > summary { list-style: none; display: flex; align-items: center; gap: .75rem; padding: var(--pad); cursor: pointer; user-select: none; }
.gm-fold > summary::-webkit-details-marker { display: none; }
.gm-fold-resume { font-size: .85rem; font-weight: 600; color: var(--vd-text); }
.gm-fold-chevron { margin-left: auto; color: var(--vd-muted); transition: transform .15s; }
.gm-fold[open] > summary { padding-bottom: 0; }
.gm-fold[open] .gm-fold-chevron { transform: rotate(180deg); }
.gm-card { padding: var(--pad); color: var(--vd-text); }
.gm-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.gm-eyebrow { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 600; color: var(--vd-muted); }
.gm-title { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.gm-title-sm { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
.gm-muted { color: var(--vd-muted); font-size: .8rem; }
.gm-xs { font-size: .72rem; }
.gm-link { font-size: .78rem; font-weight: 600; color: var(--vd-primary); text-decoration: none; }
.gm-link:hover { text-decoration: underline; }

.gm-level-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.gm-level-ring {
    --pct: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center;
    background: conic-gradient(var(--vd-primary) calc(var(--pct) * 1%), var(--vd-border) 0);
    position: relative;
}
.gm-level-ring::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--vd-card); }
.gm-level-num { position: relative; z-index: 1; font-weight: 800; font-size: 1.35rem; letter-spacing: -.03em; }

.gm-bar { height: 8px; border-radius: 999px; background: var(--vd-border); overflow: hidden; }
.gm-bar-sm { height: 6px; }
.gm-bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #60a5fa); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.gm-bar-fill.is-warm { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.gm-bar-fill.is-violet { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.gm-bar-fill.is-done { background: linear-gradient(90deg, #16a34a, #4ade80); }
.gm-bar-legend { display: flex; justify-content: space-between; font-size: .74rem; color: var(--vd-muted); margin-top: .4rem; }

.gm-kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--vd-border); }
.gm-kv-val { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.gm-kv-val small { font-size: .8rem; font-weight: 600; color: var(--vd-muted); }
.gm-kv-lab { font-size: .7rem; color: var(--vd-muted); }
.gm-fire::before { content: "🔥"; font-size: .9rem; margin-right: .25rem; }

.gm-spark { display: flex; align-items: flex-end; gap: 3px; height: 38px; margin-top: 1rem; }
.gm-spark span { flex: 1; background: var(--vd-border); border-radius: 3px 3px 0 0; transition: background .15s; }
.gm-spark span.is-today { background: var(--vd-primary); }
.gm-spark span:hover { background: #60a5fa; }

.gm-account { padding: .85rem 0; border-top: 1px solid var(--vd-border); }
.gm-account:first-of-type { border-top: 0; padding-top: 0; }
.gm-account-head { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-bottom: .55rem; font-size: .85rem; }
.gm-account-name { font-weight: 600; }
.gm-account-meta { margin-left: auto; font-size: .72rem; color: var(--vd-muted); }
.gm-account-foot { display: flex; justify-content: space-between; font-size: .72rem; color: var(--vd-muted); margin-top: .5rem; }
.gm-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.gm-dot.is-on { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.gm-dot.is-off { background: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.18); }
.gm-chip { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: .15rem .45rem; border-radius: 999px; }
.gm-chip-warn { background: #fef3c7; color: #92400e; }
.dark .gm-chip-warn { background: rgba(245,158,11,.18); color: #fbbf24; }
.gm-goal { margin-top: .45rem; }
.gm-goal-lab { display: flex; justify-content: space-between; font-size: .76rem; margin-bottom: .3rem; font-variant-numeric: tabular-nums; }
.gm-goal-lab span:last-child { font-weight: 600; }
.gm-goal-lab small { font-weight: 400; font-size: .7rem; }
.gm-goal.is-off { opacity: .55; }

.gm-badge-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.gm-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .65rem .35rem .45rem; border-radius: 999px; border: 1px solid var(--vd-border); background: var(--vd-bg); font-size: .76rem; font-weight: 600; }
.gm-badge.is-won { border-color: rgba(37,99,235,.25); background: var(--vd-primary-soft); }
.gm-badge-ico { font-size: 1rem; line-height: 1; }
.gm-badge-ico.is-locked { filter: grayscale(1); opacity: .55; font-size: 1.25rem; }
.gm-next { display: flex; gap: .75rem; align-items: flex-start; padding: .6rem 0; border-top: 1px solid var(--vd-border); }
.gm-next:first-of-type { border-top: 0; }
.gm-next-body { flex: 1; min-width: 0; }

/* ── Entonnoir ──────────────────────────────────────────────────── */
.gm-funnel-stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; margin-bottom: 1rem; background: var(--vd-border); }
.gm-funnel-stack span { display: block; min-width: 0; }
.gm-funnel-list { list-style: none; margin: 0; padding: 0; }
.gm-funnel-list li a { display: grid; grid-template-columns: 10px 1fr 80px 42px 46px; align-items: center; gap: .6rem; padding: .5rem .25rem; border-radius: 8px; font-size: .82rem; color: var(--vd-text); text-decoration: none; }
.gm-funnel-list li a:hover { background: var(--vd-bg); }
.gm-swatch { width: 10px; height: 10px; border-radius: 3px; }
.gm-funnel-bar { height: 6px; background: var(--vd-border); border-radius: 999px; overflow: hidden; }
.gm-funnel-bar i { display: block; height: 100%; border-radius: inherit; }
.gm-funnel-n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.gm-funnel-pct { text-align: right; color: var(--vd-muted); font-size: .74rem; font-variant-numeric: tabular-nums; }

/* ── Login ──────────────────────────────────────────────────────── */
.fi-simple-layout { background: radial-gradient(1200px 600px at 20% -10%, #dbe7ff 0%, var(--vd-bg) 60%) !important; }
.dark .fi-simple-layout { background: radial-gradient(1200px 600px at 20% -10%, #17264a 0%, var(--vd-bg) 60%) !important; }
.fi-simple-main { border-radius: 18px !important; box-shadow: var(--vd-shadow) !important; border: 1px solid var(--vd-border); }

/* ---- Santé des gestes ---------------------------------------------------- */
.gm-sante-compte + .gm-sante-compte { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--vd-border); }
.gm-sante-tete { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.gm-sante-nom { font-weight: 700; }
.gm-sante-table { width: 100%; border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; }
.gm-sante-table th { text-align: left; font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--vd-muted); font-weight: 600; padding: .35rem .5rem; border-bottom: 1px solid var(--vd-border); }
.gm-sante-table td { padding: .45rem .5rem; border-bottom: 1px solid var(--vd-border); vertical-align: middle; }
.gm-sante-table tr:last-child td { border-bottom: 0; }
.gm-sante-table .num { text-align: right; white-space: nowrap; }
.gm-sante-table tr.niveau-vide td { color: var(--vd-muted); }
.gm-sante-motif { max-width: 28rem; }
.gm-sante-ko { color: #b91c1c; font-weight: 600; }
.dark .gm-sante-ko { color: #f87171; }
.gm-dot-ok { background: #16a34a; }
.gm-dot-moyen { background: #f59e0b; }
.gm-dot-ko { background: #dc2626; }
.gm-dot-vide { background: var(--vd-border); }
.gm-chip-ok { background: #dcfce7; color: #166534; }
.dark .gm-chip-ok { background: rgba(22,163,74,.18); color: #4ade80; }
.gm-chip-moyen { background: #fef3c7; color: #92400e; }
.dark .gm-chip-moyen { background: rgba(245,158,11,.18); color: #fbbf24; }
.gm-chip-ko { background: #fee2e2; color: #991b1b; }
.dark .gm-chip-ko { background: rgba(220,38,38,.18); color: #f87171; }

/* ---- Repères de tolérance (formulaire du compte) ------------------------- */
.gm-tol { font-size: .85rem; line-height: 1.4; }
.gm-tol-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.gm-tol-table th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; opacity: .6; padding: 0 .6rem .4rem 0; }
.gm-tol-table td { padding: .35rem .6rem .35rem 0; border-top: 1px solid var(--vd-border); vertical-align: top; }
.gm-tol-table .num { text-align: right; white-space: nowrap; }
.gm-tol-table .geste { font-weight: 600; white-space: nowrap; }
.gm-tol-table .note { opacity: .75; }
.gm-tol-note { margin-top: .8rem; opacity: .8; }

/* ---- Tableaux en fiches sur mobile ---------------------------------------- */
@media (max-width: 767px) {
    .gm-sante-table thead, .gm-tol-table thead { display: none; }
    .gm-sante-table, .gm-sante-table tbody, .gm-sante-table tr, .gm-sante-table td,
    .gm-tol-table, .gm-tol-table tbody, .gm-tol-table tr, .gm-tol-table td { display: block; width: 100%; }
    .gm-sante-table tr, .gm-tol-table tr { padding: .55rem 0; border-bottom: 1px solid var(--vd-border); }
    .gm-sante-table tr:last-child, .gm-tol-table tr:last-child { border-bottom: 0; }
    .gm-sante-table td, .gm-tol-table td {
        display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
        padding: .15rem 0; border: 0; text-align: right; white-space: normal;
    }
    .gm-sante-table td::before, .gm-tol-table td::before {
        content: attr(data-label); flex: none; text-align: left;
        font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--vd-muted); opacity: 1;
    }
    .gm-sante-table td.geste, .gm-tol-table td.geste { display: block; text-align: left; font-weight: 700; font-size: .95rem; padding-bottom: .3rem; }
    .gm-sante-table td.geste::before, .gm-tol-table td.geste::before { content: none; }
    .gm-sante-table td.gm-sante-motif, .gm-tol-table td.note { display: block; text-align: left; max-width: none; }
    .gm-sante-table td.gm-sante-motif::before, .gm-tol-table td.note::before { display: block; margin-bottom: .1rem; }
    .gm-sante-tete { gap: .4rem; }
}

/* ── Champ « texte du post » : barre d'outils et emojis ─────────── */
.li-texte { display: flex; flex-direction: column; width: 100%; }
.li-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--vd-border); }
.li-bouton { display: inline-grid; place-items: center; min-width: 34px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--vd-text); font-size: 15px; font-weight: 600; line-height: 1; cursor: pointer; }
.li-bouton:hover { background: var(--vd-primary-soft); }
.li-bouton:focus-visible { outline: 2px solid var(--vd-primary); outline-offset: 1px; }
.li-bouton[disabled] { opacity: .4; cursor: default; }
.li-bouton-nettoyer span { font-size: 12px; letter-spacing: -.02em; text-decoration: line-through; color: var(--vd-muted); }
.li-emojis-wrp { position: relative; }
.li-emojis { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: min(360px, 90vw); max-height: 320px; overflow-y: auto; padding: 10px 12px; border-radius: 12px; background: var(--vd-card); border: 1px solid var(--vd-border); box-shadow: var(--vd-shadow); }
.li-emojis-titre { margin: 6px 0 4px; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--vd-muted); }
.li-emojis-grille { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.li-emoji { height: 36px; border: 0; border-radius: 8px; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; }
.li-emoji:hover { background: var(--vd-primary-soft); }
.li-emojis-aide { margin: 10px 0 0; font-size: .75rem; color: var(--vd-muted); }
.li-emojis-aide kbd { padding: 1px 5px; border-radius: 4px; border: 1px solid var(--vd-border); font: inherit; font-size: .7rem; }
.li-compteur { margin-left: auto; font-size: .8rem; font-variant-numeric: tabular-nums; color: var(--vd-muted); }
.li-compteur-trop { color: #dc2626; font-weight: 600; }
.li-texte textarea { font-size: 15px; line-height: 1.5; }
[x-cloak] { display: none !important; }
.li-bouton-texte { font-size: 13px; font-weight: 600; padding: 0 10px; text-decoration: none; }
.li-bouton-copier { margin-left: auto; border-color: var(--vd-border); }
.li-bouton-copier.li-bouton-fait { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.dark .li-bouton-copier.li-bouton-fait { background: rgba(5,150,105,.2); color: #6ee7b7; border-color: rgba(110,231,183,.3); }
.li-bouton-linkedin { background: #0a66c2; color: #fff; }
.li-bouton-linkedin:hover { background: #004182; }
.li-compteur { margin-left: 4px; }
