/* ========================================================================
   DeBlois Légal et Fiscal — Gabarit d'interfaces pour logiciel de gestion
   de livres de minutes (type MinuteBox). Palette et système de design.
   ======================================================================== */

:root {
  /* Palette principale — vert forêt / gris ardoise, sobre et contemporain */
  --navy-900: #1E2A35;
  --navy-800: #2A3947;
  --navy-700: #3E5063;
  --navy-600: #5A6F82;
  --blue-500: #4A6D8C;
  --teal-500: #16382A;
  --gold-500: #2D6A4C;
  --gold-400: #9DBBA9;
  --gold-100: #E7EEEA;

  /* Neutres */
  --gray-25: #FAFBFC;
  --gray-50: #F5F7FA;
  --gray-100: #ECEFF3;
  --gray-200: #DFE3E9;
  --gray-300: #C7CDD6;
  --gray-400: #9AA4B2;
  --gray-500: #6B7688;
  --gray-600: #4B5563;
  --gray-700: #333F52;
  --gray-800: #1F2937;
  --white: #FFFFFF;

  /* États */
  --success-500: #1E8E5A;
  --success-100: #E3F5EC;
  --warning-500: #C9821B;
  --warning-100: #FCF0DC;
  --danger-500: #C23B3B;
  --danger-100: #FBE9E9;
  --info-500: #2C5F9E;
  --info-100: #E7EEF7;

  /* Typo & rayons */
  --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(36, 30, 27, 0.06);
  --shadow-md: 0 4px 14px rgba(36, 30, 27, 0.08);
  --shadow-lg: 0 12px 32px rgba(36, 30, 27, 0.14);
  --sidebar-w: 264px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-sans);
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
h1, h2, h3, h4, p { margin: 0; }

/* ---------- Écran de connexion ---------- */
#screen-login {
  min-height: 100vh;
  display: flex;
}
.login-visual {
  flex: 1.1;
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 55%, var(--teal-500) 130%);
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px;
  position: relative;
  overflow: hidden;
}
.login-visual::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 80% 20%, rgba(200,155,60,0.25), transparent 40%),
                     radial-gradient(circle at 10% 90%, rgba(255,255,255,0.08), transparent 45%);
}
.login-visual > * { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .logo-mark {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; display: block;
}
.brand-texte { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.login-brand .brand-nom { font-size: 22px; font-weight: 700; }
.brand-produit {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold-400);
}
.login-quote { max-width: 420px; font-size: 26px; line-height: 1.45; font-weight: 300; }
.login-quote strong { font-weight: 600; color: var(--gold-400); }
.login-foot { font-size: 12px; opacity: 0.75; }
.login-form-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center; background: var(--white);
}
.login-form { width: 360px; }
.login-form h2 { font-size: 24px; color: var(--navy-900); margin-bottom: 6px; }
.login-form .sub { color: var(--gray-500); margin-bottom: 28px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--gray-800); background: var(--white);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(44,95,158,0.15);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  border: 1px solid transparent; transition: all .15s ease;
}
.btn-primary { background: var(--navy-800); color: var(--white); }
.btn-primary:hover { background: var(--navy-700); }
.btn-gold { background: var(--gold-500); color: var(--white); }
.btn-gold:hover { background: var(--gold-400); }
.btn-outline { background: var(--white); border-color: var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--gray-400); background: var(--gray-50); }
.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger-100); color: var(--danger-500); }
.login-links { display: flex; justify-content: space-between; font-size: 12.5px; margin-top: 14px; }
.login-links a { color: var(--blue-500); font-weight: 600; }
.login-demo { margin-top: 26px; padding: 12px 14px; background: var(--gray-50); border-radius: var(--radius-sm); font-size: 12px; color: var(--gray-500); }

/* ---------- Application (après connexion) ---------- */
#app { display: none; min-height: 100vh; }
#app.active { display: flex; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--navy-900); color: var(--gray-200);
  display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0;
  transition: width .16s ease;
}
.sidebar.collapsed { width: 68px; }
.sidebar.collapsed .brand-texte,
.sidebar.collapsed .sidebar-search,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item .badge,
.sidebar.collapsed .sidebar-footer .who,
.sidebar.collapsed .sidebar-footer .role,
.sidebar.collapsed .sidebar-footer .icon-btn {
  display: none;
}
.sidebar.collapsed .sidebar-brand { flex-direction: column; gap: 10px; padding: 16px 8px; }
.sidebar.collapsed .sidebar-toggle { transform: rotate(180deg); }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 4px; }
.sidebar.collapsed .nav-item .ic { width: auto; font-size: 16px; }
.sidebar.collapsed .sidebar-footer { justify-content: center; padding: 14px 6px; }
.sidebar-toggle {
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06); color: var(--gray-200); display: flex; align-items: center;
  justify-content: center; cursor: pointer; flex-shrink: 0; font-size: 13px; margin-left: auto;
  transition: transform .16s ease;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.16); }
.sidebar-brand {
  display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .logo-mark {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; display: block;
}
.sidebar-brand span.brand-nom {
  font-weight: 700; font-size: 13px; line-height: 1.25; color: var(--white);
  overflow-wrap: break-word; min-width: 0;
}
.sidebar-search { padding: 14px 16px; }
.sidebar-search input {
  width: 100%; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06); color: var(--white); font-size: 13px;
}
.sidebar-search input::placeholder { color: var(--gray-400); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 10px 20px; }
.sidebar-section-title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-300);
  font-weight: 700; padding: 16px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--gray-200); cursor: pointer; margin-bottom: 2px;
}
.nav-item .ic { width: 18px; text-align: center; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,0.06); }
.nav-item.active { background: var(--gold-500); color: var(--white); font-weight: 700; }
.nav-item.active .ic { opacity: 1; }
.nav-item .badge {
  margin-left: auto; background: var(--danger-500); color: var(--white); font-size: 10.5px;
  padding: 1px 6px; border-radius: 999px; font-weight: 700;
}
.sidebar-footer {
  padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--gold-500); color: var(--white);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.sidebar-footer .who { font-size: 12.5px; color: var(--white); font-weight: 600; line-height: 1.3; }
.sidebar-footer .role { font-size: 11px; color: var(--gray-400); }

/* Main column */
.main {
  flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow-y: auto;
}
.topbar {
  height: var(--topbar-h); flex-shrink: 0; background: var(--white); border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between; padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 18px; font-weight: 700; color: var(--navy-900); }
.topbar-breadcrumb { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--gray-50); border: 1px solid var(--gray-200); color: var(--gray-600); position: relative;
  cursor: pointer;
}
.icon-btn:hover { background: var(--gray-100); }
.icon-btn .dot { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger-500); border: 2px solid var(--white); }

.icon-btn-sm {
  width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold-100); border: 1px solid var(--gold-500); color: var(--gold-500);
  cursor: pointer; font-size: 13px; line-height: 1;
}
.icon-btn-sm:hover { background: var(--gold-500); color: white; }

.lv-barre-indeterminee {
  width: 40% !important;
  animation: lv-glisser 1.1s ease-in-out infinite;
}
@keyframes lv-glisser {
  0% { margin-left: -40%; }
  100% { margin-left: 100%; }
}

.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--white); border: 1px solid var(--gray-200); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.10); min-width: 230px; z-index: 60; padding: 6px;
}
.dropdown-menu.open { display: block; }
.dropdown-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 9px 10px; border: none; background: none; border-radius: 6px;
  cursor: pointer; font-size: 13px; color: var(--navy-900);
}
.dropdown-menu button:hover { background: var(--gray-50); }

.content { padding: 26px; flex: 1; }
.page { display: none; }
.page.active { display: block; }

/* Cards / grid utilitaires */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1450px) { .grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-5 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2,1fr);} }

.card {
  background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.card-title { font-size: 13px; font-weight: 700; color: var(--gray-700); margin-bottom: 4px; }
.card-flat { border-radius: var(--radius-md); }

.kpi { display: flex; align-items: flex-start; justify-content: space-between; }
.kpi .value { font-size: 28px; font-weight: 800; color: var(--navy-900); margin-top: 6px; }
.kpi .label { font-size: 12.5px; color: var(--gray-500); }
.kpi .delta { font-size: 12px; font-weight: 700; margin-top: 8px; }
.kpi .delta.up { color: var(--success-500); }
.kpi .delta.down { color: var(--danger-500); }
.kpi-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 14px; }
.section-head h3 { font-size: 15px; color: var(--navy-900); }
.section-head:first-child { margin-top: 0; }

/* Tableaux */
.table-wrap { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; }
.lv-table-scroll { overflow-x: auto; }
.lv-table-scroll table { min-width: 820px; }
.lv-table-scroll th:first-child, .lv-table-scroll td:first-child { min-width: 210px; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500);
  background: var(--gray-50); padding: 12px 16px; border-bottom: 1px solid var(--gray-200); font-weight: 700;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--gray-100); font-size: 13.5px; color: var(--gray-700); overflow-wrap: break-word; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-25); }
.cell-main { font-weight: 700; color: var(--navy-900); }
.cell-sub { color: var(--gray-500); font-size: 12px; }

.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
}
.tag-success { background: var(--success-100); color: var(--success-500); }
.tag-warning { background: var(--warning-100); color: var(--warning-500); }
.tag-danger { background: var(--danger-100); color: var(--danger-500); }
.tag-info { background: var(--info-100); color: var(--info-500); }
.tag-gray { background: var(--gray-100); color: var(--gray-600); }
.tag-forfait { background: var(--gold-100); color: var(--gold-500); }

.status-pastille { display: inline-flex; align-items: center; gap: 6px; }
.status-pastille .puce { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-pastille .puce.on { background: var(--success-500); box-shadow: 0 0 0 3px var(--success-100); }
.status-pastille .puce.off { background: var(--gray-400); }
.status-pastille .puce.attention { background: var(--warning-500); box-shadow: 0 0 0 3px var(--warning-100); }

.grid-shares { grid-template-columns: 1.7fr 1fr; align-items: start; }
@media (max-width: 1200px) { .grid-shares { grid-template-columns: 1fr; } }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search-box {
  display: flex; align-items: center; gap: 8px; background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); padding: 8px 12px; flex: 1; min-width: 220px; max-width: 360px; color: var(--gray-500);
}
.search-box input { border: none; outline: none; flex: 1; font-size: 13.5px; background: transparent; }
.select-filter {
  padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); background: var(--white);
  font-size: 13px; color: var(--gray-700);
}
.spacer { flex: 1; }

/* Onglets internes (fiche société) */
/* Défilement horizontal avec flèches bien visibles — réutilisé pour la
   barre d'onglets ET pour un tableau trop large (voir .defile-x posé sur
   l'élément qui défile vraiment à l'intérieur). Les flèches flottent en
   cercle plein par-dessus un dégradé de fondu, plutôt qu'un chevron gris
   fin sur fond blanc qu'on remarque à peine. */
.defile-wrap { display: flex; align-items: center; gap: 0; margin-bottom: 20px; position: relative; }
.defile-wrap > .defile-x {
  flex: 1; min-width: 0; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none;
}
.defile-wrap > .defile-x::-webkit-scrollbar { display: none; }
.defile-wrap.sans-marge { margin-bottom: 0; }
.defile-fleche {
  flex-shrink: 0; position: relative; z-index: 2; width: 30px; height: 30px; margin: 0 4px;
  border: none; border-radius: 50%; background: var(--navy-800); color: var(--white);
  cursor: pointer; font-size: 17px; line-height: 1; font-weight: 700;
  box-shadow: 0 2px 6px rgba(30,42,53,0.35);
  display: none; align-items: center; justify-content: center;
}
.defile-fleche:hover { background: var(--gold-500); }
/* Masquées par défaut — _majFlechesDefilement() ne les montre que du côté
   où il reste vraiment quelque chose à atteindre, pour ne jamais laisser
   une flèche cliquable qui ne ferait rien. */
.defile-wrap.peut-reculer .defile-fleche-gauche,
.defile-wrap.peut-avancer .defile-fleche-droite { display: flex; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--gray-200); margin-bottom: 20px; overflow-x: auto; }
.tab-item {
  padding: 11px 16px; font-size: 13.5px; font-weight: 600; color: var(--gray-500); border-bottom: 2.5px solid transparent;
  white-space: nowrap; cursor: pointer; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: background .12s ease, color .12s ease;
}
.tab-item:hover { color: var(--navy-800); background: var(--gray-50); }
.tab-item.active {
  color: var(--gold-500); font-weight: 700; border-color: var(--gold-500); background: var(--gold-100);
}
.tab-item.active:hover { background: var(--gold-100); }

.subtabs-panel { display: none; }
.subtabs-panel.active { display: block; }

/* En-tête fiche société */
.entity-header {
  display: flex; align-items: center; gap: 16px; background: var(--white); border: 1px solid var(--gray-200);
  border-left: 4px solid var(--etat-couleur, var(--gray-300));
  border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 20px;
}
.entity-logo {
  width: 54px; height: 54px; border-radius: var(--radius-md); background: var(--navy-800); color: var(--gold-400);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 26px; flex-shrink: 0;
}
.entity-header h2 { font-size: 19px; color: var(--navy-900); }
.entity-header .meta { font-size: 12.5px; color: var(--gray-500); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.entity-header .meta span { display: flex; align-items: center; gap: 5px; }
.entity-header .meta-identite { margin-top: 5px; }
.entity-header .meta-identite > span:not(:last-child) { position: relative; padding-right: 14px; }
.entity-header .meta-identite > span:not(:last-child)::after {
  content: ""; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 3px; border-radius: 50%; background: var(--gray-300);
}
.entity-header .meta-statut {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--gray-200); gap: 8px;
}
.entity-header .actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }

/* Barre de progression conformité */
.progress-bar { height: 8px; border-radius: 999px; background: var(--gray-100); overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--gold-500); border-radius: 999px; }

/* Timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--gray-200); }
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -22px; top: 3px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--white); border: 3px solid var(--gold-500);
}
.timeline-item .t-date { font-size: 11px; color: var(--gray-500); font-weight: 700; text-transform: uppercase; }
.timeline-item .t-title { font-size: 13.5px; font-weight: 700; color: var(--navy-900); margin-top: 2px; }
.timeline-item .t-desc { font-size: 12.5px; color: var(--gray-500); margin-top: 2px; }

/* Organigramme */
.orgchart { display: flex; flex-direction: column; align-items: center; gap: 34px; padding: 20px 0; overflow-x: auto; }
.org-row { display: flex; gap: 40px; position: relative; }
.org-node {
  background: var(--white); border: 1.5px solid var(--gray-200); border-radius: var(--radius-md); padding: 14px 18px;
  min-width: 190px; text-align: center; box-shadow: var(--shadow-sm); position: relative;
}
.org-node.root { border-color: var(--gold-500); background: var(--navy-900); color: var(--white); }
.org-node .pct { font-size: 11px; color: var(--gold-500); font-weight: 800; margin-top: 4px; }
.org-node.root .pct { color: var(--gold-400); }
.org-node .name { font-weight: 700; font-size: 13.5px; }
.org-node .role { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.org-node.root .role { color: var(--gray-300); }
.org-connector { width: 2px; background: var(--gray-300); height: 34px; margin: 0 auto; }

/* Panneau latéral (drawer) */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(11,30,58,0.45); display: none; z-index: 90;
}
.drawer-overlay.active { display: block; }
.drawer {
  position: fixed; top: 0; right: -480px; width: 460px; height: 100vh; background: var(--white); z-index: 91;
  box-shadow: var(--shadow-lg); transition: right .25s ease; display: flex; flex-direction: column;
}
.drawer.active { right: 0; }
.drawer-head { padding: 20px 22px; border-bottom: 1px solid var(--gray-200); display: flex; justify-content: space-between; align-items: center; }
.drawer-head h3 { font-size: 16px; color: var(--navy-900); }
.drawer-body { padding: 22px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 16px 22px; border-top: 1px solid var(--gray-200); display: flex; gap: 10px; justify-content: flex-end; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(11,30,58,0.5); display: none; align-items: center; justify-content: center; z-index: 95; }
.modal-overlay.active { display: flex; }
.modal { width: 520px; max-width: 92vw; background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); max-height: 88vh; display: flex; flex-direction: column; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--gray-200); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 16px; color: var(--navy-900); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--gray-200); display: flex; gap: 10px; justify-content: flex-end; }

/* Livre de minutes — table unique groupée par section (remplace l'ancienne
   arborescence séparée, qui doublait la même information que le tableau).
   Répertoires aux couleurs du portail client (crème / encre / or) : même
   société, mêmes documents — les deux surfaces se reconnaissent du premier
   coup d'œil, et la bande crème détache clairement chaque répertoire. */
.table-pieces .ligne-section { cursor: pointer; background: #EDEAE7; }
.table-pieces .ligne-section:hover { background: #E6E2DE; }
.table-pieces .ligne-section td {
  font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: #241E1B; padding: 12px 16px; border-bottom: 1px solid #E0DBD6;
  border-top: 1px solid #E0DBD6;
  transition: background .12s ease;
}
.table-pieces tr:first-child.ligne-section td { border-top: none; }
/* Pastille de compte, comme les sections du portail : disque clair à bordure
   fine, plus net que « (12) » collé au nom du répertoire. */
.pastille-section {
  display: inline-block; min-width: 20px; padding: 1px 7px; margin-left: 2px;
  border-radius: 999px; background: #FFFFFF; border: 1px solid rgba(36, 30, 27, .18);
  color: #241E1B; font-size: 11px; font-weight: 600; line-height: 16px;
  text-align: center; vertical-align: 1px;
}
.caret-section {
  display: inline-block; width: 11px; margin-right: 8px; font-size: 11px;
  color: #BEA745; transition: transform .15s ease;
}
.table-pieces .section-repliee .caret-section { transform: rotate(-90deg); }
/* Décalage visuel des documents sous leur section : la colonne Document
   gagne un retrait, et une mince bordure verticale rappelle qu'ils
   appartiennent au dossier juste au-dessus — plutôt qu'un simple
   alignement identique qui ne montrait pas la hiérarchie dossier/fichier. */
.table-pieces .ligne-doc td:first-child {
  padding-left: 40px; position: relative; border-left: 2px solid transparent;
}
.table-pieces .ligne-doc:hover td:first-child { border-left-color: var(--gold-400); }
.table-pieces .ligne-doc:hover { background: var(--gray-50); }
.table-pieces .ligne-doc td { transition: background .1s ease; }

/* Mention « à signer » : pastille dorée accolée au nom du document. */
.badge-a-signer {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  background: var(--gold-100); border: 1px solid var(--gold-500);
  color: var(--gold-500); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; vertical-align: middle;
}

/* Calendrier conformité */
.cal-legend { display: flex; gap: 16px; font-size: 12px; color: var(--gray-500); margin-bottom: 14px; }
.cal-legend span { display: flex; align-items: center; gap: 6px; }
.dotlg { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-cell {
  aspect-ratio: 1; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 8px; font-size: 12px; background: var(--white); position: relative;
}
.cal-cell .num { font-weight: 700; color: var(--gray-600); }
.cal-cell.today { border-color: var(--gold-500); background: var(--gold-100); }
.cal-cell .evt { margin-top: 5px; font-size: 10px; padding: 2px 5px; border-radius: 4px; font-weight: 700; }
.cal-cell.muted { opacity: .35; }

/* Certificat d'actions (aperçu visuel) */
.certificate {
  border: 3px double var(--gold-500); border-radius: var(--radius-md); padding: 26px; background: var(--gold-100);
  background-image: repeating-linear-gradient(45deg, rgba(200,155,60,0.05) 0 10px, transparent 10px 20px);
}
.certificate h4 { text-align: center; color: var(--navy-900); font-size: 16px; letter-spacing: .04em; }
.certificate .sub-c { text-align: center; font-size: 11px; color: var(--gray-500); margin-top: 2px; text-transform: uppercase; letter-spacing: .08em; }
.cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; font-size: 12.5px; }
.cert-grid .lbl { color: var(--gray-500); font-size: 10.5px; text-transform: uppercase; }
.cert-grid .val { font-weight: 700; color: var(--navy-900); margin-top: 2px; }
.cert-sign { display: flex; justify-content: space-between; margin-top: 30px; }
.cert-sign .line { width: 160px; border-top: 1px solid var(--gray-400); text-align: center; padding-top: 6px; font-size: 11px; color: var(--gray-500); }

/* Empty state */
.empty-state { text-align: center; padding: 50px 20px; color: var(--gray-500); }
.empty-state .ic { font-size: 34px; margin-bottom: 10px; }

/* Checkbox / roles matrix */
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: var(--gray-300); border-radius: 999px; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; height: 14px; width: 14px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--success-500); }
.switch input:checked + .slider::before { transform: translateX(16px); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--gray-100); border-radius: 999px; padding: 4px 10px; font-size: 12px; color: var(--gray-700); font-weight: 600;
}
.avatar-sm { width: 26px; height: 26px; border-radius: 50%; background: var(--navy-700); color: white; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; }
.chip-personne {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 14px;
  font-size: 12.5px; font-weight: 600; color: var(--gold-500);
  background: var(--gold-100); border: 1.5px solid var(--gold-500);
}

.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }

.text-muted { color: var(--gray-500); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Branchement au moteur réel (serveur.py / moteur.py) ---------- */
.lv-source {
  font-size: 11.5px; color: var(--gray-500); background: var(--gray-50);
  border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
  padding: 6px 10px; margin: -6px 0 14px;
}
.lv-erreur {
  background: var(--danger-100); color: var(--danger-500); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 12.5px; margin-bottom: 14px; white-space: pre-line;
}
.lv-nouvelle-personne {
  margin-top: 8px; padding: 10px; background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
}
/* Fonctions de dirigeant cumulables : cases sur deux colonnes, champ libre dessous. */
.lv-fonctions-multi {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; margin-bottom: 8px;
}
.lv-fonction-case {
  display: flex !important; align-items: center; gap: 7px; margin: 0 !important;
  font-weight: 400 !important; color: var(--gray-600); font-size: 13px !important;
}
.lv-fonction-case input[type="checkbox"] { width: auto; margin: 0; }
/* Case « Administrateur » du champ multi_fonctions : rôle distinct des
   fonctions de dirigeant — pleine largeur, filet de séparation discret. */
.lv-fonction-admin {
  grid-column: 1 / -1; border-top: 1px dashed var(--gray-300, #d1d5db);
  padding-top: 6px; margin-top: 2px !important;
  font-weight: 600 !important; color: var(--gray-800, #1f2937) !important;
}
.lv-fonctions-alerte {
  font-size: 12px; color: var(--danger-500, #C0392B); margin: 2px 0 6px; line-height: 1.4;
}
.lv-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 500;
  padding: 12px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg); color: var(--white);
  animation: lv-toast-in .15s ease-out;
}
.lv-toast.succes { background: var(--success-500); }
.lv-toast.erreur { background: var(--danger-500); }
@keyframes lv-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.lv-toast-documents {
  position: fixed; bottom: 24px; right: 24px; z-index: 500; max-width: 360px;
  background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 14px 16px; animation: lv-toast-in .15s ease-out;
}
.lv-toast-documents .titre { font-weight: 700; font-size: 13.5px; color: var(--gray-800); margin-bottom: 2px; }
.lv-toast-documents .sous-titre { font-size: 12px; color: var(--gray-500); margin-bottom: 10px; }
.lv-toast-documents .puces { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.lv-toast-documents .puce-doc {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  background: var(--gold-100); color: var(--gold-500); border-radius: 999px;
  padding: 5px 11px; font-size: 12px; font-weight: 600; border: none;
}
.lv-toast-documents .puce-doc:hover { background: var(--gold-400); color: var(--white); }
.lv-toast-documents .lien-journal {
  font-size: 11.5px; color: var(--blue-500); cursor: pointer; text-decoration: underline;
}
.lv-toast-documents .fermer {
  position: absolute; top: 8px; right: 10px; cursor: pointer; color: var(--gray-400);
  font-size: 14px; background: none; border: none;
}

/* Capital autorisé — charte standard du cabinet */
.charte-standard-mention {
  margin: 0 0 10px; padding: 8px 12px; font-size: 12.5px; color: var(--navy-900, #1a2e4a);
  background: #eef3fa; border: 1px solid #c9d8ec; border-radius: 6px;
}
.charte-standard-badge {
  display: inline-block; margin-left: 8px; padding: 1px 8px; font-size: 11px; font-weight: 600;
  color: #1a2e4a; background: #dce8f8; border: 1px solid #b3cbe8; border-radius: 10px;
  vertical-align: middle; white-space: nowrap;
}

/* ---- Livre physique ou virtuel (Sommaire) ---------------------------------------- */
.lv-format { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .lv-format { grid-template-columns: 1fr; } }
.lv-format-choix {
  display: flex; align-items: flex-start; gap: 12px; text-align: left; font: inherit;
  padding: 14px 16px; background: var(--white); color: var(--gray-700); cursor: pointer;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-md);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.lv-format-choix:hover { border-color: var(--gray-400); background: var(--gray-25); }
.lv-format-choix:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.lv-format-choix.est-actif { border-color: var(--navy-800); background: var(--gray-50); box-shadow: inset 0 0 0 1px var(--navy-800); }
.lv-format-choix.est-actif .lv-format-titre::after { content: " ✓"; color: var(--success-500); }
.lv-format-icone { font-size: 22px; line-height: 1.2; }
.lv-format-titre { display: block; font-size: 14px; font-weight: 700; color: var(--navy-900); }
.lv-format-texte { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--gray-500); }
.lv-garde {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px;
  margin-top: 16px; padding: 12px 14px; border: 1px solid; border-radius: var(--radius-md);
}
.lv-garde-texte { display: flex; align-items: center; gap: 10px; flex: 1 1 280px; font-size: 13px; line-height: 1.45; }
.lv-garde-point { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lv-garde.au-cabinet { background: var(--success-100); border-color: #BFE6D1; }
.lv-garde.au-cabinet .lv-garde-point { background: var(--success-500); }
.lv-garde.remis { background: var(--warning-100); border-color: #F0D9A8; }
.lv-garde.remis .lv-garde-point { background: var(--warning-500); }
.lv-garde.inconnue { background: var(--gray-50); border-color: var(--gray-200); }
.lv-garde.inconnue .lv-garde-point { background: var(--gray-400); }
.lv-garde-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lv-inv-sous-titre { margin: 18px 0 8px; font-size: 12.5px; font-weight: 700; color: var(--gray-600); }

/* ---- Personnes clés (Sommaire) : une carte compacte par personne, en grille ------- */
.lv-personnes-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 440px)); gap: 12px; }
@media (max-width: 720px) { .lv-personnes-grille { grid-template-columns: 1fr; } }
.lv-personnes-vide { grid-column: 1 / -1; }
.carte-personne-cle {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer;
  background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
}
.carte-personne-cle:hover { border-color: var(--gray-300); box-shadow: var(--shadow-md); }
.carte-personne-avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--gold-100); color: var(--gold-500); font-size: 14px; font-weight: 700; letter-spacing: .02em;
}
.carte-personne-corps { flex: 1 1 auto; min-width: 0; }
.carte-personne-nom { font-size: 14px; font-weight: 600; color: var(--navy-900); overflow-wrap: anywhere; }
.carte-personne-depuis { margin-top: 1px; font-size: 11.5px; color: var(--gray-500); }
.carte-personne-coordonnees { margin-top: 5px; font-size: 11.5px; line-height: 1.55; color: var(--gray-600);
                             overflow-wrap: anywhere; }
.carte-organisation .carte-personne-avatar { background: var(--gray-100); font-size: 18px; }
.tag-ancien { background: var(--gray-100); color: var(--gray-500); font-style: italic; }
.lien-contact { color: var(--blue-600, #1d4ed8); text-decoration: none; }
.lien-contact:hover { text-decoration: underline; }
.carte-personne-roles { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.carte-personne-anneaux { flex: none; display: flex; gap: 12px; }

/* ---- En-têtes de tableau triables (Capital autorisé) ----------------------------- */
th.triable { cursor: pointer; user-select: none; white-space: nowrap; }
th.triable:hover { color: var(--navy-900); }
th.triable:focus-visible { outline: 2px solid var(--blue-500); outline-offset: -2px; }
th.triable::after { content: "↕"; margin-left: 6px; font-size: 11px; opacity: .35; }
th.triable[aria-sort="ascending"]::after { content: "▲"; opacity: 1; color: var(--navy-800); }
th.triable[aria-sort="descending"]::after { content: "▼"; opacity: 1; color: var(--navy-800); }

/* Barre de filtres du capital autorisé : une seule ligne sur un écran de bureau */
.lv-capital-barre { flex-wrap: wrap; gap: 8px; }
.lv-capital-barre .search-box { flex: 1 1 190px; min-width: 170px; max-width: 230px; }
.lv-capital-barre .select-filter { width: auto; max-width: 158px; text-overflow: ellipsis; }

/* ---- Onglet Validation : état du livre et décision ---------------------------------- */
.lv-validation-carte { max-width: 780px; }
.lv-validation-etat-ligne { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 14px; }
.lv-validation-etat { font-size: 14px; padding: 8px 14px; white-space: nowrap; }
.lv-parcours { display: flex; align-items: flex-start; margin-top: 22px; }
.lv-etape { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.lv-etape::before { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--gray-200); }
.lv-etape:first-child::before { display: none; }
.lv-etape.fait::before, .lv-etape.actif::before { background: var(--success-500); }
.lv-etape-point {
  position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--white); border: 2px solid var(--gray-300); color: var(--gray-500); font-size: 12px; font-weight: 700;
}
.lv-etape.fait .lv-etape-point { background: var(--success-500); border-color: var(--success-500); color: var(--white); }
.lv-etape.actif .lv-etape-point { background: var(--navy-800); border-color: var(--navy-800); color: var(--white); }
.lv-etape.actif.attention .lv-etape-point { background: var(--warning-500); border-color: var(--warning-500); }
.lv-etape-libelle { margin-top: 6px; font-size: 11.5px; color: var(--gray-500); }
.lv-etape.actif .lv-etape-libelle { color: var(--navy-900); font-weight: 700; }
.lv-validation-texte { margin-top: 18px; font-size: 13px; line-height: 1.55; color: var(--gray-700); }

/* Champ à choix + saisie libre (liste de suggestions toujours signalée par sa flèche) */
.lv-champ-choix::-webkit-calendar-picker-indicator { opacity: .65; cursor: pointer; }
.lv-champ-choix::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* Version déployée (affichée pour vérifier qu'on regarde bien le dernier déploiement) */
.lv-version { font-size: 10.5px; letter-spacing: .02em; opacity: .75; cursor: help; }

/* ---- Paramètres → Sécurité ------------------------------------------------------------ */
.lv-securite-groupe { margin: 24px 0 4px; padding-bottom: 6px; border-bottom: 1px solid var(--gray-100); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-500); }
.lv-securite-ligne { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--gray-100); }
.lv-securite-ligne:last-child { border-bottom: 0; }
.lv-securite-titre { font-size: 13.5px; font-weight: 600; color: var(--navy-900); }
.lv-securite-aide { margin-top: 4px; font-size: 12px; line-height: 1.55; }

/* ---- Rapports du portefeuille ------------------------------------------------------------- */
.lv-rap-filtres { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lv-rap-filtres .search-box { flex: 1 1 220px; max-width: 320px; }
.lv-rap-resume { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.lv-rap-plus { display: flex; justify-content: center; margin-top: 14px; }
tr.lv-rap-ligne { cursor: pointer; }
tr.lv-rap-detail > td { background: var(--gray-50); padding: 12px 18px; font-size: 12.5px; line-height: 1.6; }
.lv-rap-detail-liste { margin: 4px 0 10px; padding-left: 18px; }
.lv-rap-barre { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.lv-rap-barre .progress-bar { flex: 1; }
.lv-doc-carte { margin-bottom: 14px; }
.lv-doc-titre { margin: 0 0 10px; font-size: 14px; color: var(--navy-900); }
.lv-doc-paires { display: grid; grid-template-columns: 220px 1fr; gap: 6px 16px; font-size: 13px; }
.lv-doc-paires > span:nth-child(odd) { color: var(--gray-500); font-weight: 600; }
.lv-doc-point { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--gray-100); font-size: 13px; }
.lv-doc-point:last-child { border-bottom: 0; }
.lv-doc-point .tag { flex: none; min-width: 74px; justify-content: center; }
@media (max-width: 720px) { .lv-doc-paires { grid-template-columns: 1fr; } }

/* ---- Tuile d'import en arrière-plan (barre du haut) ---------------------------------------- */
.lv-tuile-import {
  display: none; align-items: center; gap: 9px; height: 40px; padding: 0 16px 0 5px; cursor: pointer;
  font: inherit; color: var(--navy-900); background: var(--gold-100);
  border: 1px solid transparent; border-radius: 20px; box-shadow: var(--shadow-sm);
  transition: background .25s, border-color .25s, box-shadow .2s, transform .15s;
}
.lv-tuile-import:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.lv-tuile-import:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.lv-tuile-import[data-etat="pret"] { background: var(--success-100); border-color: var(--success-500); }
.lv-tuile-import[data-etat="echec"] { background: var(--danger-100); border-color: var(--danger-500); }
.lv-anneau-boite { position: relative; flex: none; width: 30px; height: 30px; }
.lv-anneau { width: 100%; height: 100%; transform: rotate(-90deg); }
.lv-anneau-fond, .lv-anneau-arc { fill: none; stroke-width: 3.6; }
.lv-anneau-fond { stroke: rgba(15, 30, 45, .12); }
.lv-anneau-arc { stroke: var(--gold-500); stroke-linecap: round; transition: stroke-dasharray .45s ease, stroke .25s; }
.lv-tuile-import[data-etat="pret"] .lv-anneau-arc { stroke: var(--success-500); }
.lv-tuile-import[data-etat="echec"] .lv-anneau-arc { stroke: var(--danger-500); }
.lv-anneau-icone { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; }
.lv-anneau-icone > span { display: inline-block; }
.lv-tuile-import[data-etat="pret"] .lv-anneau-icone, .lv-tuile-import[data-etat="echec"] .lv-anneau-icone { font-weight: 800; font-size: 14px; }
.lv-tuile-import[data-etat="pret"] .lv-anneau-icone { color: var(--success-500); }
.lv-tuile-import[data-etat="echec"] .lv-anneau-icone { color: var(--danger-500); }
.lv-tuile-texte { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.lv-tuile-pct { font-size: 14px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.lv-tuile-detail { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; color: var(--gray-600); }
/* Mouvement : le sablier se retourne; l'anneau tourne tant qu'on ne connaît pas encore la progression. */
@keyframes lv-sablier { 0%, 55% { transform: rotate(0); } 70%, 100% { transform: rotate(180deg); } }
@keyframes lv-tourne { to { transform: rotate(270deg); } }
@keyframes lv-pret { 0% { box-shadow: 0 0 0 0 rgba(31, 138, 91, .45); } 100% { box-shadow: 0 0 0 10px rgba(31, 138, 91, 0); } }
.lv-tuile-import[data-etat="en_cours"] #lv-import-fond-icone { animation: lv-sablier 3s ease-in-out infinite; }
.lv-tuile-import.indetermine .lv-anneau { animation: lv-tourne 1.1s linear infinite; }
.lv-tuile-import.indetermine .lv-anneau-arc { stroke-dasharray: 26 74 !important; transition: none; }
.lv-tuile-import[data-etat="pret"] { animation: lv-pret 1.4s ease-out 2; }
@media (prefers-reduced-motion: reduce) {
  .lv-tuile-import, .lv-tuile-import * { animation: none !important; transition: none !important; }
}
@media (max-width: 900px) { .lv-tuile-detail { display: none; } .lv-tuile-import { padding-right: 12px; } }

/* Pastille du n° de dossier (lignes de liste : texte seul, le clic ouvre la société) */
.lv-chip-dossier {
  display: inline-flex; align-items: center; padding: 1px 8px; font-size: 11px; font-weight: 600; white-space: nowrap;
  background: var(--gold-100); color: var(--gold-500); border-radius: 999px;
}

/* ---- Livre de minutes : filtres et colonnes ---------------------------------------------- */
.lv-pieces-filtres { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 8px; }
.lv-pieces-dates { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-600); }
.lv-pieces-dates input[type="date"] { padding: 5px 8px; font-size: 12px; border: 1px solid var(--gray-200); border-radius: 8px; background: var(--white); }
.lv-date-fichier { display: inline-block; margin-left: 6px; padding: 0 6px; font-size: 10.5px; font-style: italic; color: var(--gray-600);
                   background: var(--gray-100); border-radius: 999px; cursor: help; white-space: nowrap; }
.lv-sec-tag { margin-top: 2px; font-size: 11px; color: var(--gray-500); font-weight: 400; }
.lv-modif-date { font-size: 11px; color: var(--gray-500); margin-left: 4px; cursor: pointer; opacity: .55; }
.lv-modif-date:hover { opacity: 1; }
.table-pieces .badge-a-signer { margin-left: 0; white-space: nowrap; }

/* ---- Bulle d'explication de la validation ------------------------------------------------------ */
.lv-validation-carte { position: relative; }
.lv-etape:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 3px; border-radius: 8px; }
.lv-bulle { position: absolute; z-index: 30; top: 48px; right: 0; left: 0; max-width: 100%; background: var(--white);
            border: 1px solid var(--gray-200); border-radius: var(--radius-md); box-shadow: var(--shadow-lg, 0 12px 32px rgba(15, 30, 45, .18)); }
.lv-bulle::before { content: ""; position: absolute; top: -7px; right: 36px; width: 12px; height: 12px; background: var(--white);
                    border-left: 1px solid var(--gray-200); border-top: 1px solid var(--gray-200); transform: rotate(45deg); }
.lv-bulle-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--gray-100); }
.lv-bulle-corps { max-height: 68vh; overflow-y: auto; padding: 12px 16px 16px; position: relative; }
.lv-bulle-intro { font-size: 12.5px; line-height: 1.55; color: var(--gray-700); margin: 0 0 12px; }
.lv-bulle-etat { padding: 10px 12px; margin: 0 0 10px; border: 1px solid var(--gray-200); border-radius: 10px; }
.lv-bulle-etat.courant { border-color: var(--navy-800); box-shadow: 0 0 0 2px rgba(31, 47, 66, .12); background: var(--gray-50); }
.lv-bulle-etat h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 13.5px; }
.lv-bulle-num { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 50%; background: var(--navy-800); color: var(--white); font-size: 11px; }
.lv-bulle-ici { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--navy-800); color: var(--white); font-size: 10.5px; font-weight: 700; }
.lv-bulle-etat p { margin: 0 0 6px; font-size: 12.5px; line-height: 1.5; }
.lv-bulle-effets { margin: 0 0 8px; padding-left: 18px; font-size: 12px; line-height: 1.55; color: var(--gray-700); }
.lv-bulle-effets li { margin-bottom: 3px; }
.lv-bulle-faits { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 11.5px; color: var(--gray-600); margin-bottom: 6px; }
.lv-bulle-sous-titre { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500); margin: 4px 0; }
.lv-bulle-actions ul { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.5; }
.lv-bulle-meta { display: block; font-size: 11px; color: var(--gray-500); }
.lv-bulle-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.lv-bulle-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; color: var(--gray-500); padding: 4px 6px; border-bottom: 1px solid var(--gray-200); }
.lv-bulle-table td { padding: 5px 6px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
@media (max-width: 700px) { .lv-bulle { top: 88px; } .lv-bulle-corps { max-height: 60vh; } }
.lv-bulle-effets, .lv-bulle-actions ul { list-style: disc; }

/* ---- Indicateurs d'activité (lecture / analyse de documents) ------------------------------------ */
/* Spinner : anneau tournant dans la couleur de marque — accompagne
   systématiquement un texte d'état pour que l'utilisateur voie d'un coup
   d'œil que le logiciel travaille vraiment, même si la lecture dure. */
.lv-spinner { display: inline-block; width: 16px; height: 16px; flex: none;
              border: 2.5px solid var(--gold-100, #E7EEEA); border-top-color: var(--gold-500, #2D6A4C);
              border-radius: 50%; animation: lv-tourne .8s linear infinite; vertical-align: -3px; }
@keyframes lv-tourne { to { transform: rotate(360deg); } }

/* Ligne d'état d'analyse : symbole + texte coloré + minuteur de durée. */
.lv-analyse-en-cours { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
                       background: var(--gold-100, #E7EEEA); border: 1px solid var(--gold-400, #9DBBA9);
                       border-radius: var(--radius-sm, 6px); color: var(--teal-500, #16382A);
                       font-size: 12.5px; font-weight: 600; }
.lv-analyse-duree { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700;
                    background: var(--white); border-radius: 999px; padding: 1px 8px;
                    border: 1px solid var(--gold-400, #9DBBA9); font-size: 11.5px; white-space: nowrap; }

/* Barre de progression indéterminée : glissement continu, couleur de marque —
   pour les lectures dont la durée totale ne peut pas être connue d'avance
   (OCR, PDF volumineux). La durée écoulée s'affiche à côté du symbole. */
.lv-barre-indeterminee { position: relative; height: 4px; margin-top: 6px; overflow: hidden;
                         background: var(--gray-100, #ECEFF3); border-radius: 999px; }
.lv-barre-indeterminee::before { content: ""; position: absolute; top: 0; bottom: 0; width: 40%;
                                 border-radius: 999px; background: var(--gold-500, #2D6A4C);
                                 animation: lv-glisse 1.4s ease-in-out infinite; }
@keyframes lv-glisse { 0% { left: -40%; } 100% { left: 100%; } }

/* Zone de glisser-déposer sur l'onglet Livre de minutes : un voile en
   pointillés recouvre le panneau pendant qu'un glisser de fichiers le
   survole, jusqu'au dépôt qui ouvre l'assistant d'import. */
#tab-documents { position: relative; }
#tab-documents.lv-depot-glisse-actif::after {
  content: "Déposez pour importer : lecture, datation, classement par section, opérations proposées à la relecture…";
  position: absolute; inset: 6px; z-index: 40; pointer-events: none;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 24px; border: 2.5px dashed var(--gold-500, #2D6A4C); border-radius: 12px;
  background: rgba(255, 255, 255, .93); color: var(--navy-800, #16324A);
  font-size: 14.5px; font-weight: 600; line-height: 1.5;
}

/* Icône par défaut de la société : l'image porte son propre fond arrondi — le cadre n'ajoute ni fond ni marge. */
.entity-logo-icone { background: transparent; padding: 0; overflow: hidden; }
.entity-logo-icone img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

/* ---- Livre de minutes : barre épurée, panneau de filtres, pastilles des filtres actifs ------------------------- */
.lv-barre-pieces { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 8px; }
.lv-barre-pieces .spacer { flex: 1 1 0; }
.lv-filtre-zone { position: relative; }
.lv-badge-filtres { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
                    margin-left: 4px; border-radius: 999px; background: var(--navy-800); color: #fff; font-size: 11px; font-weight: 700; }
.lv-badge-filtres[hidden] { display: none; }
.lv-filtres-panneau { position: absolute; z-index: 45; top: calc(100% + 6px); left: 0; width: min(460px, 92vw); background: var(--white);
                      border: 1px solid var(--gray-200); border-radius: var(--radius-md); box-shadow: 0 12px 32px rgba(15, 30, 45, .16); padding: 14px 16px; }
.lv-filtres-panneau[hidden] { display: none; }
.lv-fp-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.lv-fp-grille label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--gray-600); }
.lv-fp-grille select, .lv-fp-grille input[type="date"] { width: 100%; padding: 7px 9px; border: 1px solid var(--gray-200); border-radius: 8px;
                                                          font-size: 13px; background: var(--white); color: var(--navy-900); }
.lv-fp-large { grid-column: 1 / -1; }
.lv-fp-dates { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.lv-fp-pied { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--gray-100); font-size: 12.5px; }
.lv-segment { display: inline-flex; border: 1px solid var(--gray-200); border-radius: 8px; overflow: hidden; background: var(--white); }
.lv-segment button { border: 0; background: transparent; padding: 6px 12px; font-size: 12.5px; cursor: pointer; color: var(--gray-600); }
.lv-segment button + button { border-left: 1px solid var(--gray-200); }
.lv-segment button[aria-pressed="true"] { background: var(--navy-800); color: #fff; }
#lv-rapide-a-signer[aria-pressed="true"] { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
#lv-rapide-a-signer[aria-pressed="true"] .text-muted { color: rgba(255, 255, 255, .8); }
.lv-chips-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 24px; margin: 0 0 8px; }
.lv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lv-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--gray-100); font-size: 12px; color: var(--navy-900); }
.lv-chip button { border: 0; background: transparent; cursor: pointer; width: 18px; height: 18px; border-radius: 50%; font-size: 12px; line-height: 1; color: var(--gray-600); }
.lv-chip button:hover { background: var(--gray-200); color: var(--navy-900); }
.lv-selection-barre { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; margin: 0 0 8px; border-radius: 8px;
                      background: var(--gold-100); border: 1px solid var(--gray-200); font-size: 12.5px; }
.lv-selection-barre[hidden] { display: none; }
.dropdown-menu.droite { left: auto; right: 0; }
.dropdown-titre { padding: 6px 10px 2px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); }
.dropdown-sep { height: 1px; background: var(--gray-100); margin: 6px 4px; }
@media (max-width: 700px) {
  .lv-fp-grille { grid-template-columns: 1fr; }
  .lv-barre-pieces .spacer { display: none; }
  /* Téléphone : le panneau s'ancre à toute la largeur de la barre (et non au bouton, qui peut être loin du bord gauche). */
  .lv-filtre-zone { position: static; }
  .lv-filtres-panneau { left: 0; right: 0; width: auto; top: calc(100% + 4px); }
}

/* ---- Administrateurs et dirigeants : une fiche par PERSONNE (avatar à initiales, rôles en pastilles) ---------- */
.eq-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.eq-boutons { display: flex; gap: 8px; flex-wrap: wrap; }
.eq-grille { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.eq-fiche { display: flex; gap: 14px; align-items: flex-start; padding: 15px 16px; border: 1px solid var(--gray-200); border-radius: var(--radius-md);
            background: linear-gradient(var(--white), var(--gray-50)); }
.eq-fiche.ancienne { opacity: .8; background: var(--gray-50); }
.eq-avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
             font-weight: 700; font-size: 15px; letter-spacing: .4px; color: var(--gold-500); background: var(--gold-100); border: 1.5px solid var(--gold-400); }
.eq-corps { min-width: 0; flex: 1; }
.eq-nom { font-weight: 700; font-size: 14.5px; color: var(--navy-900); line-height: 1.3; cursor: pointer; overflow-wrap: anywhere; }
.eq-nom:hover { text-decoration: underline; }
.eq-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.eq-role { display: inline-flex; align-items: center; gap: 2px; padding: 2px 3px 2px 10px; border-radius: 999px; border: 1px solid var(--gray-300);
           background: var(--white); color: var(--navy-900); font-size: 12px; font-weight: 600; white-space: nowrap; }
.eq-role.eq-role-termine { background: var(--gray-100); color: var(--gray-500); border-style: dashed; font-weight: 500; }
.eq-role.eq-role-termine .eq-role-texte { text-decoration: line-through; }
.eq-role-texte[data-modifier] { cursor: pointer; }
.eq-role-menu { border: 0; background: transparent; color: inherit; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; font-size: 14px; line-height: 1; opacity: .75; }
.eq-role-menu:hover, .eq-role-menu:focus-visible { opacity: 1; background: rgba(127, 127, 127, .25); }
.eq-depuis { margin-top: 8px; font-size: 12.5px; color: var(--gray-500); }
.eq-section-titre { margin: 18px 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); }
.eq-menu { position: fixed; z-index: 95; min-width: 200px; padding: 6px; background: var(--white); border: 1px solid var(--gray-200); border-radius: 8px;
           box-shadow: 0 10px 28px rgba(15, 30, 45, .18); }
.eq-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--navy-900); }
.eq-menu button:hover, .eq-menu button:focus-visible { background: var(--gray-50); }
@media (max-width: 700px) { .eq-grille { grid-template-columns: 1fr; } }

/* Pictogramme « registre relié » (version simplifiée de l'icône de la fiche) pour les petites tailles : remplace l'immeuble. */
.ic-registre { display: inline-block; width: 1.2em; height: 1.2em; vertical-align: -0.22em; flex: none;
               background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect x='6.4' y='4.3' width='13' height='16.8' rx='1.6' fill='%23EFEBE5' stroke='%23B9C9BE' stroke-width='.6'/><rect x='4' y='2.5' width='13.6' height='17' rx='1.6' fill='%232D6A4C'/><path d='M4 4.1A1.6 1.6 0 0 1 5.6 2.5H7.7V19.5H5.6A1.6 1.6 0 0 1 4 17.9Z' fill='%231B4A34'/><rect x='9.5' y='5.8' width='6.2' height='4.6' rx='.9' fill='%23F2EFEA'/><rect x='10.5' y='7' width='4.2' height='1' rx='.5' fill='%232D6A4C'/><rect x='10.5' y='8.8' width='2.8' height='1' rx='.5' fill='%232D6A4C'/><path d='M11.2 19.5h3.2v3.4l-1.6-1.2-1.6 1.2Z' fill='%239FBFAE'/></svg>") center / contain no-repeat; }
.kpi-icon .ic-registre { width: 24px; height: 24px; vertical-align: middle; }
.nav-item .ic .ic-registre { width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
.dropdown-menu button:disabled { opacity: .45; cursor: not-allowed; }
.dropdown-menu button:disabled:hover { background: none; }

/* ---- Sommaire du livre : barre d'état, fiches de référence à gauche, sections repliables à droite -------------- */
.som-etat { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 13px 22px; margin-bottom: 18px; background: var(--white);
            border: 1px solid var(--gray-200); border-radius: 14px; font-size: 13.5px; }
.som-etat .som-gros { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; cursor: pointer; }
.som-etat .som-gros.vert { color: var(--success-500); } .som-etat .som-gros.bleu { color: var(--info-500); } .som-etat .som-gros.navy { color: var(--navy-800); } .som-etat .som-gros.gris { color: var(--gray-600); }
.som-coche { width: 26px; height: 26px; border-radius: 50%; background: currentColor; display: inline-flex; align-items: center; justify-content: center; color: inherit; }
.som-coche svg { display: block; }
.som-sep { width: 1px; height: 22px; background: var(--gray-200); }
.som-compteur b { color: var(--navy-900); } .som-compteur.cliquable { cursor: pointer; }
.som-compteur.alerte, .som-compteur.alerte b { color: var(--warning-500); } .som-compteur.danger, .som-compteur.danger b { color: var(--danger-500); }
.som-compteur.cliquable:hover { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; }
.som-derniere { margin-left: auto; color: var(--gray-500); font-size: 12.5px; }
.som-grille { display: grid; grid-template-columns: 410px 1fr; gap: 20px; align-items: start; }
.som-colonne { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 1180px) { .som-grille { grid-template-columns: 1fr; } }
.som-titre { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 15px; margin-bottom: 12px; color: var(--navy-900); }
.som-lien { color: var(--success-500); font-weight: 700; font-size: 12.5px; text-decoration: none; cursor: pointer; } .som-lien:hover { text-decoration: underline; }
.som-dl { display: grid; grid-template-columns: 128px 1fr; font-size: 13px; }
.som-dl dt { color: var(--gray-500); padding: 9px 0; border-bottom: 1px solid var(--gray-100); margin: 0; }
.som-dl dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--gray-100); font-weight: 600; overflow-wrap: anywhere; }
.som-dl dd.vide { color: var(--gray-400); font-weight: 400; }
.som-mini { border: 1px solid var(--gray-200); background: var(--white); border-radius: 7px; padding: 1px 8px; font-size: 11px; font-weight: 600; color: var(--gray-600); cursor: pointer; margin: 0 6px; }
.som-mini:hover { background: var(--gray-50); }
.som-act-ligne { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--gray-100); cursor: pointer; font-weight: 600; font-size: 13.5px; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; font-family: inherit; color: var(--navy-900); }
.som-act-ligne:last-child { border-bottom: 0; } .som-act-ligne:hover .som-act-ic { background: var(--gray-100); }
.som-act-ligne small { display: block; color: var(--gray-500); font-weight: 400; font-size: 12px; margin-top: 1px; }
.som-act-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--gray-50); display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.som-acc { padding: 0; overflow: visible; }
.som-acc-outils { text-align: right; padding: 10px 22px 0; font-size: 12px; color: var(--gray-500); } .som-acc-outils a { color: var(--gray-600); text-decoration: none; } .som-acc-outils a:hover { text-decoration: underline; }
.som-section { border-bottom: 1px solid var(--gray-200); } .som-section:last-child { border-bottom: 0; }
.som-ligne { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 22px; background: none; border: 0; cursor: pointer; text-align: left; font-family: inherit; color: var(--navy-900); }
.som-ligne b { font-size: 14.5px; } .som-ligne:hover { background: var(--gray-50); }
.som-chev { color: var(--gray-500); width: 12px; font-size: 11px; transition: transform .15s; } .som-ligne[aria-expanded="true"] .som-chev { transform: rotate(90deg); }
.som-res { margin-left: auto; color: var(--gray-500); font-size: 12.5px; display: flex; align-items: center; gap: 9px; text-align: right; }
.som-pt { display: inline-block; vertical-align: middle; width: 9px; height: 9px; border-radius: 50%; background: var(--warning-500); box-shadow: 0 0 0 3px var(--warning-100); flex: none; }
.som-corps { padding: 6px 22px 20px 48px; background: var(--gray-50); border-top: 1px solid var(--gray-100); } .som-corps[hidden] { display: none; }
.som-entete-corps { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 12px; }
.som-lignes { display: flex; flex-direction: column; gap: 10px; font-size: 13px; } .som-info { display: flex; justify-content: space-between; gap: 12px; }
.som-inv { margin-top: 6px; }
.som-act td { padding: 11px 6px; border-bottom: 1px solid var(--gray-100); font-size: 13.5px; } .som-act td:first-child { color: var(--gray-500); width: 112px; white-space: nowrap; } .som-act td:last-child { font-weight: 600; }
.som-act tr:last-child td { border-bottom: 0; }

/* ---- Importation des contacts NotaBene ---------------------------------------------------------------------------- */
.lv-nbi-depot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 34px 20px; border: 2px dashed var(--gray-300); border-radius: 14px;
                background: var(--gray-50); cursor: pointer; text-align: center; }
.lv-nbi-depot:hover, .lv-nbi-depot.survol { border-color: var(--success-500); background: var(--success-100); }
.nbi-contact { border: 1px solid var(--gray-200); border-radius: 12px; padding: 12px 16px; margin-bottom: 12px; background: var(--white); }
.nbi-tete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.nbi-tete select { padding: 4px 8px; font-size: 12.5px; max-width: 280px; }
.nbi-conf { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.nbi-conf.exacte, .nbi-conf.probable { background: var(--success-100); color: var(--success-500); } .nbi-conf.possible, .nbi-conf.ambigue { background: var(--warning-100); color: var(--warning-500); } .nbi-conf.aucune { background: var(--gray-100); color: var(--gray-600); }
.nbi-tab { width: 100%; border-collapse: collapse; font-size: 12.5px; } .nbi-tab td { padding: 6px 8px; border-top: 1px solid var(--gray-100); vertical-align: middle; } .nbi-tab td:first-child { width: 30px; }
.nbi-tab input[type=text] { width: 100%; padding: 4px 8px; font-size: 12.5px; }
.nbi-actuel { color: var(--gray-500); max-width: 260px; overflow-wrap: anywhere; } .nbi-remplace { color: var(--warning-500); font-weight: 700; font-size: 11px; } .nbi-ajout { color: var(--success-500); font-weight: 700; font-size: 11px; }
.nbi-bloc-titre { font-weight: 700; font-size: 13px; margin: 14px 0 6px; }

/* ---- Fenêtre d'accès au portail : signalements des clients (traités = repliés sur une ligne) ---------------------------- */
.sig-carte { border: 1px solid var(--gray-200); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; font-size: 12.5px; background: var(--white); }
.sig-nouveau { border-left: 3px solid var(--gold-400); }
.sig-traite { border-left: 3px solid var(--gray-300); padding: 8px 14px; }
.sig-traite > summary { display: flex; align-items: baseline; gap: 12px; cursor: pointer; list-style: none; color: var(--gray-600); }
.sig-traite > summary::-webkit-details-marker { display: none; }
.sig-traite > summary::after { content: "▸"; margin-left: auto; font-size: 11px; color: var(--gray-400); transition: transform .15s; }
.sig-traite[open] > summary::after { transform: rotate(90deg); }
.sig-traite:hover { background: var(--gray-50); }
.sig-coche { color: var(--success-500); font-weight: 700; } .sig-date { white-space: nowrap; font-size: 11.5px; color: var(--gray-500); } .sig-qui { white-space: nowrap; font-weight: 600; color: var(--navy-900); }
.sig-apercu { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }

/* ---- Signature confirmée à la main : icône sur le nom du document dans le livre (le document lui-même n'est pas modifié) ---- */
.lv-signe { margin-left: 6px; font-size: 13px; cursor: help; }
.badge-signe { display: inline-block; background: var(--success-100); color: var(--success-500); border-radius: 999px; padding: 1px 9px; font-size: 11.5px; font-weight: 700; white-space: nowrap; cursor: help; }
.nbi-role { background: var(--info-100); color: var(--info-500); }

/* ---- Dépôt de fichiers : choisir (fichiers OU dossier), glisser-déposer, coller ----------------------------------------- */
.lv-depot-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 26px 20px; border: 2px dashed var(--gray-300);
                 border-radius: 14px; background: var(--gray-50); text-align: center; font-size: 13px; color: var(--gray-700); }
.lv-depot-zone.survol { border-color: var(--success-500); background: var(--success-100); }
.lv-depot-zone-compacte { flex-direction: row; padding: 12px 16px; margin-bottom: 8px; font-size: 12.5px; }
.lv-depot-boutons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.lv-depot-bloc { margin: 4px 0 8px; }
.tag-qualite { background: #E0F2F1; color: #0F766E; }

/* Référence de résolution au journal : lien vers le document joint */
.lien-reference { color: var(--blue-600, #1d4ed8); text-decoration: none; }
.lien-reference:hover { text-decoration: underline; }
.lien-reference-dl { margin-left: 6px; font-size: 12px; text-decoration: none; color: var(--gray-500); }
.lien-reference-dl:hover { color: var(--navy-900); }
.lien-reference-joindre { margin-left: 8px; font-size: 11.5px; color: var(--gold-500); text-decoration: none; font-weight: 600; }
.lien-reference-joindre:hover { text-decoration: underline; }


/* ================================================================ Vérification
   granulaire de l'import (phase 2 du modal d'import) : bandeau de synthèse,
   rail de puces, cartes numérotées à marquer « Vérifié » une par une. */
.lv-verif-bandeau {
  display: block; margin-bottom: 12px; padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--success-100); color: var(--success-500);
  font-size: 12.5px; font-weight: 600; line-height: 1.5;
}
.lv-verif-bandeau.alerte { background: var(--warning-100); color: var(--warning-500); }
.lv-verif-bandeau div { font-weight: 400; }

.lv-verif-rail { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.lv-verif-puce {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 7px; border-radius: 999px;
  border: 1px solid var(--gray-300); background: var(--white);
  font-family: inherit; font-size: 12px; font-weight: 600; color: var(--gray-600);
  cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.lv-verif-puce:hover { border-color: var(--gold-500); color: var(--gold-500); }
.lv-verif-puce .lv-verif-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--gray-200); color: var(--gray-600);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex: none;
}
.lv-verif-puce.ok { background: var(--success-100); border-color: var(--success-500); color: var(--success-500); }
.lv-verif-puce.ok .lv-verif-num { background: var(--success-500); color: var(--white); }

.lv-verif-carte {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  margin-bottom: 14px; padding: 0; overflow: hidden;
  scroll-margin-top: 12px;
}
.lv-verif-carte.verifiee { border-color: var(--success-500); }
.lv-verif-carte-tete {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px 11px;
  background: var(--gray-50); border-bottom: 1px solid var(--gray-200);
}
.lv-verif-carte.verifiee .lv-verif-carte-tete { background: var(--success-100); border-bottom-color: var(--success-500); }
.lv-verif-icone {
  width: 30px; height: 30px; border-radius: var(--radius-sm); flex: none;
  background: var(--white); border: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.lv-verif-carte-titre { flex: 1; min-width: 0; }
.lv-verif-carte-titre h4 { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--navy-900, #241E1B); }
.lv-verif-carte-titre p { margin: 2px 0 0; font-size: 11.5px; color: var(--gray-500); line-height: 1.4; }
.lv-verif-coche {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 11.5px; font-weight: 600; color: var(--gray-500); cursor: pointer;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--gray-300); background: var(--white);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.lv-verif-coche input { width: auto; margin: 0; accent-color: var(--success-500); }
.lv-verif-coche:has(input:checked) { background: var(--success-500); border-color: var(--success-500); color: var(--white); }

.lv-verif-corps { padding: 14px 16px; }
.lv-verif-corps .field:last-child { margin-bottom: 0; }
.lv-verif-sources { font-size: 11px; color: var(--gray-500); margin: 2px 0 0; }
.lv-verif-sources div { padding: 1px 0; }

.lv-verif-synthese {
  font-size: 11.5px; color: var(--warning-500); margin-right: auto; line-height: 1.4;
}
.lv-verif-synthese.ok { color: var(--success-500); font-weight: 600; }

.lv-verif-pieces-groupe {
  border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  padding: 8px 12px; margin-bottom: 8px; background: var(--white);
}
.lv-verif-pieces-groupe:last-child { margin-bottom: 0; }
.lv-verif-pieces-groupe summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--navy-900, #241E1B); }
.lv-verif-pieces-groupe ul { margin: 8px 0 2px; padding-left: 18px; font-size: 12px; color: var(--gray-600); }
.lv-verif-pieces-groupe li { padding: 2px 0; }
.lv-verif-tag {
  display: inline-block; padding: 0 7px; border-radius: 999px; margin-left: 6px;
  background: var(--warning-100); color: var(--warning-500);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.lv-verif-date { color: var(--gray-500); font-size: 11.5px; margin-left: 6px; white-space: nowrap; }
