/* ══════════════════════════════════════════════════════════════════
   CHARLY BINÔMIA — DESIGN SYSTEM APPLICATIF
   Charte : Guide des fondamentaux Charly 2021 (deux bleus, ronds,
   General Sans). Version application : dense, calme, précise.
   ══════════════════════════════════════════════════════════════════ */

@font-face { font-family: 'General Sans'; src: url('/static/fonts/GeneralSans-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'General Sans'; src: url('/static/fonts/GeneralSans-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'General Sans'; src: url('/static/fonts/GeneralSans-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'General Sans'; src: url('/static/fonts/GeneralSans-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  /* Couleurs de la charte */
  --indigo: #3514c7;
  --indigo-deep: #250d92;
  --indigo-night: #180a52;
  --indigo-soft: #ecebfb;
  --indigo-tint: #f4f3fd;
  --blue: #0f9cd8;
  --blue-text: #0a7aa8;
  --blue-soft: #e6f4fb;
  --aqua: #00bd9f;
  --aqua-text: #067a68;
  --aqua-soft: #e3f7f3;
  --orange: #fc5b47;
  --orange-text: #c8392a;
  --orange-soft: #ffe9e5;
  --yellow: #fec200;
  --yellow-text: #8a6500;
  --yellow-soft: #fff4cc;
  /* Neutres teintés, jamais de blanc ni de noir purs */
  --ink: #1c1440;
  --ink-2: #3a3260;
  --muted: #625d7e;
  --muted-2: #8f8aa8;
  --paper: #fdfcfa;
  --paper-2: #f5f3ef;
  --line: #e8e4dd;
  --line-2: #f0ede7;
  --white: #fffefb;
  /* Typo, rythme, mouvement */
  --font: 'General Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --sidebar: 248px;
  --content: 1180px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --shadow-card: 0 1px 2px rgba(28, 20, 64, 0.04), 0 10px 28px -14px rgba(28, 20, 64, 0.14);
  --shadow-lift: 0 2px 4px rgba(28, 20, 64, 0.06), 0 24px 48px -16px rgba(28, 20, 64, 0.22);
  --shadow-pop: 0 12px 40px -8px rgba(28, 20, 64, 0.28);
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { text-wrap: pretty; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.tiny { font-size: 0.8rem; }
.mono { font-family: var(--mono); font-size: 0.85em; }
.dot { color: var(--blue); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
code, pre { font-family: var(--mono); }
pre { white-space: pre-wrap; word-break: break-word; }
strong { font-weight: 600; }

/* ── Kicker : « le point Charly » ───────────────────────────────── */
.kicker {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--indigo);
}
.kicker::before { content: ''; width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--blue); flex: none; }
.kicker.is-muted { color: var(--muted); }
.kicker.is-muted::before { background: var(--muted-2); }

/* ── Coquille : sidebar + contenu ──────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100dvh; }
.scrim { display: none; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  background: var(--white); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 1.25rem 1rem;
  gap: 1.25rem;
}
.brand { display: flex; align-items: center; gap: 0.7rem; padding: 0.25rem 0.5rem; }
.brand img { height: 36px; width: auto; }
.brand .brand-name { font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }
.brand .brand-name small { display: block; font-weight: 500; font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; }
.nav { display: flex; flex-direction: column; gap: 0.15rem; }
.nav-section { margin-top: 0.75rem; padding: 0.5rem 0.75rem 0.25rem; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.nav a {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.75rem; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 500; text-decoration: none;
  transition: background 0.18s var(--ease-out), color 0.18s var(--ease-out);
}
.nav a:hover { background: var(--paper-2); text-decoration: none; color: var(--ink); }
.nav a.is-active { background: var(--indigo-soft); color: var(--indigo); }
.nav a .ico { width: 20px; height: 20px; flex: none; opacity: 0.85; }
.nav a .count { margin-left: auto; font-size: 0.72rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--orange-soft); color: var(--orange-text); }
.nav a .count.is-neutral { background: var(--paper-2); color: var(--muted); }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 1rem; }
.user-chip { display: flex; align-items: center; gap: 0.65rem; padding: 0.4rem 0.5rem; border-radius: var(--radius-sm); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--indigo); color: var(--white); font-weight: 600; font-size: 0.85rem;
  display: grid; place-items: center; letter-spacing: 0.02em;
}
.avatar.is-blue { background: var(--blue); }
.user-chip .who { line-height: 1.15; min-width: 0; }
.user-chip .who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { font-size: 0.75rem; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem; padding: 0.85rem 2rem;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line-2);
}
.topbar h1 { font-size: 1.2rem; }
.topbar .spacer { flex: 1; }
.burger { display: none; }
.content { padding: 1.75rem 2rem 4rem; max-width: var(--content); width: 100%; margin-inline: auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.85rem; }
.page-head .lead { color: var(--muted); margin-top: 0.35rem; max-width: 62ch; }
.page-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ── Bandeau « voir comme » et alertes ─────────────────────────── */
.banner {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 2rem;
  background: var(--yellow-soft); color: var(--yellow-text); font-weight: 500; border-bottom: 1px solid #f3dc8a;
}
.banner.is-indigo { background: var(--indigo); color: var(--white); border-color: var(--indigo-deep); }
.banner.is-orange { background: var(--orange-soft); color: var(--orange-text); border-color: #f7c2b9; }
.banner form { margin-left: auto; }
.alert { padding: 0.85rem 1rem; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 1rem; display: flex; gap: 0.75rem; align-items: flex-start; }
.alert.is-info { background: var(--blue-soft); border-color: #bfe3f5; color: var(--blue-text); }
.alert.is-ok { background: var(--aqua-soft); border-color: #b6ebe0; color: var(--aqua-text); }
.alert.is-warn { background: var(--yellow-soft); border-color: #f3dc8a; color: var(--yellow-text); }
.alert.is-danger { background: var(--orange-soft); border-color: #f7c2b9; color: var(--orange-text); }
.alert p { margin: 0; }

/* ── Toasts (messages flash) ───────────────────────────────────── */
.toasts { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 60; display: flex; flex-direction: column; gap: 0.5rem; max-width: min(420px, calc(100vw - 2.5rem)); }
.toast {
  padding: 0.8rem 1rem; border-radius: var(--radius-sm); background: var(--ink); color: var(--white);
  box-shadow: var(--shadow-pop); font-weight: 500; display: flex; gap: 0.6rem; align-items: center;
  animation: toast-in 0.45s var(--ease-out);
}
.toast.is-ok { background: var(--aqua-text); }
.toast.is-danger { background: var(--orange-text); }
.toast.is-warn { background: var(--yellow-text); }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; opacity: 0.7; cursor: pointer; font-size: 1.1rem; line-height: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── Cartes ───────────────────────────────────────────────────── */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 1.25rem 1.35rem; min-width: 0;
}
.card.is-flush { padding: 0; overflow: hidden; }
.card.is-indigo { background: var(--indigo); color: var(--white); border-color: var(--indigo-deep); }
.card.is-indigo .kicker { color: var(--white); }
.card.is-indigo .muted { color: rgba(255, 254, 251, 0.72); }
.card.is-soft { background: var(--indigo-tint); border-color: #ddd9f6; box-shadow: none; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.card-head h2, .card-head h3 { margin-top: 0.2rem; }
.card-head .actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.card-foot { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid > *, .layout > *, .stack > * { min-width: 0; }
/* Page « principal + latéral » : le contenu garde la largeur, le latéral fait 340 px, puis tout passe en colonne. */
.layout { display: grid; gap: 1.1rem; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.layout.is-aside-first { grid-template-columns: 300px minmax(0, 1fr); }
.layout.is-wide-aside { grid-template-columns: minmax(0, 1fr) 380px; }
.grid.is-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.grid.is-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.row.is-between { justify-content: space-between; }

/* ── Chiffres clés ────────────────────────────────────────────── */
.stat { display: flex; flex-direction: column; gap: 0.15rem; }
.stat .value { font-size: 1.9rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1; color: var(--indigo); }
.stat .value.is-ink { color: var(--ink); }
.stat .value.is-orange { color: var(--orange-text); }
.stat .value.is-aqua { color: var(--aqua-text); }
.stat .label { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }

/* ── Listes éditoriales (« .rules ») ──────────────────────────── */
.rules { list-style: none; padding: 0; }
.rules > li { display: grid; grid-template-columns: auto 1fr auto; gap: 0.9rem; align-items: start; padding: 0.85rem 0; border-top: 1px solid var(--line-2); }
.rules > li:first-child { border-top: 0; padding-top: 0; }
.rules > li:last-child { padding-bottom: 0; }
.rules .body { min-width: 0; }
.rules .body b { font-weight: 600; }
.rules .body .sub { color: var(--muted); font-size: 0.875rem; margin-top: 0.1rem; }
.rules .side { text-align: right; white-space: nowrap; }
.num {
  min-width: 28px; height: 28px; padding: 0 0.45rem; border-radius: 999px; flex: none;
  display: grid; place-items: center; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
  background: var(--indigo-soft); color: var(--indigo); white-space: nowrap;
}
.num.is-1 { background: var(--orange-soft); color: var(--orange-text); }
.num.is-2 { background: var(--yellow-soft); color: var(--yellow-text); }
.num.is-3 { background: var(--blue-soft); color: var(--blue-text); }
.num.is-ok { background: var(--aqua-soft); color: var(--aqua-text); }
.num.is-plain { background: var(--paper-2); color: var(--muted); }

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 0.35em; padding: 0.18rem 0.6rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
  background: var(--paper-2); color: var(--muted);
}
.badge::before { content: ''; width: 0.45em; height: 0.45em; border-radius: 50%; background: currentColor; opacity: 0.8; }
.badge.is-indigo { background: var(--indigo-soft); color: var(--indigo); }
.badge.is-blue { background: var(--blue-soft); color: var(--blue-text); }
.badge.is-ok { background: var(--aqua-soft); color: var(--aqua-text); }
.badge.is-warn { background: var(--yellow-soft); color: var(--yellow-text); }
.badge.is-danger { background: var(--orange-soft); color: var(--orange-text); }
.badge.is-plain::before { display: none; }

/* ── Boutons (pilules) ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.55rem 1.05rem; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.9rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--indigo); color: var(--white);
  transition: transform 0.16s var(--ease-out), background 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}
.btn:hover { background: var(--indigo-deep); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn.is-secondary { background: var(--white); color: var(--indigo); border-color: var(--line); }
.btn.is-secondary:hover { background: var(--indigo-tint); border-color: #ddd9f6; }
.btn.is-ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn.is-ghost:hover { background: var(--paper-2); }
.btn.is-blue { background: var(--blue); }
.btn.is-blue:hover { background: var(--blue-text); }
.btn.is-danger { background: var(--orange); }
.btn.is-danger:hover { background: var(--orange-text); }
.btn.is-small { padding: 0.35rem 0.8rem; font-size: 0.82rem; }
.btn.is-large { padding: 0.75rem 1.4rem; font-size: 1rem; }
.btn[disabled], .btn.is-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn .ico { width: 16px; height: 16px; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: var(--white); animation: spin 0.8s linear infinite;
}
.btn.is-secondary.is-loading::after { border-color: rgba(53, 20, 199, 0.25); border-top-color: var(--indigo); }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-group { display: inline-flex; gap: 0.4rem; flex-wrap: wrap; }

/* ── Formulaires ─────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.field label, .label { font-weight: 600; font-size: 0.875rem; color: var(--ink-2); }
.field .help { font-size: 0.8rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white); color: var(--ink); transition: border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
.textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.textarea.is-code { font-family: var(--mono); font-size: 0.85rem; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23625d7e' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.7rem center; padding-right: 2.2rem; }
.form-grid { display: grid; gap: 0 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.check { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--indigo); flex: none; }
.radio-cards { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.radio-card { position: relative; }
.radio-card input { position: absolute; opacity: 0; inset: 0; }
.radio-card label { display: block; padding: 0.8rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: var(--white); transition: border-color 0.18s, background 0.18s; }
.radio-card label b { display: block; font-weight: 600; }
.radio-card label span { font-size: 0.8rem; color: var(--muted); }
.radio-card input:checked + label { border-color: var(--indigo); background: var(--indigo-tint); box-shadow: 0 0 0 3px var(--indigo-soft); }
.radio-card input:focus-visible + label { outline: 3px solid var(--blue); }
.dropzone {
  border: 1.5px dashed #ccc7f0; border-radius: var(--radius); padding: 1.6rem; text-align: center; background: var(--indigo-tint);
  transition: border-color 0.18s, background 0.18s; cursor: pointer;
}
.dropzone.is-over { border-color: var(--indigo); background: var(--indigo-soft); }
.dropzone input { display: none; }
.dropzone .files { margin-top: 0.6rem; font-size: 0.85rem; color: var(--indigo); font-weight: 500; }

/* ── Réglages expliqués ─────────────────────────────────────── */
.setting { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem 1.5rem; align-items: center; padding: 0.8rem 0; border-top: 1px solid var(--line-2); }
.setting:first-of-type { border-top: 0; }
.setting-text b { font-weight: 600; }
.setting-text p { font-size: 0.85rem; color: var(--muted); margin-top: 0.15rem; max-width: 70ch; }
.setting .input { width: 150px; }
.legend { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: var(--ink-2); padding: 0.75rem 0.9rem; background: var(--paper-2); border-radius: var(--radius-sm); }
.legend b { font-weight: 600; }
.tabs .count { font-size: 0.7rem; font-weight: 600; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--orange-soft); color: var(--orange-text); margin-left: 0.3rem; }
.table tr.is-warn td { background: var(--yellow-soft); }

/* ── Tableaux ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--indigo-tint); }
.table .num-col { text-align: right; font-variant-numeric: tabular-nums; }
.table.is-compact td, .table.is-compact th { padding: 0.4rem 0.6rem; }
.card.is-flush .table th:first-child, .card.is-flush .table td:first-child { padding-left: 1.25rem; }
.card.is-flush .table th:last-child, .card.is-flush .table td:last-child { padding-right: 1.25rem; }

/* ── Onglets ─────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a, .tabs button { padding: 0.6rem 0.9rem; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 0.9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.tabs a.is-active, .tabs button.is-active { color: var(--indigo); border-bottom-color: var(--indigo); }
.tabs a:hover { color: var(--ink); text-decoration: none; }

/* ── Preuves §NNN et passages ────────────────────────────────── */
.proof {
  display: inline-block; font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  padding: 0.05rem 0.4rem; border-radius: 6px; background: var(--blue-soft); color: var(--blue-text);
  cursor: pointer; border: 1px solid #c7e6f5; margin: 0 0.1rem; text-decoration: none;
}
.proof:hover { background: var(--blue); color: var(--white); text-decoration: none; }
.passage { border-left: 3px solid var(--blue); padding: 0.5rem 0.9rem; background: var(--paper-2); border-radius: 0 var(--radius-xs) var(--radius-xs) 0; margin: 0.4rem 0; font-size: 0.9rem; }
.passage .who { font-weight: 600; color: var(--indigo); font-size: 0.8rem; }
.passage .ts { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); margin-right: 0.4rem; }
.statut { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.1rem 0.45rem; border-radius: 6px; }
.statut.dit { background: var(--aqua-soft); color: var(--aqua-text); }
.statut.deduit { background: var(--yellow-soft); color: var(--yellow-text); }
.statut.absent { background: var(--orange-soft); color: var(--orange-text); }
.rubrique { padding: 0.75rem 0; border-top: 1px solid var(--line-2); }
.rubrique:first-child { border-top: 0; }
.rubrique .rubrique-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.25rem; }
.rubrique .rubrique-head b { font-weight: 600; }
.rubrique .rubrique-val { color: var(--ink-2); }
.rubrique .rubrique-val.is-absent { color: var(--muted-2); font-style: italic; }
.rubrique textarea { margin-top: 0.4rem; }
.section-title { display: flex; align-items: center; gap: 0.75rem; margin: 1.5rem 0 0.75rem; }
.section-title h2 { font-size: 1.05rem; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ── Progression, jauges ─────────────────────────────────────── */
.meter { height: 8px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--indigo); transition: width 0.6s var(--ease-out); }
.meter.is-warn > span { background: var(--yellow); }
.meter.is-danger > span { background: var(--orange); }
.meter.is-ok > span { background: var(--aqua); }
.quota { display: flex; flex-direction: column; gap: 0.35rem; }
.quota .row { justify-content: space-between; font-size: 0.875rem; }
.quota .row b { font-weight: 600; }

/* ── Étapes / frise ──────────────────────────────────────────── */
.steps { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.step { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.7rem 0.35rem 0.4rem; border-radius: 999px; background: var(--paper-2); font-size: 0.82rem; font-weight: 500; color: var(--muted); }
.step .num { width: 22px; height: 22px; font-size: 0.72rem; }
.step.is-done { background: var(--aqua-soft); color: var(--aqua-text); }
.step.is-done .num { background: var(--aqua); color: var(--white); }
.step.is-current { background: var(--indigo-soft); color: var(--indigo); }
.step.is-current .num { background: var(--indigo); color: var(--white); }

/* ── États vides et décor (les ronds) ────────────────────────── */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); position: relative; }
.empty h3 { color: var(--ink); margin-bottom: 0.3rem; }
.empty .rings { width: 72px; height: 72px; margin: 0 auto 1rem; position: relative; }
.rings::before, .rings::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--indigo-soft); }
.rings::after { inset: 18%; border-color: var(--blue-soft); }
.rings span { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--blue); left: 50%; top: 50%; transform: translate(-50%, -50%); }

/* ── Timeline (journal, historique) ──────────────────────────── */
.timeline { list-style: none; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 1rem 1.6rem; }
.timeline li::before { content: ''; position: absolute; left: 2px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--blue); border: 2px solid var(--white); box-shadow: 0 0 0 2px var(--blue-soft); }
.timeline li .when { font-size: 0.78rem; color: var(--muted); font-family: var(--mono); }

/* ── Page de connexion ───────────────────────────────────────── */
.login-page { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-side { background: var(--indigo); color: var(--white); padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-side .big { font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; max-width: 14ch; }
.login-side .rings-deco { position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; opacity: 0.35; }
.login-side .rings-deco::before, .login-side .rings-deco::after { border-color: rgba(255, 254, 251, 0.5); }
.login-side .rings-deco span { width: 40px; height: 40px; }
.login-side ul { list-style: none; padding: 0; margin-top: 2rem; display: flex; flex-direction: column; gap: 0.6rem; }
.login-side li { display: flex; gap: 0.7rem; align-items: baseline; color: rgba(255, 254, 251, 0.85); }
.login-side li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex: none; transform: translateY(-2px); }
.login-form { display: grid; place-items: center; padding: 2rem; background: var(--paper); }
.login-card { width: min(420px, 100%); }
.login-card .logo { height: 44px; margin-bottom: 1.5rem; }
.btn-google { width: 100%; justify-content: center; gap: 0.7rem; background: var(--white); color: var(--ink); border-color: var(--line); padding: 0.75rem 1rem; font-size: 0.95rem; }
.btn-google:hover { background: var(--paper-2); }

/* ── Menus / sélecteur de vue ────────────────────────────────── */
.segment { display: inline-flex; background: var(--paper-2); border-radius: 999px; padding: 3px; }
.segment a, .segment button { padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: var(--muted); text-decoration: none; border: 0; background: none; cursor: pointer; }
.segment .is-active { background: var(--white); color: var(--indigo); box-shadow: var(--shadow-card); }

/* ── Divers ──────────────────────────────────────────────────── */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; font-size: 0.9rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; }
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.note { font-size: 0.85rem; color: var(--muted); }
.reveal { animation: reveal 0.5s var(--ease-out) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.rendered { overflow-wrap: anywhere; }
.rendered h1, .rendered h2, .rendered h3 { margin: 1.2rem 0 0.5rem; color: var(--indigo); }
.rendered h1 { font-size: 1.35rem; }
.rendered h2 { font-size: 1.1rem; }
.rendered h3 { font-size: 1rem; }
.rendered p { margin: 0.5rem 0; }
.rendered ul, .rendered ol { margin: 0.4rem 0 0.6rem 1.25rem; }
.rendered li { margin: 0.15rem 0; }
.rendered li::marker { color: var(--blue); }
.rendered table { border-collapse: collapse; font-size: 0.9rem; margin: 0.5rem 0; display: block; max-width: 100%; overflow-x: auto; }
.rendered td, .rendered th { border: 1px solid var(--line); padding: 0.35rem 0.6rem; }
details.fold summary { cursor: pointer; font-weight: 600; color: var(--indigo); list-style: none; display: inline-flex; align-items: center; gap: 0.4rem; }
details.fold summary::before { content: ''; width: 0; height: 0; border: 5px solid transparent; border-left-color: currentColor; transition: transform 0.2s; }
details.fold[open] summary::before { transform: rotate(90deg); }
.spinner { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--indigo-soft); border-top-color: var(--indigo); animation: spin 0.9s linear infinite; }
.steps-v { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-direction: column; gap: 0.15rem; }
.steps-v li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 0.6rem; align-items: start; padding: 0.45rem 0; color: var(--muted-2); }
.steps-v li::before { content: ''; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); margin: 5px 0 0 3px; background: var(--white); }
.steps-v li b, .steps-v li span { grid-column: 2; }
.steps-v li b { display: block; font-weight: 600; color: inherit; }
.steps-v li span { font-size: 0.85rem; }
.steps-v li.is-done { color: var(--muted); }
.steps-v li.is-done::before { background: var(--aqua); border-color: var(--aqua); }
.steps-v li.is-current { color: var(--ink); }
.steps-v li.is-current::before { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px var(--blue-soft); } 50% { box-shadow: 0 0 0 7px var(--blue-soft); } }
.progress-box { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; border-radius: var(--radius); background: var(--indigo-tint); border: 1px solid #ddd9f6; }
.popover { position: absolute; z-index: 50; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); padding: 0.75rem 0.9rem; max-width: min(520px, 90vw); font-size: 0.875rem; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .layout, .layout.is-aside-first, .layout.is-wide-aside { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 84vw); transform: translateX(-100%); transition: transform 0.3s var(--ease-out); z-index: 40; box-shadow: var(--shadow-pop); }
  .sidebar.is-open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(28, 20, 64, 0.35); z-index: 35; display: none; }
  .scrim.is-open { display: block; }
  .burger { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); cursor: pointer; }
  .topbar { padding: 0.7rem 1rem; }
  .content { padding: 1.25rem 1rem 4rem; }
  .banner { padding: 0.6rem 1rem; }
  .login-page { grid-template-columns: 1fr; }
  .login-side { padding: 2rem 1.25rem; min-height: 38vh; }
  .login-side ul { display: none; }
  .page-head h1 { font-size: 1.5rem; }
  .rules > li { grid-template-columns: auto 1fr; }
  .setting { grid-template-columns: 1fr; }
  .setting .input { width: 100%; max-width: none !important; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .kv { grid-template-columns: 1fr; gap: 0.1rem 0; }
  .kv dd { margin-bottom: 0.4rem; }
  .rules .side { grid-column: 2; text-align: left; white-space: normal; display: flex; gap: 0.6rem; align-items: center; }
}
@media (hover: hover) {
  .card.is-link:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
  .card.is-link { transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media print {
  .sidebar, .topbar, .toasts, .page-actions, .banner { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; }
}
