/* EDMDS — feuille de style de l'application (sans dépendance extérieure). */
:root {
  --red: #c8102e;
  --red-dark: #a00d25;
  --navy: #0f172a;
  --navy-2: #1e293b;
  --blue: #2563eb;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --green: #15803d;
  --amber: #b45309;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); }
a { color: var(--blue); }
h1, h2, h3 { margin: 0; }
button, input, select, textarea { font: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---------- Cadre ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; color: #fff; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--blue); font-weight: 700; }
.brand small { display: block; font-size: 11px; color: #94a3b8; }
.nav { flex: 1; padding: 4px 8px 16px; }
.nav-group { margin: 1px 0; }
.nav-head { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border: 0; background: none; color: #e2e8f0; border-radius: 7px; cursor: pointer; text-align: left; }
.nav-group.depth-0 > .nav-head { text-transform: uppercase; font-size: 11px; letter-spacing: .06em; color: #94a3b8; font-weight: 600; }
.nav-head:hover { background: var(--navy-2); }
.nav-children { padding-left: 10px; border-left: 1px solid #1e293b; margin-left: 10px; }
.nav-link { display: block; padding: 6px 10px; border-radius: 7px; color: #cbd5e1; text-decoration: none; }
.nav-link:hover { background: var(--navy-2); color: #fff; }
.nav-link.active { background: #fff; color: var(--navy); font-weight: 600; }
.nav-link.legacy { color: #94a3b8; }
.nav-link .ext { font-size: 11px; }
.sidebar-user { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--navy-2); }
.sidebar-user .who small { display: block; color: #94a3b8; font-size: 11px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--border); border-top: 3px solid var(--red); position: sticky; top: 0; z-index: 20; }
.topbar .logo { height: 34px; }
.topbar-title .org { display: block; font-weight: 800; letter-spacing: .08em; font-size: 12px; }
.topbar-title small { color: var(--muted); font-size: 11px; }
.topbar-user { margin-left: 8px; text-align: right; }
.topbar-user small { display: block; color: var(--muted); font-size: 11px; }
.badge-admin { background: #fee2e2; color: var(--red); font-weight: 700; font-size: 10px; padding: 1px 6px; border-radius: 4px; }
.clock { margin-left: auto; display: flex; gap: 2px; font-family: ui-monospace, Consolas, monospace; font-weight: 700; }
.clock span { background: var(--blue); color: #fff; padding: 3px 9px; border-radius: 6px; font-size: 13px; }
.clock span.lcl { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.clock small { display: block; font-size: 9px; text-align: center; opacity: .85; }
.menu-toggle { display: none; }
.content { padding: 24px; }

/* ---------- Éléments ---------- */
.page-title { font-size: 22px; margin-bottom: 6px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 2px rgb(15 23 42 / .04); margin-bottom: 18px; overflow: hidden; }
.panel > p, .panel > h1 { padding: 16px 20px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.panel-head h1, .panel-head h2 { font-size: 15px; }
.panel-tools { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.panel-foot { margin: 0; padding: 9px 20px; font-size: 12px; border-top: 1px solid var(--border); color: var(--muted); }
.panel-foot.warn { background: #fffbeb; color: #92400e; }
.search { height: 36px; min-width: 260px; border: 1px solid var(--border); border-radius: 999px; padding: 0 14px; background: #f8fafc; }
select, input:not([type=checkbox]):not([type=file]) { height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; background: #fff; }
.table-wrap { overflow-x: auto; background: #f8fafc; padding: 14px; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid var(--border); }
.table th.right { text-align: right; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f8fafc; }
.empty { text-align: center; color: var(--muted); padding: 40px 14px !important; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #f1f5f9; color: #475569; }
.pill.blue { background: #eff6ff; color: #1d4ed8; }
.pill.green { background: #dcfce7; color: var(--green); }
.pill.amber { background: #fef3c7; color: var(--amber); }
.pill.grey { background: #f1f5f9; color: #64748b; }
.status-select { height: 30px; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 20px; border-bottom: 1px solid var(--border); }
.chips-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 16px 0 20px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; border-top: 4px solid var(--red); }
.card-num { display: block; font-size: 28px; font-weight: 800; }
.card-label { color: var(--muted); font-size: 12px; }

.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; font-weight: 600; text-decoration: none; }
.btn:hover { background: #f8fafc; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.wide { width: 100%; justify-content: center; height: 42px; }
.icon-btn { display: inline-grid; place-items: center; min-width: 32px; height: 32px; border: 0; background: none; border-radius: 7px; cursor: pointer; color: #475569; font-size: 15px; text-decoration: none; }
.icon-btn:hover { background: #eff6ff; color: var(--blue); }
.icon-btn.danger:hover { background: #fee2e2; color: var(--red); }

.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.alert.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert.info { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 300; background: #0f172a; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgb(0 0 0 / .25); cursor: pointer; max-width: 420px; }
.toast.error { background: #991b1b; }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.form label input, .form label select { font-weight: 400; }
.form.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form .span2 { grid-column: span 2; }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.sub { font-size: 14px; margin: 18px 0 8px; }
.hint { font-size: 12px; color: var(--muted); }
.validation-message { color: #b91c1c; font-size: 12px; margin-top: -6px; }
.check-box { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; margin-top: 12px; border: 1px solid #bfdbfe; background: #eff6ff; border-radius: 8px; font-size: 12px; cursor: pointer; }
.facts { border: 1px solid var(--border); background: #f8fafc; border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.7; }
.perm-tree { border: 1px solid var(--border); border-radius: 8px; max-height: 340px; overflow: auto; margin-top: 8px; }
.perm-row { display: grid; grid-template-columns: 1fr repeat(4, 84px); align-items: center; padding: 4px 6px; border-bottom: 1px solid #f1f5f9; font-size: 12px; }
.perm-row input { justify-self: center; }
.perm-header { position: sticky; top: 0; background: #f8fafc; font-weight: 700; color: var(--muted); }
.perm-header span:not(:first-child) { text-align: center; }
.perm-group { display: block; font-weight: 700; background: #fafafa; }

/* ---------- Fenêtres ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgb(15 23 42 / .5); display: grid; place-items: center; z-index: 200; padding: 12px; }
.modal-backdrop[hidden] { display: none; }
.modal { background: #fff; border-radius: 12px; width: min(560px, 100%); max-height: 94vh; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgb(0 0 0 / .3); }
.modal.wide { width: min(1100px, 100%); }
.modal > h2 { padding: 18px 20px 0; font-size: 17px; }
.modal > p { padding: 0 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 16px 20px; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); }
.viewer-img { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto; }

/* ---------- Connexion ---------- */
.account-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(rgb(15 23 42 / .55), rgb(15 23 42 / .55)), url("img/login-bg.jpg") center / cover; }
.account-card { width: min(420px, 100%); background: #fff; border-radius: 14px; padding: 28px; border-top: 4px solid var(--red); box-shadow: 0 20px 50px rgb(0 0 0 / .35); display: flex; flex-direction: column; gap: 14px; }
.account-logo { height: 46px; align-self: center; }
.account-title { text-align: center; font-size: 22px; }
.account-title small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.account-sub { font-size: 16px; }

/* ---------- Erreurs Blazor ---------- */
#blazor-error-ui { background: #fef3c7; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* ---------- Lecteur PDF ---------- */
.pdfr { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #f1f5f9; }
.pdfr-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 10px; background: #fff; border-bottom: 1px solid var(--border); }
.pdfr-modes { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.pdfr-mode { border: 0; background: #fff; padding: 6px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.pdfr-mode[aria-pressed="true"] { background: var(--navy); color: #fff; }
.pdfr-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.pdfr-btn { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border: 1px solid transparent; background: none; border-radius: 7px; cursor: pointer; font-size: 16px; color: #334155; text-decoration: none; }
.pdfr-btn:hover:not(:disabled) { background: #f1f5f9; }
.pdfr-btn:disabled { opacity: .35; cursor: default; }
.pdfr-text { display: inline-flex; gap: 4px; padding: 0 10px; font-size: 12px; font-weight: 600; border-color: var(--border); }
.pdfr-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.pdfr-primary:hover:not(:disabled) { background: #1d4ed8 !important; }
.pdfr-page { width: 58px; height: 30px !important; text-align: center; }
.pdfr-zoom { width: 42px; text-align: center; font-size: 12px; }
.pdfr-muted { font-size: 12px; color: var(--muted); }
.pdfr-search { flex: 1; min-width: 160px; height: 30px !important; border-radius: 999px !important; }
.pdfr-matchbox { display: inline-flex; align-items: center; gap: 2px; }
.pdfr-pagelabel { display: none; font-size: 12px; font-weight: 600; }
.pdfr-fullbar { display: flex; align-items: center; gap: 12px; padding: 5px 12px; background: #fff; border-bottom: 1px solid var(--border); font-size: 12px; }
.pdfr-fullbar[hidden], .pdfr-end[hidden] { display: none; }
.pdfr-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pdfr-progress { width: 200px; height: 6px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.pdfr-progress-fill { height: 100%; width: 0; background: var(--red); transition: width .2s; }
.pdfr-end { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; padding: 8px 12px; background: #ecfdf5; color: #065f46; border-bottom: 1px solid #a7f3d0; font-weight: 600; }
.pdfr-scroller { position: relative; overflow: auto; padding: 16px; outline: none; }
.pdfr-loading { text-align: center; color: var(--muted); padding: 40px 0; }
.pdfr-list { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pdfr-slot { background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.pdfr-single { margin: 0 auto; width: fit-content; }
.pdfr-page-box { position: relative; --scale-round-x: 1px; --scale-round-y: 1px; }
.pdfr-page-box canvas { display: block; }
.pdfr-fallback { width: 100%; border: 1px solid var(--border); border-radius: 8px; }
.pdfr.pdfr-full { position: fixed; inset: 0; z-index: 1000; border-radius: 0; border: 0; }
.pdfr.pdfr-full .pdfr-scroller { flex: 1; height: auto !important; min-height: 0; }
.pdfr-mobile .pdfr-modes, .pdfr-mobile .pdfr-sep, .pdfr-mobile .pdfr-page, .pdfr-mobile .pdfr-muted:not(.pdfr-matchbox *),
.pdfr-mobile .pdfr-zoom, .pdfr-mobile [aria-label="Zoom arrière"], .pdfr-mobile [aria-label="Zoom avant"],
.pdfr-mobile [aria-label="Page précédente"], .pdfr-mobile [aria-label="Page suivante"] { display: none; }
.pdfr-mobile .pdfr-pagelabel { display: inline; }
.pdfr-mobile .pdfr-scroller { padding: 8px; }

/* Calque de texte pdf.js (sélection et recherche), repris de pdfjs-dist/web/pdf_viewer.css. */
.pdfr .textLayer { color-scheme: only light; position: absolute; text-align: initial; inset: 0; overflow: clip; opacity: 1; line-height: 1; letter-spacing: normal; word-spacing: normal; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; caret-color: CanvasText; z-index: 0; --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); --min-font-size-inv: calc(1 / var(--min-font-size)); }
.pdfr .textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; user-select: text; }
.pdfr .textLayer > :not(.markedContent), .pdfr .textLayer .markedContent span:not(.markedContent) { z-index: 1; --font-height: 0; font-size: calc(var(--text-scale-factor) * var(--font-height)); --scale-x: 1; --rotate: 0deg; transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv)); }
.pdfr .textLayer .markedContent { display: contents; }
.pdfr .textLayer ::selection { background: rgb(0 0 255 / .25); }
.pdfr .textLayer mark.pdfr-match { color: transparent; background: rgb(250 204 21 / .55); border-radius: 2px; padding: 0; margin: 0; }
.pdfr .textLayer mark.pdfr-current { background: rgb(234 88 12 / .6); outline: 2px solid rgb(234 88 12); }

/* ---------- Téléphone ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 100; width: 280px; transform: translateX(-100%); transition: transform .2s; }
  .shell.menu-open .sidebar { transform: none; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar-title, .topbar-user { display: none; }
  .content { padding: 12px; }
  .search { min-width: 0; width: 100%; }
  .panel-tools { margin-left: 0; width: 100%; }
  .form.grid2 { grid-template-columns: 1fr; }
  .form .span2 { grid-column: auto; }
}

/* ---------- Couleurs des catégories et statuts (classes enregistrées dans la configuration partagée) ---------- */
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.bg-blue-100 { background: #dbeafe; } .text-blue-700 { color: #1d4ed8; } .text-blue-800 { color: #1e40af; } .border-blue-200 { border-color: #bfdbfe; }
.bg-green-100 { background: #dcfce7; } .text-green-700 { color: #15803d; } .text-green-800 { color: #166534; } .border-green-200 { border-color: #bbf7d0; }
.bg-orange-100 { background: #ffedd5; } .text-orange-700 { color: #c2410c; } .text-orange-800 { color: #9a3412; } .border-orange-200 { border-color: #fed7aa; }
.bg-red-100 { background: #fee2e2; } .text-red-700 { color: #b91c1c; } .text-red-800 { color: #991b1b; } .border-red-200 { border-color: #fecaca; }
.bg-purple-100 { background: #f3e8ff; } .text-purple-700 { color: #7e22ce; } .text-purple-800 { color: #6b21a8; } .border-purple-200 { border-color: #e9d5ff; }
.bg-amber-100 { background: #fef3c7; } .text-amber-700 { color: #b45309; } .text-amber-800 { color: #92400e; } .border-amber-200 { border-color: #fde68a; }
.bg-indigo-100 { background: #e0e7ff; } .text-indigo-700 { color: #4338ca; } .text-indigo-800 { color: #3730a3; } .border-indigo-200 { border-color: #c7d2fe; }
.bg-pink-100 { background: #fce7f3; } .text-pink-700 { color: #be185d; } .text-pink-800 { color: #9d174d; } .border-pink-200 { border-color: #fbcfe8; }
.bg-teal-100 { background: #ccfbf1; } .text-teal-700 { color: #0f766e; } .text-teal-800 { color: #115e59; } .border-teal-200 { border-color: #99f6e4; }
.bg-slate-100 { background: #f1f5f9; } .text-slate-700 { color: #334155; } .text-slate-800 { color: #1e293b; } .border-slate-200 { border-color: #e2e8f0; }

/* ---------- Registres ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 20px; border-bottom: 1px solid var(--border); background: #fff; }
.filters .search { min-width: 280px; flex: 1; }
.table.dense td { padding: 7px 9px; font-size: 13px; }
.table.dense th { padding: 8px 9px; }
.center { text-align: center !important; }
.expandable { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; max-width: 420px; }
.expandable.open { display: block; -webkit-line-clamp: unset; }
.link-btn { border: 0; background: none; color: var(--blue); cursor: pointer; padding: 0; font-size: 12px; }
.small-btn { min-width: 24px; height: 24px; font-size: 13px; }
.att-list { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
textarea { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: inherit; resize: vertical; }
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; }
.cfg-grid .span2 { grid-column: span 2; }
.cfg-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 3px 0; }
.cfg-add { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.cfg-add input:not([type=number]) { flex: 1; min-width: 120px; }
@media (max-width: 900px) { .cfg-grid { grid-template-columns: 1fr; } .cfg-grid .span2 { grid-column: auto; } }

.row-yellow td { background: #fefce8; } .row-amber td { background: #fffbeb; } .row-red td { background: #fef2f2; }
.chip-yellow { background: #fef08a; color: #713f12; } .chip-amber { background: #fcd34d; color: #451a03; } .chip-red { background: #fecaca; color: #7f1d1d; }
.chip { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; margin-bottom: 3px; }
.item-tag { border: 1px solid #fed7aa; background: #fff7ed; color: #9a3412; border-radius: 4px; padding: 1px 5px; font-size: 10px; font-weight: 700; }
.table tr.focus td { outline: 2px solid var(--blue); outline-offset: -2px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 20px; border-top: 1px solid var(--border); font-size: 12px; }
.clickable { cursor: pointer; }
.form.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 14px; }
.form.grid4 .span4 { grid-column: span 4; } .form.grid4 .span2 { grid-column: span 2; }
@media (max-width: 900px) { .form.grid4 { grid-template-columns: 1fr; } .form.grid4 .span4, .form.grid4 .span2 { grid-column: auto; } }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 600; cursor: pointer; }
.tab.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.tab .pill { margin-left: 6px; }
.warn-card { border-top-color: #dc2626; }
.late { color: #b91c1c; font-weight: 700; }
.chip-btn { display: inline-block; margin: 2px 4px; padding: 2px 8px; border-radius: 999px; border: 1px solid #93c5fd; background: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }
.docx-frame { width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: 8px; background: #fff; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.page-head .page-title { margin: 0 8px 0 0; }
.spi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.spi-grid > .panel:nth-child(3) { grid-column: span 2; }
.spi-head { color: #fff; } .spi-head h2 { color: #fff; }
.spi-head.blue { background: linear-gradient(90deg, #2563eb, #1d4ed8); } .spi-head.green { background: linear-gradient(90deg, #059669, #047857); }
.spi-head.amber { background: linear-gradient(90deg, #d97706, #ea580c); } .spi-head.indigo { background: linear-gradient(90deg, #4f46e5, #7c3aed); }
.table.spi td:first-child { white-space: nowrap; }
.table.spi tr.rate td { background: #f8fafc; }
.auto, i.auto { color: #2563eb; font-style: italic; }
.cfg-panel { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; }
.cfg-panel legend { font-weight: 700; padding: 0 6px; }
@media (max-width: 900px) { .spi-grid { grid-template-columns: 1fr; } .spi-grid > .panel:nth-child(3) { grid-column: auto; } }

.muted-tab { opacity: .65; }
.stamp-mini { margin-left: 6px; font-size: 9px; font-weight: 800; color: #b91c1c; border: 1px solid #b91c1c; padding: 0 4px; border-radius: 3px; }
.panel.stamped { position: relative; }
.panel.stamped::after { content: "NO LONGER IN USE"; position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font-size: 48px; font-weight: 900; color: rgb(220 38 38 / .18); border: 6px solid rgb(220 38 38 / .18); padding: 6px 24px; pointer-events: none; white-space: nowrap; }
.cards.inner { margin: 12px 20px; }
.ack { font-size: 12px; font-weight: 600; white-space: nowrap; }
.ack.ok { color: var(--green); } .ack.missing { color: var(--amber); } .ack.missing.late { color: #b91c1c; }
.btn.danger-outline { border-color: #fca5a5; color: #b91c1c; }

.tar-banner { border-radius: 16px; padding: 26px 30px; color: #fff; background: linear-gradient(90deg, #C8102E, #7A0A1E); margin-bottom: 18px; }
.tar-banner small { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: #ffe4e6; }
.tar-banner h1 { font-size: 30px; margin: 6px 0 10px; }
.tar-stats { display: flex; flex-wrap: wrap; gap: 18px; font-size: 14px; } .tar-stats b { font-size: 22px; }
.tar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tar-map { position: relative; width: 100%; overflow: hidden; border-radius: 14px; }
.tar-map svg { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; }
.tar-frame { fill: #fff; fill-opacity: 0; stroke: #fff; cursor: zoom-in; } .tar-frame:hover { fill-opacity: .15; }
.tar-marker { cursor: pointer; outline: none; } .tar-marker:hover circle { fill: #fee2e2; }
.tar-hint { position: absolute; right: 10px; bottom: 8px; background: rgb(255 255 255 / .85); border-radius: 999px; padding: 2px 8px; font-size: 10px; font-weight: 600; }
.tar-country { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-right: 10px; font-weight: 600; color: #475569; }
.chip-btn.approx { border-color: #fcd34d; background: #fffbeb; color: #92400e; }
.tar-lists { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 20px; }
.tar-list { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.tar-region { margin: 14px 20px 0; padding: 6px 12px; border-radius: 8px; font-size: 14px; }
.tar-code { font-weight: 800; color: var(--red); }
tr.dim td { color: #64748b; } .italic { font-style: italic; }

.task-hero { background: linear-gradient(135deg, #0f172a, #1e293b); color: #fff; border-radius: 16px; padding: 20px 22px; margin-bottom: 16px; }
.task-hero-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.task-hero small { color: #93c5fd; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.task-hero h1 { font-size: 22px; margin: 4px 0 12px; }
.task-hero textarea { width: 100%; background: rgb(2 6 23 / .6); color: #fff; border: 1px solid rgb(255 255 255 / .15); }
.task-hero-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.btn.ghost-light { background: rgb(255 255 255 / .1); color: #fff; border-color: rgb(255 255 255 / .2); }
.btn.ghost-light.rec { background: #dc2626; }
.hidden-input { display: none; }
.task-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.task-stats button { background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .1); color: #cbd5e1; border-radius: 10px; padding: 10px; text-align: left; cursor: pointer; }
.task-stats b { display: block; font-size: 24px; color: #fff; } .task-stats b.orange { color: #fdba74; } .task-stats b.red { color: #fca5a5; } .task-stats b.green { color: #6ee7b7; }
.task-title { display: flex; align-items: center; gap: 8px; }
.prio-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.link-btn.strong { font-weight: 600; color: var(--text); font-size: 14px; text-align: left; }
.progress { width: 80px; height: 6px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin: 0 auto 2px; } .progress div { height: 100%; background: var(--blue); }
.btn.small-btn-text { height: 28px; padding: 0 8px; font-size: 12px; } .btn.small-btn-text.ok { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.agenda-day { margin: 14px 20px 4px; font-size: 14px; text-transform: capitalize; } .agenda-day.late { color: #b91c1c; } .agenda-day.today { color: #c2410c; }
.agenda-list { list-style: none; margin: 0 20px; padding: 0; } .agenda-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f1f5f9; }
.gantt { padding: 14px 20px; } .gantt-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-left: 260px; }
.gantt-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; } .gantt-label { width: 250px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.gantt-track { position: relative; flex: 1; height: 18px; background: #f8fafc; border-radius: 4px; }
.gantt-bar { position: absolute; top: 2px; height: 14px; border-radius: 4px; opacity: .85; overflow: hidden; } .gantt-done { height: 100%; background: rgb(0 0 0 / .25); }
.gantt-today { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #dc2626; }
.journal { list-style: none; padding: 0; margin: 0; font-size: 13px; max-height: 180px; overflow: auto; } .journal li { padding: 3px 0; border-bottom: 1px solid #f1f5f9; }
input.grow { flex: 1; }
@media (max-width: 900px) { .task-stats { grid-template-columns: 1fr 1fr; } .gantt-label { width: 120px; } .gantt-scale { margin-left: 130px; } }

/* ---- Checklist IOSA ---- */
.ck-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 14px 10px; color: var(--muted, #64748b); }
.ck-legend .bar { display: inline-block; width: 6px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }
.bar.conform { background: #34d399; } .bar.finding { background: #f87171; } .bar.partial { background: #fed7aa; } .bar.obs { background: #f9a8d4; } .bar.na { background: #fef08a; }
.checklist td { vertical-align: top; }
.checklist textarea.auto { width: 100%; min-height: 3.2em; field-sizing: content; resize: vertical; font-size: 12px; }
.checklist select { width: 100%; font-size: 11px; }
.checklist .acc-cell { position: relative; }
tr.acc-conform { background: #ecfdf580; } tr.acc-finding { background: #fef2f280; } tr.acc-partial { background: #fff7ed99; } tr.acc-obs { background: #fdf2f880; } tr.acc-na { background: #fefce899; }
tr.acc-conform .acc-cell { box-shadow: inset 4px 0 #34d399; } tr.acc-finding .acc-cell { box-shadow: inset 4px 0 #f87171; } tr.acc-partial .acc-cell { box-shadow: inset 4px 0 #fed7aa; }
tr.acc-obs .acc-cell { box-shadow: inset 4px 0 #f9a8d4; } tr.acc-na .acc-cell { box-shadow: inset 4px 0 #fef08a; }
tr.group-row td { background: var(--soft, #f1f5f9); } tr.subgroup-row td { background: #f8fafc; }
.checklist .link-btn { text-align: left; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }
.pre { white-space: pre-line; }
.ok-text { color: #059669; }

/* ---- Analyse de conformité IOSA ---- */
button.card { cursor: pointer; text-align: left; font: inherit; }
.card-on { outline: 2px solid var(--blue); }
.conf-section { background: #1e293b; color: #fff; font-weight: 600; padding: 8px 14px; font-size: 13px; }
.conf-section .muted { color: #cbd5e1; }
.conf-row { border-top: 1px solid var(--border); }
.conf-head { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 9px 14px; background: none; border: 0; text-align: left; cursor: pointer; font: inherit; }
.conf-head:hover { background: #f8fafc; }
.conf-isarp { width: 6.5rem; flex-shrink: 0; color: var(--blue); }
.conf-text { flex: 1; font-size: 13px; color: #334155; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.conf-tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 26rem; }
.conf-detail { display: grid; grid-template-columns: 1fr 22rem; gap: 16px; background: #f8fafc; padding: 14px; }
@media (max-width: 900px) { .conf-detail { grid-template-columns: 1fr; } }
.conf-box { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; font-size: 13px; }
.conf-sec-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.conf-review { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 12px; align-self: start; position: sticky; top: 70px; }
.conf-review h4 { margin: 0 0 6px; }
.plain-list { list-style: none; padding: 0; margin: 0 0 10px; }
.plain-list li { margin: 3px 0; }
.chip-x { border: 0; background: none; cursor: pointer; padding: 0 2px; }
.bg-green-600 { background: #16a34a; } .text-white { color: #fff; }
.alert.warn { background: #fffbeb; color: #78350f; border: 1px solid #fde68a; }

/* ---- Suivi de formation ---- */
.followup { min-width: 1720px; font-size: 12px; }
.followup input.cell { width: 100%; min-width: 60px; padding: 2px 4px; font-size: 12px; }
.followup input.cell.xs { min-width: 40px; } .followup input.cell.wide { min-width: 160px; }
tr.row-edit td { background: #eff6ff; }
.warn-text { color: #d97706; font-weight: 600; }
.bg-yellow-100 { background: #fef9c3; } .text-yellow-800 { color: #854d0e; }
sup.dot { color: var(--blue); font-size: 8px; } sup.badge-n { background: var(--blue); color: #fff; border-radius: 999px; padding: 0 4px; font-size: 9px; }

/* ---- Plan de formation ---- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
@media (max-width: 600px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-card { margin: 0; }
.plan-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.plan-warn { margin: 0; padding: 6px 12px; background: #fef2f2; color: #b91c1c; font-size: 11px; }
.plan-note { margin: 0; padding: 6px 12px; background: #f1f5f9; color: #475569; font-size: 11px; }
.plan-list { margin: 0; padding: 4px 12px 8px 30px; font-size: 13px; }
.plan-list li { display: flex; gap: 6px; align-items: center; padding: 3px 0; border-bottom: 1px solid #f1f5f9; }

/* ---- Formation : bandeau, cartes ---- */
.hero { position: relative; overflow: hidden; border-radius: 16px; background: linear-gradient(135deg, #020617, #0f172a 55%, #172554); color: #fff; padding: 20px; margin-bottom: 4px; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 1px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.25) 0 24px, transparent 24px 48px); }
.hero-top { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.hero-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: rgba(59,130,246,.2); font-size: 22px; }
.hero-title { flex: 1; min-width: 220px; }
.hero-title h1 { margin: 0; font-size: 22px; color: #fff; }
.hero-title p { margin: 2px 0 0; color: #cbd5e1; font-size: 13px; }
.hero-kicker { font-size: 10px; font-weight: 700; letter-spacing: .25em; text-transform: uppercase; color: #93c5fd; }
.hero .btn.hero-btn { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.2); }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.hero-stat { border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.05); border-radius: 12px; padding: 10px 14px; text-align: left; color: #fff; font: inherit; }
button.hero-stat { cursor: pointer; } button.hero-stat:hover { background: rgba(255,255,255,.1); }
.hero-stat.on { border-color: rgba(96,165,250,.6); background: rgba(255,255,255,.15); }
.hero-stat b { display: block; font-family: ui-monospace, monospace; font-size: 22px; color: #93c5fd; }
.hero-stat.green b { color: #6ee7b7; } .hero-stat.amber b { color: #fcd34d; } .hero-stat.red b { color: #fca5a5; } .hero-stat.slate b { color: #cbd5e1; }
.hero-stat span { font-size: 11px; text-transform: uppercase; color: #cbd5e1; }
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tcard { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.tcard.inactive { opacity: .6; }
.tcard-head { display: flex; gap: 10px; align-items: flex-start; }
.tcard-head .grow { flex: 1; min-width: 0; }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 999px; background: #0f172a; color: #fff; flex-shrink: 0; }
.mod-badge { display: inline-block; margin: 0 4px 4px 0; border: 1px solid #bfdbfe; background: #eff6ff; color: #1e40af; border-radius: 6px; padding: 1px 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.tcard-dates { display: flex; justify-content: space-between; }
.bar-track { height: 6px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: #10b981; } .bar-fill.expiree { background: #ef4444; } .bar-fill.a_renouveler { background: #f59e0b; } .bar-fill.inconnue { background: #cbd5e1; }
.tcard-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.tcard-nums div { background: #f8fafc; border-radius: 8px; padding: 6px; }
.tcard-nums b { display: block; font-family: ui-monospace, monospace; }
.tcard-nums span { font-size: 10px; text-transform: uppercase; color: #64748b; }
.tcard-actions { display: flex; gap: 8px; margin-top: auto; }
.mod-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.mod-pill { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; color: #475569; }
.mod-pill.on { background: #2563eb; border-color: #2563eb; color: #fff; }
.timeline { list-style: none; margin: 10px 0 0; padding: 0 0 0 16px; border-left: 2px solid var(--border); }
.timeline li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0; }
.danger-text { color: #b91c1c; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.mod-tile { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 1px solid var(--border); background: #fff; border-radius: 12px; padding: 12px; cursor: pointer; font: inherit; }
.mod-tile:hover { border-color: #93c5fd; } .mod-tile small { color: #64748b; }
.mod-tile.on { background: #2563eb; border-color: #2563eb; color: #fff; } .mod-tile.on small { color: #dbeafe; }
.mat-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; padding: 12px 16px; border-top: 1px solid var(--border); }
.mat-row .grow { flex: 1; min-width: 220px; }
.mat-files { width: 18rem; max-width: 100%; }
.tests-matrix { min-width: 1100px; }
.tests-matrix .sticky-col { position: sticky; left: 0; background: #fff; z-index: 1; }
.tests-matrix thead .sticky-col { z-index: 3; }
.test-cell { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 3px; font-size: 11px; font-weight: 600; cursor: pointer; background: #fff; }
.test-cell.empty { border-style: dashed; color: #94a3b8; }
.test-cell .tiny { font-size: 9px; font-weight: 400; opacity: .75; }
.q-timeline { list-style: none; margin: 14px 0 0; padding: 0 0 0 22px; border-left: 2px solid var(--border); }
.q-timeline > li { position: relative; margin-bottom: 14px; }
.q-timeline > li::before { content: ""; position: absolute; left: -31px; top: 16px; width: 16px; height: 16px; border-radius: 999px; background: #2563eb; box-shadow: 0 0 0 4px #fff; }
.q-timeline > li.changement::before { background: #7c3aed; }
.q-card { display: flex; flex-wrap: wrap; gap: 14px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.q-card .grow { flex: 1; min-width: 240px; }
tr.row-amber td { background: #fffbeb; }
.form .span3 { grid-column: span 3; }

/* ---- GAP ANALYSIS ---- */
.gap-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.gap-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 2px solid var(--border); }
.gap-tab { padding: 8px 12px; border: 1px solid var(--border); border-top: 3px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; background: #f8fafc; color: #334155; font-size: 12px; font-weight: 700; text-decoration: none; }
.gap-tab.on { background: #fff; color: #0f172a; margin-bottom: -2px; border-bottom: 2px solid #fff; }
.gap-banner { color: #fff; font-weight: 700; padding: 10px 14px; margin: 10px 0; border-radius: 8px; }
.gap-wrap { max-height: 72vh; }
.gap-table { font-size: 12px; }
.gap-table thead th { position: sticky; top: 0; color: #fff; background: inherit; z-index: 2; vertical-align: bottom; }
.gap-table td { vertical-align: top; }
.gap-chapter td { background: #2E75B6; color: #fff; font-weight: 700; }
.gap-heading td { background: #DEEAF1; font-weight: 700; }
.gap-review td:first-child { box-shadow: inset 4px 0 #f59e0b; }
.gap-total td { background: #f1f5f9; font-weight: 700; }
.gap-sel { width: 100%; font-size: 11px; background: transparent; border: 1px solid rgba(0,0,0,.15); border-radius: 4px; color: inherit; }
.gap-tools-col { width: 84px; }
.sc-mark { color: #C00000; font-weight: 700; }
.gap-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.gap-legend span { padding: 2px 8px; border-radius: 4px; border: 1px solid var(--border); }
.gap-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.gap-tile { background: #fff; border: 1px solid var(--border); border-top: 4px solid; border-radius: 10px; padding: 10px 12px; }
.gap-tile-head { font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.gap-tile-value { font-size: 26px; font-weight: 800; font-family: ui-monospace, monospace; }
.gap-panel-head { color: #fff; font-weight: 700; padding: 8px 14px; border-radius: 10px 10px 0 0; font-size: 13px; }
.gap-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 14px 16px; }
.gap-mini div { background: #f8fafc; border-radius: 8px; padding: 8px; text-align: center; }
.gap-mini b { display: block; font-size: 20px; font-family: ui-monospace, monospace; }
.gap-mini span { font-size: 11px; color: #64748b; }
.gap-mini .bad b { color: #b91c1c; } .gap-mini .warn b { color: #b45309; }
.meter { display: flex; align-items: center; gap: 6px; }
.meter-track { flex: 1; height: 8px; background: #DEEAF1; border-radius: 999px; overflow: hidden; }
.meter-fill { height: 100%; background: #2E75B6; } .meter-fill.good { background: #16a34a; } .meter-fill.mid { background: #f59e0b; } .meter-fill.low { background: #dc2626; }
.stack-bar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; background: #f1f5f9; font-size: 10px; font-weight: 700; }
.stack-bar span { display: flex; align-items: center; justify-content: center; min-width: 14px; }

/* ---- Formulaires ---- */
.form-brand { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; margin-bottom: 14px; }
.form-brand img { height: 36px; }
.form-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.form-card > h2 { margin: 0 0 10px; font-size: 15px; color: var(--blue); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.check-grid label { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 6px 0 24px; }
.form-warn { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.num-label { display: inline-block; min-width: 1.6em; padding: 0 4px; margin-right: 4px; border-radius: 4px; background: #e0e7ff; color: #3730a3; font-size: 11px; font-weight: 700; text-align: center; }
.sev { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 4px; }
.sev.HIGH { background: #fee2e2; color: #991b1b; } .sev.MEDIUM { background: #fef3c7; color: #92400e; } .sev.LOW { background: #e0f2fe; color: #075985; }
.sticky-stats { position: sticky; top: 0; z-index: 5; }
.rs-frame { width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.rs-sign { margin-top: 12px; padding: 12px; border: 1px solid #bfdbfe; background: #eff6ff; border-radius: 10px; display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.rs-people { max-height: 14rem; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; background: #f8fafc; }
.rs-people label { display: flex; gap: 6px; padding: 2px 0; font-size: 13px; }

/* ---- Graphiques ---- */
.chart { margin: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.chart-title { font-weight: 700; font-size: 13px; color: #191919; margin-bottom: 6px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: #666; margin-bottom: 6px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.chart-scroll { overflow-x: auto; }
.chart svg .grid { stroke: #ececec; stroke-width: 1; }
.chart svg .base { stroke: #bdbdbd; stroke-width: 1; }
.chart svg .axis { font-size: 10px; fill: #666; }
.chart svg .bar:hover path { opacity: .8; }
.chart-table summary { font-size: 11px; color: #666; cursor: pointer; margin-top: 4px; }
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; margin-bottom: 14px; }
@media (max-width: 600px) { .charts-grid { grid-template-columns: 1fr; } }

/* ---------- En-tête : langue, cloche, rappel des tâches ---------- */
.lang-btn { font-size: 11px; font-weight: 700; border: 1px solid var(--border); }
.bell { position: relative; }
a.bell, .bell > .icon-btn { position: relative; }
.count-dot { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.count-dot.red { background: var(--red); }
.count-dot.orange { background: #f97316; }
.bell-backdrop { position: fixed; inset: 0; z-index: 40; }
.bell-panel { position: absolute; right: 0; top: 40px; width: 360px; max-width: calc(100vw - 24px); max-height: 70vh; overflow-y: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(15, 23, 42, .18); z-index: 41; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.bell-list { list-style: none; margin: 0; padding: 0; }
.bell-list li a { display: block; padding: 9px 12px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); font-size: 13px; }
.bell-list li a:hover { background: #f8fafc; }
.bell-list small { display: block; margin-top: 2px; }
.edmds-toast { position: fixed; right: 16px; bottom: 16px; z-index: 1000; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; gap: 10px; align-items: center; font-size: 13px; }
.edmds-toast[hidden] { display: none; }
.edmds-toast a, .edmds-toast .link-btn { color: #93c5fd; }

/* ---------- Protection anti-copie (profils interne standard et externe) ---------- */
body.no-copy-mode { user-select: none; -webkit-user-select: none; }
body.no-copy-mode input, body.no-copy-mode textarea, body.no-copy-mode [data-allow-copy="1"] { user-select: text; -webkit-user-select: text; }
@media print {
  body.no-copy-mode * { visibility: hidden !important; }
  body.no-copy-mode::after { content: "Impression désactivée — contenu confidentiel Tunisair."; visibility: visible; display: block; padding: 2rem; font-weight: bold; }
}

/* ---------- Mode sombre ----------
   Couleurs miroir de toute l'interface ; images, vidéos, documents affichés et menu latéral gardent leurs couleurs. */
html.dark { filter: invert(0.9) hue-rotate(180deg); background: #fff; color-scheme: light; }
html.dark img, html.dark video, html.dark canvas, html.dark iframe, html.dark embed, html.dark object,
html.dark .sidebar, html.dark .edmds-toast, html.dark .keep-colors { filter: invert(1) hue-rotate(180deg); }
html.dark .sidebar img, html.dark .sidebar canvas, html.dark .keep-colors img, html.dark .keep-colors canvas { filter: none; }

/* ---------- Vue générale ---------- */
.bar-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bar-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.bar-panel-head { width: 100%; text-align: left; border: 0; cursor: pointer; padding: 11px 16px; color: #fff; font-weight: 700; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.bar-panel-head .small { margin-left: auto; opacity: .8; }
.bar-panel.red .bar-panel-head { background: linear-gradient(90deg, #dc2626, #e11d48); }
.bar-panel.blue .bar-panel-head { background: linear-gradient(90deg, #2563eb, #4f46e5); }
.bar-panel.green .bar-panel-head { background: linear-gradient(90deg, #059669, #0d9488); }
.bar-panel-body { padding: 12px 16px 14px; display: grid; gap: 10px; }
.hbar-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.hbar-top b { color: var(--text); }
.hbar-track { height: 8px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; }
.collapse-head { width: 100%; border: 0; background: none; cursor: pointer; text-align: left; }
.cards button.card { text-align: left; cursor: pointer; font: inherit; }
.alert-card { border-color: #fca5a5; box-shadow: 0 0 0 2px #fca5a5; animation: edmds-pulse 2s ease-in-out infinite; }
@keyframes edmds-pulse { 50% { box-shadow: 0 0 0 4px #fecaca; } }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { border-bottom: 1px solid var(--border); }
.link-list li:last-child { border-bottom: 0; }
.link-list a { display: block; padding: 8px 14px; color: var(--text); text-decoration: none; }
.link-list a:hover { background: #f8fafc; }
.link-list .row-line { display: flex; gap: 10px; align-items: center; padding: 7px 14px; font-size: 13px; }
.link-list .row-line a.btn { display: inline-block; padding: 3px 10px; }
.notice-panel.amber { border: 2px solid #fbbf24; background: #fffbeb; }
.notice-panel.red { border: 2px solid #f87171; background: #fef2f2; }
.notice-panel .panel-head h2 { text-transform: uppercase; font-size: 13px; letter-spacing: .03em; }
.notice-panel.amber .panel-head h2 { color: #92400e; }
.notice-panel.red .panel-head h2 { color: #991b1b; }
.count-pill { margin-left: auto; background: #d97706; color: #fff; border-radius: 999px; padding: 1px 9px; font-size: 11px; font-weight: 700; }
.count-pill.red { background: #dc2626; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; }
.two-cols > div { background: var(--card); border: 1px solid #fecaca; border-radius: 8px; padding: 10px; }
.two-cols h3 { color: #b91c1c; text-transform: uppercase; margin-bottom: 6px; }
@media (max-width: 900px) { .bar-panels, .two-cols { grid-template-columns: 1fr; } }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
h1:focus { outline: none; }
.pill.purple { background: #f3e8ff; color: #7e22ce; }
.charts-grid.three { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.recap-grid { display: grid; grid-template-columns: 1fr 1fr; }
.recap-grid > div + div { border-left: 1px solid var(--border); }
.recap-head { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 12px; font-weight: 700; }
.recap-head.ok { background: #f0fdf4; color: #166534; }
.recap-head.ko { background: #fef2f2; color: #991b1b; }
@media (max-width: 900px) { .recap-grid { grid-template-columns: 1fr; } }
.chartered { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.chartered-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.chartered-head h3 { font-size: 14px; }
.chartered-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.chartered-block { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.chartered-block-head { display: flex; align-items: center; gap: 4px; }
.chartered-block-head h4 { flex: 1; font-size: 13px; margin: 0; }
.pre-wrap { white-space: pre-wrap; margin: 4px 0 0; }
.audience-box { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin: 0; }
.audience-box legend { font-size: 13px; font-weight: 700; padding: 0 4px; }
.audience-mode { display: flex; flex-direction: column; gap: 4px; }
.audience-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; display: grid; gap: 4px; background: #f8fafc; }

/* ---------- Barres de défilement horizontal des grands tableaux (en haut et en bas de l'écran) ---------- */
.hbar-sync { position: fixed; z-index: 15; overflow-x: auto; overflow-y: hidden; height: 16px; background: rgba(241, 245, 249, .95); display: none; }
.hbar-sync > div { height: 1px; }
.hbar-sync.bottom { bottom: 0; border-top: 1px solid var(--border); box-shadow: 0 -2px 6px rgba(15, 23, 42, .08); }
.hbar-sync.top { border-bottom: 1px solid var(--border); }
.hbar-sync::-webkit-scrollbar { height: 12px; }
.hbar-sync::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 6px; }
.hbar-sync::-webkit-scrollbar-track { background: #e2e8f0; }
@media print { .hbar-sync { display: none !important; } }
.clip-btn { cursor: pointer; }

/* ---------- Accusés de réception des escales ---------- */
.ack-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ack-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 14px; }
.ack-toolbar-right { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; align-items: center; }
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary.disabled { opacity: .5; pointer-events: none; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 25px rgba(15, 23, 42, .15); min-width: 210px; padding: 4px; display: grid; }
.dropdown-menu button { border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.dropdown-menu button:hover { background: #eff6ff; }
.ack-filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.ack-filters label, .ack-filters > div { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.ack-filters .chips, .ack-board .chips { padding: 0; border: 0; gap: 4px; }
.ack-filters .chip, .ack-board .chip { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 600; margin: 0; color: var(--text); cursor: pointer; }
.ack-filters .chip.on, .ack-board .chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.ack-counters { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.ack-tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 16px; display: flex; flex-direction: column; }
.ack-tile b { font-size: 24px; line-height: 1.2; }
.ack-tile span { font-size: 12px; color: var(--muted); }
.ack-tile-wide { flex-direction: row; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 13px; }
.ack-tile-wide span { color: var(--text); font-size: 13px; }
.tone-ok { color: #15803d; } .tone-warn { color: #c2410c; } .tone-late { color: #b91c1c; } .tone-cyan { color: #0e7490; }
.ack-rings { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 4px 0 12px; }
.ack-slot { border-radius: 12px; }
.ack-slot.drop { outline: 2px dashed var(--blue); outline-offset: 2px; }
.ack-slot[draggable=true] .ack-card { cursor: grab; }
.ack-card { position: relative; overflow: hidden; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 10px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font: inherit; color: var(--text); }
.ack-card:hover { border-color: #93c5fd; }
.ack-card.on { border-color: var(--blue); box-shadow: 0 0 0 2px #bfdbfe; background: #f8fbff; }
.ack-card.invalid { opacity: .75; }
.ack-card-title { width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.ack-ring-pair { display: flex; gap: 10px; }
.ack-ring { position: relative; width: 62px; height: 62px; display: inline-block; }
.ack-ring svg { width: 100%; height: 100%; }
.ack-ring circle { fill: none; stroke-width: 7; }
.ack-ring .track { stroke: #e2e8f0; }
.ack-ring .val { stroke-linecap: round; }
.ack-ring.ok .val { stroke: #16a34a; } .ack-ring.mid .val { stroke: #0891b2; } .ack-ring.low .val { stroke: #dc2626; }
.ack-ring-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.ack-ring-txt b { font-size: 15px; } .ack-ring-txt b small { font-size: 10px; } .ack-ring-txt > small { font-size: 8px; color: var(--muted); font-weight: 600; }
.ack-ring-na { width: 62px; height: 62px; border-radius: 50%; border: 6px solid #e2e8f0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.ack-ring-na b { font-size: 13px; color: var(--muted); } .ack-ring-na small { font-size: 8px; color: var(--muted); font-weight: 600; }
.ack-invalid { display: inline-block; font-size: 10px; font-weight: 700; color: #92400e; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 999px; padding: 1px 8px; }
.ack-stamp { position: absolute; top: 42%; left: -12%; width: 124%; transform: rotate(-24deg); text-align: center; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #dc2626; border: 3px double #dc2626; background: rgba(255, 255, 255, .78); padding: 2px 0; pointer-events: none; }
.ack-stamp-badge { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 900; text-transform: uppercase; color: #dc2626; border: 2px double #dc2626; padding: 0 6px; border-radius: 3px; vertical-align: middle; }
.ack-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; font-size: 13px; }
.btn-pair { display: inline-flex; } .btn-pair .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; } .btn-pair .btn + .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.ack-docs { display: flex; flex-wrap: wrap; gap: 4px; }
.ack-doc { border: 1px solid; border-radius: 999px; padding: 1px 9px; font-size: 11px; font-weight: 700; }
.ack-doc.missing { color: #b91c1c; border-color: #f87171; } .ack-doc.ok { color: #15803d; border-color: #4ade80; }
.ack-matrix th, .ack-matrix td { white-space: nowrap; }
.ack-matrix .bl { border-left: 1px solid var(--border); }
.ack-matrix .sticky-col { position: sticky; left: 0; background: var(--card); z-index: 1; }
.cell-ok { background: #dcfce7; } .cell-missing { background: #fee2e2; color: #b91c1c; font-weight: 600; } .cell-unsent { background: #f1f5f9; color: var(--muted); }
.legend { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; border: 1px solid var(--border); }
.ack-board { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; padding: 12px 14px; }
.ack-remark { border: 1px solid #fcd34d; background: #fffbeb; border-radius: var(--radius); padding: 12px; align-self: start; }
.ack-remark h3 { font-size: 13px; color: #92400e; margin-bottom: 6px; }
.ack-stations { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; display: grid; gap: 8px; font-size: 13px; }
.ack-src { display: grid; gap: 4px; }
.ack-picked { display: flex; flex-wrap: wrap; gap: 6px; }
.ack-code { display: inline-flex; gap: 4px; align-items: center; border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 12px; font-weight: 700; }
.ack-code button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0; }
.ack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 4px; max-height: 160px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; }
.alert.warn { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
@media (max-width: 900px) { .ack-board { grid-template-columns: 1fr; } .ack-toolbar-right { margin-left: 0; } }
.ack-tile-wide b { font-size: 13px; line-height: 1.4; }
.panel-foot .legend { width: 12px !important; height: 12px !important; padding: 0 !important; margin: 0 2px; }
.gap-legend-inline { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; }
.gap-legend-inline span { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.gap-bars { display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr 3rem; gap: 8px 12px; align-items: center; font-size: 12px; }
.gap-bars > span:first-child, .gap-bars > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gap-legend { list-style: none; margin: 0; padding: 12px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 6px; font-size: 12px; }
.gap-legend li { padding: 5px 9px; border-radius: 4px; }
