/* ========================================================================
   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; }
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-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1200px) { .grid-4 { 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); }
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é) */
.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: 2px solid transparent;
  white-space: nowrap; cursor: pointer;
}
.tab-item:hover { color: var(--navy-800); }
.tab-item.active { color: var(--navy-900); border-color: var(--gold-500); }

.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-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: 18px; flex-shrink: 0;
}
.entity-header h2 { font-size: 19px; color: var(--navy-900); }
.entity-header .meta { font-size: 12.5px; color: var(--gray-500); margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; }
.entity-header .meta span { display: flex; align-items: center; gap: 5px; }
.entity-header .actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.btn-sharepoint {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: none; border-radius: 999px;
  background: var(--gold-500); color: var(--white);
  font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.btn-sharepoint:hover { background: var(--gold-400); }
.btn-sharepoint-ic { font-size: 14px; }

/* 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; }

/* Arborescence documents */
.filetree { }
.tree-node { margin-bottom: 2px; }
.tree-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13.5px; cursor: pointer;
}
.tree-row:hover { background: var(--gray-50); }
.tree-children { margin-left: 26px; border-left: 1px dashed var(--gray-200); padding-left: 10px; display: none; }
.tree-node.open > .tree-children { display: block; }
.tree-node.open > .tree-row .caret { transform: rotate(90deg); }
.caret { transition: transform .15s ease; display: inline-block; width: 12px; color: var(--gray-400); }
.file-icon { color: var(--blue-500); }
.folder-icon { color: var(--gold-500); }

/* 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; }

.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);
}
.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; } }
