/* =========================================================================
   ArteDATA — Design system (portail Symfony)
   Repris de la maquette « Audiences numériques ». Tokens + chrome +
   composants, avec un pont vers Bootstrap 5.3 pour les widgets pilotés
   par le JS Bootstrap (dropdown, modal, collapse, tooltip).
   Light / dark via [data-theme] (et data-bs-theme aligné pour le JS).
   ========================================================================= */

@font-face {
  font-family: "Barna";
  src: url("../fonts/barna.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  /* ARTE brand */
  --arte-orange: #f07d00;
  --arte-orange-tint: rgba(240, 125, 0, 0.12);
  --arte-red: #e8330f;
  --arte-red-bright: #ef7d33;   /* accent principal (onglet actif, boutons) */
  --wm-arte: #fa471d;           /* orange du wordmark arteDATA */

  /* Type */
  --font-ui: "Barna", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Fira Code", "Consolas", ui-monospace, SFMono-Regular, Menlo, monospace;

  --fs-xxs: 0.69rem;
  --fs-xs: 0.75rem;
  --fs-sm: 0.82rem;
  --fs-base: 0.9rem;
  --fs-md: 1rem;
  --fs-lg: 1.15rem;
  --fs-kpi: 2.6rem;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  --gap-xs: 0.35rem;
  --gap-sm: 0.55rem;
  --gap-md: 0.85rem;
  --gap-lg: 1.25rem;
  --gap-xl: 2rem;

  --header-h: 56px;
  --subbar-h: 52px;

  /* Palette catégorielle (types de rapport / séries) */
  --c-fr: #2d8fe0;
  --c-de: #18b899;
  --c-en: #7c5cd6;
  --c-es: #f5b614;
  --c-it: #57c071;
}

/* ---------------- DARK (défaut) --------------------------------------- */
:root,
[data-theme="dark"] {
  --bg: #0e0e11;
  --bg-elev: #16161a;
  --panel: #1b1c20;
  --panel-2: #232429;
  --panel-hover: #2a2b31;
  --border: #2d2e35;
  --border-soft: #232429;
  --text: #f3f3f5;
  --text-2: #c4c5cc;
  --text-muted: #8b8d97;
  --text-faint: #62646e;
  --grid: rgba(255, 255, 255, 0.06);
  --grid-strong: rgba(255, 255, 255, 0.12);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --chip-bg: #26272d;
  --chip-border: #34353d;
  --pos: #34d399;
  --neg: #ff4d4f;
  --warn: #f5b614;
  --info: #2d8fe0;
  --wm-data: #dcdcdc;
  --wm-tag: #8b8d97;
}

/* ---------------- LIGHT ----------------------------------------------- */
[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-elev: #eceef1;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --panel-hover: #f0f1f4;
  --border: #e2e5ea;
  --border-soft: #eef0f3;
  --text: #16171b;
  --text-2: #3d4049;
  --text-muted: #6b7280;
  --text-faint: #9aa0a6;
  --grid: rgba(0, 0, 0, 0.06);
  --grid-strong: rgba(0, 0, 0, 0.12);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.10);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.10);
  --chip-bg: #f1f3f6;
  --chip-border: #dfe3e9;
  --pos: #16a34a;
  --neg: #dc2626;
  --warn: #d97706;
  --info: #2563eb;
  --wm-data: #16171b;
  --wm-tag: #6b7280;
}

/* =========================================================================
   Pont Bootstrap : les composants BS résiduels héritent des tokens ADS
   ========================================================================= */
:root {
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-body-font-family: var(--font-ui);
  --bs-primary: var(--arte-red-bright);
  --bs-primary-rgb: 239, 125, 51;
  --bs-secondary-bg: var(--panel-2);
  --bs-border-color: var(--border);
  --bs-emphasis-color: var(--text);
  --bs-tertiary-bg: var(--bg-elev);
  --bs-link-color: var(--arte-red-bright);
  --bs-link-hover-color: var(--arte-red);
}
[data-bs-theme] {
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-emphasis-color: var(--text);
}

/* =========================================================================
   Base
   ========================================================================= */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--arte-red-bright); text-decoration: none; }
a:hover { color: var(--arte-red); }
button { font-family: inherit; cursor: pointer; }
::selection { background: rgba(244, 80, 30, 0.28); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border); border-radius: var(--r-pill);
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: content-box; }

/* Shell applicatif : header fixe + zone scrollable */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.app-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.scroll { flex: 1; overflow-y: auto; min-height: 0; }
.page { padding: 1.4rem 2rem 2.5rem; width: 100%; }
/* Pas de marge haute superflue sur le premier bloc (ex. .section-title) : le seul
   espace au-dessus reste le padding de .page. */
.page > :first-child,
.page > :first-child.section-title { margin-top: 0; }

/* =========================================================================
   Topbar (header)
   ========================================================================= */
.topbar {
  height: var(--header-h); flex-shrink: 0; position: sticky; top: 0; z-index: 1030;
  display: flex; align-items: center; gap: var(--gap-lg);
  padding: 0 1.1rem;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.wordmark { display: flex; align-items: center; gap: 0.5rem; line-height: 1; text-decoration: none; }
.wm-img { height: 36px; width: auto; display: block; }
/* Logo par thème : variante claire (fond clair) / sombre (fond sombre) */
.wm-img-light { display: none; }
[data-theme="light"] .wm-img-dark { display: none; }
[data-theme="light"] .wm-img-light { display: block; }
.wm-text { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.wm-text .wm-a { color: var(--wm-arte); }
.wm-text .wm-d { color: var(--wm-data); }

.topnav { display: flex; gap: 0.3rem; align-items: stretch; height: 100%; }
.topnav a {
  display: inline-flex; align-items: center;
  font-size: var(--fs-base); font-weight: 600; color: var(--text); white-space: nowrap;
  text-decoration: none; padding: 0 0.7rem;
  border-bottom: 2.5px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.topnav a:hover { background: var(--panel-hover); color: var(--text); }
.topnav a.current { color: var(--arte-red-bright); font-weight: 700; border-bottom-color: var(--arte-red-bright); }
.topnav a.current:hover { background: transparent; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; min-width: 0; }

.tb-item { display: flex; align-items: center; gap: 0.45rem; font-size: var(--fs-base); font-weight: 500;
  color: var(--text); background: transparent; border: none; padding: 0.35rem 0.5rem; border-radius: var(--r-sm); }
.tb-item:hover { background: var(--panel-hover); color: var(--text); }
.tb-item .chev { color: var(--text-muted); font-size: 0.7rem; }
.tb-item.user { font-weight: 600; }
.avatar { width: 30px; height: 30px; border-radius: var(--r-pill); overflow: hidden; display: grid; place-items: center; flex-shrink: 0;
  background: var(--panel-2); color: var(--text-2); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 992px) { .topnav { display: none; } }
@media (max-width: 640px) { .tb-item .tb-label { display: none; } }

/* burger (mobile) */
.tb-burger { display: none; background: transparent; border: none; color: var(--text); font-size: 1.1rem; padding: 0.4rem 0.55rem; border-radius: var(--r-sm); }
.tb-burger:hover { background: var(--panel-hover); }
@media (max-width: 992px) { .tb-burger { display: inline-flex; } }

/* =========================================================================
   Sub-bar (viewer : fil d'ariane + actions)
   ========================================================================= */
.subbar {
  flex-shrink: 0; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.5rem 1.25rem; border-bottom: 1px solid var(--border-soft); background: var(--bg);
}
.subbar-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.crumb { display: flex; align-items: center; gap: 0.4rem; font-size: var(--fs-sm); color: var(--text-muted); flex-wrap: wrap; }
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--text); }
.crumb .sep { opacity: 0.5; }
.crumb-active { color: var(--text); font-weight: 600; }

/* =========================================================================
   Page head
   ========================================================================= */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.page-head > div:first-child { flex: 1 1 360px; min-width: 0; }
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; color: var(--text); }
.page-sub { margin: 0.25rem 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.section-title { font-size: var(--fs-lg); font-weight: 700; margin: 2rem 0 1rem; color: var(--text);
  display: flex; align-items: center; gap: 0.6rem; }
.section-title .muted { font-weight: 500; color: var(--text-muted); font-size: var(--fs-base); }

/* =========================================================================
   Onglets de page (façon maquette : .pagenav)
   ========================================================================= */
.pagenav { display: flex; align-items: stretch; gap: 0.2rem; margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--border); overflow-x: auto; }
.pagenav-items { display: flex; align-items: stretch; gap: 0.2rem; }

/* Barre supérieure de page : onglets (ou fil d'ariane) à gauche + version à droite */
.pagebar { display: flex; align-items: stretch; justify-content: space-between; gap: 1rem; padding: 0 1.25rem; flex-wrap: nowrap; min-height: 46px; }
.pagebar-nav { display: flex; align-items: stretch; min-width: 0; overflow-x: auto; }
.pagebar-nav .crumb { align-items: center; }
.pagebar-version { display: inline-flex; align-items: center; gap: 0.35rem; flex-shrink: 0;
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pagebar-version i { opacity: 0.7; }

.pagenav-item { position: relative; border: none; background: transparent; color: var(--text-2);
  font-size: var(--fs-base); font-weight: 600; white-space: nowrap;
  padding: 0.8rem 1.05rem; border-bottom: 2.5px solid transparent;
  transition: color .14s, border-color .14s; }
.pagenav-item:hover { color: var(--text); }
.pagenav-item.active { color: var(--arte-red-bright); border-bottom-color: var(--arte-red-bright); }

/* =========================================================================
   Cards
   ========================================================================= */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm); color: var(--text);
}
.card-body { padding: 1.2rem 1.3rem; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.card-title { font-size: var(--fs-lg); font-weight: 700; margin: 0; color: var(--text); }
.card-sub { margin: 0.2rem 0 0; font-size: var(--fs-xs); color: var(--text-muted); }

/* Grille de cartes rapport */
.report-grid { display: grid; gap: var(--gap-lg);
  grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1400px) { .report-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .report-grid { grid-template-columns: 1fr; } }

/* Variante home : 4 cartes/ligne (grand écran) → 3 → 2 → 1 */
.report-grid-home { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1400px) { .report-grid-home { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .report-grid-home { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .report-grid-home { grid-template-columns: 1fr; } }
.report-card {
  display: flex; flex-direction: column; height: 100%;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md);
  overflow: hidden; box-shadow: var(--shadow-sm); text-decoration: none; color: var(--text);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.report-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--text-faint); color: var(--text); }
.report-card .rc-media { aspect-ratio: 16 / 9; background: var(--bg-elev); overflow: hidden; display: block; }
.report-card .rc-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Image selon le thème : sombre par défaut, claire si data-theme=light */
.report-card .rc-img-light { display: none; }
[data-theme="light"] .report-card .rc-img-dark  { display: none; }
[data-theme="light"] .report-card .rc-img-light { display: block; }
.report-card .rc-body { padding: 0.85rem 1rem; flex: 1; }
.report-card .rc-title { font-size: var(--fs-md); font-weight: 700; color: var(--text); line-height: 1.25; }
.report-card .rc-text { margin-top: 0.5rem; font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.45; }
.report-card .rc-text hr { border: 0; border-top: 1px solid var(--border-soft); margin: 0.55rem 0; }
.report-card .rc-foot { display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 1rem; border-top: 1px solid var(--border-soft); }
.report-card .rc-foot img { height: 18px; width: auto; opacity: 0.9; }

/* Étoile favori */
.fav-star { color: var(--arte-red-bright); font-size: 1rem; cursor: pointer; background: none; border: none; padding: 0.2rem; line-height: 1; }
.fav-star:hover { color: var(--arte-red); }

/* Release notes : une carte indépendante par note */
.rn-list { display: flex; flex-direction: column; gap: var(--gap-lg); }
.rn-card { border-left: 3px solid var(--info); }
.rn-card .card-body { padding: 1.15rem 1.35rem; }
.rn-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.55rem; flex-wrap: wrap; }
.rn-title { font-size: var(--fs-lg); font-weight: 700; margin: 0; color: var(--text); }
.rn-date { display: inline-flex; align-items: center; gap: 0.3rem; flex-shrink: 0; font-size: var(--fs-xs); font-weight: 600;
  color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rn-desc { color: var(--text-2); font-size: var(--fs-base); line-height: 1.55; }
.rn-desc p:last-child { margin-bottom: 0; }
.rn-foot { margin-top: 1rem; padding-top: 0.85rem; border-top: 1px solid var(--border-soft); }

/* Carte « tuile action » (Tous les rapports) */
.tile-action { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 160px;
  border: 1px dashed var(--border); border-radius: var(--r-md); background: var(--panel-2); }

/* Groupes de la section « Rapports à la une » (accueil) */
.home-group + .home-group { margin-top: 1.6rem; }
.tab-pane > .home-group:first-child .section-title { margin-top: 0.4rem; }

/* Dernière carte d'un groupe : accès à tous les rapports du groupe */
.report-card.rc-all { align-items: center; justify-content: center; text-align: center;
  border-style: dashed; background: var(--panel-2); color: var(--text-2); }
.report-card.rc-all:hover { color: var(--text); }
.report-card.rc-all .rc-all-inner { display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1rem; font-size: var(--fs-sm); font-weight: 600; }
.report-card.rc-all .rc-all-inner i { font-size: 1.4rem; color: var(--arte-red-bright); }

/* =========================================================================
   Boutons
   ========================================================================= */
.ads-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  font-family: inherit; font-size: var(--fs-sm); font-weight: 600; line-height: 1.2;
  padding: 0.55rem 1rem; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--panel); color: var(--text-2); text-decoration: none; white-space: nowrap;
  transition: background .14s, border-color .14s, color .14s, transform .05s;
}
.ads-btn:hover { border-color: var(--text-faint); color: var(--text); background: var(--panel-hover); }
.ads-btn:active { transform: translateY(1px); }
.ads-btn.sm { padding: 0.4rem 0.7rem; font-size: var(--fs-xs); }
/* Un seul design de bouton : neutre, bordé, sans fond de couleur.
   Les variantes historiques retombent toutes sur le style de base. */
.ads-btn-primary, .ads-btn-success, .ads-btn-ghost, .ads-btn-danger { }

/* Bouton bascule thème (icône + libellé, bordé — comme la maquette) */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem; flex-shrink: 0; white-space: nowrap;
  font-family: inherit; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2);
  border: 1px solid var(--border); background: var(--panel);
  border-radius: var(--r-sm); padding: 0.4rem 0.7rem;
  transition: background .14s, border-color .14s, color .14s;
}
.theme-toggle:hover { border-color: var(--text-faint); color: var(--text); background: var(--panel-hover); }
.theme-toggle .tt-dark, .theme-toggle .tt-light { display: inline-flex; align-items: center; gap: 0.4rem; }
/* Libellé de l'action : « clair » en mode sombre, « sombre » en mode clair */
.theme-toggle .tt-light { display: none; }
[data-theme="light"] .theme-toggle .tt-dark { display: none; }
[data-theme="light"] .theme-toggle .tt-light { display: inline-flex; }
.theme-toggle-fixed { position: fixed; top: 14px; right: 16px; z-index: 1040; }
@media (max-width: 640px) { .theme-toggle .tt-txt { display: none; } }

/* =========================================================================
   Chips
   ========================================================================= */
.chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.6rem; background: var(--chip-bg);
  border: 1px solid var(--chip-border); border-radius: var(--r-pill); color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; }
.src-badge { font-size: var(--fs-xs); color: var(--text-2); background: var(--chip-bg); border: 1px solid var(--chip-border);
  padding: 0.15rem 0.55rem; border-radius: var(--r-xs); display: inline-block; }

/* =========================================================================
   Alerts (callouts)
   ========================================================================= */
.ads-alert { position: relative; border: 1px solid var(--border); background: var(--panel);
  border-left: 3px solid var(--text-faint); border-radius: var(--r-md); padding: 1rem 1.15rem; color: var(--text); }
.ads-alert p { margin: 0 0 0.6rem; font-size: var(--fs-base); }
.ads-alert p:last-child { margin-bottom: 0; }
.ads-alert hr { border: 0; border-top: 1px solid var(--border-soft); margin: 0.9rem 0; }
.ads-alert.info { border-left-color: var(--info); }
.ads-alert.warn { border-left-color: var(--warn); }
.ads-alert.danger { border-left-color: var(--neg); }
.ads-alert.success { border-left-color: var(--pos); }
.ads-alert-title { font-weight: 700; margin: 0 0 0.5rem; color: var(--text); }

/* =========================================================================
   Formulaires (inclut le pont Bootstrap .form-select / .form-control)
   ========================================================================= */
.form-label { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-bottom: 0.35rem; }
.ads-select, .form-select, .form-control {
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text);
  font-size: var(--fs-base); font-weight: 500; border-radius: var(--r-sm); padding: 0.5rem 0.75rem;
}
.form-select { font-weight: 600; }
.ads-select:hover, .form-select:hover, .form-control:hover { border-color: var(--text-faint); }
.ads-select:focus, .form-select:focus, .form-control:focus {
  border-color: var(--arte-red-bright); outline: none; box-shadow: 0 0 0 3px rgba(239, 125, 51, 0.18); background: var(--bg-elev); color: var(--text);
}
.form-control::placeholder { color: var(--text-muted); }
.form-select option { background: var(--panel); color: var(--text); }

/* =========================================================================
   Segmented / toggles
   ========================================================================= */
.seg { display: inline-flex; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px; gap: 2px; }
.seg-btn { padding: 0.4rem 0.8rem; border: none; background: transparent; color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; border-radius: calc(var(--r-sm) - 2px); }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--arte-red-bright); color: #fff; }

/* =========================================================================
   Tables
   ========================================================================= */
.dtable { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.dtable th { text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted);
  font-weight: 600; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border); }
.dtable td { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border-soft); color: var(--text); vertical-align: top; }
.dtable tbody tr:hover { background: var(--panel-hover); }
.dtable .num { text-align: right; font-variant-numeric: tabular-nums; }
.dtable .type-logo { max-height: 16px; max-width: 20px; width: auto; object-fit: contain; display: block; }

/* =========================================================================
   KPI (dashboard admin)
   ========================================================================= */
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-sm); height: 100%; }
.kpi-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-value { font-size: var(--fs-kpi); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; margin: 0.5rem 0 0; font-variant-numeric: tabular-nums; color: var(--text); }

/* =========================================================================
   Login
   ========================================================================= */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card { width: min(760px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow); overflow: hidden; }
.auth-body { padding: 2.5rem 2.2rem; text-align: center; }
.auth-brand { margin-bottom: 1.6rem; }
.auth-brand .wm-img { height: 60px; margin: 0 auto; }
.auth-brand .wm-text { font-size: 2rem; }
.auth-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: center; }
.auth-intro { text-align: left; color: var(--text-2); font-size: var(--fs-base); line-height: 1.55; border-right: 1px solid var(--border-soft); padding-right: 1.5rem; }
.auth-foot { border-top: 1px solid var(--border-soft); padding: 0.9rem 1.5rem; display: flex; align-items: center; gap: 0.5rem; justify-content: flex-start; }
@media (max-width: 640px) {
  .auth-cols { grid-template-columns: 1fr; }
  .auth-intro { display: none; }
}

/* =========================================================================
   Page centrée (erreurs)
   ========================================================================= */
.centered-page { min-height: calc(100vh - var(--header-h)); display: flex; align-items: center; justify-content: center; padding: 2rem; }
.error-card { max-width: 520px; text-align: center; }
.error-code { font-size: 5rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--arte-red-bright); margin-bottom: 0.5rem; }
.error-title { font-size: 1.4rem; font-weight: 700; margin: 0 0 0.6rem; color: var(--text); }
.error-desc { color: var(--text-muted); margin-bottom: 1.5rem; }

/* =========================================================================
   Viewer rapport
   ========================================================================= */
.report-container { position: relative; width: 100%; height: calc(100vh - var(--header-h) - var(--subbar-h)); }
.report-container iframe { width: 100%; height: 100%; border: 0; }

/* Overlay de chargement affiché pendant l'application d'un thème Power BI */
.report-theme-loader { display: none; position: absolute; inset: 0; z-index: 10;
  align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(4px); }
.report-theme-loader.is-visible { display: flex; animation: rtl-fade 0.15s ease-out; }
/* Encart central bien visible (carte + ombre) */
.report-theme-loader .rtl-inner { display: flex; flex-direction: column; align-items: center; gap: 1.3rem;
  padding: 2.4rem 3rem; border-radius: var(--r-lg, 16px);
  background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow-lg, 0 20px 50px rgba(0,0,0,0.35)); }
.report-theme-loader .rtl-spinner { width: 68px; height: 68px; border-radius: 50%;
  border: 6px solid color-mix(in srgb, var(--arte-red-bright) 22%, transparent);
  border-top-color: var(--arte-red-bright);
  animation: rtl-spin 0.7s linear infinite; }
.report-theme-loader .rtl-label { font-size: var(--fs-md, 1rem); font-weight: 700; letter-spacing: 0.01em;
  color: var(--text); text-align: center; }
@keyframes rtl-spin { to { transform: rotate(360deg); } }
@keyframes rtl-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .report-theme-loader .rtl-spinner { animation-duration: 2s; }
  .report-theme-loader.is-visible { animation: none; }
}

/* =========================================================================
   Bootstrap : ré-habillage des widgets pilotés par le JS BS
   ========================================================================= */
/* Dropdown */
.dropdown-menu {
  --bs-dropdown-bg: var(--panel);
  --bs-dropdown-border-color: var(--border);
  --bs-dropdown-color: var(--text);
  --bs-dropdown-link-color: var(--text-2);
  --bs-dropdown-link-hover-color: var(--text);
  --bs-dropdown-link-hover-bg: var(--panel-hover);
  --bs-dropdown-link-active-bg: var(--panel-hover);
  --bs-dropdown-link-active-color: var(--text);
  border-radius: var(--r-md); box-shadow: var(--shadow); padding: 0.3rem;
}
.dropdown-menu .dropdown-item { border-radius: var(--r-sm); font-size: var(--fs-base); padding: 0.5rem 0.7rem; }
.dropdown-menu hr, .dropdown-divider { border-color: var(--border-soft); }

/* Modal */
.modal-content { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text); box-shadow: var(--shadow); }
.modal-header, .modal-footer { border-color: var(--border-soft); }
.modal-title { font-weight: 700; }
.btn-close { filter: var(--btn-close-filter, none); }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }

/* Tooltip */
.tooltip { --bs-tooltip-bg: var(--panel-2); --bs-tooltip-color: var(--text); --bs-tooltip-opacity: 1; font-size: var(--fs-xs); }
.tooltip .tooltip-inner { border: 1px solid var(--border); box-shadow: var(--shadow-sm); border-radius: var(--r-sm); }

/* Bootstrap .btn résiduels (ex. dans les modales) → design neutre unifié, sans fond orange */
.btn-primary, .btn-outline-secondary, .btn-secondary {
  --bs-btn-bg: var(--panel); --bs-btn-border-color: var(--border); --bs-btn-color: var(--text-2);
  --bs-btn-hover-bg: var(--panel-hover); --bs-btn-hover-color: var(--text); --bs-btn-hover-border-color: var(--text-faint);
  --bs-btn-active-bg: var(--panel-hover); --bs-btn-active-color: var(--text); --bs-btn-active-border-color: var(--text-faint); }

/* Utilitaires */
.text-arte { color: var(--arte-red-bright) !important; }
.muted { color: var(--text-muted); }
.divider { border: 0; border-top: 1px solid var(--border-soft); margin: 1.5rem 0; }

/* =========================================================================
   COMPAT Bootstrap — front sans bootstrap.css (on ne charge que bootstrap.min.js)
   Fournit les utilitaires utilisés + l'affichage des composants pilotés par le
   JS Bootstrap (dropdown, onglets, modale, tooltip). bootstrap.min.js se contente
   de basculer les classes (.show/.active) : le rendu vient d'ici.
   ========================================================================= */

/* --- Utilitaires de layout --- */
.d-flex { display: flex !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.align-items-center { align-items: center !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.flex-grow-1 { flex: 1 1 auto !important; }
.text-start { text-align: left !important; }
.text-center { text-align: center !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.h-100 { height: 100% !important; }
.w-100 { width: 100% !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.m-4 { margin: 1.5rem !important; }
.p-0 { padding: 0 !important; }

/* --- Grille (subset) --- */
.row { display: flex; flex-wrap: wrap; }
.row.g-4 { gap: 1.5rem; }
.col, .col-12, [class*="col-md-"] { flex: 1 1 100%; max-width: 100%; }
@media (min-width: 768px) {
  .col-md-6 { flex: 1 1 calc(50% - 0.75rem); max-width: calc(50% - 0.75rem); }
}

/* --- Ratio (iframe PDF) --- */
.ratio { position: relative; width: 100%; }
.ratio::before { content: ""; display: block; padding-top: 100%; }
.ratio-16x9::before { padding-top: 56.25%; }
.ratio > * { position: absolute; inset: 0; width: 100%; height: 100%; }

/* --- Boutons Bootstrap résiduels (modales) : look neutre ADS, sans orange --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font-family: inherit; font-size: var(--fs-sm); font-weight: 600; line-height: 1.2;
  padding: 0.55rem 1rem; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--panel); color: var(--text-2); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--text-faint); color: var(--text); background: var(--panel-hover); }
.btn-primary, .btn-secondary { background: var(--panel); border-color: var(--border); color: var(--text-2); }
.btn-primary:hover, .btn-secondary:hover { background: var(--panel-hover); border-color: var(--text-faint); color: var(--text); }
.btn-outline-secondary { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-outline-secondary:hover { background: var(--panel-hover); border-color: var(--text-faint); color: var(--text); }
.btn-close { border: 0; background: transparent; color: var(--text-2); font-size: 1.1rem; line-height: 1; padding: 0.35rem 0.5rem; cursor: pointer; border-radius: var(--r-xs); }
.btn-close::before { content: "\00d7"; display: block; }
.btn-close:hover { color: var(--text); background: var(--panel-hover); }

/* --- Dropdown (positionné par Popper via styles inline ; ici : affichage + look) --- */
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; z-index: 1000; min-width: 12rem;
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow); padding: 0.3rem; margin: 0; list-style: none; }
.dropdown-menu.show { display: block; }
.dropdown-menu-end { right: 0; left: auto; }
.dropdown-item { display: flex; align-items: center; width: 100%; text-align: left;
  padding: 0.5rem 0.7rem; border: 0; background: transparent; color: var(--text-2);
  font-size: var(--fs-base); border-radius: var(--r-sm); text-decoration: none; white-space: nowrap; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--panel-hover); color: var(--text); }
.dropdown-divider { height: 0; margin: 0.3rem 0; border: 0; border-top: 1px solid var(--border-soft); }

/* --- Onglets --- */
.tab-content > .tab-pane { display: none; }
.tab-content > .tab-pane.active { display: block; }

/* --- Alertes résiduelles --- */
.alert { border: 1px solid var(--border); background: var(--panel); border-radius: var(--r-md); padding: 1rem 1.15rem; color: var(--text); }
.alert-warning { border-left: 3px solid var(--warn); }
.alert-danger { border-left: 3px solid var(--neg); }
.alert-success { border-left: 3px solid var(--pos); }
.alert-info { border-left: 3px solid var(--info); }
.alert-secondary { border-left: 3px solid var(--text-faint); }

/* --- Modale (bootstrap.min.js pose display:block en inline + ajoute .modal-backdrop) --- */
.modal { position: fixed; inset: 0; z-index: 1055; display: none; width: 100%; height: 100%; overflow-x: hidden; overflow-y: auto; outline: 0; }
.modal-dialog { position: relative; width: auto; margin: 1.75rem auto; max-width: 500px; pointer-events: none; }
.modal-xl { max-width: 800px; }
@media (min-width: 1200px) { .modal-xl { max-width: 1140px; } }
.modal-dialog-centered { display: flex; align-items: center; min-height: calc(100% - 3.5rem); }
.modal-dialog-scrollable { height: calc(100% - 3.5rem); }
.modal-dialog-scrollable .modal-content { max-height: 100%; overflow: hidden; }
.modal-dialog-scrollable .modal-body { overflow-y: auto; }
.modal-content { position: relative; display: flex; flex-direction: column; width: 100%; pointer-events: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text); box-shadow: var(--shadow); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-soft); }
.modal-body { position: relative; flex: 1 1 auto; padding: 1.15rem 1.25rem; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 0.5rem; padding: 0.85rem 1.25rem; border-top: 1px solid var(--border-soft); }
.modal-title { margin: 0; font-weight: 700; line-height: 1.4; }
.modal-backdrop { position: fixed; inset: 0; z-index: 1050; width: 100vw; height: 100vh; background: #000; }
.modal-backdrop.show { opacity: 0.5; }
body.modal-open { overflow: hidden; }

/* --- Fade (transition douce, sans masquer : l'affichage est géré par .show/.active/display inline) --- */
.fade { transition: opacity 0.15s linear; }

/* --- Tooltip Bootstrap --- */
.tooltip { position: absolute; z-index: 1080; display: block; margin: 0; font-size: var(--fs-xs); }
.tooltip.show { opacity: 1; }
.tooltip .tooltip-inner { max-width: 240px; padding: 0.35rem 0.55rem; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm); box-shadow: var(--shadow-sm); text-align: center; }
