
/* ========================= */
/* DESIGN SYSTEM (TOKENS) */
/* ========================= */

:root {
  --color-primary: #1f5a85;
  --color-primary-light: #2c92d5; /* 👈 AJOUT */
  --color-primary-dark: #153f5c; /* 👈 OPTIONNEL mais utile */
  --color-accent: #3ec5ff;

  --color-bg: #eef3f8;
  --color-surface: #ffffff;

  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-border: #e5e7eb;

  /* --color-success: #16a34a;*/
  /* --color-success-bg: #dcfce7;*/
  --color-success: #1C9C8F;
  --color-success-bg: rgba(28, 156, 143, 0.12);

  --color-danger: #dc2626;
  --color-danger-bg: #fee2e2;

  --radius-sm: 8px;
  --radius-md: 14px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 24px rgba(0,0,0,0.08);

  --font-main: "Segoe UI", Arial, sans-serif;
}

/* ========================= */
/* RESET */
/* ========================= */

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background: linear-gradient(to bottom, #eef3f8, #f8fafc);
  color: var(--color-text);
}

/* ========================= */
/* LAYOUT */
/* ========================= */

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-container {
  padding: 20px 60px;
}

/* ========================= */
/* HEADER */
/* ========================= */

.header-container {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* TOP HEADER */

.topbar-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 60px;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
}

/* BRAND */

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  height: 70px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
}

.brand-subtitle {
  font-size: 13px;
  color: #64748b;
}

/* ACTIONS */

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  border: 1px solid #d1d5db;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  outline: none;
}

.header-link {
  font-size: 13px;
  color: #334155;
  text-decoration: none;
  font-weight: 600;
}

/* NAVBAR */

.navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 20px;
  gap: 22px;
  background: var(--color-primary);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav-menu {
  display: flex;
  gap: 22px;
  flex-wrap: nowrap;
}

.nav-link {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
  text-transform: uppercase; /* 👈 AJOUT ICI */
  letter-spacing: 0.5px; /* 👈 AJOUT ICI */
  font-size: 13px; /* 👈 recommandé */
}

.nav-link:hover {
  background: rgba(255,255,255,0.12);
  color: white;
}

.nav-link.active {
  background: rgba(255,255,255,0.18);
  color: white;
}

/* ========================= */
/* SEPARATEURS NAVBAR */
/* ========================= */

.nav-link {
  position: relative; /* nécessaire pour le pseudo-élément */
}

.nav-link:not(:first-child)::before {
  content: "";
  position: absolute;
  left: -11px; /* moitié du gap (22px / 2) */
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 14px;
  background: rgba(255,255,255,0.35);
}

/* ========================= */
/* FILTERS */
/* ========================= */

.global-filters {
  display: flex;
  gap: 20px;
  align-items: stretch;
  background: #ffffff;
  padding: 20px;
  margin: 30px 60px 10px 60px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  position: static !important; /* 👈 suffit */
  top: auto !important;
}

.group-separator {
  width: 1px;
  background: var(--color-border);
  margin: 0 16px;
}

.filter-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.filter-group-title {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 10px;
}

.filter-inline {
  display: flex;
  gap: 15px;
}

.filter-item {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
}

.filter-item label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #334155;
}

.filter-item button {
  width: 100%;
  margin-top: auto;
}

/* ========================= */
/* BUTTONS */
/* ========================= */

#btn-toggle-peb {
  height: 40px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;

  display: flex;
  align-items: center;
  justify-content: center;

  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-primary-light)
  );
  color: white;
  border: none;
  border-radius: 10px;
}

/* bouton secondaire */

#btn-refresh {
  height: 40px; /* 👈 ALIGNÉ */
  padding: 0 16px;
  border-radius: 10px;

  font-weight: 600;
  font-size: 14px;

  background: #f8fafc;
  color: #334155;
  border: 1px solid #d1d9e6;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  transition: all 0.2s ease;
}

#btn-refresh:hover {
  background: #eef2f7;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

/* ========================= */
/* CONTENT */
/* ========================= */

.main-content {
  flex: 1;
  padding: 30px 60px;
}

/* TITRES */

.section-title {
  font-size: 34px;
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 8px;
  color: #0f172a;
  letter-spacing: -0.3px;
  padding-left: 12px;
  border-left: 4px solid var(--color-primary);
}

.analysis-text {
  font-size: 15px;
  color: #64748b;
}


/* ========================= */
/* KPI CARD */
/* ========================= */

.kpi-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
  transition: all 0.25s ease;

  display: flex;
  flex-direction: column;
  gap: 6px;

  height: 100%;        /* 🔥 clé : toutes les cartes prennent la même hauteur */
  min-height: 160px;   /* 🔥 optionnel : stabilise le rendu */
}

.kpi-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-lg);
}



/* ========================= */
/* GRID */
/* ========================= */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 20px;

  align-items: stretch; /* 🔥 clé pour uniformiser les hauteurs */
}

/* ========================= */
/* TEXTES */
/* ========================= */

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.6px;
}

/* VALEUR (clé) */

.kpi-value {
  min-height: 52px; /* 🔥 clé alignement */
  display: flex;
  align-items: center;
  line-height: 1.1;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

/* tailles */

/* ========================= */
/* KPI VALUES */
/* ========================= */

.kpi-value,
.kpi-value.positive,
.kpi-value.negative {
  color: #0f172a !important;
}

/* KPI principal */

.kpi-main .kpi-value {
  font-size: 42px;
  font-weight: 800;
  color: #0f172a !important;
}

/* KPI secondaires */

.kpi-secondary .kpi-value {
  font-size: 28px;
  font-weight: 600;
  color: #0f172a !important;
}

.dyn-prix-page .kpi-value {
    font-size: 3rem;
    font-weight: 800;
}

/* ========================= */
/* SUBTEXT */
/* ========================= */

.kpi-sub {
  min-height: 18px; /* 🔥 évite décalage */
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ========================= */
/* VARIATION */
/* ========================= */

.kpi-variation {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ========================= */
/* GRID */
/* ========================= */

.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
}

/* ========================= */
/* PAGE DYNAMIQUES PRIX */
/* ========================= */

.page-dyn-prix .bottom-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 20px;
}

.page-dyn-prix .bottom-grid > .card {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.page-dyn-prix .bottom-grid .graph {
  width: 100% !important;
}

.page-dyn-prix .bottom-grid .dash-graph,
.page-dyn-prix .bottom-grid .js-plotly-plot {
  width: 100% !important;
  max-width: 100% !important;
}

/* =============================== */
/* PAGE SYNTHÈSE – FIX COMPLET */
/* =============================== */

.page-synthese .bottom-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.page-synthese .js-plotly-plot {
  height: 420px !important;
}

/* ========================= */
/* FOOTER */
/* ========================= */

.footer {
  text-align: center;
  padding: 14px;
  font-size: 12px;
  background-color: var(--color-primary);
  color: white;
}

/* ========================= */
/* RESPONSIVE */
/* ========================= */

@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .global-filters {
    flex-direction: column;
  }
}

@media (max-width: 800px) {
  .filter-inline {
    flex-direction: column;
  }

  .topbar-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .navbar {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .navbar::-webkit-scrollbar {
    display: none;
  }
}

/* ========================= */
/* CARD */
/* ========================= */

.card {
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  padding: 20px 24px;
}

/* 🔥 FIX margin collapsing SANS overflow */

.card::before {
  content: "";
  display: table;
}

/* espace au-dessus du premier élément */

.card > :first-child {
  margin-top: 0;
  padding-top: 10px;
}

/* titres */

.card-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--color-text);
  margin-bottom: 4px;
}

/* sous-texte */

.card p {
  margin-bottom: 14px;
}

/* graph spacing */

.card .graph,
.card .dash-graph,
.card .js-plotly-plot {
  margin-top: 10px;
}

.graph {
  height: 420px;
}

/* 🔥 FIX PLOTLY */
/* Graphes avec hauteur fixe */

.card.graph-fixed .js-plotly-plot {
  height: 420px !important;
  max-height: 420px !important;
}

/* Graphes adaptatifs */

.card.graph-fluid .js-plotly-plot {
  height: auto !important;
  max-height: none !important;
}

.js-plotly-plot > div {
  height: 100% !important;
}

/* ========================= */
/* BADGE */
/* ========================= */

#btn-toggle-peb {
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-primary-light)
  );
}

.badge-primary {
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-primary-light)
  );
}

/* ============================= */
/* LECTURE RAPIDE (BLOC GLOBAL) */
/* ============================= */

.lecture-highlight {
  background: linear-gradient(
    135deg,
    rgba(31, 90, 133, 0.06),
    rgba(44, 146, 213, 0.08)
  );
  border-left: 5px solid var(--color-primary);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 30px;
}

/* ============================= */
/* TITRE PRINCIPAL */
/* ============================= */

.lecture-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 10px;
  letter-spacing: -0.2px;
}

/* ============================= */
/* META (périmètre, note) */
/* ============================= */

.lecture-meta {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
  line-height: 1.4;
}

/* ============================= */
/* TITRES DE SECTION */
/* ============================= */

.lecture-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 18px;
  margin-bottom: 18px;
}

/* ============================= */
/* PARAGRAPHES */
/* ============================= */

.lecture-highlight p {
  margin-bottom: 10px;
  line-height: 1.45;
  color: #374151;
}

/* ============================= */
/* LISTES (résumé) */
/* ============================= */

.lecture-highlight ul {
  margin-top: 6px;
  margin-bottom: 14px;
  padding-left: 18px;
  line-height: 1.45;
  color: #4b5563; /* 👈 atténue le résumé */
}

.lecture-highlight li {
  margin-bottom: 4px;
}


/* ============================= */
/* TEXTE FORT */
/* ============================= */

.lecture-strong {
  font-weight: 700;
  color: #1f2937;
}

/* ============================= */
/* TEXTE IMPORTANT */
/* ============================= */

.lecture-important {
  font-weight: 800;
  color: var(--color-primary);
}

/* ============================= */
/* BLOC DECISIONNEL */
/* ============================= */

.lecture-decision p {
  position: relative;
  padding-left: 18px;
}

.lecture-decision p::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-primary);
  font-weight: 700;
}

/* ============================= */
/* LIGNE DE SEPARATION */
/* ============================= */

.lecture-divider {
  height: 1.5px;
  margin: 14px 0 18px 0;
  background: #d1d5db;
}

/* ============================= */
/* NOTE / TEXTE SECONDAIRE */
/* ============================= */

.lecture-note {
  font-size: 13px;
  color: #4b5563;
  margin-top: 8px;
}

/* ============================= */
/* FIABILITÉ (signal vert) */
/* ============================= */

.lecture-fiabilite {
  color: var(--color-success);
  font-weight: 600;
}

.lecture-highlight .lecture-fiabilite {
  margin-top: 10px;
  display: block;
}

.badge.neutral {
  background-color: #e9ecef;
  color: #6c757d;
}
/* ============================= */
/* LISTE LECTURE RAPIDE */
/* ============================= */

.lecture-list {
  margin-top: 10px;
  padding-left: 22px;
}

.lecture-list li {
  margin-bottom: 6px;
  color: #374151;
  line-height: 1.45;
}



/* ============================= */
/* KPI _ TRIPLE */
/* ============================= */
.kpi-triple-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 10px;
}

.kpi-col {
    flex: 1;
    text-align: center;
    position: relative;
}

.kpi-sub-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}



.kpi-left {
    border-right: 1px solid #e2e8f0;
    padding-right: 25px;
}

.kpi-right {
    padding-left: 25px;
}

.kpi-col:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 10%;
    height: 60%;
    width: 1px;
    background: rgba(148,163,184,0.4);
}



.insight-badge {
    font-size: 11px;
    font-weight: 600;
    color: #2563eb;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.insight-main {
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 3px;
}

.insight-secondary {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}



/* ============================= */
/* KPI BADGES */
/* ============================= */

.kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 5px 10px;
  border-radius: 999px;

  font-size: 12px;
  font-weight: 700;
  line-height: 1;

  transition: all 0.2s ease;
}




.kpi-badge-positive {
  color: var(--color-success);
  font-size: 12px;
  font-weight: 700;
}

.kpi-badge-negative {
    color: var(--color-danger);
  font-size: 12px;
  font-weight: 700;
}

.kpi-badge-neutral {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}



.kpi-tcam {

    background: white;

    #border: 1px solid rgba(15,23,42,0.04);

}

.kpi-tcam .kpi-label {

    color: #ea580c;

}

.kpi-tcam .kpi-icon {

    color: #f97316;

}

.kpi-tcam .kpi-icon-circle {

    background: rgba(249,115,22,0.10);

}



/* =========================
   TOOLTIP INFO
========================= */

.custom-tooltip .tooltip-inner {

    max-width: 520px !important;
    width: 520px !important;

    padding: 18px !important;

    font-size: 14px !important;
    line-height: 1.7 !important;

    text-align: left !important;
    white-space: pre-line !important;

    background: rgba(15, 23, 42, 0.96) !important;

    color: #f8fafc !important;

    border-radius: 14px !important;

    border: 1px solid rgba(255,255,255,0.08) !important;

    box-shadow:
        0 12px 30px rgba(0,0,0,0.28) !important;

    backdrop-filter: blur(8px);

    max-height: 75vh !important;
    overflow-y: auto !important;
}

/* scrollbar */

.custom-tooltip .tooltip-inner::-webkit-scrollbar {
    width: 7px;
}

.custom-tooltip .tooltip-inner::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.22);
    border-radius: 8px;
}


/* scrollbar */

.custom-tooltip .tooltip-inner::-webkit-scrollbar {
    width: 7px;
}

.custom-tooltip .tooltip-inner::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.22);
    border-radius: 8px;
}

/* Scrollbar propre */

.custom-tooltip .tooltip-inner::-webkit-scrollbar {
    width: 8px;
}

.custom-tooltip .tooltip-inner::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 8px;
}

.custom-tooltip .tooltip-inner::-webkit-scrollbar-track {
    background: transparent;
}


/* =========================
  EXPLICATION TCAM
========================= */
.card-subtitle{

    font-size: 13px;
    line-height: 1.5;
    color: #64748b;

    margin-top: 4px;
    margin-bottom: 10px;

    max-width: 95%;
}


.card-note{

    font-size: 12px;
    line-height: 1.45;

    color: #94a3b8;

    margin-top: -2px;
    margin-bottom: 14px;

    font-style: italic;
}

/* =========================
  TEXTE SOUS KPI
========================= */

.kpi-global-note{
    margin-top: 10px;
    margin-bottom: 25px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

/* =========================
   KPI REPARTITION
========================= */

.kpi-repartition {

  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* lignes */

.kpi-repartition-row {

  display: grid;

  grid-template-columns:
    120px
    1fr
    45px;

  align-items: center;

  gap: 10px;
}

/* labels */

.kpi-repartition-label {

  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

/* progress track */

.kpi-repartition-track {

  width: 100%;
  height: 12px;

  background: #e2e8f0;

  border-radius: 999px;

  overflow: hidden;

  position: relative;
}

/* progress fill */

.kpi-repartition-fill {

  height: 100%;

  border-radius: 999px;

  background: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-primary-light)
  );
}

/* pct */

.kpi-repartition-pct {

  text-align: right;

  font-size: 14px;
  font-weight: 700;

  color: #0f172a;
}

/* bloc dominant */

.kpi-dominant-block {

  margin-top: 8px;

  padding: 16px;

  border-radius: 14px;

  background:
    linear-gradient(
      135deg,
      rgba(31,90,133,0.05),
      rgba(44,146,213,0.08)
    );

  border: 1px solid rgba(31,90,133,0.08);
}

/* titre */

.kpi-dominant-title {

  font-size: 11px;
  font-weight: 800;

  letter-spacing: 0.6px;

  text-transform: uppercase;

  color: #64748b;

  margin-bottom: 10px;
}

/* type */

.kpi-dominant-type {

  font-size: 30px;
  font-weight: 800;

  color: #0f172a;

  line-height: 1;
}

/* pct dominant */

.kpi-dominant-sub {

  margin-top: 6px;

  font-size: 14px;
  color: #64748b;
}

/* barre dominant */

.kpi-dominant-track {

  margin-top: 14px;

  width: 100%;
  height: 8px;

  background: rgba(148,163,184,0.18);

  border-radius: 999px;

  overflow: hidden;
}

.kpi-dominant-fill {

  height: 100%;

  border-radius: 999px;

  background: linear-gradient(
    90deg,
    #2563eb,
    #3b82f6
  );
}


.kpi-dominant-wrapper {
    display: block;
    width: 100%;
}

.kpi-dominant-block {
    margin-top: 6px;
}

/* =========================================
   SLIDERS — correction labels coupés
========================================= */

.rc-slider-mark {
    left: 12px !important;
    right: 12px !important;
    width: calc(100% - 24px) !important;
}

.rc-slider-mark-text:first-child {
    transform: translateX(0%) !important;
}

.rc-slider-mark-text:last-child {
    transform: translateX(-100%) !important;
}


/* =========================================
   SLIDERS — STYLE BLEU OBSERVATOIRE
========================================= */

.rc-slider-track {

    background:
        linear-gradient(
            90deg,
            #2563eb,
            #06b6d4
        ) !important;
}

.rc-slider-dot-active {

    border-color: #2563eb !important;
}

.rc-slider-handle {

    border: 3px solid #2563eb !important;

    background: white !important;

    box-shadow:
        0 0 0 4px rgba(37,99,235,0.18) !important;
}

.rc-slider-handle:hover {

    border-color: #06b6d4 !important;
}

.rc-slider-rail {

    background: #dbe4ee !important;
}

/* TRACK */

.rc-slider-track {

    background:
        linear-gradient(
            90deg,
            #2563eb,
            #06b6d4
        ) !important;
}


/* HANDLE */

.rc-slider-handle {

    border-color: #2563eb !important;

    background-color: #2563eb !important;
}


/* DOT ACTIVE */

.rc-slider-dot-active {

    border-color: #2563eb !important;
}


/* TOOLTIP */

.rc-slider-tooltip-inner {

    background-color: #2563eb !important;
}

.rc-slider-tooltip-arrow {

    border-top-color: #2563eb !important;
}
/* =====================================================
   SOUS-TITRE CARTE
===================================================== */

.map-subtitle {

    font-size: 14px;
    line-height: 1.6;
    color: #64748b;

    margin-top: 2px;
    margin-bottom: 18px;

    text-align: left;

    max-width: 1100px;
}


/* =====================================================
   LEGENDE — ALIGNEMENT HAUT PROPRE
===================================================== */

.map-legend-side {

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 20px;

    flex-wrap: wrap;

    width: 100%;

    margin-bottom: 0px;   /* 🔥 réduit l’espace avant la carte */
}

/* =====================================================
   ITEM
===================================================== */

.legend-item {

    display: flex;

    align-items: flex-start;

    gap: 12px;

    min-height: 60px;

    flex: 1 1 180px;
}


/* =====================================================
   BLOC COULEUR
===================================================== */

.legend-color {

    width: 42px;
    min-width: 42px;

    height: 42px;

    border-radius: 12px;

    border: 1px solid rgba(0,0,0,0.06);

    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* =====================================================
   COULEURS — IDENTIQUES À LA CARTE
===================================================== */

.legend-q1 {
    background: #2b83ba;
}

.legend-q2 {
    background: #abdda4;
}

.legend-q3 {
    background: #ffffbf;
}

.legend-q4 {
    background: #fdae61;
}

.legend-q5 {
    background: #d7191c;
}

.legend-nodata {

    background: #ECECEC;

    border: 1px solid rgba(0,0,0,0.08);
}

/* =====================================================
   TEXTES
===================================================== */

.legend-text {

    display: flex;

    flex-direction: column;

    justify-content: flex-start;
}


/* =====================================================
   TITRE
===================================================== */

.legend-title {

    font-size: 13px;

    font-weight: 700;

    line-height: 1.2;

    color: #0f172a;

    margin: 0;
}


/* =====================================================
   SOUS-TITRE
===================================================== */

.legend-subtitle {

    font-size: 12px;

    line-height: 1.4;

    color: #64748b;

    margin-top: 4px;
}

.map-subtitle {
    margin-bottom: 8px;
}

.map-legend-side,
.map-legend-wide {
    margin-bottom: 2px !important;
    padding-bottom: 0 !important;
}

.js-plotly-plot {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.kpi-variation-line {

display: flex;

align-items: center;

justify-content: space-between;

gap: 10px;

width: 100%;
}

.kpi-variation-label {

font-size: 13px;

color: #475569;

line-height: 1.3;
}

.triple-grid{

    display:grid;

    grid-template-columns:repeat(3, 1fr);

    gap:18px;

    align-items:stretch;
}


.kpi-no-frame {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.kpi-no-frame::before,
.kpi-no-frame::after {
    display: none !important;
}


/* =====================================================
   KPI — VERSION PREMIUM HARMONISÉE
===================================================== */

.kpi-row {

    display: grid;

    grid-template-columns: repeat(5, 1fr);

    gap: 22px;

    margin-top: 30px;
    margin-bottom: 28px;

    align-items: stretch;
}


/* =====================================================
   CARD
===================================================== */

.kpi-card {

    position: relative;

    overflow: hidden;

    background: #ffffff;

    border-radius: 18px;

    padding: 18px 18px;

    border: 1px solid rgba(15,23,42,0.04);

    box-shadow:
        0 4px 12px rgba(15,23,42,0.05);

    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease;

    min-height: 150px;

    display: flex;
    flex-direction: column;

    justify-content: flex-start;
}


/* =====================================================
   HOVER
===================================================== */

.kpi-card:hover {

    transform:
        translateY(-5px);

    box-shadow:
        0 16px 32px rgba(15,23,42,0.10);
}




/* =====================================================
   LABELS
===================================================== */

.kpi-label {

    font-size: 13px;

    font-weight: 700;

    letter-spacing: 0.7px;

    text-transform: uppercase;

    color: var(--color-primary);

    line-height: 1.45;

    margin-bottom: 8px;
}



/* =====================================================
   VALUES — HARMONISÉES
===================================================== */

.kpi-value {

    font-size: clamp(20px, 1.8vw, 32px);

    font-weight: 800;

    line-height: 1.1;

    letter-spacing: -1px;

    color: #0f172a;

    margin-bottom: 10px;

    font-variant-numeric: tabular-nums;

    word-break: break-word;
}


/* =====================================================
   SUBTEXT
===================================================== */

.kpi-sub {

    font-size: 10px;

    line-height: 1.5;

    color: #64748b;

    margin-bottom: 16px;
}


/* =====================================================
   VARIATIONS
===================================================== */

.kpi-variation-line {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    padding-top: 6px;
}


/* =====================================================
   BARRES KPI
===================================================== */

.kpi-dominant-track {

    margin-top: auto;

    height: 10px;

    border-radius: 999px;

    background:
        rgba(148,163,184,0.16);
}

.kpi-dominant-fill {

    border-radius: 999px;

    background:
        linear-gradient(
            90deg,
            #2563eb,
            #22c1ff
        );
}


/* =====================================================
   BLOC DOMINANT
===================================================== */

.kpi-dominant-block {

    margin-top: auto;

    padding: 18px;

    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            rgba(31,90,133,0.05),
            rgba(44,146,213,0.08)
        );

    border:
        1px solid rgba(31,90,133,0.08);
}


/* =====================================================
   TYPE DOMINANT
===================================================== */

.kpi-dominant-type {

    font-size: 22px;

    font-weight: 800;

    color: #0f172a;
}


/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 1400px) {

    .kpi-row {

        grid-template-columns:
            repeat(3, 1fr);
    }
}

@media (max-width: 900px) {

    .kpi-row {

        grid-template-columns:
            1fr;
    }
}


.kpi-card hr {
    margin: 10px 0;
}

.kpi-card .kpi-secondary-block {

    padding-top: 8px;

    margin-top: 6px;
}

.kpi-card .kpi-secondary-label {

    margin-bottom: 4px;
}

.kpi-card .progress-track {

    height: 6px;

    margin-top: 6px;
}


/* =====================================================
   DASH SLIDER — THEME OBSERVATOIRE BLEU
===================================================== */

/* rail */

.rc-slider-rail {

    background: #dbe4ee !important;

    height: 6px !important;

    border-radius: 999px !important;
}


/* partie active */

.rc-slider-track {

    background:
        linear-gradient(
            90deg,
            #2563eb,
            #06b6d4
        ) !important;

    height: 6px !important;

    border-radius: 999px !important;
}


/* poignée */

.rc-slider-handle {

    width: 18px !important;
    height: 18px !important;

    margin-top: -6px !important;

    background: #2563eb !important;

    border: 3px solid white !important;

    box-shadow:
        0 0 0 4px rgba(37,99,235,0.20) !important;

    opacity: 1 !important;
}


/* états */

.rc-slider-handle:hover,
.rc-slider-handle:active,
.rc-slider-handle:focus,
.rc-slider-handle-click-focused {

    border-color: white !important;

    background: #06b6d4 !important;

    box-shadow:
        0 0 0 6px rgba(6,182,212,0.22) !important;
}


/* dots */

.slider-bleu .rc-slider-track {
    background-color: #1e88e5 !important;
}

.slider-bleu .rc-slider-handle {
    border-color: #1e88e5 !important;
    background-color: #1e88e5 !important;
}

.slider-bleu .rc-slider-handle:hover,
.slider-bleu .rc-slider-handle:focus {
    border-color: #1565c0 !important;
}

.slider-bleu .rc-slider-dot-active {
    border-color: #1e88e5 !important;
}
/* ===== Slider bleu ===== */

.rc-slider-track {
    background-color: #1e88e5 !important;
}

.rc-slider-handle {
    border: solid 3px #1e88e5 !important;
    background-color: #1e88e5 !important;
    opacity: 1 !important;
}

.rc-slider-handle:hover,
.rc-slider-handle:active,
.rc-slider-handle:focus {
    border-color: #1565c0 !important;
    box-shadow: 0 0 0 5px rgba(30,136,229,0.25) !important;
}

.rc-slider-dot-active {
    border-color: #1e88e5 !important;
}

.rc-slider-rail {
    background-color: #d6dbe3 !important;
}


/* ===== Garder la même largeur MAIS agrandir le contenu ===== */

.kpi-type-dominant {
    padding: 28px !important;
}

/* titre */
.kpi-type-dominant h3,
.kpi-type-dominant h4 {
    font-size: 1.55rem !important;
    line-height: 1.4 !important;
    letter-spacing: 1px;
}

/* icône + valeur */
.kpi-type-dominant .kpi-main {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 18px;
}

/* ===== KPI type dominant un peu plus large ===== */

.kpi-type-dominant {
    min-width: 380px !important;
    max-width: 400px !important;
    width: 400px !important;

    padding: 28px !important;
    border-radius: 24px !important;
}

/* texte Maison */
.kpi-type-dominant .kpi-value {
    font-size: 4rem !important;
    font-weight: 800 !important;
}

/* texte secondaire */
.kpi-type-dominant p {
    font-size: 1.2rem !important;
    margin-top: 18px;
}

.kpi-type-dominant .kpi-value-appartement {
    font-size: 2.8rem !important;
    line-height: 1 !important;
}
/* barre */
.kpi-type-dominant .progress {
    height: 14px !important;
    border-radius: 20px !important;
    margin-top: 20px;
}


/* moins d'espace vide en bas */
.kpi-type-dominant {
    padding-bottom: 24px !important;
}

/* texte Maison légèrement plus compact */
.kpi-type-dominant .kpi-value {
    line-height: 0.95;
    letter-spacing: -2px;
}

/* barre un peu plus élégante */
.kpi-type-dominant .progress {
    height: 12px !important;
    border-radius: 999px;
}

/* ombre légère premium */
.kpi-card {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);

}

.stats-box{
    background:#ffffff;

    border:1px solid #e2e8f0;
    border-radius:12px;

    padding:8px 4px;

    text-align:center;

    min-height:68px;
    min-width:0;

    display:flex;
    flex-direction:column;
    justify-content:center;

    overflow:hidden;

    box-shadow:0 1px 6px rgba(0,0,0,0.04);

    transition:all .2s ease;
}

.stats-box:hover{
    transform:translateY(-1px);
    box-shadow:0 4px 12px rgba(0,0,0,0.08);
}

.stats-label{
    font-size:9px;
    font-weight:600;

    text-transform:uppercase;
    letter-spacing:.08em;

    color:#64748b;

    margin-bottom:4px;

    white-space:nowrap;
}

.stats-value{
    font-size:14px;
    font-weight:700;

    color:#0f172a;

    line-height:1.1;

    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.stats-mean{
    border-top:4px solid #ef4444;
}

.stats-median{
    border-top:4px solid #f59e0b;
}

.stats-min{
    border-top:4px solid #475569;
}

.stats-max{
    border-top:4px solid #10b981;
}

.kpi-row {

    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 22px;

    margin-top: 30px;
    margin-bottom: 28px;

    align-items: stretch;
}

/* =====================================================
   KPI HEADER AVEC ICÔNE
===================================================== */
/* =====================================================
   KPI HEADER AVEC ICÔNE
===================================================== */

.kpi-header {

    display: flex;

    align-items: center;

    gap: 14px;

    margin-bottom: 18px;
}

.kpi-icon-circle {

    width: 58px;
    height: 58px;

    border-radius: 50%;

    background: #e2e8f0;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;
}

.kpi-icon {

    color: #355d8c;
}

.kpi-value {
    color: #0f172a;
}

.kpi-label {
    color: var(--color-primary);
}

.kpi-sub {
    color: #64748b;
}


.kpi-value {
    min-height: 100px;
    display: flex;
    align-items: center;
}

.analysis-summary-card {

    background: #ffffff;

    border-radius: 18px;

    padding: 26px 28px;

    border-left: 5px solid var(--color-primary);

    box-shadow:
        0 4px 12px rgba(15,23,42,0.05);

    border:
        1px solid rgba(15,23,42,0.04);

    margin-bottom: 24px;
}

.analysis-summary-header {

    display: flex;

    align-items: center;

    gap: 14px;

    margin-bottom: 18px;
}

.analysis-summary-icon {

    width: 44px;

    height: 44px;

    border-radius: 50%;

    background: #e2e8f0;

    display: flex;

    align-items: center;

    justify-content: center;

    color: var(--color-primary);

    flex-shrink: 0;
}

.analysis-summary-title {

    font-size: 18px;

    font-weight: 700;

    color: var(--color-primary);

    margin: 0;
}

.analysis-summary-content {

    font-size: 15px;

    line-height: 1.9;

    color: #334155;
}

background: rgba(16,185,129,.08);
border-radius: 8px;
padding: 4px 8px;


.kpi-icon-circle{
    width:72px;
    height:72px;
    border-radius:50%;
    background:#eef2ff;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
}

.kpi-section-title{
    font-size:13px;
    font-weight:700;
    letter-spacing:.08em;
    text-transform:uppercase;
    color:#37517e;
}

.kpi-type-value{
    font-size:58px;
    font-weight:800;
    line-height:1;
    color:#0f172a;
    margin-top:8px;
}


/* =========================================PAGE PRIX HEDONIQUES - RESPONSIVE========================================= */

@media (max-width: 1400px){

.stats-value{
    font-size:12px;
}

.kpi-value{
    font-size:30px;
}

}

@media (max-width: 1200px){

.stats-value{
    font-size:11px;
}

.stats-label{
    font-size:8px;
}

.kpi-value{
    font-size:26px;
}

.kpi-header{
    flex-wrap:wrap;
}

.kpi-label{
    white-space:normal;
    line-height:1.4;
}

}

@media (max-width: 1000px){

.stats-value{
    white-space:normal;
    overflow:visible;
    text-overflow:unset;
}

}



/* =========================================
   KPI RESPONSIVE
========================================= */

@media (max-width: 1380px){

    .kpi-value{
        font-size: 30px;
        min-height: 80px;
    }
}

@media (max-width: 1380px){

    .kpi-value{
        font-size: 26px;
        min-height: 70px;

        white-space: normal;
        word-break: break-word;
    }

    .kpi-label{
        white-space: normal;
        line-height: 1.4;
    }
}

@media (max-width: 1380px){

    .kpi-value{
        font-size: 22px;
        min-height: auto;
    }
}

.kpi-value-secondary {
    font-size: clamp(20px, 1.5vw, 30px);
    font-weight: 700;
    line-height: 1.1;
}

.kpi-territoire .kpi-value{
    font-size: 28px;
    font-weight: 800;
    min-height: auto;
}

.kpi-territoire-label{
    font-family: Inter, sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.15;
}


.kpi-row-prix{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:20px;
}


@media (max-width:900px){

    .kpi-row-prix{
        grid-template-columns:repeat(2,1fr) !important;
    }

    .kpi-row-prix > :nth-child(5){
        grid-column:1 / span 2;
    }
}


.bottom-grid-dyn-prix{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap:20px;
}

@media (max-width:1200px){ .bottom-grid-dyn-prix{ grid-template-columns:1fr; } }


@media (max-width: 900px){

    .prix-filters-grid{
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .prix-filters-grid > :nth-child(1){
        grid-column: 1 / span 1;
    }

    .prix-filters-grid > :nth-child(2){
        grid-column: 2 / span 1;
    }

    .prix-filters-grid > :nth-child(3){
        grid-column: 1 / span 2;
    }
}

@media (max-width: 900px){

    .prix-grid-ligne2{
        grid-template-columns: 1fr !important;
    }

}


@media (max-width: 900px){

    .prix-grid-ligne3{
        grid-template-columns: 1fr !important;
    }

}

@media (max-width: 900px){

    .demo-kpi-main-row{
        grid-template-columns: repeat(2,1fr) !important;
    }

    .demo-kpi-main-row > :nth-child(3){
        grid-column: 1 / span 2;
    }

}

@media (max-width: 1380px){

    .demo-kpi-territoire-row{
        grid-template-columns: 1fr !important;
    }

}

@media (max-width: 900px){

    .hedo-kpi-main-row{
        grid-template-columns: repeat(2,1fr) !important;
    }

}

@media (max-width:1200px) and (min-width:901px){

    .hedo-layout{
        flex-direction:column;
    }

}



@media (max-width: 900px){

    .permis-kpi-row{
        grid-template-columns: repeat(2,1fr) !important;
    }

}

@media (max-width: 1000px){

    .permis-graphiques-row{
        flex-direction: column;
    }

}




@media (max-width:1380px){

    .kpi-type-dominant{
        width:100% !important;
        min-width:0 !important;
        max-width:none !important;
    }

}


@media (max-width:900px){

    .dyn-prix-kpi-row{
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .dyn-prix-kpi-row > :nth-child(5){
        grid-column: 1 / span 2;
    }

}

.bottom-grid-dyn-prix{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
}

@media (max-width: 1380px){

    .bottom-grid-dyn-prix{
        grid-template-columns:1fr;
    }

}

@media (max-width: 1380px){
    .bottom-grid-dyn-prix{
        grid-template-columns:1fr;
    }
}



.synthese-kpi-row{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:20px;
}

@media (max-width:900px){

    .synthese-kpi-row{
        grid-template-columns:repeat(2,1fr);
    }

}




/* =========================================
   HEADER RESPONSIVE
   ========================================= */

@media (max-width: 900px) {

    .topbar-main {

        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 16px;

    }

    .brand {

        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;

    }

    .brand-logo {

        width: 70px;
        height: auto;

    }

    .brand-title {

        font-size: 24px;

    }

    .brand-subtitle {

        font-size: 15px;

    }

    .header-actions {

        width: 100%;
        justify-content: center;

    }

}