/* ═══════════════════════════════════════════════════════════════════
   COMPASS — refresh visuel 2026-09-09 (direction « Compass, light »)
   Chargé APRÈS style.css (assets triés par nom → z_). Reprend le registre
   de universem.com : navy #0D2246, cyan #13CDC8, jaune #FFD801, cartes
   carrées sur filet fin, titres DM Sans 500 à interlettrage serré. Cinq
   partis pris, tous compatibles avec le fonctionnement des pages (filtres
   → données) : barre de filtres en phrase de puces, rangée KPI en bande de
   chiffres sur filets, panneaux numérotés avec le numéro en filigrane,
   boussole de la marque en filigrane de la sidebar, jaune = marqueur.
   Maquettes : artifact « Muninn Refresh » (page Compass, light).
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --c-line: #DCE1E7;
    --c-pale: #F3F6F7;
    --c-muted: #59677B;
    --c-soft: #E4F9F7;
    --c-cyan-ink: #09A9A5;
    --c-yellow-ink: #B8960A;
    --c-sb-dim: #A8B5C9;
}

body { background: var(--c-pale) !important; color: var(--navy); }

/* ── Sidebar : navy profond, boussole en filigrane, libellés à tiret cyan ── */
.sidebar { background: var(--navy-deep); }
.sidebar::before {
    content: '';
    position: absolute; right: -90px; bottom: 90px;
    width: 300px; height: 234px;
    background: #FFFFFF; opacity: 0.05; filter: none; border-radius: 0;
    -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2078.24%2061%22%3E%3Cpath%20fill%3D%22black%22%20fill-rule%3D%22evenodd%22%20d%3D%22M39.12%2061C55.965%2061%2069.62%2047.345%2069.62%2030.5c0-1.887-.171-3.734-.499-5.527l9.119-4.955-10.372.268C63.668%208.465%2052.383%200%2039.12%200%2022.276%200%208.62%2013.655%208.62%2030.5c0%201.887.172%203.734.5%205.527L0%2040.982l10.373-.268C14.573%2052.535%2025.858%2061%2039.12%2061zm-28.747-20.286l12.432-.321c7.825-.203%2015.292%203.271%2020.178%209.387l1.96%202.453.471-3.105c1.174-7.739%205.904-14.481%2012.781-18.218l10.926-5.937a29.99%2029.99%200%200%200-1.253-4.687l-12.433.321c-7.825.203-15.292-3.271-20.178-9.387l-1.96-2.453-.471%203.105c-1.174%207.739-5.904%2014.481-12.781%2018.218L9.12%2036.027a29.99%2029.99%200%200%200%201.253%204.687z%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2078.24%2061%22%3E%3Cpath%20fill%3D%22black%22%20fill-rule%3D%22evenodd%22%20d%3D%22M39.12%2061C55.965%2061%2069.62%2047.345%2069.62%2030.5c0-1.887-.171-3.734-.499-5.527l9.119-4.955-10.372.268C63.668%208.465%2052.383%200%2039.12%200%2022.276%200%208.62%2013.655%208.62%2030.5c0%201.887.172%203.734.5%205.527L0%2040.982l10.373-.268C14.573%2052.535%2025.858%2061%2039.12%2061zm-28.747-20.286l12.432-.321c7.825-.203%2015.292%203.271%2020.178%209.387l1.96%202.453.471-3.105c1.174-7.739%205.904-14.481%2012.781-18.218l10.926-5.937a29.99%2029.99%200%200%200-1.253-4.687l-12.433.321c-7.825.203-15.292-3.271-20.178-9.387l-1.96-2.453-.471%203.105c-1.174%207.739-5.904%2014.481-12.781%2018.218L9.12%2036.027a29.99%2029.99%200%200%200%201.253%204.687z%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
    pointer-events: none;
}
.sidebar::after { display: none; }
.nav-label { display: flex; align-items: center; gap: 10px; color: var(--c-sb-dim); letter-spacing: 0.16em; }
.nav-label::before { content: ''; display: block; width: 14px; height: 1px; background: var(--cyan); flex-shrink: 0; }
.nav-item { border-radius: 0; color: #D1DBE9; }
.nav-item.active { color: #FFFFFF !important; box-shadow: none; background: rgba(19, 205, 200, 0.12); }
.nav-item.active::before { left: -20px; top: 6px; bottom: 6px; height: auto; width: 2px; transform: none; border-radius: 0; }
.sidebar-logo-mark { border-radius: 0; }

/* ── En-tête de page : surtitre à tiret cyan + titre éditorial ── */
.topbar { padding: 24px 40px 18px; align-items: flex-end; border-bottom: 1px solid var(--c-line); }
.topbar > div:first-child { display: flex; flex-direction: column-reverse; gap: 8px; }
.page-breadcrumb {
    display: flex; align-items: center; gap: 12px; margin: 0;
    font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--c-cyan-ink);
}
.page-breadcrumb::before { content: ''; display: block; width: 22px; height: 1px; background: var(--cyan); }
.page-title { font-size: 34px; font-weight: 500; letter-spacing: -0.05em; line-height: 1; color: var(--navy); }
.page-title span { color: var(--c-cyan-ink); }
.topbar-filters { gap: 10px; align-items: center; }
.topbar-filters .dash-dropdown .Select-control,
.date-dropdown .Select-control {
    border-radius: 999px !important; border: 1px solid var(--c-line) !important;
    background: var(--white) !important; min-height: 38px !important;
}
.filter-pill, .project-switch-dd, .project-switch-dd .dash-dropdown { border-radius: 999px !important; }
/* Topbar (date, projet) : pilules compactes sur fond blanc — Dash 4. */
.topbar .dash-dropdown { border-radius: 999px !important; border: 1px solid var(--c-line) !important; background: var(--white) !important; font-size: 12px; color: var(--navy) !important; }
.topbar .dash-dropdown .dash-dropdown-trigger { min-height: 32px; padding: 0 10px 0 12px; }
.topbar .dash-dropdown:hover { border-color: var(--c-cyan-ink) !important; }
#topbar-project-pill { border-radius: 999px; }

/* ── Filtres en phrase : « Showing [puce] [puce] … » ── */
.page-content { padding: 20px 40px 40px; counter-reset: panel; }
.filter-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
    padding: 4px 0 18px; margin-bottom: 20px; border-bottom: 1px solid var(--c-line); row-gap: 12px;
}
.filter-row::before {
    content: 'Showing'; font-size: 20px; font-weight: 500; letter-spacing: -0.03em;
    color: var(--c-muted); margin-right: 2px;
}
.filter-item { min-width: 0; flex: 0 1 auto; display: flex; align-items: center; gap: 8px; max-width: 100%; }
.filter-item .filter-label { margin: 0; font-size: 11px; letter-spacing: 0.1em; color: var(--c-muted); white-space: nowrap; }
.filter-item .dash-dropdown { min-width: 180px; max-width: 460px; }
/* Dash 4 (dcc.Dropdown v4) : le bouton porte .dash-dropdown, le contenu
   .dash-dropdown-trigger ; le menu est un portail .dash-dropdown-content.
   Les anciennes classes .Select-* n'existent plus. */
.filter-item .dash-dropdown, .filter-item .dash-dropdown-wrapper > .dash-dropdown {
    border-radius: 999px !important; border: 1px solid rgba(19, 205, 200, 0.7) !important;
    background: var(--c-soft) !important; color: var(--navy) !important; font-size: 13px;
    font-weight: 500; outline: none; box-shadow: none;
}
.filter-item .dash-dropdown:hover { border-color: var(--c-cyan-ink) !important; }
.filter-item .dash-dropdown:focus, .filter-item .dash-dropdown:focus-visible {
    border-color: var(--c-cyan-ink) !important; outline: 3px solid rgba(19, 205, 200, 0.25) !important; outline-offset: 1px;
}
.filter-item .dash-dropdown .dash-dropdown-trigger { min-height: 38px; padding: 0 12px 0 16px; }
.filter-item .dash-dropdown .dash-dropdown-placeholder { color: var(--navy); opacity: 0.85; }
.filter-item .dash-dropdown .dash-dropdown-value-count {
    border-radius: 999px; background: var(--white); color: var(--navy); font-weight: 600;
}
.dash-dropdown-content {
    border-radius: 0 !important; border: 1px solid var(--c-line) !important;
    box-shadow: 0 12px 32px rgba(13, 34, 70, 0.12) !important; font-size: 13px;
}
.dash-dropdown-content .dash-options-list-option:hover,
.dash-dropdown-content .dash-options-list-option[data-highlighted] { background: var(--c-soft); }
.dash-dropdown-search { font: inherit; }
.gpt-scope-toggle, .scope-toggle { border-radius: 999px; }

/* ── Rangée KPI → bande de chiffres sur filets ── */
.kpi-row { gap: 0; margin-bottom: 24px; border-bottom: 1px solid var(--c-line); }
.kpi-card {
    display: flex; flex-direction: column; gap: 0;
    background: transparent; border: 0; border-right: 1px solid var(--c-line); border-radius: 0;
    padding: 20px 24px 22px 0; margin-right: 24px; box-shadow: none;
}
.kpi-card:last-child { border-right: 0; margin-right: 0; }
.kpi-card:hover { border-color: var(--c-line); box-shadow: none; }
.kpi-card::before, .kpi-card .blob { display: none; }
.kpi-value {
    order: 1; font-size: 52px; font-weight: 500; letter-spacing: -0.06em; line-height: 0.95;
    color: var(--navy); margin-bottom: 0; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.kpi-row .kpi-card:first-child .kpi-value { color: var(--c-cyan-ink); }
.kpi-label {
    order: 2; margin: 14px 0 0; font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em;
    color: var(--c-muted);
}
.kpi-delta {
    order: 3; margin-top: 10px; padding: 0; background: transparent; border-radius: 0;
    font-size: 16px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.kpi-delta.positive { color: var(--c-cyan-ink); background: transparent; }
.kpi-delta.negative { color: var(--coral); background: transparent; }
.kpi-delta.neutral { color: var(--c-muted); background: transparent; }
.kpi-sub { order: 4; margin-top: 6px; font-size: 12.5px; line-height: 1.4; color: var(--c-muted); }

/* ── Panneaux : carrés sur filet fin, numéro « 01 / » + filigrane ── */
.chart-card {
    border-radius: 0; border: 1px solid var(--c-line); padding: 24px 28px 22px;
    position: relative; box-shadow: none;
}
.chart-card::before {
    counter-increment: panel; content: counter(panel, decimal-leading-zero);
    position: absolute; right: 20px; top: 10px;
    font-size: 64px; font-weight: 500; letter-spacing: -0.08em; line-height: 1;
    color: rgba(13, 34, 70, 0.035); pointer-events: none; z-index: 0;
}
.chart-card > * { position: relative; z-index: 1; }
.chart-card-title {
    font-size: 21px; font-weight: 500; letter-spacing: -0.035em; line-height: 1.1; color: var(--navy);
    margin-bottom: 16px; padding-right: 90px;
}
.chart-card-title::before {
    content: counter(panel, decimal-leading-zero) ' /'; display: block;
    font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--c-cyan-ink); margin-bottom: 6px;
}
.aio-legend-box { border-radius: 0; }

/* ── Tables : filets, sans arrondi ── */
.dash-table-container .dash-spreadsheet-container { border-radius: 0 !important; border: 0 !important; border-top: 1px solid var(--c-line) !important; }
.dash-table-container .dash-header { background: transparent !important; color: var(--c-muted) !important; letter-spacing: 0.12em; }

/* ── Boutons : pilules ── */
.export-btn-small, .export-btn { border-radius: 999px; border: 1px solid var(--c-line); color: var(--navy); padding: 7px 16px; }
.export-btn-small:hover, .export-btn:hover { border-color: var(--navy); color: var(--navy); }
.login-btn, .logout-btn, .print-btn, button.btn-primary { border-radius: 999px !important; }

/* ── Marqueur jaune (client) — classe disponible pour les callbacks ── */
.mark { background: var(--yellow); color: var(--navy); padding: 0 8px; border-radius: 40px; }

@media (max-width: 1100px) {
    .kpi-value { font-size: 40px; }
    .filter-row::before { display: none; }
}

/* ── Vague 2 — charts typographiques (taille = part de voix) ── */
.typo-share { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 18px; }
.typo-share.typo-empty { font-size: 13px; color: var(--c-muted); }
.typo-row {
    display: flex; align-items: baseline; gap: 12px; line-height: 1.15;
    font-weight: 500; letter-spacing: -0.04em; color: var(--navy);
}
.typo-row .typo-name, .typo-row .mark { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.typo-row .typo-val {
    font-style: normal; font-size: 13px; font-weight: 600; letter-spacing: 0;
    color: var(--c-cyan-ink); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.typo-row.is-client .typo-val { color: var(--navy); }

/* ── Vague 2 — cadran boussole (Cockpit) ── */
.compass-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 20px; margin-bottom: 20px; }
.compass-grid > .chart-card { margin-bottom: 0; }
.dial-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.dial { position: relative; width: 172px; height: 172px; flex: 0 0 auto; }
.dial-ring {
    width: 100%; height: 100%; border-radius: 50%;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 15px), #000 calc(100% - 14px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 15px), #000 calc(100% - 14px));
}
.dial-needle {
    position: absolute; left: 50%; top: 50%; width: 3px; height: 52px;
    background: var(--navy); border-radius: 3px; transform-origin: 50% 100%;
    transition: transform .6s ease;
}
.dial-needle::after {
    content: ''; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--white); border: 3px solid var(--navy);
    transform: translateX(-50%);
}
.dial-center {
    position: absolute; left: 0; right: 0; bottom: 30px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none;
}
.dial-center b { font-size: 30px; font-weight: 500; letter-spacing: -0.06em; line-height: 1; color: var(--navy); }
.dial-center span { font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-muted); }
.dial-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1 1 150px; }
.dial-legend { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--navy); }
.dial-legend span { display: inline-flex; align-items: center; gap: 8px; }
.dial-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.dial-note { font-size: 12px; line-height: 1.5; color: var(--c-muted); }
@media (max-width: 1100px) { .compass-grid { grid-template-columns: 1fr; } }

/* ── Revue design 2026-09-09 (Codex) : classement lisible des parts de voix ── */
.share-ranking { max-width: 1120px; margin-bottom: 6px; }
.ranking-summary {
    display: flex; align-items: center; gap: 28px; padding: 0 0 18px; margin-bottom: 4px;
    border-bottom: 1px solid var(--c-line);
}
.ranking-eyebrow { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; color: var(--c-cyan-ink); margin-bottom: 4px; }
.ranking-share {
    display: block; font-size: 44px; font-weight: 500; line-height: 1; letter-spacing: -0.06em;
    color: var(--c-cyan-ink); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ranking-context { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ranking-context .mark { font-size: 17px; font-weight: 500; align-self: flex-start; overflow-wrap: anywhere; }
.ranking-context span:not(.mark) { font-size: 12px; color: var(--c-muted); }
.ranking-list { list-style: none; margin: 0; padding: 10px 0 0; }
.ranking-row { display: flex; align-items: center; gap: 14px; padding: 8px 10px; }
.ranking-row.is-client { background: var(--c-soft); }
.ranking-rank { font-size: 11px; color: var(--c-muted); width: 22px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.ranking-row-body { flex: 1; min-width: 0; }
.ranking-row-label { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; font-size: 13px; color: var(--navy); }
.ranking-domain { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-you { color: var(--navy); background: var(--yellow); font-size: 10px; font-weight: 600; border-radius: 40px; padding: 1px 7px; }
.ranking-value { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.ranking-track { background: var(--c-line); height: 6px; border-radius: 3px; overflow: hidden; }
.ranking-track > div { height: 100%; background: var(--c-muted); border-radius: inherit; }
.is-client .ranking-track > div { background: var(--c-cyan-ink); }
.ranking-footnote { margin: 10px 10px 0; font-size: 11px; line-height: 1.6; color: var(--c-muted); }
.ranking-empty { color: var(--c-muted); padding: 12px 0; font-size: 13px; }
.chart-details { border-top: 1px solid var(--c-line); margin-top: 14px; }
.chart-details > summary { padding: 14px 0 0; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--navy); list-style: none; }
.chart-details > summary::before { content: '▸'; display: inline-block; margin-right: 8px; color: var(--c-cyan-ink); transition: transform .15s; }
.chart-details[open] > summary::before { transform: rotate(90deg); }
.chart-details[open] > summary { padding-bottom: 12px; }
.detail-hint { font-size: 12px; font-weight: 400; color: var(--c-muted); margin-left: 14px; }
.scope-note { color: var(--c-muted); font-size: 12px; line-height: 1.6; margin: -6px 0 18px; max-width: 960px; }
.chart-details .scope-note { margin: 0 0 6px; }

/* ── États explicites : chargement, indisponible, erreur + Retry ── */
.loading-placeholder { border-radius: 0; border: 0; background: transparent; }
.kpi-skeleton { justify-content: center; }
.skeleton-line { border-radius: 4px; background: var(--c-line); animation: data-pulse 1.4s ease-in-out infinite alternate; }
.skeleton-label { width: 55%; height: 10px; margin: 0 0 18px; }
.skeleton-value { width: 42%; height: 40px; margin-bottom: 14px; }
.skeleton-caption { width: 78%; height: 9px; }
@keyframes data-pulse { to { opacity: 0.35; } }
.data-notice {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 16px 20px; background: var(--c-soft); border: 1px solid var(--c-line);
    font-size: 13px; line-height: 1.5; color: var(--navy); margin-bottom: 16px;
}
.data-notice strong { display: block; font-size: 14px; font-weight: 600; }
.data-notice p { margin: 4px 0 0; color: var(--c-muted); }
.data-notice.is-error { background: #FFF6F4; border-color: rgba(242, 107, 91, 0.45); }
.data-notice details { margin-top: 8px; font-size: 11px; color: var(--c-muted); }
.data-notice summary { cursor: pointer; }
.data-notice code { display: block; margin-top: 6px; font-size: 11px; }
.data-retry {
    border: 1px solid var(--navy); background: var(--white); color: var(--navy); border-radius: 999px;
    padding: 8px 16px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; flex-shrink: 0;
}
.data-retry:hover { background: var(--navy); color: var(--white); }
.data-retry:disabled { opacity: 0.6; cursor: wait; }
#data-health-banner:empty { display: none; }
#data-health-banner .data-notice { margin: 16px 40px 0; }
#trends-feedback:not(:empty) { margin-bottom: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:where(button, summary, a):focus-visible { outline: 3px solid var(--c-cyan-ink); outline-offset: 3px; }
@media (max-width: 900px) {
    .ranking-summary { gap: 16px; }
    .ranking-share { font-size: 34px; }
    .data-notice { align-items: flex-start; flex-direction: column; gap: 12px; }
    #data-health-banner .data-notice { margin: 12px 20px 0; }
}
@media (prefers-reduced-motion: reduce) {
    .skeleton-line, .loading-spinner { animation: none; }
    .dial-needle, .chart-details > summary::before { transition: none; }
}

/* ── Admin : couverture de collecte (2026-09-09) ── */
.coverage-table { border-collapse: collapse; font-size: 13px; margin-bottom: 12px; }
.coverage-table th, .coverage-table td { padding: 6px 16px 6px 0; text-align: left; }
.coverage-table th { font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-muted); }
.coverage-table td { font-variant-numeric: tabular-nums; border-top: 1px solid var(--c-line); }
.coverage-details { margin-top: 10px; }
.coverage-details > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--navy); }
.coverage-pairs { list-style: none; margin: 8px 0 0; padding: 0; max-height: 260px; overflow-y: auto; font-size: 12.5px; }
.coverage-pairs li { padding: 3px 0; border-bottom: 1px solid var(--c-line); }
.coverage-pairs code { background: var(--c-soft); color: var(--c-cyan-ink); padding: 1px 7px; border-radius: 999px; font-size: 11px; }
