/* =====================================================================
   Tsinjorano · Système d'information — feuille de style principale
   ===================================================================== */
:root {
  --green-950: #0f2e18;
  --green-900: #143d21;
  --green-800: #185029;
  --green-700: #1f6b33;
  --green-600: #2a8540;
  --green-500: #3d9d52;
  --green-100: #e5f1e6;
  --green-50:  #f2f8f1;
  --blue-700: #0f5ea3;
  --blue-600: #1677c8;
  --blue-500: #2b8fe0;
  --blue-100: #e2effb;
  --sun: #f0b429;
  --sun-100: #fdf3d8;
  --red: #b83227;
  --red-100: #fbe6e3;
  --orange: #c96d12;
  --orange-100: #fcebd6;
  --ink: #1b2a20;
  --ink-2: #3a4a3f;
  --muted: #67776c;
  --line: #dbe3d8;
  --line-2: #e9eee6;
  --bg: #f4f6f0;
  --card: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 40, 25, .06), 0 4px 16px rgba(20, 40, 25, .06);
  --shadow-lg: 0 10px 40px rgba(20, 40, 25, .16);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15.5px; line-height: 1.55;
  color: var(--ink); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column;
}
.main { flex: 1; padding-bottom: 48px; }
a { color: var(--blue-700); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--blue-600); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--green-900); }
h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0 } .mb0 { margin-bottom: 0 }
.hidden { display: none !important; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 760px; }
.container.wide { max-width: 1440px; }

/* ---------- Barre supérieure ---------- */
.topbar { background: var(--green-900); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.topbar-in { max-width: 1440px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex-shrink: 0; }
.brand img { border-radius: 50%; background: #fff; padding: 2px; }
.brand span { display: flex; flex-wrap: wrap; align-items: baseline; line-height: 1.05; font-size: 1.05rem; letter-spacing: .02em; }
.brand b { font-weight: 800; color: #fff; }
.brand b.blue { color: #7cc2ff; }
.brand small { flex-basis: 100%; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: #b9d6bf; font-weight: 600; }
.brand:hover { color: #fff; }
.mainnav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.mainnav a { color: #d7e9da; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: .93rem; white-space: nowrap; }
.mainnav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.mainnav a.active { background: rgba(255,255,255,.14); color: #fff; }
.mainnav .nav-sep { width: 1px; height: 24px; background: rgba(255,255,255,.18); margin: 0 8px; }
.mainnav .nav-user { display: inline-flex; align-items: center; gap: 8px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--sun); color: var(--green-950); display: inline-grid; place-items: center; font-weight: 800; font-size: .8rem; }
.mainnav .nav-logout { color: #a8c4ad; font-weight: 500; }
.mainnav.public .btn { margin-left: 8px; color: #fff; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; margin: 4px 0; border-radius: 2px; }

@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .mainnav:not(.public) { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--green-900); flex-direction: column; align-items: stretch; padding: 8px 12px 16px; box-shadow: var(--shadow-lg); }
  .nav-open .mainnav { display: flex; }
  .mainnav .nav-sep { width: auto; height: 1px; margin: 6px 0; }
  .mainnav.public a:not(.btn) { display: none; }
}

/* ---------- Titres de page ---------- */
.page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 28px 0 20px; }
.page-title h1 { margin: 0; }
.page-title p { margin: 4px 0 0; }
.page-title .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { font-size: .87rem; margin: 20px 0 -12px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }

/* ---------- Cartes ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card.flat { box-shadow: none; }
.card.pad0 { padding: 0; overflow: hidden; }

/* ---------- Boutons ---------- */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--green-700); background: var(--green-700); color: #fff; font: inherit; font-weight: 700; font-size: .93rem; padding: 9px 16px; border-radius: 9px; cursor: pointer; text-decoration: none; line-height: 1.2; transition: background .15s, box-shadow .15s; }
.btn:hover { background: var(--green-800); color: #fff; }
.btn:focus-visible { outline: 3px solid rgba(22,119,200,.35); outline-offset: 2px; }
.btn-blue { background: var(--blue-600); border-color: var(--blue-600); }
.btn-blue:hover { background: var(--blue-700); }
.btn-ghost { background: #fff; color: var(--green-800); border-color: var(--line); }
.btn-ghost:hover { background: var(--green-50); color: var(--green-900); border-color: #c8d5c5; }
.btn-danger { background: #fff; color: var(--red); border-color: #e7c1bc; }
.btn-danger:hover { background: var(--red-100); color: var(--red); }
.btn-warn { background: var(--orange); border-color: var(--orange); }
.btn-warn:hover { background: #a85a0e; }
.btn-sm { padding: 6px 11px; font-size: .85rem; border-radius: 7px; }
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.badge-grey { background: #eceee9; color: #556058; }
.badge-blue { background: var(--blue-100); color: var(--blue-700); }
.badge-orange { background: var(--orange-100); color: #9a510b; }
.badge-red { background: var(--red-100); color: var(--red); }
.badge-green { background: var(--green-100); color: var(--green-800); }
.badge-teal { background: #d8f0ec; color: #0e6b5e; }
.badge-sun { background: var(--sun-100); color: #8a6100; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--green-50); border: 1px solid var(--line); font-size: .82rem; font-weight: 600; color: var(--ink-2); }

/* ---------- Messages ---------- */
.flashes { margin-top: 16px; }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 12px; font-weight: 500; border: 1px solid; }
.flash-ok { background: var(--green-50); border-color: #bfdcc3; color: var(--green-800); }
.flash-err { background: var(--red-100); border-color: #efc4be; color: #8e231a; }
.flash-warn { background: var(--sun-100); border-color: #f1d98f; color: #6f4f00; }
.flash-info { background: var(--blue-100); border-color: #bcd8f3; color: var(--blue-700); }

/* ---------- Formulaires ---------- */
.form label { display: block; font-weight: 600; font-size: .9rem; color: var(--ink-2); margin-bottom: 14px; }
.form label > input, .form label > select, .form label > textarea { margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=tel], input[type=search], input:not([type]), select, textarea {
  width: 100%; font: inherit; font-weight: 400; color: var(--ink); background: #fff; border: 1px solid #cbd6c8; border-radius: 9px; padding: 10px 12px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(43,143,224,.18); }
.checkbox { display: flex !important; align-items: flex-start; gap: 10px; font-weight: 500 !important; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green-700); flex-shrink: 0; }
.checkgroup { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 6px 0 16px; }
.hint { font-size: .82rem; color: var(--muted); font-weight: 400; margin-top: 3px; display: block; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 18px; }
@media (max-width: 720px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input, .filters select { width: auto; min-width: 160px; padding: 8px 10px; }
.filters input[type=search] { min-width: 240px; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 2px solid var(--line); background: #fafbf8; white-space: nowrap; }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: #fafcf8; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .c { text-align: center; }
table.data .title-cell a { font-weight: 700; color: var(--green-900); text-decoration: none; }
table.data .title-cell a:hover { color: var(--blue-700); text-decoration: underline; }
table.data .sub { display: block; font-size: .82rem; color: var(--muted); }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--green-100); display: block; }
.thumb-ph { width: 44px; height: 44px; border-radius: 8px; background: var(--green-100); display: grid; place-items: center; color: var(--green-700); font-weight: 800; }

/* ---------- Indicateurs ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .v { font-size: 1.9rem; font-weight: 800; color: var(--green-900); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: .84rem; color: var(--muted); font-weight: 600; }
.stat.accent { background: var(--green-800); border-color: var(--green-800); }
.stat.accent .v { color: #fff; } .stat.accent .l { color: #b9d6bf; }
.progress { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-600), var(--blue-500)); border-radius: 999px; }
.progress-label { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-bottom: 4px; }

/* ---------- Dossier (vue détaillée d'un cas) ---------- */
.dossier-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.dossier-layout.single { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1100px) { .dossier-layout { grid-template-columns: 1fr; } }
.sticky-panel { position: sticky; top: 76px; }

.dossier-hero { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: center; background: linear-gradient(135deg, var(--green-900), var(--green-700) 60%, #20618a); color: #fff; border-radius: var(--radius); padding: 24px; margin-bottom: 20px; position: relative; overflow: hidden; }
.dossier-hero::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(124,194,255,.25), transparent 70%); }
.dossier-hero .portrait { width: 200px; height: 200px; border-radius: 14px; object-fit: cover; border: 3px solid rgba(255,255,255,.85); background: rgba(255,255,255,.1); }
.dossier-hero .portrait-ph { width: 200px; height: 200px; border-radius: 14px; background: rgba(255,255,255,.12); display: grid; place-items: center; font-size: 3.4rem; font-weight: 800; }
.dossier-hero h1 { color: #fff; font-size: 1.9rem; margin: 6px 0 4px; }
.dossier-hero .code { font-family: ui-monospace, monospace; font-size: .82rem; background: rgba(255,255,255,.15); padding: 3px 8px; border-radius: 6px; letter-spacing: .04em; }
.dossier-hero .solution-title { font-family: var(--serif); font-size: 1.28rem; line-height: 1.3; color: #fdf3d8; margin: 10px 0 14px; }
.dossier-hero .facts { display: flex; flex-wrap: wrap; gap: 8px; }
.dossier-hero .facts span { background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.18); padding: 4px 10px; border-radius: 999px; font-size: .83rem; font-weight: 600; }
@media (max-width: 640px) { .dossier-hero { grid-template-columns: 1fr; } .dossier-hero .portrait, .dossier-hero .portrait-ph { width: 120px; height: 120px; } }

.section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow); }
.section > h2 { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin-bottom: 14px; }
.section > h2 .n { width: 28px; height: 28px; border-radius: 8px; background: var(--green-100); color: var(--green-800); display: inline-grid; place-items: center; font-size: .85rem; font-weight: 800; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 20px; }
.kv div { min-width: 0; }
.kv dt, .kv .k { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.kv dd, .kv .v { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.prose { font-size: 1rem; line-height: 1.7; color: var(--ink); }
.prose p:last-child { margin-bottom: 0; }
.qa { border-left: 3px solid var(--green-500); padding: 2px 0 2px 16px; margin: 0 0 18px; }
.qa:last-child { margin-bottom: 0; }
.qa h3 { font-size: .98rem; margin: 0 0 2px; }
.qa .q { font-size: .83rem; color: var(--muted); font-style: italic; margin-bottom: 6px; }
.qa.empty { border-left-color: var(--line); }
.qa.empty .a { color: var(--muted); font-style: italic; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); background: #fbfcfa; }
.checklist .ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex-shrink: 0; }
.checklist .yes .ic { background: var(--green-600); color: #fff; }
.checklist .no .ic { background: var(--red); color: #fff; }
.checklist .na .ic { background: #e1e5df; color: #7a857d; }
.checklist b { display: block; font-size: .92rem; }
.checklist small { color: var(--muted); font-size: .8rem; line-height: 1.35; display: block; }

.warnings { list-style: none; padding: 0; margin: 0; }
.warnings li { padding: 7px 0 7px 26px; position: relative; font-size: .92rem; border-bottom: 1px dashed var(--line); }
.warnings li:last-child { border-bottom: 0; }
.warnings li::before { content: "!"; position: absolute; left: 0; top: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--sun); color: var(--green-950); font-weight: 800; font-size: .75rem; display: grid; place-items: center; }

/* Galerie */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gallery figure { margin: 0; border-radius: 10px; overflow: hidden; background: #eef2ec; border: 1px solid var(--line); position: relative; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; cursor: zoom-in; transition: transform .25s; }
.gallery figure:hover img { transform: scale(1.03); }
.gallery figcaption { padding: 7px 10px; font-size: .8rem; color: var(--ink-2); line-height: 1.35; background: #fff; }
.gallery figcaption b { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--green-700); }
.gallery .priv { position: absolute; top: 8px; left: 8px; }
.media-list { display: grid; gap: 12px; }
.media-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fbfcfa; }
.media-item .mh { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.media-item .mh b { font-size: .92rem; }
.media-item audio { width: 100%; }
.media-item video { width: 100%; max-height: 420px; border-radius: 8px; background: #000; }
.media-item .transcription { font-size: .9rem; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; margin-top: 8px; white-space: pre-wrap; }

/* Visionneuse */
.lightbox { position: fixed; inset: 0; background: rgba(8, 20, 12, .92); z-index: 200; display: none; align-items: center; justify-content: center; flex-direction: column; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lightbox .cap { color: #e6efe7; margin-top: 12px; text-align: center; max-width: 800px; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); border: 0; color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.25); }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 16px; top: 50%; }
.lightbox .lb-next { right: 16px; top: 50%; }

.map { height: 280px; border-radius: 10px; border: 1px solid var(--line); z-index: 1; }
.map.tall { height: 460px; }

/* ---------- Grille de notation ---------- */
.score-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.score-panel .sp-head { background: var(--green-900); color: #fff; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; }
.score-panel .sp-head h2 { color: #fff; margin: 0; font-size: 1.02rem; }
.score-panel .sp-body { padding: 16px 18px; max-height: calc(100vh - 220px); overflow-y: auto; }
.score-panel .sp-foot { padding: 12px 18px; border-top: 1px solid var(--line); background: #fafbf8; }
.crit { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.crit:last-of-type { border-bottom: 0; }
.crit .ct { font-weight: 700; font-size: .93rem; color: var(--green-900); }
.crit .cd { font-size: .8rem; color: var(--muted); line-height: 1.35; margin: 2px 0 8px; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale label { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1.5px solid #cfd9cc; border-radius: 9px; padding: 6px 0 5px; cursor: pointer; background: #fff; transition: all .12s; user-select: none; }
.scale label b { font-size: 1.1rem; line-height: 1.1; color: var(--ink-2); }
.scale label small { font-size: .56rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0; font-weight: 700; }
.scale label:hover { border-color: var(--green-500); background: var(--green-50); }
.scale input:checked + label { background: var(--green-700); border-color: var(--green-700); }
.scale input:checked + label b, .scale input:checked + label small { color: #fff; }
.scale input:focus-visible + label { outline: 3px solid rgba(22,119,200,.35); }
.score-total { display: flex; align-items: baseline; justify-content: space-between; margin: 10px 0 12px; }
.score-total .big { font-size: 2rem; font-weight: 800; color: var(--green-800); font-variant-numeric: tabular-nums; }
.score-total .big small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.saved-at { font-size: .78rem; color: var(--muted); }

/* Classement */
.rank { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-weight: 800; background: var(--line-2); color: var(--ink-2); }
.rank.r1 { background: #f3c443; color: #4d3700; }
.rank.r2 { background: #d5dbe0; color: #3a434a; }
.rank.r3 { background: #e0a878; color: #4b2a0d; }
.bar { height: 6px; background: var(--line-2); border-radius: 999px; overflow: hidden; min-width: 70px; }
.bar > span { display: block; height: 100%; background: var(--green-600); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: inline-block; }
.dots i.on { background: var(--green-600); }
.dots i.cf { background: var(--orange); }

/* Liste de cas (jury / savoir) */
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.case-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.case-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: inherit; }
.case-card .cc-img { aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--green-100), var(--blue-100)); position: relative; overflow: hidden; }
.case-card .cc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.case-card .cc-img .badge { position: absolute; top: 10px; left: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.case-card .cc-img .cc-code { position: absolute; top: 10px; right: 10px; background: rgba(15,46,24,.75); color: #fff; font-size: .74rem; padding: 3px 8px; border-radius: 6px; font-family: ui-monospace, monospace; }
.case-card .cc-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.case-card h3 { margin: 0 0 2px; font-size: 1.04rem; }
.case-card .cc-sol { font-family: var(--serif); font-size: .98rem; color: var(--ink-2); line-height: 1.35; margin: 6px 0 10px; }
.case-card .cc-meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; font-size: .8rem; color: var(--muted); }
.case-card .cc-foot { border-top: 1px solid var(--line-2); padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; font-size: .85rem; background: #fafbf8; }

/* ---------- Authentification ---------- */
.auth-wrap { min-height: calc(100vh - 200px); display: grid; place-items: center; padding: 30px 16px; background: radial-gradient(circle at 20% 10%, rgba(43,143,224,.10), transparent 40%), radial-gradient(circle at 80% 90%, rgba(61,157,82,.12), transparent 40%); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; padding: 30px 28px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.auth-logo { width: 92px; display: block; margin: 0 auto 10px; }
.auth-card h1 { text-align: center; font-size: 1.45rem; }
.auth-card > p.muted { text-align: center; font-size: .9rem; }

/* Installation */
.install { padding: 30px 0; }
.install-head { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.install-head h1 { margin: 0; }
.checks { list-style: none; padding: 0; margin: 0; columns: 2; }
.checks li { padding: 3px 0; }
.checks .ok { color: var(--green-700); } .checks .ko { color: var(--red); font-weight: 700; }

/* ---------- Pied de page ---------- */
.footer { background: var(--green-950); color: #a9c3ae; font-size: .87rem; padding: 18px 0; }
.footer a { color: #d3e7d6; }
.footer-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Divers ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 700; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; font-size: .93rem; }
.tabs a.active { color: var(--green-800); border-bottom-color: var(--green-700); }
.tabs a .badge { margin-left: 4px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .big { font-size: 2.6rem; }
.inline-form { display: inline; }
.side-actions { display: grid; gap: 10px; }
.side-actions form { margin: 0; }
details.box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fbfcfa; margin-bottom: 12px; }
details.box summary { cursor: pointer; font-weight: 700; color: var(--green-800); }
.kbd { font-family: ui-monospace, monospace; background: var(--line-2); padding: 1px 6px; border-radius: 4px; font-size: .85em; }
.note-agent { display: flex; gap: 16px; align-items: center; }
.note-agent .circle { width: 74px; height: 74px; border-radius: 50%; background: conic-gradient(var(--blue-600) calc(var(--p) * 1%), var(--line-2) 0); display: grid; place-items: center; flex-shrink: 0; }
.note-agent .circle span { width: 58px; height: 58px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; color: var(--blue-700); }

/* =====================================================================
   Site public
   ===================================================================== */
.hero { position: relative; color: #fff; background: var(--green-900); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(ellipse at 85% 20%, rgba(124,194,255,.35), transparent 45%),
  radial-gradient(ellipse at 10% 100%, rgba(240,180,41,.22), transparent 50%),
  linear-gradient(160deg, var(--green-900), var(--green-700) 55%, #145a87); }
.hero-in { position: relative; max-width: 1240px; margin: 0 auto; padding: 64px 20px 72px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.hero h1 { color: #fff; font-family: var(--serif); font-weight: 700; font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.08; letter-spacing: -.01em; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: #9fd2ff; }
.hero p.lead { font-size: 1.14rem; color: #dcecdf; max-width: 620px; }
.hero .kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 800; color: var(--sun); margin-bottom: 14px; }
.hero-emblem { justify-self: center; width: min(320px, 80%); aspect-ratio: 1; border-radius: 50%; background: #fff; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.hero-stats { display: flex; gap: 28px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats div b { display: block; font-size: 2rem; font-weight: 800; color: #fff; line-height: 1; }
.hero-stats div span { font-size: .84rem; color: #b9d6bf; font-weight: 600; }
.wave { display: block; width: 100%; height: 40px; margin-top: -1px; }
@media (max-width: 860px) { .hero-in { grid-template-columns: 1fr; padding: 40px 20px 50px; } .hero-emblem { display: none; } }
.section-title { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 40px 0 18px; flex-wrap: wrap; }
.section-title h2 { font-family: var(--serif); font-size: 1.8rem; margin: 0; }
.section-title p { margin: 4px 0 0; color: var(--muted); }

/* Page d'un cas public */
.story-hero { position: relative; min-height: 380px; display: flex; align-items: flex-end; color: #fff; background: var(--green-900); overflow: hidden; }
.story-hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.story-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,46,24,.1), rgba(15,46,24,.85)); }
.story-hero .in { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 50px 20px 36px; width: 100%; }
.story-hero h1 { color: #fff; font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.12; margin: 10px 0 12px; }
.story-hero .who { font-size: 1.05rem; color: #dcecdf; }
.story-body { max-width: 900px; margin: 0 auto; padding: 0 20px; }
.story-body .chapeau { font-family: var(--serif); font-size: 1.28rem; line-height: 1.55; color: var(--green-900); margin: 32px 0 26px; }
.story-body blockquote { margin: 28px 0; padding: 18px 24px; border-left: 4px solid var(--sun); background: var(--sun-100); font-family: var(--serif); font-size: 1.15rem; border-radius: 0 10px 10px 0; color: var(--green-950); }
.story-body h2 { font-family: var(--serif); font-size: 1.45rem; margin-top: 34px; }
.story-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 26px 0; }
.story-facts > div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.story-facts .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.story-facts .v { font-weight: 700; color: var(--green-900); }

@media print {
  .topbar, .footer, .no-print, .sticky-panel, .btn { display: none !important; }
  body { background: #fff; }
  .card, .section { box-shadow: none; break-inside: avoid; }
}

@media (max-width: 520px) {
  .topbar-in { padding: 0 14px; gap: 10px; }
  .brand small { display: none; }
  .brand { flex-shrink: 1; min-width: 0; }
  .container { padding: 0 14px; }
  .card, .section { padding: 18px 16px; }
  .page-title h1 { font-size: 1.4rem; }
}
