/* Stats automatiques, graphiques, infobulles */

.tile__sub { margin: 6px 0 0; color: var(--muted); font-size: 0.875rem; }
#auto-tiles .tile dd { font-size: 2rem; overflow-wrap: anywhere; }
.charts { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items: start; }
.section-title { margin: 8px 0 0; font-family: var(--head); font-weight: 700; font-size: 1.4375rem; }

.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; height: 220px; padding-top: 24px; }
.bars__col { display: flex; flex-direction: column; min-width: 0; }
.bars__track {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}
.bars__bar {
  position: relative;
  width: min(28px, 70%);
  background: var(--red);
  border-radius: 4px 4px 0 0;
  cursor: default;
}
/* mois sans coup */
.bars__bar--zero { height: 2px !important; background: var(--line); border-radius: 1px; }
.bars__value {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--head);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}
.bars__label { margin-top: 6px; text-align: center; color: var(--muted); font-size: 0.75rem; white-space: nowrap; overflow: hidden; }
/* zone de survol */
.bars__track:hover .bars__bar { filter: brightness(1.15); }

.stack { display: flex; gap: 2px; height: 22px; margin: 6px 0 16px; }
.stack__seg { border-radius: 4px; min-width: 6px; position: relative; }
.stack__seg--red, .legend__key--red { background: var(--red); }
.stack__seg--amber, .legend__key--amber { background: var(--amber); }
.stack__seg--green, .legend__key--green { background: var(--green); }
.stack__seg--grey, .legend__key--grey { background: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 48px; gap: 10px; align-items: center; }
.legend__key { width: 12px; height: 12px; border-radius: 3px; }
.legend b { font-family: var(--head); font-size: 1.125rem; }
.legend__pct { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* Infobulles (barres, segments, points de la carte) */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #0b0b0c;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 9px;
  font-family: var(--body);
  font-size: 0.8125rem;
  font-weight: 600;
  z-index: 4;
  pointer-events: none;
}

.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--xl { width: 88px; height: 88px; font-size: 2rem; }

.member { width: min(560px, calc(100vw - 24px)); position: relative; }
.member__close {
  position: absolute;
  top: 12px; right: 12px;
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
}
.member__close:hover { border-color: var(--muted); }
.member__head { display: flex; gap: 18px; align-items: center; padding-right: 40px; }
.dialog .member__name { margin: 2px 0 0; font-family: var(--head); font-weight: 700; font-size: 2rem; line-height: 1; }
.member__sub { margin: 20px 0 6px; font-family: var(--head); font-weight: 700; font-size: 1.25rem; }

.photo-pick { display: flex; align-items: center; gap: 12px; }
.photo-pick img, .photo-pick__empty {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  color: var(--muted);
  flex: none;
}
.photo-pick input[type="file"] { font-size: 0.875rem; color: var(--muted); }
.field--photo { grid-column: 1 / -1; }

@media (max-width: 1050px) {
  .charts { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .bars { height: 180px; gap: 4px; }
  .bars__label { font-size: 0.625rem; }
  .member__head { flex-direction: column; align-items: flex-start; }
}

/* mois en cours */
.bars__col--now .bars__label { color: var(--text); font-weight: 700; }

/* Par type */
#chart-types li { grid-template-columns: 20px 96px minmax(0, 1fr) 24px; }
#chart-types .ticon { stroke: var(--muted); }
