/* ── BAROMETRE ── */

/* ── Stats ── */
.baro-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.baro-stat-card { background: white; border: 1.5px solid #e8e8e8; border-radius: 8px; padding: 14px 16px; }
.baro-stat-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #777; margin-bottom: 4px; }
.baro-stat-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.1; }
.baro-stat-sub { font-size: 11px; color: #888; margin-top: 2px; }

/* ── Table ── */
.baro-table-wrap { overflow-x: auto; }
.baro-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.baro-table th { text-align: left; padding: 8px 10px; border-bottom: 2px solid #e8e8e8; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #777; white-space: nowrap; }
.baro-table td { padding: 8px 10px; border-bottom: 1px solid #f0eee9; vertical-align: top; }
.baro-table tr:hover td { background: #faf9f6; }
.baro-badge { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 10px; font-weight: 600; background: #f0eee9; color: #555; white-space: nowrap; }
.baro-badge.red { background: rgba(208,27,10,.1); color: var(--red); }
.baro-empty { color: #aaa; font-size: 13px; padding: 20px 0; text-align: center; }

/* ── Distribution ── */
.baro-distrib { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.baro-distrib-item { font-size: 11px; color: #555; }
.baro-distrib-bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--red); opacity: .7; vertical-align: middle; margin-right: 4px; min-width: 4px; }

/* ── Filtres pills (v2) ── */
#baro-filters-wrap {
  background: white;
  border: 1.5px solid #ebe9e4;
  border-radius: 12px;
  padding: 18px 20px 12px;
  margin-bottom: 20px;
}

.baro-filter-block { margin-bottom: 14px; }
.baro-filter-block:last-child { margin-bottom: 0; }

.baro-filter-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.baro-pill-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #aaa;
  margin-bottom: 8px;
}

.baro-filter-block-head .baro-pill-label { margin-bottom: 0; }

.baro-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.baro-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #e0ddd8;
  background: white;
  color: #666;
  font-family: inherit;
  transition: background .1s, border-color .1s, color .1s;
  white-space: nowrap;
  user-select: none;
}

.baro-pill:hover {
  background: #f8f6f3;
  border-color: #c8c4be;
  color: #333;
}

.baro-pill.active {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

.baro-pill.active:hover {
  opacity: .88;
}

.baro-pill-expand {
  border-style: dashed;
  color: #bbb;
  font-size: 11px;
  font-weight: 600;
}

.baro-pill-expand:hover {
  background: #f5f3f0;
  border-color: #aaa;
  color: #555;
}

/* Ligne inférieure : Télétravail + Expérience côte à côte */
.baro-filter-row-2 {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  padding-top: 14px;
  border-top: 1px solid #f0ede8;
  margin-bottom: 0;
}

/* Bouton reset */
.baro-reset-btn {
  font-size: 11px;
  font-weight: 600;
  color: #bbb;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color .1s;
}

.baro-reset-btn:hover { color: var(--red); }

/* ── Slider dual-range Expérience (v3) ── */
.baro-slider-outer {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.baro-slider-wrap {
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
}
.baro-slider-track-bg {
  position: absolute;
  height: 4px; width: 100%;
  background: #e8e5e0; border-radius: 2px;
  pointer-events: none;
}
.baro-slider-track-fill {
  position: absolute;
  height: 4px;
  background: var(--red);
  border-radius: 2px;
  pointer-events: none;
  left: 0; width: 100%;
}
.baro-range {
  position: absolute;
  width: 100%;
  margin: 0; padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  height: 4px;
}
.baro-range::-webkit-slider-thumb {
  pointer-events: all;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,.22);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.baro-range::-moz-range-thumb {
  pointer-events: all;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,.22);
  cursor: pointer;
}
.baro-range::-webkit-slider-runnable-track { background: transparent; }
.baro-range::-moz-range-track { background: transparent; }
.baro-slider-lbl {
  font-size: 11px;
  color: #888;
  min-height: 14px;
}
.baro-slider-lbl strong { color: var(--red); font-weight: 700; }

/* ── Bouton export rapport (v3) ── */
.baro-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  background: white;
  color: var(--red);
  border: 1.5px solid var(--red);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.baro-export-btn:hover { background: var(--red); color: white; }

/* ── Filtres période (v3) ── */
.baro-filter-row-2 {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  padding-top: 14px;
  border-top: 1px solid #f0ede8;
  margin-bottom: 0;
}

/* ── Charts (v3) ── */
#baro-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.baro-chart-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
  grid-column: 1 / -1;
}
.baro-chart-card {
  background: white;
  border: 1.5px solid #e8e5e0;
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.baro-chart-title {
  font-size: 10px; font-weight: 700;
  color: #280805; margin-bottom: 12px;
}
.baro-chart-note {
  font-size: 9px; color: #555;
  margin-top: 8px; padding-top: 7px;
  border-top: 1px solid #f0ede8;
  line-height: 1.5;
}
.baro-chart-note strong { color: var(--red); font-weight: 700; }
.baro-chart-note em { color: #280805; font-style: normal; font-weight: 600; }

/* Histogram */
.baro-histo-wrap { position: relative; padding-top: 20px; }
.baro-histo {
  display: flex; align-items: flex-end; gap: 4px;
  height: 100px; padding-bottom: 20px;
}
.baro-hb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; justify-content: flex-end; }
.baro-hb-bar { width: 100%; background: var(--red); border-radius: 2px 2px 0 0; }
.baro-hb-lbl { font-size: 7px; color: #aaa; white-space: nowrap; }
.baro-median-marker {
  position: absolute;
  top: 20px; bottom: 20px;
  width: 1.5px; background: var(--red);
  pointer-events: none;
}
.baro-median-label {
  position: absolute; top: 2px;
  font-size: 7.5px; font-weight: 800; color: var(--red);
  white-space: nowrap;
  background: white; padding: 1px 5px;
  border-radius: 3px; border: 1px solid rgba(225,23,9,.2);
  line-height: 1.5;
}

/* Donut */
.baro-donut-wrap { display: flex; align-items: center; gap: 11px; }
.baro-donut { flex-shrink: 0; width: 76px; height: 76px; border-radius: 50%; position: relative; }
.baro-donut-hole { position: absolute; inset: 15px; background: white; border-radius: 50%; }
.baro-legend { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.baro-leg-item { display: flex; align-items: center; gap: 5px; font-size: 9.5px; color: #555c6c; }
.baro-leg-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.baro-leg-val { margin-left: auto; font-weight: 700; color: #1a1a1a; }

/* H-bars */
.baro-hbars { display: flex; flex-direction: column; gap: 8px; }
.baro-hbar-row { }
.baro-hbar-lbl { display: flex; justify-content: space-between; font-size: 9.5px; color: #555c6c; margin-bottom: 3px; }
.baro-hbar-lbl strong { color: #1a1a1a; font-weight: 700; }
.baro-hbar-track { height: 6px; background: #f0ede8; border-radius: 3px; overflow: hidden; }
.baro-hbar-fill { height: 100%; border-radius: 3px; }

/* No-data */
.baro-chart-nodata { font-size: 11px; color: #aaa; text-align: center; padding: 24px 0; }

/* Ancien code (conservé pour compatibilité v1) */
.baro-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; align-items: flex-end; }
.baro-filter-group { display: flex; flex-direction: column; gap: 4px; }
.baro-filter-group label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #777; }
.baro-filter-group select, .baro-filter-group input { border: 1.5px solid #e8e8e8; border-radius: 6px; padding: 6px 10px; font-size: 13px; background: white; color: var(--text); min-width: 140px; }
.baro-load-btn { padding: 8px 20px; background: var(--red); color: white; border: none; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.baro-load-btn:hover { opacity: .88; }

/* ── Bouton Veille concurrentielle ── */
.baro-veille-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px;
  background: var(--red); color: white;
  border: 1.5px solid var(--red);
  border-radius: 6px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: opacity .12s; white-space: nowrap;
}
.baro-veille-btn:hover { opacity: .88; }

/* ── Overlay + Modal ── */
.baro-veille-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.baro-veille-modal {
  background: white; border-radius: 12px;
  width: 100%; max-width: 580px;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
}
.baro-veille-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px; border-bottom: 1px solid #f0ede8;
  flex-shrink: 0;
}
.baro-veille-modal-title { font-size: 15px; font-weight: 700; color: #1a1a1a; }
.baro-veille-modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: #aaa; line-height: 1; padding: 0 2px;
  font-family: inherit;
}
.baro-veille-modal-close:hover { color: #555; }
.baro-veille-modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.baro-veille-modal-foot {
  padding: 14px 20px; border-top: 1px solid #f0ede8;
  display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0;
}

/* Sections internes */
.veille-section { margin-bottom: 18px; }
.veille-section:last-child { margin-bottom: 0; }
.veille-section-label {
  display: block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: #aaa; margin-bottom: 8px;
}
.veille-hint { font-size: 11px; color: #aaa; margin-top: 6px; }

/* Recherche entreprises */
.veille-search-wrap { position: relative; }
.veille-co-input {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid #e0ddd8; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; color: var(--text);
  background: white; font-family: inherit;
  transition: border-color .12s;
}
.veille-co-input:focus { outline: none; border-color: var(--red); }
.veille-co-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: white; border: 1.5px solid #e0ddd8; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.10); z-index: 10;
  max-height: 180px; overflow-y: auto;
}
.veille-co-option {
  padding: 8px 12px; font-size: 12px; cursor: pointer; color: #333;
}
.veille-co-option:hover { background: #faf8f5; }
.veille-co-option mark { background: none; color: var(--red); font-weight: 700; }
.veille-co-empty { padding: 10px 12px; font-size: 12px; color: #aaa; }

/* Pills entreprises sélectionnées */
.veille-co-selected { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.veille-co-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  background: var(--red); color: white;
  font-size: 11px; font-weight: 600;
}
.veille-co-pill button {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.8); font-size: 14px; line-height: 1;
  padding: 0; font-family: inherit;
}
.veille-co-pill button:hover { color: white; }

/* Champ client */
.veille-client-input {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid #e0ddd8; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; color: var(--text);
  background: white; font-family: inherit;
  transition: border-color .12s;
}
.veille-client-input:focus { outline: none; border-color: var(--red); }

/* Boutons footer */
.baro-veille-cancel {
  padding: 7px 16px; border-radius: 6px;
  background: none; border: 1.5px solid #e0ddd8;
  font-size: 13px; font-weight: 600; color: #666;
  cursor: pointer; font-family: inherit;
  transition: background .1s;
}
.baro-veille-cancel:hover { background: #f8f6f3; }
.baro-veille-gen {
  padding: 7px 18px; border-radius: 6px;
  background: var(--red); border: 1.5px solid var(--red);
  font-size: 13px; font-weight: 600; color: white;
  cursor: pointer; font-family: inherit;
  transition: opacity .12s;
}
.baro-veille-gen:hover { opacity: .88; }
.baro-veille-gen:disabled { opacity: .45; cursor: not-allowed; }

/* ── Date range : presets ── */
.veille-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.veille-preset {
  padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 600;
  border: 1.5px solid #e0ddd8; background: white; color: #666;
  cursor: pointer; font-family: inherit; transition: all .1s; white-space: nowrap;
}
.veille-preset:hover { background: #f8f6f3; border-color: #c8c4be; color: #333; }
.veille-preset.active { background: var(--red); border-color: var(--red); color: white; }

/* Date range display */
.veille-date-display {
  font-size: 12px; color: #555; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.veille-date-display strong { color: #280805; }
.veille-date-display .veille-date-sep { color: #aaa; font-size: 11px; }
.veille-date-hint { font-size: 10px; color: #aaa; margin-bottom: 8px; }

/* ── Calendrier ── */
.veille-cal {
  background: #fafaf8; border: 1.5px solid #ede9e3; border-radius: 10px;
  padding: 12px 14px; user-select: none;
}
.veille-cal-nav {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.veille-cal-nav-btn {
  background: none; border: 1.5px solid #e0ddd8; border-radius: 6px;
  width: 28px; height: 28px; cursor: pointer; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  color: #555; font-family: inherit; transition: background .1s;
}
.veille-cal-nav-btn:hover { background: #f0ede8; }
.veille-cal-head { display: flex; align-items: center; gap: 6px; }
.veille-cal-select {
  border: 1.5px solid #e0ddd8; border-radius: 6px; padding: 4px 7px;
  font-size: 12px; font-weight: 600; color: #280805; background: white;
  cursor: pointer; font-family: inherit;
}
.veille-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.veille-cal-weekday {
  text-align: center; font-size: 9px; font-weight: 700; color: #aaa;
  text-transform: uppercase; padding: 4px 2px; letter-spacing: .04em;
}
.veille-cal-day {
  text-align: center; font-size: 11px; color: #333;
  padding: 5px 2px; border-radius: 4px; cursor: pointer;
  transition: background .08s;
  line-height: 1.3;
}
.veille-cal-day:hover { background: #f0ede8; }
.veille-cal-day.other { opacity: 0; pointer-events: none; }
.veille-cal-day.today { font-weight: 700; color: var(--red); }
.veille-cal-day.range { background: rgba(225,23,9,.08); border-radius: 0; }
.veille-cal-day.start,
.veille-cal-day.end { background: var(--red); color: white; border-radius: 6px; font-weight: 700; }
.veille-cal-day.start.range-start-edge { border-radius: 6px 0 0 6px; }
.veille-cal-day.end.range-end-edge { border-radius: 0 6px 6px 0; }
.veille-cal-day.disabled { opacity: .3; cursor: not-allowed; }

/* ── Pagination baromètre ── */
.baro-pag-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 6px;
  border: 1.5px solid #e0ddd8; background: white; color: #555;
  font-size: 11px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background .1s;
}
.baro-pag-btn:hover:not(:disabled) { background: #f5f3f0; }
.baro-pag-btn:disabled { opacity: .35; cursor: not-allowed; }
