/* LTF Émargement — feuille de style principale, sans dépendance externe.
   Identité : bleu marine LTF #1F3863, police Plus Jakarta Sans (OFL, auto-hébergée), piste « Clair et guidé ».
   Une couleur par thème (planning, direct, à affecter, à clôturer, documents, sauvegarde), reprise partout. */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/static/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/static/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --navy: #1f3863;
  --navy-hover: #172a4b;
  --navy-deep: #12203b;
  --navy-50: #eef2f9;
  --navy-100: #dfe6f3;
  --navy-soft: var(--navy-50);
  --gray: #545454;
  --text: #1a2233;
  --muted: #5c6880;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --border: #e3e8f1;
  --border-strong: #c9d2e0;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --success: #067647;
  --success-bg: #ecfdf3;
  --warning: #93370d;
  --warning-bg: #fffaeb;
  --focus: #2e5aac;
  /* Thèmes (icônes, cartes « À traiter », planning) */
  --c-plan: #2f5ea8;   --c-plan-bg: #e7eefa;
  --c-live: #0f8a5f;   --c-live-bg: #e3f5ec;
  --c-assign: #b26a00; --c-assign-bg: #fdf1dc;
  --c-close: #c2412d;  --c-close-bg: #fde9e5;
  --c-doc: #6b4bb8;    --c-doc-bg: #efe9fb;
  --c-safe: #0d7f8c;   --c-safe-bg: #e1f4f6;
  /* Parcours (couleurs des rôles Discord) et groupes (niveaux), distinctes les unes des autres */
  --t-tc: #2f7d32;      --t-tc-bg: #e5f3e6;
  --t-emf: #2160c4;     --t-emf-bg: #e4edfb;
  --t-premium: #9a6a00; --t-premium-bg: #fcf1cf;
  --t-excel: #1f3863;   --t-excel-bg: #e3e8f1;
  --t-g1: #6b44c4;      --t-g1-bg: #efe8fb;
  --t-g2: #b8326e;      --t-g2-bg: #fbe6ef;
  --t-g3: #0d7f8c;      --t-g3-bg: #e1f4f6;
  --t-attente: #667085; --t-attente-bg: #eef0f4;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(31, 56, 99, 0.06), 0 1px 1px rgba(31, 56, 99, 0.04);
  --shadow-hover: 0 14px 28px -18px rgba(20, 35, 70, 0.45);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --sidebar-w: 264px;
  --font: "Plus Jakarta Sans", -apple-system, "Segoe UI", system-ui, Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01" off;
}

h1, h2, h3 { line-height: 1.2; color: var(--navy); margin: 0 0 var(--space-3); letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: 1.75rem; font-weight: 750; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 var(--space-4); }
a { color: var(--navy); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--navy-hover); }
strong, b { font-weight: 700; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.skip-link {
  position: absolute; left: var(--space-4); top: -48px; z-index: 50;
  padding: var(--space-2) var(--space-4); background: var(--navy); color: #fff; border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--space-2); color: #fff; }

/* --- Icônes ------------------------------------------------------------------------- */

.icon { width: 20px; height: 20px; flex: none; overflow: visible; }
.icon .duo { fill: currentColor; stroke: none; opacity: 0.18; }

/* --- Coquille : barre latérale + contenu ------------------------------------------------ */

.shell {
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh;
  /* Fond de la barre latérale prolongé sur toute la hauteur des pages longues */
  background: linear-gradient(to right, var(--surface) calc(var(--sidebar-w) - 1px), var(--border) calc(var(--sidebar-w) - 1px), var(--border) var(--sidebar-w), transparent var(--sidebar-w));
}
.shell-main { display: flex; flex-direction: column; min-width: 0; }

.brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: inherit; }
.brand-crest { width: 34px; height: auto; flex: none; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-org { font-weight: 800; letter-spacing: 0.04em; color: var(--navy); font-size: 0.78rem; }
.brand-app { color: var(--muted); font-size: 0.85rem; font-weight: 500; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--space-1);
  padding: var(--space-5) var(--space-3) var(--space-4);
  background: var(--surface); border-right: 1px solid var(--border);
}
.brand-side { padding: 0 var(--space-2) var(--space-5); }
.sidebar nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-group {
  margin: var(--space-4) var(--space-3) var(--space-1); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: #8a94a7;
}
.sidebar nav .nav-group:first-child { margin-top: 0; }
.nav-link {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 42px;
  padding: 0 var(--space-3); border-radius: var(--radius-sm); border: 0; background: none;
  font: inherit; font-size: 0.93rem; font-weight: 550; color: #3a4559; text-decoration: none; cursor: pointer; text-align: left;
}
.nav-link .icon { color: #66728a; }
.nav-link:hover { background: var(--navy-50); color: var(--navy); }
.nav-link:hover .icon { color: var(--navy); }
.nav-link[aria-current="page"] { background: var(--navy-50); color: var(--navy); font-weight: 700; }
.nav-link[aria-current="page"] .icon { color: var(--navy); }
.nav-link[aria-current="page"] .icon .duo { opacity: 0.3; }
.sidebar-foot { margin-top: auto; padding-top: var(--space-4); border-top: 1px solid var(--border); display: grid; gap: 2px; }
.nav-account { min-height: 52px; }
.nav-account span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.nav-account strong { font-size: 0.9rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-account small { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.nav-logout { color: var(--muted); }

.mobilebar { display: none; }
.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--navy); cursor: pointer; }
.nav-toggle .icon { width: 22px; height: 22px; }
.nav-toggle-close { display: none; }
.nav-backdrop { position: fixed; inset: 0; background: rgba(15, 22, 38, 0.45); z-index: 30; }

main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: var(--space-6) var(--space-6) var(--space-7); }

.footer { padding: var(--space-4) var(--space-5) var(--space-5); color: var(--muted); font-size: 0.82rem; text-align: center; }

@media (max-width: 1023px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .mobilebar {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
    position: sticky; top: 0; z-index: 20; padding: var(--space-2) var(--space-4);
    background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border);
  }
  .mobilebar .brand-crest { width: 28px; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: min(300px, 86vw); height: auto;
    transform: translateX(-102%); box-shadow: 0 0 40px rgba(15, 22, 38, 0.25);
  }
  .nav-open .sidebar { transform: none; }
  .nav-open .nav-toggle-open { display: none; }
  .nav-open .nav-toggle-close { display: block; }
  main { padding: var(--space-5) var(--space-4) var(--space-6); }
}

/* --- Mise en page ----------------------------------------------------------------------- */

.page-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4);
  flex-wrap: wrap; margin-bottom: var(--space-5);
}
.page-header h1 { margin-bottom: var(--space-1); }
.page-header p { color: var(--muted); margin: 0; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: var(--space-5); margin-bottom: var(--space-5);
}
.card > :last-child { margin-bottom: 0; }

.grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.section-title { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: var(--space-6) 0 var(--space-3); }
.section-title:first-of-type { margin-top: 0; }

/* Pages d'authentification : carte centrée */
.auth-page { background: radial-gradient(1200px 600px at 50% -10%, var(--navy-100), var(--bg) 60%); }
.auth-page main { display: flex; align-items: center; justify-content: center; max-width: none; }
.auth-card { width: 100%; max-width: 440px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center; margin-bottom: var(--space-5); }
.auth-brand img { width: 56px; height: auto; }
.auth-brand .brand-org { display: block; font-size: 0.95rem; }
.auth-brand .brand-app { display: block; font-size: 0.95rem; }
.auth-card h1 { font-size: 1.35rem; }
.auth-card .lead { color: var(--muted); }

/* --- Formulaires -------------------------------------------------------------------------- */

.field { margin-bottom: var(--space-4); }
.field label { display: block; font-weight: 650; font-size: 0.92rem; margin-bottom: 6px; }
.field .hint { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 6px; }

input:not([type]), input[type="text"], input[type="url"], input[type="number"], input[type="email"], input[type="password"], input[type="date"],
input[type="time"], input[type="datetime-local"], input[type="tel"], input[type="search"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; font-size: 0.95rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
input:hover, select:hover, textarea:hover { border-color: #aeb9cb; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px rgba(46, 90, 172, 0.18);
}
input[aria-invalid="true"] { border-color: var(--danger); }
.code-input { font-family: var(--mono); font-size: 1.35rem; letter-spacing: 0.25em; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 18px; font: inherit; font-size: 0.93rem; font-weight: 650;
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms var(--ease);
}
.btn .icon { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 1px 2px rgba(18, 32, 59, 0.25); }
.btn-primary:hover { background: var(--navy-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--navy); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--navy-50); border-color: #aeb9cb; color: var(--navy); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--surface); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #f1c0bb; }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 0.86rem; }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.65; cursor: progress; }

.actions { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; margin-top: var(--space-5); }
.inline-form { display: inline; margin: 0; }

/* --- Messages ----------------------------------------------------------------------------- */

.alert { border-radius: var(--radius); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); border: 1px solid; font-size: 0.93rem; }
.alert ul { margin: 0; padding-left: 1.2em; }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #f6c6c0; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #b4e6cb; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #f5d79b; }
.alert-info { background: var(--navy-50); color: var(--navy); border-color: var(--navy-100); }

/* --- Tableaux ----------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; margin: 0 calc(-1 * var(--space-2)); padding: 0 var(--space-2); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; white-space: nowrap; }
tbody tr { transition: background-color 120ms ease; }
tbody tr:hover { background: #f9fbfe; }
tbody tr:last-child td { border-bottom: 0; }
td.actions-cell { white-space: nowrap; text-align: right; }
td.actions-cell form + form { margin-left: var(--space-2); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 650; background: var(--navy-50); color: var(--navy); white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: #eef0f4; color: var(--muted); }

.mono { font-family: var(--mono); font-size: 0.85rem; word-break: break-all; }
.muted { color: var(--muted); }

/* --- Tableau de bord : cartes « À traiter » ------------------------------------------------- */

.todo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: var(--space-4); margin-bottom: var(--space-6); }
.tile {
  position: relative; display: grid; gap: var(--space-2); align-content: start; padding: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
}
.tile:hover { color: inherit; border-color: var(--border-strong); }
.tile-ico { position: relative; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; }
.tile-ico .icon { width: 24px; height: 24px; }
.tile-num { font-size: 2rem; font-weight: 750; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile-label { font-weight: 650; color: var(--text); line-height: 1.3; }
.tile-foot { display: inline-flex; align-items: center; gap: 6px; font-size: 0.84rem; font-weight: 650; }
.tile-foot .icon { width: 15px; height: 15px; transition: transform 200ms var(--ease); }
.tile:hover .tile-foot .icon { transform: translateX(3px); }
.tile.is-zero .tile-num { color: #9aa4b5; }
.tile.is-zero .tile-foot { color: var(--muted); }
.k-plan .tile-ico, .k-plan.tile-ico { background: var(--c-plan-bg); color: var(--c-plan); } .k-plan .tile-num, .k-plan .tile-foot { color: var(--c-plan); }
.k-live .tile-ico, .k-live.tile-ico { background: var(--c-live-bg); color: var(--c-live); } .k-live .tile-num, .k-live .tile-foot { color: var(--c-live); }
.k-assign .tile-ico, .k-assign.tile-ico { background: var(--c-assign-bg); color: var(--c-assign); } .k-assign .tile-num, .k-assign .tile-foot { color: var(--c-assign); }
.k-close .tile-ico, .k-close.tile-ico { background: var(--c-close-bg); color: var(--c-close); } .k-close .tile-num, .k-close .tile-foot { color: var(--c-close); }
.k-doc .tile-ico, .k-doc.tile-ico { background: var(--c-doc-bg); color: var(--c-doc); } .k-doc .tile-num, .k-doc .tile-foot { color: var(--c-doc); }
.k-safe .tile-ico, .k-safe.tile-ico { background: var(--c-safe-bg); color: var(--c-safe); } .k-safe .tile-num, .k-safe .tile-foot { color: var(--c-safe); }
.tile.is-zero .tile-ico { filter: saturate(0.35); opacity: 0.8; }
/* Ce qui attend une action se signale aussi par la bordure */
.tile.is-alert.k-close { border-color: #f3b9ae; }
.tile.is-alert.k-assign { border-color: #f1d29a; }
.tile.is-alert.k-live { border-color: #9edcbf; }
.live-dot { position: absolute; top: -3px; right: -3px; width: 13px; height: 13px; border-radius: 50%; background: var(--c-live); border: 2px solid var(--surface); }

.badge .icon { width: 14px; height: 14px; }
.dash-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.dash-cols .card { margin-bottom: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-3); }
.card-head h2 { margin: 0; }
.next-list, .shortcut-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.next-item {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2); margin: 0 calc(-1 * var(--space-2));
  border-radius: var(--radius); text-decoration: none; color: inherit;
}
.next-item:hover { background: var(--navy-50); color: inherit; }
.next-date {
  flex: none; width: 52px; height: 52px; border-radius: 13px; display: grid; place-content: center; text-align: center;
  background: var(--c-plan-bg); color: var(--c-plan); font-size: 0.72rem; font-weight: 650; line-height: 1.1;
}
.next-date b { font-size: 1.25rem; font-weight: 750; }
.next-item.is-live .next-date { background: var(--c-live-bg); color: var(--c-live); }
.next-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.next-body strong { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-body .muted { font-size: 0.86rem; }
.shortcut-list .nav-link { min-height: 52px; }
.shortcut-list .tile-ico { width: 36px; height: 36px; border-radius: 10px; }
.shortcut-list .tile-ico .icon { width: 19px; height: 19px; }
.shortcut-list .tile-ico:not([class*="k-"]) { background: #eef0f4; color: var(--muted); }
.is-soon { cursor: default; color: var(--muted); }
.is-soon:hover { background: none; color: var(--muted); }
.is-soon .badge { margin-left: auto; }
@media (max-width: 900px) { .dash-cols { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .todo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .tile { padding: 14px; gap: 6px; border-radius: var(--radius); }
  .tile-ico { width: 38px; height: 38px; border-radius: 11px; }
  .tile-ico .icon { width: 20px; height: 20px; }
  .tile-num { font-size: 1.6rem; }
  .tile-label { font-size: 0.88rem; }
  .tile-foot { font-size: 0.78rem; }
  .tile-foot .icon { display: none; }
}

/* --- Personnes, puces, heures ----------------------------------------------------------- */

.person { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.avatar {
  flex: none; width: 38px; height: 38px; border-radius: 12px; display: inline-grid; place-items: center;
  font-size: 0.8rem; font-weight: 750; letter-spacing: 0.02em;
}
.person-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.person-name { font-weight: 650; color: var(--text); text-decoration: none; }
a.person-name:hover { color: var(--navy); text-decoration: underline; }
.person-sub { font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.av-0 { background: var(--c-plan-bg); color: var(--c-plan); }
.av-1 { background: var(--c-doc-bg); color: var(--c-doc); }
.av-2 { background: var(--c-safe-bg); color: var(--c-safe); }
.av-3 { background: var(--c-assign-bg); color: var(--c-assign); }
.av-4 { background: var(--c-live-bg); color: var(--c-live); }
.av-5 { background: var(--navy-100); color: var(--navy); }

.pchip, .gchip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 700; white-space: nowrap; line-height: 1.4;
}
.gchip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pchip, .gchip { background: var(--t-bg); color: var(--t); }
.t-autre { --t: var(--navy); --t-bg: var(--navy-100); }
.t-tc { --t: var(--t-tc); --t-bg: var(--t-tc-bg); }
.t-emf { --t: var(--t-emf); --t-bg: var(--t-emf-bg); }
.t-premium { --t: var(--t-premium); --t-bg: var(--t-premium-bg); }
.t-excel { --t: var(--t-excel); --t-bg: var(--t-excel-bg); }
.t-g1 { --t: var(--t-g1); --t-bg: var(--t-g1-bg); }
.t-g2 { --t: var(--t-g2); --t-bg: var(--t-g2-bg); }
.t-g3 { --t: var(--t-g3); --t-bg: var(--t-g3-bg); }
.t-attente { --t: var(--t-attente); --t-bg: var(--t-attente-bg); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge-group { background: var(--navy); color: #fff; }

[hidden] { display: none !important; }
.text-warn { color: var(--c-assign); font-weight: 650; }
.crumbs { margin: 0 0 var(--space-1); font-size: 0.85rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }

/* Chiffres clés d'une fiche */
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr); gap: var(--space-3); margin-bottom: var(--space-5); }
.stat {
  display: flex; align-items: center; gap: var(--space-3); padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0;
}
.stat .tile-ico { width: 40px; height: 40px; border-radius: 12px; }
.stat .tile-ico .icon { width: 20px; height: 20px; }
.stat > span:last-child { display: flex; flex-direction: column; font-size: 0.82rem; color: var(--muted); line-height: 1.25; }
.stat b { font-size: 1.35rem; color: var(--text); font-weight: 750; font-variant-numeric: tabular-nums; }
.stat-people { flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.stat-label { width: 100%; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.trainer { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 600; font-size: 0.9rem; }
.trainer .avatar { width: 30px; height: 30px; border-radius: 10px; font-size: 0.72rem; }
.card-compact { padding: var(--space-4) var(--space-5); }

/* Liste de dossiers : tableau sur ordinateur, cartes sur téléphone ; le menu d'actions n'est jamais rogné */
.dossiers-wrap { margin: 0 calc(-1 * var(--space-2)); }
table.dossiers td { vertical-align: middle; }
table.dossiers .period { display: table-cell; }
table.dossiers .period span, table.dossiers td[data-label="Financement"] span { display: block; }
td.row-end { text-align: right; white-space: nowrap; }
td.row-end > * { vertical-align: middle; }

.menu { position: relative; display: inline-block; margin-left: var(--space-2); text-align: left; }
.menu > summary { list-style: none; min-height: 36px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: "▾"; font-size: 0.7rem; margin-left: 4px; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; width: 300px; padding: var(--space-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 20px 44px -14px rgba(15, 22, 38, 0.28); white-space: normal; display: grid; gap: 2px;
}
.menu-item {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 40px; padding: 0 var(--space-3);
  border: 0; border-radius: var(--radius-sm); background: none; font: inherit; font-size: 0.9rem; font-weight: 600;
  color: var(--text); text-decoration: none; cursor: pointer; text-align: left;
}
.menu-item .icon { width: 18px; height: 18px; color: var(--muted); }
.menu-item:hover { background: var(--navy-50); color: var(--navy); }
.menu-item:hover .icon { color: var(--navy); }
.menu-sub > summary.menu-item { list-style: none; }
.menu-sub > summary::-webkit-details-marker { display: none; }
.menu-sub[open] > summary { background: var(--navy-50); color: var(--navy); }
.menu-sub .stack-form { padding: var(--space-2) var(--space-3) var(--space-3); min-width: 0; }
.menu-danger, .menu-danger .icon { color: var(--danger); }
.menu-danger:hover { background: var(--danger-bg); color: var(--danger); }

.empty-state { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) 0; }
.empty-state p { margin: 0; }
.empty-state .tile-ico { width: 48px; height: 48px; border-radius: 14px; flex: none; }

@media (max-width: 900px) {
  .stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-people { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat { padding: 12px; }
  table.dossiers thead { display: none; }
  table.dossiers, table.dossiers tbody, table.dossiers tr, table.dossiers td { display: block; width: 100%; }
  table.dossiers tr { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-3); }
  table.dossiers td { border: 0; padding: 0; }
  table.dossiers td:first-child, table.dossiers td.row-end { grid-column: 1 / -1; }
  table.dossiers td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
  td.row-end { text-align: left; }
  .menu-pop { left: 0; right: auto; width: min(300px, calc(100vw - 48px)); }
  .person-sub { max-width: 200px; }
}

.module-card { display: flex; flex-direction: column; gap: var(--space-2); }
.module-card h2 { margin: 0; }
.module-card p { color: var(--muted); flex: 1; margin: 0; }

/* --- Micro-animations (désactivées si l'appareil demande moins de mouvement) ---------------- */

@media (prefers-reduced-motion: no-preference) {
  .sidebar { transition: transform 260ms var(--ease); }
  .tile, .card-link { transition: transform 250ms var(--ease), box-shadow 250ms var(--ease), border-color 150ms ease; }
  .tile:hover, .tile:focus-visible, .card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
  .live-dot::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--c-live); animation: ltf-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite; }
  @keyframes ltf-ping { 0% { transform: scale(1); opacity: 0.8; } 80%, 100% { transform: scale(2.4); opacity: 0; } }

  .icon .flip { transform-box: view-box; transform-origin: 12px 15px; }
  .icon .plus { transform-box: fill-box; transform-origin: center; }
  .icon .hand { transform-box: view-box; transform-origin: 12px 12px; }
  .icon .check { stroke-dasharray: 14; stroke-dashoffset: 0; }
  .icon .shield { transform-box: view-box; transform-origin: 12px 20px; }
  :is(.tile, .nav-link, .btn, .card-link):is(:hover, :focus-visible) .flip, .play .flip { animation: ltf-flip 0.6s ease-in-out; }
  :is(.tile, .nav-link, .btn, .card-link):is(:hover, :focus-visible) .plus, .play .plus { animation: ltf-pop 0.55s cubic-bezier(0.3, 1.6, 0.5, 1); }
  :is(.tile, .nav-link, .btn, .card-link):is(:hover, :focus-visible) .hand, .play .hand { animation: ltf-spin 0.9s cubic-bezier(0.5, 0, 0.3, 1); }
  :is(.tile, .nav-link, .btn, .card-link):is(:hover, :focus-visible) .check, .play .check { animation: ltf-draw 0.7s ease-out; }
  :is(.tile, .nav-link, .btn, .card-link):is(:hover, :focus-visible) .shield, .play .shield { animation: ltf-wobble 0.7s ease-in-out; }
  .k-live .mod, .is-live .mod { animation: ltf-blink 3s steps(1) infinite; }
  .k-live .mod:nth-of-type(2), .is-live .mod:nth-of-type(2) { animation-delay: 0.5s; }
  .k-live .mod:nth-of-type(3), .is-live .mod:nth-of-type(3) { animation-delay: 1.2s; }
  .k-live .mod:nth-of-type(4), .is-live .mod:nth-of-type(4) { animation-delay: 2s; }
  @keyframes ltf-flip { 0% { transform: scaleY(1); } 45%, 55% { transform: scaleY(0); } 100% { transform: scaleY(1); } }
  @keyframes ltf-pop { 0% { transform: scale(1); } 40% { transform: scale(1.45) rotate(90deg); } 100% { transform: scale(1) rotate(180deg); } }
  @keyframes ltf-spin { to { transform: rotate(360deg); } }
  @keyframes ltf-draw { from { stroke-dashoffset: 14; } to { stroke-dashoffset: 0; } }
  @keyframes ltf-wobble { 20% { transform: rotate(-9deg); } 50% { transform: rotate(7deg); } 80% { transform: rotate(-3deg); } }
  @keyframes ltf-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.25; } }
}

/* --- Composants divers ---------------------------------------------------------------------- */

.qr-box { display: flex; justify-content: center; padding: var(--space-4); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: var(--space-4); }
.qr-box img { width: 220px; height: 220px; image-rendering: pixelated; }
.secret-key { font-family: var(--mono); font-size: 1rem; letter-spacing: 0.08em; background: var(--bg); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); display: inline-block; }
.codes-list {
  list-style: none; margin: 0 0 var(--space-4); padding: var(--space-4); display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2) var(--space-5); background: var(--bg); border-radius: var(--radius); font-family: var(--mono); font-size: 1.05rem;
}
.copy-row { display: flex; gap: var(--space-2); }
.copy-row input { flex: 1; font-family: var(--mono); font-size: 0.88rem; }

details summary { cursor: pointer; color: var(--navy); font-weight: 650; min-height: 44px; display: flex; align-items: center; gap: var(--space-2); }

@media (max-width: 640px) {
  .card { padding: var(--space-4); border-radius: var(--radius); }
  .codes-list { grid-template-columns: 1fr; }
  td.actions-cell { white-space: normal; text-align: left; }
  h1 { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .sidebar, .mobilebar, .footer, .actions, .no-print { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; border: none; }
}

.after-form { margin-top: var(--space-4); margin-bottom: 0; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* --- Aide contextuelle : bouton « ? » et bulle ------------------------------------------------------
   Toujours à droite du titre de l'écran ou de la section (même place partout : WCAG 2.2, « aide cohérente »). */
.title-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.title-line > h1, .title-line > h2 { margin-bottom: 0; }
.page-header .title-line { margin-bottom: var(--space-1); }
.help-tip { position: relative; display: inline-flex; }
.help-btn {
  position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px; min-height: 0; flex: none; padding: 0; border-radius: 50%; cursor: pointer;
  list-style: none; background: var(--navy-50); color: var(--navy); border: 1.5px solid var(--navy-100);
  font-size: 0.85rem; font-weight: 800; line-height: 1; letter-spacing: 0; text-transform: none; user-select: none;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.help-btn::-webkit-details-marker { display: none; }
.help-btn::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; } /* zone de clic de 44 px */
.help-btn:hover, .help-tip[open] > .help-btn { background: var(--navy); color: #fff; border-color: var(--navy); }
.help-btn:focus-visible { outline: 3px solid var(--focus, #2f5ea8); outline-offset: 2px; }
.help-pop {
  position: absolute; left: -8px; top: calc(100% + 10px); z-index: 60; width: min(360px, calc(100vw - 32px));
  padding: 14px 16px 12px; border-radius: 14px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: 0 18px 40px -16px rgba(20, 35, 70, 0.35);
  font-size: 0.88rem; font-weight: 400; line-height: 1.5; letter-spacing: normal; text-transform: none; text-align: left;
}
.help-pop.is-right { left: auto; right: -8px; }
.help-pop-title { margin: 0 0 2px; font-weight: 750; color: var(--navy); }
.help-pop-sum { margin: 0 0 8px; color: var(--muted); }
.help-pop ul { margin: 0 0 10px; padding-left: 1.1em; }
.help-pop li { margin: 3px 0; }
.help-more { font-weight: 650; font-size: 0.84rem; }
@media (prefers-reduced-motion: no-preference) {
  .help-tip[open] > .help-pop { animation: ltf-help-in 160ms ease-out; }
  @keyframes ltf-help-in { from { opacity: 0; transform: translateY(-4px); } }
}
@media (max-width: 640px) {
  .help-pop, .help-pop.is-right { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; max-height: 70vh; overflow: auto; }
}
.help-corner { position: absolute; top: 12px; right: 12px; }
.recurrence, .visitors { position: relative; }
.legend-tip { display: inline-flex; align-items: center; gap: 6px; }
.help-inline { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--navy-50); color: var(--navy); font-weight: 800; font-size: 0.75rem; }
.nav-help { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border); }

/* --- Page Aide ------------------------------------------------------------------------------------- */
.help-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: var(--space-5, 24px); align-items: start; }
.help-toc { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; padding: var(--space-4); }
.help-toc input { width: 100%; margin: 4px 0 8px; }
.help-toc ul { list-style: none; padding: 0; margin: 0 0 6px; }
.help-toc a { display: block; padding: 6px 8px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 0.86rem; line-height: 1.35; }
.help-toc a:hover { background: var(--navy-50); color: var(--navy); }
.help-toc-cat { margin: 14px 0 4px; font-size: 0.7rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.help-topic { scroll-margin-top: 16px; margin-bottom: var(--space-4); }
.help-topic:target { box-shadow: 0 0 0 2px var(--navy); }
.help-topic h3 { margin: 0 0 4px; font-size: 1.12rem; }
.help-summary { margin: 0 0 10px; color: var(--muted); }
.help-topic h4 { margin: 14px 0 4px; }
.help-list, .help-steps { margin: 4px 0 6px; padding-left: 1.3em; }
.help-list li, .help-steps li { margin: 5px 0; line-height: 1.55; }
.help-steps li::marker { font-weight: 750; color: var(--navy); }
@media (max-width: 900px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-toc { position: static; max-height: none; }
}

/* Logo aux colonnes (09/11/2026) : logo large, réglé en hauteur. */
.brand-crest { width: auto; height: 36px; }
.mobilebar .brand-crest { width: auto; height: 28px; }
.auth-brand img { width: auto; height: 56px; }

/* Logo rond sur les pages de connexion (09/11/2026). */
.auth-brand img.logo-rond { width: 72px; height: 72px; border-radius: 50%; }

/* Logo + nom de l'outil (12/11/2026) — règle commune à tous les outils LTF (comme Compta, Pilot, Studio) : plus de
   « Le Trading Français », seulement le nom de l'outil, en Playfair Display (la plus proche du « LTF » du logo), sur
   UNE ligne, à la hauteur de capitale et sur la ligne de base du « LTF » (logo de 36 px : capitales de 18,4 px, ligne
   de base à 26 px du haut), en noir comme lui. */
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/playfair-display-latin-400-normal.woff2") format("woff2"); }
.brand-side, .mobilebar .brand { align-items: flex-start; gap: 10px; }
.brand-side .brand-txt, .mobilebar .brand-txt { display: block; }
.brand-side .brand-app, .mobilebar .brand-app { display: block; font-family: "Playfair Display", Georgia, serif; font-weight: 400;
  font-size: 26px; line-height: 26px; margin-top: 2px; color: #000; }
.mobilebar .brand-app { font-size: 20px; line-height: 20px; margin-top: 1.5px; }
