:root {
  --bg: #0a0c12;
  --bg-2: #12151e;
  --panel: rgba(18, 21, 30, 0.82);
  --stroke: rgba(234, 88, 12, 0.28);
  --text: #f3f4f6;
  --muted: #9ca3af;
  --cyan: #ea580c;
  --amber: #fbbf24;
  --violet: #fb923c;
  --danger: #ff6b8a;
  --ok: #4ade80;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --top-bg: rgba(10, 12, 18, 0.86);
  --input-bg: #141824;
  --orbit-line: rgba(234, 88, 12, 0.05);
  --pie-ok: #4ade80;
  --pie-ko: #fbbf24;
  --pie-ring: rgba(10, 12, 18, 0.35);
  --font: "Sora", "IBM Plex Sans", system-ui, sans-serif;
  --display: "Orbitron", "Sora", sans-serif;
}
html[data-theme="light"] {
  --bg: #f7f5f2;
  --bg-2: #efeae4;
  --panel: #ffffff;
  --stroke: rgba(194, 65, 12, 0.16);
  --text: #1c1917;
  --muted: #57534e;
  --cyan: #c2410c;
  --amber: #b45309;
  --violet: #ea580c;
  --danger: #be123c;
  --ok: #15803d;
  --shadow: 0 10px 28px rgba(28, 25, 23, 0.08);
  --top-bg: #ffffff;
  --input-bg: #ffffff;
  --orbit-line: transparent;
  --pie-ok: #3dba7a;
  --pie-ko: #f0a14a;
  --pie-ring: #ffffff;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(234, 88, 12, 0.18), transparent 50%),
    radial-gradient(900px 500px at 110% 0%, rgba(251, 146, 60, 0.10), transparent 45%),
    var(--bg);
  color: var(--text);
  line-height: 1.45;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-size: 0.86em; color: var(--amber); }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0);
}

.orbit {
  pointer-events: none;
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--orbit-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--orbit-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 20%, #000 20%, transparent 75%);
}

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.85rem 4.2rem 0.85rem 1.25rem;
  backdrop-filter: blur(16px);
  background: var(--top-bg);
  border-bottom: 1px solid var(--stroke);
}
.brand { display: flex; align-items: center; gap: 0.7rem; color: inherit; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 2.2rem; height: 2.2rem; border-radius: 0.7rem;
  display: grid; place-items: center;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}
.brand__mark img {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
}
.gate__logo {
  display: flex;
  justify-content: center;
  margin: 0 auto 0.85rem;
  line-height: 0;
  color: #ffffff;
}
html[data-theme="light"] .gate__logo { color: #1c1917; }
.gate__logo-svg,
.gate__logo img {
  width: min(11.5rem, 58vw);
  height: auto;
  display: block;
}
.gate__mark {
  width: 4.6rem; height: 4.6rem;
  border-radius: 1.15rem;
  margin: 0 auto 0.55rem;
}
.logo-word {
  display: inline-flex;
  align-items: center;
  color: #ffffff;
  line-height: 0;
  user-select: none;
}
.logo-word__svg {
  display: block;
  width: auto;
  height: 1em;
  overflow: visible;
}
.logo-word__gest { color: #ffffff; }
.logo-word__ia { color: #ea580c; }
html[data-theme="light"] .logo-word { color: #1c1917; }
html[data-theme="light"] .logo-word__gest { color: #1c1917; }
.gate__word {
  display: flex; justify-content: center;
  margin: 0.25rem auto 0.75rem;
  font-size: clamp(2.25rem, 5.5vw, 2.85rem);
}
.logo-word__svg {
  shape-rendering: geometricPrecision;
}
.gate__mark {
  overflow: visible;
  background: transparent !important;
  box-shadow: none !important;
}
.gate__mark img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.brand__text .logo-word { font-size: 1.15rem; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__text strong { font-family: var(--display); letter-spacing: 0.04em; font-size: 0.95rem; }
.brand__text em { font-style: normal; color: var(--muted); font-size: 0.72rem; }

/* Menu gauche — même coque que TalentIA / RelatIA */
.app-shell { min-height: 100vh; }
.sidebar {
  width: 15.5rem;
  background: #100c09;
  color: #f3e8e0;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  border-right: 1px solid rgba(234, 88, 12, 0.32);
}
.sidebar-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 1rem 0.85rem 0.9rem;
  border-bottom: 1px solid rgba(234, 88, 12, 0.28);
}
.sidebar .brand { min-width: 0; flex: 1; }
.sidebar .brand__mark { width: 2.4rem; height: 2.4rem; }
.sidebar .brand__text .logo-word { font-size: 1.05rem; }
.sidebar .brand__text em { color: #c4b5a8; }
html[data-theme="light"] .sidebar .logo-word,
html[data-theme="light"] .sidebar .logo-word__gest { color: #fff; }
.sidebar-close,
.sidebar-open {
  display: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 0.35rem;
  padding: 0.25rem;
}
.sidebar-close:hover,
.sidebar-open:hover { background: #2a160c; color: #fff; }
.sidebar-nav {
  flex: 1;
  overflow: auto;
  padding: 0.45rem 0 1rem;
}
.side-label {
  margin: 0.85rem 1.15rem 0.25rem;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #a89080;
}
.side-group {
  margin: 0.35rem 0.55rem;
  padding: 0.15rem 0 0.3rem;
  border: 1px solid rgba(234, 88, 12, 0.28);
  border-radius: 0.75rem;
  background: rgba(234, 88, 12, 0.06);
}
.side-group .side-label { margin: 0.4rem 0.85rem 0.05rem; }
.side-group.is-active { border-color: rgba(234, 88, 12, 0.55); }
@media (max-width: 720px) {
  .kpi--duo { grid-column: auto; grid-template-columns: 1fr; }
  .kpi--duo > a + a { border-left: 0; border-top: 1px solid var(--stroke); }
  .kpi--duo > a:first-child { border-radius: 1rem 1rem 0 0; }
  .kpi--duo > a:last-child { border-radius: 0 0 1rem 1rem; }
}
.side-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.55rem 1.05rem;
  color: #f3e8e0;
  text-decoration: none;
  border-left: 2px solid transparent;
}
html[data-theme="light"] .sidebar a.side-link { color: #f3e8e0; }
.side-link:hover {
  background: #2a160c;
  color: #fff;
  text-decoration: none;
}
.side-link.is-active {
  background: #2a160c;
  color: #fff;
  border-left-color: #ea580c;
}
html[data-theme="light"] .sidebar a.side-link:hover,
html[data-theme="light"] .sidebar a.side-link.is-active { color: #fff; }
html[data-theme="light"] .sidebar .side-link-sub { color: #a89080; }
.side-link__ico {
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  color: #fb923c;
}
.side-link.is-active .side-link__ico,
.side-link:hover .side-link__ico { color: #fdba74; }
.side-link__ico svg { width: 1.05rem; height: 1.05rem; display: block; }
.side-link-text { min-width: 0; display: flex; flex-direction: column; }
.side-link-label { font-size: 0.875rem; font-weight: 500; }
.side-link-sub {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a89080;
}
.app-main {
  margin-left: 15.5rem;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  background: var(--top-bg);
  backdrop-filter: blur(12px);
}
.app-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.app-rule { height: 0; border-top: 1px solid var(--stroke); }
.gestia-app .who { margin-left: auto; }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 12, 9, 0.62);
  z-index: 30;
}
.sidebar-backdrop.is-open { display: block; }

.nav { display: flex; flex-wrap: wrap; gap: 0.35rem; flex: 1; }
.nav__link {
  display: inline-flex; align-items: center; gap: 0.38rem;
  padding: 0.38rem 0.7rem 0.38rem 0.5rem; border-radius: 999px;
  color: var(--muted); font-size: 0.86rem;
  --nav-c: var(--cyan);
}
.nav__ico {
  display: grid; place-items: center;
  width: 1.15rem; height: 1.15rem; flex: 0 0 auto;
  color: var(--nav-c);
}
.nav__ico svg { width: 1.05rem; height: 1.05rem; display: block; }
.nav__link--home { --nav-c: #fb923c; }
.nav__link--clients { --nav-c: #fb923c; }
.nav__link--affaires { --nav-c: #fbbf24; }
.nav__link--chantiers { --nav-c: #ffb86b; }
.nav__link--devis { --nav-c: #fb923c; }
.nav__link--factures { --nav-c: #ff8aa3; }
.nav__link--utilisateurs { --nav-c: #a5b4c8; }
.nav__link--admin { --nav-c: #ea580c; }
.nav__drop { position: relative; display: inline-flex; align-items: center; }
button.nav__link,
.nav__drop-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  line-height: inherit;
}
.nav__drop-menu {
  display: none;
  position: absolute; left: 0; top: calc(100% + 0.25rem);
  min-width: 15rem; z-index: 30;
  flex-direction: column;
  padding: 0.35rem;
  border: 1px solid var(--stroke);
  border-radius: 0.8rem;
  background: #0b1224;
  box-shadow: var(--shadow);
}
.nav__drop.is-open .nav__drop-menu { display: flex; }
.nav__drop-item {
  padding: 0.45rem 0.7rem; border-radius: 0.5rem;
  color: var(--text); text-decoration: none; font-size: 0.86rem;
}
.nav__drop-item:hover, .nav__drop-item.is-active {
  background: rgba(129, 140, 248, 0.16); color: #c7d2fe; text-decoration: none;
}
.nav__link.is-active, .nav__link:hover {
  color: #061018;
  background: var(--nav-c);
  text-decoration: none;
}
.nav__link.is-active .nav__ico,
.nav__link:hover .nav__ico { color: #ffffff; }
.nav-toggle { display: none; }
.who { display: flex; align-items: center; gap: 0.7rem; margin-left: auto; font-size: 0.78rem; color: var(--muted); }
.who__avatar {
  width: 2.45rem; height: 2.45rem; border-radius: 50%;
  display: grid; place-items: center; flex: 0 0 auto;
  font-family: var(--display); font-weight: 700; font-size: 1rem;
  color: #f4fbff;
  background: radial-gradient(circle at 35% 30%, #16324a, #0a1424 70%);
  border: 3px solid var(--cyan);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.22), 0 0 18px rgba(234, 88, 12, 0.4);
}
.who__meta { display: flex; flex-direction: column; align-items: flex-start; gap: 0.22rem; line-height: 1.15; min-width: 0; }
.who__name { color: var(--text); font-weight: 600; }
/* Bouton clair / sombre — dans le bloc utilisateur ; fixe seulement hors header */
.who .delta-theme-toggle,
.delta-who .delta-theme-toggle,
.who .theme-toggle,
.delta-who .theme-toggle {
  position: static;
  top: auto;
  right: auto;
  z-index: 1;
  width: 2.45rem;
  height: 2.45rem;
  box-shadow: none;
  backdrop-filter: none;
}
.delta-theme-toggle,
.theme-toggle {
  position: fixed;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 9999;
  display: grid; place-items: center;
  width: 2.45rem; height: 2.45rem; flex: 0 0 auto;
  border-radius: 50%;
  color: #fbbf24;
  border: 2px solid rgba(251, 191, 36, 0.45);
  background: rgba(14, 22, 40, 0.88);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  cursor: pointer;
  padding: 0;
}
.delta-theme-toggle svg,
.theme-toggle svg { width: 1.15rem; height: 1.15rem; display: none; }
html[data-theme="dark"] .delta-theme-toggle .delta-theme-toggle__sun,
html[data-theme="dark"] .theme-toggle__sun,
html:not([data-theme]) .delta-theme-toggle .delta-theme-toggle__sun,
html:not([data-theme]) .theme-toggle__sun { display: block; }
html[data-theme="light"] .delta-theme-toggle .delta-theme-toggle__moon,
html[data-theme="light"] .theme-toggle__moon { display: block; }
html[data-theme="light"] .delta-theme-toggle,
html[data-theme="light"] .theme-toggle {
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.4);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}
.delta-theme-toggle:hover,
.theme-toggle:hover { filter: brightness(1.08); }
.who__out {
  display: grid; place-items: center;
  width: 2.45rem; height: 2.45rem; flex: 0 0 auto;
  border-radius: 50%;
  color: var(--cyan);
  border: 2px solid rgba(234, 88, 12, 0.55);
  background: radial-gradient(circle at 35% 30%, #1a2a44, #0a0c12 72%);
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.12), 0 6px 16px rgba(0, 0, 0, 0.35);
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.who__out svg { width: 1.25rem; height: 1.25rem; display: block; }
.who__out:hover, .who__out:focus-visible {
  color: #041018;
  background: linear-gradient(145deg, #ff8aa3, var(--danger));
  border-color: #ffd0da;
  box-shadow: 0 0 0 3px rgba(255, 107, 138, 0.28), 0 0 18px rgba(255, 107, 138, 0.45);
  transform: translateY(-1px);
  text-decoration: none;
}

.role-pill, .type-pill {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}
.role-pill--admin {
  color: #ffffff;
  background: var(--cyan);
  border-color: #fdba74;
  box-shadow: 0 0 12px rgba(234, 88, 12, 0.32);
}
.role-pill--user {
  color: #fdba74;
  background: rgba(234, 88, 12, 0.12);
  border-color: rgba(234, 88, 12, 0.4);
}
.role-pill--supervisor {
  color: #fed7aa;
  background: rgba(92, 180, 255, 0.18);
  border-color: rgba(92, 180, 255, 0.48);
}
.role-pill--magasinier {
  color: #7ee8e0;
  background: rgba(56, 210, 200, 0.14);
  border-color: rgba(56, 210, 200, 0.42);
}
.who__role { font-size: 0.62rem; padding: 0.14rem 0.48rem; }
.type-pill--fac {
  color: #ffffff;
  background: var(--cyan);
  border-color: #fdba74;
  box-shadow: 0 0 12px rgba(234, 88, 12, 0.32);
}
.type-pill--sit {
  color: #fdba74;
  background: rgba(234, 88, 12, 0.12);
  border-color: rgba(234, 88, 12, 0.4);
}
.type-pill--avoir {
  color: #ffc4d0;
  background: rgba(255, 107, 138, 0.16);
  border-color: rgba(255, 107, 138, 0.45);
}
.type-pill--cmd {
  color: #e0c8ff;
  background: rgba(251, 146, 60, 0.16);
  border-color: rgba(251, 146, 60, 0.45);
}
.type-pill--g {
  color: #ffd7a8;
  background: rgba(255, 184, 107, 0.16);
  border-color: rgba(255, 184, 107, 0.45);
}
.type-pill--other, .type-pill--empty {
  color: var(--muted);
  background: rgba(138, 160, 196, 0.12);
  border-color: rgba(138, 160, 196, 0.32);
}

.stage { width: calc(100% - 2rem); max-width: none; margin: 1.5rem 1rem 3rem; }
.page-head h1 {
  font-family: var(--display); font-size: clamp(1.6rem, 3vw, 2.3rem);
  margin: 0.15rem 0 0.35rem; letter-spacing: 0.03em;
}
.kicker {
  margin: 0; text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 0.72rem; color: var(--cyan);
}
.lede, .muted, .count { color: var(--muted); }
.count { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }

.list-toolbar {
  display: flex; align-items: center; gap: 0.7rem 1rem;
  margin: 0 0 0.85rem;
}
.list-toolbar .search { flex: 1 1 auto; min-width: 0; margin: 0; }
.list-toolbar .count { flex: 0 0 auto; }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
  gap: 0.85rem; margin: 1.2rem 0 1.6rem;
}
.kpi {
  display: block; padding: 1rem 1.05rem;
  border: 1px solid var(--stroke); border-radius: 1rem;
  background: var(--panel); box-shadow: var(--shadow);
  color: inherit;
  min-width: 0;
}
.kpi:hover { border-color: var(--cyan); text-decoration: none; }
.kpi span { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.kpi strong {
  display: block;
  font-family: var(--font);
  font-weight: 600;
  font-size: clamp(1.28rem, 1.7vw, 1.6rem);
  letter-spacing: 0;
  margin: 0.25rem 0;
  white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums;
}
.kpi em { font-style: normal; color: var(--amber); font-size: 0.78rem; }
.kpi--duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-column: span 2;
  padding: 0;
}
.kpi--duo > a {
  display: block;
  min-width: 0;
  padding: 1rem 1.05rem;
  color: inherit;
  text-decoration: none;
}
.kpi--duo > a + a { border-left: 1px solid var(--stroke); }
.kpi--duo > a:hover { background: rgba(234, 88, 12, 0.06); text-decoration: none; }
.kpi--duo > a:first-child { border-radius: 1rem 0 0 1rem; }
.kpi--duo > a:last-child { border-radius: 0 1rem 1rem 0; }

.card {
  border: 1px solid var(--stroke); border-radius: 1.1rem;
  background: var(--panel); padding: 1.1rem 1.2rem; margin: 1rem 0;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 0.8rem; font-size: 1.05rem; }
.chain { display: grid; gap: 0.45rem; padding-left: 1.1rem; }
.chain li { color: var(--muted); }
.model-schema {
  margin: 0 0 1.2rem;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: var(--bg);
}
.model-schema img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}
.chain strong { color: var(--text); }

.search { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }
.search input {
  flex: 1 1 220px; min-width: 0;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--stroke); border-radius: 0.7rem;
  padding: 0.65rem 0.8rem;
}
.search button, .gate button, .nav-toggle {
  background: linear-gradient(135deg, #ea580c, #f97316);
  color: #ffffff; border: 0; border-radius: 0.7rem;
  padding: 0.65rem 1rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.search__clear { align-self: center; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 100%; border-collapse: collapse; font-size: 0.9rem; table-layout: auto; }
th, td { padding: 0.55rem 0.7rem; border-bottom: 1px solid rgba(255,255,255,0.06); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
tr:hover td { background: rgba(234, 88, 12, 0.04); }
.num, .keep, th.num, td.num, .mono {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}
.num { text-align: right; font-variant-numeric: tabular-nums; }
.money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.84em; }
.text { min-width: 12rem; overflow-wrap: anywhere; word-break: break-word; }
mark { background: #fff1a8; color: #17130a; border-radius: 0.15rem; padding: 0 0.1em; }

.pill {
  display: inline-block; padding: 0.12rem 0.5rem; border-radius: 999px;
  font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase;
}
.pill--study { background: rgba(234, 88, 12, 0.15); color: var(--cyan); }
.pill--live { background: rgba(74, 222, 128, 0.16); color: var(--ok); }
.pill--lost { background: rgba(255, 107, 138, 0.16); color: var(--danger); }
.pill--done { background: rgba(138, 160, 196, 0.18); color: var(--muted); }
.pill--archive { background: rgba(251, 146, 60, 0.16); color: var(--violet); }
.pill--unknown { background: rgba(255, 184, 107, 0.14); color: var(--amber); }

.grid-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem 1rem; }
.kv { margin: 0; }
.kv dt { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.kv dd { margin: 0.15rem 0 0; }

.banner { padding: 0.75rem 0.9rem; border-radius: 0.8rem; margin: 0.8rem 0; }
.banner--err { background: rgba(255, 107, 138, 0.12); border: 1px solid rgba(255, 107, 138, 0.35); }
.empty {
  padding: 1.4rem; text-align: center; color: var(--muted);
  border: 1px dashed var(--stroke); border-radius: 0.9rem;
}
.pager { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0; }
.pager__btn {
  padding: 0.35rem 0.65rem; border: 1px solid var(--stroke); border-radius: 0.5rem; color: var(--text);
}
.pager__btn.is-current { background: var(--cyan); color: #ffffff; }

.th-sort {
  display: inline-flex; align-items: center; gap: 0.3rem;
  color: inherit; text-decoration: none; white-space: nowrap;
}
.th-sort:hover { color: var(--cyan); text-decoration: none; }
th.is-sorted .th-sort { color: var(--cyan); }
.th-sort__mark { font-size: 0.62rem; min-width: 0.7em; }
.th-filter {
  display: block; width: 100%; margin-top: 0.38rem;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--stroke); border-radius: 0.4rem;
  padding: 0.28rem 0.4rem; font: inherit; font-size: 0.74rem;
}
.th-filter:focus { outline: 1px solid rgba(234, 88, 12, 0.35); }
th.num .th-filter { text-align: right; }
.th-filters th { font-weight: 400; text-transform: none; letter-spacing: 0; padding-top: 0.15rem; }
.fiche-row { cursor: pointer; }
.col-filters { display: none; }

.dash { margin: 0 0 1.6rem; }
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}
.dash-kpi {
  border: 1px solid var(--stroke);
  border-radius: 1rem;
  background: var(--panel);
  padding: 1.05rem 1.15rem;
  box-shadow: var(--shadow);
  min-width: 0;
}
.dash-kpi span { display: block; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.dash-kpi strong {
  display: block;
  font-family: var(--font);
  font-weight: 600;
  font-size: clamp(1.28rem, 1.7vw, 1.6rem);
  letter-spacing: 0;
  margin: 0.35rem 0 0.15rem;
  white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums;
}
.dash-kpi em { font-style: normal; color: var(--amber); font-size: 0.8rem; }
.dash-charts {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr);
  gap: 1rem;
}
.year-nav {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin: -0.4rem 0 1.1rem;
}
.year-nav__btn {
  padding: 0.32rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--stroke);
  color: var(--text); background: rgba(10, 16, 32, 0.55);
  font-size: 0.86rem; text-decoration: none;
}
.year-nav__btn:hover, .year-nav__btn.is-active {
  background: var(--cyan); color: #ffffff; text-decoration: none;
}
.dash-chart {
  border: 1px solid var(--stroke);
  border-radius: 1.1rem;
  background: var(--panel);
  padding: 1.15rem 1.2rem 1.3rem;
  min-height: 22rem;
  max-height: 40rem;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.dash-chart h2 { margin: 0 0 1rem; font-size: 1.05rem; flex: 0 0 auto; }
.dash-bars {
  display: grid; gap: 0.7rem;
  overflow-y: auto;
  min-height: 16rem;
  max-height: 32rem;
  padding-right: 0.4rem;
}
.dash-bar {
  display: grid;
  grid-template-columns: minmax(11rem, 24rem) 1fr auto;
  gap: 0.7rem;
  align-items: start;
  color: inherit;
  text-decoration: none;
}
.dash-bar:hover { text-decoration: none; }
.dash-bar__label {
  font-weight: 600;
  line-height: 1.3;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}
.dash-bar__track {
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(234, 88, 12, 0.08);
  overflow: hidden;
}
.dash-bar__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ea580c, #f97316);
}
.dash-bar__val { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--cyan); font-weight: 600; }
.dash-chart--pie { display: flex; flex-direction: column; align-items: center; }
.dash-pie {
  width: min(18rem, 70%);
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 0.6rem 0 1rem;
  background: conic-gradient(var(--pie-ok) 0 var(--pie-pct, 0%), var(--pie-ko) var(--pie-pct, 0%) 100%);
  box-shadow: inset 0 0 0 18px var(--pie-ring);
}
.dash-pie__leg { list-style: none; padding: 0; margin: 0; width: 100%; }
.dash-pie__leg li { display: flex; align-items: center; gap: 0.5rem; margin: 0.35rem 0; }
.dash-pie__swatch { width: 0.85rem; height: 0.85rem; border-radius: 50%; display: inline-block; }
.dash-pie__swatch--ok { background: var(--pie-ok); }
.dash-pie__swatch--ko { background: var(--pie-ko); }
@media (max-width: 900px) {
  .dash-charts { grid-template-columns: 1fr; }
  .dash-bar { grid-template-columns: 1fr; gap: 0.25rem; }
  .dash-chart { max-height: none; }
}
.evo { margin: 0 0 2rem; }
.evo__title { margin: 0 0 0.35rem; font-size: 1.2rem; }
.evo-chart {
  margin: 1rem 0 1.4rem;
  border: 1px solid var(--stroke);
  border-radius: 1.1rem;
  background: var(--panel);
  padding: 1.1rem 1.15rem 1.2rem;
  box-shadow: var(--shadow);
}
.evo-chart h2 { margin: 0 0 0.25rem; font-size: 1.02rem; }
.evo-plot {
  display: flex; align-items: flex-end; gap: 0.45rem;
  min-height: 16rem;
  padding: 0.4rem 0 0;
  overflow-x: auto;
}
.evo-col {
  flex: 1 1 3.2rem; min-width: 3.1rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
}
.evo-col__val { font-size: 0.72rem; color: var(--cyan); font-variant-numeric: tabular-nums; text-align: center; line-height: 1.15; white-space: nowrap; }
.evo-col__track {
  width: 100%; max-width: 2.4rem;
  height: 12.5rem;
  display: flex; align-items: flex-end;
  background: rgba(234, 88, 12, 0.07);
  border-radius: 0.45rem 0.45rem 0.2rem 0.2rem;
}
.evo-col__bar {
  display: block; width: 100%;
  min-height: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #ea580c, #f97316);
}
.evo-col__x { font-size: 0.72rem; color: var(--muted); text-align: center; }
.evo2 {
  margin: 1rem 0 1.4rem;
  border: 1px solid var(--stroke);
  border-radius: 1.1rem;
  background: var(--panel);
  padding: 1.1rem 1.15rem 1.2rem;
  box-shadow: var(--shadow);
}
.evo2 h2 { margin: 0 0 0.25rem; font-size: 1.08rem; }
.evo2-wrap { overflow-x: auto; }
.evo2-svg { width: 100%; min-width: 36rem; height: auto; display: block; }
.evo2-grid { stroke: rgba(138, 160, 196, 0.28); stroke-width: 1; }
.evo2-grid--h { stroke-dasharray: 4 6; }
.evo2-tick, .evo2-x { fill: var(--muted); font-size: 11px; font-family: inherit; }
.evo2-line { stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.evo2-leg {
  list-style: none; padding: 0.7rem 0 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 0.55rem 1.15rem;
}
.evo2-leg li { display: flex; align-items: center; gap: 0.4rem; font-size: 0.86rem; }
.evo2-leg i { width: 1.15rem; height: 0.28rem; border-radius: 99px; display: inline-block; }
.evo2-leg strong { font-variant-numeric: tabular-nums; color: var(--text); }
.infinite { text-align: center; color: var(--muted); padding: 0.85rem 0.4rem 0.2rem; }
.infinite__status { margin: 0; font-size: 0.82rem; }

.banner--ok { background: rgba(74, 222, 128, 0.12); border: 1px solid rgba(74, 222, 128, 0.35); }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1rem; }
.btn {
  background: linear-gradient(135deg, #ea580c, #f97316);
  color: #ffffff; border: 0; border-radius: 0.7rem;
  padding: 0.65rem 1rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.btn:hover { filter: brightness(1.06); }
.btn--ghost {
  background: transparent;
  color: var(--cyan);
  border: 1px solid rgba(234, 88, 12, 0.45);
}
.btn--ghost:hover { background: rgba(234, 88, 12, 0.12); filter: none; }
html[data-theme="light"] .btn--ghost {
  color: #c2410c;
  border-color: rgba(234, 88, 12, 0.4);
}
html[data-theme="light"] .btn--ghost:hover { background: rgba(234, 88, 12, 0.08); }
.link-edit {
  background: none; border: 0; padding: 0;
  color: #9aa8bd; cursor: pointer; font: inherit;
}
.link-edit:hover { color: #c9d3e3; text-decoration: underline; }
html[data-theme="light"] .link-edit { color: #c2410c; }
html[data-theme="light"] .link-edit:hover { color: #085a6d; }

.m-overlay {
  display: none;
  position: fixed; inset: 0;
  z-index: 4000;
  background: transparent;
}
.m-overlay::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(4, 8, 16, 0.55);
  backdrop-filter: blur(6px);
  pointer-events: none;
  z-index: 0;
}
.m-overlay.is-open { display: block; }
.m-modal {
  position: fixed;
  z-index: 1;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  grid-template-rows: auto minmax(0, 1fr) 16px;
  grid-template-areas:
    "bar grip-e"
    "body grip-e"
    "grip-s grip-se";
  min-width: 320px;
  border-radius: 1rem;
  border: 1px solid rgba(234, 88, 12, 0.28);
  background: linear-gradient(180deg, rgba(16, 26, 48, 0.97), rgba(8, 14, 28, 0.98));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(234, 88, 12, 0.08);
  overflow: visible;
}
.m-modal.is-max {
  inset: 10px !important;
  left: 10px !important;
  top: 10px !important;
  right: 10px !important;
  bottom: 10px !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0.7rem;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "bar"
    "body";
}
.m-modal.is-resizing {
  user-select: none;
}
body.is-modal-resizing {
  user-select: none !important;
  cursor: inherit;
}
body.is-modal-resizing,
body.is-modal-resizing * {
  cursor: inherit !important;
}
.m-modal__bar {
  grid-area: bar;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  cursor: grab;
  user-select: none;
  background: linear-gradient(180deg, rgba(234, 88, 12, 0.16), rgba(234, 88, 12, 0.05));
  border-bottom: 1px solid rgba(234, 88, 12, 0.16);
  border-radius: 1rem 0 0 0;
  min-width: 0;
}
.m-modal__bar:active { cursor: grabbing; }
.m-modal__title {
  margin: 0; flex: 1; min-width: 0;
  font-family: var(--display); font-size: 0.92rem; letter-spacing: 0.03em;
  color: var(--text);
}
.m-modal__traffic { display: flex; align-items: center; gap: 0.45rem; }
.m-modal__dot {
  box-sizing: border-box;
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; place-content: center;
  border: 0; padding: 0; margin: 0;
  font-size: 0; line-height: 0;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  cursor: pointer;
  appearance: none; -webkit-appearance: none;
  flex-shrink: 0;
}
.m-modal__dot::-moz-focus-inner { border: 0; padding: 0; }
.m-modal__dot svg {
  display: block;
  width: 10px; height: 10px;
  margin: 0; overflow: visible;
  opacity: 0;
  color: #fff !important;
  fill: none !important;
  stroke: #fff !important;
}
.m-modal__dot--close svg {
  transform: translate(0, 0);
}
.m-modal__dot svg * {
  fill: none !important;
  stroke: #fff !important;
}
.m-modal__traffic:hover .m-modal__dot svg,
.m-modal__dot:hover svg,
.m-modal__dot:focus-visible svg {
  opacity: 1;
}
.m-modal__dot--min { background: #f5c14a; }
.m-modal__dot--max { background: #32d074; }
.m-modal__dot--close { background: #ff6b8a; }
.m-modal__dot:hover { filter: brightness(1.08); transform: scale(1.06); }
.m-modal__resize {
  position: relative;
  z-index: 8;
  touch-action: none;
  user-select: none;
  pointer-events: auto;
}
.m-modal__resize::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: auto;
}
.m-modal__resize--e {
  grid-area: grip-e;
  cursor: ew-resize;
  background: transparent;
  border-radius: 0 1rem 0 0;
}
.m-modal__resize--e::before {
  top: 0;
  bottom: 0;
  left: -4px;
  right: -10px;
}
.m-modal__resize--s {
  grid-area: grip-s;
  cursor: ns-resize;
  background: transparent;
  border-radius: 0 0 0 1rem;
}
.m-modal__resize--s::before {
  left: 0;
  right: 0;
  top: -4px;
  bottom: -10px;
}
.m-modal__resize--se {
  grid-area: grip-se;
  z-index: 9;
  cursor: nwse-resize;
  background: transparent;
  border-radius: 0 0 0.85rem 0;
}
.m-modal__resize--se::before {
  top: -8px;
  left: -8px;
  right: -12px;
  bottom: -12px;
}
.m-modal__resize--e:hover,
.m-modal__resize--s:hover,
.m-modal__resize--se:hover {
  background: rgba(234, 88, 12, 0.32);
}
html[data-theme="light"] .m-modal__resize--e:hover,
html[data-theme="light"] .m-modal__resize--s:hover,
html[data-theme="light"] .m-modal__resize--se:hover {
  background: rgba(11, 125, 150, 0.18);
}
.m-modal__resize--se::after {
  content: "";
  position: absolute;
  right: 4px; bottom: 4px;
  width: 9px; height: 9px;
  border-right: 2px solid rgba(232, 241, 255, 0.55);
  border-bottom: 2px solid rgba(232, 241, 255, 0.55);
  border-radius: 0 0 2px 0;
  pointer-events: none;
}
html[data-theme="light"] .m-modal__resize--se::after {
  border-right-color: rgba(28, 55, 90, 0.45);
  border-bottom-color: rgba(28, 55, 90, 0.45);
}
.m-modal.is-max .m-modal__resize { display: none; }
.m-modal.is-max .m-modal__bar { border-radius: 0.7rem 0.7rem 0 0; }
.m-modal.is-max .m-modal__body { border-radius: 0 0 0.7rem 0.7rem; }
.m-modal__body {
  grid-area: body;
  padding: 1.05rem 1.1rem 1.15rem;
  overflow: auto;
  min-width: 0;
  min-height: 0;
  border-radius: 0;
}
.m-dock {
  position: fixed; right: 0.85rem; bottom: 0; z-index: 4100;
  display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 0.35rem;
  pointer-events: none;
}
.m-dock__tab {
  pointer-events: auto;
  display: flex; align-items: stretch;
  max-width: min(280px, calc(100vw - 24px));
  border: 1px solid rgba(234, 88, 12, 0.28);
  border-bottom: 0;
  border-radius: 0.7rem 0.7rem 0 0;
  background: rgba(10, 18, 36, 0.94);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}
.m-dock__open {
  flex: 1; min-width: 0;
  border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 0.78rem; font-weight: 600;
  padding: 0.45rem 0.7rem; cursor: pointer; text-align: left;
}
.m-dock__x {
  border: 0; background: transparent; color: var(--muted);
  font-size: 1.1rem; padding: 0 0.55rem; cursor: pointer;
}
.m-dock__x:hover { color: var(--danger); }

.user-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
}
.user-form label { color: var(--muted); font-size: 0.82rem; }
.user-form input, .user-form select {
  display: block; width: 100%; margin-top: 0.3rem;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--stroke); border-radius: 0.7rem; padding: 0.6rem 0.7rem;
}
.user-form .check { display: flex; align-items: center; gap: 0.45rem; margin-top: 1.4rem; }
.user-form .check input { width: auto; margin: 0; }
.user-form__actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.4rem; }
.user-form__actions button {
  background: linear-gradient(135deg, #ea580c, #f97316);
  color: #041018; border: 0; border-radius: 0.7rem;
  padding: 0.65rem 1rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.inline-del, .inline-as { display: inline; margin-left: 0.55rem; }
.inline-as--banner { margin-left: 0.65rem; }
.linkish {
  background: none; border: 0; padding: 0;
  color: #6f7a8a; cursor: pointer; font: inherit;
}
.linkish:hover { color: #9a8088; text-decoration: underline; }
html[data-theme="light"] .linkish { color: #be123c; }
html[data-theme="light"] .linkish:hover { color: #9f1239; }
.link-as {
  background: none; border: 0; padding: 0;
  color: #7dd3fc; cursor: pointer; font: inherit;
}
.link-as:hover { color: #bae6fd; text-decoration: underline; }
html[data-theme="light"] .link-as { color: #0369a1; }
html[data-theme="light"] .link-as:hover { color: #0c4a6e; }
.banner--impersonate {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem;
}
.banner--impersonate__meta { color: var(--muted); font-size: 0.92em; }
html[data-theme="light"] .banner--impersonate {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(3, 105, 161, 0.35);
}

.doc-lines__toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem 1rem;
  margin: 0 0 0.7rem;
}
.doc-lines__hint { margin: 0; flex: 1 1 16rem; }
.doc-cols-toggle {
  appearance: none; border: 0; background: none; padding: 0;
  font: inherit; font-size: 0.78rem; color: var(--muted);
  cursor: pointer; text-decoration: underline; text-underline-offset: 0.15em;
  white-space: nowrap;
}
.doc-cols-toggle:hover { color: var(--text); }
html[data-doc-refs="1"] .doc-cols-toggle__show { display: none; }
html:not([data-doc-refs="1"]) .doc-cols-toggle__hide { display: none; }
html:not([data-doc-refs="1"]) .doc-col-ref { display: none; }
.nae-pick { margin: 0 0 0.7rem; }
.nae-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.7rem 1rem;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(234, 88, 12, 0.32);
  border-radius: 0.85rem;
  background: rgba(10, 20, 38, 0.88);
}
.nae-bar__hint { margin: 0; font-weight: 600; color: var(--text); }
.nae-bar__btn { margin-left: auto; }
.nae-col { width: 3.2rem; text-align: center; }
.nae-check {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.35rem; cursor: pointer; user-select: none;
  color: var(--muted); font-size: 0.78rem; font-weight: 600;
}
.nae-check input {
  width: 1.2rem; height: 1.2rem; margin: 0;
  accent-color: var(--cyan); cursor: pointer;
}
html[data-theme="light"] .nae-bar {
  background: #f4f8fc;
  border-color: rgba(234, 88, 12, 0.22);
}
.nae-btn {
  display: inline-flex; align-items: center; gap: 0.28rem;
  padding: 0.2rem 0.62rem; border-radius: 999px;
  border: 1px solid rgba(234, 88, 12, 0.45);
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.14), rgba(251, 146, 60, 0.16));
  color: var(--cyan);
  font: inherit; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap; vertical-align: middle;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}
.nae-btn svg { width: 0.78rem; height: 0.78rem; display: block; }
.nae-btn:hover, .nae-btn:focus-visible {
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  border-color: transparent;
  box-shadow: 0 0 16px rgba(234, 88, 12, 0.45);
  transform: translateY(-1px);
}
html[data-theme="light"] .nae-btn {
  border-color: rgba(234, 88, 12, 0.4);
  background: rgba(234, 88, 12, 0.08);
  color: #c2410c;
}
html[data-theme="light"] .nae-btn:hover,
html[data-theme="light"] .nae-btn:focus-visible {
  color: #ffffff;
  background: linear-gradient(135deg, #0891b2, #7c3aed);
  box-shadow: 0 6px 16px rgba(8, 145, 178, 0.3);
}
.nae-modal__kicker {
  margin: 0 0 0.6rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 0.72rem; color: var(--cyan);
}
.nae-modal__title { margin: 0.4rem 0 0.5rem; font-size: 1.02rem; }
.nae-modal__actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 0.9rem;
  margin-top: 0.9rem;
}
.nae-modal__hint { margin: 0; font-size: 0.78rem; }
.nae-modal__actions .btn[disabled] { opacity: 0.6; cursor: progress; }

.nae-link {
  font-size: 0.78rem; font-weight: 600; color: var(--muted);
  white-space: nowrap;
}
.nae-link:hover { color: var(--cyan); }
.nae-back { margin: 0 0 0.8rem; }
.nae-devis { margin: 0; padding-left: 1.1rem; }
.nae-synth__text {
  white-space: pre-wrap; font: inherit; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--stroke);
  border-radius: 0.8rem; padding: 0.9rem 1rem; overflow: auto;
}
.nae-form { margin: 0.8rem 0 1.2rem; }
.nae-actions { margin: 0 0 1rem; }
.doc-lines { border-collapse: collapse; border-spacing: 0; }
.doc-lines thead th {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.doc-block + .doc-block { margin-top: 0; }
.doc-lines .doc-line--title td {
  font-weight: 700;
  background: rgba(234, 88, 12, 0.12);
  border-top: 0;
}
.doc-lines .doc-line--title td.text { letter-spacing: 0.01em; }
.doc-lines .doc-line--subtotal td {
  font-weight: 700;
  background: rgba(50, 208, 116, 0.2);
  border-top: 2px solid rgba(50, 208, 116, 0.55);
  border-bottom: 2px solid rgba(50, 208, 116, 0.28);
}
.doc-lines .doc-line--subtotal td:first-child {
  box-shadow: inset 4px 0 0 var(--ok);
}
.doc-lines .doc-line--subtotal .num { color: var(--ok); }
.doc-lines .doc-line--split td.text { padding-left: 1.2rem; color: var(--muted); }

.login-theme { position: fixed; top: 0.85rem; right: 0.85rem; z-index: 5; }
.login-body { min-height: 100vh; }
.gate-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  padding: 2rem 1rem;
}
.gate-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.35rem;
}
.gate-hero[hidden] { display: none !important; }
.gate-hero__logo .gate__logo-svg { width: min(12rem, 70vw); }
.gate-hero .btn { padding: 0.75rem 1.6rem; font-size: 1rem; }
.gate-box {
  position: relative;
  z-index: 1;
  width: min(440px, calc(100vw - 2.5rem));
  max-height: min(86vh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.9rem;
  border: 1px solid rgba(234, 88, 12, 0.28);
  background: linear-gradient(180deg, rgba(18, 21, 30, 0.98), rgba(10, 12, 18, 0.99));
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(234, 88, 12, 0.08);
}
.gate-box[hidden] { display: none !important; }
.gate-box.is-pinned { position: fixed; margin: 0; }
.gate-box__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(234, 88, 12, 0.18), rgba(234, 88, 12, 0.06));
  border-bottom: 1px solid rgba(234, 88, 12, 0.18);
}
.gate-box.is-max .gate-box__bar,
.gate-box.is-min .gate-box__bar { cursor: default; }
.gate-box__bar:active { cursor: grabbing; }
.gate-box__title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  font-weight: 700;
}
.gate-box__win {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
  flex-shrink: 0;
}
.gate-win {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  box-shadow:
    0 2px 3px rgba(0, 0, 0, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 -1px 1px rgba(0, 0, 0, 0.18) inset;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.gate-win:hover { transform: scale(1.1); filter: brightness(1.05); }
.gate-win--min {
  background: radial-gradient(120% 90% at 30% 18%, #ffe27a 0%, #ffc53d 38%, #f5a623 72%, #d8890c 100%);
}
.gate-win--max {
  background: radial-gradient(120% 90% at 30% 18%, #7dff8f 0%, #3fd65a 38%, #22c53e 72%, #14a32e 100%);
}
.gate-win--close {
  background: radial-gradient(120% 90% at 30% 18%, #ff9a93 0%, #ff6b63 38%, #ff3b30 72%, #d92018 100%);
}
.gate-win::before {
  content: "";
  position: absolute;
  left: 14%; right: 14%; top: 8%;
  height: 38%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.gate-win::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: center / 11px 11px no-repeat;
  pointer-events: none;
}
.gate-win--min::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 6h7.6' stroke='%231a1a1a' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
}
.gate-win--max::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Crect x='2.6' y='2.6' width='6.8' height='6.8' rx='0.6' fill='none' stroke='%23fff' stroke-width='1.7'/%3E%3C/svg%3E");
}
.gate-win--max.is-restore::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4.2 2.8h5v5' fill='none' stroke='%23fff' stroke-width='1.5'/%3E%3Crect x='2.4' y='4' width='5.2' height='5.2' rx='0.4' fill='none' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E");
}
.gate-win--close::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 3l6 6M9 3L3 9' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  padding: 1.35rem 1.45rem 1.3rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: auto;
}
.gate-form__hint { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.45; }
.gate-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.1rem 0 0.15rem;
  color: #ffffff;
}
.gate-brand--full,
.gate-brand.gate__logo {
  display: flex;
  justify-content: center;
  margin: 0.15rem auto 0.35rem;
  line-height: 0;
}
.gate-brand--full img,
.gate-brand.gate__logo img {
  width: min(9.5rem, 52vw);
  height: auto;
  display: block;
}
.gate-brand .brand__mark,
.gate-brand__mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.55rem;
  margin: 0;
  flex-shrink: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}
.gate-brand .brand__mark img,
.gate-brand__mark img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.gate-brand .logo-word,
.gate-brand__word {
  font-size: 1.35rem;
  margin: 0;
}
.logo-word__img {
  display: block;
  height: 1.15em;
  width: auto;
}
.gate-fld {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.gate-fld input {
  display: block; width: 100%;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--stroke); border-radius: 0.55rem;
  padding: 0.7rem 0.8rem; font: inherit;
}
.gate-form__submit {
  align-self: flex-start;
  margin-top: 0.15rem;
  width: auto;
  padding: 0.65rem 1.25rem;
  background: linear-gradient(135deg, #ea580c, #f97316);
  color: #fff; border: 0; border-radius: 0.55rem;
  font-weight: 700; cursor: pointer; font-family: inherit;
}
.gate-form__submit:hover { filter: brightness(1.06); }
.gate-pass { position: relative; display: block; }
.gate-pass input { padding-right: 2.6rem; }
.gate-pass__toggle {
  position: absolute; right: 0.35rem; top: 50%; transform: translateY(-50%);
  width: auto; margin: 0; padding: 0.35rem;
  background: transparent; border: 0; border-radius: 0.45rem;
  color: var(--muted); cursor: pointer; line-height: 0;
}
.gate-pass__toggle:hover { color: var(--text); background: transparent; }
.gate-pass__toggle svg { width: 1.15rem; height: 1.15rem; display: block; }
.gate-pass__toggle svg[hidden] { display: none; }
.gate-box__resize {
  position: absolute;
  right: 0; bottom: 0;
  width: 16px; height: 16px;
  cursor: nwse-resize;
  z-index: 2;
}
.gate-box__resize::after {
  content: "";
  position: absolute;
  right: 4px; bottom: 4px;
  width: 8px; height: 8px;
  border-right: 2px solid rgba(234, 88, 12, 0.55);
  border-bottom: 2px solid rgba(234, 88, 12, 0.55);
}
.gate-box.is-max {
  width: min(720px, calc(100vw - 2rem));
  height: min(640px, calc(100vh - 2rem));
  max-height: none;
}
.gate-box.is-max .gate-box__resize { display: none; }
.gate-box.is-min {
  position: fixed;
  left: 1.1rem; bottom: 1.1rem;
  width: auto; height: auto;
  max-height: none;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.gate-box.is-min .gate-form,
.gate-box.is-min .gate-box__resize { display: none; }
.gate-box.is-min .gate-box__bar {
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  background: var(--panel);
}
html[data-theme="light"] .gate-box {
  background: #ffffff;
  border-color: rgba(28, 55, 90, 0.14);
  box-shadow: 0 24px 48px rgba(18, 32, 51, 0.16), 0 0 0 1px rgba(28, 55, 90, 0.05);
}
html[data-theme="light"] .gate-box__bar {
  background: linear-gradient(180deg, #f3f0ea, #e9e4da);
  border-bottom-color: rgba(28, 55, 90, 0.12);
}
html[data-theme="light"] .gate-box__title { color: #122033; }
html[data-theme="light"] .gate-brand { color: #1c1917; }
html[data-theme="light"] .gate-box.is-min .gate-box__bar { background: #ffffff; }
html[data-theme="light"] .gate-box__resize::after {
  border-right-color: rgba(28, 55, 90, 0.4);
  border-bottom-color: rgba(28, 55, 90, 0.4);
}
/* Ancien formulaire gate (mobile / fallback) */
.gate {
  width: min(420px, 100%);
  padding: 1.6rem 1.5rem 1.4rem;
  border: 1px solid var(--stroke); border-radius: 1.2rem;
  background: var(--panel); box-shadow: var(--shadow);
}
.gate h1 { font-family: var(--display); margin: 0.2rem 0 0.4rem; }
.gate label { display: block; margin: 0.75rem 0; color: var(--muted); font-size: 0.82rem; }
.gate input {
  display: block; width: 100%; margin-top: 0.3rem;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--stroke); border-radius: 0.7rem; padding: 0.7rem 0.8rem;
}
.gate button { width: 100%; margin-top: 0.8rem; }
.gate button.gate-pass__toggle {
  position: absolute; right: 0.35rem; top: 50%; transform: translateY(-50%);
  width: auto; margin: 0; padding: 0.35rem;
  background: transparent; border: 0; border-radius: 0.45rem;
  color: var(--muted); cursor: pointer; line-height: 0;
}
.gate button.gate-pass__toggle:hover { color: var(--text); background: transparent; }

html[data-theme="light"] body {
  background: var(--bg);
}
html[data-theme="light"] .orbit {
  display: none;
}
html[data-theme="light"] .brand__mark {
  background: transparent;
  box-shadow: none;
}
html[data-theme="light"] .nav__link.is-active,
html[data-theme="light"] .nav__link:hover {
  color: #ffffff;
}
html[data-theme="light"] .nav__link.is-active .nav__ico,
html[data-theme="light"] .nav__link:hover .nav__ico {
  color: #ffffff;
}
html[data-theme="light"] .nav__link--admin {
  --nav-c: #4f46e5;
}
html[data-theme="light"] .nav__link--admin.is-active,
html[data-theme="light"] .nav__link--admin:hover {
  background: #4f46e5;
  color: #ffffff;
}
html[data-theme="light"] .nav__drop-menu {
  background: #ffffff;
  border-color: rgba(28, 55, 90, 0.16);
}
html[data-theme="light"] .nav__drop-item {
  color: #122033;
}
html[data-theme="light"] .nav__drop-item:hover,
html[data-theme="light"] .nav__drop-item.is-active {
  background: #eef2ff;
  color: #3730a3;
}
html[data-theme="light"] .who__avatar {
  color: #ffffff;
  background: linear-gradient(145deg, #0ea5b7, #4f46e5);
  border-color: #c2410c;
  box-shadow: 0 0 0 3px rgba(11, 125, 150, 0.16), 0 8px 16px rgba(18, 32, 51, 0.12);
}
html[data-theme="light"] .delta-theme-toggle,
html[data-theme="light"] .theme-toggle {
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.4);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}
html[data-theme="light"] .who__out {
  color: #c2410c;
  border-color: rgba(11, 125, 150, 0.4);
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(18, 32, 51, 0.08);
}
html[data-theme="light"] .who__out:hover,
html[data-theme="light"] .who__out:focus-visible {
  color: #ffffff;
  background: linear-gradient(145deg, #fb7185, #be123c);
  border-color: #fda4af;
  box-shadow: 0 0 0 3px rgba(190, 18, 60, 0.18);
}
html[data-theme="light"] .role-pill--admin {
  color: #ffffff;
  background: #4f46e5;
  border-color: #4338ca;
  box-shadow: none;
}
html[data-theme="light"] .role-pill--user {
  color: #0f4c5c;
  background: #d7f4f8;
  border-color: #7ec8d4;
}
html[data-theme="light"] .role-pill--supervisor {
  color: #1e3a5f;
  background: #dbeafe;
  border-color: #93c5fd;
}
html[data-theme="light"] .role-pill--magasinier {
  color: #115e59;
  background: #ccfbf1;
  border-color: #5eead4;
}
html[data-theme="light"] .type-pill--fac {
  color: #ffffff;
  background: #c2410c;
  border-color: #0a6a80;
  box-shadow: none;
}
html[data-theme="light"] .type-pill--sit {
  color: #1e3a5f;
  background: #dbeafe;
  border-color: #7dd3fc;
}
html[data-theme="light"] .type-pill--avoir {
  color: #9f1239;
  background: #ffe4e6;
  border-color: #fda4af;
}
html[data-theme="light"] .type-pill--cmd {
  color: #5b21b6;
  background: #ede9fe;
  border-color: #c4b5fd;
}
html[data-theme="light"] .type-pill--g {
  color: #9a3412;
  background: #ffedd5;
  border-color: #fdba74;
}
html[data-theme="light"] .type-pill--other,
html[data-theme="light"] .type-pill--empty {
  color: #334155;
  background: #e8eef6;
  border-color: #cbd5e1;
}
html[data-theme="light"] .pill--study {
  background: #d7f4f8;
  color: #0f4c5c;
}
html[data-theme="light"] .pill--live {
  background: #dcfce7;
  color: #166534;
}
html[data-theme="light"] .pill--lost {
  background: #ffe4e6;
  color: #9f1239;
}
html[data-theme="light"] .pill--done {
  background: #e8eef6;
  color: #334155;
}
html[data-theme="light"] .pill--archive {
  background: #ede9fe;
  color: #5b21b6;
}
html[data-theme="light"] .pill--unknown {
  background: #ffedd5;
  color: #9a3412;
}
html[data-theme="light"] .year-nav__btn {
  background: #ffffff;
  color: #334155;
  border-color: rgba(28, 55, 90, 0.18);
}
html[data-theme="light"] .year-nav__btn:hover {
  background: #e8eef6;
  color: #122033;
}
html[data-theme="light"] .year-nav__btn.is-active {
  background: #c2410c;
  color: #ffffff;
  border-color: #0a6a80;
}
html[data-theme="light"] .pager__btn.is-current {
  background: #c2410c;
  color: #ffffff;
}
html[data-theme="light"] .dash-pie {
  box-shadow:
    inset 0 0 0 20px #ffffff,
    0 0 0 1px rgba(28, 55, 90, 0.1),
    0 10px 24px rgba(18, 32, 51, 0.08);
}
html[data-theme="light"] .dash-pie__swatch {
  box-shadow: inset 0 0 0 1px rgba(18, 32, 51, 0.12);
}
html[data-theme="light"] .dash-pie__leg li {
  color: #334155;
}
html[data-theme="light"] .dash-bar__track {
  background: #e8eef6;
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar.is-open { transform: none; }
  .sidebar-close, .sidebar-open { display: inline-flex; }
  .app-main { margin-left: 0; }
  .app-kicker { display: none; }
  .who { margin-left: auto; }
}
html[data-theme="light"] .nav {
  background: #ffffff;
}

/* Thème clair — coque des modales (fiche, nae, user-form) */
html[data-theme="light"] .m-overlay::before {
  background: rgba(18, 32, 51, 0.28);
}
html[data-theme="light"] .m-modal {
  border-color: rgba(28, 55, 90, 0.16);
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(18, 32, 51, 0.22), 0 0 0 1px rgba(28, 55, 90, 0.05);
}
html[data-theme="light"] .m-modal__bar {
  background: linear-gradient(180deg, #eef4fa, #e2ebf5);
  border-bottom: 1px solid rgba(28, 55, 90, 0.14);
}
html[data-theme="light"] .m-modal__title { color: #122033; }
html[data-theme="light"] .m-modal__body { color: #122033; }
html[data-theme="light"] .m-dock__tab {
  border-color: rgba(28, 55, 90, 0.2);
  background: #ffffff;
  box-shadow: 0 -8px 24px rgba(18, 32, 51, 0.18);
}

/* Thème clair — contenu de la modale NAE */
html[data-theme="light"] .nae-modal__kicker { color: #c2410c; }
html[data-theme="light"] .nae-modal__title { color: #122033; }
html[data-theme="light"] .nae-modal__hint { color: #4d6178; }
html[data-theme="light"] .nae-synth__text {
  background: #f7fafd;
  border-color: rgba(28, 55, 90, 0.16);
  color: #122033;
}

/* Barre de progression NAE (génération / envoi) */
.nae-progress { width: 100%; margin: 0.65rem 0 0.1rem; }
.nae-progress__track {
  height: 6px;
  border-radius: 999px;
  background: rgba(234, 88, 12, 0.14);
  overflow: hidden;
}
.nae-progress__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ea580c, #f97316);
  transition: width 0.3s ease-out;
}
.nae-progress--error .nae-progress__fill {
  background: linear-gradient(90deg, #ff6b8a, #ff8a5c);
}
.nae-progress__step {
  margin: 0.45rem 0 0;
  font-size: 0.85rem;
  color: #8ea2c0;
}
.nae-progress--error .nae-progress__step { color: #ff8aa4; }
html[data-theme="light"] .nae-progress__track { background: rgba(28, 55, 90, 0.12); }
html[data-theme="light"] .nae-progress__step { color: #4d6178; }
html[data-theme="light"] .nae-progress--error .nae-progress__step { color: #b0264a; }

/* Badges d'état sur le bouton NAE */
.nae-btn--draft {
  border-color: rgba(255, 178, 64, 0.55);
  background: linear-gradient(135deg, rgba(255, 178, 64, 0.14), rgba(255, 138, 92, 0.14));
  color: #ffc46b;
}
.nae-btn--pushed {
  border-color: rgba(74, 222, 128, 0.55);
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.14), rgba(52, 211, 153, 0.14));
  color: #6fe3a1;
}
.nae-btn--err::after {
  content: "";
  width: 7px; height: 7px; flex: 0 0 auto;
  border-radius: 50%;
  background: #ff5c7a;
  box-shadow: 0 0 6px rgba(255, 92, 122, 0.7);
}
html[data-theme="light"] .nae-btn--draft {
  border-color: rgba(194, 120, 3, 0.5);
  background: rgba(255, 178, 64, 0.14);
  color: #9a5b00;
}
html[data-theme="light"] .nae-btn--pushed {
  border-color: rgba(22, 142, 80, 0.5);
  background: rgba(74, 222, 128, 0.14);
  color: #0f7a44;
}
html[data-theme="light"] .nae-btn--err::after { background: #d62753; box-shadow: none; }

/* Modale NAE — liste des devis inclus (chantier) */
.nae-modal__subhead {
  margin: 0.6rem 0 0.25rem;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: #8ea2c0;
}
.nae-modal__devis {
  margin: 0 0 0.6rem; padding: 0 0 0 1.1rem;
  font-size: 0.85rem; color: #c7d5ea;
}
.nae-modal__devis li { margin: 0.15rem 0; }
html[data-theme="light"] .nae-modal__subhead { color: #4d6178; }
html[data-theme="light"] .nae-modal__devis { color: #2b3f57; }

/* Bouton retour de la modale fiche (historique de navigation) */
.m-modal__back {
  flex: 0 0 auto;
  margin-right: 0.55rem;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(234, 88, 12, 0.35);
  background: rgba(234, 88, 12, 0.08);
  color: var(--cyan);
  font: inherit; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.m-modal__back:hover, .m-modal__back:focus-visible {
  background: rgba(234, 88, 12, 0.18);
  border-color: rgba(234, 88, 12, 0.6);
}
html[data-theme="light"] .m-modal__back {
  border-color: rgba(234, 88, 12, 0.35);
  background: #ffffff;
  color: #c2410c;
}
html[data-theme="light"] .m-modal__back:hover,
html[data-theme="light"] .m-modal__back:focus-visible {
  background: rgba(234, 88, 12, 0.08);
  border-color: rgba(234, 88, 12, 0.55);
}

/* Tri des tableaux dans la fiche modale */
[data-fiche-slot] table th { cursor: pointer; user-select: none; }
[data-fiche-slot] table th.is-fsort-asc::after {
  content: " \25B2";
  font-size: 0.68em;
  color: var(--cyan);
}
[data-fiche-slot] table th.is-fsort-desc::after {
  content: " \25BC";
  font-size: 0.68em;
  color: var(--cyan);
}
html[data-theme="light"] [data-fiche-slot] table th.is-fsort-asc::after,
html[data-theme="light"] [data-fiche-slot] table th.is-fsort-desc::after {
  color: #c2410c;
}

/* Badge Oui/Non */
.badge-flag {
  display: inline-block;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.badge-flag--oui { background: rgba(74, 222, 128, 0.16); color: #6fe3a1; }
.badge-flag--non { background: rgba(255, 107, 138, 0.14); color: #ff8aa4; }
html[data-theme="light"] .badge-flag--oui { background: #e2f7eb; color: #0f7a44; }
html[data-theme="light"] .badge-flag--non { background: #fde8ec; color: #b0264a; }

/* Mes appareils (sessions persistantes) */
.dev-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.dev-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border: 1px solid rgba(234, 88, 12, 0.18); border-radius: 12px;
  background: rgba(13, 25, 48, 0.55);
}
.dev-card--current { border-color: rgba(234, 88, 12, 0.55); }
.dev-card__name { margin: 0; font-weight: 600; }
.dev-card__badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 500; vertical-align: middle;
  background: rgba(234, 88, 12, 0.16); color: #ea580c; border: 1px solid rgba(234, 88, 12, 0.4);
}
.dev-card__meta { margin: 3px 0 0; font-size: 0.8rem; opacity: 0.75; }
.dev-card__act { margin: 0; flex: none; }
.dev-revoke-all { margin: 6px 0 14px; }
html[data-theme="light"] .dev-card { background: #ffffff; border-color: rgba(15, 60, 110, 0.16); }
html[data-theme="light"] .dev-card--current { border-color: rgba(11, 116, 173, 0.55); }
html[data-theme="light"] .dev-card__badge { background: #e3f4fb; color: #0b74ad; border-color: rgba(11, 116, 173, 0.35); }

/* Passkeys WebAuthn */
.gate__alt { margin-top: 14px; text-align: center; }
.gate__pk {
  width: 100%; padding: 10px 14px; border-radius: 10px; cursor: pointer;
  background: transparent; color: #ea580c; border: 1px solid rgba(234, 88, 12, 0.45);
  font: inherit; font-weight: 600;
}
.gate__pk:hover { background: rgba(234, 88, 12, 0.12); }
.pk-status { margin: 8px 0 0; font-size: 0.82rem; opacity: 0.85; }
.pk-status--err { color: #ff8aa4; opacity: 1; }
.pk-section { margin-top: 26px; }
.pk-section__title { margin: 0 0 4px; font-size: 1.05rem; }
.pk-section__lede { margin: 0 0 10px; font-size: 0.85rem; opacity: 0.75; }
.pk-section__create { margin: 12px 0 0; }
.pk-rename { display: flex; align-items: center; gap: 6px; margin: 0; }
.pk-rename__input {
  font: inherit; font-weight: 600; padding: 3px 8px; border-radius: 8px;
  background: transparent; color: inherit; border: 1px solid transparent; max-width: 240px;
}
.pk-rename__input:hover, .pk-rename__input:focus { border-color: rgba(234, 88, 12, 0.35); outline: none; }
.pk-rename__save { padding: 3px 9px; }
.gate-magic {
  width: min(380px, calc(100vw - 40px)); margin: 14px auto 0;
  border: 1px solid rgba(234, 88, 12, 0.16); border-radius: 12px;
  background: rgba(13, 25, 48, 0.45); padding: 10px 14px;
}
.gate-magic summary {
  cursor: pointer; font-size: 0.85rem; opacity: 0.8; list-style-position: inside;
}
.gate-magic summary:hover { opacity: 1; }
.gate-magic__form { display: flex; gap: 8px; margin: 10px 0 0; }
.gate-magic__form input {
  flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px;
  background: rgba(6, 14, 30, 0.6); color: inherit;
  border: 1px solid rgba(234, 88, 12, 0.25); font: inherit;
}
.gate-magic__form button {
  padding: 8px 12px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600;
  background: transparent; color: #ea580c; border: 1px solid rgba(234, 88, 12, 0.45);
}
.gate-magic__form button:hover { background: rgba(234, 88, 12, 0.12); }
.gate-magic__hint { margin: 8px 0 2px; font-size: 0.75rem; opacity: 0.6; }
.gate-magic .banner { margin: 10px 0 0; }
/* Connexion QR (PC) */
.gate-qr__panel { margin-top: 12px; text-align: center; }
.gate-qr__img {
  display: block; margin: 0 auto; width: 200px; height: 200px;
  border-radius: 10px; background: #ffffff; padding: 6px; box-sizing: content-box;
}
.gate-qr__img--stale { opacity: 0.25; filter: grayscale(1); }
.gate-qr__code { margin: 10px 0 0; font-size: 0.9rem; }
.gate-qr__code strong { font-size: 1.25rem; letter-spacing: 2px; color: #ea580c; }
.gate-qr__hint { margin: 6px 0 0; font-size: 0.75rem; opacity: 0.65; }
.gate-qr__count { margin: 8px 0 0; font-size: 0.8rem; opacity: 0.8; font-variant-numeric: tabular-nums; }
.gate-qr__regen { margin-top: 10px; }
html[data-theme="light"] .gate-qr__code strong { color: #0b74ad; }
html[data-theme="light"] .gate-qr__img { border: 1px solid rgba(15, 60, 110, 0.16); }

/* Écran « Connecter ce PC ? » */
.qr-confirm { max-width: 460px; }
.qr-confirm__lede { margin: 0 0 10px; }
.qr-confirm__code {
  margin: 14px 0; font-size: 3rem; font-weight: 700; letter-spacing: 10px;
  text-align: center; color: #ea580c; font-variant-numeric: tabular-nums;
}
.qr-confirm__hint { margin: 0 0 6px; font-size: 0.85rem; opacity: 0.75; text-align: center; }
.qr-confirm__meta { margin: 0 0 16px; font-size: 0.8rem; opacity: 0.65; text-align: center; }
.qr-confirm__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.qr-confirm__actions form { margin: 0; }
html[data-theme="light"] .qr-confirm__code { color: #0b74ad; }

html[data-theme="light"] .gate-magic { background: #ffffff; border-color: rgba(15, 60, 110, 0.16); }
html[data-theme="light"] .gate-magic__form input { background: #f5f9fc; border-color: rgba(15, 60, 110, 0.2); }
html[data-theme="light"] .gate-magic__form button { color: #0b74ad; border-color: rgba(11, 116, 173, 0.45); }
html[data-theme="light"] .gate-magic__form button:hover { background: #e3f4fb; }
html[data-theme="light"] .gate__pk { color: #0b74ad; border-color: rgba(11, 116, 173, 0.45); }
html[data-theme="light"] .gate__pk:hover { background: #e3f4fb; }
html[data-theme="light"] .pk-status--err { color: #b0264a; }
html[data-theme="light"] .pk-rename__input:hover, html[data-theme="light"] .pk-rename__input:focus { border-color: rgba(11, 116, 173, 0.35); }

/* Durcissement : journal des connexions + hint formulaire utilisateur */
.authlog { margin-top: 26px; }
.authlog__list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.authlog__row { margin: 0; padding: 6px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.authlog__method { font-weight: 600; min-width: 130px; }
.authlog__meta { opacity: 0.75; font-size: 0.9rem; }
.authlog__badge { color: #ff97b1; border: 1px solid rgba(255, 151, 177, 0.55); border-radius: 999px; padding: 0 8px; font-size: 0.78rem; }
.authlog__row--fail { background: rgba(255, 151, 177, 0.08); }
.user-form__hint { margin: -4px 0 6px; font-size: 0.85rem; opacity: 0.75; }
html[data-theme="light"] .authlog__row { background: rgba(11, 116, 173, 0.06); }
html[data-theme="light"] .authlog__row--fail { background: rgba(176, 38, 74, 0.07); }
html[data-theme="light"] .authlog__badge { color: #b0264a; border-color: rgba(176, 38, 74, 0.5); }

/* Bandeau accès IP → adresse conseillée */
.ip-note { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 7px 14px; font-size: 0.85rem; background: rgba(240, 200, 90, 0.12); border-bottom: 1px solid rgba(240, 200, 90, 0.35); color: inherit; position: relative; z-index: 40; }
.ip-note a { color: inherit; font-weight: 600; }
.ip-note__close { background: none; border: 0; color: inherit; opacity: 0.6; cursor: pointer; font-size: 0.9rem; padding: 2px 6px; }
.ip-note__close:hover { opacity: 1; }
html[data-theme="light"] .ip-note { background: #fdf3d7; border-bottom-color: #ecd9a0; }
