/* Mosaïc - styles.
   Composition : colonne mobile centrée, barre d'onglets en bas ; dès 900 px, menu latéral à gauche.
   Parti pris : fond bleu nuit, tuiles de la couleur de chaque application, une seule teinte d'interface. */
:root {
  --bg: #06132a;
  --bg-2: #0b2147;
  --surface: #0f2750;
  --surface-2: #163663;
  --line: #2c4f86;
  --fg: #f2f6ff;
  --fg-dim: #a9bcda;
  --accent: #3d9bff;
  --accent-ink: #04122b;
  --danger: #ff6a6e;
  --ok: #3fcf86;
  --pdf: #e5484d;
  --doc: #2a8cff;
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-lg: 20px;
  --r-md: 14px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --navh: 76px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: radial-gradient(900px 520px at 85% -8%, #14407f 0%, transparent 62%), radial-gradient(700px 500px at -10% 105%, #0e2c5c 0%, transparent 60%), var(--bg);
  background-color: var(--bg);
  background-attachment: fixed;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  -webkit-tap-highlight-color: transparent;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 30; }
h1, h2 { font-family: var(--font-display); margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #8cc4ff; outline-offset: 2px; border-radius: 8px; }
.dim { color: var(--fg-dim); }
.small { font-size: 0.875rem; }
#app { min-height: 100%; }

/* ---------- Écrans plein cadre ---------- */
.center { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.wordmark { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.wordmark--xl { font-size: 3.2rem; }
.wordmark--lg { font-size: 2.4rem; }
.splash__logo { animation: rise 0.7s ease both; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.18); border-top-color: var(--accent); animation: spin 0.9s linear infinite; margin-top: 18px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.login { max-width: 460px; margin: 0 auto; padding-block: 36px 40px; display: flex; flex-direction: column; gap: 22px; min-height: 100vh; min-height: 100dvh; justify-content: center; }
.login__brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.org { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 2px; font-size: 1rem; }
.org span:first-child { font-weight: 600; }
.org__city { color: var(--fg-dim); }
.notice { background: rgba(255, 176, 32, 0.12); border: 1px solid rgba(255, 176, 32, 0.45); border-radius: var(--r-md); padding: 12px 14px; font-size: 0.95rem; }
.card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.card__head { display: flex; align-items: center; gap: 14px; }
.card__ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line); color: var(--fg); flex: none; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.95rem; font-weight: 600; }
.field input { width: 100%; min-height: 52px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(3, 12, 30, 0.55); font-weight: 400; font-size: 1.05rem; }
.field input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(61, 155, 255, 0.35); }
.field__row { position: relative; display: block; }
.field__row input { padding-right: 52px; }
.field__row .icon-btn { position: absolute; right: 2px; top: 2px; }
.field + .field { margin-top: 2px; }
form { display: flex; flex-direction: column; gap: 14px; }
.error { color: var(--danger); font-size: 0.95rem; min-height: 1.3em; text-align: center; }
form .error { text-align: left; }
.hint { text-align: center; }
.link { background: none; border: 0; color: #8cc4ff; text-decoration: underline; text-underline-offset: 3px; padding: 10px; min-height: 44px; font-size: 0.95rem; align-self: center; }

.btn { min-height: 54px; border-radius: 14px; border: 1.5px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 1.05rem; padding: 0 18px; width: 100%; }
.btn--primary { background: linear-gradient(180deg, #ffffff, #dfeaff); color: #07214a; }
.btn--primary:active { transform: translateY(1px); }
.btn--primary:disabled { opacity: 0.6; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--fg); margin-top: 10px; }
.icon-btn { background: none; border: 0; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: var(--fg); position: relative; flex: none; }
.icon-btn:active { background: rgba(255, 255, 255, 0.1); }

.agents { display: flex; flex-direction: column; gap: 10px; }
.agent { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, 0.05); text-align: left; width: 100%; }
.agent__n { flex: 1; font-weight: 600; font-size: 1.1rem; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #3d9bff, #7a6cff); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; flex: none; }
.avatar--lg { width: 56px; height: 56px; font-size: 1.3rem; }
.avatar--xl { width: 72px; height: 72px; font-size: 1.8rem; }
.dots { display: flex; gap: 16px; justify-content: center; padding: 6px 0; }
.dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--fg-dim); }
.dot.is-on { background: var(--fg); border-color: var(--fg); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 320px; width: 100%; margin: 0 auto; }
.key { height: 64px; border-radius: 16px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, 0.06); font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; display: grid; place-items: center; }
.key:active { background: rgba(255, 255, 255, 0.18); }

.demo { border: 1px dashed var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.demo__t { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-dim); font-family: var(--font-body); font-weight: 700; }
.demo__l { margin-top: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, 0.05); font-weight: 600; font-size: 0.97rem; white-space: nowrap; flex: none; }
.chip.is-on { background: #bfe0ff; color: #06214a; border-color: #bfe0ff; }
.chips--sector { margin-top: 12px; }

/* ---------- Coque ---------- */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 68px; background: rgba(6, 19, 42, 0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); margin-inline: calc(var(--gutter-l) * -1) calc(var(--gutter-r) * -1); padding-inline: var(--gutter-l) var(--gutter-r); }
.topbar__sp { width: 48px; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand__t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__t strong { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: -0.01em; }
.brand__t span { font-size: 0.82rem; color: var(--fg-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { position: absolute; top: 9px; right: 10px; width: 11px; height: 11px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg); }
.idle { background: #ffb020; color: #2a1c00; padding: 10px 16px; font-weight: 700; text-align: center; border-radius: 12px; margin-bottom: 10px; }

.main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding-block: 8px calc(var(--navh) + 28px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 16px; outline: none; }
.main > * { min-width: 0; }
.hello { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; gap: 4px; background: rgba(8, 24, 52, 0.96); border-top: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 8px var(--gutter-r) calc(8px + env(safe-area-inset-bottom, 0px)) var(--gutter-l); }
.nav__brand { display: none; }
.nav__i { position: relative; flex: 1; max-width: 140px; min-height: 58px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 0.78rem; font-weight: 600; color: var(--fg-dim); }
.nav__i.is-on { color: #fff; background: radial-gradient(ellipse 85% 95% at 50% 60%, rgba(54, 136, 255, 0.6), rgba(54, 136, 255, 0.18) 60%, rgba(54, 136, 255, 0) 100%); box-shadow: 0 0 24px rgba(54, 136, 255, 0.4); }
.nav__i.is-on svg { filter: drop-shadow(0 0 6px rgba(120, 180, 255, 0.9)); }
.nav__i .badge { top: 6px; right: calc(50% - 22px); }

/* ---------- Tuiles (accueil) ---------- */
.tiles { display: flex; flex-direction: column; gap: 10px; }
.tile { --tbg: linear-gradient(135deg, #1d5cc0, #123f8f); --tfg: #fff; --tsub: rgba(255, 255, 255, 0.82); --tline: rgba(255, 255, 255, 0.22);
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 14px 8px 10px; border-radius: 16px; text-align: left; width: 100%; border: 1.5px solid var(--tline); background: var(--tbg); color: var(--tfg); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 14px rgba(0, 0, 0, 0.3); }
.tile::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 60% 120% at 100% 50%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 70%); }
.tile:active { transform: translateY(1px); }
.tile__ico { height: 44px; width: 44px; display: grid; place-items: center; flex: none; border: 1.5px solid var(--tline); border-radius: 12px; background: rgba(255, 255, 255, 0.08); }
.tile__txt { display: flex; flex-direction: column; flex: 1; min-width: 0; position: relative; z-index: 1; }
.tile__txt strong { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.tile__txt span { font-size: 0.85rem; color: var(--tsub); line-height: 1.3; }
.tile__end { position: relative; z-index: 1; }
.tile__end svg { width: 20px; height: 20px; opacity: 0.85; }

/* ---------- En-tête d'accueil compact ---------- */
.greet { display: flex; align-items: center; gap: 14px; padding: 2px 2px 4px; }
.greet__av { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(120, 160, 220, 0.16); border: 1.5px solid rgba(160, 190, 235, 0.3); color: #cfe0ff; }
.greet__t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.greet__t h1 { font-size: 1.35rem; line-height: 1.2; }
.greet__t p { color: var(--fg-dim); font-size: 0.92rem; display: flex; align-items: center; gap: 4px; }
.tile__end { flex: none; display: grid; place-items: center; }
.tile--flashbt { --tbg: linear-gradient(135deg, #7a4dff, #4d2bc4); }
.tile--worklink { --tbg: linear-gradient(135deg, #f7f9fd, #e1e8f5); --tfg: #0b1f45; --tsub: #3d4f70; --tline: rgba(11, 31, 69, 0.22); }
.tile--mobigestion { --tbg: linear-gradient(135deg, #25a95f, #167741); }
.tile--vigilem { --tbg: linear-gradient(135deg, #1b4fa3, #12356f); --tline: #6db3ff; }
.tile--protocoles { --tbg: linear-gradient(135deg, #4a6683, #33495f); }
.tile--admin { --tbg: linear-gradient(135deg, #2b3a55, #1c273d); --tline: #5c76a3; margin-block: 4px; }
.tile.is-locked { --tbg: linear-gradient(135deg, #4a5565, #3a4352); --tfg: #cbd3df; --tsub: #aab4c3; --tline: rgba(255, 255, 255, 0.14); opacity: 0.8; }

.cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cell { min-height: 150px; padding: 16px; border-radius: 18px; border: 1.5px solid rgba(255, 255, 255, 0.22); display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 2px; text-align: left; color: #fff; background: linear-gradient(135deg, #1d5cc0, #123f8f); }
.cell__ico { margin-bottom: auto; }
.cell strong { font-family: var(--font-display); font-size: 1.05rem; }
.cell span:last-child { font-size: 0.88rem; opacity: 0.85; }
.cell--flashbt { background: linear-gradient(135deg, #7a4dff, #4d2bc4); }
.cell--worklink { background: linear-gradient(135deg, #f7f9fd, #e1e8f5); color: #0b1f45; border-color: rgba(11, 31, 69, 0.2); }
.cell--mobigestion { background: linear-gradient(135deg, #25a95f, #167741); }
.cell--vigilem { background: linear-gradient(135deg, #1b4fa3, #12356f); border-color: #6db3ff; }
.cell--protocoles { background: linear-gradient(135deg, #4a6683, #33495f); }
.cell.is-locked { background: linear-gradient(135deg, #4a5565, #3a4352); color: #cbd3df; border-color: rgba(255, 255, 255, 0.14); opacity: 0.8; }

/* ---------- Bandeau de module, listes ---------- */
.banner { display: flex; align-items: center; gap: 16px; padding: 20px 18px; border-radius: 20px; border: 1.5px solid rgba(255, 255, 255, 0.22); background: linear-gradient(135deg, #1d5cc0, #123f8f); color: #fff; }
.banner p { color: rgba(255, 255, 255, 0.85); font-size: 0.95rem; margin-top: 4px; }
.banner--flashbt { background: linear-gradient(135deg, #7a4dff, #4d2bc4); }
.banner--worklink { background: linear-gradient(135deg, #f7f9fd, #e1e8f5); color: #0b1f45; border-color: rgba(11, 31, 69, 0.2); }
.banner--worklink p { color: #3d4f70; }
.banner--mobigestion { background: linear-gradient(135deg, #25a95f, #167741); }
.banner--vigilem { background: linear-gradient(135deg, #1b4fa3, #12356f); border-color: #6db3ff; }
.banner--protocoles { background: linear-gradient(135deg, #4a6683, #33495f); }
.banner__ico { flex: none; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 16px; background: rgba(255, 255, 255, 0.14); }
.banner--worklink .banner__ico { background: rgba(11, 31, 69, 0.08); }

.panel { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.status { align-self: flex-start; font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 5px 10px; border-radius: 999px; background: rgba(255, 176, 32, 0.15); border: 1px solid rgba(255, 176, 32, 0.5); color: #ffd48a; }
.list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }

.search { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(3, 12, 30, 0.55); color: var(--fg-dim); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(61, 155, 255, 0.35); }
.search input { flex: 1; min-width: 0; height: 52px; background: none; border: 0; outline: none; font-size: 1rem; color: var(--fg); }
.search input::placeholder { color: var(--fg-dim); }

.rows { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 10px 14px; border-radius: 16px; border: 1.5px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)); text-align: left; width: 100%; }
.row:active { background: rgba(255, 255, 255, 0.12); }
.row--static:active { background: inherit; }
.row__ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none; }
.row__txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.row__txt strong { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.row__txt span, .row__txt em { font-size: 0.92rem; color: var(--fg-dim); font-style: normal; }
.row.is-unread { border-color: #5aa2ff; }
.fmt { flex: none; width: 52px; height: 56px; border-radius: 10px; display: grid; place-items: end center; padding-bottom: 6px; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; color: #fff; }
.fmt--pdf { background: var(--pdf); }
.fmt--doc { background: var(--doc); }
.doc__dl { flex: none; color: var(--fg-dim); }
.empty { padding: 18px 4px; }

.profile { display: flex; align-items: center; gap: 16px; padding-top: 6px; }
.segs { display: flex; gap: 6px; background: rgba(255, 255, 255, 0.06); padding: 5px; border-radius: 14px; }
.seg { flex: 1; min-height: 46px; border: 0; border-radius: 10px; background: none; font-weight: 700; color: var(--fg-dim); }
.seg.is-on { background: #bfe0ff; color: #06214a; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.matrix { border-collapse: collapse; width: 100%; min-width: 360px; }
.matrix th, .matrix td { padding: 10px 12px; text-align: center; border-bottom: 1px solid rgba(44, 79, 134, 0.6); }
.matrix th[scope="row"] { text-align: left; font-weight: 600; }
.matrix thead th { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-dim); }
.matrix tr:last-child th, .matrix tr:last-child td { border-bottom: 0; }
.devl { margin-top: 6px; }

.switch { position: relative; display: inline-block; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch__t { position: absolute; inset: 0; border-radius: 999px; background: #3a4a66; transition: background 0.15s; }
.switch__t::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + .switch__t { background: #2c9a62; }
.switch input:checked + .switch__t::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__t { outline: 3px solid #8cc4ff; outline-offset: 2px; }

.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(2, 8, 20, 0.7); display: flex; align-items: flex-end; justify-content: center; padding-inline: var(--gutter-l) var(--gutter-r); }
.sheet { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px 22px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; animation: rise 0.25s ease both; }
.sheet__head { display: flex; gap: 14px; align-items: center; }

.toast { position: fixed; left: 50%; bottom: calc(var(--navh) + 24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: #eaf2ff; color: #06214a; padding: 12px 18px; border-radius: 14px; font-weight: 600; max-width: min(92vw, 440px); text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); transition: opacity 0.4s; }
.toast.is-out { opacity: 0; }

/* ---------- Fidélité à la maquette : logo, splash, connexion, accueil, bannières ---------- */
.logo { display: block; height: auto; max-width: 100%; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.splash { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: 1fr auto auto; justify-items: center; align-items: center; padding-block: 24px 40px; text-align: center; position: relative; }
.splash__top { display: flex; flex-direction: column; align-items: center; gap: 6px; align-self: end; padding-bottom: 28px; }
.splash .skyline { width: min(100%, 560px); height: auto; opacity: 0.95; margin-inline: calc(var(--gutter-l) * -1) 0; }
.splash__load { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 24px; color: var(--fg-dim); }
.splash__load .spinner { margin-top: 0; }
.splash__load p { color: var(--fg); }

.login__brand .logo { margin-bottom: 2px; }
.org { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 0; font-size: 1.15rem; width: 100%; }
.org strong { font-weight: 600; white-space: nowrap; }
.org__rule { flex: 0 1 44px; height: 2px; background: var(--accent); border-radius: 2px; }
.org__city { margin: 0; font-size: 1.05rem; color: var(--fg); }
.org__city strong { font-weight: 700; }
.field__row--ico { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(10, 30, 66, 0.6); color: var(--fg-dim); position: relative; }
.field__row--ico:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(61, 155, 255, 0.35); }
.field__row--ico input { flex: 1; min-width: 0; border: 0; background: none; min-height: 52px; padding: 0; font-size: 1.05rem; color: var(--fg); font-weight: 400; }
.field__row--ico input:focus { outline: none; box-shadow: none; }
.field__row--ico input::placeholder { color: var(--fg-dim); }
.field__row--ico .icon-btn { position: static; width: 44px; height: 44px; margin-right: -8px; }
.field__row--ico input { padding-right: 0; }

.topbar .brand .logo { width: 46px; height: auto; }
.hero { position: relative; overflow: hidden; border-radius: 22px; margin-inline: 0; padding: 22px 18px 100px; }
.hero::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 78%; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 150' preserveAspectRatio='none'><defs><linearGradient id='g' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='%232f7ee0' stop-opacity='.55'/><stop offset='1' stop-color='%230b2a5c' stop-opacity='.05'/></linearGradient></defs><path d='M0 128 C 90 124 150 70 250 52 C 320 40 370 20 400 4 L400 150 L0 150 Z' fill='url(%23g)'/><path d='M0 128 C 90 124 150 70 250 52 C 320 40 370 20 400 4' fill='none' stroke='%2373b4ff' stroke-opacity='.7' stroke-width='2'/></svg>") center bottom / 100% 100% no-repeat; }
.hero__sky { position: absolute; right: 0; bottom: 6px; width: 72%; max-width: 380px; height: auto; opacity: 0.95; pointer-events: none; }
.hero__txt { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 4px; }
.hero__txt h1 { font-size: 1.75rem; }
.hero__txt p { color: var(--fg); }
.hero__meta { color: var(--fg-dim) !important; font-size: 0.95rem; }

.banner { position: relative; overflow: hidden; isolation: isolate; min-height: 128px; background: var(--bbg, linear-gradient(135deg, #1d5cc0, #123f8f)); }
.banner > * { position: relative; z-index: 1; }
.banner.has-photo::after { content: ""; position: absolute; z-index: 0; top: 0; right: 0; bottom: 0; width: 52%; background: var(--bimg) center / cover no-repeat; -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 70%); mask-image: linear-gradient(90deg, transparent 0%, #000 70%); opacity: 0.95; }
.banner--protocoles { --bbg: linear-gradient(135deg, #1565b8, #0c3f80); background: var(--bbg); }
.banner--cat { background: linear-gradient(135deg, var(--bc), color-mix(in srgb, var(--bc) 50%, #000)); }
.banner__ico { width: 72px; height: 72px; background: none; border-radius: 0; }
.banner h1 { font-size: 1.6rem; }

.searchrow { display: flex; gap: 10px; align-items: stretch; }
.searchrow .search { flex: 1; min-width: 0; }
.filterbtn { flex: none; width: 56px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(10, 30, 66, 0.6); display: grid; place-items: center; }
.filterbtn.is-on { background: #bfe0ff; color: #06214a; border-color: #bfe0ff; }
.search { background: rgba(10, 30, 66, 0.6); }
.search input { font-size: 0.98rem; }

.drawer-bg { position: fixed; inset: 0; z-index: 50; background: rgba(2, 8, 20, 0.7); }
.drawer { position: absolute; top: 0; bottom: 0; left: 0; width: min(86vw, 340px); background: var(--bg-2); border-right: 1px solid var(--line); padding: calc(20px + env(safe-area-inset-top, 0px)) 18px calc(20px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 18px; animation: slide 0.22s ease both; }
@keyframes slide { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer__head { display: flex; align-items: center; gap: 14px; }
.drawer__head strong { display: block; font-family: var(--font-display); }
.drawer__head span { color: var(--fg-dim); font-size: 0.9rem; }
.drawer__nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.drawer__nav a { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 0 12px; border-radius: 12px; font-weight: 600; }
.drawer__nav a:active { background: rgba(255, 255, 255, 0.1); }
.drawer .btn--ghost { margin-top: 0; }

/* ---------- Ordinateur : menu latéral ---------- */
@media (min-width: 900px) {
  body { padding-left: 0; padding-right: 0; }
  .shell { padding-left: 250px; padding-right: var(--gutter-r); }
  .topbar { margin-inline: 0; padding-inline: 0 0; max-width: 880px; width: 100%; margin-inline: auto; }
  .main { max-width: 880px; padding-bottom: 48px; }
  .nav { left: 0; right: auto; top: 0; bottom: 0; width: 250px; flex-direction: column; justify-content: flex-start; gap: 8px; padding: 24px 16px; border-top: 0; border-right: 1px solid var(--line); }
  .nav__brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; font-size: 1.5rem; }
  .nav__i { flex: none; max-width: none; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 0 16px; min-height: 54px; font-size: 1rem; }
  .nav__i .badge { top: 14px; right: auto; left: 34px; }
  .tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cells { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toast { bottom: 28px; }
  .shell > .idle { max-width: 880px; margin-inline: auto; width: 100%; }
}
@media (min-width: 900px) { .topbar .brand, .topbar [data-act=menu] { display: none; } .topbar { justify-content: flex-end; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; } }

@media (prefers-reduced-motion: reduce) {
  .spinner, .splash__logo, .sheet { animation: none; }
  .switch__t, .switch__t::after, .toast { transition: none; }
}

.chips--scroll .chip { flex: 1 1 auto; padding: 0 10px; font-size: 0.9rem; }

.topbar__r { display: flex; align-items: center; flex: none; }
.nav__i { max-width: 140px; }

/* ---------- Tuiles modules : effet vitré, lueur, grand logo en filigrane ---------- */
.tile { min-height: 70px; border-radius: 18px; border-color: color-mix(in srgb, var(--tglow, #fff) 55%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--tglow, #fff) 35%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -10px 24px rgba(0, 0, 0, 0.18); }
.tile::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 45%); }
.tile__art { position: absolute; right: -6px; top: 50%; transform: translateY(-50%) rotate(-8deg); width: 120px; height: 120px; opacity: 0.2; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 55%); mask-image: linear-gradient(90deg, transparent, #000 55%); }
.tile__art svg { width: 100%; height: 100%; stroke-width: 1.2; }
.tile--flashbt { --tglow: #9a78ff; }
.tile--worklink { --tglow: #ffffff; }
.tile--worklink::before { background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 50%); }
.tile--worklink .tile__art { opacity: 0.12; color: #0b1f45; }
.tile--mobigestion { --tglow: #4be38a; }
.tile--vigilem { --tglow: #6db3ff; }
.tile--protocoles { --tglow: #8fb0d4; }
.tile--admin { --tglow: #7f9ad0; }
.tile.is-locked { box-shadow: none; --tglow: #8a94a6; }

.tile__photo { position: absolute; inset: 0 0 0 28%; pointer-events: none; background: var(--tph) center / cover; opacity: 0.85; -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); mask-image: linear-gradient(90deg, transparent, #000 60%); }
.tile--flashbt .tile__photo { mix-blend-mode: luminosity; opacity: 0.7; }
.tile--worklink .tile__photo { inset: 0 0 0 48%; opacity: 0.8; -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%); mask-image: linear-gradient(90deg, transparent, #000 45%); }
.tile--mobigestion .tile__photo { mix-blend-mode: luminosity; opacity: 0.6; }
.tile--vigilem .tile__photo { mix-blend-mode: luminosity; opacity: 0.55; }
.tile.is-locked .tile__photo { filter: grayscale(1); opacity: 0.35; mix-blend-mode: normal; }
.tile--protocoles .tile__photo { mix-blend-mode: luminosity; opacity: 0.55; }
.tile--protocoles .tile__photo { inset: 0 0 0 45%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 50%); mask-image: linear-gradient(90deg, transparent, #000 50%); }
.tile--admin .tile__photo { inset: 0 0 0 40%; mix-blend-mode: luminosity; opacity: 0.55; -webkit-mask-image: linear-gradient(90deg, transparent, #000 55%); mask-image: linear-gradient(90deg, transparent, #000 55%); }

/* Mobile : barre du bas et en-tête d'accueil plus discrets */
@media (max-width: 899px) {
  :root { --navh: 52px; }
  .nav { padding-top: 5px; padding-bottom: calc(5px + env(safe-area-inset-bottom, 0px)); }
  .nav__i { min-height: 46px; gap: 1px; font-size: 0.68rem; border-radius: 13px; }
  .nav__i svg { width: 21px; height: 21px; }
  .nav__i .badge { top: 3px; right: calc(50% - 18px); width: 9px; height: 9px; }
}
.hero { padding: 14px 16px 84px; }
.hero__txt h1 { font-size: 1.35rem; }
.hero__txt p { font-size: 0.92rem; }
.hero__meta { font-size: 0.82rem !important; }
.hero__sky { width: 62%; }
.tile--admin .tile__photo { inset: 0 0 0 58%; opacity: 0.45; -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%); mask-image: linear-gradient(90deg, transparent, #000 40%); }
