/* ============================================================
   REGISTRE DU FOIS · SODECOTON — Design system v2
   Thème « Emerald Command » : sidebar sombre premium,
   espace de travail clair, accents émeraude / or.
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #f0f3f9;

  /* Sidebar (dégradé émeraude profond) */
  --side-1: #063a30;
  --side-2: #04241f;
  --side-text: #cfe9df;
  --side-muted: #7fa89b;

  /* Accents */
  --accent: #10b981;
  --accent-2: #0d9488;
  --accent-strong: #059669;
  --accent-grad: linear-gradient(135deg, #10b981 0%, #0d9488 100%);
  --accent-soft: #e7faf2;
  --accent-soft-border: #bdefdc;

  --gold: #f59e0b;
  --gold-soft: #fff7e6;
  --gold-border: #fadfa0;

  /* Sémantique (référencées par app.js — NE PAS renommer) */
  --color-danger: #ef4444;
  --color-text-muted: #64748b;
  --color-border: #e6eaf1;

  /* Texte */
  --text: #0f1b2d;
  --text-2: #445069;

  /* Genre */
  --male: #2563eb;
  --male-soft: #e8effe;
  --female: #db2777;
  --female-soft: #fdecf5;

  /* Rayons & ombres */
  --r-sm: 9px;
  --r: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .05), 0 1px 3px rgba(15, 27, 45, .04);
  --shadow: 0 2px 4px rgba(15, 27, 45, .04), 0 12px 28px -14px rgba(15, 27, 45, .18);
  --shadow-lg: 0 8px 40px -12px rgba(15, 27, 45, .28);
  --shadow-accent: 0 8px 22px -8px rgba(16, 185, 129, .5);

  --ring: 0 0 0 4px rgba(16, 185, 129, .16);
  --transition: 180ms cubic-bezier(.4, 0, .2, 1);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Sora', 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cdd6e4; border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b3bfd1; background-clip: content-box; }

/* ============================================================
   Layout
   ============================================================ */
.app-container {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  background: linear-gradient(180deg, var(--side-1), var(--side-2));
  color: var(--side-text);
  overflow: hidden;
}
.sidebar::before {
  content: "";
  position: absolute;
  top: -120px; right: -120px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(16, 185, 129, .35), transparent 65%);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 6px 8px 22px;
  position: relative;
}
.logo-monogram {
  width: 46px; height: 46px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent-grad);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .5px;
  box-shadow: var(--shadow-accent);
}
.brand-text { display: flex; flex-direction: column; }
.company-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--accent);
}
.app-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.nav-menu { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--side-muted);
  padding: 4px 12px 10px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 13px;
  border-radius: 12px;
  color: var(--side-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 14.5px;
  position: relative;
  transition: var(--transition);
}
.nav-item .nav-icon {
  width: 20px; height: 20px;
  fill: currentColor;
  opacity: .8;
  transition: var(--transition);
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item:hover .nav-icon { opacity: 1; }
.nav-item.active {
  background: var(--accent-grad);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-accent);
}
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--side-text);
}
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, .6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .55); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.footer-version { font-size: 11px; color: var(--side-muted); }

/* ============================================================
   Main content & views
   ============================================================ */
.main-content {
  padding: 30px 34px 44px;
  overflow-x: hidden;
  max-width: 1500px;
  width: 100%;
}

.content-view { display: none; }
.content-view.active-view {
  display: block;
  animation: viewIn .4s cubic-bezier(.2, .7, .3, 1);
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.view-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--text);
}
.view-subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: var(--color-text-muted);
}
.view-head-actions { display: flex; gap: 10px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  height: 42px;
  padding: 0 20px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 10px 26px -8px rgba(16, 185, 129, .6); }
.btn-secondary {
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--surface-2); border-color: #d3dbe7; color: var(--text); }
.btn-icon-svg { width: 17px; height: 17px; fill: currentColor; }

/* ============================================================
   Filters bar
   ============================================================ */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.filter-group { display: flex; flex-direction: column; gap: 7px; min-width: 150px; flex: 1; }
.filter-group.search-input-group { flex: 2.2; min-width: 240px; }
.filter-group.button-group { flex: 0 0 auto; min-width: 0; }
.filter-group > label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding-left: 2px;
}

.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon {
  position: absolute; left: 13px;
  width: 18px; height: 18px;
  fill: var(--color-text-muted);
  pointer-events: none;
}
.search-wrap input { padding-left: 40px; }

/* Inputs / selects / textareas */
input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  padding: 0 13px;
  height: 42px;
  transition: var(--transition);
  outline: none;
}
textarea { height: auto; padding: 11px 13px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #9aa6b8; }
input:hover, select:hover, textarea:hover { border-color: #cdd6e4; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
  background: var(--surface);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}

/* ============================================================
   Registre — dual column
   ============================================================ */
.registry-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 22px;
  align-items: start;
}

.registry-list-panel {
  background: var(--surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: sticky;
  top: 20px;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-border);
  background: var(--surface-2);
}
.panel-header-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-2);
}
.count-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-border);
  padding: 4px 11px;
  border-radius: var(--r-pill);
}
.list-container {
  max-height: calc(100vh - 210px);
  overflow-y: auto;
  padding: 10px;
}

/* Cartes formateurs */
.fois-card {
  padding: 14px 15px 14px 16px;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  margin-bottom: 6px;
}
.fois-card::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: transparent;
  transition: var(--transition);
}
.fois-card:hover { background: var(--surface-2); }
.fois-card.selected {
  background: var(--accent-soft);
  border-color: var(--accent-soft-border);
}
.fois-card.selected::before { background: var(--accent-grad); }
.fois-card-name {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
  margin-bottom: 8px;
}
.fois-card-meta { display: flex; flex-direction: column; gap: 2px; }
.fois-card-meta-line { font-size: 12.5px; color: var(--color-text-muted); }
.fois-card-meta-line strong { color: var(--text-2); font-weight: 600; }
.fois-card-badge-container {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
  flex-wrap: wrap;
}

/* ============================================================
   Badges (pills)
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  line-height: 1.3;
  white-space: nowrap;
}
.badge-direction {
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--color-border);
}
.badge-m { background: var(--male-soft); color: var(--male); }
.badge-f { background: var(--female-soft); color: var(--female); }
.badge-alert {
  background: #fdecec;
  color: var(--color-danger);
  border: 1px solid #f7c9c9;
}

/* ============================================================
   Detail panel
   ============================================================ */
.registry-detail-panel {
  background: var(--surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 400px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px;
  background: linear-gradient(135deg, #063a30 0%, #0a5344 60%, #0d9488 140%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.detail-header::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(16, 185, 129, .4), transparent 65%);
}
.detail-header-info { position: relative; z-index: 1; }
.detail-header-direction {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #7ff0cf;
}
.detail-header-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.detail-header-name .badge { font-size: 11px; }
.detail-header-name .badge-m { background: rgba(255,255,255,.2); color: #fff; }
.detail-header-name .badge-f { background: rgba(255,255,255,.2); color: #fff; }
.detail-header-name .badge-alert { background: rgba(255, 255, 255, .95); color: var(--color-danger); }
.detail-header-actions { display: flex; gap: 10px; position: relative; z-index: 1; }
.detail-header-actions .btn-secondary {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .25);
  color: #fff;
  backdrop-filter: blur(4px);
}
.detail-header-actions .btn-secondary:hover { background: rgba(255, 255, 255, .24); color: #fff; }

.detail-alerts-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 28px;
  background: var(--gold-soft);
  border-bottom: 1px solid var(--gold-border);
}
.detail-alert-item {
  font-size: 12px;
  font-weight: 600;
  color: #92610a;
  background: #fff;
  border: 1px solid var(--gold-border);
  padding: 5px 12px;
  border-radius: var(--r-pill);
}
.detail-alert-item::before { content: "⚠ "; }

.detail-body { padding: 24px 28px 28px; }

.synthesis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}
.synthesis-block {
  padding: 13px 15px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: var(--transition);
}
.synthesis-block:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.synthesis-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.synthesis-value { font-size: 15px; font-weight: 700; color: var(--text); word-break: break-word; }
.synthesis-block.yellow-bg { background: var(--gold-soft); border-color: var(--gold-border); }
.synthesis-block.yellow-bg .synthesis-label { color: #a9770f; }
.synthesis-block.green-bg { background: var(--accent-soft); border-color: var(--accent-soft-border); }
.synthesis-block.green-bg .synthesis-label { color: var(--accent-strong); }
.synthesis-block.green-bg .synthesis-value { color: var(--accent-strong); }

.detail-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}
.detail-section:last-child { border-bottom: none; }
.detail-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-section-title::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.detail-section-content {
  font-size: 14px;
  color: var(--text-2);
  white-space: pre-line;
  line-height: 1.65;
}

/* ============================================================
   Empty / error states
   ============================================================ */
.no-records, .no-records-detail, .error-msg {
  padding: 40px 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
}
.no-records-detail {
  display: grid;
  place-items: center;
  min-height: 400px;
  font-size: 15px;
  font-weight: 500;
}
.error-msg { color: var(--color-danger); font-weight: 500; }

/* ============================================================
   Saisie — form
   ============================================================ */
.saisie-container { max-width: 1120px; }
.form-card {
  background: var(--surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 28px 30px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 40px;
}
.form-column { display: flex; flex-direction: column; gap: 16px; }
.form-section-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 12px;
  margin-bottom: 2px;
  border-bottom: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-dot {
  width: 9px; height: 9px;
  border-radius: 3px;
  background: var(--accent-grad);
}
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field > label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-field.required > label::after {
  content: "obligatoire";
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--color-danger);
  background: #fdecec;
  padding: 2px 7px;
  border-radius: var(--r-pill);
}
.auto-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-border);
  padding: 2px 7px;
  border-radius: var(--r-pill);
}
.form-field.read-only input {
  background: var(--surface-3);
  color: var(--accent-strong);
  font-weight: 700;
  cursor: not-allowed;
  border-style: dashed;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--color-border);
}

/* ============================================================
   Panel cards & tables
   ============================================================ */
.controles-container, .stats-dashboard { display: flex; flex-direction: column; gap: 22px; }
.panel-card {
  background: var(--surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--color-border);
  background: var(--surface-2);
}
.panel-card-header h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.panel-card-body { padding: 8px; }
.section-intro { padding: 12px 14px; color: var(--color-text-muted); font-size: 13.5px; }

.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--surface-3);
  font-size: 13.5px;
  color: var(--text-2);
  vertical-align: middle;
}
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td strong { color: var(--text); font-weight: 600; }
.data-table code {
  font-family: 'SFMono-Regular', ui-monospace, 'Cascadia Code', monospace;
  font-size: 12.5px;
  background: var(--surface-3);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-2);
}

/* ============================================================
   Statistiques — KPI
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.kpi-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent-grad);
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kpi-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--text);
}
.kpi-value .sub-number { font-size: 15px; font-weight: 600; color: var(--color-text-muted); letter-spacing: 0; }
.kpi-subtitle { font-size: 12px; color: var(--color-text-muted); }

/* ============================================================
   Statistiques — charts
   ============================================================ */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}
.chart-card.full-width-chart { grid-column: 1 / -1; }
.chart-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
}
.bar-chart-container { display: flex; flex-direction: column; gap: 12px; }
.chart-row {
  display: grid;
  grid-template-columns: 130px 1fr 42px;
  align-items: center;
  gap: 14px;
}
.chart-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chart-bar-wrapper {
  height: 12px;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.chart-bar {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--accent-grad);
  min-width: 4px;
  transition: width .7s cubic-bezier(.2, .7, .3, 1);
}
.chart-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1140px) {
  .registry-layout { grid-template-columns: 320px 1fr; }
}
@media (max-width: 980px) {
  .app-container { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    z-index: 20;
  }
  .sidebar::before { display: none; }
  .brand { padding: 0; margin-right: 8px; }
  .nav-menu { flex-direction: row; margin: 0; gap: 4px; overflow-x: auto; }
  .nav-section-label { display: none; }
  .nav-item span { display: none; }
  .nav-item { padding: 10px; }
  .sidebar-footer { display: none; }
  .main-content { padding: 22px 18px 40px; }
  .registry-layout { grid-template-columns: 1fr; }
  .registry-list-panel { position: static; }
  .list-container { max-height: 460px; }
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .view-title { font-size: 21px; }
  .detail-header { flex-direction: column; }
  .chart-row { grid-template-columns: 96px 1fr 34px; gap: 10px; }
}

/* ============================================================
   Rubriques détaillées (boutons) + modale
   ============================================================ */
.rubric-section { padding-top: 4px; }
.rubric-section-heading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rubric-section-heading::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.rubric-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 12px;
}
.rubric-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  padding: 15px 16px;
  border-radius: var(--r);
  border: 1px solid var(--color-border);
  background: var(--surface);
  cursor: pointer;
  font-family: var(--font);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.rubric-btn:hover {
  border-color: var(--accent-soft-border);
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.rubric-btn:active { transform: translateY(0); }
.rubric-btn-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.rubric-btn-state {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
.rubric-btn.has-content .rubric-btn-state {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-border);
}
.rubric-btn.is-empty { opacity: .68; }
.rubric-btn.is-empty .rubric-btn-state {
  color: var(--color-text-muted);
  background: var(--surface-3);
  border: 1px solid var(--color-border);
}

/* Modale */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 20, 17, .55);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(14px) scale(.98);
  transition: transform .24s cubic-bezier(.2, .7, .3, 1);
}
.modal-overlay.open .modal-card { transform: none; }
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #063a30 0%, #0d9488 160%);
  color: #fff;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}
.modal-close {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border: none;
  cursor: pointer;
  border-radius: 9px;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: var(--transition);
}
.modal-close:hover { background: rgba(255, 255, 255, .28); }
.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-2);
  word-break: break-word;
}

/* Listes à tirets dans la modale */
.modal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.modal-list li {
  position: relative;
  padding-left: 20px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-2);
}
.modal-list li::before {
  content: "–";
  position: absolute;
  left: 3px;
  top: 0;
  color: var(--accent-strong);
  font-weight: 800;
}
.modal-empty {
  color: var(--color-text-muted);
  font-style: italic;
}

/* Arbre domaine → expertises */
.domaine-group { margin-bottom: 22px; }
.domaine-group:last-child { margin-bottom: 0; }
.domaine-group-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  padding: 9px 13px;
  margin-bottom: 13px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-border);
  border-left: 4px solid var(--accent);
}
.domaine-group .modal-list { padding-left: 6px; }
.domaine-empty {
  font-size: 13px;
  color: var(--color-text-muted);
  font-style: italic;
  padding-left: 8px;
}
