/* ============================================================
   Reson — feuille de style
   Thèmes : Lagon (turquoise profond), Spectre (gris nuit),
            Herbier (clair, vert profond & vermillon),
            Nébuleuse (aubergine, rose, turquoise & or),
            Voltage (noir neutre, jaune électrique, bleu & rose),
            Braise (bordeaux noir, cramoisi, cyan & pêche),
            Fosse (vert pétrole, ambre, rose & menthe),
            Sillage (indigo nocturne, corail & sable),
            Sérigraphie (clair, bleu électrique & rose vif)
   ============================================================ */

:root, [data-theme="lagon"] {
  --bg: #070F12;
  --surface: #0E1B1F;
  --surface2: #122228;
  --border: #1B2F35;
  --text: #D6EAEC;
  --muted: #7A979C;
  --accent: #2DD4BF;
  --accent2: #E879C6;
  --accent3: #F5A524;
  --up: #3ECF8E;
  --down: #F0616D;
  --accent-soft: rgba(45, 212, 191, .14);
  --accent2-soft: rgba(232, 121, 198, .14);
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

[data-theme="spectre"] {
  --bg: #0A0B10;
  --surface: #13151D;
  --surface2: #191C26;
  --border: #232734;
  --text: #E3E6EE;
  --muted: #8991A3;
  --accent: #8BE05A;
  --accent2: #8B7CF6;
  --accent3: #E5533D;
  --up: #8BE05A;
  --down: #E5533D;
  --accent-soft: rgba(139, 224, 90, .13);
  --accent2-soft: rgba(139, 124, 246, .15);
  --shadow: 0 8px 28px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

[data-theme="herbier"] {
  --bg: #F4F3EC;
  --surface: #FFFFFF;
  --surface2: #FAF9F3;
  --border: #DEDDD0;
  --text: #15181A;
  --muted: #66695F;
  --accent: #1F9D63;
  --accent2: #E8472B;
  --accent3: #2B6CE8;
  --up: #1F9D63;
  --down: #E8472B;
  --accent-soft: rgba(31, 157, 99, .12);
  --accent2-soft: rgba(232, 71, 43, .1);
  --shadow: 0 8px 24px rgba(60, 60, 40, .12);
  color-scheme: light;
}

[data-theme="nebuleuse"] {
  --bg: #0A0612;
  --surface: #150D24;
  --surface2: #1D1432;
  --border: #2A1B45;
  --text: #EDE3FA;
  --muted: #9A86BD;
  --accent: #FF4FA3;
  --accent2: #3DE0D0;
  --accent3: #FFD166;
  --up: #3DE0D0;
  --down: #FF4FA3;
  --accent-soft: rgba(255, 79, 163, .14);
  --accent2-soft: rgba(61, 224, 208, .14);
  --shadow: 0 8px 28px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

[data-theme="voltage"] {
  --bg: #07080A;
  --surface: #101216;
  --surface2: #171A21;
  --border: #22262D;
  --text: #F0F2F5;
  --muted: #8A93A1;
  --accent: #E8FF3A;
  --accent2: #5B8CFF;
  --accent3: #FF5D73;
  --up: #E8FF3A;
  --down: #FF5D73;
  --accent-soft: rgba(232, 255, 58, .13);
  --accent2-soft: rgba(91, 140, 255, .15);
  --shadow: 0 8px 28px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

[data-theme="braise"] {
  --bg: #12060A;
  --surface: #1F0C12;
  --surface2: #291119;
  --border: #3A1620;
  --text: #FBE6E8;
  --muted: #B58790;
  --accent: #FF3D5A;
  --accent2: #5EE6F0;
  --accent3: #FFC98B;
  --up: #5EE6F0;
  --down: #FF3D5A;
  --accent-soft: rgba(255, 61, 90, .14);
  --accent2-soft: rgba(94, 230, 240, .13);
  --shadow: 0 8px 28px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

[data-theme="fosse"] {
  --bg: #031412;
  --surface: #082421;
  --surface2: #0C2E2A;
  --border: #0F3D38;
  --text: #D8F5EF;
  --muted: #6AA89E;
  --accent: #FFB547;
  --accent2: #FF6F91;
  --accent3: #7DF9D6;
  --up: #7DF9D6;
  --down: #FF6F91;
  --accent-soft: rgba(255, 181, 71, .14);
  --accent2-soft: rgba(255, 111, 145, .14);
  --shadow: 0 8px 28px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

[data-theme="sillage"] {
  --bg: #080B1A;
  --surface: #10152B;
  --surface2: #161D38;
  --border: #1E2545;
  --text: #DDE3F7;
  --muted: #7F8AB3;
  --accent: #FF7A66;
  --accent2: #7CC4FF;
  --accent3: #F2D49B;
  --up: #3ECF8E; /* pas de vert dans la palette : vert générique lisible */
  --down: #FF7A66;
  --accent-soft: rgba(255, 122, 102, .14);
  --accent2-soft: rgba(124, 196, 255, .14);
  --shadow: 0 8px 28px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

[data-theme="serigraphie"] {
  --bg: #F3F1EA;
  --surface: #FFFFFF;
  --surface2: #F7F5EE;
  --border: #DAD6C8;
  --text: #101223;
  --muted: #626578;
  --accent: #2A3BEA;
  --accent2: #FF5C8A;
  --accent3: #F2B400;
  --up: #1F9D63;
  --down: #D94E76; /* rose de la palette assombri pour rester lisible sur fond clair */
  --warn: #9A6B00; /* l'ambre #F2B400 serait illisible en texte sur fond clair */
  --warn-soft: rgba(242, 180, 0, .16);
  --accent-soft: rgba(42, 59, 234, .1);
  --accent2-soft: rgba(255, 92, 138, .12);
  --shadow: 0 8px 24px rgba(50, 50, 70, .12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
/* Gras adouci : 600 au lieu du 700 natif des titres et des <strong>. */
h1, h2, h3, strong, b { font-weight: 600; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- Layout ---------------- */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 218px; flex: 0 0 218px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.content { flex: 1; overflow-y: auto; padding: 14px 16px 40px; }

.brand { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.brand-wave { width: 52px; height: 22px; }
.brand-wave path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.brand-wave .wave2 { stroke: var(--accent2); stroke-width: 2; opacity: .75; }
.brand-name { font-size: 15.5px; font-weight: 600; letter-spacing: .4px; }

.nav { flex: 1; overflow-y: auto; padding: 4px 8px; }
.nav-section { margin: 12px 8px 4px; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 9px; margin: 1px 0; border-radius: 7px;
  color: var(--text); cursor: pointer; border: 1px solid transparent;
  font-size: 12px;
}
.nav-item:hover { background: var(--surface2); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); border-color: var(--border); color: var(--accent); font-weight: 500; }
.nav-item .ic { width: 15px; height: 15px; flex: 0 0 15px; color: var(--accent); } /* couleur unique : l'accent du thème actif */

.sidebar-foot { border-top: 1px solid var(--border); padding: 8px; }
.user-btn {
  width: 100%; display: flex; align-items: center; gap: 8px;
  background: none; border: none; border-radius: 7px; padding: 6px 8px; cursor: pointer;
}
.user-btn:hover { background: var(--surface2); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px; flex: 0 0 26px;
}
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }

/* ---------------- Topbar ---------------- */
.topbar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar-spacer { flex: 1; }
.site-select {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 8px; font: inherit; max-width: 220px; cursor: pointer;
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 7px; padding: 6px 10px; cursor: pointer; font-size: 12.5px;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 500; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { color: var(--down); }
.btn-ghost { background: transparent; }
.btn-icon { padding: 6px 9px; font-size: 14px; line-height: 1; }
.btn-sm { padding: 3px 8px; font-size: 12px; }
.ic { width: 14px; height: 14px; }
.filter-count {
  background: var(--accent); color: var(--bg); border-radius: 9px;
  font-size: 10.5px; font-weight: 600; padding: 0 5px;
}
.range-picker { display: flex; gap: 4px; align-items: center; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; margin-right: 4px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 6px var(--up); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.popover {
  position: absolute; top: 52px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow); padding: 12px; min-width: 240px;
}
#filter-pop { left: 240px; }
#range-pop { right: 120px; }
#theme-pop { right: 16px; min-width: 230px; }
#user-pop { left: 8px; top: auto; bottom: 56px; position: fixed; }
.popover label { display: block; font-size: 11.5px; color: var(--muted); margin: 8px 0 3px; }
.popover input, .popover select {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px; padding: 6px 8px; font: inherit;
}
.popover .row { display: flex; gap: 8px; margin-top: 10px; }
.preset-list { display: flex; flex-direction: column; gap: 2px; }
.preset-list button {
  text-align: left; background: none; border: none; padding: 6px 8px;
  border-radius: 6px; cursor: pointer;
}
.preset-list button:hover { background: var(--surface2); }
.preset-list button.active { color: var(--accent); font-weight: 500; }

/* Sélecteur de thème : petite barre dégradée discrète (fond → accent → accent 2 → accent 3). */
.theme-bar {
  width: 46px; height: 7px; border-radius: 4px; flex: 0 0 auto;
  box-shadow: 0 0 0 1px var(--border); opacity: .85;
}
.theme-list { display: flex; flex-direction: column; gap: 2px; }
.theme-list button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  text-align: left; background: none; border: none; padding: 6px 8px;
  border-radius: 6px; cursor: pointer;
}
.theme-list button:hover { background: var(--surface2); }
.theme-list button.active { color: var(--accent); font-weight: 500; }
.theme-list .spacer { flex: 1; }

/* ---------------- Cartes & grilles ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 12px;
}
.card-title { font-size: 13.5px; font-weight: 500; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.card-title .spacer { flex: 1; }
.card-sub { color: var(--muted); font-size: 12px; margin: -4px 0 10px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; cursor: default; position: relative; overflow: hidden;
}
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover, .kpi.selected { border-color: var(--accent); }
.kpi-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 21px; font-weight: 600; margin: 3px 0 1px; display: flex; align-items: baseline; gap: 8px; }
.kpi-sub { font-size: 11px; color: var(--muted); }
.kpi-spark { position: absolute; right: 0; bottom: 0; left: 0; height: 26px; opacity: .8; }
.delta { font-size: 11.5px; font-weight: 500; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.badge { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 8px; }
.badge.good { color: var(--up); background: var(--accent-soft); }
.badge.warn { color: var(--warn, var(--accent3)); background: var(--warn-soft, rgba(245, 165, 36, .13)); }
.badge.bad { color: var(--down); background: rgba(240, 97, 109, .12); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr; } }

.chart-wrap { position: relative; height: 300px; }
.chart-wrap.tall { height: 380px; }
.chart-wrap.short { height: 200px; }

/* ---------------- Tables ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left; color: var(--muted); font-weight: 500; font-size: 11.5px;
  padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.num { text-align: right; }
.bar-cell { position: relative; min-width: 120px; }
.bar-fill { position: absolute; inset: 3px auto 3px 0; background: var(--accent-soft); border-radius: 4px; }
.bar-text { position: relative; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 8px; flex-wrap: wrap; }
.tab {
  background: none; border: none; padding: 6px 10px; cursor: pointer;
  color: var(--muted); border-bottom: 2px solid transparent; font-size: 12.5px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); font-weight: 500; border-bottom-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.seg button { background: transparent; border: none; padding: 5px 10px; cursor: pointer; color: var(--muted); font-size: 12px; }
.seg button.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar .spacer { flex: 1; }
.search-input {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 7px; padding: 6px 10px; font: inherit; min-width: 220px;
}
/* Ligne avec case à cocher (comparaison de périodes, activation des alertes) */
.check-line { display: flex; align-items: center; gap: 8px; padding: 7px 4px 2px; font-size: 12.5px; color: var(--text); cursor: pointer; user-select: none; }
.check-line input { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; margin: 0; }

/* ---------------- Sparklines & divers ---------------- */
.spark { display: inline-block; vertical-align: middle; }
.spark rect { fill: var(--accent2); opacity: .8; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.empty .big { font-size: 30px; margin-bottom: 8px; }
.loading { text-align: center; color: var(--muted); padding: 50px 0; }
.loading::after { content: "…"; animation: pulse 1.2s infinite; }
.mono { font-family: "Cascadia Code", "JetBrains Mono", Consolas, monospace; font-size: 12px; }
.code-block {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-family: Consolas, monospace; font-size: 12px;
  overflow-x: auto; white-space: pre; color: var(--accent);
}
.muted { color: var(--muted); }
/* Drapeaux en image (flagcdn) : les emojis drapeaux ne sont pas rendus par Windows. */
.flag-img {
  display: inline-block; width: 20px; height: 15px; margin-right: 6px;
  border-radius: 2px; object-fit: cover; vertical-align: -2px;
  box-shadow: 0 0 0 1px var(--border); background: var(--bg-input);
}
.flag-none { background: var(--border); }

/* Sankey parcours */
.sankey-wrap { overflow-x: auto; }
.sankey-node-label { font-size: 11.5px; fill: var(--text); }
.sankey-step-label { font-size: 12px; font-weight: 500; fill: var(--muted); }

/* Rétention */
.retention-table td.cell { text-align: center; border-radius: 4px; font-variant-numeric: tabular-nums; }
.retention-table td.na { color: var(--muted); background: repeating-linear-gradient(45deg, transparent, transparent 4px, var(--surface2) 4px, var(--surface2) 8px); }

/* Globe */
#globe-map { height: 560px; border-radius: 10px; background: var(--bg); }
.leaflet-container { background: var(--bg) !important; font: inherit !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface) !important; color: var(--text) !important; }
.reson-marker {
  background: var(--accent); color: var(--bg); border-radius: 12px;
  font-weight: 600; font-size: 11px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg); box-shadow: 0 0 10px var(--accent-soft);
}
.globe-wrap { position: relative; height: 560px; border-radius: 10px; overflow: hidden; background: var(--bg); }
#globe-view { position: absolute; inset: 0; }
#globe-view canvas { display: block; }
.globe-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.globe-seg button { background: transparent; border: none; padding: 5px 12px; cursor: pointer; color: var(--muted); font-size: 12px; }
.globe-seg button.active { background: var(--accent); color: var(--bg); font-weight: 500; }
.globe-bar {
  position: absolute; left: 10px; bottom: 10px; z-index: 500;
  display: flex; gap: 4px; padding: 4px;
  background: rgba(15, 23, 42, .72); backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: 10px;
}
.globe-bar button {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: none; border-radius: 7px;
  padding: 5px 9px; cursor: pointer; color: #cbd5e1; font-size: 12px;
}
.globe-bar button:hover { background: rgba(148, 163, 184, .18); }
.globe-bar button.active { background: var(--accent); color: var(--bg); font-weight: 500; }
.globe-chrono {
  position: absolute; left: 10px; right: 10px; bottom: 52px; z-index: 500;
  display: flex; align-items: center; gap: 10px; padding: 6px 10px;
  background: rgba(15, 23, 42, .72); backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: 10px;
}
.globe-chrono input[type="range"] { flex: 1; accent-color: var(--accent); cursor: pointer; }
.globe-chrono .mono { color: #cbd5e1; white-space: nowrap; }
.globe-chrono #chrono-play { background: rgba(148, 163, 184, .15); border-color: transparent; color: #cbd5e1; }
.globe-tip {
  background: rgba(15, 23, 42, .9); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 9px; font-size: 12px; color: #e2e8f0;
}
/* Sélecteur de type de globe (Standard satellite / Standard / Plein air / Nightwatch) */
.globe-style {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 7px;
  padding: 5px 8px; font: inherit; font-size: 12px; cursor: pointer;
}

/* Blocage */
.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; max-height: 420px; overflow-y: auto; padding: 4px; }
.country-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 9px;
  border: 1px solid var(--border); border-radius: 7px; cursor: pointer; user-select: none;
}
.country-item:hover { background: var(--surface2); }
.country-item.blocked { border-color: var(--down); background: rgba(240, 97, 109, .08); }
.country-item input { accent-color: var(--down); }

/* Entonnoirs */
.funnel-step { display: flex; gap: 12px; align-items: flex-start; margin: 10px 0; }
.funnel-step-num {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 24px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.funnel-bar-track { flex: 1; background: var(--surface2); border-radius: 6px; height: 26px; position: relative; overflow: hidden; }
.funnel-bar { height: 100%; background: var(--accent2); opacity: .75; border-radius: 6px; }
.funnel-bar-label { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 10px; font-size: 12px; font-weight: 500; }
.funnel-meta { width: 130px; text-align: right; font-size: 12px; }

/* ---------------- Auth ---------------- */
.auth-root {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, var(--accent-soft), transparent),
    var(--bg);
}
.auth-card {
  width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px; box-shadow: var(--shadow);
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 18px; }
.auth-brand svg { width: 130px; height: 44px; }
.auth-brand path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.auth-brand .wave2 { stroke: var(--accent2); stroke-width: 2; opacity: .75; }
.auth-brand h1 { margin: 0; font-size: 22px; letter-spacing: .5px; }
.auth-card h2 { font-size: 15px; margin: 0 0 4px; }
.auth-card p.sub { color: var(--muted); font-size: 12.5px; margin: 0 0 16px; }
.auth-card label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
.auth-card input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: 7px; padding: 8px 10px; font: inherit;
}
.auth-card input:focus { outline: none; border-color: var(--accent); }
.auth-card .btn-primary { width: 100%; justify-content: center; margin-top: 16px; padding: 9px; }
.auth-error { color: var(--down); font-size: 12.5px; margin-top: 10px; min-height: 16px; }
.auth-switch { text-align: center; margin-top: 14px; font-size: 12.5px; color: var(--muted); }

/* ---------------- SEO & Sessions ---------------- */
/* Tendances horaires : mini-histogramme 24 h (heure locale des visiteurs) */
.hour-strip { display: inline-flex; align-items: flex-end; gap: 1px; height: 22px; width: 150px; vertical-align: middle; }
.hour-strip i { flex: 1 1 0; min-height: 1px; background: var(--accent); opacity: .7; border-radius: 1px; }
.src-row { display: flex; align-items: center; gap: 10px; padding: 5px 2px; }
.src-name { flex: 0 0 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.src-bar { flex: 1; height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.src-bar span { display: block; height: 100%; background: var(--accent); opacity: .75; border-radius: 4px; }
.src-n { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 500; }
.sess-row { cursor: pointer; }
.sess-detail { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 1100px) { .sess-detail { grid-template-columns: 1fr; } }
.sess-side { display: flex; flex-direction: column; gap: 12px; }
.sess-side .card { margin-bottom: 0; }
.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.info-row:last-child { border-bottom: none; }
.info-row span:last-child { text-align: right; overflow: hidden; text-overflow: ellipsis; }
.tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.tl-item::before { content: ""; position: absolute; left: 12px; top: 26px; bottom: 0; width: 1px; background: var(--border); }
.tl-item:last-child::before, .tl-end::before { display: none; }
.tl-num {
  width: 25px; height: 25px; border-radius: 50%; flex: 0 0 25px; z-index: 1;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600;
}
.tl-end .tl-num { background: var(--surface2); color: var(--muted); }
.tl-body { flex: 1; min-width: 0; }
.tl-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.tl-path { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-time { font-size: 11.5px; white-space: nowrap; }
.tl-title { font-size: 11.5px; margin: 1px 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-meta { display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); margin: 3px 0; }
.tl-ev { font-size: 12px; padding: 2px 0 2px 8px; border-left: 2px solid var(--accent2); margin: 3px 0; }
.tl-ev.err { border-left-color: var(--down); color: var(--down); }
.tl-props { margin-top: 4px; font-size: 11.5px; }
.tl-props summary { cursor: pointer; color: var(--muted); }
.tl-props div { background: var(--surface2); border-radius: 6px; padding: 6px 8px; margin-top: 4px; overflow-x: auto; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--accent); color: var(--text);
  border-radius: 9px; padding: 9px 16px; z-index: 100; box-shadow: var(--shadow);
  font-size: 13px;
}

@media (max-width: 860px) {
  .sidebar { width: 56px; flex-basis: 56px; }
  .brand-name, .nav-item span, .nav-section, .user-name { display: none; }
  .nav-item { justify-content: center; }
  #filter-pop { left: 60px; }
}