/* =====================================================================
   B.R.S. — FEUILLE DE STYLE DU TERMINAL
   ===================================================================== */

:root {
  --bg: #05080d;
  --bg-2: #070c13;
  --panel: #0a1119;
  --panel-2: #0d1620;
  --line: #16222e;
  --line-2: #213345;
  --line-3: #2d465c;

  --tx: #c6cfd8;
  --tx-2: #8b98a5;
  --tx-3: #57646f;

  --cy: #7fb3bf;
  --cy-2: #4d8591;
  --cy-bg: rgba(127, 179, 191, .07);
  --am: #d0a25a;
  --am-bg: rgba(208, 162, 90, .08);
  --rd: #bd5a52;
  --rd-bg: rgba(189, 90, 82, .09);
  --ok: #86b39b;

  --font: "JetBrains Mono", "IBM Plex Mono", ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1120px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(60, 100, 130, .14), transparent 70%),
    linear-gradient(var(--bg), var(--bg));
  background-attachment: fixed;
  color: var(--tx);
  font: 400 14px/1.7 var(--font);
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-booting .app { opacity: 0; }
.app { transition: opacity .4s var(--ease); }

a { color: var(--cy); text-decoration: none; }
a:hover { color: #a9d3dc; }
:focus-visible { outline: 1px solid var(--cy); outline-offset: 2px; }
::selection { background: rgba(127, 179, 191, .3); color: #fff; }
b, strong { font-weight: 700; color: #dfe6ec; }
em { font-style: italic; color: #d5dde4; }
h1, h2, h3 { font-weight: 500; margin: 0; letter-spacing: .06em; }
p { margin: 0; }

.noscript { padding: 2rem; color: var(--rd); font-family: var(--font); }

/* ---------------------------------------------------------------------
   EFFETS D'ÉCRAN
   --------------------------------------------------------------------- */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 90; }
.fx__scan {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .016) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
}
.fx__vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, .55) 100%);
}
.fx__flicker { position: absolute; inset: 0; background: rgba(150, 200, 220, .025); opacity: 0; }
.fx.is-flicker .fx__flicker { animation: flicker .16s steps(3) 1; }
@keyframes flicker { 0% { opacity: 0; } 33% { opacity: 1; } 66% { opacity: .2; } 100% { opacity: 0; } }

/* ---------------------------------------------------------------------
   ÉLÉMENTS COMMUNS
   --------------------------------------------------------------------- */
.insignia { display: block; color: var(--cy); flex: none; }
.insignia--xl { width: 92px; height: 92px; filter: drop-shadow(0 0 18px rgba(127, 179, 191, .18)); }
.insignia--hdr { width: 38px; height: 38px; }
.insignia--xs { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; margin-right: 8px; opacity: .7; }
.insignia--card { width: 46px; height: 46px; opacity: .35; }

.btn {
  font: inherit; font-size: 12px; font-weight: 500; letter-spacing: .12em;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 40px; padding: 8px 16px;
  color: var(--cy); background: var(--cy-bg);
  border: 1px solid var(--cy-2); border-radius: 1px;
  cursor: pointer; text-transform: uppercase; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: rgba(127, 179, 191, .14); color: #bfe0e7; border-color: var(--cy); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: rgba(127, 179, 191, .12); }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--tx-2); }
.btn--ghost:hover { color: var(--cy); border-color: var(--cy-2); background: var(--cy-bg); }
.btn--sm { min-height: 34px; padding: 6px 12px; font-size: 11px; }
.btn--danger { color: var(--rd); border-color: rgba(189, 90, 82, .5); background: var(--rd-bg); }
.btn--danger:hover { color: #e08a82; border-color: var(--rd); background: rgba(189, 90, 82, .16); }
.btn--ghost.btn--danger { background: transparent; }

.rule { display: flex; align-items: center; gap: 14px; color: var(--tx-3); font-size: 10.5px; letter-spacing: .22em; }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

/* Niveaux d'habilitation */
.lv {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 1px 8px 1px 2px; font-size: 10.5px; font-weight: 500; letter-spacing: .14em;
  border: 1px solid currentColor; border-radius: 1px; line-height: 1.6; white-space: nowrap;
  color: var(--tx-2);
}
.lv__n { display: inline-grid; place-items: center; min-width: 16px; height: 16px; background: currentColor; }
.lv__n { color: inherit; }
.lv .lv__n { font-size: 10px; }
.lv-1 { color: #8a96a1; }
.lv-2 { color: #6f9fb0; }
.lv-3 { color: var(--cy); }
.lv-4 { color: var(--am); }
.lv-5 { color: var(--rd); }
.lv__n { position: relative; }
.lv__n { -webkit-text-fill-color: var(--bg); }

.tag {
  display: inline-flex; align-items: center; padding: 1px 8px; font-size: 10.5px; letter-spacing: .14em;
  border: 1px solid var(--line-3); color: var(--tx-2); white-space: nowrap; line-height: 1.6;
}
.tag--warn { color: var(--am); border-color: rgba(208, 162, 90, .5); background: var(--am-bg); }
.tag--red { color: var(--rd); border-color: rgba(189, 90, 82, .55); background: var(--rd-bg); }
.tag--dim { color: var(--tx-3); border-color: var(--line-2); }

.st {
  display: inline-flex; align-items: center; gap: 7px; padding: 1px 9px; font-size: 10.5px; letter-spacing: .14em;
  border: 1px solid currentColor; white-space: nowrap; line-height: 1.6;
}
.st i { width: 6px; height: 6px; background: currentColor; display: inline-block; }
.st--ok { color: var(--ok); }
.st--ok i { box-shadow: 0 0 6px currentColor; }
.st--warn { color: var(--am); }
.st--red { color: var(--rd); background: var(--rd-bg); }
.st--red i { animation: pulse 1.6s ease-in-out infinite; }
.st--kia { color: #8f7470; text-decoration: line-through; text-decoration-thickness: 1px; }
.st--dim { color: var(--tx-3); }
@keyframes pulse { 50% { opacity: .25; } }

.stamp {
  display: inline-block; padding: 1px 10px; font-size: 11px; font-weight: 700; letter-spacing: .3em;
  color: var(--tx-2); border: 2px solid var(--tx-3); transform: rotate(-3deg);
}

.todo { color: var(--tx-3); font-size: 11px; letter-spacing: .14em; border-bottom: 1px dashed var(--line-3); }
.todo-block {
  color: var(--tx-3); font-size: 11px; letter-spacing: .18em; padding: 14px 16px;
  border: 1px dashed var(--line-2); background: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(255, 255, 255, .012) 8px 16px);
}

/* ---------------------------------------------------------------------
   AUTHENTIFICATION
   --------------------------------------------------------------------- */
.login {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 72px var(--gutter) 40px; position: relative;
}
.login__top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: space-between;
  padding: 14px var(--gutter); font-size: 10.5px; letter-spacing: .16em; color: var(--tx-3);
  border-bottom: 1px solid var(--line);
}
.login__panel {
  width: 100%; max-width: 560px; text-align: center;
  padding: 40px clamp(18px, 5vw, 44px) 34px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(13, 22, 32, .85), rgba(7, 12, 19, .9));
  position: relative;
  animation: rise .7s var(--ease) both;
}
.login__panel::before, .login__panel::after {
  content: ""; position: absolute; width: 14px; height: 14px; border: 1px solid var(--cy-2);
}
.login__panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.login__panel::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.login__emblem { display: flex; justify-content: center; margin-bottom: 22px; }
.login__inst { font-size: clamp(15px, 3.4vw, 19px); letter-spacing: .14em; line-height: 1.45; color: #dce4ea; }
.login__sub { margin-top: 8px; color: var(--tx-2); font-size: 12px; letter-spacing: .08em; }
.login__panel .rule { margin: 28px 0 24px; }
.login__form { text-align: left; }
.login__label { display: block; font-size: 11px; letter-spacing: .26em; color: var(--tx-2); margin-bottom: 8px; }
.login__field {
  display: flex; align-items: stretch; border: 1px solid var(--line-3); background: rgba(0, 0, 0, .35);
  transition: border-color .2s;
}
.login__field:focus-within { border-color: var(--cy-2); box-shadow: 0 0 0 3px rgba(127, 179, 191, .06); }
.login__prompt { display: grid; place-items: center; padding: 0 4px 0 14px; color: var(--cy); font-size: 18px; }
.login__field input {
  flex: 1; min-width: 0; font: inherit; font-size: 17px; letter-spacing: .3em; text-transform: uppercase;
  color: #e6edf2; background: transparent; border: 0; outline: 0; padding: 12px 10px; caret-color: var(--cy);
}
.login__field .btn { border: 0; border-left: 1px solid var(--line-3); min-height: 52px; }
.login__field.is-shake { animation: shake .42s cubic-bezier(.36, .07, .19, .97) both; border-color: var(--rd); }
.login__field.is-locked { border-color: var(--rd); background: repeating-linear-gradient(-45deg, rgba(189, 90, 82, .06) 0 6px, transparent 6px 12px); }
.login__field.is-ok { border-color: var(--cy); }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}
.login__msg { min-height: 1.7em; margin-top: 12px; font-size: 12px; letter-spacing: .12em; }
.login__msg.is-err { color: var(--rd); }
.login__msg.is-warn { color: var(--am); }
.login__msg.is-info { color: var(--cy); }
.login__log { list-style: none; margin: 6px 0 0; padding: 0; text-align: left; font-size: 12px; color: var(--tx-2); min-height: 1em; }
.login__log li { padding-left: 18px; position: relative; animation: fadein .25s ease both; }
.login__log li::before { content: "›"; position: absolute; left: 4px; color: var(--cy-2); }
.login__log li.is-ok { color: var(--cy); }
.login__foot { margin-top: 26px; font-size: 11px; color: var(--tx-3); letter-spacing: .08em; text-align: center; }
.login__foot .tag { margin-top: 10px; }
@keyframes fadein { from { opacity: 0; } }

/* ---------------------------------------------------------------------
   COQUILLE
   --------------------------------------------------------------------- */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.hdr {
  position: sticky; top: 0; z-index: 40;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 24px;
  padding: 12px var(--gutter);
  background: rgba(5, 8, 13, .92);
  border-bottom: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.hdr__brand { display: flex; align-items: center; gap: 14px; color: inherit; min-width: 0; }
.hdr__brand:hover { color: inherit; }
.hdr__titles { display: flex; flex-direction: column; min-width: 0; }
.hdr__name { font-size: 13px; font-weight: 500; letter-spacing: .12em; color: #dbe3e9; line-height: 1.35; }
.hdr__sub { font-size: 10.5px; color: var(--tx-3); letter-spacing: .1em; }
.hdr__status { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 11px; letter-spacing: .1em; justify-self: end; text-align: right; }
.hdr__agent .k { color: var(--tx-3); }
.hdr__agent b { color: #e3eaef; font-weight: 500; }
.hdr__ind { color: var(--tx-2); }
.hdr__clock { color: var(--tx-2); display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.hdr__clock .dot { width: 6px; height: 6px; background: var(--cy); box-shadow: 0 0 8px var(--cy); animation: pulse 2s ease-in-out infinite; }
.hdr__actions { display: flex; gap: 8px; }

.snd { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.snd i { width: 2px; background: currentColor; height: 3px; opacity: .6; }
.snd.is-on i:nth-child(1) { height: 5px; }
.snd.is-on i:nth-child(2) { height: 11px; }
.snd.is-on i:nth-child(3) { height: 7px; }
.snd.is-on i { opacity: 1; }

.nav {
  display: flex; gap: 0; overflow-x: auto; scrollbar-width: none;
  padding: 0 var(--gutter); border-bottom: 1px solid var(--line);
  background: rgba(7, 12, 19, .7);
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none; padding: 12px 16px 11px; font-size: 11px; letter-spacing: .18em; color: var(--tx-2);
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--tx); }
.nav a.is-active { color: var(--cy); border-bottom-color: var(--cy); }

.mjbar {
  padding: 8px var(--gutter); font-size: 11px; letter-spacing: .12em; color: var(--am);
  background: var(--am-bg); border-bottom: 1px solid rgba(208, 162, 90, .3);
}

.main {
  flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: 28px var(--gutter) 120px; outline: none;
  animation: fadein .35s ease both;
}

.ftr {
  border-top: 1px solid var(--line); padding: 18px var(--gutter) 22px; text-align: center;
  font-size: 11px; letter-spacing: .08em; color: var(--tx-3);
}
.ftr__main { color: var(--tx-2); }
.ftr__legal { margin-top: 6px; max-width: 760px; margin-left: auto; margin-right: auto; line-height: 1.6; }

.crumbs { font-size: 11px; letter-spacing: .14em; color: var(--tx-3); margin-bottom: 22px; display: flex; flex-wrap: wrap; gap: 4px 0; }
.crumbs a { color: var(--tx-2); }
.crumbs a:hover { color: var(--cy); }
.crumbs__sep { margin: 0 10px; color: var(--line-3); }
.crumbs [aria-current] { color: var(--cy); }

.h-sec {
  display: flex; align-items: center; gap: 14px; margin: 40px 0 16px;
  font-size: 11px; letter-spacing: .24em; color: var(--tx-2); font-weight: 500;
}
.h-sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.toasts {
  position: fixed; z-index: 100; right: 16px; bottom: 16px; left: auto;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none;
  max-width: calc(100vw - 32px);
}
.toast {
  font-size: 11.5px; letter-spacing: .1em; padding: 10px 14px; background: rgba(10, 17, 25, .96);
  border: 1px solid var(--line-3); border-left: 3px solid var(--cy); color: var(--tx);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5); animation: toastin .25s var(--ease) both;
  transition: opacity .5s, transform .5s;
}
.toast--err { border-left-color: var(--rd); }
.toast--warn { border-left-color: var(--am); }
.toast.is-out { opacity: 0; transform: translateY(6px); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------------
   ACCUEIL
   --------------------------------------------------------------------- */
.home__agent {
  display: grid; grid-template-columns: 112px 1fr; gap: 24px; align-items: center;
  padding: 22px; border: 1px solid var(--line-2); background: linear-gradient(90deg, var(--panel-2), transparent);
}
.home__photo .photo { width: 112px; }
.sysline { font-size: 11.5px; color: var(--cy); letter-spacing: .06em; margin-bottom: 8px; }
.sysline::before { content: "› "; color: var(--cy-2); }
.home__name { font-size: clamp(18px, 3.4vw, 24px); letter-spacing: .1em; color: #e3eaef; margin-bottom: 12px; }

.kv { margin: 0; display: grid; gap: 0; }
.kv > div { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv dt { font-size: 10.5px; letter-spacing: .16em; color: var(--tx-3); padding-top: 2px; text-transform: uppercase; }
.kv dd { margin: 0; color: var(--tx); overflow-wrap: anywhere; }
.kv--inline { display: flex; flex-wrap: wrap; gap: 8px 34px; }
.kv--inline > div { display: block; border: 0; padding: 0; }
.kv--inline dt { margin-bottom: 2px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 196px;
  padding: 18px 18px 16px; color: var(--tx); border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  transition: border-color .2s, background .2s, transform .2s var(--ease);
}
.tile:hover { color: var(--tx); border-color: var(--cy-2); background: linear-gradient(180deg, var(--panel-2), var(--bg-2)); transform: translateY(-2px); }
.tile::before { content: ""; position: absolute; top: -1px; left: -1px; width: 22px; height: 2px; background: var(--cy); }
.tile__code { font-size: 10.5px; color: var(--tx-3); letter-spacing: .2em; }
.tile__name { font-size: 16px; letter-spacing: .16em; color: #e1e8ed; font-weight: 500; }
.tile__desc { font-size: 12px; color: var(--tx-2); line-height: 1.55; flex: 1; }
.tile__count { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.tile__count b { font-size: 30px; font-weight: 300; color: var(--cy); letter-spacing: .04em; line-height: 1; font-variant-numeric: tabular-nums; }
.tile__count span { font-size: 10.5px; letter-spacing: .14em; color: var(--tx-2); text-transform: uppercase; }
.tile__out { font-size: 10.5px; color: var(--rd); letter-spacing: .12em; text-transform: uppercase; }
.tile__out--none { color: var(--tx-3); }
.tile__arrow { position: absolute; right: 16px; bottom: 14px; color: var(--tx-3); transition: transform .2s, color .2s; }
.tile:hover .tile__arrow { color: var(--cy); transform: translateX(3px); }

.reg { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.reg li { border-bottom: 1px solid var(--line); }
.reg a { display: grid; grid-template-columns: 120px 1fr auto; gap: 16px; padding: 10px 4px; color: var(--tx); align-items: baseline; }
.reg a:hover { background: var(--cy-bg); color: var(--tx); }
.reg__kind { font-size: 10.5px; color: var(--tx-3); letter-spacing: .16em; }
.reg__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reg__date { font-size: 11px; color: var(--tx-2); }
.reg__empty { padding: 14px 4px; color: var(--tx-3); font-size: 12px; }

/* ---------------------------------------------------------------------
   LISTES
   --------------------------------------------------------------------- */
.list__head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap;
  padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line-2);
}
.list__code { font-size: 10.5px; letter-spacing: .2em; color: var(--tx-3); }
.list__title { font-size: clamp(20px, 4vw, 28px); letter-spacing: .16em; color: #e3eaef; margin: 2px 0 6px; }
.list__desc { color: var(--tx-2); font-size: 12.5px; }
.list__count { font-size: 12px; color: var(--tx-2); text-align: right; font-variant-numeric: tabular-nums; }
.list__count b { font-size: 26px; font-weight: 300; color: var(--cy); }
.list__count span { display: block; font-size: 10px; letter-spacing: .18em; color: var(--tx-3); text-transform: uppercase; }
.empty { color: var(--tx-3); padding: 24px 0; font-size: 12px; letter-spacing: .1em; }

.rows { display: flex; flex-direction: column; gap: 6px; }
.row {
  font: inherit; text-align: left; width: 100%;
  display: grid; grid-template-columns: 120px 1fr auto; gap: 18px; align-items: center;
  padding: 13px 16px; color: var(--tx); background: var(--panel); border: 1px solid var(--line);
  border-left: 2px solid var(--cy-2); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.row:hover { background: var(--panel-2); border-color: var(--line-3); border-left-color: var(--cy); color: var(--tx); }
.row__ref { font-size: 11.5px; letter-spacing: .1em; color: var(--cy); font-weight: 500; overflow-wrap: anywhere; }
.row__main { display: flex; flex-direction: column; min-width: 0; }
.row__title { color: #dde5ea; overflow: hidden; text-overflow: ellipsis; }
.row__meta { font-size: 11px; color: var(--tx-3); letter-spacing: .06em; }
.row__tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.row.is-locked, .card.is-locked {
  border-left-color: var(--rd);
  background: repeating-linear-gradient(-45deg, rgba(189, 90, 82, .035) 0 8px, transparent 8px 16px), var(--bg-2);
}
.row.is-locked .row__ref { color: #2a333d; letter-spacing: -.05em; }
.row.is-locked .row__title { color: var(--rd); font-size: 12px; letter-spacing: .14em; }
.row.is-locked.is-shake, .card.is-locked.is-shake { animation: shake .42s both; }
.row.is-erased { border-left-color: var(--tx-3); opacity: .65; }
.row.is-erased .row__ref { color: var(--tx-3); text-decoration: line-through; }
.row.is-erased .row__title { color: var(--tx-3); letter-spacing: .16em; font-size: 12px; }
.row.is-archived { border-left-color: var(--tx-3); filter: grayscale(1); opacity: .78; }
.row.is-archived:hover { opacity: 1; }

.agroup + .agroup { margin-top: 28px; }
.agroup__h { display: flex; align-items: center; gap: 14px; font-size: 11px; letter-spacing: .2em; color: var(--tx-2); margin-bottom: 10px; }
.agroup__h i { flex: 1; height: 1px; background: var(--line); }
.agroup__n { color: var(--tx-3); }
.arow { display: grid; grid-template-columns: 104px 1fr; gap: 10px; align-items: center; }
.arow__kind { font-size: 10px; letter-spacing: .18em; color: var(--tx-3); text-align: right; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card {
  font: inherit; text-align: left; color: var(--tx); cursor: pointer; padding: 0;
  display: flex; flex-direction: column; border: 1px solid var(--line-2); background: var(--panel);
  transition: border-color .2s, transform .2s var(--ease);
}
.card:hover { border-color: var(--cy-2); color: var(--tx); transform: translateY(-2px); }
.card__photo { aspect-ratio: 4 / 3; border-bottom: 1px solid var(--line); overflow: hidden; }
.card__photo .photo { width: 100%; height: 100%; aspect-ratio: auto; border: 0; }
.card__photo--doc { display: grid; place-items: center; background: repeating-linear-gradient(0deg, transparent 0 23px, rgba(127, 179, 191, .05) 23px 24px), var(--bg-2); color: var(--cy); }
.card__photo--locked { display: grid; place-items: center; color: var(--rd); font-size: 12px; letter-spacing: .3em; background: #06090e; }
.card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.card__ref { font-size: 10.5px; letter-spacing: .14em; color: var(--tx-3); }
.card__title { font-size: 14px; color: #e1e8ed; letter-spacing: .06em; line-height: 1.4; }
.card.is-locked .card__title { color: var(--rd); font-size: 11.5px; letter-spacing: .12em; }
.card.is-locked .card__ref { color: #2a333d; }
.card__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

/* ---------------------------------------------------------------------
   PHOTO D'IDENTIFICATION
   --------------------------------------------------------------------- */
.photo {
  position: relative; margin: 0; overflow: hidden; aspect-ratio: 3 / 4; width: 100%;
  background:
    linear-gradient(rgba(127, 179, 191, .045) 1px, transparent 1px) 0 0 / 100% 16px,
    linear-gradient(90deg, rgba(127, 179, 191, .045) 1px, transparent 1px) 0 0 / 16px 100%,
    radial-gradient(ellipse at 50% 40%, #0f1b26, #060a10 75%);
  border: 1px solid var(--line-2);
  isolation: isolate;
}
.photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%;
  filter: grayscale(.55) contrast(1.06) brightness(.86) sepia(.15) hue-rotate(160deg) saturate(.9);
  opacity: 0; transition: opacity .6s ease;
}
.photo img.is-loaded { opacity: 1; }
.photo__tint { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(40, 90, 120, .18), rgba(5, 8, 13, .35)); mix-blend-mode: multiply; }
.photo__scan {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px);
}
.photo__scan::after {
  content: ""; position: absolute; left: 0; right: 0; height: 30%; top: -30%;
  background: linear-gradient(180deg, transparent, rgba(127, 179, 191, .06), transparent);
  animation: sweep 6s linear infinite;
}
@keyframes sweep { to { top: 100%; } }
.photo__c { position: absolute; width: 14px; height: 14px; border: 1.5px solid var(--cy); opacity: .8; z-index: 2; }
.photo__c--1 { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.photo__c--2 { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.photo__c--3 { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.photo__c--4 { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.photo--sm .photo__c { width: 9px; height: 9px; }
.photo--sm .photo__c--1, .photo--sm .photo__c--2 { top: 5px; }
.photo--sm .photo__c--3, .photo--sm .photo__c--4 { bottom: 5px; }
.photo--sm .photo__c--1, .photo--sm .photo__c--3 { left: 5px; }
.photo--sm .photo__c--2, .photo--sm .photo__c--4 { right: 5px; }
.photo__stamp {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 18px 12px 9px; font-size: 10px; letter-spacing: .12em; color: rgba(210, 225, 232, .85);
  background: linear-gradient(transparent, rgba(3, 6, 10, .8));
  font-variant-numeric: tabular-nums;
}
.photo__stamp::before { content: "● "; color: var(--rd); }
.sil { position: absolute; left: 12%; right: 12%; bottom: 0; width: 76%; height: 82%; color: rgba(127, 179, 191, .13); }
.photo__msg {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 2;
  padding: 6px 10px; font-size: 10.5px; line-height: 1.5; letter-spacing: .2em; text-align: center; white-space: nowrap;
  color: var(--tx-2); background: rgba(5, 8, 13, .82); border: 1px solid var(--line-3);
}
.photo__msg--red { color: var(--rd); border-color: rgba(189, 90, 82, .5); }
.photo--sm .photo__msg { font-size: 8.5px; letter-spacing: .14em; padding: 3px 6px; }
.photo--retire .sil { color: rgba(189, 90, 82, .08); }
.photo--retire { background: repeating-linear-gradient(-45deg, rgba(189, 90, 82, .05) 0 10px, transparent 10px 20px), #070a0f; }

/* ---------------------------------------------------------------------
   DOCUMENTS
   --------------------------------------------------------------------- */
.doc { max-width: 900px; }
.doc__head { padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--line-2); }
.doc__kicker { font-size: 11px; letter-spacing: .22em; color: var(--tx-3); margin-bottom: 6px; }
.doc__title { font-size: clamp(22px, 5vw, 34px); letter-spacing: .12em; color: #e6edf2; line-height: 1.25; overflow-wrap: anywhere; }
.doc__subtitle { color: var(--tx-2); margin-top: 6px; }
.doc__tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

.doc.is-archived { filter: grayscale(.85); }
.doc.is-archived .doc__title { color: #b9c1c8; }
.doc.is-archived .doc__head { border-bottom-style: dashed; }

.meta {
  margin: 0 0 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line-2); background: var(--panel);
}
.meta__row { padding: 10px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.meta__row--wide { grid-column: 1 / -1; display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: baseline; border-right: 0; }
.meta__row:last-child { border-bottom: 0; }
.meta dt { font-size: 10px; letter-spacing: .18em; color: var(--tx-3); }
.meta dd { margin: 2px 0 0; color: #dbe3e9; overflow-wrap: anywhere; }
.meta__row--wide dd { margin: 0; }
.dest { display: inline-block; padding: 0 8px; margin: 2px 4px 2px 0; border: 1px solid var(--line-3); font-size: 12px; letter-spacing: .08em; }

.notice { padding: 12px 16px; font-size: 12.5px; border: 1px solid; margin-bottom: 18px; letter-spacing: .02em; }
.notice--warn { color: var(--am); border-color: rgba(208, 162, 90, .4); background: var(--am-bg); }

/* Déchiffrement */
.decrypt { border: 1px solid var(--line-2); background: #04070b; padding: 16px 18px; margin-bottom: 22px; }
.decrypt.is-done { padding: 10px 16px; border-color: var(--line); background: transparent; }
.decrypt__head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 11px; letter-spacing: .18em; color: var(--cy); }
.decrypt__label { display: inline-flex; align-items: center; gap: 10px; }
.decrypt__label--ok::before { content: "■"; color: var(--ok); font-size: 9px; }
.decrypt__pct { color: var(--tx-2); font-variant-numeric: tabular-nums; }
.decrypt__scr { margin: 14px 0 12px; font-size: clamp(13px, 2.6vw, 17px); letter-spacing: .14em; color: #e1ebf0; min-height: 1.6em; overflow-wrap: anywhere; }
.bar { height: 3px; background: var(--line); position: relative; overflow: hidden; }
.bar__fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--cy); box-shadow: 0 0 10px var(--cy); }
.decrypt__log { list-style: none; margin: 12px 0 0; padding: 0; font-size: 11.5px; color: var(--tx-2); }
.decrypt__log li { animation: fadein .2s ease both; }
.decrypt__log li::before { content: "› "; color: var(--cy-2); }
.spin { width: 9px; height: 9px; border: 1.5px solid var(--cy); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Lecture vocale */
.voice {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  padding: 12px 14px; margin-bottom: 22px; border: 1px solid var(--line-2); background: var(--panel);
  animation: fadein .4s ease both;
}
.btn--voice { min-height: 40px; }
.voice__icon { font-size: 10px; width: 12px; text-align: center; }
.voice__time { font-size: 11px; color: var(--tx-2); font-variant-numeric: tabular-nums; }
.wave { display: flex; align-items: center; gap: 2px; height: 32px; min-width: 0; overflow: hidden; }
.wave i { flex: 1; min-width: 2px; max-width: 5px; height: 100%; background: var(--cy-2); opacity: .45; transform: scaleY(var(--h)); transition: transform .09s linear; }
.wave i.is-past { background: var(--cy); opacity: .9; }
.wave.is-playing i { opacity: .85; }
#audio-slot.is-gone { opacity: 0; transition: opacity .5s; }

/* Corps du texte */
.body, .rt { font-size: 14.5px; line-height: 1.8; color: var(--tx); }
.rp { margin: 0 0 1.05em; position: relative; overflow-wrap: break-word; }
.rp:last-child { margin-bottom: 0; }
.rp.beat { margin: 1.5em 0; font-weight: 500; letter-spacing: .06em; color: #e3eaef; }
.box .rp.beat { margin: .6em 0; }
.rp.addr {
  background: linear-gradient(90deg, rgba(127, 179, 191, .09), rgba(127, 179, 191, .02));
  box-shadow: inset 2px 0 0 var(--cy);
  padding: 8px 12px 8px 14px; margin-left: -14px; margin-right: -12px;
}
.rp.addr::before {
  content: "◆ ADRESSÉ"; display: block; font-size: 9.5px; letter-spacing: .22em; color: var(--cy); margin-bottom: 2px; font-weight: 500;
}
.rp.tw-wait { visibility: hidden; }
.box.tw-wait { opacity: 0; }
.box { transition: opacity .3s ease; }
.rp.tw-on::after {
  content: ""; display: inline-block; width: .55em; height: 1.05em; margin-left: 2px; vertical-align: -.15em;
  background: var(--cy); animation: blink .9s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.box {
  position: relative; margin: 1.6em 0; padding: 22px 18px 16px;
  border: 1px solid; border-left-width: 3px;
}
.box__label {
  position: absolute; top: -9px; left: 12px; padding: 0 8px; background: var(--bg);
  font-size: 10.5px; letter-spacing: .26em; font-weight: 700; line-height: 18px;
}
.box--ok { border-color: rgba(127, 179, 191, .35); border-left-color: var(--cy); background: var(--cy-bg); }
.box--ok .box__label { color: var(--cy); }
.box--no { border-color: rgba(189, 90, 82, .35); border-left-color: var(--rd); background: var(--rd-bg); }
.box--no .box__label { color: var(--rd); }
.box--warn { border-color: rgba(208, 162, 90, .35); border-left-color: var(--am); background: var(--am-bg); }
.box--warn .box__label { color: var(--am); }

/* Caviardage */
.rd {
  color: #010203; background: #010203; letter-spacing: -.08em; word-break: break-all;
  box-shadow: 0 0 0 1px #2a3946; user-select: none; -webkit-user-select: none;
}
.rv { background: rgba(189, 90, 82, .08); border-bottom: 1px dotted var(--rd); padding: 0 2px; }
.rv-3 { background: rgba(127, 179, 191, .07); border-bottom-color: var(--cy); }
.rv-4 { background: rgba(208, 162, 90, .07); border-bottom-color: var(--am); }
.rv-1, .rv-2 { background: transparent; border-bottom-color: var(--tx-3); }

/* Fin / effacement */
.endnote {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 28px; padding: 14px 16px; border: 1px solid var(--line-2); font-size: 12px; letter-spacing: .1em; color: var(--tx-2);
  animation: fadein .4s ease both;
}
.endnote--warn { color: var(--am); border-color: rgba(208, 162, 90, .4); background: var(--am-bg); line-height: 1.7; }
.endnote b { color: inherit; }

.rp.is-decay, .box.is-decay { animation: decay 1s cubic-bezier(.5, 0, .9, .4) forwards; }
@keyframes decay {
  0% { clip-path: inset(0 0 0 0); filter: none; opacity: 1; }
  30% { filter: blur(.4px) brightness(1.4); color: var(--rd); }
  100% { clip-path: inset(0 0 100% 0); filter: blur(3px); opacity: 0; transform: translateY(-4px); }
}
.box.is-decay { animation-duration: 1.2s; }
.body.is-fading { opacity: 0; transition: opacity .5s; }

.erased {
  margin-top: 10px; padding: 46px 20px; text-align: center; border: 1px solid rgba(189, 90, 82, .35);
  background: repeating-linear-gradient(-45deg, rgba(189, 90, 82, .03) 0 10px, transparent 10px 20px);
  color: var(--tx-2); font-size: 12.5px; animation: fadein .6s ease both;
}
.erased__stamp {
  display: inline-block; font-size: clamp(16px, 4.4vw, 24px); font-weight: 700; letter-spacing: .3em;
  color: var(--rd); border: 3px double var(--rd); padding: 8px 18px; margin-bottom: 18px; transform: rotate(-2deg);
}
.erased__sub { color: var(--tx-3); margin: 6px 0 22px; font-size: 11px; letter-spacing: .1em; }

/* Barre de lecture */
.twbar {
  position: fixed; z-index: 50; left: 50%; bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; gap: 6px; padding: 6px; background: rgba(7, 12, 19, .94);
  border: 1px solid var(--line-3); box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
  max-width: calc(100vw - 24px);
}
.twbar[hidden] { display: none; }

/* Fiches */
.fiche { display: grid; grid-template-columns: 240px 1fr; gap: 26px; margin-bottom: 8px; align-items: start; }
.fiche--nophoto { grid-template-columns: 1fr; }
.fiche__id .kv > div:first-child { border-top: 1px solid var(--line); }

.threat { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .12em; }
.threat__bar { display: inline-flex; gap: 2px; }
.threat__bar i { width: 12px; height: 8px; background: var(--line-2); }
.threat--1 .on, .threat--2 .on { background: var(--cy); }
.threat--3 .on { background: var(--am); }
.threat--4 .on, .threat--5 .on { background: var(--rd); }
.threat--3 { color: var(--am); }
.threat--4, .threat--5 { color: var(--rd); }

.sec { margin-top: 30px; }
.sec__h {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
  font-size: 12px; letter-spacing: .22em; color: var(--cy); font-weight: 500;
}
.sec__h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sec__n { color: var(--tx-3); font-variant-numeric: tabular-nums; }
.sec--brf .sec__h { font-size: 13px; color: #dbe3e9; }
.sec--brf .sec__n { color: var(--cy); }
.sec--brf .rt { padding-left: 26px; border-left: 1px solid var(--line); }

.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.member { display: grid; grid-template-columns: 84px 1fr; gap: 14px; padding: 12px; border: 1px solid var(--line-2); background: var(--panel); }
.member__body { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.member__name { color: #e1e8ed; letter-spacing: .06em; }
.rt--sm { font-size: 12.5px; color: var(--tx-2); }

.sign { margin-top: 44px; padding-top: 20px; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.sign__line { width: 220px; max-width: 60%; height: 1px; background: var(--line-3); margin-bottom: 10px; }
.sign__text { font-style: italic; color: #d5dde4; letter-spacing: .04em; }
.sign__sub { font-size: 10.5px; color: var(--tx-3); letter-spacing: .14em; margin-top: 2px; }

/* Refus */
.refused__box {
  max-width: 640px; padding: 34px clamp(18px, 4vw, 34px); border: 1px solid rgba(189, 90, 82, .4);
  border-left: 3px solid var(--rd);
  background: repeating-linear-gradient(-45deg, rgba(189, 90, 82, .035) 0 10px, transparent 10px 20px), var(--bg-2);
}
.refused__box--warn { border-color: rgba(208, 162, 90, .4); border-left-color: var(--am); }
.refused__code { font-size: 11px; letter-spacing: .3em; color: var(--rd); margin-bottom: 10px; }
.refused__box--warn .refused__code { color: var(--am); }
.refused__box h1 { font-size: clamp(16px, 3.6vw, 21px); letter-spacing: .12em; line-height: 1.5; color: #e3eaef; margin-bottom: 14px; }
.refused__box p { color: var(--tx-2); margin-bottom: 10px; }
.refused__note { font-size: 11px; color: var(--tx-3) !important; letter-spacing: .1em; margin-bottom: 22px !important; }

/* ---------------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------------- */
@media (max-width: 900px) {
  .hdr { grid-template-columns: 1fr auto; }
  .hdr__status { grid-column: 1 / -1; grid-row: 2; flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 14px; justify-self: stretch; text-align: left; border-top: 1px solid var(--line); padding-top: 8px; }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  body { font-size: 13.5px; }
  .hdr { padding-top: 10px; padding-bottom: 8px; gap: 8px 12px; }
  .hdr__sub { display: none; }
  .hdr__name { font-size: 11px; letter-spacing: .08em; }
  .insignia--hdr { width: 30px; height: 30px; }
  .hdr__brand { gap: 10px; }
  .hdr__actions .btn { padding: 6px 9px; letter-spacing: .08em; }
  .hdr__actions #btn-logout { font-size: 0; gap: 0; }
  .hdr__actions #btn-logout::before { content: "QUITTER"; font-size: 10.5px; }
  .hdr__status { font-size: 10px; }
  .nav a { padding: 11px 12px 10px; font-size: 10.5px; letter-spacing: .14em; }
  .main { padding-top: 20px; }

  .home__agent { grid-template-columns: 76px 1fr; gap: 16px; padding: 14px; }
  .home__photo .photo { width: 76px; }
  .kv--inline { gap: 8px 20px; }

  .row { grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px; }
  .row__ref { grid-column: 1; }
  .row__main { grid-column: 1 / -1; grid-row: 2; }
  .row__tags { grid-column: 2; grid-row: 1; }
  .row .tag { display: none; }
  .row .tag--dim, .row .tag--red { display: inline-flex; }
  .arow { grid-template-columns: 1fr; gap: 4px; }
  .arow__kind { text-align: left; }

  .reg a { grid-template-columns: 1fr; gap: 0; }
  .reg__date { order: 3; }

  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); font-size: 12.5px; }
  .meta__row { padding: 8px 12px; }
  .meta__row:nth-child(2n) { border-right: 0; }
  .nav { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
  .meta__row--wide { grid-template-columns: 1fr; gap: 2px; }

  .fiche { grid-template-columns: 1fr; gap: 18px; }
  .fiche__photo { max-width: 260px; }
  .kv > div { grid-template-columns: 1fr; gap: 2px; }

  .body, .rt { font-size: 14px; }
  .rp.addr { margin-left: -10px; margin-right: -10px; padding-left: 10px; padding-right: 10px; }
  .box { padding: 20px 12px 12px; }
  .sec--brf .rt { padding-left: 14px; }

  .voice { grid-template-columns: 1fr auto; }
  .voice .btn--voice { grid-column: 1 / -1; white-space: normal; }
  .twbar { left: 12px; right: 12px; transform: none; max-width: none; }
  .twbar .btn { flex: 1; padding: 6px 4px; font-size: 10px; letter-spacing: .06em; }
  .toasts { left: 16px; right: 16px; align-items: stretch; bottom: 70px; }
  .login__field input { font-size: 16px; letter-spacing: .2em; }
  .login__field .btn { padding: 8px 12px; font-size: 11px; }
}

@media (max-width: 380px) {
  .login__field { flex-wrap: wrap; }
  .login__field input { flex-basis: calc(100% - 40px); }
  .login__field .btn { flex-basis: 100%; border-left: 0; border-top: 1px solid var(--line-3); }
}

/* ---------------------------------------------------------------------
   MOUVEMENT RÉDUIT
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .photo__scan::after { display: none; }
  .fx__flicker { display: none; }
  .rp.tw-on::after { display: none; }
}

/* ---------------------------------------------------------------------
   AJOUTS : copie du registre, listes, membres sans photo, classification
   --------------------------------------------------------------------- */
.notice--copy { color: var(--cy); border-color: rgba(127, 179, 191, .35); background: var(--cy-bg); }
.erased__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.doc__class { font-size: 11px; letter-spacing: .14em; color: var(--am); margin: -2px 0 8px; }
.rl { list-style: none; padding: 0; }
.rl li { position: relative; padding-left: 22px; margin-bottom: .55em; }
.rl li:last-child { margin-bottom: 0; }
.rl li::before { content: "▪"; position: absolute; left: 4px; color: var(--cy-2); }
.member--nophoto { grid-template-columns: 1fr; border-left: 2px solid var(--am); }
.rt .rp.beat { margin: 0 0 1.05em; font-weight: 400; letter-spacing: inherit; color: inherit; }

/* ---------------------------------------------------------------------
   REGISTRE CENTRAL — RAPPORTS
   --------------------------------------------------------------------- */
.hdr__net { margin-left: 6px; padding-left: 10px; border-left: 1px solid var(--line-2); color: var(--tx-3); }
.hdr__net.is-up { color: var(--ok); }
.hdr__net.is-down { color: var(--tx-3); }
.tag--new { color: #0b1118; background: var(--am); border-color: var(--am); font-weight: 700; }
.tag--cy { color: var(--cy); border-color: var(--cy-2); }
.tag--ok { color: var(--ok); border-color: rgba(134, 179, 155, .5); }
.tile__out--new { color: var(--am); }
.tile--rap::before { background: var(--am); }
.row.is-new { border-left-color: var(--am); }
.row.is-new .row__title { color: #fff; font-weight: 500; }
.loading { display: flex; align-items: center; gap: 12px; color: var(--tx-2); font-size: 12px; letter-spacing: .12em; padding: 24px 0; }
.linkbtn { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; }
.filter {
  font: inherit; font-size: 11px; letter-spacing: .14em; padding: 7px 12px; cursor: pointer;
  color: var(--tx-2); background: transparent; border: 1px solid var(--line-2);
}
.filter:hover { color: var(--tx); border-color: var(--line-3); }
.filter.is-active { color: var(--cy); border-color: var(--cy-2); background: var(--cy-bg); }

.form { margin-top: 6px; }
.form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field--wide { grid-column: 1 / -1; }
.field__label { font-size: 10.5px; letter-spacing: .2em; color: var(--tx-2); padding: 0; }
.field__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 13.5px; color: #e3eaef; background: rgba(0, 0, 0, .35);
  border: 1px solid var(--line-3); border-radius: 0; padding: 10px 12px; width: 100%;
}
.field textarea { resize: vertical; line-height: 1.7; min-height: 120px; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--cy) 50%), linear-gradient(135deg, var(--cy) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.field select option, .field select optgroup { background: #0a1119; color: var(--tx); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--cy-2); box-shadow: 0 0 0 3px rgba(127, 179, 191, .06); }
.hint { font-size: 11px; color: var(--tx-3); line-height: 1.6; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line-2); cursor: pointer; font-size: 12px; }
.check:has(input:checked) { border-color: var(--cy-2); background: var(--cy-bg); color: var(--cy); }
.check input { accent-color: var(--cy); margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line-2); }
.seg__b { font: inherit; font-size: 10.5px; letter-spacing: .14em; padding: 5px 10px; background: transparent; color: var(--tx-3); border: 0; cursor: pointer; }
.seg__b.is-active { color: var(--cy); background: var(--cy-bg); }
.preview { border: 1px dashed var(--line-3); padding: 14px 16px; min-height: 120px; }
.form__msg { min-height: 1.6em; margin-top: 12px; color: var(--rd); font-size: 12px; letter-spacing: .06em; }
.form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.form__draft { font-size: 11px; color: var(--tx-3); }
.form--reply { margin-top: 18px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -6px 0 22px; }
.actions__statut { display: inline-flex; align-items: center; gap: 8px; font-size: 10.5px; letter-spacing: .16em; color: var(--tx-3); }
.actions__statut select { font: inherit; font-size: 11px; letter-spacing: .1em; color: var(--tx); background: var(--panel); border: 1px solid var(--line-3); padding: 7px 10px; }

.replies { display: flex; flex-direction: column; gap: 10px; }
.reply { border: 1px solid var(--line-2); border-left: 2px solid var(--cy-2); background: var(--panel); padding: 12px 16px; }
.reply--dir { border-left-color: var(--rd); }
.reply__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 6px; font-size: 12px; }
.reply__head b { color: #e3eaef; letter-spacing: .06em; }
.reply__head > span:last-child { color: var(--tx-3); font-size: 11px; margin-left: auto; }
.reply .rt { font-size: 13.5px; }

.linked { margin-top: 40px; }
.linked .rows { margin-bottom: 14px; }
.linked .empty { padding: 4px 0 14px; }

@media (max-width: 640px) {
  .form__grid { grid-template-columns: 1fr; }
  .row .tag--new { display: inline-flex; }
  .hdr__net { display: none; }
  .toolbar .btn { width: 100%; }
  .reply__head > span:last-child { margin-left: 0; width: 100%; }
}
.field .check input { width: auto; padding: 0; border: 0; background: none; box-shadow: none; flex: none; }
.check span { white-space: nowrap; }

/* ---------------------------------------------------------------------
   ÉDITION DES DOSSIERS + BARRE DE MISE EN FORME
   --------------------------------------------------------------------- */
.doc__edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; }
.doc__edit:empty { display: none; }
.doc__mod { font-size: 11px; color: var(--tx-3); letter-spacing: .04em; }

.tb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 5px; border: 1px solid var(--line-3); border-bottom: 0; background: var(--panel-2); }
.tb + textarea { border-top-color: var(--line-2); }
.tb button { font: inherit; font-size: 10.5px; letter-spacing: .1em; color: var(--tx-2); background: transparent; border: 1px solid transparent; padding: 4px 8px; cursor: pointer; min-height: 28px; }
.tb button:hover { color: var(--tx); border-color: var(--line-3); }
.tb__sep { width: 1px; align-self: stretch; background: var(--line-2); margin: 0 4px; }
.tb__cav { display: inline-flex; align-items: stretch; border: 1px solid var(--line-3); }
.tb__cav select { font: inherit; font-size: 10.5px; color: var(--tx); background: #05080d; border: 0; padding: 0 6px; }
.tb .tb__cavbtn { color: #e3eaef; background: #010203; border: 0; border-left: 1px solid var(--line-3); }
.tb .tb__cavbtn:hover { background: #10161d; }
.tb .tb__am { color: var(--am); }
.tb .tb__cy { color: var(--cy); }
.tb .tb__rd { color: var(--rd); }
.ed-rows + .btn, #ed-secs + .btn, #ed-mems + .btn { align-self: flex-start; margin-top: 8px; }
.field > .tb { border-bottom: 1px solid var(--line-3); }
.field > .tb + .ed-rows { margin-top: 8px; }

.ed-visual { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: start; }
.ed-visual__ctl { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.ed-upload { position: relative; cursor: pointer; }
.ed-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

.ed-rows { display: flex; flex-direction: column; gap: 6px; }
.ed-row { display: grid; grid-template-columns: minmax(120px, 30%) 1fr auto; gap: 6px; align-items: center; }
.ed-row.is-locked { padding: 8px 10px; border: 1px dashed var(--line-3); grid-template-columns: minmax(120px, 30%) 1fr auto; }
.ed-row.is-locked .ed-k { font-size: 11px; letter-spacing: .12em; color: var(--tx-3); }
.ed-x { font: inherit; width: 34px; height: 34px; color: var(--tx-3); background: transparent; border: 1px solid var(--line-2); cursor: pointer; }
.ed-x:hover { color: var(--rd); border-color: var(--rd); }
.ed-lock { font-size: 9.5px; letter-spacing: .16em; color: var(--rd); white-space: nowrap; }
.ed-locked { border: 1px dashed rgba(189, 90, 82, .4); padding: 10px 12px; background: repeating-linear-gradient(-45deg, rgba(189, 90, 82, .03) 0 8px, transparent 8px 16px); }
.ed-locked__v { margin-top: 6px; font-size: 13px; }

#ed-secs { display: flex; flex-direction: column; gap: 10px; }
.ed-sec { border: 1px solid var(--line-2); background: var(--panel); padding: 10px; display: flex; flex-direction: column; }
.ed-sec.is-locked { border-style: dashed; border-color: rgba(189, 90, 82, .4); }
.ed-sec__head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.ed-sec__head .ed-st { flex: 1; }
.ed-sec__head b { flex: 1; letter-spacing: .08em; }
.ed-btns { display: inline-flex; gap: 4px; }
.ed-btns button:not(.ed-x) { font: inherit; width: 34px; height: 34px; color: var(--tx-2); background: transparent; border: 1px solid var(--line-2); cursor: pointer; }
.ed-btns button:not(.ed-x):hover { color: var(--cy); border-color: var(--cy-2); }
.ed-mem { border: 1px solid var(--line-2); padding: 8px; margin-bottom: 6px; display: flex; flex-direction: column; gap: 6px; }
.ed-mem__row { display: grid; grid-template-columns: 1fr 180px auto; gap: 6px; }

.hist { list-style: none; padding: 0; margin: 0 0 14px; font-size: 12.5px; }
.hist li { padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--tx-2); }
.hist li.is-cur { color: var(--tx); }

@media (max-width: 640px) {
  .ed-visual { grid-template-columns: 120px 1fr; gap: 12px; }
  .ed-row { grid-template-columns: 1fr auto; }
  .ed-row .ed-k { grid-column: 1 / -1; }
  .ed-row.is-locked { grid-template-columns: 1fr; }
  .ed-mem__row { grid-template-columns: 1fr auto; }
  .ed-mem__row .ed-ms { grid-column: 1 / -1; grid-row: 2; }
  .tb__sep { display: none; }
}
.tb button, .tb select { white-space: nowrap; }
