/* ============================================================
   Suivi de production — styles de l'application
   Composants repris du design system Soléna Énergie.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--text-body);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  margin: 0;
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  font-weight: var(--fw-bold);
}

p { margin: 0; }
a { color: var(--forest-700); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--leaf-600); }
button { font: inherit; }

.eyebrow {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--leaf-600);
}
.muted { color: var(--text-muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Button ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 22px;
  font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-body);
  line-height: 1; letter-spacing: var(--ls-snug); white-space: nowrap;
  border-radius: var(--radius-pill); cursor: pointer;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
  background: var(--color-primary); color: var(--text-inverse); border: 2px solid var(--color-primary);
}
.btn:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: var(--text-inverse); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn--secondary { background: transparent; color: var(--color-primary); border-color: var(--border-default); }
.btn--secondary:hover { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn--ghost { background: transparent; color: var(--color-primary); border-color: transparent; }
.btn--ghost:hover { background: var(--surface-brand-soft); color: var(--color-primary); border-color: transparent; }
.btn--danger { background: var(--danger-500); border-color: var(--danger-500); }
.btn--danger:hover { background: #b53a2d; border-color: #b53a2d; }
.btn--sm { height: 38px; padding: 0 16px; font-size: var(--fs-sm); gap: 8px; }
.btn--full { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ---------- IconButton ---------- */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; padding: 0;
  border-radius: var(--radius-circle); cursor: pointer;
  background: transparent; color: var(--color-primary); border: 2px solid transparent;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.icon-btn:hover { background: var(--surface-brand-soft); color: var(--color-primary); }
.icon-btn--secondary { background: var(--surface-card); border-color: var(--border-default); }
.icon-btn--sm { width: 34px; height: 34px; }
.icon-btn.is-disabled, .icon-btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
button.icon-btn[disabled] { pointer-events: auto; }
button.icon-btn[disabled]:hover { background: transparent; }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
  font-family: var(--font-body); font-weight: var(--fw-bold); font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide); line-height: 1.4; text-transform: uppercase; white-space: nowrap;
  border-radius: var(--radius-pill);
  background: var(--leaf-100); color: var(--forest-700);
}
.badge--leaf-solid { background: var(--leaf-500); color: var(--forest-900); }
.badge--forest { background: #dde8e0; color: var(--forest-800); }
.badge--forest-solid { background: var(--forest-700); color: var(--neutral-0); }
.badge--neutral { background: var(--neutral-100); color: var(--neutral-700); }
.badge--neutral-solid { background: var(--neutral-700); color: var(--neutral-0); }
.badge--sun { background: #fdf0d3; color: #8a6410; }
.badge--sun-solid { background: var(--sun-500); color: var(--neutral-900); }
.badge--danger { background: #f8ded9; color: #a5271a; }
.badge--danger-solid { background: var(--danger-500); color: var(--neutral-0); }

/* ---------- Input ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-body); min-width: 0; }
.field__label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-body); }
.field__required { color: var(--danger-500); margin-left: 3px; }
.field__control {
  display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 46px;
  background: var(--surface-card); border: 1.5px solid var(--border-default); border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.field__control:focus-within { border-color: var(--leaf-500); box-shadow: var(--shadow-focus); }
.field__control input, .field__control select {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-family: var(--font-body); font-size: var(--fs-body); color: var(--text-strong);
}
.field__control select { height: 100%; width: 100%; cursor: pointer; }
.field__control select:disabled { cursor: not-allowed; color: var(--text-muted); }
.field__control:has(:disabled) { background: var(--surface-sunken); }
.field__hint { font-size: var(--fs-xs); color: var(--text-muted); }
.field__error { font-size: var(--fs-xs); color: var(--danger-500); }
.field--error .field__control { border-color: var(--danger-500); box-shadow: none; }

/* ---------- Checkbox ---------- */
.checkbox { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-body); color: var(--text-body); cursor: pointer; }
.checkbox__box { position: relative; display: inline-flex; width: 22px; height: 22px; }
.checkbox__box input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.checkbox__mark {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: var(--radius-xs); border: 2px solid var(--border-strong); background: var(--surface-card);
  transition: all var(--dur-fast) var(--ease-out); pointer-events: none;
}
.checkbox__mark svg { opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }
.checkbox__box input:checked + .checkbox__mark { border-color: var(--leaf-500); background: var(--leaf-500); }
.checkbox__box input:checked + .checkbox__mark svg { opacity: 1; }
.checkbox__box input:focus-visible + .checkbox__mark { box-shadow: var(--shadow-focus); }

/* ---------- Switch ---------- */
.switch { position: relative; display: inline-flex; width: 46px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch__track { width: 46px; height: 26px; border-radius: var(--radius-pill); background: var(--neutral-300); transition: background var(--dur-base) var(--ease-out); }
.switch__thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: var(--radius-circle); background: #fff; box-shadow: var(--shadow-sm); transition: left var(--dur-base) var(--ease-out); }
.switch input:checked ~ .switch__track { background: var(--leaf-500); }
.switch input:checked ~ .switch__thumb { left: 23px; }
.switch input:focus-visible ~ .switch__track { box-shadow: var(--shadow-focus); }

/* ---------- Alert ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  border-radius: var(--radius-md); font-size: var(--fs-sm); color: var(--neutral-700); line-height: var(--lh-normal);
  background: #e8f1f9; border: 1px solid #bcd6ee;
}
.alert--success { background: var(--leaf-100); border-color: var(--leaf-300); }
.alert--warning { background: #fdf3dc; border-color: #f5d98a; }
.alert--danger { background: #fae4e0; border-color: #f0b6ad; }

/* ---------- Card / StatCard ---------- */
.card {
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs); padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0;
}
.card__title { font-weight: var(--fw-semibold); font-size: var(--fs-lead); color: var(--text-strong); letter-spacing: normal; }
.stat-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  padding: var(--space-5); box-shadow: var(--shadow-xs);
}
.stat-card__figure { display: flex; align-items: baseline; gap: 6px; }
.stat-card__value { font-family: var(--font-display); font-weight: var(--fw-extrabold); font-size: var(--fs-h2); line-height: 1; color: var(--forest-700); letter-spacing: var(--ls-tight); }
.stat-card__unit { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-h4); color: var(--leaf-500); }
.stat-card--sun .stat-card__unit { color: var(--sun-500); }
.stat-card--forest .stat-card__unit { color: var(--forest-700); }
.stat-card__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat-card__label { font-size: var(--fs-sm); color: var(--text-muted); }
.stat-card__trend { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--leaf-600); }

/* ---------- Segmented control ---------- */
.segmented { display: flex; gap: 4px; padding: 4px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-pill); }
.segmented__item {
  border: 0; padding: 8px 18px; border-radius: var(--radius-pill); background: transparent; color: var(--forest-700);
  font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-sm); cursor: pointer; white-space: nowrap;
}
.segmented__item:hover { color: var(--forest-700); background: var(--surface-brand-soft); }
.segmented__item.is-active, .segmented__item.is-active:hover { background: var(--forest-700); color: #fff; }
.segmented--sm { gap: 2px; padding: 3px; background: var(--surface-page); }
.segmented--sm .segmented__item { padding: 6px 14px; font-size: var(--fs-xs); }
.segmented--form { flex-wrap: wrap; align-self: flex-start; }
.segmented--form .segmented__item { padding: 7px 14px; font-size: var(--fs-xs); }

/* ============================================================
   Connexion
   ============================================================ */
.auth { min-height: 100vh; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.auth__hero {
  background: var(--gradient-hero); color: #fff; padding: clamp(32px, 5vw, 64px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
}
.auth__hero img { width: 170px; display: block; }
.auth__pitch { display: flex; flex-direction: column; gap: 16px; max-width: 460px; }
.auth__pitch .eyebrow { color: var(--leaf-200); }
.auth__pitch h1 { color: #fff; font-size: var(--fs-h2); line-height: 1.1; text-wrap: pretty; }
.auth__pitch p { color: var(--leaf-100); line-height: 1.5; text-wrap: pretty; }
.auth__legal { font-size: var(--fs-xs); color: var(--leaf-200); }
.auth__panel { padding: clamp(32px, 5vw, 64px); display: flex; align-items: center; justify-content: center; }
.auth__form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.auth__heading { display: flex; flex-direction: column; gap: 6px; }
.auth__heading h2 { font-size: var(--fs-h3); }
.auth__heading div { font-size: var(--fs-sm); color: var(--text-muted); }
.auth__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.link-button { border: 0; padding: 0; background: none; cursor: pointer; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--forest-700); }
.link-button:hover { color: var(--leaf-600); }
.auth__footnote { font-size: var(--fs-xs); color: var(--text-muted); text-align: center; }
.auth__footnote a { color: inherit; }

/* ---------- Pages légales (politique de confidentialité) ---------- */
.legal { background: var(--surface-page); min-height: 100vh; display: flex; flex-direction: column; }
.legal__header { background: var(--gradient-hero); padding: 24px 16px; display: flex; justify-content: center; }
.legal__header img { width: 140px; display: block; }
.legal__content {
  width: 100%; max-width: 760px; margin: 0 auto; padding: 40px 16px 56px;
  display: flex; flex-direction: column; gap: 14px; line-height: 1.6; color: var(--text-body);
}
.legal__content h1 { font-size: var(--fs-h3); line-height: 1.15; }
.legal__content h2 { font-size: var(--fs-lead); margin-top: 18px; }
.legal__content ul { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.legal__content a { color: var(--forest-700); font-weight: var(--fw-semibold); }
.legal__updated { font-size: var(--fs-sm); color: var(--text-muted); }
.legal__footer { margin-top: auto; padding: 20px 16px; text-align: center; font-size: var(--fs-xs); color: var(--text-muted); }

/* ============================================================
   Application : barre latérale + contenu
   ============================================================ */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  background: var(--forest-900); color: #fff; padding: 24px 20px;
  display: flex; flex-direction: column; gap: 24px;
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
}
.sidebar__logo { width: 150px; display: block; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar__section { font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: var(--ls-caps); text-transform: uppercase; color: var(--leaf-300); padding: 0 12px 8px; }
.sidebar__section + .nav-item, .sidebar__section:first-child { margin-top: 0; }
.nav-item + .sidebar__section { padding-top: 14px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius-md);
  background: transparent; color: var(--leaf-100);
  font-family: var(--font-display); font-weight: var(--fw-medium); font-size: var(--fs-sm);
  transition: background var(--dur-base) var(--ease-out);
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.is-active { background: rgba(255,255,255,.12); color: #fff; }
.nav-item__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.nav-item__icon { flex: none; margin-left: -4px; }
.nav-item__label { flex: 1; }
.nav-item__meta { font-family: var(--font-body); font-size: var(--fs-xs); color: var(--leaf-300); }
.nav-item__count {
  min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: var(--radius-pill);
  background: var(--danger-500); color: #fff; font-family: var(--font-body); font-size: var(--fs-xs); font-weight: var(--fw-bold);
  display: flex; align-items: center; justify-content: center;
}
.sidebar__status { margin-top: auto; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-xs); color: var(--leaf-200); line-height: 1.5; }
.sidebar__status div:first-child { display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--leaf-400); box-shadow: 0 0 0 4px rgba(121,192,105,.25); }
.sidebar__status div:last-child { color: var(--neutral-400); }

/* ---------- Barre du haut et menu mobile (largeur <= 900 px) ---------- */
/* Conteneur du menu mobile : sans boîte propre, pour ne pas occuper de case de la
   grille .app (sinon le contenu passe sous la barre latérale sur ordinateur). */
.topbar-wrap { display: contents; }
.topbar { display: none; }
@media (max-width: 900px) {
  .topbar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 40;
    padding: 12px clamp(20px, 3vw, 44px);
    background: var(--forest-900); color: #fff;
  }
}
.topbar__burger {
  width: 44px; height: 44px; flex: none; margin-left: -10px; border: 0; border-radius: var(--radius-md);
  background: transparent; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.topbar__burger:hover { background: rgba(255,255,255,.1); }
.topbar__logo { width: 120px; display: block; }
.topbar__label {
  flex: 1; min-width: 0; font-family: var(--font-display); font-weight: var(--fw-medium); font-size: var(--fs-sm);
  color: var(--leaf-200); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right;
}
.topbar__avatar {
  width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: var(--leaf-500); color: var(--forest-900);
  font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.nav-drawer { position: fixed; inset: 0; z-index: 60; display: flex; }
.nav-drawer[hidden] { display: none; }
@media (min-width: 901px) { .nav-drawer { display: none !important; } }
.nav-drawer__overlay { position: absolute; inset: 0; background: rgba(12,49,23,.45); }
.nav-drawer__panel {
  position: relative; width: min(300px, 86vw); height: 100%; overflow-y: auto; box-sizing: border-box;
  background: var(--forest-900); color: #fff; padding: 16px 16px 24px;
  display: flex; flex-direction: column; gap: 20px; box-shadow: var(--shadow-lg);
}
.nav-drawer__panel:focus { outline: none; }
.nav-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nav-drawer__logo { width: 130px; display: block; }
.nav-drawer__close {
  width: 44px; height: 44px; flex: none; border: 0; border-radius: var(--radius-md);
  background: transparent; color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
}
.nav-drawer__close:hover { background: rgba(255,255,255,.1); }
.nav-drawer nav { display: flex; flex-direction: column; gap: 2px; }
.nav-drawer .nav-item { min-height: 48px; padding: 0 12px; }
.nav-drawer__footer {
  margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.14);
  display: flex; align-items: center; gap: 10px;
}
.nav-drawer__email { flex: 1; min-width: 0; font-size: var(--fs-xs); color: var(--leaf-200); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-drawer__logout {
  flex: none; min-height: 40px; padding: 0 12px; border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius-pill);
  background: transparent; color: #fff; font-family: var(--font-display); font-weight: var(--fw-medium); font-size: var(--fs-xs); cursor: pointer;
}
.nav-drawer__logout:hover { background: rgba(255,255,255,.1); }

body.nav-drawer-open { overflow: hidden; }

.user-menu { position: relative; }
.user-menu__toggle {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px;
  border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius-md);
  background: transparent; color: #fff; cursor: pointer; text-align: left;
}
.user-menu__toggle:hover, .user-menu.is-open .user-menu__toggle, .user-menu__toggle.is-active { background: rgba(255,255,255,.1); }
.avatar {
  width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--leaf-500); color: var(--forest-900);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-sm);
}
.user-menu__who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.user-menu__who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu__name { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.user-menu__role { font-size: var(--fs-xs); color: var(--leaf-200); }
.user-menu__chevron { flex: none; color: var(--leaf-200); }
.user-menu__panel {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px);
  background: var(--surface-card); border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  padding: 6px; display: none; flex-direction: column; gap: 2px; z-index: 10;
}
.user-menu.is-open .user-menu__panel { display: flex; }
.user-menu__email { padding: 10px 12px 8px; font-size: var(--fs-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0;
  border-radius: var(--radius-sm); background: transparent; color: var(--text-strong);
  font-family: var(--font-body); font-size: var(--fs-sm); font-weight: var(--fw-semibold); cursor: pointer; text-align: left;
}
.menu-item:hover { background: var(--surface-brand-soft); color: var(--text-strong); }
.menu-item--danger { color: var(--danger-500); }
.menu-item--danger:hover { background: #fae4e0; color: var(--danger-500); }

.main { padding: 32px clamp(20px, 3vw, 44px) 56px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-header__titles { display: flex; flex-direction: column; gap: 6px; }
.page-header h1 { font-size: var(--fs-h2); line-height: 1.1; }
.page-header__sub { font-size: var(--fs-sm); color: var(--text-muted); }

.flash { margin-bottom: -8px; }

/* ---------- Sélecteur de période ---------- */
.period-picker { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.period-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.date-chip {
  position: relative; display: flex; align-items: center; gap: 8px; min-width: 210px; justify-content: center;
  padding: 7px 14px; border-radius: var(--radius-pill); background: var(--surface-card); border: 1px solid var(--border-subtle);
  font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-sm); line-height: inherit; color: var(--forest-700); cursor: pointer;
}
.date-chip:hover { background: var(--leaf-100); }
.date-chip.is-open { background: var(--leaf-100); border-color: var(--leaf-500); }
.date-chip__chevron { opacity: .7; flex: none; }

/* Sélecteur de date (maquette « Sélecteur Date ») : calendrier, mois ou années, partagé web et app. */
.date-menu { position: relative; display: flex; justify-content: center; }
.date-menu__pop {
  position: absolute; top: calc(100% + 8px); z-index: 40; width: 300px; max-width: calc(100vw - 16px); box-sizing: border-box; padding: 14px;
  display: flex; flex-direction: column; gap: 12px; text-align: left;
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.date-menu__pop--right { right: 0; }
.date-menu__pop--left { left: 0; }
.date-menu__pop--center { left: 50%; transform: translateX(-50%); }
.date-menu__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.date-menu__nav {
  width: 32px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center; padding: 0;
  border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--forest-700); cursor: pointer;
}
.date-menu__nav:hover:not(:disabled) { background: var(--leaf-100); }
.date-menu__nav:disabled { opacity: .35; cursor: default; }
.date-menu__nav.is-hidden { visibility: hidden; }
.date-menu__selects { display: flex; gap: 4px; }
.date-menu__select {
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 4px 6px; background: var(--surface-page); cursor: pointer;
  font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-sm); color: var(--text-strong);
}
.date-menu__title { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-sm); color: var(--text-strong); }
.date-menu__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; }
.date-menu__dow { padding: 4px 0; text-align: center; font-size: 11px; font-weight: var(--fw-bold); letter-spacing: var(--ls-caps); text-transform: uppercase; color: var(--text-muted); }
.date-menu__day {
  height: 36px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 400; color: var(--text-strong); font-variant-numeric: tabular-nums;
}
.date-menu__day:hover:not(:disabled):not(.is-selected):not(.is-week) { background: var(--leaf-100); }
.date-menu__day.is-out { opacity: .5; }
.date-menu__day:disabled { opacity: .35; cursor: default; }
.date-menu__day.is-today { font-weight: var(--fw-bold); box-shadow: inset 0 0 0 1.5px var(--leaf-500); }
.date-menu__day.is-selected { background: var(--forest-700); color: #fff; font-weight: var(--fw-bold); box-shadow: none; }
.date-menu__day.is-week { border-radius: 0; background: var(--leaf-100); font-weight: var(--fw-bold); box-shadow: none; }
.date-menu__day.is-week-start, .date-menu__day.is-week-end { background: var(--forest-700); color: #fff; }
.date-menu__day.is-week-start { border-radius: 999px 0 0 999px; }
.date-menu__day.is-week-end { border-radius: 0 999px 999px 0; }
.date-menu__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.date-menu__cell {
  height: 40px; border: 0; border-radius: var(--radius-sm); background: var(--surface-page); cursor: pointer;
  font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-sm); color: var(--text-strong);
}
.date-menu__cell:hover:not(:disabled):not(.is-selected) { background: var(--leaf-100); }
.date-menu__cell:disabled { opacity: .35; cursor: default; }
.date-menu__cell.is-today { box-shadow: inset 0 0 0 1.5px var(--leaf-500); }
.date-menu__cell.is-selected { background: var(--forest-700); color: #fff; box-shadow: none; }
.date-menu__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.date-menu__hint { font-size: var(--fs-xs); color: var(--text-muted); }
.date-menu__foot .btn { height: 32px; padding: 0 12px; flex: none; }


.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); gap: 16px; align-items: start; }

/* ---------- Graphique ---------- */
.chart-card { grid-column: 1 / -1; gap: 28px; }
.chart-card__head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-start; }
.chart-card__head h2 { font-weight: var(--fw-semibold); font-size: var(--fs-h4); letter-spacing: normal; }
.chart-card__tooltip { font-size: var(--fs-sm); color: var(--text-muted); min-height: 21px; }
.chart-card__tools { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: var(--fs-sm); color: var(--neutral-600); }
.legend__item { display: flex; align-items: center; gap: 8px; }
.legend__swatch { width: 14px; border-radius: 3px; }

/* Contrats appliqués sur la période, sous le graphique */
.applied-contracts { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 10px; }
.applied-contracts__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.applied-contracts__card {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 12px 14px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-page);
}
.applied-contracts__dot { width: 10px; height: 10px; border-radius: var(--radius-circle); margin-top: 5px; }
.applied-contracts__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.applied-contracts__title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.applied-contracts__label { font-size: var(--fs-xs); color: var(--text-body); }
.applied-contracts__dates { font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.applied-contracts__revenue {
  font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-sm); color: var(--text-strong);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

.chart { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; margin-top: 16px; }
.chart__axis { position: relative; height: 260px; }
/* Axe de droite (prix spot, €/MWh) */
.chart--spot { grid-template-columns: 64px minmax(0, 1fr) 56px; }
.chart__axis--right .chart__tick { right: auto; left: 0; }
.chart__tick { position: absolute; right: 0; transform: translateY(50%); font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }
.chart__plot { position: relative; height: 260px; min-width: 0; }
.chart__plot--curve { cursor: crosshair; }
.chart__grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--border-subtle); }
.chart__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart__now {
  position: absolute; top: -4px; transform: translateX(-50%); background: var(--forest-700); color: #fff;
  font-size: var(--fs-xs); font-weight: var(--fw-bold); padding: 2px 8px; border-radius: var(--radius-pill); white-space: nowrap;
}
.chart__hover-line { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--forest-900); pointer-events: none; }
.chart__hover-dot { position: absolute; width: 10px; height: 10px; margin: 0 0 -5px -5px; border-radius: 50%; background: #fff; border: 2.5px solid; pointer-events: none; }
.chart__hover-box {
  position: absolute; top: 28px; background: var(--surface-card); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-md);
  border-radius: var(--radius-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px;
  pointer-events: none; white-space: nowrap; z-index: 2;
}
.chart__hover-time { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-sm); color: var(--text-strong); }
.chart__hover-row { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--neutral-600); }
.chart__hover-row span:first-child { width: 10px; height: 3px; border-radius: 2px; }
.chart__hover-row span:nth-child(2) { flex: 1; }
.chart__hover-row span:last-child { font-weight: var(--fw-bold); color: var(--text-strong); margin-left: 12px; }
.chart__bars { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.chart__bar {
  flex: 1; min-width: 0; height: 100%; position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  border-radius: 6px 6px 0 0; cursor: default;
}
a.chart__bar { cursor: pointer; }
.chart__bar:hover { background: var(--surface-sunken); }
.chart__bar-target { position: absolute; left: -3px; right: -3px; border-top: 2px solid var(--forest-900); }
.chart__bar-segment:first-of-type { border-radius: 4px 4px 0 0; }
.chart__bar-segment { box-sizing: border-box; }
.chart__x { display: flex; font-size: var(--fs-xs); color: var(--text-muted); }
.chart__x div { flex: 1; min-width: 0; white-space: nowrap; overflow: visible; }

/* ---------- Cartes centrales (vue d'ensemble) ---------- */
.plant-card {
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
  padding: 24px; display: flex; flex-direction: column; gap: 20px; color: inherit;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.plant-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); color: inherit; }
.plant-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.plant-card__id { display: flex; gap: 14px; align-items: center; }
.plant-card__tile { width: 48px; height: 48px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex: none; }
.plant-card__tile--solaire { background: #fdf0d3; color: #8a6410; }
.plant-card__tile--hydro { background: var(--leaf-100); color: var(--forest-600); }
.plant-card__tile--stockage { background: var(--leaf-100); color: var(--leaf-600); }
.plant-card h3 { font-weight: var(--fw-semibold); font-size: var(--fs-h4); letter-spacing: normal; }
.plant-card__sub { font-size: var(--fs-sm); color: var(--text-muted); }
.plant-card__power { display: flex; flex-direction: column; gap: 8px; }
.plant-card__power > div:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.plant-card__value { font-family: var(--font-display); font-weight: var(--fw-extrabold); font-size: var(--fs-h3); color: var(--forest-700); letter-spacing: var(--ls-tight); }
.plant-card__unit { font-family: var(--font-display); font-weight: var(--fw-semibold); color: var(--leaf-600); margin-left: 6px; }
.gauge { height: 8px; background: var(--surface-sunken); border-radius: var(--radius-pill); overflow: hidden; }
.gauge div { height: 100%; border-radius: var(--radius-pill); transition: width var(--dur-slow) var(--ease-out); }
.plant-card__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 12px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat div:first-child { font-size: var(--fs-xs); color: var(--text-muted); }
.stat div:last-child { font-family: var(--font-display); font-weight: var(--fw-semibold); color: var(--text-strong); }

/* ---------- Production en direct (relevés des onduleurs) ---------- */
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(93,173,77,.6); } 70% { box-shadow: 0 0 0 7px rgba(93,173,77,0); } 100% { box-shadow: 0 0 0 0 rgba(93,173,77,0); } }
.live-badge { align-self: flex-start; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 6px 14px 6px 12px; border-radius: var(--radius-pill); background: var(--leaf-100); font-size: var(--fs-sm); line-height: 1.3; }
.live-badge__dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--leaf-500); animation: livePulse 2s ease-out infinite; }
.live-badge__label { font-weight: var(--fw-bold); color: var(--forest-700); }
.live-badge__power { font-family: var(--font-display); font-weight: var(--fw-bold); color: var(--text-strong); }
.live-badge__ago { color: var(--text-muted); }
.live-badge--stale { background: var(--surface-sunken); }
.live-badge--stale .live-badge__dot { background: var(--neutral-400); animation: none; }
.live-badge--stale .live-badge__label { color: var(--text-muted); }
.live-badge--card { padding: 5px 12px 5px 10px; font-size: var(--fs-xs); margin-bottom: -8px; }
.live-badge--compact { gap: 7px; padding: 4px 11px 4px 9px; font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .live-badge__dot { animation: none; } }

/* ---------- Fiche centrale ---------- */
.empty { font-size: var(--fs-sm); color: var(--text-muted); padding: 12px 0; border-top: 1px solid var(--border-subtle); }

/* ---------- Profil ---------- */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; }
.profile-card { padding: 28px; gap: 24px; }
.profile-id { display: flex; align-items: center; gap: 18px; }
.avatar--lg { width: 72px; height: 72px; background: var(--leaf-100); color: var(--forest-700); font-size: var(--fs-h4); }
.profile-id__name { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-h4); color: var(--text-strong); }
.profile-id__meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: var(--fs-sm); color: var(--text-muted); }
.profile-rows { display: flex; flex-direction: column; }
.profile-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--border-subtle); font-size: var(--fs-sm); }
.profile-row div:first-child { color: var(--text-muted); }
.profile-row div:last-child { color: var(--text-strong); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.site-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border-subtle); color: inherit; }
.site-row:hover { color: inherit; background: var(--surface-page); }
.site-row__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.site-row__text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.site-row__text span:first-child { font-family: var(--font-display); font-weight: var(--fw-semibold); color: var(--text-strong); }
.site-row__text span:last-child { font-size: var(--fs-xs); color: var(--text-muted); }
.notif { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
.notif__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.notif__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif__channels { display: flex; flex-wrap: wrap; gap: 8px; }
/* Pastille de canal (E-mail, Notification mobile) : case à cocher masquée, état porté par la pastille. */
.notif-channel {
  position: relative; height: 32px; padding: 0 14px; box-sizing: border-box;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border-radius: var(--radius-pill); border: 1.5px solid var(--border-default);
  background: var(--surface-card); color: var(--forest-700);
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  transition: background var(--dur-fast, 160ms) var(--ease-out), color var(--dur-fast, 160ms) var(--ease-out);
}
.notif-channel input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.notif-channel:has(input:checked) { background: var(--forest-700); border-color: var(--forest-700); color: #fff; }
.notif-channel:has(input:focus-visible) { outline: 2px solid var(--leaf-500); outline-offset: 2px; }
.notif__label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.notif__hint { font-size: var(--fs-xs); color: var(--text-muted); }

/* ---------- Administration ---------- */
.admin-card { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); display: flex; flex-direction: column; min-width: 0; }
.admin-card__head { padding: 20px 24px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-subtle); }
.admin-card__head h2 { font-weight: var(--fw-semibold); font-size: var(--fs-h4); letter-spacing: normal; }
.admin-card__tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.admin-card__tools .field { width: 260px; }
.table-scroll { overflow-x: auto; }
/* La table prend la largeur de ses colonnes (au moins celle du conteneur) : fonds et séparateurs vont jusqu'au bout. */
.table { display: flex; flex-direction: column; width: 100%; min-width: min-content; }
.table__row { display: grid; gap: 16px; padding: 14px 24px; align-items: center; border-top: 1px solid var(--border-subtle); font-size: var(--fs-sm); }
.table__row:hover { background: var(--surface-page); }
.table__row--head, .table__row--head:hover { padding: 12px 24px; background: var(--surface-page); border-top: 0; font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: var(--ls-wide); text-transform: uppercase; color: var(--text-muted); }
.table--plants .table__row { grid-template-columns: minmax(160px, 1.3fr) minmax(150px, 1.1fr) 170px 100px 200px minmax(120px, 1fr) 130px 76px; }
.table--users .table__row { grid-template-columns: minmax(180px, 1.3fr) minmax(200px, 1.3fr) minmax(160px, 1fr) 150px 150px 76px; }
.cell-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-name span:last-child { font-family: var(--font-display); font-weight: var(--fw-semibold); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cell-num { font-variant-numeric: tabular-nums; color: var(--text-strong); }
.cell-prm { letter-spacing: .02em; }
.cell-right { text-align: right; }
.cell-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-stack span:first-child { color: var(--text-strong); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.cell-stack span:last-child { font-size: var(--fs-xs); color: var(--text-muted); }
.cell-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-actions { display: flex; gap: 4px; justify-content: flex-end; }
.table__empty { padding: 40px 24px; text-align: center; font-size: var(--fs-sm); color: var(--text-muted); border-top: 1px solid var(--border-subtle); }

/* ---------- Fenêtres modales ---------- */
.modal { position: fixed; inset: 0; background: rgba(12,49,23,.45); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50; }
.modal__close-area { position: absolute; inset: 0; }
.modal__dialog {
  position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 48px); overflow-y: auto;
  background: var(--surface-card); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  padding: 28px; display: flex; flex-direction: column; gap: 18px;
}
.modal__dialog--sm { max-width: 440px; gap: 16px; }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.modal__head h2 { font-size: var(--fs-h4); }
.modal__text { font-size: var(--fs-sm); color: var(--text-body); line-height: 1.5; }
.modal__actions { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.contract-box { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--surface-page); border-radius: var(--radius-lg); }
.contract-box__title { font-family: var(--font-display); font-weight: var(--fw-semibold); color: var(--text-strong); }
.contract-box__sub { font-size: var(--fs-xs); color: var(--text-muted); }
.contract-box [hidden] { display: none !important; }
.contract-box .form-grid { gap: 14px; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
}

@media (max-width: 860px) {
  .period-picker { align-items: flex-start; }
}

/* Journée sans mesure Enedis */
.chart__bar--missing::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 0; height: 3px; border-radius: 2px; background: var(--neutral-300); }
.live-dot--off { background: var(--neutral-400); box-shadow: 0 0 0 4px rgba(154,165,147,.25); }

/* Pastilles de choix (boutons radio) */
.segmented--radio .segmented__item { position: relative; display: inline-flex; align-items: center; }
.segmented--radio input { position: absolute; opacity: 0; pointer-events: none; }
.segmented--radio .segmented__item:has(input:checked) { background: var(--forest-700); color: #fff; }
.segmented--radio .segmented__item:has(input:focus-visible) { box-shadow: var(--shadow-focus); }

/* Page d'édition d'une centrale */
.edit-page { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.edit-page__main { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.edit-page__back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-sm); color: var(--forest-700); }
.edit-section { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.edit-section__head { display: flex; flex-direction: column; gap: 2px; }
.edit-section__head h2 { font-weight: var(--fw-semibold); font-size: var(--fs-lead); letter-spacing: normal; }
.edit-section__head div { font-size: var(--fs-sm); color: var(--text-muted); }
.form-grid--wide { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form-row { display: flex; flex-wrap: wrap; gap: 20px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px; background: var(--surface-page); border-radius: var(--radius-md); }
.toggle-row__label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.toggle-row__hint { font-size: var(--fs-xs); color: var(--text-muted); }
.edit-aside { flex: 0 1 320px; min-width: 280px; position: sticky; top: 24px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.edit-aside__number { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-h4); color: var(--forest-700); overflow-wrap: anywhere; }
.edit-aside__row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-subtle); font-size: var(--fs-sm); }
.edit-aside__row span:first-child { color: var(--text-muted); }
.edit-aside__row span:last-child { color: var(--text-strong); font-weight: var(--fw-semibold); text-align: right; }
.edit-aside__actions { display: flex; flex-direction: column; gap: 8px; }
.email-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.email-tag { display: inline-flex; align-items: center; gap: 7px; padding: 7px 8px 7px 14px; font-weight: var(--fw-semibold); font-size: var(--fs-sm); line-height: 1; color: var(--neutral-700); background: var(--surface-card); border: 1.5px solid var(--border-default); border-radius: var(--radius-pill); }
.email-tag button { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0; border: none; border-radius: var(--radius-circle); background: var(--neutral-200); color: var(--neutral-700); cursor: pointer; font-size: 12px; line-height: 1; }
.email-add { display: flex; gap: 8px; align-items: flex-start; }
.email-add .field { flex: 1; }

/* Facturation */
.invoice-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.table--invoices .table__row { grid-template-columns: 150px minmax(120px, 1fr) 130px 100px 120px 110px 130px 110px 24px; }
.invoice-row { border-top: 1px solid var(--border-subtle); }
.invoice-row > summary { list-style: none; cursor: pointer; border-top: 0; }
.invoice-row > summary::-webkit-details-marker { display: none; }
.invoice-row[open] > summary { background: var(--surface-page); }
.invoice-row__chevron { color: var(--text-muted); display: flex; justify-content: flex-end; transition: transform var(--dur-base) var(--ease-out); }
.invoice-row[open] .invoice-row__chevron { transform: rotate(180deg); }
.invoice-row__sub { font-size: var(--fs-xs); color: var(--text-muted); font-weight: var(--fw-regular); }
.invoice-row__late { color: var(--danger-500) !important; }
.invoice-row__panel { display: flex; flex-wrap: wrap; gap: 24px; padding: 8px 24px 24px; background: var(--surface-page); }
.invoice-row__block { flex: 1 1 300px; display: flex; flex-direction: column; gap: 4px; }
.invoice-row__actions { flex: 0 0 220px; display: flex; flex-direction: column; gap: 8px; }
.invoice-row__actions form { display: contents; }
.invoice-event { display: grid; grid-template-columns: 10px 84px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--border-subtle); font-size: var(--fs-sm); }
.invoice-event__dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--neutral-300); }
.invoice-event__dot--forest { background: var(--forest-600); }
.invoice-event__dot--leaf { background: var(--leaf-500); }
.invoice-event__dot--sun { background: var(--sun-500); }
.invoice-event__dot--danger { background: var(--danger-500); }
.invoice-event__date { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.invoice-event__title { font-weight: var(--fw-semibold); color: var(--text-strong); }

/* Contrats de vente (page centrale) */
.edit-section__head--actions { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.edit-section__head--actions > div { display: flex; flex-direction: column; gap: 2px; flex: 1 1 280px; }
.contracts-list { display: flex; flex-direction: column; gap: 8px; }
.contracts-list:not(:has(> :not([hidden]))) { display: none; }
.contract { display: flex; flex-direction: column; gap: 8px; }
.contract[hidden], .contract [hidden], .contracts-empty[hidden] { display: none !important; }
.contracts-empty { padding: 18px; border: 1.5px dashed var(--border-default); border-radius: var(--radius-md); font-size: var(--fs-sm); color: var(--text-muted); text-align: center; }
.contract-card { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 16px; border: 1.5px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-card); }
.contract-card.is-editing { border-color: var(--leaf-500); }
.contract-card__dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; }
.contract-card__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.contract-card__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.contract-card__ref { font-family: var(--font-display); font-weight: var(--fw-semibold); color: var(--text-strong); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.contract-card__dates { font-size: var(--fs-sm); color: var(--text-body); font-variant-numeric: tabular-nums; }
.contract-card__label { font-size: var(--fs-sm); color: var(--text-strong); font-weight: var(--fw-semibold); }
.contract-card__detail { font-weight: var(--fw-regular); color: var(--text-muted); }
.contract-card__actions { display: flex; gap: 12px; align-items: center; padding-top: 2px; }
.contract-card__edit, .contract-card__remove { padding: 0; border: 0; background: transparent; font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-sm); cursor: pointer; }
.contract-card__edit { color: var(--forest-700); }
.contract-card__edit:hover { color: var(--leaf-600); }
.contract-card__remove { color: var(--danger-500); }
.contract-gap { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border: 1.5px dashed var(--sun-500); border-radius: var(--radius-md); font-size: var(--fs-xs); color: var(--text-body); }
.contract-gap__icon { color: var(--warning-500); flex: none; }
.contract-editor { display: flex; flex-direction: column; gap: 16px; padding: 20px; border: 1.5px solid var(--leaf-500); border-radius: var(--radius-md); background: var(--surface-page); }
.contract-editor__title { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-body); color: var(--text-strong); }
.contract-editor__group { display: flex; flex-direction: column; gap: 14px; }
.contract-editor__group .form-grid { gap: 14px; }
.contract-editor__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .contract-card { grid-template-columns: 10px minmax(0, 1fr); }
  .contract-card__actions { grid-column: 2; }
}

/* Prix spot */
.spot-page { display: contents; }
.spot-pending { padding: 64px 24px; align-items: center; text-align: center; }
.spot-pending__icon { width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--leaf-100); color: var(--forest-600); display: flex; align-items: center; justify-content: center; }
.spot-pending__title { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-h4); color: var(--text-strong); text-wrap: balance; }
.spot-pending a { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.spot-alert { font-size: var(--fs-body); text-wrap: pretty; }
.spot-alert__icon { flex: none; margin-top: 1px; color: var(--danger-500); }
.spot-alert strong { color: var(--text-strong); }
.kpis--spot { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpis--spot .stat-card { min-width: 0; }
.kpis--spot .stat-card__figure { flex-wrap: wrap; column-gap: 6px; row-gap: 0; }
.kpis--spot .stat-card__value { font-size: var(--fs-h3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpis--spot .stat-card__unit { font-size: var(--fs-lead); }
.stat-card--danger .stat-card__unit { color: var(--danger-500); }
.stat-card--danger .stat-card__trend { color: #a5271a; }
.stat-card--empty .stat-card__value { color: var(--neutral-400); }
.spot-veille-toggle { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--neutral-600); cursor: pointer; }
.legend__swatch--dashed { height: 0; border-top: 1px dashed var(--neutral-500); }
.spot-chart { grid-template-columns: 44px minmax(0, 1fr); }
.spot-chart__plot { cursor: crosshair; }
.spot-chart__bars { position: absolute; inset: 0; display: flex; gap: 1px; }
.spot-chart__bar { flex: 1; min-width: 0; height: 100%; position: relative; }
.spot-chart__bar.is-hover { background: var(--surface-sunken); }
.spot-chart__bar span { position: absolute; left: 0; right: 0; background: var(--forest-700); border-radius: 2px 2px 0 0; }
.spot-chart__bar.is-negative span { background: var(--danger-500); border-radius: 0 0 2px 2px; }
.spot-chart.is-estimated .spot-chart__bar span { opacity: .55; }
.spot-chart__zero { position: absolute; left: -4px; right: 0; border-top: 1.5px solid var(--forest-900); pointer-events: none; }
.spot-chart__veille { pointer-events: none; }
.is-veille-off .spot-chart__veille, .is-veille-off .spot-chart__veille-legend { display: none; }
.spot-chart__tip { top: 8px; }
.spot-chart__tip[hidden] { display: none; }
.spot-chart__tip-row span:first-child { height: 0; border-top: 2px dashed var(--neutral-500); border-radius: 0; }
.spot-chart__x { position: relative; height: 16px; font-size: var(--fs-xs); color: var(--text-muted); }
.spot-chart__x div { position: absolute; top: 0; white-space: nowrap; }
.spot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.spot-table > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; }
.spot-table > summary::-webkit-details-marker { display: none; }
.spot-table__heading { display: flex; flex-direction: column; gap: 2px; }
.spot-table__title { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-lead); color: var(--text-strong); }
.spot-table__sub { font-size: var(--fs-xs); color: var(--text-muted); }
.spot-table__chevron { flex: none; color: var(--forest-700); transition: transform var(--dur-base) var(--ease-out); }
.spot-table[open] .spot-table__chevron { transform: rotate(180deg); }
.spot-table__grid { display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; }
.spot-table__head, .spot-table__row { display: grid; grid-template-columns: 48px repeat(4, minmax(0, 1fr)); gap: 2px; align-items: center; }
.spot-table__head { padding-bottom: 6px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--text-muted); }
.spot-table__head span { text-align: right; padding: 0 8px; }
.spot-table__row { font-size: var(--fs-sm); }
.spot-table__hour { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--text-muted); }
.spot-table__cell { text-align: right; padding: 5px 8px; border-radius: var(--radius-sm); white-space: nowrap; color: var(--text-body); }
.spot-table__cell.is-negative { background: #f8ded9; color: #a5271a; font-weight: var(--fw-bold); }
.spot-table__cell.is-hover { outline: 2px solid var(--forest-700); outline-offset: -2px; }
@media (min-width: 861px) {
  .spot-table > summary { pointer-events: none; cursor: default; }
  .spot-table__chevron { display: none; }
}
.spot-plants { gap: 8px; }
.spot-plants h2 { margin-bottom: 8px; font-weight: var(--fw-semibold); font-size: var(--fs-lead); letter-spacing: normal; }
.spot-plant { display: flex; flex-direction: column; gap: 12px; padding: 14px 0 4px; border-top: 1px solid var(--border-subtle); }
.spot-plant__id { display: flex; align-items: center; gap: 12px; }
.spot-plant__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.spot-plant__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.spot-plant__name { font-family: var(--font-display); font-weight: var(--fw-semibold); color: var(--text-strong); }
.spot-plant__meta { font-size: var(--fs-xs); color: var(--text-muted); }
.spot-plant__figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.spot-plant__figure { background: var(--surface-page); border-radius: var(--radius-md); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.spot-plant__figure > div:first-child { font-size: var(--fs-xs); color: var(--text-muted); }
.spot-plant__figure > div:last-child { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--neutral-600); }
.spot-plant__value { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-h4); color: var(--forest-700); font-variant-numeric: tabular-nums; }
.spot-plants__empty { padding: 14px 0 4px; border-top: 1px solid var(--border-subtle); font-size: var(--fs-sm); color: var(--text-muted); }
@media (max-width: 860px) {
  .kpis--spot { grid-template-columns: minmax(0, 1fr); }
  .spot-chart__x .is-minor { display: none; }
}

/* Alertes */
.alerts-current { display: flex; flex-direction: column; gap: 14px; }
.alerts-current h2, .alerts-resolved h2 { font-weight: var(--fw-semibold); font-size: var(--fs-h4); letter-spacing: normal; }
.alerts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: stretch; }
.alert-card {
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs); padding: 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.alert-card__head { display: flex; align-items: center; gap: 12px; }
.alert-card__tile { flex: none; width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.alert-card__tile--critique { background: #fae4e0; color: var(--danger-500); }
.alert-card__tile--surveiller { background: #fdf0d3; color: #8a6410; }
.alert-card__tile--information { background: #e8f1f9; color: var(--info-500); }
.alert-card__since { margin-left: auto; font-size: var(--fs-xs); color: var(--text-muted); text-align: right; }
.alert-card__heading { display: flex; flex-direction: column; gap: 4px; }
.alert-card__context { font-size: var(--fs-sm); color: var(--text-muted); }
.alert-card__title { font-weight: var(--fw-semibold); font-size: var(--fs-lead); letter-spacing: normal; color: var(--text-strong); overflow-wrap: anywhere; }
.alert-card__detail { flex: 1; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-body); text-wrap: pretty; }
.alert-card__actions { display: flex; }
/* Retour à la normale annoncé (alertes hydrauliques, maquette La Louge). */
.alert-card__back { padding-top: 10px; border-top: 1px solid var(--border-subtle); font-size: var(--fs-xs); color: var(--text-muted); }
.alerts-empty { padding: 40px 24px; align-items: center; gap: 12px; text-align: center; }
.alerts-empty__icon { width: 52px; height: 52px; border-radius: var(--radius-md); background: var(--leaf-100); color: var(--forest-600); display: flex; align-items: center; justify-content: center; }
.alerts-empty__title { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-lead); color: var(--text-strong); }
.alerts-empty p { max-width: 440px; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-muted); text-wrap: pretty; }
.alerts-resolved { overflow: hidden; }
.alerts-resolved__head { padding: 20px 24px; border-bottom: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 4px; }
.alerts-resolved__head div { font-size: var(--fs-sm); color: var(--text-muted); }
.alerts-resolved__row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 14px; padding: 16px 24px; border-bottom: 1px solid var(--border-subtle); align-items: start; }
.alerts-resolved__row:last-child { border-bottom: 0; }
.alerts-resolved__icon { color: var(--leaf-500); }
.alerts-resolved__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.alerts-resolved__what { font-size: var(--fs-sm); color: var(--text-strong); }
.alerts-resolved__sub { font-size: var(--fs-xs); line-height: 1.4; color: var(--text-muted); }
.alerts-resolved__when { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--leaf-600); white-space: nowrap; }
.alerts-resolved__empty { padding: 16px 24px; font-size: var(--fs-sm); color: var(--text-muted); }
@media (max-width: 860px) {
  .alert-card { padding: 20px; }
  .alert-card__head { flex-wrap: wrap; }
  .alerts-resolved__row { grid-template-columns: 20px minmax(0, 1fr); padding: 14px 20px; }
  .alerts-resolved__when { grid-column: 2; }
  .alerts-resolved__head { padding: 16px 20px; }
}

/* ============================================================
   Page « Onduleurs » (maquette « Nabirat · Onduleurs »)
   ============================================================ */
.plant-tabs { align-self: flex-start; display: flex; gap: 4px; padding: 4px; margin-top: 10px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-pill); }
.plant-tabs__tab {
  display: flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: var(--radius-pill);
  font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-sm); color: var(--forest-700);
}
.plant-tabs__tab:hover { color: var(--forest-700); background: var(--surface-page); }
.plant-tabs__tab.is-active, .plant-tabs__tab.is-active:hover { background: var(--forest-700); color: #fff; }
.plant-tabs__count {
  min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: var(--radius-pill); background: var(--danger-500); color: #fff;
  font-family: var(--font-body); font-size: var(--fs-xs); font-weight: var(--fw-bold); display: flex; align-items: center; justify-content: center;
}

.inverters-page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.inverters-status {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 20px; border-radius: var(--radius-lg);
  background: var(--surface-card); border: 1px solid var(--border-subtle);
}
.inverters-status__tile { flex: none; width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--leaf-100); color: var(--forest-600); display: flex; align-items: center; justify-content: center; }
.inverters-status__text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inverters-status__title { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-body); color: var(--text-strong); }
.inverters-status__sub { font-size: var(--fs-sm); color: var(--text-body); text-wrap: pretty; }
.inverters-status--stale { background: #fae4e0; border-color: #f0b6ad; }
.inverters-status--stale .inverters-status__tile { background: #fff; color: var(--danger-500); }
.inverters-status--waiting .inverters-status__tile { background: var(--surface-sunken); color: var(--text-muted); }

.inverter-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 16px; align-items: start; }
.inverter-card { gap: 20px; }
.inverter-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.inverter-card__id { display: flex; gap: 14px; align-items: center; min-width: 0; }
.inverter-card__tile { flex: none; width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--leaf-100); color: var(--forest-600); display: flex; align-items: center; justify-content: center; }
.inverter-card__names { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inverter-card h2 { font-weight: var(--fw-semibold); font-size: var(--fs-h4); letter-spacing: normal; }
.inverter-card__model { font-size: var(--fs-sm); color: var(--text-muted); }
.inverter-card__sn { font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.inverter-card__power { display: flex; flex-direction: column; gap: 8px; }
.inverter-card__power-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.inverter-card__value { font-family: var(--font-display); font-weight: var(--fw-extrabold); font-size: var(--fs-h3); color: var(--forest-700); letter-spacing: var(--ls-tight); font-variant-numeric: tabular-nums; }
.inverter-card__unit { font-family: var(--font-display); font-weight: var(--fw-semibold); color: var(--leaf-600); margin-left: 6px; }
.inverter-card__rated { font-size: var(--fs-sm); color: var(--text-muted); }
.inverter-card__note { font-size: var(--fs-xs); color: var(--text-muted); }
.inverter-card__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.inverter-card__stats .stat { min-width: 0; }
.inverter-card__stats .stat div:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }

.inverter-iso { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 14px 16px; background: var(--surface-page); border-radius: var(--radius-md); }
.inverter-iso__figure { flex: 1 1 150px; display: flex; flex-direction: column; gap: 2px; }
.inverter-iso__label { font-size: var(--fs-xs); color: var(--text-muted); }
.inverter-iso__value { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-h4); color: var(--forest-700); font-variant-numeric: tabular-nums; }
.inverter-iso__unit { font-size: var(--fs-sm); color: var(--neutral-600); margin-left: 5px; }
.inverter-iso__note { font-size: var(--fs-xs); color: var(--text-muted); }
.inverter-iso__spark { flex: 1 1 170px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.inverter-iso__spark svg { width: 100%; height: 44px; overflow: visible; }
.inverter-iso__area { fill: rgba(93,173,77,.14); stroke: none; }
.inverter-iso__line { fill: none; stroke: var(--leaf-500); stroke-width: 2; stroke-linejoin: round; }
.inverter-iso__axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.inverter-iso--low .inverter-iso__value, .inverter-iso--low .inverter-iso__note { color: #8a6410; }
.inverter-iso--low .inverter-iso__area { fill: rgba(244,183,64,.2); }
.inverter-iso--low .inverter-iso__line { stroke: #d99a1e; }

.inverter-alarms { display: flex; flex-direction: column; gap: 8px; }
.inverter-alarms__none { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-muted); }
.inverter-alarms__ok { color: var(--leaf-500); flex: none; }
.inverter-alarm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: #fae4e0; border: 1px solid #f0b6ad; border-radius: var(--radius-md); font-size: var(--fs-sm); }
.inverter-alarm__icon { flex: none; color: var(--danger-500); }
.inverter-alarm__text { color: var(--text-strong); }
.inverter-alarm__text strong { font-variant-numeric: tabular-nums; }
.inverter-alarm__since { margin-left: auto; font-size: var(--fs-xs); color: #a5271a; font-weight: var(--fw-semibold); }

.strings { display: flex; flex-direction: column; gap: 12px; padding-top: 20px; border-top: 1px solid var(--border-subtle); }
.strings__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.strings__head h3 { font-weight: var(--fw-semibold); font-size: var(--fs-lead); letter-spacing: normal; }
.strings__summary { font-size: var(--fs-sm); color: var(--text-muted); font-weight: var(--fw-semibold); }
.strings__summary--cut { color: #a5271a; }
.strings__summary--low { color: #8a6410; }
.strings__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 10px 8px; }
.strings__mppt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.strings__mppt-label { font-size: 11px; font-weight: var(--fw-bold); letter-spacing: var(--ls-wide); text-transform: uppercase; color: var(--text-muted); }
.string-cell {
  min-height: 58px; padding: 6px 8px; box-sizing: border-box; border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 1px; min-width: 0;
  background: var(--surface-page); border: 1.5px solid var(--border-subtle); cursor: default;
}
.string-cell:focus-visible { outline: 2px solid var(--leaf-500); outline-offset: 2px; }
/* Infobulle au clavier (le survol garde l'infobulle native +title+) : au-dessus de la
   grille, sur toute sa largeur, pour ne jamais déborder de la carte. */
.strings__grid { position: relative; }
.string-cell:focus-visible::after {
  content: attr(data-tip); position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 3;
  padding: 8px 10px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-strong); white-space: normal; pointer-events: none;
}
.string-cell__input { font-size: 11px; font-weight: var(--fw-bold); color: var(--text-muted); }
.string-cell__main { font-size: 13px; font-weight: var(--fw-bold); color: var(--text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.string-cell__sub { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Pastille de légende : règle de base avant les variantes d'état ci-dessous. */
.strings__swatch { width: 12px; height: 12px; border-radius: 3px; box-sizing: border-box; background: var(--surface-page); border: 1.5px solid var(--border-subtle); }
.string-cell--low, .strings__swatch--low { background: #fdf0d3; border-color: #f3d58f; }
.string-cell--low .string-cell__main, .string-cell--low .string-cell__sub { color: #8a6410; }
.string-cell--cut, .strings__swatch--cut { background: #fae4e0; border-color: #f0b6ad; }
.string-cell--cut .string-cell__main, .string-cell--cut .string-cell__sub { color: #a5271a; }
.string-cell--not_wired, .strings__swatch--not_wired { background: transparent; border: 1.5px dashed var(--neutral-300); }
.string-cell--not_wired .string-cell__main, .string-cell--idle .string-cell__main { color: var(--text-muted); }
.strings__legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: var(--fs-xs); color: var(--neutral-600); }
.strings__legend > span { display: flex; align-items: center; gap: 6px; }

.inverters-chart { gap: 20px; }
.inverters-chart__head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-start; }
.inverters-chart__titles { display: flex; flex-direction: column; gap: 4px; }
.inverters-chart h2 { font-weight: var(--fw-semibold); font-size: var(--fs-h4); letter-spacing: normal; }
.inverters-chart__hint { font-size: var(--fs-sm); color: var(--text-muted); }
.inverters-chart .period-nav { justify-content: flex-start; }
.date-chip--day { min-width: 200px; }
.inverters-chart__chart { grid-template-columns: 56px minmax(0, 1fr); margin-top: 0; }
.inverters-chart__chart .chart__axis, .inverters-chart__chart .chart__plot { height: 240px; }
.inverters-chart__max-line { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--neutral-400); pointer-events: none; }
.inverters-chart__max { position: absolute; right: 0; padding-bottom: 3px; font-size: 11px; font-weight: var(--fw-bold); color: var(--neutral-500); pointer-events: none; }
.inverters-chart__box { top: 12px; }
.inverters-chart__x { position: relative; height: 16px; font-size: var(--fs-xs); color: var(--text-muted); }
.inverters-chart__x div { position: absolute; top: 0; white-space: nowrap; }

.journal { gap: 4px; }
.journal__head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.journal__head h2 { font-weight: var(--fw-semibold); font-size: var(--fs-h4); letter-spacing: normal; }
.journal__count { font-size: var(--fs-sm); color: var(--text-muted); }
.journal__empty { padding: 12px 0; border-top: 1px solid var(--border-subtle); font-size: var(--fs-sm); color: var(--text-muted); }
.journal-row { display: grid; grid-template-columns: 136px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border-subtle); }
.journal-row__when { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.journal-row__date { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.journal-row__inv { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.journal-row__text { font-size: var(--fs-sm); color: var(--text-body); text-wrap: pretty; }
@media (max-width: 560px) {
  .inverter-card { padding: 20px; }
  .inverter-card__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journal-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .journal-row__text { grid-column: 1 / -1; grid-row: 2; }
  .inverters-chart__x-minor { display: none; }
  .date-chip--day { min-width: 0; }
}

/* Administration : concentrateur WebdynSun PM et onduleurs */
.gateway-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 16px; border: 1.5px dashed var(--border-default); border-radius: var(--radius-md); font-size: var(--fs-sm); color: var(--text-body); }
.gateway-empty p { flex: 1 1 280px; margin: 0; }
.gateway-empty code { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-strong); }
.gateway-block { display: flex; flex-direction: column; gap: 10px; }
.gateway-block__title { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-sm); color: var(--text-strong); }
.gateway-config { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); margin: 0; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; }
.gateway-config dt, .gateway-config dd { margin: 0; padding: 10px 14px; border-top: 1px solid var(--border-subtle); font-size: var(--fs-sm); min-width: 0; }
.gateway-config dt { background: var(--surface-page); color: var(--text-muted); }
.gateway-config dt:first-of-type, .gateway-config dt:first-of-type + dd { border-top: 0; }
.gateway-config__password { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; color: var(--text-body); }
.gateway-dirs { margin: 0; font-size: var(--fs-sm); color: var(--text-body); }
.gateway-dirs strong { font-weight: var(--fw-semibold); color: var(--text-strong); }
.gateway-state .edit-aside__row:first-of-type { border-top: 0; }
.gateway-state__error { color: var(--danger-500) !important; overflow-wrap: anywhere; }
.copy-value { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; min-width: 0; }
.copy-value code { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-strong); user-select: all; overflow-wrap: anywhere; min-width: 0; }
.copy-value__btn { flex: none; padding: 2px 8px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--surface-card); font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-xs); color: var(--forest-700); cursor: pointer; }
.copy-value__btn:hover { border-color: var(--forest-700); }
.secret-box { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1.5px solid var(--leaf-500); border-radius: var(--radius-md); background: var(--leaf-100); }
.secret-box__title { font-family: var(--font-display); font-weight: var(--fw-semibold); color: var(--text-strong); }
.copy-value--secret { justify-content: space-between; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-card); }
.copy-value--secret code { font-size: var(--fs-body); letter-spacing: .02em; }
.secret-box__hint { font-size: var(--fs-sm); color: var(--text-body); text-wrap: pretty; }
.wired-inputs { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 12px 8px; margin: 0; padding: 0; border: 0; }
.wired-inputs__item { gap: 8px; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.btn--danger-text { color: var(--danger-500); }
.btn--danger-text:hover { background: #fae4e0; color: var(--danger-500); }
.edit-aside form.button_to { display: contents; }
@media (max-width: 560px) {
  .gateway-config { grid-template-columns: minmax(0, 1fr); }
  .gateway-config dt { padding-bottom: 4px; }
  .gateway-config dd { border-top: 0; padding-top: 4px; }
  .wired-inputs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Onglet Performance (ensoleillement) : maquette « Nabirat · Performance » */
.perf-page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.perf-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 16px; }
.perf-kpi {
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
  padding: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.perf-kpi__label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-muted); }
.perf-kpi__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.perf-kpi__figure { display: flex; align-items: baseline; gap: 4px 5px; flex-wrap: wrap; }
.perf-kpi__value { font-family: var(--font-display); font-weight: var(--fw-extrabold); font-size: var(--fs-h3); line-height: 1; letter-spacing: var(--ls-tight); white-space: nowrap; font-variant-numeric: tabular-nums; }
.perf-kpi__value--forest { color: var(--forest-700); }
.perf-kpi__unit { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--fs-lead); white-space: nowrap; }
.perf-kpi__unit--sun { font-size: var(--fs-body); color: #d99a1e; }
.perf-kpi__unit--muted { font-size: var(--fs-body); color: var(--neutral-600); }
.perf-kpi__source { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--text-muted); }
.perf-kpi__status { display: flex; flex-direction: column; gap: 2px; }
.perf-kpi__state { font-size: var(--fs-xs); font-weight: var(--fw-bold); }
.perf-kpi__note { font-size: var(--fs-xs); color: var(--text-muted); }

.perf-chart { gap: 18px; }
.perf-chart__titles { display: flex; flex-direction: column; gap: 4px; }
.perf-chart h2 { font-weight: var(--fw-semibold); font-size: var(--fs-h4); letter-spacing: normal; }
.perf-chart__hint { font-size: var(--fs-sm); color: var(--text-muted); text-wrap: pretty; }
.perf-chart__hint--live { min-height: 21px; }
.perf-legend { gap: 10px 18px; }
.perf-legend__line { width: 18px; height: 3px; border-radius: 2px; }
.perf-legend__dashed { width: 18px; height: 0; border-top: 2px dashed; }
.perf-legend__band { width: 18px; height: 12px; border-radius: 2px; background: rgba(244,183,64,.3); }
.perf-legend__hatch { width: 18px; height: 12px; border-radius: 2px; background: rgba(80,90,75,.16); }
.perf-legend__square { width: 12px; height: 12px; border-radius: 3px; }
.perf-legend__threshold { width: 18px; height: 0; border-top: 1.5px dashed var(--danger-500); }
.perf-chart__chart { grid-template-columns: 56px minmax(0, 1fr) 52px; margin-top: 0; }
.perf-chart__chart .chart__axis, .perf-chart__chart .chart__plot { height: 280px; }
.perf-chart__right .chart__tick { color: #b07d12; }
.perf-chart__unit { font-size: 11px; color: #b07d12; white-space: nowrap; }
.perf-chart__cut { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(80,90,75,.14) 0 6px, rgba(80,90,75,.05) 6px 12px); pointer-events: none; }
.perf-chart__cap-line { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--danger-500); pointer-events: none; }
.perf-chart__cap { position: absolute; right: 0; padding-bottom: 3px; font-size: 11px; font-weight: var(--fw-bold); color: #a5271a; pointer-events: none; }
.perf-chart__box { top: 12px; gap: 6px; font-variant-numeric: tabular-nums; }
.perf-tip__row { display: grid; grid-template-columns: 96px 64px 64px 44px; column-gap: 14px; font-size: var(--fs-xs); color: var(--neutral-600); align-items: center; }
.perf-tip__row span:not(:first-child) { text-align: right; color: var(--text-strong); }
.perf-tip__row span:nth-child(2), .perf-tip__row span:last-child { font-weight: var(--fw-bold); }
.perf-tip__row--head span:not(:first-child) { color: var(--neutral-600); font-weight: normal; }
.perf-tip__row span:first-child { display: flex; align-items: center; gap: 6px; }
.perf-tip__swatch { width: 10px; height: 3px; border-radius: 2px; flex: none; }
.perf-tip__row .is-good { color: var(--forest-700); }
.perf-tip__row .is-warn { color: #b07d12; }
.perf-tip__row .is-bad { color: #a5271a; }
.perf-tip__sun { display: flex; justify-content: space-between; gap: 12px; padding-top: 6px; border-top: 1px solid var(--border-subtle); font-size: var(--fs-xs); color: var(--neutral-600); }
.perf-tip__sun strong { color: var(--text-strong); }
.perf-empty { padding: 32px 16px; border: 1.5px dashed var(--border-default); border-radius: var(--radius-md); font-size: var(--fs-sm); color: var(--text-muted); text-align: center; }

.perf-trend { grid-template-columns: 56px minmax(0, 1fr); margin-top: 0; }
.perf-trend .chart__axis, .perf-trend .chart__plot { height: 240px; }
.perf-trend__bars { position: absolute; inset: 0; display: flex; gap: 10px; }
.perf-trend__bars--mois { gap: 3px; }
.perf-trend__day { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-radius: 4px 4px 0 0; }
a.perf-trend__day:hover { background: var(--surface-sunken); }
.perf-trend__bar { flex: 1 1 0; max-width: 16px; border-radius: 3px 3px 0 0; }
.perf-trend__threshold { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--danger-500); pointer-events: none; z-index: 1; }
.perf-trend__x { display: flex; gap: 10px; font-size: var(--fs-xs); color: var(--text-muted); }
.perf-trend__x--mois { gap: 3px; }
.perf-trend__x div { flex: 1; min-width: 0; text-align: center; white-space: nowrap; }

.perf-losses { gap: 0; }
.perf-losses__head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; }
.perf-losses__head h2 { font-weight: var(--fw-semibold); font-size: var(--fs-h4); letter-spacing: normal; }
.perf-losses__sub { font-size: var(--fs-sm); color: var(--text-muted); }
.perf-losses__row {
  display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(64px, max-content); gap: 16px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--border-subtle); font-variant-numeric: tabular-nums;
}
.perf-losses__cause { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: var(--fs-sm); color: var(--text-strong); }
.perf-losses__bar { height: 6px; max-width: 360px; background: var(--surface-sunken); border-radius: var(--radius-pill); overflow: hidden; }
.perf-losses__bar div { height: 100%; border-radius: var(--radius-pill); }
.perf-losses__kwh { text-align: right; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); white-space: nowrap; }
.perf-losses__eur { text-align: right; font-size: var(--fs-sm); color: var(--text-body); white-space: nowrap; }
.perf-losses__eur--gain { color: var(--leaf-600); font-weight: var(--fw-semibold); }
.perf-losses__row--total { padding: 14px 0 0; border-top: 1.5px solid var(--border-default); }
.perf-losses__row--total span { font-family: var(--font-display); font-weight: var(--fw-bold); color: var(--text-strong); }
.perf-losses__row--total span:first-child { font-weight: var(--fw-semibold); }
.perf-losses__note { margin-top: 14px; font-size: var(--fs-xs); color: var(--text-muted); }
.perf-credit { margin: 0; font-size: var(--fs-xs); color: var(--text-muted); }

@media (max-width: 560px) {
  .perf-chart__chart { grid-template-columns: 44px minmax(0, 1fr) 36px; gap: 4px; }
  .perf-tip__row { grid-template-columns: 80px 56px 56px 40px; column-gap: 8px; }
  .perf-trend { grid-template-columns: 44px minmax(0, 1fr); }
  .perf-trend__bars, .perf-trend__x { gap: 4px; }
  .perf-trend__bars--mois, .perf-trend__x--mois { gap: 1px; }
  .perf-trend__x--mois div:nth-child(even) { visibility: hidden; }
  .perf-losses__row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; }
}

/* Carte « Demain » de l'onglet Production : maquette « Nabirat · Prévision demain » */
.tomorrow-card { grid-column: 1 / -1; gap: 20px; }
.tomorrow-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.tomorrow-card__titles { display: flex; flex-direction: column; gap: 4px; }
.tomorrow-card h2 { font-weight: var(--fw-semibold); font-size: var(--fs-h4); letter-spacing: normal; }
.tomorrow-card__issued { font-size: var(--fs-xs); color: var(--text-muted); }
.tomorrow-card__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.tomorrow-card__tile { background: var(--surface-page); border-radius: var(--radius-md); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.tomorrow-card__tile--negative { background: #fdf0d3; }
.tomorrow-card__label { font-size: var(--fs-xs); color: var(--text-muted); }
.tomorrow-card__tile--negative .tomorrow-card__label { color: #8a6410; font-weight: var(--fw-bold); }
.tomorrow-card__figure { display: flex; align-items: baseline; gap: 5px; }
.tomorrow-card__figure--badge { align-items: center; gap: 10px; flex-wrap: wrap; }
.tomorrow-card__value { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-h4); color: var(--forest-700); font-variant-numeric: tabular-nums; }
.tomorrow-card__unit { font-size: var(--fs-sm); color: var(--neutral-600); }
.tomorrow-card__range { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-lead); color: var(--text-strong); }
.tomorrow-card__curtailed { font-size: var(--fs-xs); color: var(--neutral-700); }
.tomorrow-card__chart { grid-template-columns: 56px minmax(0, 1fr); margin-top: 0; }
.tomorrow-card__chart .chart__axis, .tomorrow-card__chart .chart__plot { height: 160px; }
.tomorrow-card__cut { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(209,72,58,.12) 0 6px, rgba(209,72,58,.04) 6px 12px); }
.tomorrow-card__cut-label { position: absolute; top: 4px; text-align: center; font-size: 11px; font-weight: var(--fw-bold); color: #a5271a; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tomorrow-card__cut-short { display: none; }
@media (max-width: 560px) {
  .tomorrow-card__cut-long { display: none; }
  .tomorrow-card__cut-short { display: inline; }
}
.tomorrow-card__cap-line { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--neutral-500); }
.tomorrow-card__cap { position: absolute; left: 0; padding-bottom: 3px; font-size: 11px; font-weight: var(--fw-bold); color: var(--neutral-600); }

/* Onglet « Performance » d'une centrale hydraulique : maquette « La Louge · Performance » */
.perf-kpi__unit--flow, .hydro-perf__flow .perf-kpi__value { color: #1f5d93; }
.perf-kpi__unit--flow { font-size: var(--fs-body); }
.hydro-perf__type { display: flex; }
.hydro-perf__credit { display: flex; flex-direction: column; gap: 4px; }
.hydro-legend__flow { width: 18px; height: 12px; background: rgba(47,119,184,.2); border-top: 2px solid #2f77b8; box-sizing: border-box; }
.hydro-legend__real { width: 18px; border-top: 2.5px solid var(--forest-700); }
.hydro-legend__estimated { width: 18px; border-top: 2px dashed var(--forest-700); }
.hydro-legend__reserved { width: 18px; border-top: 1.5px dashed #2f77b8; }
.hydro-legend__start { width: 18px; border-top: 1.5px dashed var(--neutral-600); }
.hydro-legend__stop { width: 12px; height: 4px; border-radius: 2px; background: var(--danger-500); }
.hydro-legend__median { width: 18px; border-top: 2.5px solid var(--sun-500); }
.hydro-legend__band { width: 14px; height: 14px; border-radius: 3px; background: var(--leaf-100); border: 1px solid var(--leaf-200); box-sizing: border-box; }
.hydro-chart__line { position: absolute; left: 0; right: 0; pointer-events: none; }
.hydro-chart__line--reserved { border-top: 1.5px dashed #2f77b8; }
.hydro-chart__line--start { border-top: 1.5px dashed var(--neutral-600); }
.hydro-chart__line--flood { border-top: 1.5px dashed var(--danger-500); }
.hydro-chart__flood { position: absolute; right: 4px; padding-bottom: 3px; font-size: 11px; font-weight: var(--fw-bold); color: #a5271a; pointer-events: none; }
.hydro-chart__right .chart__tick { color: #1f5d93; }
.hydro-chart__unit { font-size: 11px; color: #1f5d93; white-space: nowrap; }
.hydro-chart__unit-kw { color: var(--text-muted); text-align: right; }
.hydro-tip { top: 12px; display: grid; grid-template-columns: auto auto; column-gap: 18px; row-gap: 4px; white-space: nowrap; font-size: var(--fs-xs); color: var(--neutral-600); font-variant-numeric: tabular-nums; }
.hydro-tip__time { grid-column: 1 / -1; }
.hydro-tip strong { text-align: right; color: var(--text-strong); }
.hydro-tip strong.hydro-tip__flow { color: #1f5d93; }
.hydro-tip strong.hydro-tip__time { text-align: left; }
.hydro-trend { grid-template-columns: 56px minmax(0, 1fr) 40px; }
.hydro-trend .perf-trend__day { position: relative; }
.hydro-trend .perf-trend__day.hydro-trend__day--grey { background: rgba(195,204,189,.45); }
.hydro-trend a.perf-trend__day:hover { background: rgba(23,86,42,.06); }
.hydro-trend a.perf-trend__day.hydro-trend__day--grey:hover { background: rgba(195,204,189,.6); }
.hydro-trend__bar { max-width: 28px; flex: 0 1 70%; }
.hydro-trend__icon { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); color: var(--neutral-500); display: flex; }
.hydro-productible__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.hydro-productible__fact { background: var(--surface-page); border-radius: var(--radius-md); padding: 14px 16px; font-size: var(--fs-body); line-height: 1.5; color: var(--text-strong); }
.hydro-productible__fact strong { font-family: var(--font-display); }
.hydro-productible__chart { grid-template-columns: 56px minmax(0, 1fr); margin-top: 0; }
.hydro-productible__chart .chart__axis, .hydro-productible__chart .chart__plot { height: 240px; }
.hydro-productible__months { position: absolute; inset: 0; display: flex; gap: 6px; }
.hydro-productible__month { flex: 1; min-width: 0; position: relative; height: 100%; }
.hydro-productible__month--no-data::after { content: ""; position: absolute; left: 28%; right: 28%; bottom: 0; height: 3px; border-radius: 2px; background: var(--neutral-300); }
.hydro-productible__band { position: absolute; left: 8%; right: 8%; background: var(--leaf-100); border: 1px solid var(--leaf-200); box-sizing: border-box; border-radius: 4px; }
.hydro-productible__real { position: absolute; left: 28%; right: 28%; bottom: 0; background: var(--forest-700); border-radius: 3px 3px 0 0; }
.hydro-productible__median { position: absolute; left: 4%; right: 4%; border-top: 2.5px solid var(--sun-500); }
.hydro-productible__x { display: flex; gap: 6px; font-size: var(--fs-xs); color: var(--text-muted); }
.hydro-productible__x div { flex: 1; min-width: 0; text-align: center; }
.perf-losses__muted { color: var(--text-muted); }
.hydro-dive { margin-top: 16px; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-page); font-size: var(--fs-sm); color: var(--text-body); }
.hydro-dive__icon { flex: none; margin-top: 2px; color: var(--neutral-500); }

@media (max-width: 560px) {
  .hydro-trend { grid-template-columns: 44px minmax(0, 1fr) 28px; }
  .hydro-productible__chart { grid-template-columns: 44px minmax(0, 1fr); }
  .hydro-productible__months, .hydro-productible__x { gap: 2px; }
  .hydro-trend__icon svg { width: 12px; height: 12px; }
  .hydro-trend__weekday { display: none; }
}

/* Carte « Aujourd'hui » de l'onglet Production : maquette « La Louge · Aujourd'hui » */
.hydro-today { grid-column: 1 / -1; gap: 20px; }
.hydro-today__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.hydro-today__titles { display: flex; flex-direction: column; gap: 4px; }
.hydro-today h2 { font-weight: var(--fw-semibold); font-size: var(--fs-h4); letter-spacing: normal; }
.hydro-today__last { font-size: var(--fs-xs); color: var(--text-muted); }
.hydro-today__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.hydro-today__tile { background: var(--surface-page); border-radius: var(--radius-md); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hydro-today__label { font-size: var(--fs-sm); color: var(--text-muted); }
.hydro-today__value { font-family: var(--font-display); font-weight: var(--fw-extrabold); font-size: var(--fs-h3); line-height: 1.1; letter-spacing: var(--ls-tight); color: var(--forest-700); font-variant-numeric: tabular-nums; }
.hydro-today__value--flow, .hydro-today__unit { color: #1f5d93; }
.hydro-today__unit { font-family: var(--font-display); font-weight: var(--fw-semibold); }
.hydro-today__note { font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.45; }
.hydro-today__flow-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hydro-today__flow { display: flex; flex-direction: column; gap: 6px; }
.hydro-today__figure { display: flex; align-items: baseline; gap: 6px; }
.hydro-today__trend { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill); background: #e8f1f9; color: #1f5d93; font-size: var(--fs-xs); font-weight: var(--fw-bold); white-space: nowrap; }
.hydro-today__spark { position: relative; height: 56px; }
.hydro-today__spark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hydro-today__start-line { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--neutral-500); }
.hydro-today__start { position: absolute; left: 0; transform: translateY(100%); padding: 2px 4px 0 0; font-size: 10px; font-weight: var(--fw-bold); color: var(--neutral-600); background: var(--surface-page); }
.hydro-today__axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.hydro-today__state { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-md); font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: 1.4; background: var(--surface-sunken); color: var(--neutral-700); }
.hydro-today__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--neutral-400); }
.hydro-today__state--production { background: var(--leaf-100); color: var(--forest-700); }
.hydro-today__state--production .hydro-today__dot { background: var(--leaf-500); }
.hydro-today__state--crue, .hydro-today__state--stale { background: #fdf0d3; color: #8a6410; }
.hydro-today__state--crue .hydro-today__dot, .hydro-today__state--stale .hydro-today__dot { background: var(--sun-500); }
