/* === ÉVÉNEMENTS === */
/* Chips de type (dialog événement) : pastille couleur + nom. */
.ev-types { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ev-type { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-secondary); color: var(--text-secondary); cursor: pointer; font-family: var(--font-text); font-size: 0.88rem; transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease; }
.ev-type i { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.ev-type.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-muted); font-weight: 600; }
/* Légende sous les graphes : trait pointillé vertical coloré + nom du type. Respirations larges
   (marge au-dessus + gap) pour ne pas coller aux graphes. */
.ev-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.1rem; margin-top: 1.1rem; padding-top: 0.75rem; border-top: 1px solid var(--header-border); font-size: 0.85rem; color: var(--text-secondary); }
.ev-legend-t { font-weight: 600; }
.ev-legend-i { display: inline-flex; align-items: center; gap: 0.45rem; }
.ev-legend-i i { width: 0; height: 15px; border-inline-start: 2px dashed transparent; display: inline-block; }
/* Liste des événements (onglet Suivi) : une carte dépliable par JOUR (même markup .hist-item que
   l'historique des mesures), donc même gap entre cartes que .history-list. Dans chaque carte, une
   .ev-row par événement : structure fixe 2 lignes robuste aux noms longs (mobile). Ligne 1 = type
   (tronqué) · quantité + suppression à droite ; ligne 2 = heure + note. .ev-row:first-child perd son
   border-top : c'est la 1re ligne de la carte (premier enfant de .hist-body). */
.events-list { display: flex; flex-direction: column; gap: 0.55rem; }
.ev-row { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.65rem 0; border-top: 1px solid var(--header-border); }
.ev-row:first-child { border-top: none; }
.ev-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; margin-top: 0.45rem; }
.ev-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.ev-line1 { display: flex; align-items: baseline; gap: 0.4rem; min-width: 0; }
.ev-lab { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ev-qty { color: var(--text-secondary); flex: 0 0 auto; }
.ev-sub { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; color: var(--text-secondary); font-size: 0.85rem; }
.ev-note { color: var(--text-primary); min-width: 0; overflow-wrap: anywhere; }
.ev-del { flex: 0 0 auto; display: inline-flex; gap: 0.4rem; align-items: flex-start; }
/* Bulle de détail d'un trait d'événement sur le graphe (survol / tap du trait). */
.ev-tip { position: absolute; z-index: 40; max-width: 15rem; padding: 0.45rem 0.65rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-card); font-size: 0.8rem; line-height: 1.4; color: var(--text-primary); pointer-events: none; }
.ev-tip span { color: var(--text-secondary); font-size: 0.74rem; }
/* Choix de couleur (dialog type d'événement) : aperçu + 3 sliders (teinte / saturation / luminosité). */
.evtype-colors { display: flex; align-items: center; gap: 0.85rem; }
/* Aperçu avant/après : l'ANNEAU (bordure épaisse) garde la couleur d'origine, le centre = en cours. */
.evtype-preview { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; border: 5px solid var(--border); }
/* L'input (22px) est PLUS HAUT que la piste (10px, dessinée par la pseudo-track via --trk) :
   le curseur de 20px reste entièrement contenu, jamais rogné, même aux extrémités. */
.evtype-sliders { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.evtype-slider { display: block; }
/* Nom du curseur À DROITE : ne se confond plus avec le libellé "Couleur" du champ (à gauche). */
.evtype-slider > span { display: block; text-align: end; font-size: 0.72rem; color: var(--text-secondary); margin-bottom: 0.1rem; }
.evtype-slider input { display: block; width: 100%; -webkit-appearance: none; appearance: none; height: 22px; background: transparent; cursor: pointer; }
.evtype-slider input::-webkit-slider-runnable-track { height: 10px; border-radius: var(--radius-pill); background: var(--trk); }
.evtype-slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -5px; border-radius: 50%; background: #fff; border: none; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5); }
.evtype-slider input::-moz-range-track { height: 10px; border-radius: var(--radius-pill); background: var(--trk); }
.evtype-slider input::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: none; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5); }
/* Réglages > Types d'événements. */
#evtype-add-btn { margin-top: 0.9rem; }
.evtype-row-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-inline-end: 0.55rem; vertical-align: middle; flex: 0 0 auto; }

/* Réglages > Mes bacs : cartes unifiées (nom + profil + crayon). */
.tank-badge { display: inline-block; margin-inline-start: 0.5rem; padding: 0.05rem 0.45rem; border-radius: var(--radius-pill); background: var(--accent-muted); color: var(--accent); font-size: 0.66rem; font-weight: 600; vertical-align: middle; }
/* Carte cliquable (Réglages) : ouvrir ce bac d'un tap ; le crayon reste l'édition. */
.tank-card { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.85rem 0.95rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-card); cursor: pointer; transition: border-color 0.2s ease; }
.tank-card:hover { border-color: var(--accent); }
.tank-card + .tank-card { margin-top: 0.6rem; }
.tank-card.is-current { border-color: var(--accent); }
.tank-card-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.tank-card-name { font-weight: 600; display: flex; align-items: center; }
.tank-card-prof { font-size: 0.8rem; color: var(--text-secondary); }
.tank-card-edit { flex: 0 0 auto; width: 2.1rem; height: 2.1rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 50%; background: transparent; color: var(--text-secondary); cursor: pointer; }
.tank-card-edit:hover { color: var(--accent); border-color: var(--accent); }
.tank-add-btn { margin-top: 0.9rem; }
/* Pied "Mes bacs" : Nouveau bac (gauche) + repli Archives (droite) sur la même ligne. */
.tanks-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; row-gap: 0.6rem; flex-wrap: wrap; margin-top: 0.9rem; }
.tanks-foot .pill { white-space: nowrap; }
#custom-open-btn { margin-top: 0.9rem; } /* espace au-dessus du bouton "Créer un profil" */
.tanks-arch-toggle { background: transparent; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem; color: var(--text-secondary); font: inherit; font-size: 0.85rem; padding: 0.4rem 0.2rem; }
.tanks-arch-toggle::after { content: "\25BE"; font-size: 0.75em; transition: transform 0.2s ease; }
.tanks-arch-toggle.is-open { color: var(--accent); }
.tanks-arch-toggle.is-open::after { transform: rotate(180deg); }
.tanks-arch-toggle:hover { color: var(--accent); }
#tanks-trash { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.6rem; }

/* Corbeille (repliable) + actions restaurer / supprimer définitivement. */
.set-fold > summary { list-style: none; cursor: pointer; color: var(--text-secondary); font-size: 0.9rem; padding: 0.6rem 0.2rem; }
.set-fold > summary::-webkit-details-marker { display: none; }
.set-fold > summary::before { content: "\25B8"; margin-inline-end: 0.4rem; }
.set-fold[open] > summary::before { content: "\25BE"; }
/* Actions côte à côte SANS wrap : c'est le titre (min-width:0 + ellipsis) qui cède la place,
   pas les boutons qui s'empilent (ex. "Changement d'eau" sur mobile). */
.tank-acts { display: flex; align-items: center; gap: 0.4rem; flex-wrap: nowrap; flex: 0 0 auto; justify-content: flex-end; }
.set-row-title { display: flex; align-items: center; min-width: 0; }
.set-row-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tank-act { background: transparent; border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 0.3rem 0.7rem; color: var(--text-secondary); cursor: pointer; font-family: var(--font-text); font-size: 0.8rem; transition: color 0.2s ease, border-color 0.2s ease; }
.tank-act:hover:not([disabled]) { color: var(--accent); border-color: var(--accent); }
.tank-act--danger:hover:not([disabled]) { color: var(--bad); border-color: var(--bad); }
/* Boutons icône (archives : restaurer / supprimer déf.) : compacts, ne poussent plus le nom du bac. */
.tank-act--icon { width: 2.1rem; height: 2.1rem; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.tank-act--icon svg { width: 16px; height: 16px; }

/* Badge d'alertes sur l'onglet Suivi (M3 navigation badge) : compteur, rouge si critique. */
.botnav .navlink .ind { position: relative; }
.nav-badge { min-width: 15px; height: 15px; padding: 0 4px; border-radius: var(--radius-pill); background: var(--warn); color: #121212; font-size: 0.62rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.nav-badge.is-bad { background: var(--bad); color: #fff; }
.botnav .nav-badge { position: absolute; top: -3px; inset-inline-end: 4px; }
.topnav .nav-badge { margin-inline-start: 0.35rem; }

/* === ALERTES (Phase 4) : dérive / hors-plage / oubli === */
/* Style DISCRET (comme les anciennes recommandations) : seule la pastille porte la couleur,
   le texte reste calme. La carte vit sous "Dernières mesures", pas en tête de page. */
.alerts-list { display: flex; flex-direction: column; }
.alert-row { display: flex; align-items: flex-start; gap: 0.55rem; padding: 0.45rem 0; font-size: 0.92rem; }
/* Pastille calée sur la PREMIÈRE ligne (pas centrée : illisible quand le texte wrappe sur mobile). */
.alert-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; margin-top: 0.5em; }
.alert-row.warn .alert-dot { background: var(--warn); }
.alert-row.bad .alert-dot { background: var(--bad); }
.alert-body { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
.alert-title { font-weight: 600; font-size: 0.92rem; }
.alert-detail { color: var(--text-secondary); font-size: 0.88rem; }
/* En-tête de la carte Alertes : titre + "i" de légende alignés. */
.alerts-head { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.35rem; }
.alerts-head h2 { margin: 0; }
/* Légende alertes (contenu du .info-pop) : titre + 2 lignes couleur + note auto. Plus large qu'un tooltip simple. */
.alerts-legend-pop { max-width: min(17rem, calc(100vw - 2.5rem)); inset-inline-start: auto; inset-inline-end: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.alerts-legend-pop b { color: var(--text-primary); }
.al-leg { display: flex; align-items: flex-start; gap: 0.45rem; }
.al-leg-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; margin-top: 0.4em; }
.al-leg-bad { background: var(--bad); }
.al-leg-warn { background: var(--warn); }
.al-leg-auto { color: var(--text-secondary); }
