/* Isc VeriScientia — identité visuelle inspirée du blason de l'ISC Matadi :
   cadre noir, champ jaune, pont bleu, fleuve lilas. */
:root {
  --ink: #141414;
  --ink-2: #2a2a2a;
  --paper: #f8f6ef;
  --surface: #ffffff;
  --line: #e4e0d4;
  --line-strong: #cfc9b8;
  --muted: #625e55;
  --yellow: #f4e400;
  --yellow-soft: #fff8bf;
  --blue: #2557d6;
  --blue-dark: #1b43a8;
  --blue-soft: #e8eefc;
  --lilac: #b49ae8;
  --lilac-soft: #f2edfc;
  --ok: #1f7a4d;
  --ok-soft: #e4f3ea;
  --warn: #9a6400;
  --warn-soft: #fdf1d8;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .06), 0 4px 16px rgba(20, 20, 20, .05);
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sidebar: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-family: var(--serif); font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 .6em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- démarrage ---------- */
.boot-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }

/* ---------- connexion ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-brand { background: var(--ink); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: linear-gradient(90deg, var(--yellow) 0 50%, var(--blue) 50% 75%, var(--lilac) 75%); }
.auth-brand .crest { width: 120px; height: 120px; background: #fff; border-radius: 16px; padding: 8px; }
.auth-brand h1 { font-size: 44px; margin-top: 28px; }
.auth-brand .tagline { font-size: 18px; color: #d8d4c8; max-width: 30ch; margin-top: 10px; }
.auth-brand ul { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 12px; color: #e9e6dc; }
.auth-brand li { display: flex; gap: 10px; align-items: baseline; }
.auth-brand li::before { content: ""; flex: 0 0 8px; height: 8px; background: var(--yellow); border-radius: 2px; transform: translateY(-1px); }
.auth-brand .motto { font-family: var(--serif); font-style: italic; color: #a9a59a; font-size: 14px; }
.auth-form { display: grid; place-content: center; padding: 40px 24px; }
.auth-card { width: min(400px, 100%); }
.auth-card h2 { font-family: var(--serif); font-size: 26px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 24px; }

/* ---------- structure ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--ink); color: #e8e5dc; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; border-bottom: 4px solid var(--yellow); }
.brand img { width: 44px; height: 44px; background: #fff; border-radius: 8px; padding: 3px; flex: none; }
.brand strong { display: block; color: #fff; font-family: var(--serif); font-size: 19px; }
.brand small { display: block; color: #aaa59a; font-size: 12px; }
.nav { padding: 14px 10px; display: grid; gap: 2px; }
.nav .section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8f8a7e; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; color: #e8e5dc; padding: 9px 10px; border-radius: 8px; font-size: 14.5px; }
.nav a:hover { background: #262626; text-decoration: none; }
.nav a.active { background: var(--yellow); color: var(--ink); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; }
.sidebar-foot { margin-top: auto; padding: 14px 18px 18px; border-top: 1px solid #2c2c2c; font-size: 13px; }
.sidebar-foot .who { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .role { color: #aaa59a; }
.sidebar-foot .links { display: flex; gap: 14px; margin-top: 8px; }
.sidebar-foot a, .sidebar-foot button.linklike { color: var(--yellow); }

.topbar { display: none; }
.main { min-width: 0; padding: 28px 36px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.page-head .lead { color: var(--muted); margin-top: 6px; max-width: 70ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- composants ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.stack > * + * { margin-top: 18px; }
.grid { display: grid; gap: 18px; align-items: start; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 18px; align-items: start; }

.stat { padding: 18px 20px; border-left: 4px solid var(--yellow); }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat.blue { border-left-color: var(--blue); }
.stat.lilac { border-left-color: var(--lilac); }
.stat.ink { border-left-color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; padding: 9px 16px; font-weight: 600; font-size: 14px; cursor: pointer; background: var(--blue); color: #fff; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: var(--blue-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--paper); }
.btn.dark { background: var(--ink); }
.btn.dark:hover { background: var(--ink-2); }
.btn.danger { background: var(--surface); color: var(--danger); border-color: #e7b9b5; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn svg { width: 16px; height: 16px; }
button.linklike { background: none; border: 0; padding: 0; color: var(--blue); cursor: pointer; font-weight: 500; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13.5px; font-weight: 600; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line-strong); background: #fff; border-radius: 8px; padding: 9px 11px; }
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--blue); outline: 2px solid var(--blue-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin-bottom: 10px; }
.check input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fcfbf7; }
.filters .input { width: auto; min-width: 150px; flex: 1 1 160px; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fcfbf7; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #fbfaf4; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .sub { color: var(--muted); font-size: 12.5px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #efede6; color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.blue { background: var(--blue-soft); color: var(--blue-dark); }
.badge.lilac { background: var(--lilac-soft); color: #5b3fa6; }
.badge.yellow { background: var(--yellow-soft); color: #5c5400; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.pulse .dot { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.notice { border-radius: 8px; padding: 12px 14px; font-size: 14px; border: 1px solid; }
.notice.info { background: var(--blue-soft); border-color: #c8d5f5; color: #183a8f; }
.notice.warn { background: var(--warn-soft); border-color: #f0d9a6; color: #6d4700; }
.notice.danger { background: var(--danger-soft); border-color: #f1c2be; color: #8a1a12; }
.notice.neutral { background: #f4f2ea; border-color: var(--line); color: var(--ink-2); }
.notice strong { display: block; margin-bottom: 2px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.meter { height: 8px; background: #eeebe2; border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.meter.blue > span { background: var(--blue); }

/* ---------- rapports ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 11px 16px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--yellow); }
.score { display: flex; gap: 22px; align-items: center; padding: 22px; flex-wrap: wrap; }
.score .big { font-size: 52px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.score .big small { font-size: 24px; font-weight: 600; }
.score .level { font-family: var(--serif); font-size: 38px; font-weight: 700; text-transform: capitalize; }
.score-bar { border-left: 6px solid var(--yellow); }
.score-bar.blue { border-left-color: var(--blue); }
.source-list { list-style: none; margin: 0; padding: 0; }
.source-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: start; }
.source-list li:last-child { border-bottom: 0; }
.source-list li:hover, .source-list li.selected { background: #fbfaf4; }
.source-list .rank { width: 28px; height: 28px; border-radius: 6px; display: grid; place-content: center; font-weight: 700; font-size: 13px; color: var(--ink); }
.source-list .pct { font-weight: 700; font-variant-numeric: tabular-nums; }

.s1 { background: #fff3a3; } .s2 { background: #cfdcff; } .s3 { background: #e3d6fb; }
.s4 { background: #c9ecd8; } .s5 { background: #ffd9c2; } .s6 { background: #d6eef5; }

.doc-text { font-family: var(--serif); font-size: 15.5px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; padding: 22px 26px; max-height: 70vh; overflow-y: auto; }
.doc-text mark { color: inherit; border-radius: 2px; padding: 1px 0; cursor: pointer; }
.doc-text mark.dim { background: transparent; }
.doc-text mark.focus { outline: 2px solid var(--ink); }
.passage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 12px; font-size: 14px; }
.passage > div { padding: 12px 14px; }
.passage > div + div { border-left: 1px solid var(--line); background: #fcfbf7; }
.passage .lbl { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.passage b { background: #fff3a3; font-weight: 600; }
.quote-block { border-left: 3px solid var(--lilac); padding: 6px 12px; margin: 8px 0; background: #fbf9ff; font-family: var(--serif); }
.quote-block b { background: #e3d6fb; font-weight: 600; }
ul.limits { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }

/* ---------- dialogues ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(20, 20, 20, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 12px; width: min(620px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { width: min(880px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: #fcfbf7; }
.close-x { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }

.dropzone { display: block; border: 2px dashed var(--line-strong); border-radius: 10px; padding: 26px; text-align: center; background: #fcfbf7; cursor: pointer; }
.dropzone.over { border-color: var(--blue); background: var(--blue-soft); }
.dropzone strong { display: block; }
.dropzone .file { margin-top: 8px; font-weight: 600; color: var(--blue-dark); }

#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 8px; box-shadow: var(--shadow); max-width: 380px; font-size: 14px; border-left: 4px solid var(--yellow); }
.toast.error { border-left-color: #ff8a80; }
.net-banner { position: fixed; top: 0; left: 0; right: 0; background: var(--warn-soft); color: #6d4700; text-align: center; padding: 8px; font-size: 14px; z-index: 70; border-bottom: 1px solid #f0d9a6; }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.mt { margin-top: 18px; }
.mt-s { margin-top: 10px; }
.nowrap { white-space: nowrap; }
.secret { font-family: var(--mono); font-size: 18px; background: var(--yellow-soft); border: 1px dashed #c9bd00; padding: 10px 14px; border-radius: 8px; user-select: all; text-align: center; letter-spacing: .04em; }
pre.json { background: #f4f2ea; padding: 10px; border-radius: 6px; font-size: 12px; overflow-x: auto; max-height: 260px; margin: 0; }

/* ---------- application installée (PWA) ---------- */
.install-card h2 { display: flex; align-items: center; gap: 8px; }
.install-card h2 svg { width: 20px; height: 20px; flex: none; }
ol.steps { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.offline-page { min-height: 100vh; display: grid; place-content: center; justify-items: center; text-align: center; gap: 10px; padding: 24px; max-width: 460px; margin: 0 auto; }
.offline-page img { background: #fff; border-radius: 14px; padding: 6px; border: 1px solid var(--line); }
.offline-page h1 { font-size: 24px; }
.standalone body { overscroll-behavior-y: none; }
.sidebar { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
#toasts { bottom: calc(16px + env(safe-area-inset-bottom)); }
.auth-brand { padding-top: calc(56px + env(safe-area-inset-top)); }

/* ---------- adaptatif ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { padding: calc(28px + env(safe-area-inset-top)) 24px 34px; }
  .auth-brand h1 { font-size: 32px; margin-top: 16px; }
  .auth-brand .crest { width: 76px; height: 76px; }
  .auth-brand ul, .auth-brand .motto { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 40; transform: translateX(-100%); transition: transform .2s ease; }
  .shell.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .4); }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; background: var(--ink); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 3px solid var(--yellow); }
  .topbar img { width: 32px; height: 32px; background: #fff; border-radius: 6px; padding: 2px; }
  .topbar strong { font-family: var(--serif); font-size: 18px; }
  .topbar button { background: none; border: 0; color: #fff; padding: 6px; margin-left: -6px; cursor: pointer; }
  .main { padding: 20px 16px calc(48px + env(safe-area-inset-bottom)); }
  h1 { font-size: 23px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .passage { grid-template-columns: minmax(0, 1fr); }
  .passage > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .score .big { font-size: 42px; }
  .doc-text { padding: 16px; font-size: 15px; }
  .table .hide-sm { display: none; }
}
@media (max-width: 520px) {
  .grid-4, .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .value { font-size: 24px; }
  .card-head, .filters { padding-left: 14px; padding-right: 14px; }
}
@media print {
  .sidebar, .topbar, .actions, .tabs, #toasts { display: none !important; }
  .shell { display: block; }
  .doc-text { max-height: none; }
}

/* pages Web de la base documentaire */
.web-ico { display: inline-flex; vertical-align: -3px; margin-right: 6px; color: var(--blue, #1f4e9a); }
.web-ico svg, .ext-link svg { width: 15px; height: 15px; }
.ext-link { display: inline-flex; align-items: center; gap: 4px; overflow-wrap: anywhere; word-break: break-word; }
.ext-link svg { flex: none; }
.sub.url, dd.url { overflow-wrap: anywhere; word-break: break-word; font-family: var(--mono, ui-monospace, monospace); font-size: .78rem; }
.table td strong { overflow-wrap: anywhere; }
.topbar button svg { width: 24px; height: 24px; display: block; }
.progress-box { margin-top: 12px; padding: 12px; border: 1px solid var(--line, #e2ddd0); border-radius: 10px; background: #fff; }
.import-log { list-style: none; padding: 0; margin: 8px 0 0; max-height: 180px; overflow: auto; }
.import-log li { padding: 3px 0; border-bottom: 1px solid #f0ece2; overflow-wrap: anywhere; }
.import-log li.ok::before { content: "✓ "; color: var(--ok, #1e7b4a); font-weight: 700; }
.import-log li.ko::before { content: "✗ "; color: var(--danger, #b42318); font-weight: 700; }

/* code couleur des taux et niveaux */
:root { --orange: #b25e09; --orange-soft: #fdebd3; --green: #1e7b4a; --green-soft: #dff3e7; --red: #b42318; --red-soft: #fde4e1; }
.score-bar.band-green { border-left-color: var(--green); } .score-bar.band-orange { border-left-color: var(--orange); } .score-bar.band-red { border-left-color: var(--red); }
.band-green .big, .band-green .level { color: var(--green); } .band-orange .big, .band-orange .level { color: var(--orange); } .band-red .big, .band-red .level { color: var(--red); }
.meter.band-green > span { background: var(--green); } .meter.band-orange > span { background: var(--orange); } .meter.band-red > span { background: var(--red); }
.rate { display: inline-block; min-width: 58px; text-align: center; padding: 2px 8px; border-radius: 99px; font-weight: 650; font-variant-numeric: tabular-nums; }
.rate.green { background: var(--green-soft); color: var(--green); } .rate.orange { background: var(--orange-soft); color: var(--orange); } .rate.red { background: var(--red-soft); color: var(--red); }
.band-label { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 650; vertical-align: middle; }
.band-label.green { background: var(--green-soft); color: var(--green); } .band-label.orange { background: var(--orange-soft); color: var(--orange); } .band-label.red { background: var(--red-soft); color: var(--red); }
.scale { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.scale i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.scale .g { background: var(--green); } .scale .o { background: var(--orange); } .scale .r { background: var(--red); }
.badge.lvl-faible { background: var(--green-soft); color: var(--green); } .badge.lvl-modéré { background: var(--orange-soft); color: var(--orange); } .badge.lvl-élevé { background: var(--red-soft); color: var(--red); }
.page-mark { display: block; margin: 14px 0 8px; padding: 2px 0; border-top: 1px dashed #cfc9b8; font-family: var(--sans); font-size: 11.5px; font-weight: 650; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.page-mark:first-child { margin-top: 0; border-top: 0; }
.doc-text mark sup { font-family: var(--sans); font-size: 10px; font-weight: 700; margin-right: 2px; }
.c-formulation { background: #ffd9c2; } .c-connecteur { background: #cfdcff; } .c-structure { background: #e3d6fb; } .c-style { background: #c9ecd8; } .c-repetition { background: #fff3a3; } .c-autre { background: #d6eef5; }
.legend { display: flex; gap: 8px 16px; flex-wrap: wrap; font-size: 13px; }
.legend span i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.pg { font-size: 12px; color: var(--muted); font-weight: 600; }
.show-sm { display: none; } @media (max-width: 860px) { .show-sm { display: block; } }
@media (max-width: 860px) { .table .desc { display: none; } }
.doc-text mark.ai-sent { background: #ffebdd; cursor: help; }
.doc-text b.ai-hit { font-weight: 700; border-radius: 2px; }
.legend i.ai-sent-key { background: #ffebdd; border: 1px solid #f3c9a8; }

/* =====================================================================
   Thème 1.8 — « Intégrité académique » : bleu nuit, vert, papier crème.
   ===================================================================== */
@font-face { font-family: "Inter"; src: url("/fonts/inter-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-600.woff") format("woff"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-700.woff") format("woff"); font-weight: 700 800; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/poppins-500.woff") format("woff"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/poppins-700.woff") format("woff"); font-weight: 700 800; font-display: swap; }

:root {
  --ink: #15233f;
  --ink-2: #22324f;
  --paper: #f3efe6;
  --surface: #fffdf9;
  --line: #e4ddcf;
  --line-strong: #d3cab7;
  --muted: #5f6472;
  --blue: #15233f;
  --blue-dark: #0c172d;
  --blue-soft: #e7ebf3;
  --accent: #0e7a5c;
  --accent-soft: #dcf0e8;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(21, 35, 63, .05), 0 8px 24px rgba(21, 35, 63, .06);
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --serif: "Poppins", "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, "Roboto Mono", monospace;
  --display: "Poppins", "Inter", system-ui, sans-serif;
}
body { font-size: 15.5px; color: var(--ink); }
h1 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; font-size: 30px; }
h2 { font-family: var(--display); font-weight: 600; font-size: 17.5px; letter-spacing: -.005em; }
a { color: var(--accent); }
.eyebrow { font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.eyebrow.light { color: #e9df6a; margin-top: 10px; letter-spacing: .16em; }

/* boutons et champs */
.btn { border-radius: 12px; padding: 10px 18px; background: var(--ink); }
.btn:hover { background: var(--blue-dark); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: #f7f3ea; }
.input { border-radius: 12px !important; background: #fffefb; border-color: var(--line-strong); }
.input:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft) !important; outline: none; }
:focus-visible { outline-color: var(--accent); }
.card { border-radius: var(--radius); }
.modal { border-radius: 20px !important; }
.badge.ok { background: var(--accent-soft); color: var(--accent); }

/* barre latérale (ordinateur) */
.sidebar { background: var(--ink); }
.brand { border-bottom: 0; padding: 22px 18px 16px; }
.brand::after { content: ""; display: block; }
.sidebar .brand { box-shadow: inset 0 -3px 0 #f4e400; }
.brand img { border-radius: 12px; }
.brand strong { font-family: var(--display); font-weight: 700; font-size: 17px; }
.nav .section { font-family: var(--mono); letter-spacing: .18em; font-size: 10.5px; color: #8e99b3; }
.nav a { color: #dfe4ef; border-radius: 10px; }
.nav a:hover { background: #20304f; }
.nav a.active { background: var(--accent-soft); color: var(--ink); }
.nav a.active svg { color: var(--accent); }
.sidebar-foot { border-top-color: #263655; }
.sidebar-foot .role { color: #9aa5bd; }
.sidebar-foot a, .sidebar-foot button.linklike { color: #8fe0c2; }

/* en-têtes de page */
.page-head h1 { font-size: 32px; }
.page-head .lead { font-size: 16px; }

/* cartes statistiques : liseré fin + chiffre en Poppins */
.stat { border-left-width: 0; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: #f4e400; }
.stat.blue::before { background: var(--accent); }
.stat.lilac::before { background: #b49ae8; }
.stat.ink::before { background: var(--ink); }
.stat .label { font-family: var(--mono); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; }
.stat .value { font-family: var(--display); font-size: 34px; }

/* onglets */
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }

/* connexion */
.auth-brand { background: radial-gradient(120% 90% at 0% 0%, #22365e 0%, var(--ink) 55%, #0c172d 100%); }
.auth-brand::after { background: linear-gradient(90deg, #f4e400 0 50%, #2557d6 50%); }
.auth-brand h1 { font-family: var(--display); margin-top: 26px; }
.auth-brand li::before { background: #f4e400; border-radius: 99px; }
.auth-card h2 { font-family: var(--display); }

/* page publique de vérification */
.verify-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--paper); }
.verify-card { width: min(560px, 100%); overflow: hidden; }
.verify-head { display: flex; gap: 14px; align-items: center; padding: 22px 22px 16px; border-bottom: 1px solid var(--line); }
.verify-head img { width: 56px; height: 56px; border-radius: 14px; background: #fff; padding: 3px; border: 1px solid var(--line); }
.verify-ok, .verify-ko { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; }
.verify-ok { background: var(--accent-soft); color: #0a5a44; }
.verify-ok svg { width: 26px; height: 26px; flex: none; }
.verify-ko { background: var(--danger-soft); color: #8a1a12; display: block; }

/* réglage du sceau */
.seal-box label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.seal-preview { display: grid; place-items: center; min-height: 120px; border: 1.5px dashed var(--line-strong); border-radius: 14px; padding: 12px; background: #fffefb; text-align: center; }
.seal-preview img { max-width: 150px; max-height: 150px; }

/* barre d'onglets du bas (téléphone) */
.tabbar { display: none; }
@media (max-width: 860px) {
  .topbar { background: rgba(243, 239, 230, .94); color: var(--ink); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px); gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
  .topbar img { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); padding: 3px; background: #fff; }
  .topbar .tb-text { display: grid; min-width: 0; flex: 1; }
  .topbar .eyebrow { margin: 0; font-size: 10px; letter-spacing: .2em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar strong { font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar button { margin: 0 0 0 auto; width: 46px; height: 46px; border-radius: 14px; background: #fff; border: 1px solid var(--line); color: var(--ink); display: grid; place-items: center; }
  .page-head .eyebrow { display: none; }
  .page-head h1 { font-size: 26px; }
  .main { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: rgba(255, 253, 249, .97); border-top: 1px solid var(--line); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); gap: 6px; box-shadow: 0 -6px 24px rgba(21, 35, 63, .06); }
  .tabbar a { display: grid; justify-items: center; gap: 3px; padding: 8px 4px 6px; border-radius: 16px; color: #7a8090; font-size: 12.5px; font-weight: 600; text-decoration: none !important; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.on { background: var(--accent-soft); color: var(--accent); }
  #toasts { bottom: calc(86px + env(safe-area-inset-bottom)) !important; }
}
@media print { .tabbar { display: none !important; } }

/* double logo : ISC Matadi + VeriScientia */
.logos { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.logos img.vs { background: transparent !important; padding: 0 !important; border: 0 !important; border-radius: 10px !important; }
.brand .logos img { width: 40px; height: 40px; }
.crests { display: flex; gap: 12px; align-items: center; }
.auth-brand .crest.vs { padding: 0; background: transparent; border-radius: 22px; }
.verify-head .logos img { width: 50px; height: 50px; }
@media (max-width: 860px) {
  .topbar .logos img { width: 42px; height: 42px; }
  .topbar .logos img.vs { width: 40px; height: 40px; }
}

/* photo du bâtiment de l'ISC en fond discret du panneau de connexion */
.auth-brand { background: linear-gradient(160deg, rgba(34, 54, 94, .90) 0%, rgba(21, 35, 63, .94) 55%, rgba(12, 23, 45, .97) 100%), url("/img/isc-batiment.jpg") center 30% / cover no-repeat, var(--ink); }
