/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== DESIGN TOKENS ===== */
:root {
  --bg:           #f4f3f0;
  --surface:      #ffffff;
  --surface2:     #f9f8f6;
  --border:       #e2e0da;
  --border2:      #cccac3;
  --text:         #1a1916;
  --text2:        #5a5850;
  --text3:        #6e6d63;   /* a11y : assombri pour contraste AA (4.5:1) ; était #9a9890 (~2.6:1) */
  --accent:       #1a3a5c;
  --accent-light: #e8edf3;
  --green:        #1e6b45;
  --green-light:  #e6f2ec;
  --amber:        #8a5a00;
  --amber-light:  #fdf3e0;
  --red:          #8a1f1f;
  --red-light:    #fde8e8;
  --blue:         #1a4a7a;
  --blue-light:   #e6eef7;
  /* Veille réglementaire — palette de couleurs par source (chips + colonne Source/Code) */
  --src-1:        #2563eb;
  --src-2:        #d97706;
  --src-3:        #7c3aed;
  --src-4:        #0891b2;
  --src-5:        #dc2626;
  --src-6:        #16a34a;
  --src-7:        #db2777;
  --src-8:        #4f46e5;
  --mono:         'IBM Plex Mono', monospace;
  --sans:         'IBM Plex Sans', sans-serif;

  /* Legacy aliases used in page inline styles */
  --navy:         #023F75;
  --navy-dark:    #011f3a;
  --gray-bg:      #f4f3f0;
  --gray-border:  #e2e0da;
  --gray-text:    #9a9890;
  --white:        #ffffff;
  --orange:       #8a5a00;
  --shadow:       0 1px 4px rgba(0,0,0,.07);
  --radius:       5px;

  /* ─── CHARTE UNIQUE — éditer ICI propage partout (tokens) ─────────────────── */
  /* Espacement */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;  --sp-4: 16px;  --sp-5: 24px;  --sp-6: 32px;  --sp-8: 48px;
  /* Rayons */
  --r-sm: 8px;  --r-md: 12px;  --r-lg: 14px;  --r-xl: 18px;  --r-pill: 999px;
  /* Tailles de police */
  --fs-xs: 11px;  --fs-sm: 12px;  --fs-md: 13px;  --fs-base: 14px;  --fs-lg: 16px;  --fs-h2: 18px;  --fs-h1: 22px;
  /* Ombres */
  --shadow-sm: 0 1px 4px rgba(0,0,0,.07);
  --shadow-md: 0 4px 12px rgba(0,0,0,.12);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.20);
  /* Bandeau (hero) : dégradé + couleurs des courbes */
  --hero-grad: linear-gradient(118deg, #0D3E72 0%, #3f6c9b 52%, #7aa3c8 100%);
  --hero-curve1: #4F78A3;
  --hero-curve2: #A2C2DD;
  /* Couches (z-index) */
  --z-header: 100;  --z-overlay: 400;  --z-popover: 9999;  --z-toast: 10050;
}

/* ===== BASE ===== */
body {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--sans); font-size: 13px; }

/* ===== LAYOUT ===== */
#app { display: flex; flex-direction: column; min-height: 100vh; }
#main { flex: 1; }

/* ===== HEADER ===== */
.header {
  background: linear-gradient(180deg, #0a3c6e 0%, #023F75 100%);
  height: 58px;
  border-bottom: 1px solid rgba(0,0,0,.18);
  box-shadow: 0 2px 12px rgba(2,30,58,.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  gap: 0;
}

/* Brand */
.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-logo { flex-shrink: 0; }

.header-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.header-brand-name {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.brand-main {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: white;
}

.brand-sub {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 14px;
  color: rgba(255,255,255,.55);
}

.header-brand-version {
  font-family: var(--mono);
  font-size: 9px;
  color: rgba(255,255,255,.3);
  letter-spacing: .04em;
}

.header-sep {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,.2);
  margin-left: 10px;
  flex-shrink: 0;
}

/* ===== HEADER NAV ===== */
.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  padding: 0 12px;
  scrollbar-width: none;
  min-width: 0;
}
.header-nav::-webkit-scrollbar { display: none; }

/* Pill — borderless, frosted hover, icon + active underline */
.nav-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  height: 38px;
  border: none;
  background: none;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .045em;
  color: rgba(255,255,255,.82);
  white-space: nowrap;
  transition: background .14s, color .14s;
  flex-shrink: 0;
  text-decoration: none;
  cursor: pointer;
  font-family: var(--sans);
}
.nav-ico { width: 15px; height: 15px; flex-shrink: 0; opacity: .75; transition: opacity .14s; }
.nav-pill:hover { background: rgba(255,255,255,.10); color: #fff; text-decoration: none; }
.nav-pill:hover .nav-ico { opacity: 1; }

.nav-pill.active { background: rgba(255,255,255,.13); color: #fff; }
.nav-pill.active .nav-ico { opacity: 1; }
.nav-pill.active::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 5px;
  height: 2.5px; border-radius: 2px; background: var(--nav-accent, #fff);
}
a.nav-pill { --nav-accent: #ffffff; }

/* ===== DROPDOWNS ===== */
.nav-dropdown { position: relative; flex-shrink: 0; }

.nav-chevron { font-size: 9px; opacity: .6; margin-left: -1px; display: inline-block; transition: transform .15s; }
.nav-dropdown.open .nav-chevron { transform: rotate(180deg); }
.nav-dropdown.open .nav-dropdown-trigger { background: rgba(255,255,255,.13); color: #fff; }
.nav-dropdown.open .nav-dropdown-trigger .nav-ico { opacity: 1; }

/* Zone accent (subtle wayfinding via CSS var) */
.nav-zone-dashboard  { --nav-accent: #60a5fa; }
.nav-zone-safety     { --nav-accent: #fb923c; }
.nav-zone-compliance { --nav-accent: #34d399; }
.nav-zone-doc        { --nav-accent: #22d3ee; }
.nav-zone-training   { --nav-accent: #a78bfa; }
.nav-zone-admin      { --nav-accent: #f87171; }
.nav-zone-stats      { --nav-accent: #fbbf24; }

/* Dropdown panel — clean rounded card */
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 212px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(2,30,58,.22);
  overflow: hidden;
  z-index: 300;
  padding: 5px;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; animation: nav-menu-in .15s ease; }
@keyframes nav-menu-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
.nav-dropdown-menu::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--nav-accent, var(--accent));
}

/* Module verrouillé (droits insuffisants) : libellé flouté, cadenas net, non cliquable. */
.nav-dropdown-item.nav-locked { pointer-events: none; cursor: not-allowed; }
.nav-dropdown-item.nav-locked .nav-lbl  { filter: blur(3px); opacity: .55; user-select: none; }
.nav-dropdown-item.nav-locked .nav-lock { filter: none; opacity: .85; margin-right: 4px; }

.nav-dropdown-item {
  position: relative;
  display: block;
  padding: 9px 28px 9px 26px;
  margin-top: 1px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text2);
  border-radius: 8px;
  transition: background .12s, color .12s, padding .12s;
  text-decoration: none;
  white-space: nowrap;
}
.nav-dropdown-item:first-child { margin-top: 4px; }
/* Pastille d'accent de zone (repli si pas d'emoji) */
.nav-dropdown-item::before {
  content: ''; position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--nav-accent, var(--accent)); opacity: .3; transition: opacity .12s, transform .12s, filter .12s;
}
/* Icône (emoji) par entrée quand `data-ico` est fourni : grisée au repos, vive au survol/actif. */
.nav-dropdown-item[data-ico] { padding-left: 40px; }
.nav-dropdown-item[data-ico]::before {
  content: attr(data-ico); left: 12px; width: 20px; height: auto; border-radius: 0; background: none;
  font-size: 14px; line-height: 1; text-align: center; opacity: .75; filter: grayscale(.35);
}
.nav-dropdown-item[data-ico]:hover::before,
.nav-dropdown-item[data-ico].active::before { opacity: 1; filter: none; transform: translateY(-50%) scale(1.18); }
/* Flèche au survol */
.nav-dropdown-item::after {
  content: '›'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%) translateX(-4px);
  color: var(--nav-accent, var(--accent)); font-weight: 700; font-size: 14px; opacity: 0; transition: opacity .14s, transform .14s;
}
.nav-dropdown-item:hover {
  background: var(--surface2);
  background: color-mix(in srgb, var(--nav-accent, var(--accent)) 11%, var(--surface));
  color: var(--text); text-decoration: none;
}
.nav-dropdown-item:hover::before { opacity: 1; transform: translateY(-50%) scale(1.2); }
.nav-dropdown-item:hover::after { opacity: .65; transform: translateY(-50%) translateX(0); }
.nav-dropdown-item.active {
  background: var(--accent-light);
  background: color-mix(in srgb, var(--nav-accent, var(--accent)) 16%, var(--surface));
  color: var(--text); font-weight: 600;
}
.nav-dropdown-item.active::before { opacity: 1; transform: translateY(-50%) scale(1.2); }

/* Compteur d'« actions attendues » : badge sur l'entrée + agrégat sur le pill de la zone. */
.nav-count, .nav-pill-count {
  min-width: 18px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
.nav-count { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); }
.nav-pill-count { margin-left: 4px; }

/* ===== HEADER RIGHT ===== */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: 10px;
}

/* Code de la page (4 lettres) — repère discret de gestion des droits, clic = copie */
.header-pagecode {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  color: rgba(255,255,255,.62);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 7px;
  padding: 3px 8px;
  line-height: 1;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.header-pagecode:hover {
  color: #fff;
  border-color: rgba(255,255,255,.4);
  background: rgba(255,255,255,.16);
}
.header-pagecode[hidden] { display: none; }

/* Codes de pages listés en face d'un module dans l'admin des droits */
.perm-codes { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.perm-code {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text3);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  line-height: 1.4;
}

/* Éditeur « droits par page » (rôles & dérogations) */
.pr-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.pr-table th { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 4px 8px; }
.pr-table td { padding: 5px 8px; vertical-align: middle; }
.pr-row-top td { border-top: 2px solid var(--border); }
.pr-page { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pr-ttl { font-weight: 500; }
.pr-mod { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }
.pr-ctrl { text-align: right; white-space: nowrap; width: 240px; }
.pr-level { width: 100%; max-width: 230px; font-size: 12px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); cursor: pointer; }
.pr-level:disabled { opacity: .5; cursor: not-allowed; }

/* Saisie E5X / ECCAIRS (panneau occurrence) */
.e5x-section { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 13px 16px; align-items: start; margin-bottom: 22px; }
.e5x-section-title { grid-column: 1 / -1; padding: 10px 14px; border-radius: 9px; background: var(--accent-light); border: 1px solid var(--accent-light); border-left: 3px solid var(--accent); color: var(--accent); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 2px; }
.e5x-section .form-group { margin: 0; }
.e5x-section .form-control { border-color: var(--border2); }
.e5x-section .form-control:focus { border-color: var(--accent); }
.e5x-wide { grid-column: 1 / -1; }
/* Section togglable (aéronef/pièce) : interrupteur dans le bandeau, masque/affiche les champs. */
.e5x-toggle-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.e5x-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex: 0 0 auto; }
.e5x-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.e5x-switch-sl { position: relative; width: 38px; height: 21px; border-radius: 999px; background: var(--border2); transition: background .15s; }
.e5x-switch-sl::after { content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.e5x-switch input:checked + .e5x-switch-sl { background: var(--accent); }
.e5x-switch input:checked + .e5x-switch-sl::after { transform: translateX(17px); }
.e5x-section.off > .form-group { display: none; }
/* Champ E5X requis (export) encore vide → libellé + bordure rouges. */
.e5x-req .form-label { color: var(--red); }
.e5x-req .form-control, .e5x-req .e5x-ta input { border-color: var(--red); background: var(--red-light); }
/* Toggle segmenté (Oui/Non/…) — plus visible qu'un select pour les décisions binaires. */
.seg { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.seg-btn { padding: 7px 14px; font-size: 13px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; cursor: pointer; color: var(--text2); transition: all .12s; }
.seg-btn:hover { border-color: var(--accent); }
.seg-btn.on { background: var(--accent); color: var(--white); border-color: var(--accent); font-weight: 600; }
.e5x-ta { position: relative; }
/* Chevron sur les champs typeahead → signale qu'une liste déroulante existe derrière l'input. */
.e5x-ta::after { content: '▾'; position: absolute; right: 11px; top: 17px; color: var(--text3); font-size: 11px; pointer-events: none; }
.e5x-ta input { padding-right: 26px; }
/* Sélecteur hiérarchique par famille (grosse VL : Event_Type) : famille au-dessus, recherche en dessous. */
.e5x-tree { display: flex; flex-direction: column; gap: 6px; }
.e5x-tree-fam { font-weight: 600; }
/* Le dropdown du sélecteur arborescent déborde la largeur de la cellule pour rester lisible. */
.e5x-tree .e5x-ta-drop { min-width: 560px; right: auto; max-width: 92vw; }
.e5x-tree .e5x-ta-item { white-space: normal; line-height: 1.4; padding: 7px 12px; }
.e5x-ta-drop { position: absolute; top: 100%; left: 0; right: 0; z-index: 50; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12); max-height: 240px; overflow-y: auto; margin-top: 2px; }
.e5x-ta-item { padding: 6px 10px; font-size: 13px; cursor: pointer; }
.e5x-ta-item:hover { background: var(--bg2); }
.e5x-ta-empty { padding: 6px 10px; font-size: 12px; color: var(--text3); }
.e5x-complete { font-size: 12px; padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }
.e5x-complete.ok { background: var(--green-light); color: var(--green); }
.e5x-complete.warn { background: var(--amber-light); color: var(--amber); }
.e5x-caa-hint { font-size: 11px; color: var(--text3); margin-top: 4px; }
/* Panneau intake (phase A) — inspiré des modales NC : encart guide + sections à bandeau encadré. */
.e5x-guide { font-size: 12.5px; color: var(--text2); background: var(--surface2); border: 1px solid var(--border); border-radius: 9px; padding: 10px 13px; margin-bottom: 14px; line-height: 1.45; }
.e5x-sec { margin-bottom: 18px; }
.e5x-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 15px; border-radius: 10px; border: 1.5px solid var(--accent); background: var(--accent-light); }
.e5x-sec-ttl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.e5x-sec-b { padding: 14px 2px 0; }
.e5x-sec-b .form-label { display: block; margin-bottom: 6px; }
.e5x-dec-dismiss { font-size: 12px; padding: 6px 12px; }
.e5x-dismiss-hint { font-size: 13px; margin: 0 0 10px; }
.haz-risk { display: inline-block; padding: 2px 9px; border-radius: 20px; color: var(--white); font-size: 11px; font-weight: 700; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.3); }

.header-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.header-user-name {
  font-size: 12.5px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

.header-org {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(255,255,255,.5);
  white-space: nowrap;
}

.header-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.30), rgba(255,255,255,.12));
  border: 1px solid rgba(255,255,255,.32);
  color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .02em;
  display: flex; align-items: center; justify-content: center;
}

.header-lang {
  display: flex;
  gap: 0;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 9px;
  padding: 2px;
}

.lang-btn {
  border: none;
  border-radius: 6px;
  background: none;
  color: rgba(255,255,255,.55);
  font-size: 11px;
  font-family: var(--sans);
  font-weight: 600;
  padding: 3px 9px;
  transition: all .12s;
  cursor: pointer;
}
.lang-btn:hover { color: rgba(255,255,255,.9); }
.lang-btn.active { color: var(--accent); background: #fff; }

.btn-header-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 9px;
  background: none;
  color: rgba(255,255,255,.6);
  transition: all .12s;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-header-logout:hover { color: #fff; border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.09); }

/* ===== STATUS BADGES — new system ===== */
.status-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: .02em;
  white-space: nowrap;
  display: inline-block;
}

.s-ok      { background: var(--green-light); color: var(--green); }
.s-warn    { background: var(--amber-light); color: var(--amber); }
.s-alert   { background: var(--red-light);   color: var(--red); }
.s-option  { background: #fff7ed; color: #ea580c; }
.s-confirm { background: #f0fdf4; color: #16a34a; }
.s-attente { background: #fefce8; color: #ca8a04; }
.s-realise { background: #eff6ff; color: #2563eb; }
.s-facture { background: #f5f3ff; color: #7c3aed; }
.s-cancel  { background: var(--red-light); color: var(--red); }

/* ===== KPI BAR ===== */
.fact-kpi-bar {
  display: flex;
  align-items: stretch;
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}

.fact-kpi-card {
  flex: 0 0 auto;
  padding: 12px 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 1px solid var(--border);
  min-width: 140px;
  position: relative;
  overflow: hidden;
}
.fact-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border2);
}
.fact-kpi-card.kpi-alert::before { background: #ef4444; }
.fact-kpi-card.kpi-ok::before    { background: #22c55e; }
.fact-kpi-card.kpi-warn::before  { background: #f59e0b; }
.fact-kpi-card.kpi-prev::before  { background: #94a3b8; }
/* Tuiles KPI cliquables (cockpit conformité formation) */
.fact-kpi-card.kpi-click { cursor: pointer; transition: background .12s; }
.fact-kpi-card.kpi-click:hover { background: rgba(127, 127, 127, .06); }
.fact-kpi-card.kpi-active { background: rgba(127, 127, 127, .10); }
.fact-kpi-card.kpi-active::before { height: 5px; }
/* Matrice de qualification (formation) — personnes × cours : look charte + scroll interne sticky. */
.trn-mx-legend { font-size: 12px; color: var(--text2); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.trn-mx-wrap { border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); overflow: auto; max-height: calc(100vh - 240px); }
.trn-mx { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.trn-mx th, .trn-mx td { padding: 9px 12px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--border); }
.trn-mx tbody tr:last-child td { border-bottom: none; }
.trn-mx tbody tr:hover td { background: var(--accent-light); }
.trn-mx thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); color: var(--text2);
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; border-bottom: 2px solid var(--accent-light); }
.trn-mx td.col-person, .trn-mx th.col-person { text-align: left; position: sticky; left: 0; z-index: 1; background: var(--surface); font-weight: 600; color: var(--text); }
.trn-mx thead th.col-person { z-index: 3; }
.trn-fc-h { font-size: 14px; margin: 16px 0 6px; color: var(--text2); }

.fact-kpi-val {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.fact-kpi-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
}

/* ===== FILTER PILLS ===== */
.mis-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 7px;
  border-radius: 20px;
  border: 1.5px solid var(--border2);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface2);
  color: var(--text3);
  opacity: .42;
  white-space: nowrap;
  user-select: none;
  transition: opacity .15s, background .15s, border-color .15s, color .15s;
}
.mis-pill:hover { opacity: .75; }
.mis-pill.active { opacity: 1; }

.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 5px;
  border: none;
  font-weight: 500;
  font-size: 12px;
  font-family: var(--sans);
  cursor: pointer;
  transition: opacity .12s;
  white-space: nowrap;
}
.btn:hover { opacity: .85; }

.btn-primary   { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text2); border: 1px solid var(--border2); }
.btn-success   { background: var(--green); color: #fff; }
.btn-danger    { background: var(--red); color: #fff; }
.btn-sm        { padding: 4px 10px; font-size: 11px; }

/* Legacy compat */
.btn-logout {
  background: none;
  border: 1px solid var(--border2);
  color: var(--text2);
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 11px;
  cursor: pointer;
  font-family: var(--sans);
}
.btn-logout:hover { background: var(--surface2); }

/* ===== TOOLBAR ===== */
.toolbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.filter-label {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.search-input {
  padding: 5px 10px;
  border: 1px solid var(--border2);
  border-radius: 5px;
  font-size: 12px;
  font-family: var(--sans);
  width: 220px;
  outline: none;
  background: var(--surface2);
  color: var(--text);
  transition: border .12s;
}
.search-input:focus { border-color: var(--accent); background: var(--surface); }

/* ===== PANEL (mds) ===== */
.mds-header  { padding: 8px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; background: var(--surface2); }
.mds-section { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.mds-title   { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text2); margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.mdt-inp     { width: 100%; padding: 4px 8px; border: 1px solid var(--border2); border-radius: 5px; font-family: var(--sans); font-size: 11px; color: var(--text); background: var(--surface2); outline: none; }
.mdt-inp:focus { border-color: var(--accent); }
.mdt-lbl     { font-size: 10px; color: var(--text3); display: block; margin-top: 5px; }

/* ===== PAGE HEADER — Knack blue gradient banner ===== */
.page-header {
  background: linear-gradient(135deg, #2d5e8e 0%, #1e4070 45%, #2a6090 75%, rgba(180,210,235,.35) 100%);
  padding: 18px 32px 22px;
  color: white;
  border-bottom: none;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 300;
  font-style: italic;
  color: white;
  letter-spacing: .01em;
}

.page-header p { display: none; }

/* ===== PAGE SECTIONS (Knack A/ B/ C/ structure) ===== */
.page-section {
  background: white;
  padding: 20px 32px;
}

.page-section-title {
  font-size: 18px;
  font-weight: 400;
  color: #333;
  margin-bottom: 14px;
}

.page-divider {
  border: none;
  border-top: 1px solid #dce0e5;
  margin: 0;
}

/* ===== KNACK ACTION BUTTONS ===== */
.knack-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid #2d5e8e;
  background: white;
  color: #2d5e8e;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--sans);
  transition: background .12s;
  white-space: nowrap;
}
.knack-btn:hover { background: #eef3f9; }
.knack-btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* Primitives charte réutilisables (évitent les style="display:flex" inline) */
.search-row { display: flex; gap: 6px; margin-bottom: 12px; }
.search-row > .form-control { flex: 1; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== KNACK SEARCH BAR ===== */
.knack-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.knack-search {
  display: flex;
  align-items: center;
  gap: 5px;
}
.knack-search input {
  padding: 4px 9px;
  border: 1px solid var(--border2);
  border-radius: 3px;
  font-size: 12px;
  font-family: var(--sans);
  width: 170px;
  outline: none;
  color: var(--text);
  background: var(--surface2);
}
.knack-search input:focus { border-color: #2d5e8e; background: white; }
.knack-search-btn {
  padding: 4px 11px;
  background: white;
  border: 1px solid var(--border2);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  cursor: pointer;
  font-family: var(--sans);
  color: var(--text2);
  transition: background .1s;
}
.knack-search-btn:hover { background: var(--surface2); }

.showing-count {
  font-size: 12px;
  color: var(--text3);
}

/* ===== STAGE TABS — Knack inline LABEL : COUNT format ===== */
.stage-tabs-knack {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.stage-tab-k {
  padding: 6px 12px;
  border: 1px solid #c5cdd8;
  border-right: none;
  background: white;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #2d5e8e;
  cursor: pointer;
  white-space: nowrap;
  transition: background .1s;
  font-family: var(--sans);
  line-height: 1.4;
}
.stage-tab-k:first-child { border-radius: 3px 0 0 3px; }
.stage-tab-k:last-child  { border-right: 1px solid #c5cdd8; border-radius: 0 3px 3px 0; }
.stage-tab-k:hover       { background: #eef3f9; }
.stage-tab-k.active      { background: #2d5e8e; color: white; }
.stage-tab-k.active .tab-count-k { color: white; }
.tab-count-k { color: #c0392b; font-weight: 700; }

/* ===== CONTENT (legacy compat) ===== */
.content {
  padding: 20px 32px;
  background: white;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ===== STAGE TABS ===== */
.stage-tabs {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.stage-tab {
  flex: 1;
  min-width: 90px;
  padding: 8px 10px;
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--sans);
  color: var(--text3);
  text-align: center;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.stage-tab:last-child { border-right: none; }
.stage-tab:hover { background: var(--surface2); color: var(--text); }
.stage-tab.active { background: var(--accent); color: white; }

.stage-tab .tab-label { display: block; text-transform: uppercase; letter-spacing: .04em; font-size: 9px; }
.stage-tab .tab-count { display: block; font-size: 16px; font-weight: 700; margin-top: 2px; font-family: var(--mono); }
.stage-tab:not(.active) .tab-count { color: var(--accent); }
.stage-tab.active .tab-count { color: white; }

/* ===== TABLE ===== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }

thead th {
  background: var(--surface2);
  padding: 8px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text2);   /* a11y : contraste AA sur fond clair (était --text3, trop pâle) */
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }

tbody td {
  padding: 10px 14px;
  vertical-align: middle;
  font-size: 13px;
}

.td-ref {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--blue);
  white-space: nowrap;
}

.td-title { max-width: 340px; }
.td-title-text { font-weight: 500; }
.td-title-sub { font-size: 11px; color: var(--text3); margin-top: 1px; }

/* ===== STATUS BADGES — legacy compat ===== */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
}

.badge-open          { background: var(--blue-light);   color: var(--blue); }
.badge-classified    { background: #ede9fe;              color: #4c1d95; }
.badge-hazards       { background: var(--amber-light);   color: var(--amber); }
.badge-investigating { background: #fff7ed;              color: #ea580c; }
.badge-mitigating    { background: #fdf2f8;              color: #9d174d; }
.badge-no_action     { background: var(--surface2);      color: var(--text2); }
.badge-closed        { background: var(--green-light);   color: var(--green); }
.badge-cancelled     { background: var(--red-light);     color: var(--red); }
.badge-draft         { background: var(--surface2);      color: var(--text3); }

.badge-ca-open     { background: var(--blue-light);  color: var(--blue); }
.badge-ca-progress { background: var(--amber-light); color: var(--amber); }
.badge-ca-closed   { background: var(--green-light); color: var(--green); }
.badge-ca-na       { background: var(--surface2);    color: var(--text3); }

.badge-high     { background: var(--red-light);   color: var(--red); }
.badge-medium   { background: var(--amber-light); color: var(--amber); }
.badge-low      { background: var(--green-light); color: var(--green); }
.badge-critical { background: var(--red);         color: white; }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  font-size: 11px;
  color: var(--text3);
}

.pagination-controls { display: flex; gap: 3px; }
.pagination-controls button {
  padding: 3px 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--sans);
  color: var(--text2);
  cursor: pointer;
  transition: all .12s;
}
.pagination-controls button:hover:not(:disabled) { background: var(--accent); color: white; border-color: var(--accent); }
.pagination-controls button:disabled { opacity: .35; cursor: not-allowed; }
.pagination-controls button.current { background: var(--accent); color: white; border-color: var(--accent); }

/* ===== CARDS (dashboard) ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 15px 18px;
  border-left: 3px solid var(--accent);
  position: relative;
}
.card.card-red    { border-left-color: var(--red); }
.card.card-green  { border-left-color: var(--green); }
.card.card-orange { border-left-color: var(--amber); }

.card-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.card-value { font-size: 28px; font-weight: 700; font-family: var(--mono); color: var(--text); margin: 5px 0 2px; line-height: 1; }
.card-sub   { font-size: 11px; color: var(--text3); }

/* ===== MODAL ===== */
/* .modal-overlay = backdrop plein-écran + centrage flex (z-index > header) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* .modal = carte blanche centrée (ex-modal-box) */
.modal {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 48px rgba(0,0,0,.20);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

/* Dimension commune des modals du module Occurrences (OCCR) — source unique. */
.modal.modal-occ { max-width: 820px; width: 95vw; }

/* Alias pour compatibilité referentiels.js qui utilise .modal-box */
.modal-box {
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-box.modal-lg { max-width: 760px; }
.modal-box.modal-xl { max-width: 980px; }
.clickable-row { cursor: pointer; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 10px 10px 0 0;
}
.modal-header h2 { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
/* Badge d'identification de la modale (outil de dev) — clic = copie. */
.modal-code { margin: 0 8px 0 auto; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--text3); background: var(--surface); border: 1px solid var(--border2); border-radius: 6px; padding: 2px 8px; cursor: pointer; line-height: 1.5; transition: color .12s, border-color .12s; }
.modal-code:hover { color: var(--accent); border-color: var(--accent); }
.modal-code.float { position: absolute; top: 12px; right: 50px; margin: 0; z-index: 6; }
/* Grand modal (E5XR) : colonne flex → en-tête/pied fixes, SEUL le corps scrolle (un seul ascenseur). */
.modal.e5x-modal { display: flex; flex-direction: column; max-height: 94vh; overflow: hidden; }
.modal.e5x-modal .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
/* Actions (Annuler / Export / Enregistrer) dans l'en-tête du modal E5XR — bien visibles. */
.modal-header.e5x-head { gap: 12px; }
.e5x-head-actions { display: flex; align-items: center; gap: 8px; }
.e5x-head-actions .btn { padding: 8px 16px; font-size: 13px; font-weight: 600; border-radius: 7px; }
.e5x-head-actions #e5x-cancel { background: var(--surface); color: var(--text2); border: 1px solid var(--border2); }
.e5x-head-actions .btn-secondary { border-color: var(--accent); color: var(--accent); }
.e5x-head-actions .modal-close { margin-left: 4px; }

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text3);
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 18px; }
.modal-confirm-msg { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text); white-space: pre-line; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 0 0 10px 10px;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 12px; }

/* Label styling — both .form-label class and bare label inside .form-group */
.form-label,
.form-group > label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Checkbox/radio labels stay inline */
.form-group > label:has(input[type=checkbox]),
.form-group > label:has(input[type=radio]) {
  display: flex;
  align-items: center;
  gap: 7px;
  text-transform: none;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0;
  cursor: pointer;
}

.form-label .req, .required { color: var(--red); margin-left: 2px; }
.set-field { display: block; }   /* wrapper de champ Paramètres (label englobant) */

/* All form inputs */
.form-control,
.form-group input[type=text],
.form-group input[type=email],
.form-group input[type=password],
.form-group input[type=date],
.form-group input[type=number],
.form-group input[type=url],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border2);
  border-radius: 5px;
  font-size: 12px;
  font-family: var(--sans);
  outline: none;
  background: var(--surface2);
  color: var(--text);
  transition: border .12s, box-shadow .12s;
}

.form-control:focus,
.form-group input[type=text]:focus,
.form-group input[type=email]:focus,
.form-group input[type=password]:focus,
.form-group input[type=date]:focus,
.form-group input[type=number]:focus,
.form-group input[type=url]:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 2px rgba(26,58,92,.07);
}

.form-group textarea,
textarea.form-control { resize: vertical; min-height: 70px; }
.form-group select { cursor: pointer; }

.form-grid,
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-col-2  { grid-column: span 2; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text3); }
.empty-state-icon { font-size: 38px; margin-bottom: 10px; opacity: .25; }
.empty-state h3 { font-size: 14px; font-weight: 600; color: var(--text2); }
.empty-state p { font-size: 12px; margin-top: 4px; }

/* ===== LOADING ===== */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .5s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row td {
  text-align: center;
  padding: 40px !important;
  color: var(--text3);
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toast {
  background: var(--text);
  color: white;
  padding: 9px 14px;
  border-radius: 6px;
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
  animation: slideIn .18s ease;
  max-width: 300px;
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
@keyframes slideIn { from { transform: translateX(14px); opacity: 0; } }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #011f3a 0%, #023F75 55%, #1a4a7a 100%);
}

.login-box {
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,.3);
  padding: 36px;
  width: 100%;
  max-width: 380px;
}

.login-logo { text-align: center; margin-bottom: 24px; }

.login-logo-icon {
  width: 54px;
  height: 54px;
  background: #023F75;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: white;
  margin-bottom: 10px;
}

.login-logo h1 { font-size: 20px; font-weight: 700; color: var(--accent); letter-spacing: -.01em; }
.login-logo p  { font-size: 11px; color: var(--text3); margin-top: 2px; }

.login-error {
  background: var(--red-light);
  color: var(--red);
  padding: 9px 12px;
  border-radius: 5px;
  font-size: 12px;
  margin-bottom: 12px;
  display: none;
}
.login-error.show { display: block; }

/* ===== DETAIL CARD ===== */
.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.detail-card-header {
  background: var(--surface2);
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-card-body { padding: 18px; }

/* ===== DETAIL GRID ===== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}
.detail-grid .span-2 { grid-column: span 2; }
.detail-grid label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  margin-bottom: 2px;
}

/* ===== FIELD ROWS ===== */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; margin-bottom: 16px; }

.field-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text2); margin-bottom: 3px; }
.field-value { font-size: 13.5px; color: var(--text); }
.field-value.empty { color: var(--text3); font-style: italic; }

/* ===== STAGE PROGRESS BAR ===== */
.stage-progress {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}

.stage-step {
  flex: 1;
  padding: 7px 4px;
  text-align: center;
  font-size: 9px;
  font-weight: 600;
  border-right: 1px solid var(--border);
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.stage-step:last-child { border-right: none; }
.stage-step.done    { background: var(--accent-light); color: var(--accent); }
.stage-step.current { background: var(--accent); color: white; }
.stage-step .step-letter { display: block; font-size: 12px; font-weight: 700; margin-bottom: 1px; font-family: var(--mono); }

/* ===== DETAIL TABS (within modal) ===== */
.detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
  background: var(--surface2);
  gap: 0;
}
.detail-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--sans);
  color: var(--text3);
  cursor: pointer;
  transition: color .12s;
}
.detail-tab:hover { color: var(--accent); }
.detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== CHECKLIST ===== */
.checklist-group { margin-bottom: 14px; }
.checklist-group-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  padding: 6px 0 3px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3px;
}
.checklist-item {
  padding: 7px 4px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.checklist-item.answered { background: var(--green-light); }
.checklist-item-q { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; }
.checklist-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--border2);
  flex-shrink: 0;
  margin-top: 3px;
}
.checklist-dot.dot-ok { background: var(--green); }
.checklist-item-answer { display: flex; gap: 7px; margin-left: 16px; }
.checklist-item-answer .answer-select {
  font-size: 11px; padding: 2px 7px;
  border: 1px solid var(--border2); border-radius: 4px; width: 150px;
  font-family: var(--sans);
}
.checklist-item-answer .answer-comment {
  flex: 1; font-size: 11px; padding: 2px 7px;
  border: 1px solid var(--border2); border-radius: 4px;
  font-family: var(--sans);
}
.checklist-item-answer-ro { margin-left: 16px; display: flex; gap: 7px; align-items: center; }

/* ===== AUDIT CHECKLIST (nouveau UI) ===== */
.aud-chl-header { padding: 0 0 12px; }
.aud-chl-progress-wrap { display: flex; flex-direction: column; gap: 6px; }
.aud-chl-progress-bar {
  height: 8px; background: var(--border); border-radius: 4px; overflow: hidden;
}
.aud-chl-progress-fill {
  height: 100%; background: var(--green); border-radius: 4px; transition: width .4s ease;
}
.aud-chl-progress-stats {
  display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text3);
}

/* Domaine (scope) — carte (charte éditeur P-CHECKLISTS/EDIT) */
.aud-chl-scope {
  margin-bottom: 14px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--accent-light); border-left: 5px solid var(--accent);
  box-shadow: 0 2px 6px rgba(26,58,92,.08);
}
.aud-chl-scope-header {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px; min-height: 54px;
  background: linear-gradient(90deg, var(--accent-light) 0%, var(--surface2) 100%);
  border-bottom: 1px solid var(--accent-light);
}
.aud-chl-scope-name { flex: 1; font-size: 16px; font-weight: 700; color: var(--text); }
.aud-chl-scope-progress { font-size: 12px; color: var(--text3); flex-shrink: 0; white-space: nowrap; }
.aud-chl-scope-body { padding: 8px 0 12px; background: var(--surface); }

/* Chapitre (topic) — niveau 2 */
.aud-chl-topic { border-left: 4px solid var(--blue); margin: 6px 22px; border-radius: 0 8px 8px 0; }
.aud-chl-topic-header {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; min-height: 42px;
  background: var(--blue-light); border-radius: 0 8px 8px 0;
}
.aud-chl-topic-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); }
.aud-chl-topic-body { padding: 2px 0 6px; }

/* Toggle repliage / numéro / méta */
.aud-chl-toggle {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--text3); width: 18px; flex-shrink: 0; padding: 0; line-height: 1;
}
.aud-chl-toggle:hover { color: var(--text); }
.aud-chl-num  { font-size: 12px; color: var(--text3); font-family: var(--mono); flex-shrink: 0; min-width: 22px; }
.aud-chl-meta { font-size: 12px; color: var(--text3); flex-shrink: 0; white-space: nowrap; }

/* Question (item) — niveau 3 : rangée principale + commentaire pleine largeur dessous */
.aud-chl-item {
  display: flex; flex-direction: column; gap: 8px;
  padding: 11px 16px; margin: 2px 22px; border-radius: 8px;
  border-bottom: 1px solid var(--border); transition: background .12s;
}
.aud-chl-item:last-child { border-bottom: none; }
.aud-chl-item-main { display: flex; align-items: flex-start; gap: 12px; }
.aud-chl-item-num {
  font-size: 12px; color: var(--text3); font-family: var(--mono);
  flex-shrink: 0; min-width: 44px; padding-top: 2px;
}
.aud-chl-item-content { flex: 1; min-width: 0; }
.aud-chl-item-q { font-size: 14px; color: var(--text); line-height: 1.5; }

/* Consigne auditeur — toujours affichée */
.aud-chl-guidance {
  margin-top: 6px; font-size: 12px; color: var(--text2); font-style: italic; line-height: 1.45;
  background: var(--surface2); border-left: 3px solid var(--border2);
  border-radius: 0 5px 5px 0; padding: 5px 9px;
}
.aud-chl-guidance-lbl {
  font-style: normal; font-weight: 700; color: var(--text3);
  font-size: 10px; text-transform: uppercase; letter-spacing: .04em; margin-right: 6px;
}

/* Commentaire pleine largeur (RTE) — barre d'outils révélée au focus */
.aud-chl-item-comment { margin-left: 56px; }
.aud-chl-item-comment .rte-toolbar { display: none; }
.aud-chl-item-comment:focus-within .rte-toolbar { display: flex; }
.aud-chl-comment-ro {
  font-size: 13px; color: var(--text2); line-height: 1.5;
  background: var(--surface2); border-radius: 6px; padding: 6px 10px; white-space: pre-wrap;
}

/* Pièces jointes par question (photos / PDF) */
.aud-chl-attach { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: 56px; }
.aud-chl-attach-chip {
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 220px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); font-size: 12px; color: var(--text2); cursor: pointer; transition: all .12s;
}
.aud-chl-attach-chip:hover { border-color: var(--accent); color: var(--accent); }
.aud-chl-attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aud-chl-attach-del {
  border: 0; background: none; cursor: pointer; color: var(--text3);
  font-size: 14px; line-height: 1; padding: 0 0 0 2px;
}
.aud-chl-attach-del:hover { color: var(--red); }
.aud-chl-attach-add {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border: 1px dashed var(--border2); border-radius: 14px;
  background: none; font-size: 12px; color: var(--text3); cursor: pointer; transition: all .12s;
}
.aud-chl-attach-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* ===== Documentation — fichiers par révision (PDF / CAA / source) ===== */
.man-doc-group { margin-top: 8px; }
.man-doc-grouplabel { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text3); margin-bottom: 4px; }
.man-doc-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.man-doc-chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 280px;
  padding: 3px 8px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); font-size: 12px; color: var(--text2); cursor: pointer; transition: all .12s;
}
.man-doc-chip:hover { border-color: var(--accent); color: var(--accent); }
.man-doc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.man-doc-del { border: 0; background: none; cursor: pointer; color: var(--text3); font-size: 14px; line-height: 1; padding: 0 0 0 2px; }
.man-doc-del:hover { color: var(--red); }
.man-doc-empty { font-size: 12px; color: var(--text3); }
.man-doc-add {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border: 1px dashed var(--border2); border-radius: 14px;
  background: none; font-size: 12px; color: var(--text3); cursor: pointer; transition: all .12s;
}
.man-doc-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* Distribution par fonction (obligatoire / pour information) */
.man-dist-hint { font-size: 12px; color: var(--text2); margin: 0 0 12px; }
.man-dist-list { display: flex; flex-direction: column; gap: 6px; }
.man-dist-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
}
.man-dist-check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; flex: 1; min-width: 0; }
.man-dist-name { font-weight: 600; }
.man-dist-count { color: var(--text3); font-size: 12px; }
.man-dist-mode { display: inline-flex; border: 1px solid var(--border2); border-radius: 7px; overflow: hidden; flex-shrink: 0; }
.man-dist-mode.disabled { opacity: .35; pointer-events: none; }
.man-dist-modebtn { border: 0; background: var(--surface); color: var(--text2); font-size: 11px; font-weight: 700; padding: 5px 11px; cursor: pointer; }
.man-dist-modebtn + .man-dist-modebtn { border-left: 1px solid var(--border2); }
.man-dist-modebtn[data-req="1"].active { background: var(--green); color: #fff; }
.man-dist-modebtn[data-req="0"].active { background: var(--blue);  color: #fff; }
.man-ack-info { font-size: 10px; }

/* Colonne Actions : le clic se fait via un bouton explicite — plus de clic sur la ligne entière */
#doc-list tr.ma-row, #mrev-list tr.ma-row { cursor: default; }
.man-actions-cell { text-align: right; white-space: nowrap; }
.man-open-btn { padding: 4px 14px; font-size: 12px; }

/* Fiche document = modale À ONGLETS, agrandie et à DIMENSIONS FIXES (la taille ne
   change pas selon l'onglet : en-tête/onglets figés, seul le panneau défile). */
.modal.man-detail-modal {
  width: min(1100px, 94vw); max-width: 94vw;
  height: min(82vh, 800px); max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.man-detail-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.man-tabpanel { flex: 1; min-height: 0; overflow-y: auto; }
.man-detail-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.man-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--border); margin: 4px 0 18px; }
.man-tab {
  border: 0; background: transparent; padding: 9px 16px; font-size: 13px; font-weight: 600;
  color: var(--text2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.man-tab:hover { color: var(--text1); }
.man-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.man-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.man-panel-head-end { justify-content: flex-end; }
.man-hint-flush { margin: 0; }
.man-field-hint { font-size: 12px; color: var(--text3); margin-top: 4px; }
.man-deadline-input { max-width: 160px; }
.man-check-row { display: flex; align-items: center; gap: 8px; }
.man-check-lbl { font-size: 13px; cursor: pointer; }
.man-mt-14 { margin-top: 14px; }
.man-pre { margin-top: 4px; white-space: pre-wrap; }
.man-acks-table { margin-top: 4px; max-height: 240px; overflow-y: auto; }
.man-wf-wait { font-size: 13px; color: var(--text3); font-style: italic; }

/* Onglet Gouvernance/Approbation du document (puces d'approbateurs) */
.gov-approver-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.gov-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface2); font-size: 13px; font-weight: 600; }
.gov-chip-rm { border: 0; background: transparent; color: var(--text3); cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.gov-chip-rm:hover { color: var(--red); }
.gov-approver-sel { max-width: 320px; }

/* Distribution multi-cibles */
/* Colonne Distribution éditable (commutateurs dans le tableau) */
.man-dist-cellrow { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.man-dist-cellname { flex: 1; min-width: 0; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.man-dist-cellrow .man-dist-mode { flex-shrink: 0; }
.man-dist-cellrow .man-dist-modebtn { padding: 2px 8px; font-size: 10px; }
.man-dist-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.man-dist-h3 { font-size: var(--fs-lg); font-weight: 700; margin: 0; }
.man-dist-empty { font-size: 13px; color: var(--text3); padding: 10px 2px; }
.man-dist-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
}
.man-dist-itemmain { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.man-dist-typebadge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text2); background: var(--surface2); border-radius: 5px; padding: 2px 7px; flex-shrink: 0;
}
.man-dist-rm {
  border: 0; background: transparent; color: var(--text3); font-size: 18px; line-height: 1;
  cursor: pointer; padding: 0 4px; flex-shrink: 0;
}
.man-dist-rm:hover { color: var(--red); }
.man-dist-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.man-dist-add .form-control { width: auto; min-width: 140px; }
.man-dist-excl-lbl { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text2); cursor: pointer; }

/* Profils-postes */
.man-jp-list { display: flex; flex-direction: column; gap: 6px; }
.man-jp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
}
.man-jp-name { font-weight: 600; flex: 1; min-width: 0; }
.man-jp-count { color: var(--text3); font-size: 12px; }
.man-jp-del {
  border: 0; background: transparent; color: var(--text3); font-size: 18px; line-height: 1;
  cursor: pointer; padding: 0 4px;
}
.man-jp-del:hover { color: var(--red); }
.man-jp-fns { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; margin: 6px 0; }
.man-jp-fn { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

/* Lien Document ↔ Réglementation */
.man-reg-list { display: flex; flex-direction: column; gap: 6px; }
.man-reg-item, .man-reg-result {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; width: 100%; text-align: left;
}
.man-reg-result { background: var(--surface); cursor: pointer; }
.man-reg-result:hover { background: var(--surface2); }
.man-reg-code { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--blue); flex-shrink: 0; }
.man-reg-name { font-size: 13px; color: var(--text2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.man-reg-plus { color: var(--green); font-weight: 700; flex-shrink: 0; }
.man-rcp-email { font-size: var(--fs-sm); color: var(--text3); flex-shrink: 0; }
.man-reg-search { margin-top: 14px; }
.man-reg-results { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 260px; overflow-y: auto; }

/* Dashboard conformité */
.comp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.comp-kpi { border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.comp-kpi-val { font-size: 22px; font-weight: 800; color: var(--text1); }
.comp-kpi-lbl { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .03em; margin-top: 2px; }
.comp-matrix { display: flex; flex-direction: column; gap: 6px; max-height: 380px; overflow-y: auto; }
.comp-row { display: flex; align-items: center; gap: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.comp-art { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.comp-profs { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; flex-shrink: 0; }
.comp-prof { font-size: 11px; font-weight: 600; border-radius: 5px; padding: 2px 8px; }
.comp-prof.pub { background: var(--green-light); color: var(--green); }
.comp-prof.draft { background: var(--surface2); color: var(--text3); }

/* Spinner centré dans une modale (remplace les styles inline) */
.modal-spin { text-align: center; padding: 24px; }

/* Workflow d'approbation des révisions */
.man-wf-info { margin-top: 12px; padding: 10px 12px; background: var(--surface2); border-radius: 8px; font-size: 12px; color: var(--text2); }
.man-wf-line { margin: 2px 0; }
.man-wf-reject { color: var(--red); margin-bottom: 6px; }

/* Comparaison de révisions */
.cmp-pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.cmp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmp-col { border: 1px solid var(--border); border-radius: 10px; padding: 12px; min-height: 80px; }
.cmp-head { font-family: var(--mono); font-weight: 700; font-size: 13px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.cmp-meta { font-size: 12px; color: var(--text2); display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.cmp-meta span { color: var(--text3); }
.cmp-docs { display: flex; flex-direction: column; gap: 5px; }
.cmp-doc { font-size: 12px; }

/* Demandes de modification */
.man-cr-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.man-cr-filter { width: auto; min-width: 160px; }
.man-cr-list { display: flex; flex-direction: column; gap: 6px; }
.man-cr-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.man-cr-row:hover { background: var(--surface2); }
.man-cr-ref { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--text3); flex-shrink: 0; }
.man-cr-main { flex: 1; min-width: 0; }
.man-cr-title { font-weight: 600; font-size: 13px; }
.man-cr-sub { font-size: 12px; color: var(--text3); }
.man-cr-desc { white-space: pre-wrap; font-size: 13px; color: var(--text2); margin-bottom: 12px; }

/* Mes documents */
.md-list { display: flex; flex-direction: column; gap: 6px; }
.md-doc { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; flex-wrap: wrap; }
.md-doc-main { flex: 1; min-width: 160px; }
.md-doc-name { font-weight: 600; font-size: 13px; }
.md-doc-sub { font-size: 12px; color: var(--text3); }
.md-doc-files { display: flex; flex-wrap: wrap; gap: 6px; }
.md-doc-files .md-open { padding: 2px 10px; font-size: 11px; }
.md-doc-status { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.md-nofile { font-size: 12px; color: var(--text3); font-style: italic; }

/* Page transversale Révisions */
.man-rev-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.man-rev-search { max-width: 320px; }
.ui-cell-empty { text-align: center; padding: 24px; color: var(--text3); }

/* Recherche & catégorie de documents (#16) */
.man-profile-search { max-width: 340px; margin-bottom: 12px; }
.ui-pill-cat { font-size: 10px; opacity: .7; font-style: italic; margin-left: 5px; }

/* Cloche de notifications in-app (#17) */
.header-bell-wrap { position: relative; }
.header-bell { background: none; border: 0; color: var(--text2); cursor: pointer; padding: 6px; border-radius: 8px; display: inline-flex; align-items: center; }
.header-bell:hover { background: var(--surface2); color: var(--text1); }
.header-bell-badge { position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.notif-panel { position: absolute; top: 42px; right: 0; width: 340px; max-height: 440px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .12); z-index: 200; padding: 6px; }
.notif-empty { padding: 24px; text-align: center; color: var(--text3); font-size: 13px; }
.notif-item { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: inherit; }
.notif-item:hover { background: var(--surface2); }
.notif-item-unread { background: var(--blue-light); }
.notif-item-title { font-weight: 600; font-size: 13px; color: var(--text1); }
.notif-item-body { font-size: 12px; color: var(--text2); margin-top: 2px; }
.notif-item-time { font-size: 11px; color: var(--text3); margin-top: 3px; }

.aud-chl-guidance-btn {
  margin-top: 5px; display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--accent); background: none;
  color: var(--accent); font-size: 10px; font-weight: 700; cursor: pointer;
  transition: all .15s;
}
.aud-chl-guidance-btn.active { background: var(--accent); color: #fff; }
.aud-chl-guidance-text {
  margin-top: 6px; padding: 8px 10px;
  background: var(--bg2); border-left: 3px solid var(--accent);
  border-radius: 2px; font-size: 12px; color: var(--text2); white-space: pre-line;
}

.aud-chl-item-right {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end; min-width: 200px;
}
.aud-chl-answer-select {
  font-size: 12px; padding: 4px 8px; width: 160px;
  border: 1px solid var(--border2); border-radius: 6px; font-family: var(--sans);
  background: var(--bg); color: var(--text);
}
.aud-chl-comment-input {
  width: 160px; font-size: 12px; padding: 4px 8px;
  border: 1px solid var(--border2); border-radius: 6px; font-family: var(--sans);
  background: var(--bg); color: var(--text);
}
.aud-chl-item-right-ro {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.aud-chl-ro-comment { font-size: 12px; color: var(--text3); text-align: right; }

/* Scope picker cards in creation modal */
.aud-scope-card { transition: border-color .15s, background .15s; user-select: none; }
.aud-scope-card:hover { border-color: var(--accent) !important; }

/* Item management controls (edit / delete) — révélés au survol (charte éditeur) */
.aud-chl-item-mgmt {
  display: flex; gap: 4px;
  flex-shrink: 0; align-self: flex-start; padding-top: 2px;
  opacity: .55; transition: opacity .15s;
}
.aud-chl-item:hover .aud-chl-item-mgmt { opacity: 1; }

/* Poignée + états de glisser-déposer (réordonnancement des questions) */
.aud-chl-drag {
  cursor: grab; color: var(--text3); font-size: 15px; line-height: 1.5;
  flex-shrink: 0; user-select: none; opacity: .4; padding: 0 2px;
  transition: opacity .12s, color .12s;
}
.aud-chl-item:hover .aud-chl-drag { opacity: .85; }
.aud-chl-drag:hover { opacity: 1; color: var(--accent); }
.aud-chl-drag:active { cursor: grabbing; }
.aud-chl-dragging { opacity: .4; outline: 2px dashed var(--accent); outline-offset: 2px; }
.aud-chl-drop-before { box-shadow: 0 -3px 0 0 var(--accent); }
.aud-chl-drop-after  { box-shadow: 0  3px 0 0 var(--accent); }
.aud-chl-drag-ghost {
  position: fixed; top: -200px; left: -200px;
  background: var(--accent); color: #fff; padding: 7px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap; max-width: 360px;
  overflow: hidden; text-overflow: ellipsis; box-shadow: 0 8px 24px rgba(0,0,0,.35); pointer-events: none;
}
.aud-chl-mgmt-btn {
  width: 26px; height: 26px;
  border: 1px solid var(--border); border-radius: 5px;
  background: var(--bg); color: var(--text2);
  cursor: pointer; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 0; transition: all .15s;
}
.aud-chl-mgmt-btn:hover        { background: var(--bg2); }
.aud-chl-mgmt-del:hover        { background: #fff5f5; color: var(--red); border-color: var(--red); }
.aud-chl-mgmt-edit:hover       { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

/* Add-question inline form at the bottom of each scope */
.aud-chl-add-q-wrap {
  padding: 8px 14px 12px; border-top: 1px dashed var(--border);
  background: var(--bg);
}
.aud-chl-add-q-btn {
  background: none; border: 1px dashed var(--border);
  color: var(--text3); padding: 5px 14px;
  border-radius: 6px; font-size: 12px; cursor: pointer;
  width: 100%; text-align: left; transition: all .15s;
}
.aud-chl-add-q-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.aud-chl-add-q-form { padding-top: 10px; }
.aud-chl-add-g { margin-top: 6px; }
.aud-chl-add-q-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* ===== AUDIT CHECKLIST — refonte 2 colonnes (Doc/Impl + états) ===== */
/* Petites classes utilitaires (remplacent d'anciens styles inline) */
.aud-chl-loading { display: flex; align-items: center; justify-content: center; padding: 80px; }
.aud-chl-error { padding: 40px; color: var(--red); }
.aud-chl-hist-comment { margin-left: 8px; color: var(--text3); }
.aud-chl-no-history { color: var(--text3); padding: 16px; }
.aud-chl-findings { font-size: 10px; }
.aud-chl-import-more { padding: 3px 10px; font-size: 11px; }
.aud-chl-scope-pct { font-size: 10px; opacity: .7; }

/* Teintes de ligne selon l'évaluation */
.aud-chl-item--ok        { background: var(--green-light); }
.aud-chl-item--finding   { background: var(--red-light); }
.aud-chl-item--na        { background: var(--bg2); }
.aud-chl-item--unaudited { background: var(--bg2); }
.aud-chl-item--other     { background: var(--amber-light); }

/* Colonne gauche : référence + contenu réglementaire */
.aud-chl-ref {
  display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 700;
  color: var(--accent); background: var(--accent-light);
  padding: 1px 7px; border-radius: 4px; margin-bottom: 5px;
}
.aud-chl-reg {
  margin-top: 7px; display: flex; gap: 7px; align-items: flex-start;
  background: var(--bg2); border-left: 3px solid var(--border2);
  border-radius: 0 5px 5px 0; padding: 6px 9px; cursor: pointer;
}
.aud-chl-reg:hover { border-left-color: var(--accent); }
.aud-chl-reg-icon { flex: none; font-size: 12px; line-height: 1.5; }
.aud-chl-reg-text {
  font-size: 12px; color: var(--text2); line-height: 1.45; white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.aud-chl-reg.expanded .aud-chl-reg-text { -webkit-line-clamp: unset; display: block; }

/* Colonne droite : évaluation */
.aud-chl-assess {
  display: flex; flex-direction: column; gap: 8px;
  min-width: 250px; flex-shrink: 0;
}
.aud-chl-seg-grid {
  display: grid; grid-template-columns: auto 1fr; gap: 7px 10px; align-items: center;
}
.aud-chl-seg-grid.is-disabled { opacity: .35; pointer-events: none; }
.aud-chl-seg-lbl { font-size: 12px; font-weight: 600; color: var(--text2); }
.aud-chl-seg {
  display: inline-flex; border: 1px solid var(--border2); border-radius: 7px; overflow: hidden;
}
.aud-chl-seg-btn {
  flex: 1; padding: 5px 16px; border: 0; background: var(--surface);
  color: var(--text2); font-size: 12px; font-weight: 700; cursor: pointer; transition: all .12s;
}
.aud-chl-seg-btn + .aud-chl-seg-btn { border-left: 1px solid var(--border2); }
.aud-chl-seg-btn:hover { background: var(--bg2); }
.aud-chl-seg-btn[data-val="yes"].active { background: var(--green); color: #fff; }
.aud-chl-seg-btn[data-val="no"].active  { background: var(--red);   color: #fff; }

.aud-chl-states { display: flex; gap: 6px; flex-wrap: wrap; }
.aud-chl-state-btn {
  padding: 4px 11px; border: 1px solid var(--border2); border-radius: 14px;
  background: var(--surface); color: var(--text3);
  font-size: 11px; font-weight: 600; cursor: pointer; transition: all .12s;
}
.aud-chl-state-btn:hover { border-color: var(--accent); color: var(--accent); }
.aud-chl-state-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.aud-chl-assess .aud-chl-comment-input { width: 100%; }
.aud-chl-nc-btn { display: none; align-self: flex-start; padding: 3px 12px; font-size: 11px; }
.aud-chl-nc-btn.show { display: inline-flex; }

/* ===== Transfert tablette (QR handoff) + verrou ===== */
.aud-chl-tablet-btn { margin-left: auto; }

/* Bandeau de verrou (poste en lecture seule) */
.aud-chl-lockbar {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 14px; padding: 10px 16px;
  background: var(--amber-light); border: 1px solid var(--amber); border-radius: 8px;
}
.aud-chl-lockbar-txt { flex: 1; font-size: 13px; font-weight: 600; color: var(--amber); }

/* Modale QR */
.aud-ho-hint { font-size: 13px; color: var(--text2); margin: 0 0 12px; text-align: center; }
.aud-ho-qr { display: flex; justify-content: center; margin: 0 auto 12px; }
.aud-ho-qr svg { border: 1px solid var(--border); border-radius: 8px; }
.aud-ho-qr.aud-ho-expired { opacity: .25; }
.aud-ho-expire { font-size: 12px; color: var(--text3); text-align: center; margin: 0 0 8px; }
.aud-ho-link { text-align: center; font-size: 13px; word-break: break-all; }

/* Page terrain (tablette) : bouton Terminer à droite + écran de fin/erreur */
.aud-chl-field-done { margin-left: auto; }
.aud-chl-field-msg {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 80px 24px; text-align: center;
}
.aud-chl-field-ico { font-size: 48px; }
.aud-chl-field-msg p { font-size: 15px; color: var(--text2); margin: 0; max-width: 420px; }

/* ===== AUDIT CHECKLIST — FULL PAGE ===== */
.aud-chl-page { display: flex; flex-direction: column; min-height: calc(100vh - 52px); }

.aud-chl-page-topbar {
  position: sticky;
  top: 52px; /* directly below app header */
  z-index: 90;
  background: var(--bg);
  border-bottom: 2px solid var(--accent);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
}

.aud-chl-page-back { flex-shrink: 0; }

.aud-chl-page-title {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 0; overflow: hidden;
}
.aud-chl-page-ref {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  color: var(--accent); flex-shrink: 0;
}
.aud-chl-page-sep { color: var(--text3); flex-shrink: 0; }
.aud-chl-page-name {
  font-size: 15px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.aud-chl-page-body {
  flex: 1;
  padding: 24px 32px 60px;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Make progress bar sticky within the page body */
.aud-chl-page-body .aud-chl-header {
  position: sticky;
  top: calc(52px + 56px); /* app header + page topbar */
  z-index: 80;
  background: var(--bg);
  padding: 10px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

/* ===== HISTORY ===== */
.history-list { display: flex; flex-direction: column; gap: 1px; }
.history-item { padding: 9px 4px; border-bottom: 1px solid var(--border); }
.history-meta { display: flex; gap: 10px; font-size: 11px; color: var(--text3); }
.history-action { font-weight: 600; color: var(--text); }
.history-detail { margin-top: 3px; font-size: 11px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1400px) {
  .nav-zone-stats { display: none; }
}
@media (max-width: 1200px) {
  .nav-zone-doc,
  .nav-zone-admin,
  .nav-zone-stats { display: none; }
}
@media (max-width: 900px) {
  .header-nav { display: none; }
  .form-grid, .form-grid-2 { grid-template-columns: 1fr; }
  .form-col-2 { grid-column: 1; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid .span-2 { grid-column: 1; }
}

/* ===== DEV — modal-ref (identifiant discret dans les modales, lu par injectDevRef) ===== */
.modal-ref {
  font-size: 9px;
  font-family: var(--mono);
  color: var(--text3);
  opacity: 0.45;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  user-select: none;
}

/* ── NC Stage progress bar ─────────────────────────────────────────────────── */
.nc-stage-progress {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  gap: 4px;
  flex-wrap: wrap;
  border-radius: 8px 8px 0 0;
}
.nc-stage-step {
  font-size: 10px;
  font-family: var(--mono);
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  color: var(--text3);
  white-space: nowrap;
}
.nc-stage-step.done {
  background: var(--green-light);
  color: var(--green);
  border-color: var(--green);
}
.nc-stage-step.current {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
.nc-stage-arrow { color: var(--text3); font-size: 11px; }

/* ── Checklist items (library) ─────────────────────────────────────────────── */
.checklist-lib-group { margin-bottom: 20px; }
.checklist-lib-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 6px 12px;
  border-radius: 4px;
  margin-bottom: 4px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ===== AUDIT CALENDAR ===== */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.cal-month-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.cal-header-cell {
  background: var(--surface2);
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  padding: 6px 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.cal-cell {
  background: var(--surface);
  min-height: 90px;
  padding: 4px;
  vertical-align: top;
}
.cal-cell-empty {
  background: var(--bg);
}
.cal-cell-today {
  background: var(--accent-light);
}
.cal-day-num {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text3);
  margin-bottom: 3px;
  padding: 1px 3px;
  display: inline-block;
}
.cal-today-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  text-align: center;
  line-height: 22px;
  padding: 0;
}
.cal-event {
  display: block;
  font-size: 10px;
  font-family: var(--mono);
  padding: 2px 4px;
  border-radius: 3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
.cal-event:hover { opacity: .8; text-decoration: none; }
.cal-legend {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text3);
}
.cal-legend-item { font-weight: 500; }

/* ===== SMS INDICATORS ===== */
.sms-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 4px 0 8px;
}
.sms-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 16px 14px;
  text-align: center;
}
.sms-card-value {
  font-size: 36px;
  font-weight: 700;
  font-family: var(--mono);
  line-height: 1.1;
  margin-bottom: 6px;
}
.sms-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sms-card-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
}

/* Dashboard stat card — same as sms-card but clickable */
.dash-stat-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 16px 14px;
  text-align: center;
  text-decoration: none;
  transition: box-shadow .15s, border-color .15s;
}
.dash-stat-card:hover {
  box-shadow: 0 3px 12px rgba(0,0,0,.1);
  border-color: var(--border2);
  text-decoration: none;
}

/* ── NC Detail stage sections ─────────────────────────────────────────────── */
.stage-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.stage-section:last-child { border-bottom: none; }
.stage-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.proof-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}

/* ===== SUPERADMIN ===== */
.sa-import-form { max-width: 520px; display: flex; flex-direction: column; gap: 16px; }
.sa-import-summary { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; max-width: 520px; }
.sa-summary-title { font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 14px; }
.sa-summary-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.sa-summary-stat { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; font-size: 22px; font-weight: 700; color: var(--text); display: flex; flex-direction: column; align-items: center; min-width: 80px; }
.sa-summary-stat span { font-size: 11px; font-weight: 500; color: var(--text3); margin-top: 2px; }
.sa-add { color: var(--green) !important; }
.sa-mod { color: var(--amber) !important; }
.sa-del { color: var(--red) !important; }

.sa-diff-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.sa-diff-item { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.sa-diff-item-header { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--border); }
.sa-diff-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 4px; }
.sa-diff-added .sa-diff-badge, .sa-add { background: var(--green-light); color: var(--green); }
.sa-diff-modified .sa-diff-badge, .sa-mod { background: var(--amber-light); color: var(--amber); }
.sa-diff-deleted .sa-diff-badge, .sa-del { background: var(--red-light); color: var(--red); }
.sa-diff-code { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--accent); }
.sa-diff-path { font-family: var(--mono); font-size: 11px; color: var(--text3); }
.sa-diff-texts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); }
.sa-diff-old, .sa-diff-new { padding: 8px 12px; font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
.sa-diff-old { background: #fff8f8; color: var(--text2); }
.sa-diff-new { background: #f6fffa; color: var(--text2); }
.sa-diff-old span, .sa-diff-new span { font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: 4px; color: var(--text3); }
.sa-diff-only { grid-column: 1 / -1; }

/* ===== EASA ARTICLES ===== */
.easa-article-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.easa-article-row:hover { background: var(--bg); }
.easa-article-code { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--accent); min-width: 160px; flex-shrink: 0; }
.easa-article-title { font-size: 13px; color: var(--text); flex: 1; }
.easa-article-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }
.easa-badge-ir  { background: var(--accent-light); color: var(--accent); font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.easa-badge-amc { background: var(--green-light); color: var(--green); font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.easa-badge-gm  { background: var(--amber-light); color: var(--amber); font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.easa-na { opacity: .45; }
.easa-provision { padding: 6px 12px; font-size: 12px; color: var(--text2); border-left: 3px solid var(--border); margin: 4px 0 4px 8px; line-height: 1.5; }
.easa-provision-ref { font-family: var(--mono); font-size: 11px; color: var(--text3); min-width: 32px; display: inline-block; }
.easa-provisions { display: flex; flex-direction: column; gap: 6px; }
.easa-provision-path { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.easa-provision-text { font-size: 13px; color: var(--text2); line-height: 1.6; white-space: pre-wrap; }

/* ===== EASA — tableau réglementation (référence | contenu | checklist | question) ===== */
.ear-searchbox { display: flex; align-items: center; gap: 6px; min-width: 300px; padding: 4px 10px; border: 1px solid var(--border2); border-radius: 6px; background: var(--surface); }
.ear-searchbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.ear-search-icon { font-size: 12px; opacity: .55; }
.ear-searchbox input { flex: 1; border: none; outline: none; background: transparent; font-size: 13px; color: var(--text); }
.ear-search-clear { border: none; background: none; cursor: pointer; color: var(--text3); font-size: 13px; padding: 0 2px; }
.ear-search-clear:hover { color: var(--text); }
.ear-hl { background: #fde68a; color: inherit; border-radius: 2px; padding: 0 1px; }
.ear-filter { font-size: 12px; padding: 5px 8px; border: 1px solid var(--border2); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; }
.ear-filter:focus { outline: none; border-color: var(--accent); }
.ear-det-sep { grid-column: 1 / -1; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text3); font-weight: 700; }
.ear-det-sep-dd { display: none; }
.ear-det-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 14px; line-height: 1.4; }
.ear-det-grid { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; margin: 0; }
.ear-det-grid dt { font-size: 12px; color: var(--text3); font-weight: 600; margin: 0; }
.ear-det-grid dd { font-size: 13px; color: var(--text); margin: 0; }
.ear-det-applic { display: flex; align-items: center; gap: 8px; }

#ear-list { max-height: calc(100vh - 210px); overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.ear-table { width: 100%; table-layout: fixed; border-collapse: collapse; background: var(--surface); }
.ear-table thead th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text2); padding: 9px 14px; background: var(--surface2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 3; }
.ear-table td { padding: 9px 14px; vertical-align: top; border-bottom: 1px solid var(--border); word-break: break-word; }

.ear-art-row td { padding: 8px 14px; cursor: pointer; user-select: none;
  background: color-mix(in srgb, var(--art-color, var(--accent)) 12%, var(--surface));
  border-left: 4px solid var(--art-color, var(--accent)); }
.ear-art-row:hover td { background: color-mix(in srgb, var(--art-color, var(--accent)) 22%, var(--surface)); }
.ear-caret { font-size: 10px; color: var(--text2); margin-right: 8px; }
.ear-art-code { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--art-color, var(--accent)); margin: 0 8px; }
.ear-art-title { font-size: 13px; font-weight: 600; color: var(--text); margin-right: 8px; }

.ear-prov-row:hover td { background-color: var(--surface2); }
.ear-ref-inner { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.ear-ref-code { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--accent); }

/* Jeu de pastilles homogènes (même hauteur, forme, police) */
.ear-pill {
  display: inline-flex; align-items: center; justify-content: flex-start; gap: 5px;
  height: 23px; padding: 0 11px; box-sizing: border-box;
  font-size: 11px; font-weight: 600; line-height: 1; letter-spacing: .01em;
  border: 1px solid transparent; border-radius: 6px;
  cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, filter .12s;
}
.ear-pill > svg { flex-shrink: 0; opacity: .9; }
/* Dans la colonne référence : pastilles toutes de même largeur (pleine largeur) */
.ear-ref-inner .ear-pill { width: 100%; }
/* Créer une question — accent plein (action principale) */
.ear-pill-create { background: var(--accent); border-color: var(--accent); color: #fff; justify-content: center; }
.ear-pill-create:hover { filter: brightness(1.1); }
.ear-pill-info { background: #eaf1fb; border-color: #cbddf5; color: #1d4ed8; }
.ear-pill-info:hover { background: #dbe8f9; }
.ear-pill-na   { background: #fdebec; border-color: #f3cdd1; color: #b3261e; cursor: default; }
.ear-pill-del  { background: #f3e8ef; border-color: #e0c8d6; color: #8a1f5a; cursor: default; }
.ear-pill-mod  { background: #fff4e2; border-color: #f3d9a8; color: #9a6a00; }
.ear-pill-mod:hover { background: #fdebcb; }
.ear-pill-seen { background: #e9f5ee; border-color: #bfe3cf; color: #1e6b45; }
.ear-pill-seen:hover { background: #dceee3; }

/* Bouton "passer non applicable" du modal — rouge doux */
.btn-danger-soft { background: #fdebec; border: 1px solid #f5ccd0; color: #b3261e; }
.btn-danger-soft:hover { background: #f9d8db; }
/* Historique des révisions d'une provision */
.ear-rev { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.ear-rev:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.ear-rev-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ear-rev-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text2); background: var(--surface2); border: 1px solid var(--border2); border-radius: 4px; padding: 1px 7px; }
.ear-rev-latest { color: var(--accent); background: var(--accent-light); border-color: #cbddf5; }
.ear-rev-date { font-size: 11px; color: var(--text3); }
.ear-rev-seen { font-size: 11px; font-weight: 700; color: var(--green); margin-left: auto; }
.ear-diff-date { font-weight: 400; font-style: normal; color: var(--text3); font-size: 10px; text-transform: none; letter-spacing: 0; }

.ear-det-footer { justify-content: space-between; align-items: center; }
.ear-det-applic-line { display: flex; align-items: center; gap: 8px; }
.ear-applic-meta { font-size: 11px; color: var(--text3); margin-top: 4px; }
.ear-ack-info { font-size: 12px; }
.ear-ack-seen { color: var(--green); font-weight: 600; }
/* Diff au mot dans le modal de modification */
.ear-del { background: #fde0e0; color: #8a1f1f; text-decoration: line-through; border-radius: 2px; }
.ear-ins { background: #d8f0e0; color: #1e6b45; border-radius: 2px; }
.ear-cell-content { font-size: 13px; color: var(--text2); line-height: 1.6; white-space: pre-wrap; }
.ear-cell-cl { font-size: 12px; color: var(--text2); }
.ear-cl-code { display: inline-block; font-family: var(--mono); font-size: 10px; font-weight: 700; color: #1d4ed8; background: #dbeafe; border: 1px solid #bfdbfe; border-radius: 4px; padding: 0 6px; margin-right: 4px; }
.ear-cl-loc { color: var(--text2); }
.ear-cell-q { font-size: 12px; color: var(--text); line-height: 1.5; }
.ear-q-ref { display: inline-block; margin-right: 6px; font-family: var(--mono); font-size: 10px; font-weight: 700; color: #1d4ed8; background: #eaf1fb; border: 1px solid #cbddf5; border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.ear-q-link { color: var(--accent); cursor: pointer; text-decoration: none; border-bottom: 1px dotted var(--accent); }
.ear-q-link:hover { text-decoration: none; border-bottom-style: solid; }
.ear-cell-empty { color: var(--text3); text-align: center; }
.ear-cell-action { text-align: right; }
.ear-q-stale-row .ear-cell-q { background: var(--amber-light); }
.ear-no-prov { color: var(--text3); font-size: 12px; font-style: italic; }

/* Provision non applicable : hachurée + atténuée */
.ear-prov-na td {
  background-image: repeating-linear-gradient(45deg, transparent, transparent 9px, rgba(179,38,30,.10) 9px, rgba(179,38,30,.10) 10.5px);
  color: var(--text3);
}
.ear-prov-na .ear-cell-content,
.ear-prov-na .ear-cell-q,
.ear-prov-na .ear-cl-loc { color: var(--text3); }
/* Le survol n'efface pas la hachure (background-color seul, l'image reste) */
.ear-prov-na:hover td { background-color: #fdebec; }

/* Provision supprimée : texte barré + atténué */
.ear-prov-deleted .ear-cell-content,
.ear-prov-deleted .ear-cell-cl,
.ear-prov-deleted .ear-cell-q { color: var(--text3); text-decoration: line-through; text-decoration-color: #c79ab4; }
.ear-prov-deleted .ear-ref-code { color: var(--text3); text-decoration: line-through; }

.ear-q-badge { font-size: 11px; font-weight: 700; color: #1e6b45; background: var(--green-light); border: 1px solid #bfe3cf; border-radius: 5px; padding: 1px 8px; white-space: nowrap; }
.ear-add-q { margin-top: 4px; }
.ear-linked-q { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; padding: 5px 8px; margin-bottom: 5px; background: var(--green-light); border-radius: 5px; }
.ear-linked-q-stale { background: var(--amber-light); }
.ear-linked-q-icon { color: #1e6b45; flex-shrink: 0; }
.ear-linked-q-text { color: var(--text); flex: 1; }
.ear-linked-q-loc { font-size: 10px; color: var(--text3); white-space: nowrap; }
.ear-linked-q-flag { color: var(--amber); flex-shrink: 0; }
.ear-cqm-exigence { background: #f8fbff; border: 1px solid #bfdbfe; border-left: 4px solid var(--accent); border-radius: 7px; padding: 10px 14px; }
.ear-cqm-exigence .ear-prov-path { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.ear-cqm-exigence .ear-prov-text { font-size: 13px; color: var(--text2); line-height: 1.6; white-space: pre-wrap; }
