/* ══════════════════════════════════════════════════════════════
   SEDLA Design System — v2.0
   Thème : blanc / vert pastel moderne
   Responsive : mobile (< 640px) · tablette (640–1024px) · desktop (> 1024px)
   ══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  /* Fond & surfaces */
  --bg:          #f5f7f4;
  --bg-alt:      #eef1ec;
  --surface:     #ffffff;
  --surface-2:   #f0f4ee;
  --surface-3:   #e6ede4;

  /* Couleur principale — vert pastel tech */
  --green:       #4caf82;
  --green-light: #d4ede2;
  --green-dark:  #2e8b5e;
  --green-xlight:#edf7f2;

  /* Accents secondaires */
  --yellow:      #e8b84b;
  --yellow-light:#fdf3d8;
  --red:         #e05a52;
  --red-light:   #fde8e7;
  --blue:        #4a90d9;
  --blue-light:  #e5f0fa;
  --orange:      #e07a30;
  --orange-light:#fdecd8;
  --purple:      #7c6bb0;
  --purple-light:#ede9f8;

  /* Textes */
  --t1:          #1a1f1c;
  --t2:          #4a5550;
  --t3:          #8a9590;
  --t4:          #b8c4be;

  /* Bordures */
  --border:      rgba(0,0,0,0.06);
  --border-med:  rgba(0,0,0,0.10);
  --border-str:  rgba(0,0,0,0.16);

  /* Ombres */
  --shadow-xs:   0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md:   0 4px 20px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);

  /* Rayons */
  --r-xs: 6px;
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --fast: 0.15s;
  --mid:  0.25s;

  /* Layout */
  --max-w:       1200px;
  --sidebar-w:   220px;
  --nav-h:       60px;
  --content-pad: clamp(16px, 4vw, 48px);

  /* Typo */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}

/* ── Reset & base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--t1);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100svh;
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

img { display: block; max-width: 100%; }

/* ── SVG global : inline par défaut, taille sécurisée ── */
svg {
  display: inline-block;
  flex-shrink: 0;
  overflow: visible;
}

/* SVG avec width+height explicites (logos, illustrations) → respecter leurs dimensions */
svg[width][height] {
  display: block;
  max-width: 100%;
  width: attr(width px);
  height: attr(height px);
}

/* SVG icônes sans dimensions → taille par défaut sûre de 20px */
svg:not([width]):not([height]) {
  width: 20px;
  height: 20px;
}

/* ── Tailles spécifiques par contexte (priorité sur la règle générale) ── */

/* Champs */
.s-field-ico                  { width: 15px; height: 15px; position: absolute; pointer-events: none; }

/* Boutons */
.s-btn      > svg             { width: 15px; height: 15px; flex-shrink: 0; }
.s-btn-sm   > svg             { width: 13px; height: 13px; }
.s-btn-lg   > svg             { width: 16px; height: 16px; }

/* Alertes flash */
.s-flash    > svg             { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

/* KPI cards */
.s-kpi-icon > svg             { width: 18px; height: 18px; stroke: var(--kpi-color, var(--green)); }

/* Cellules dashboard (inclinomètre, système) */
.s-cell-ico        > svg      { width: 18px; height: 18px; }
.s-cell-ico-center > svg      { width: 18px; height: 18px; }

/* Nav topbar */
.s-topbar-nav .tn > svg       { width: 15px; height: 15px; }
.s-mobile-menu .tn > svg      { width: 16px; height: 16px; }
.s-hamburger      > svg       { width: 18px; height: 18px; }
.s-breadcrumb     > svg       { width: 12px; height: 12px; }

/* Toggle mot de passe */
.s-toggle-pwd > svg           { width: 15px; height: 15px; }

/* Gestion admin */
.s-mgmt-ico   > svg           { width: 22px; height: 22px; stroke: var(--green-dark); }
.s-mgmt-arrow > svg           { width: 16px; height: 16px; }

/* Profil — items capteurs, panels */
.s-cap-item svg               { width: 14px; height: 14px; }
.s-panel-inner svg            { width: 14px; height: 14px; }

/* Tables */
.s-table td  svg              { width: 14px; height: 14px; }

/* Footer dashboard */
[class*="footer-ico"] svg     { width: 15px; height: 15px; }

/* Logo marque et brand SVG — laisser leurs attributs width/height natifs */
.s-auth-brand  > svg,
.s-topbar-brand > svg,
.brand-icon                   { width: auto; height: auto; max-width: none; flex-shrink: 0; }

/* Citerne SVG hero — pleine largeur de son conteneur */
.s-hero-tank   > svg          { width: 100%; height: auto; display: block; }

/* Icône statut (activation, reset) — contrôlée par son conteneur */
.s-pop-in      > svg,
.ico-ring      > svg          { display: block; width: auto; height: auto; }

/* ══════════════════════════════════════════════════════════════
   LAYOUT — Topbar + Sidebar + Content
   ══════════════════════════════════════════════════════════════ */

/* ── Topbar ─────────────────────────────────────────────────── */
.s-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  overflow: visible;  /* ne pas couper le menu mobile */
  height: var(--nav-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

/* Conteneur interne : même largeur max et centrage que .s-layout */
.s-topbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  height: 100%;
  padding: 0 var(--content-pad);
  display: flex;
  align-items: center;
  gap: 8px;
}

.s-topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--t1);
  text-decoration: none;
  flex-shrink: 0;
}
.s-topbar-brand:hover { text-decoration: none; }

.s-topbar-brand .brand-icon {
  width: 32px; height: 32px;
}

.s-topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}

.s-topbar-nav .tn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; color: var(--t2);
  text-decoration: none; border: none; background: none; cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
  white-space: nowrap;
}
.s-topbar-nav .tn svg { width: 15px; height: 15px; flex-shrink: 0; }
.s-topbar-nav .tn:hover { background: var(--surface-2); color: var(--t1); text-decoration: none; }
.s-topbar-nav .tn.active { background: var(--green-light); color: var(--green-dark); font-weight: 600; }
.s-topbar-nav .tn.tn-admin { color: var(--green-dark); }
.s-topbar-nav .tn.tn-admin:hover { background: var(--green-xlight); }
.s-topbar-nav .tn.tn-admin.active { background: var(--green-light); }
.s-topbar-nav .tn.tn-logout { color: var(--red); }
.s-topbar-nav .tn.tn-logout:hover { background: var(--red-light); color: var(--red); }

.s-topbar-spacer { flex: 1; }

/* Bouton hamburger (mobile) */
.s-hamburger {
  display: none;
  align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--r-sm);
  border: 1px solid var(--border-med);
  background: var(--surface);
  cursor: pointer; color: var(--t2);
}
.s-hamburger svg { width: 18px; height: 18px; }
.s-hamburger .ham-icon-close { display: none; }
.s-hamburger.open .ham-icon-bars { display: none; }
.s-hamburger.open .ham-icon-close { display: block; }

/* Menu mobile déroulant */
.s-mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px var(--content-pad) 16px;
  z-index: 9999;          /* au-dessus de tout */
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  gap: 2px;
}
.s-mobile-menu.open { display: flex; }
.s-mobile-menu .tn {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--t2);
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; cursor: pointer; border: none; background: none;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.s-mobile-menu .tn svg { width: 16px; height: 16px; flex-shrink: 0; }
.s-mobile-menu .tn:hover { background: var(--surface-2); color: var(--t1); }
.s-mobile-menu .tn.active { background: var(--green-light); color: var(--green-dark); font-weight: 600; }
.s-mobile-menu .tn.tn-logout { color: var(--red); }
.s-mobile-menu .tn.tn-logout:hover { background: var(--red-light); }
.s-mobile-menu-sep { height: 1px; background: var(--border); margin: 6px 0; }

/* ── Wrapper principal ──────────────────────────────────────── */
.s-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px var(--content-pad) 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Layout 2 colonnes (sidebar + main) */
.s-layout-cols {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 24px;
  align-items: start;
}

/* ── Page header ────────────────────────────────────────────── */
.s-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.s-page-title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--t1);
  line-height: 1.2;
}
.s-page-sub {
  font-size: 14px;
  color: var(--t3);
  margin-top: 4px;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.s-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--t3);
  margin-bottom: 4px;
}
.s-breadcrumb a { color: var(--green-dark); font-weight: 500; }
.s-breadcrumb svg { width: 12px; height: 12px; }

/* ══════════════════════════════════════════════════════════════
   COMPOSANTS
   ══════════════════════════════════════════════════════════════ */

/* ── Card ───────────────────────────────────────────────────── */
.s-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.s-card-body { padding: 24px; }
.s-card-header {
  padding: 20px 24px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.s-card-title {
  font-size: 15px; font-weight: 600; color: var(--t1);
}
.s-card-sep {
  height: 1px; background: var(--border); margin: 0 24px;
}
.s-card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* ── KPI Cards ──────────────────────────────────────────────── */
.s-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.s-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}
.s-kpi::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--kpi-color, var(--green));
  border-radius: 3px 3px 0 0;
}
.s-kpi-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--kpi-bg, var(--green-xlight));
  margin-bottom: 14px;
}
.s-kpi-icon svg { width: 18px; height: 18px; stroke: var(--kpi-color, var(--green)); }
.s-kpi-val {
  font-size: 28px; font-weight: 700; letter-spacing: -0.6px;
  color: var(--t1); line-height: 1;
}
.s-kpi-label { font-size: 12px; color: var(--t3); font-weight: 500; margin-top: 4px; }
.s-kpi-sub   { font-size: 11px; color: var(--t4); margin-top: 2px; }

/* ── Boutons ────────────────────────────────────────────────── */
.s-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--r-sm); border: none; cursor: pointer;
  font-family: var(--font); font-size: 14px; font-weight: 600;
  text-decoration: none; transition: all var(--fast) var(--ease);
  white-space: nowrap; -webkit-appearance: none;
  position: relative; overflow: hidden;
}
.s-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.s-btn:active { transform: scale(0.98); }
.s-btn:hover { text-decoration: none; }

.s-btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(76,175,130,0.35);
}
.s-btn-primary:hover { background: var(--green-dark); box-shadow: 0 4px 12px rgba(76,175,130,0.4); }

.s-btn-secondary {
  background: var(--surface);
  color: var(--t1);
  border: 1px solid var(--border-med);
  box-shadow: var(--shadow-xs);
}
.s-btn-secondary:hover { background: var(--surface-2); border-color: var(--border-str); }

.s-btn-ghost {
  background: transparent;
  color: var(--t2);
  border: 1px solid var(--border-med);
}
.s-btn-ghost:hover { background: var(--surface-2); color: var(--t1); }

.s-btn-danger {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid rgba(224,90,82,0.2);
}
.s-btn-danger:hover { background: var(--red); color: #fff; }

.s-btn-warn {
  background: var(--orange-light);
  color: var(--orange);
  border: 1px solid rgba(224,122,48,0.2);
}
.s-btn-warn:hover { background: var(--orange); color: #fff; }

.s-btn-info {
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid rgba(74,144,217,0.2);
}
.s-btn-info:hover { background: var(--blue); color: #fff; }

.s-btn-success {
  background: var(--green-light);
  color: var(--green-dark);
  border: 1px solid rgba(76,175,130,0.25);
}
.s-btn-success:hover { background: var(--green); color: #fff; }

.s-btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--r-xs); }
.s-btn-sm svg { width: 13px; height: 13px; }
.s-btn-lg { padding: 13px 24px; font-size: 15px; border-radius: var(--r); }
.s-btn-full { width: 100%; }

/* ── Champs ─────────────────────────────────────────────────── */
.s-field { display: flex; flex-direction: column; gap: 5px; }
.s-label {
  font-size: 12px; font-weight: 600; color: var(--t2);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.s-field-wrap { position: relative; }
.s-field-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--t4); pointer-events: none;
  transition: color var(--fast) var(--ease);
}
.s-input, .s-textarea, .s-select {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border-med);
  border-radius: var(--r-sm);
  color: var(--t1);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
  -webkit-appearance: none;
}
.s-input { padding: 10px 12px 10px 38px; }
.s-input.no-ico { padding-left: 12px; }
.s-textarea { padding: 10px 12px; resize: vertical; min-height: 90px; }
.s-select { padding: 10px 32px 10px 38px; cursor: pointer; }
.s-select.no-ico { padding-left: 12px; }
.s-input:focus, .s-textarea:focus, .s-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(76,175,130,0.12);
}
.s-field-wrap:focus-within .s-field-ico { color: var(--green); }
.s-input::placeholder, .s-textarea::placeholder { color: var(--t4); }
.s-input[readonly], .s-input:disabled { background: var(--surface-2); color: var(--t3); cursor: not-allowed; }

.s-toggle-pwd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 4px; cursor: pointer;
  color: var(--t4); transition: color var(--fast) var(--ease); display: flex;
}
.s-toggle-pwd:hover { color: var(--green); }
.s-toggle-pwd svg { width: 15px; height: 15px; }

/* Grilles de champs */
.s-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.s-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.s-full  { grid-column: 1 / -1; }

/* Jauge force mot de passe */
.s-pwd-track { height: 3px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.s-pwd-fill  { height: 100%; border-radius: 999px; transition: width 0.3s var(--ease), background 0.3s var(--ease); }
.s-pwd-label { font-size: 11px; color: var(--t3); margin-top: 4px; }

/* ── Messages flash ─────────────────────────────────────────── */
.s-flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: var(--r-sm);
  font-size: 13px; line-height: 1.5;
}
.s-flash svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.s-flash-ok  { background: var(--green-xlight); border: 1px solid rgba(76,175,130,0.3); color: var(--green-dark); }
.s-flash-err { background: var(--red-light);   border: 1px solid rgba(224,90,82,0.3);  color: var(--red); }
.s-flash-warn{ background: var(--yellow-light); border: 1px solid rgba(232,184,75,0.3); color: #9a6f00; }

/* ── Badges / Pills ─────────────────────────────────────────── */
.s-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
}
.s-badge-green  { background: var(--green-light);  color: var(--green-dark); }
.s-badge-yellow { background: var(--yellow-light); color: #7a5a00; }
.s-badge-red    { background: var(--red-light);    color: var(--red); }
.s-badge-blue   { background: var(--blue-light);   color: #2260a0; }
.s-badge-gray   { background: var(--surface-3);    color: var(--t3); }
.s-badge-purple { background: var(--purple-light); color: var(--purple); }

.s-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  display: inline-block;
}
.s-dot-green  { background: var(--green); }
.s-dot-red    { background: var(--red); }
.s-dot-yellow { background: var(--yellow); }
.s-dot-gray   { background: var(--t4); }
.s-dot-pulse  { animation: s-pulse 2s ease-in-out infinite; }
@keyframes s-pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── Tables ─────────────────────────────────────────────────── */
.s-table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border); }
.s-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface);
  font-size: 13px;
}
.s-table thead th {
  padding: 12px 16px; text-align: left;
  font-size: 11px; font-weight: 600; color: var(--t3);
  text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.s-table tbody tr { border-bottom: 1px solid var(--border); transition: background var(--fast) var(--ease); }
.s-table tbody tr:last-child { border-bottom: none; }
.s-table tbody tr:hover { background: var(--surface-2); }
.s-table td { padding: 12px 16px; color: var(--t1); vertical-align: middle; }
.s-table td.td-muted { color: var(--t3); font-size: 12px; }
.s-table td.td-mono  { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; color: var(--t2); }

/* ── Section titles ─────────────────────────────────────────── */
.s-sec {
  font-size: 11px; font-weight: 700; color: var(--t3);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 10px; margin-top: 4px;
}

/* ── Avatar ─────────────────────────────────────────────────── */
.s-avatar {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 700; color: #fff; flex-shrink: 0;
  background: var(--green);
  font-size: 14px;
}
.s-avatar-sm  { width: 32px; height: 32px; font-size: 12px; }
.s-avatar-md  { width: 42px; height: 42px; font-size: 16px; }
.s-avatar-lg  { width: 56px; height: 56px; font-size: 22px; }

/* ── Progress bar ───────────────────────────────────────────── */
.s-progress { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.s-progress-fill { height: 100%; border-radius: 999px; background: var(--green); transition: width 0.6s var(--ease); }

/* ── Anneau SVG ─────────────────────────────────────────────── */
@keyframes s-ring-in { from { stroke-dashoffset: 283; } }
.s-ring-fill { animation: s-ring-in 0.9s 0.1s cubic-bezier(0.4,0,0.2,1) both; }

/* ── Dropdown search ────────────────────────────────────────── */
.s-search-wrap { position: relative; z-index: 500; }
.s-search-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border-med);
  border-radius: var(--r); box-shadow: var(--shadow-lg);
  z-index: 500;           /* au-dessus des cards et sections */
  max-height: 280px; overflow-y: auto;
}
.s-search-dropdown.open { display: block; }
.s-dd-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  cursor: pointer; border-bottom: 1px solid var(--border);
  transition: background var(--fast) var(--ease);
}
.s-dd-item:last-child { border-bottom: none; }
.s-dd-item:hover, .s-dd-item.highlighted { background: var(--surface-2); }
.s-dd-empty { padding: 16px; text-align: center; color: var(--t3); font-size: 13px; }

/* ── Tabs ───────────────────────────────────────────────────── */
.s-tabs { display: flex; gap: 2px; background: var(--surface-2); padding: 4px; border-radius: var(--r-sm); }
.s-tab {
  flex: 1; padding: 7px 14px; border-radius: var(--r-xs);
  font-size: 13px; font-weight: 500; color: var(--t3);
  text-align: center; cursor: pointer; border: none; background: none;
  transition: all var(--fast) var(--ease); text-decoration: none;
}
.s-tab:hover { color: var(--t1); }
.s-tab.active {
  background: var(--surface); color: var(--green-dark);
  font-weight: 600; box-shadow: var(--shadow-xs);
}

/* ── Accordion / Panel inline ───────────────────────────────── */
.s-panel { display: none; }
.s-panel.open { display: block; }
.s-panel-inner {
  background: var(--green-xlight); border: 1px solid rgba(76,175,130,0.2);
  border-radius: var(--r-sm); padding: 16px; margin-top: 8px;
}

/* ── Citerne SVG hero ───────────────────────────────────────── */
.s-hero { display: flex; gap: 24px; align-items: center; padding: 28px; flex-wrap: wrap; }
.s-hero-tank { flex-shrink: 0; width: 80px; }
.s-hero-info { flex: 1; min-width: 200px; }
.s-hero-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px 3px 6px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--kpi-bg, var(--green-xlight));
  color: var(--kpi-color, var(--green-dark));
  border: 1px solid rgba(76,175,130,0.25);
  margin-bottom: 8px;
}
.s-hero-title { font-size: clamp(22px,4vw,28px); font-weight: 700; letter-spacing: -0.4px; }
.s-hero-sub   { font-size: 14px; color: var(--t2); margin-top: 4px; margin-bottom: 16px; }

/* ── Row grilles iOS-style ──────────────────────────────────── */
.s-row3 { display: grid; grid-template-columns: repeat(3,1fr); }
.s-row2 { display: grid; grid-template-columns: repeat(2,1fr); }
.s-cell {
  padding: 18px; display: flex; flex-direction: column; align-items: center;
  text-align: center; position: relative;
}
.s-row3 .s-cell + .s-cell::before,
.s-row2 .s-cell:nth-child(even)::before {
  content:''; position:absolute; left:0; top:15%; bottom:15%;
  width: 1px; background: var(--border);
}
.s-row2 .s-cell:nth-child(1)::after,
.s-row2 .s-cell:nth-child(2)::after {
  content:''; position:absolute; bottom:0; left:18px; right:0;
  height: 1px; background: var(--border);
}
.s-row2 .s-cell { align-items: flex-start; text-align: left; }
.s-cell-row { display: flex; align-items: center; gap: 12px; }
.s-cell-ico {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.s-cell-ico svg { width: 18px; height: 18px; }
.s-cell-ico-center {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 10px;
}
.s-cell-ico-center svg { width: 18px; height: 18px; }
.s-val-lg { font-size: 24px; font-weight: 700; letter-spacing: -0.4px; line-height: 1; }
.s-val-md { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; line-height: 1; }
.s-val-sm { font-size: 14px; font-weight: 600; line-height: 1.2; word-break: break-all; }
.s-cell-lbl { font-size: 12px; color: var(--t3); margin-top: 3px; }
.s-mini-bar { margin-top: 8px; width: 100%; }

/* ══════════════════════════════════════════════════════════════
   PAGES SPÉCIFIQUES
   ══════════════════════════════════════════════════════════════ */

/* ── Auth pages (connexion, inscription…) ───────────────────── */
.s-auth-body {
  background: var(--bg);
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 16px;
  background-image:
    radial-gradient(ellipse 70% 40% at 50% -5%, rgba(76,175,130,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 80% 90%, rgba(76,175,130,0.04) 0%, transparent 60%);
}
.s-auth-brand {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; margin-bottom: 32px;
}
.s-auth-brand-name {
  font-size: 22px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--t1);
}
.s-auth-brand-sub {
  font-size: 11px; color: var(--t3); letter-spacing: 0.14em;
  text-transform: uppercase; margin-top: -8px;
}
.s-auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border-med);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.s-auth-card-body { padding: 32px 28px 24px; }
.s-auth-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 4px; }
.s-auth-hint  { font-size: 13px; color: var(--t3); margin-bottom: 24px; line-height: 1.5; }
.s-auth-footer {
  border-top: 1px solid var(--border); padding: 14px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.s-auth-footer-row { display: flex; align-items: center; gap: 6px; }
.s-auth-footer-row span { font-size: 12px; color: var(--t3); }
.s-auth-footer-row a   { font-size: 12px; font-weight: 600; color: var(--green-dark); }
.s-copy { font-size: 11px; color: var(--t4); margin-top: 24px; text-align: center; }

/* Logo SEDLA — version claire */
.s-logo-hex polygon { stroke: var(--green); }
.s-logo-hex .hex-fill { fill: rgba(76,175,130,0.08); }
.s-logo-hex .hex-ring-el { stroke: var(--green); opacity: 0.4; }
.s-logo-hex .hex-drop { fill: var(--green); }
.s-logo-hex .hex-shine { fill: rgba(255,255,255,0.5); }
.hex-ring-anim { animation: spin-slow 12s linear infinite; transform-origin: center; }
@keyframes spin-slow { to { transform: rotate(360deg); } }

/* ── Gestion (admin pages) ──────────────────────────────────── */
.s-mgmt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.s-mgmt-btn {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1.5px solid var(--border-med);
  border-radius: var(--r-lg); padding: 22px; text-decoration: none; color: var(--t1);
  transition: all var(--mid) var(--ease); position: relative; overflow: hidden;
}
.s-mgmt-btn:hover {
  border-color: var(--green); background: var(--green-xlight);
  box-shadow: var(--shadow-md); text-decoration: none; transform: translateY(-1px);
}
.s-mgmt-ico {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-xlight);
}
.s-mgmt-ico svg { width: 22px; height: 22px; stroke: var(--green-dark); }
.s-mgmt-label { font-size: 15px; font-weight: 700; }
.s-mgmt-desc  { font-size: 12px; color: var(--t3); line-height: 1.4; }
.s-mgmt-arrow { position: absolute; top: 20px; right: 20px; color: var(--t4); }
.s-mgmt-arrow svg { width: 16px; height: 16px; }

/* ── Bandeau "Voir en tant que" (impersonation) ─────────────── */
.sedla-impersonation-ribbon {
  background: #7c3aed;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 7px 10px;
  position: sticky;
  top: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sedla-impersonation-ribbon a {
  color: #fff;
  text-decoration: underline;
  font-weight: 700;
}

/* ── Capteur list items ─────────────────────────────────────── */
.s-cap-item {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.s-cap-item:last-child { border-bottom: none; }
.s-cap-item:hover { background: var(--surface-2); }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

/* ── Tablette (≤ 1024px) ────────────────────────────────────── */
@media (max-width: 1024px) {
  .s-layout-cols { grid-template-columns: 1fr; }
  .s-topbar-nav .tn-label { display: none; }
  .s-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .s-mgmt-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Mobile (≤ 640px) ───────────────────────────────────────── */
@media (max-width: 640px) {
  :root { --nav-h: 54px; }
  .s-topbar-nav { display: none; }
  .s-hamburger { display: flex; }
  .s-kpi-grid  { grid-template-columns: 1fr 1fr; }
  .s-grid2     { grid-template-columns: 1fr; }
  .s-grid3     { grid-template-columns: 1fr; }
  .s-row3      { grid-template-columns: 1fr 1fr 1fr; }
  .s-mgmt-grid { grid-template-columns: 1fr; }
  .s-hero      { padding: 20px; gap: 16px; }
  .s-auth-card-body { padding: 24px 20px 18px; }
  .s-layout { padding: 20px 16px 56px; gap: 16px; }
  .s-page-title { font-size: 20px; }
  .s-table thead th:nth-child(n+4) { display: none; }
  .s-table td:nth-child(n+4) { display: none; }
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {
  .s-topbar, .s-hamburger, .s-mobile-menu { display: none !important; }
  .s-card { box-shadow: none; border: 1px solid #ccc; }
}

/* ══════════════════════════════════════════════════════════════
   ANIMATIONS UTILITAIRES
   ══════════════════════════════════════════════════════════════ */
@keyframes s-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.s-fade-in { animation: s-fade-in 0.3s var(--ease) both; }

@keyframes s-pop-in {
  0%  { transform: scale(0.7); opacity: 0; }
  70% { transform: scale(1.05); }
  100%{ transform: scale(1); opacity: 1; }
}
.s-pop-in { animation: s-pop-in 0.4s cubic-bezier(0.34,1.56,0.64,1) both; }

@keyframes s-shimmer {
  to { left: 120%; }
}
.s-shimmer::after {
  content: ''; position: absolute; top: 0; left: -80%;
  width: 45%; height: 100%;
  background: rgba(255,255,255,0.2); transform: skewX(-20deg);
  animation: s-shimmer 3s ease-in-out infinite;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-str); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--t4); }