/* Polices hebergees avec l'application (pas d'appel a Google Fonts) */
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("/static/fonts/sourcesans3.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("/static/fonts/playfair.woff2") format("woff2"); }

:root {
  --bg: #f5f2ec;
  --card-bg: #ffffff;
  --border: #e6dfd1;
  --border-soft: #f0ebe1;
  --border-btn: #d4c9b3;
  --text: #1b2433;
  --muted: #6c7383;
  --primary: #1b3a63;
  --primary-dark: #10274a;
  --primary-soft: #eef3f9;
  --danger: #e0435c;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 2px rgba(27,36,51,.04), 0 6px 16px rgba(27,36,51,.05);
  --shadow-pop: 0 10px 30px rgba(15,30,51,.18);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color .15s ease; }
a:hover { text-decoration: underline; color: var(--primary-dark); }

.layout { display: flex; height: 100vh; }

.sidebar {
  width: 232px;
  background: linear-gradient(180deg, #0f1e33 0%, #0a1524 100%);
  color: #c9d3e2;
  display: flex;
  flex-direction: column;
  padding: 22px 0;
  flex-shrink: 0;
  overflow: hidden;
}
.brand {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  padding: 0 22px 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 14px;
  letter-spacing: .01em;
}
.brand span { color: #e9d3a2; font-weight: 400; font-size: 13px; }
.brand.center { text-align: center; border: none; padding: 0; margin-bottom: 0; }

.sidebar nav { display: flex; flex-direction: column; gap: 3px; flex: 1; padding: 0 12px; overflow-y: auto; }
.sidebar nav a {
  color: #b9c4d6;
  padding: 7px 14px;
  text-decoration: none;
  font-size: 13.5px;
  border-radius: 10px;
  transition: background-color .15s ease, color .15s ease;
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.nav-sep { padding: 12px 14px 4px 14px; font-size: 10.5px; text-transform: uppercase; color: #8a7a5c; letter-spacing: .08em; }

.sidebar-user { padding: 16px 22px 4px 22px; border-top: 1px solid rgba(255,255,255,.08); margin-top: auto; flex-shrink: 0; }
.sidebar-user .who { color: #fff; font-weight: 600; font-size: 13px; }
.sidebar-user .role { color: #9aa6b8; font-size: 12px; margin-bottom: 8px; }
.mini-link {
  display: block; color: #e9d3a2; font-size: 12.5px; padding: 4px 0; text-align: left;
}
.brand-history-nav { display: flex; gap: 10px; margin-top: 8px; }
.brand-history-nav button {
  background: none; border: none; color: #e9d3a2; font-size: 11.5px; font-weight: 600;
  padding: 0; cursor: pointer;
}
.brand-history-nav button:hover { color: #fff; text-decoration: underline; }
.linklike { background: none; border: none; cursor: pointer; padding: 4px 0; font: inherit; }

.content { flex: 1; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; width: 100%; }
/* la page defile : ses blocs gardent leur hauteur (sinon une carte « overflow:hidden » placee
   apres un long tableau etait ecrasee a 2 px, ex. la liste des bordereaux compta) */
.content > :not(.content-body) { flex-shrink: 0; }

/* marge des pages ; celles a en-tete fixe (dossiers, crewing, archives) ont deja la leur */
@media screen { .content:not(:has(.content-header)) { padding: 6px 14px 10px; } }
.content-header { padding: 4px 12px 0; flex-shrink: 0; border-bottom: 1px solid var(--border-soft); background: var(--bg); }
.content-body { flex: 1; overflow-x: auto; padding: 4px 12px 8px 12px; }

.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; gap: 8px; flex-wrap: wrap; padding: 0; }
.header-actions { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.header-actions a, .header-actions button { padding: 4px 8px; font-size: 11px; }
.inline-form select { padding: 4px 6px; font-size: 11px; }

.stats-table th, .stats-table td { text-align: right; }
.stats-table th:first-child, .stats-table td:first-child { text-align: left; }
.stats-table tfoot td, .stats-table tfoot th { font-weight: 700; background: #faf8f3; border-top: 2px solid var(--border); }
h1 { font-size: 16px; margin: 0; font-weight: 600; }
h2 { font-size: 13px; margin: 0 0 8px 0; font-weight: 600; }
h3 { font-size: 11px; margin: 6px 0 4px 0; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
h3.dashboard-scope { margin-top: 2px; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-card);
}
.card.no-pad { padding: 0; overflow: hidden; }
/* overflow:hidden (ci-dessus) casse le sticky de l'entete de tableau (il
   devient lui-meme la reference de defilement pour le sticky, qui grandit
   avec la page au lieu de defiler independamment). Cette variante l'evite en
   arrondissant directement les cellules d'angle plutot que de rogner. */
@media (min-width: 769px) {
  .card.no-pad.sticky-table { overflow: visible; }
}
/* Tablettes et ecrans tactiles larges : la page coupe ce qui depasse a droite
   (.content en overflow-x:hidden), un tableau trop large y etait donc tronque
   sans defilement possible. Le tableau devient une zone defilante dans les deux
   sens, l'entete restant fige en haut de cette zone. */
@media (min-width: 769px) and (pointer: coarse) {
  .card.no-pad.sticky-table { overflow: auto; max-height: calc(100vh - 150px); -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
}
/* Meme chose des que le tableau deborde (classe posee par app.js), quel que
   soit l'appareil : tablette en portrait, petit ecran, fenetre reduite. */
/* Ordinateur : zone de tableau pleine hauteur, hauteur posee par app.js (ajusterTableaux) */
@media (min-width: 769px) {
  .card.no-pad.sticky-table.plein { overflow: auto; -webkit-overflow-scrolling: touch; }
}
@media (min-width: 769px) {
  .card.no-pad.sticky-table.deborde { overflow: auto; max-height: calc(100vh - 150px); -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; touch-action: pan-x pan-y; }
}
.card.no-pad.sticky-table .table thead tr:first-child th:first-child { border-top-left-radius: var(--radius); }
.card.no-pad.sticky-table .table thead tr:first-child th:last-child { border-top-right-radius: var(--radius); }
.card.no-pad.sticky-table .table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }
.card.no-pad.sticky-table .table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  /* Sur petit ecran, "Changer le statut" (action la plus frequente) remonte
     avant les informations du dossier, au lieu d'etre tout en bas apres un
     long defilement. */
  .two-col .dossier-status-col { order: -1; }
}

.btn {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-btn);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(27,36,51,.05);
  transition: background-color .15s ease, box-shadow .15s ease, border-color .15s ease, transform .08s ease;
}
.btn:hover { background: var(--border-soft); border-color: var(--muted); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 3px 10px rgba(27,58,99,.28); }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.ghost { background: #fff; }
.btn.accent { background: #0f9d68; border-color: #0f9d68; color: #fff; box-shadow: 0 3px 10px rgba(15,157,104,.28); }
.btn.accent:hover { background: #0c7d54; border-color: #0c7d54; }
.btn.full { width: 100%; }
.btn.danger { color: var(--danger); border-color: #f0c1cb; }
.btn.danger:hover { background: #fdedf0; border-color: var(--danger); }

.link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 13px; padding: 0; }
.link.danger { color: var(--danger); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; margin-bottom: 6px; }
.stat-grid.compact { grid-template-columns: repeat(auto-fit, minmax(85px, 1fr)); margin-bottom: 6px; }
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--muted);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  color: var(--text);
  display: block;
  box-shadow: none;
  transition: background-color .12s ease;
  cursor: pointer;
}
.stat-card.total { border-left-color: #0f1e33; }
.stat-card:hover { background: #f8f5ef; }
.stat-card.selected { background: var(--primary-soft); border-color: var(--primary); }
.stat-value { font-size: 16px; font-weight: 700; }
.stat-label { font-size: 10px; color: var(--muted); margin-top: 2px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid #d6cdb9; font-size: 12px; }
.table th {
  color: var(--muted); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: .03em; background: #faf8f3;
  position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 #d6cdb9;
}
/* Tableau principal des dossiers : un peu plus arere que les tableaux
   secondaires (documents, factures...), qui doivent rester compacts. */
.sticky-table .table th,
.sticky-table .table td { padding: 9px 10px; font-size: 12.5px; line-height: 1.4; }
.sticky-table .table th { font-size: 10.5px; padding-top: 10px; padding-bottom: 10px; }
.table tr.clickable { cursor: pointer; transition: background-color .1s ease; }
.table tr.clickable:hover { background: #f8f5ef; }
.table.grid th, .table.grid td { border: 1px solid #d6cdb9; }
.table.zebra tbody tr:nth-child(even) { background: #fcfaf6; }
.table.zebra tr.clickable:nth-child(even):hover, .table.zebra tr.clickable:hover { background: #f8f5ef; }
.note-dot { font-size: 12px; opacity: .6; cursor: help; }
.note-dot:hover { opacity: 1; }
.row-actions { display: flex; gap: 10px; }
.row-actions form { display: inline; }

.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.sm { font-size: 11px; padding: 2px 8px; }
.badge-select {
  display: inline-block;
  padding: 3px 24px 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}
.badge-select:hover, .badge-select:focus { border-color: rgba(0,0,0,.15); outline: none; }
.badge.lg { font-size: 13px; padding: 5px 14px; margin-top: 4px; }
.badge.neutral { background: #eceef7; color: #454b66; }
.badge.age-ok { background: #e5f8ee; color: #14733e; }
.badge.age-warn { background: #fef4e3; color: #92580a; }
.badge.age-late { background: #fdeaee; color: #a11d3a; }

/* Delai de facturation dans le tableau des dossiers : toute la LIGNE change
   de couleur (pas juste une cellule) pour etre visible d'un coup d'oeil. */
.cell-delai { font-weight: 700; text-align: center; white-space: nowrap; }

.table.zebra tbody tr.row-delai-ok,
.table.zebra tbody tr.row-delai-ok:nth-child(even) { background: #eefaf3; }
.table.zebra tbody tr.row-delai-warn,
.table.zebra tbody tr.row-delai-warn:nth-child(even) { background: #fef6e8; }
.table.zebra tbody tr.row-delai-critique,
.table.zebra tbody tr.row-delai-critique:nth-child(even) { background: #fdedf1; }
.table.zebra tbody tr.row-delai-cloture,
.table.zebra tbody tr.row-delai-cloture:nth-child(even) { background: #f2ede4; }

.table.zebra tr.row-delai-ok.clickable:hover { background: #d7f2e2; }
.table.zebra tr.row-delai-warn.clickable:hover { background: #fbe8cc; }
.table.zebra tr.row-delai-critique.clickable:hover { background: #fbd9e1; }
.table.zebra tr.row-delai-cloture.clickable:hover { background: #dfe1ef; }

.row-delai-ok .cell-delai { color: #14733e; }
.row-delai-warn .cell-delai { color: #92580a; }
.row-delai-critique .cell-delai { color: #a11d3a; }
.row-delai-cloture .cell-delai { color: #454b66; }

.back-link { display: inline-block; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--muted); }
.back-link:hover { color: var(--primary); text-decoration: none; }

.hidden-field { display: none; }

.kv { width: 100%; }
.kv th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 10px 6px 0; width: 42%; vertical-align: top; font-size: 13px; }
.kv td { padding: 6px 0; font-size: 13px; }

.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }
.filter-bar input, .filter-bar select { padding: 4px 6px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 11px; }
.filter-bar input[type=text] { min-width: 150px; }
.filter-bar .inline-label { flex-direction: row; align-items: center; gap: 4px; font-size: 11px; }
.filter-bar .inline-label input { padding: 4px 6px; }
.statut-filter-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.checkbox-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--border); font-size: 12.5px;
  font-weight: 600; cursor: pointer; background: #fff; transition: background-color .15s ease, border-color .15s ease;
}
.checkbox-chip:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }
.checkbox-chip input { margin: 0; width: auto; }
.filter-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid; font-size: 12px; font-weight: 600; }
.filter-tag-remove { background: none; border: none; padding: 0; margin: 0; cursor: pointer; font-size: 16px; line-height: 1; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; font-weight: 700; opacity: 0.7; transition: opacity .15s ease; }
.filter-tag-remove:hover { opacity: 1; }

.table th a { color: inherit; display: block; }
.table th a:hover { text-decoration: underline; color: var(--primary); }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 0; }
.form-section {
  margin-bottom: 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.form-section:last-of-type { margin-bottom: 6px; }
.form-section-title {
  background: var(--primary-dark); color: #fff; margin: 0; padding: 10px 16px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.form-section-body { padding: 16px; }
.input-with-add { display: flex; gap: 6px; }
.input-with-add input { flex: 1; min-width: 0; }
.input-with-add .quick-add-contact { padding: 0 12px; font-weight: 700; line-height: 1; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .form-grid.two { grid-template-columns: 1fr; } }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 500; }
input, select, textarea {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text);
  font-family: inherit;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
input:disabled { background: #f5f1e9; color: var(--muted); }
.checkbox-row { display: flex; gap: 20px; margin: 2px 0; }
.checkbox-label { flex-direction: row; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text); font-weight: 400; }
.checkbox-label input { width: auto; }
.btn-copy { color: var(--primary); }
.hint { font-size: 11px; color: #9aa0b4; font-weight: 400; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; }

.upload-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.upload-form select, .upload-form input[type=text] { flex: 1; min-width: 140px; }

.status-form { margin-bottom: 8px; }
.status-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.status-pick {
  display: flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--pick-color);
  background: #fff;
  transition: background-color .15s ease, border-color .15s ease;
}
.status-pick input { display: none; }
.status-pick:has(input:checked) { background: var(--pick-bg); border-color: var(--pick-color); }

.recent-activity summary {
  cursor: pointer; font-size: 15px; font-weight: 600; list-style: none;
  display: flex; align-items: center; gap: 6px;
}
.recent-activity summary::-webkit-details-marker { display: none; }
.recent-activity summary::before { content: "▸"; color: var(--muted); transition: transform .15s ease; font-size: 11px; }
.recent-activity[open] summary::before { transform: rotate(90deg); }
.recent-activity .activity-list { margin-top: 16px; max-height: 320px; overflow-y: auto; }

.history-list, .activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.history-list li, .activity-list li { border-bottom: 1px solid var(--border-soft); padding-bottom: 8px; }
.motif { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* Graphiques : donut, barres, mini-barres */
.donut-row { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.donut { position: relative; width: 140px; height: 140px; border-radius: 50%; flex-shrink: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.donut-hole {
  position: absolute; inset: 24px; background: var(--card-bg); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px;
  box-shadow: inset 0 0 0 1px var(--border-soft);
}
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

.bar-chart { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 160px 1fr 110px; align-items: center; gap: 10px; }
.bar-track { background: #f1ece2; border-radius: 6px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.bar-label { font-size: 13px; }
.bar-value { font-size: 12.5px; text-align: right; }

.compact-table th, .compact-table td { padding: 7px 10px; font-size: 12.5px; }
.mini-bar { background: #f1ece2; border-radius: 4px; height: 8px; width: 90px; overflow: hidden; }
.mini-bar div { height: 100%; border-radius: 4px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* Sous-navigation (liens reels entre pages liees, ex. section Parametres) */
.subnav { display: flex; gap: 4px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.subnav-sep { width: 1px; align-self: stretch; margin: 6px 6px; background: var(--border); }
.subnav a {
  padding: 4px 10px; font-size: 11px; font-weight: 600; color: var(--muted);
  border-radius: 6px 6px 0 0; transition: color .15s ease, background-color .15s ease;
  margin-bottom: -1px; text-decoration: none;
}
.subnav a:hover { color: var(--text); background: #f4f0e8; text-decoration: none; }
.subnav a.active { color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 -2px 0 var(--primary); }
.subnav a.tab-accent {
  color: #fff; background: #0f9d68; border-radius: 999px; padding: 4px 14px; margin-bottom: 0;
}
.subnav a.tab-accent:hover { background: #0c7d54; color: #fff; }
.subnav a.tab-accent.active { background: #0c7d54; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.subnav a.tab-orange {
  color: #fff; background: #e8730c; border-radius: 999px; padding: 4px 14px; margin-bottom: 0; margin-left: 6px;
}
.subnav a.tab-orange:hover { background: #c45f08; color: #fff; }
.subnav a.tab-orange.active { background: #c45f08; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }

.subnav a.tab-primary {
  color: #fff; background: var(--primary); border-radius: 999px; padding: 4px 14px; margin-bottom: 0;
}
.subnav a.tab-primary:hover { background: var(--primary-dark); color: #fff; }
.subnav a.tab-primary.active { background: var(--primary-dark); box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }

/* Onglets (CSS pur, sans JS) */
.tab-radio { display: none; }
.tabs-nav { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tabs-nav label {
  padding: 9px 16px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--muted);
  border-radius: 10px 10px 0 0; transition: color .15s ease, background-color .15s ease;
  margin-bottom: -1px;
}
.tabs-nav label:hover { color: var(--text); background: #f4f0e8; }
.tab-panel { display: none; }
#tab-mensuel:checked ~ .panel-mensuel { display: block; }
#tab-analyse:checked ~ .panel-analyse { display: block; }
#tab-explorer:checked ~ .panel-explorer { display: block; }
#tab-mensuel:checked ~ .tabs-nav label[for="tab-mensuel"],
#tab-analyse:checked ~ .tabs-nav label[for="tab-analyse"],
#tab-explorer:checked ~ .tabs-nav label[for="tab-explorer"] {
  color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 -2px 0 var(--primary);
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: Consolas, "Courier New", monospace; }
.empty { color: var(--muted); font-style: italic; padding: 12px 0; }
.notes { white-space: pre-wrap; background: #faf8f3; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; }

.alert { padding: 11px 15px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.alert.error { background: #fdeaee; color: #a11d3a; }
.alert.success { background: #e5f8ee; color: #14733e; }
.alert.warn { background: #fef4e3; color: #92580a; }

.temp-pass { background: #fff; padding: 3px 10px; border-radius: 6px; font-weight: 700; margin-left: 8px; }

.auth-page {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(160deg, #0f1e33 0%, #081120 100%);
  padding: 24px;
}
.auth-card {
  background: #fff; border-radius: 18px; padding: 40px 36px; width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: var(--shadow-pop);
}
.auth-card .brand.center { color: var(--text); font-size: 17px; }
.auth-sub { color: var(--muted); font-size: 13px; margin: 0 0 4px 0; text-align: center; }
.auth-logo { display: block; max-width: 240px; width: 100%; height: auto; margin: 4px auto 2px; }
.auth-card label { gap: 6px; font-size: 13.5px; }
.auth-card input { padding: 11px 13px; font-size: 14.5px; }
.auth-card .btn.primary.full {
  padding: 12px 16px; font-size: 15px; border-radius: var(--radius-sm); margin-top: 6px;
}
@media (max-width: 480px) {
  .auth-page { padding: 16px; }
  .auth-card { padding: 30px 22px; border-radius: 14px; gap: 16px; }
}

/* Vue imprimable / partage du rapport */
.print-page { background: #fff; padding: 24px 32px; max-width: 1100px; margin: 0 auto; }
.print-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.print-header h1 { font-size: 18px; margin: 0 0 4px 0; }
.print-header { margin-bottom: 16px; }
.print-table th, .print-table td { font-size: 12px; padding: 6px 8px; }

dialog {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  border: none; border-radius: var(--radius); padding: 0;
  box-shadow: var(--shadow-pop); max-width: 500px; width: 90%;
  background: var(--card-bg); z-index: 1000;
}
dialog::backdrop { background: rgba(0,0,0,.3); }
dialog > div { padding: 24px; }
dialog h2 { margin: 0 0 12px 0; font-size: 18px; }
dialog p { margin: 0 0 16px 0; color: var(--muted); }
dialog input[type="password"] { width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; }
dialog input[type="password"]:focus { outline: none; border-color: var(--primary); }

.scroll-hint { display: none; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; }
.pagination .btn.disabled { opacity: .4; pointer-events: none; }

/* Barre + menu de navigation mobile : la sidebar normale est cachee sur
   petit ecran (voir plus bas), ce bouton l'ouvre en tiroir a la place --
   sans ca, Statistiques/Repertoire/Parametres etaient inatteignables. */
.mobile-topbar { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 768px) {
  .mobile-topbar {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    background: #0a1524; color: #fff; position: sticky; top: 0; z-index: 1001;
  }
  .mobile-topbar button {
    background: none; border: none; color: #fff; font-size: 20px; line-height: 1;
    padding: 4px 6px; cursor: pointer;
  }
  .mobile-topbar-title { font-weight: 600; font-size: 14px; flex: 1; }
  .history-nav-btn { font-size: 18px !important; }

  .sidebar {
    position: fixed; top: 0; left: -232px; height: 100vh; width: 232px; z-index: 1002;
    transition: left .2s ease;
  }
  .sidebar.open { left: 0; }
  .sidebar-backdrop.open {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1000;
  }

  /* Sur mobile, la PAGE ENTIERE defile normalement (scroll natif du navigateur).
     On ne garde plus de scroll interne imbrique (source des blocages precedents). */
  .layout { flex-direction: column; height: auto; min-height: 100vh; }
  .content { max-width: 100%; overflow: visible; }


  /* Scroll horizontal des tableaux uniquement (largeur mini forcee pour activer le scroll).
     .card.no-pad est cible explicitement car sa regle de base (overflow:hidden) est plus
     specifique que ".card" seul et l'emporterait sinon, bloquant le scroll de la liste. */
  .card, .card.no-pad { overflow-x: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
  .table { min-width: 600px; }
  .card.no-pad .table { min-width: 900px; }

  .scroll-hint { display: block; text-align: center; font-size: 11px; color: var(--muted); margin: 0 0 4px; }
}

@media print {
  .no-print, .sidebar, .tabs-nav, .tab-radio { display: none !important; }
  .layout { display: block; }
  .content { max-width: none; padding: 0; }
  .tab-panel { display: block !important; margin-bottom: 24px; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .print-page { padding: 0; max-width: none; }
  body { font-size: 11px; }
  a { color: inherit !important; text-decoration: none !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

/* Bons de transport */
.bt-table .nowrap { white-space: nowrap; }
.bt-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.bt-table td { font-size: 13px; }
.badge-warn { display: inline-block; background: #fef4e3; color: #92580a; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 600; }
.bt-total { display: flex; gap: 24px; justify-content: flex-end; align-items: baseline; flex-wrap: wrap; margin-top: 12px; }
.bt-total strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.bt-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.bt-list-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.bt-list-row form { display: flex; gap: 6px; align-items: center; }
.bt-list-row input[type=text] { min-width: 160px; }
.bt-new-row td { background: #eefaf3; vertical-align: middle; }
.bt-new-row input, .bt-new-row select { font-size: 13px; padding: 5px 6px; }
.bt-nom strong { color: #14733e; font-size: 14px; }
.bt-ko { color: var(--danger); font-weight: 600; }

/* Bons de transport : tous les champs visibles sans defilement horizontal (ecrans > smartphone) */
.bt-table { table-layout: fixed; width: 100%; font-size: clamp(10px, 0.82vw, 13px); }
.bt-table th, .bt-table td { padding: 4px 5px; font-size: inherit; vertical-align: middle; }
.bt-table th { white-space: normal; line-height: 1.15; }
.bt-table td { overflow-wrap: anywhere; }
.bt-table td.nowrap { white-space: nowrap; overflow-wrap: normal; }
.bt-table input, .bt-table select { width: 100%; min-width: 0; font-size: inherit; padding: 3px 4px; box-sizing: border-box; }
.bt-table input[type=number] { text-align: right; }
.bt-sub { font-size: .85em; color: var(--muted); white-space: nowrap; }
.bt-row { box-shadow: inset 4px 0 0 var(--bt-edge, #9aa0b4); }
.bt-row td:first-child { padding-left: 9px; }
.bt-row:hover { filter: brightness(.97); }
.bt-editing { outline: 2px solid var(--primary); outline-offset: -2px; background: #fff !important; }
.bt-edit-actions { white-space: nowrap; }
.bt-edit-actions .btn { padding: 4px 8px; font-size: inherit; margin-right: 4px; }
.bt-table .row-actions { flex-direction: column; gap: 4px; }
.bt-table .row-actions .link { font-size: inherit; }
.bt-table.table.grid th, .bt-table.table.grid td { border-color: rgba(0, 0, 0, .08); }

.bt-table .bt-ico { padding: 2px 8px; font-size: 15px; line-height: 1.2; min-width: 28px; white-space: nowrap; }
.bt-table .bt-ico-l { font-size: 15px; line-height: 1; padding: 2px 4px; background: none; border: 0; cursor: pointer; }
.bt-table td:last-child { white-space: nowrap; width: 1%; }
.bt-edit-actions .btn { margin: 0 2px 0 0; }
.bt-table td.bt-nom, .bt-table td:nth-child(3) { min-width: 64px; }
.bt-table td:nth-child(3) { overflow-wrap: normal; min-width: 84px; }

.bt-table th:nth-child(1) { width: 7.5%; } .bt-table th:nth-child(2) { width: 6.5%; } .bt-table th:nth-child(3) { width: 9%; }
.bt-table th:nth-child(4) { width: 5.5%; } .bt-table th:nth-child(5) { width: 5.5%; } .bt-table th:nth-child(6) { width: 8%; }
.bt-table th:nth-child(7) { width: 3.5%; } .bt-table th:nth-child(8) { width: 11.5%; } .bt-table th:nth-child(9) { width: 8.5%; }
.bt-table th:nth-child(10) { width: 11%; } .bt-table th:nth-child(11) { width: 6%; } .bt-table th:nth-child(12) { width: 8.5%; }
.bt-table th:nth-child(13) { width: 8.5%; } .bt-table th:nth-child(14) { width: 4.5%; }
.bt-table td:nth-child(3) { min-width: 0; }
.bt-table td:last-child { width: auto; }
.bt-table select { text-overflow: ellipsis; }
@media (max-width: 768px) { .bt-table { table-layout: auto; min-width: 1100px; } .card.no-pad.sticky-table { overflow-x: auto; } }
@media (min-width: 769px) and (max-width: 1199px) {
  .sidebar { width: 164px; }
  .sidebar nav a { padding-left: 14px; padding-right: 8px; font-size: 13px; }
  .content-header { padding-left: 8px; padding-right: 8px; }
  .content-body { padding-left: 6px; padding-right: 6px; }
}
.bt-table th:nth-child(1) { width: 8.6%; } .bt-table th:nth-child(2) { width: 7%; } .bt-table th:nth-child(8) { width: 10.5%; }
.bt-table th:nth-child(10) { width: 10%; } .bt-table th:nth-child(3) { width: 8.6%; } .bt-table th:nth-child(7) { width: 4%; }
.bt-table input.bt-date { padding-left: 2px; padding-right: 2px; }
.bt-table td { padding-left: 3px; padding-right: 3px; }

/* Bons de transport : lignes gris clair, ligne de saisie en vert soutenu */
.bt-table tr.bt-row { background: #f4f0e8; box-shadow: none; }
.bt-table tr.bt-row:nth-child(even) { background: #eceef3; }
.bt-table tr.bt-row.bt-grp td { border-top: 2px solid #8d93ad; }
.bt-table tr.bt-row:hover { filter: none; background: #e2e5ef; }
.bt-table tr.bt-new-row td { background: #bfe4cd; border-bottom: 2px solid #1f9d63; }
.bt-table tr.bt-new-row { box-shadow: inset 4px 0 0 #1f9d63; }
.bt-table tr.bt-new-row input, .bt-table tr.bt-new-row select { background: #fff; border-color: #7fbf9c; }
.bt-datewrap { display: flex; align-items: center; gap: 2px; position: relative; }
.bt-datewrap input.bt-date { flex: 1 1 auto; min-width: 0; }
.bt-cal { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 22px; padding: 0; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--primary); cursor: pointer; }
.bt-cal:hover { background: #eef3f9; }
.bt-datehid { position: absolute; right: 0; top: 100%; width: 1px; height: 1px; opacity: 0; pointer-events: none; padding: 0; border: 0; }
.bt-table th:nth-child(1) { width: 10.5%; } .bt-table th:nth-child(8) { width: 9.5%; } .bt-table th:nth-child(10) { width: 9.5%; }
.bt-table th:nth-child(3) { width: 8%; } .bt-table th:nth-child(12) { width: 8%; } .bt-table th:nth-child(13) { width: 8%; }

/* Bons de transport : en-tete bleu marine fige */
.bt-table thead th { background: #0f1e33; color: #fff; text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 0 #0a1524; }
.bt-table thead th a { color: #fff; }
.bt-table thead th a:hover { color: #cfd3ff; text-decoration: underline; }

/* Bons de transport : recapitulatif des personnes transportees */
.bt-recap { margin: 8px 0 10px; padding: 8px 12px; }
.bt-recap > summary { cursor: pointer; font-weight: 600; }
.bt-recap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 10px; align-items: start; }
.bt-recap-titre { background: #0f1e33; color: #fff; font-weight: 700; font-size: 12px; padding: 4px 8px; border-radius: 4px 4px 0 0; }
.bt-recap-ligne { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 3px 8px; border-bottom: 1px solid #e3dccd; }
.bt-recap-ligne:nth-child(odd) { background: #f4f0e8; }
.bt-recap-ligne strong { font-variant-numeric: tabular-nums; }

.bt-recap-dlg { border: 0; border-radius: 10px; padding: 18px 20px; width: min(1100px, 94vw); box-shadow: 0 20px 60px rgba(15, 30, 51, .35); }
.bt-recap-dlg::backdrop { background: rgba(15, 30, 51, .45); }
.bt-recap-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.bt-recap-dlg .bt-recap-grid { grid-template-columns: repeat(2, 1fr); margin-top: 0; }
@media (max-width: 760px) { .bt-recap-dlg .bt-recap-grid { grid-template-columns: 1fr; } }
.bt-recap-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bt-recap-table th { background: #0f1e33; color: #fff; text-align: right; padding: 4px 6px; font-size: 11px; font-weight: 700; text-transform: none; }
.bt-recap-table th:first-child, .bt-recap-table td:first-child { text-align: left; }
.bt-recap-table td { padding: 3px 6px; border-bottom: 1px solid #e3dccd; text-align: right; font-variant-numeric: tabular-nums; }
.bt-recap-table tbody tr:nth-child(odd) { background: #f4f0e8; }
.bt-recap-table tfoot td { font-weight: 700; border-top: 2px solid #0f1e33; border-bottom: 0; }
dialog.bt-recap-dlg { max-width: 1100px; width: 94vw; max-height: 90vh; overflow-y: auto; padding: 18px 20px; }
.bt-recap-table td, .bt-recap-table th { white-space: nowrap; }
.bt-recap-table td:first-child { white-space: normal; }
.bt-recap-lien { color: inherit; text-decoration: none; border-bottom: 1px dotted #9a8f7a; }
.bt-recap-lien:hover { color: #1d4ed8; border-bottom-color: #1d4ed8; }
dialog.bt-recap-dlg { top: 4vh; transform: translateX(-50%); max-height: 92vh; margin: 0; }

.bt-table tr.bt-picked td { background: #dfe6ff !important; }
.bt-table input.bt-sel, .bt-table #bt-all { width: auto; margin: 0 3px 0 0; vertical-align: middle; accent-color: #1b3a63; }

.bt-periode { display: inline-block; margin-left: 10px; padding: 2px 10px; border-radius: 999px; background: #eef3f9; color: #10274a; font-size: 12px; font-weight: 600; }

.bt-recap-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.bt-sugg-box { position: fixed; z-index: 2000; width: 430px; max-width: 94vw; max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid #c4b9a2; border-radius: 6px; box-shadow: 0 10px 30px rgba(15, 30, 51, .25); }
.bt-sugg-box[hidden] { display: none; }
.bt-sugg-item { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 6px 10px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #efe9dd; }
.bt-sugg-item.on, .bt-sugg-item:hover { background: #e3ebf6; }
.bt-sugg-item strong { color: #0f1e33; }
.bt-sugg-num { font-variant-numeric: tabular-nums; color: #10274a; font-weight: 600; }
.bt-sugg-item small { color: #6b7088; margin-left: auto; }
.bt-sugg-item em { font-style: normal; font-size: 11px; font-weight: 700; color: #0f7a4d; background: #e1f6ec; border-radius: 999px; padding: 1px 8px; }

.bt-del-nom { background: #fdeaee; border: 1px solid #f0c1cb; border-radius: 6px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.bt-del-nom span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #a11d3a; }
.bt-del-nom strong { font-size: 15px; color: #1c2530; word-break: break-word; }
#bt-del-dlg label { color: #1c2530; font-weight: 600; }

/* pages annexes des bons de transport : ne pas se laisser ecraser par le conteneur flex (sinon le bas de page est coupe) */
.bt-page { flex: 0 0 auto; padding-bottom: 40px; }

dialog.bt-big-dlg { max-width: 680px; width: 94vw; max-height: 92vh; overflow-y: auto; top: 4vh; transform: translateX(-50%); margin: 0; }
.bt-tf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 6px; }
.bt-tf-grid label { font-size: 12px; font-weight: 600; color: #1c2530; }
.bt-tf-grid input { margin-top: 2px; }
.bt-tf-autres { grid-column: 1 / -1; background: #f4f0e8; border-radius: 6px; padding: 8px 10px; }

/* Fenetre « Modifier des bons » : sobre, une seule colonne, etapes numerotees */
dialog.md { padding: 0; border-radius: 14px; }
dialog.md > div { padding: 22px 24px 18px; }
.md-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.md-head h2 { margin: 0; font-size: 19px; color: #0f1e33; }
.md-x { border: 0; background: transparent; font-size: 24px; line-height: 1; color: #8a90a8; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.md-x:hover { background: #f2ede4; color: #0f1e33; }
.md-step { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #5d647e; }
.md-step span { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: #0f1e33; color: #fff; font-size: 11px; letter-spacing: 0; }
.md-scope { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.md-scope label { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: #1c2530; border: 1px solid #ddd5c4; border-radius: 9px; padding: 9px 11px; cursor: pointer; transition: border-color .12s, background .12s; }
.md-scope label:hover { border-color: #c4b9a2; }
.md-scope label:has(input:checked) { border-color: #1b3a63; background: #eef3f9; color: #0f1e33; font-weight: 600; }
.md-scope input { width: auto; accent-color: #1b3a63; }
.md-field { margin-top: 10px; color: #1c2530; font-weight: 600; font-size: 13px; }
.md-field input, .md-field select { padding: 9px 11px; border: 1px solid #ddd5c4; border-radius: 8px; font-size: 14px; }
.md-field input:focus, .md-field select:focus { outline: none; border-color: #1b3a63; box-shadow: 0 0 0 3px rgba(27,58,99,.15); }
.md-count { margin-top: 8px; font-size: 13px; font-weight: 600; color: #0f7a4d; }
.md-count.ko { color: #b3261e; } .md-count.warn { color: #92580a; } .md-count.muted { color: #8a90a8; font-weight: 500; }
.md-block { border: 1px solid #e6dfd1; border-radius: 11px; margin-top: 10px; overflow: hidden; transition: border-color .12s; }
.md-block.on { border-color: #1b3a63; box-shadow: 0 2px 10px rgba(27,58,99,.08); }
.md-bhead { flex-direction: row; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; font-size: 14px; font-weight: 600; color: #1c2530; }
.md-block.on .md-bhead { background: #f4f7fb; }
.md-bhead input { width: auto; accent-color: #1b3a63; transform: scale(1.1); }
.md-bbody { display: none; padding: 4px 14px 14px; border-top: 1px solid #efe9dd; }
.md-block.on .md-bbody { display: block; }
.md-tgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 10px; }
.md-tgrid label { font-size: 12px; font-weight: 600; color: #3a4156; }
.md-tgrid input { text-align: right; font-variant-numeric: tabular-nums; padding: 7px 9px; border: 1px solid #ddd5c4; border-radius: 7px; }
.md-autres { grid-column: 1 / -1; background: #f6f2ea; border-radius: 8px; padding: 9px 11px; }
.md-check { flex-direction: row; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; font-weight: 500; color: #1c2530; }
.md-check input { width: auto; accent-color: #1b3a63; }
.md-hint { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: #7a8099; }
.md-hint.ok { color: #0f7a4d; font-weight: 600; } .md-hint.ko { color: #b3261e; font-weight: 600; }
.md-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid #efe9dd; }
.md-summary { font-size: 13px; color: #5d647e; }
.md-actions { display: flex; gap: 8px; }

/* Fiche dossier : l'essentiel mis en avant, blocs repliables, boutons toujours visibles */
.card.df { padding: 0; overflow: visible; }
.card.df form { padding: 18px 20px 0; }
.df .form-section { border: 1px solid #e6dfd1; border-radius: 12px; margin-bottom: 14px; background: #fff; }
.df .form-section-title { margin: 0; padding: 12px 16px; font-size: 13px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #3a4156; }
.df .df-ess { background: #eef3f9; border-color: #d6e0ee; }
.df .df-ess .form-section-title { color: #0f1e33; }
.df .df-ess .form-section-body { padding-top: 4px; }
.df details.df-sec > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; border-radius: 12px; }
.df details.df-sec > summary::-webkit-details-marker { display: none; }
.df details.df-sec > summary::after { content: "▾"; font-size: 14px; color: #8a90a8; transition: transform .15s; }
.df details.df-sec:not([open]) > summary::after { transform: rotate(-90deg); }
.df details.df-sec > summary:hover { background: #faf8f3; }
.df details.df-sec[open] > summary { border-bottom: 1px solid #efe9dd; border-radius: 12px 12px 0 0; }
.df label { color: #2b3245; }
.df input:not([type=checkbox]):not([type=radio]), .df select, .df textarea { border-radius: 8px; border-color: #ddd5c4; }
.df input:focus, .df select:focus, .df textarea:focus { outline: none; border-color: #1b3a63; box-shadow: 0 0 0 3px rgba(27,58,99,.15); }
.df .df-bar { position: sticky; bottom: 0; z-index: 5; margin: 6px -20px 0; padding: 12px 20px; background: rgba(255,255,255,.96); backdrop-filter: blur(4px); border-top: 1px solid #e6dfd1; border-radius: 0 0 12px 12px; justify-content: flex-end; flex-wrap: wrap; box-shadow: 0 -6px 18px rgba(15,30,51,.06); }
.df .df-bar .btn.ghost { order: -1; margin-right: auto; }
.df .form-section-title { background: transparent; color: #3a4156; border-radius: 12px 12px 0 0; }
.df .df-ess > .form-section-title { color: #0f1e33; }
.df details.df-sec > summary.form-section-title { background: transparent; }
.df details.df-sec > summary.form-section-title:hover { background: #f8f5ef; }

/* Fiche dossier (consultation) : en-tete clair, sections sobres */
.dd-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; background: #fff; border: 1px solid #e6dfd1; border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; box-shadow: 0 4px 16px rgba(15,30,51,.04); }
.dd-hero-main { min-width: 0; flex: 1 1 420px; }
.dd-kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #1b3a63; }
.dd-title { margin: 4px 0 10px; font-size: 26px; line-height: 1.15; color: #0f1e33; text-wrap: balance; }
.dd-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.dd-chips .badge.lg { margin-top: 0; }
.dd-adresse { margin: 8px 0 0; font-size: 12.5px; color: #626a80; }
.dd-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dd-actions .dd-del { border-color: transparent; color: #b3261e; background: transparent; }
.dd-actions .dd-del:hover { background: #fdeaee; }
.dd .form-section { border: 1px solid #e6dfd1; border-radius: 12px; background: #fff; overflow: hidden; margin-bottom: 10px; }
.dd .form-section-title { background: transparent; color: #3a4156; border-bottom: 1px solid #efe9dd; padding: 8px 16px; font-size: 12.5px; letter-spacing: .05em; }
.dd .form-section-body { padding: 2px 16px 6px; }
.dd .kv { border-collapse: collapse; }
.dd .kv tr + tr th, .dd .kv tr + tr td { border-top: 1px solid #f1ece2; }
.dd .kv th { color: #7a8099; font-weight: 500; padding: 4px 12px 4px 0; width: 38%; }
.dd .kv td { color: #1c2530; font-weight: 500; padding: 4px 0; }
.dd .kv td a { color: #10274a; }
.dd .card { border: 1px solid #e6dfd1; border-radius: 12px; box-shadow: none; }
.dd .card h2 { font-size: 15px; color: #0f1e33; margin-bottom: 12px; }
.dd .history-list li { border-bottom: 1px solid #f1ece2; padding: 5px 0; }
.dd .history-list li:last-child { border-bottom: 0; }
.dd .notes { background: #f8f5ef; }
/* Fiche dossier : meme fond bleu tres pale que « L'essentiel » pour tous les blocs */
.df .df-sec { background: #eef3f9; border-color: #d6e0ee; }
.df details.df-sec > summary.form-section-title { color: #0f1e33; }
.df details.df-sec > summary.form-section-title:hover { background: #eceeff; }
.df details.df-sec[open] > summary { border-bottom-color: #dce5f2; }
.df .df-sec input:not([type=checkbox]):not([type=radio]), .df .df-sec select, .df .df-sec textarea,
.df .df-ess input:not([type=checkbox]):not([type=radio]), .df .df-ess select { background: #fff; }
/* Fiche dossier (consultation) : meme fond bleu tres pale que le formulaire */
.dd .form-section { background: #eef3f9; border-color: #d6e0ee; }
.dd .form-section-title { color: #0f1e33; border-bottom-color: #dce5f2; }
.dd .kv tr + tr th, .dd .kv tr + tr td { border-top-color: #e3ebf6; }
.dd .history-list li { border-bottom-color: #e3ebf6; }
.dd .form-section textarea { background: #fff; }
.dd .notes { background: #fff; }

/* Recapitulatif de facturation des dossiers */
.dr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dr-title { font-size: 18px; color: #0f1e33; }
.dr-portee { font-size: 12.5px; color: #626a80; margin-top: 3px; }
.dr-actions { display: flex; gap: 8px; }
.dr-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.dr-kpi { background: #eef3f9; border: 1px solid #d6e0ee; border-radius: 10px; padding: 10px 14px; }
.dr-kpi .v { font-size: 22px; font-weight: 700; color: #0f1e33; font-variant-numeric: tabular-nums; }
.dr-kpi .l { font-size: 11.5px; color: #626a80; text-transform: uppercase; letter-spacing: .04em; }
.dr-kpi.warn { background: #fff8ec; border-color: #f3dfb8; }
.dr-kpi.warn .v { color: #92580a; }
.dr-note { font-size: 12.5px; color: #92580a; margin: 8px 0 0; }
.dr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; margin-top: 16px; align-items: start; }
.dr-grid .dr-wide { grid-column: 1 / -1; }
@media (max-width: 760px) { .dr-grid { grid-template-columns: 1fr; } }
.dr h4 { margin: 0 0 6px; font-size: 13px; color: #0f1e33; text-transform: uppercase; letter-spacing: .04em; }
.dr-sub { font-size: 12px; color: #7a8099; font-weight: 400; text-transform: none; letter-spacing: 0; }
.dr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dr-table th { background: #0f1e33; color: #fff; text-align: left; padding: 5px 8px; font-size: 11.5px; font-weight: 700; }
.dr-table td { padding: 5px 8px; border-bottom: 1px solid #efe9dd; }
.dr-table tbody tr:nth-child(odd) { background: #f8f5ef; }
.dr-table .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dr-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.dr-dot.ok { background: #14a35f; } .dr-dot.warn { background: #e0a020; } .dr-dot.late { background: #d23a50; }
.dr-retards { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.dr-retards a { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 4px 8px; border-radius: 6px; background: #fdf1f3; color: #1c2530; text-decoration: none; }
.dr-retards a:hover { background: #fbe1e6; }
.dr-retards b { color: #a11d3a; font-variant-numeric: tabular-nums; }
.dr-foot { margin-top: 14px; font-size: 11.5px; color: #7a8099; }
.dr-cb-col { width: 28px; text-align: center; }
.dr-cb-col input { width: auto; cursor: pointer; accent-color: #1b3a63; }
.table tr.dr-picked td { background: #e3ebf6 !important; }

/* Lecture des FNE */
.fne-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.fne-head h2 { margin: 0; }
.fne-info { margin-top: 8px; padding: 9px 12px; border-radius: 8px; background: #e5f8ee; color: #14733e; font-size: 13px; }
.fne-info.warn { background: #fef4e3; color: #92580a; }
.fne-table td { vertical-align: top; }
.fne-table .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fne-table tr.fne-avoir td { background: #fff6f7; }
.fne-badge-avoir { background: #fdeaee; color: #a11d3a; }
.fne-warn { color: #a11d3a; font-weight: 600; }
.fne-ok { color: #14733e; font-weight: 600; }

/* Statistiques : marchandises */
.tabs-nav .tab-link { display: inline-block; padding: 8px 14px; color: inherit; text-decoration: none; font-weight: 600; border-radius: 8px; }
.tabs-nav .tab-link:hover { background: #eef3f9; color: #0f1e33; }
.sm-portee { font-size: 12.5px; color: #626a80; margin: 4px 0 12px; }
.sm-card { overflow-x: auto; }
.sm-table th { background: #0f1e33; color: #fff; font-size: 12px; text-transform: none; letter-spacing: 0; }
.sm-table th.sm-imp { background: #2d4f8a; } .sm-table th.sm-exp { background: #2f6b55; } .sm-table th.sm-aut { background: #6b5a3a; }
.sm-table .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sm-table .c { text-align: center; }
.sm-table tbody tr:nth-child(even) { background: #f8f5ef; }
.sm-table tr.sm-sel td { background: #e3ebf6; }
.sm-table tfoot td { font-weight: 700; border-top: 2px solid #0f1e33; background: #eef3f9; }
.sm-table td a { color: #0f1e33; }
.sm-h2 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 22px 0 10px; font-size: 18px; color: #0f1e33; }
@media print { .sm-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

.df .df-pos { margin-right: auto; font-size: 12.5px; color: #626a80; font-weight: 600; }
.df .df-bar .btn[disabled] { opacity: .4; pointer-events: none; }
.df .df-bar .df-pos ~ .btn.ghost:first-of-type { order: 0; margin-right: 0; }

/* Statistiques : analyse (l'essentiel) */
.an-periode { font-size: 12.5px; color: #626a80; margin: 0 0 14px; }
.an-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.an-kpi { background: #fff; border: 1px solid #e6dfd1; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.an-kpi span { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #7a8099; }
.an-kpi b { font-size: 24px; color: #0f1e33; font-variant-numeric: tabular-nums; line-height: 1.2; }
.an-kpi small { font-size: 12px; color: #7a8099; }
.an-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.an-grid .an-wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .an-grid { grid-template-columns: 1fr; } }
.an-card { background: #fff; border: 1px solid #e6dfd1; border-radius: 12px; padding: 16px 18px; min-width: 0; }
.an-card h3 { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #3a4156; }
.an-card h3.an-mt { margin-top: 18px; }
.an-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.an-head a { font-size: 12.5px; color: #1b3a63; }
.an-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.an-table th { text-align: left; font-size: 11.5px; font-weight: 600; color: #7a8099; padding: 6px 8px; border-bottom: 1px solid #e6dfd1; }
.an-table td { padding: 7px 8px; border-bottom: 1px solid #f1ece2; color: #1c2530; }
.an-table .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-table tr.an-autres td { color: #7a8099; font-style: italic; }
.an-table tbody tr:hover td { background: #faf8f3; }
.an-bar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 40px; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
.an-l { color: #1c2530; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-track { height: 8px; background: #efe9dd; border-radius: 99px; overflow: hidden; }
.an-track i { display: block; height: 100%; background: #1b3a63; border-radius: 99px; }
.an-v { text-align: right; font-variant-numeric: tabular-nums; color: #3a4156; font-weight: 600; }
.an-note { font-size: 12px; color: #7a8099; margin: 10px 0 0; }
.an-vide { color: #9aa0b4; font-size: 13px; }
@media print { .an-track i { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* Annonces de l'administration */
.annonce-bandeau { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 12px 16px; margin-bottom: 14px; border-radius: 10px; border: 1px solid #b9d3f0; background: #eef5fd; color: #17375e; }
.annonce-bandeau.annonce-important { border-color: #f0c99a; background: #fdf3e6; color: #6b3f06; }
.annonce-msg { white-space: pre-line; margin-top: 4px; font-size: 14px; }
.annonce-lu { flex-shrink: 0; }


/* ===================================================================
   Theme « Bleu nuit et laiton » : polices, menu, titres, connexion.
   =================================================================== */
:root {
  --nuit: #0f1e33; --nuit-2: #172b47; --laiton: #c9a35c; --laiton-clair: #e9d3a2; --ecume: #f5f2ec;
  --f-titre: "Playfair Display", Georgia, "Times New Roman", serif;
  --f-texte: "Source Sans 3", "Segoe UI", -apple-system, Arial, sans-serif;
}
body { font-family: var(--f-texte); }
button, input, select, textarea { font-family: inherit; }
h1, .page-header h1, .bt-page > h1 { font-family: var(--f-titre); font-weight: 700; color: var(--nuit); letter-spacing: .005em; font-variant-numeric: lining-nums; }
h1 { font-size: 22px; }
dialog h2, .card > h2, .bt-page > h2 { font-variant-numeric: lining-nums; font-family: var(--f-titre); color: var(--nuit); font-weight: 700; }

/* Menu lateral */
.sidebar { background: radial-gradient(140% 60% at 0% 0%, #1d3557 0%, var(--nuit) 55%, #0a1524 100%); color: #c9d3e2; }
.brand { font-family: var(--f-titre); font-size: 18px; letter-spacing: .01em; border-bottom-color: rgba(233,211,162,.18); }
.brand span { font-family: var(--f-texte); color: var(--laiton); text-transform: uppercase; letter-spacing: .16em; font-size: 10.5px; font-weight: 700; }
.sidebar nav a.active { background: rgba(201,163,92,.16); color: var(--laiton-clair); box-shadow: inset 3px 0 0 var(--laiton); }
.sidebar nav a:hover { background: rgba(233,211,162,.08); color: #fff; }
.nav-sep { color: var(--laiton); opacity: .8; }
.sidebar-user { border-top-color: rgba(233,211,162,.18); }
.mini-link, .brand-history-nav button { color: var(--laiton-clair); }
.mobile-topbar { background: var(--nuit); }

/* Boutons : principal bleu nuit, accent laiton pour l'action positive */
.btn.primary { box-shadow: 0 3px 10px rgba(15,30,51,.25); }
.btn.accent { background: linear-gradient(180deg, #d4b06a, var(--laiton)); border-color: #b8924b; color: #1a1406; box-shadow: 0 3px 10px rgba(201,163,92,.35); }
.btn.accent:hover { background: #b8924b; border-color: #a6833f; color: #1a1406; }

/* Cartes et tableaux de bord */
.stat-card { border-radius: 12px; }
.stat-card.selected { box-shadow: inset 0 -2px 0 var(--laiton); }
.subnav a.active { color: var(--nuit); box-shadow: inset 0 -2px 0 var(--laiton); }

/* Page de connexion */
.auth-page { background: radial-gradient(120% 90% at 0% 0%, #22406a 0%, var(--nuit) 55%, #0a1524 100%); }
.auth-card { border-top: 3px solid var(--laiton); }
.auth-eyebrow { text-align: center; color: #9a7a3c; text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 700; margin: -6px 0 0; }
.auth-titre { text-wrap: balance; font-variant-numeric: lining-nums; text-align: center; font-family: var(--f-titre); color: var(--nuit); font-size: 22px; line-height: 1.2; margin: 0; }
.auth-titre em { color: #9a7a3c; font-style: normal; }
.auth-card .btn.primary.full { background: linear-gradient(180deg, #d4b06a, var(--laiton)); border-color: #b8924b; color: #1a1406; box-shadow: 0 4px 14px rgba(201,163,92,.4); font-weight: 700; }
.auth-card .btn.primary.full:hover { background: #b8924b; }

a:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--laiton); outline-offset: 1px; }

/* Fiche dossier : bande bleu nuit, numero et nom en or */
.dd-hero { background: radial-gradient(130% 120% at 0% 0%, #22406a 0%, var(--nuit) 60%, #0a1524 100%); border: 0; border-bottom: 3px solid var(--laiton); color: #fff; box-shadow: 0 8px 24px rgba(15,30,51,.18); }
.dd-kicker { color: var(--laiton); letter-spacing: .16em; font-size: 11px; }
.dd-title { color: var(--laiton-clair); font-family: var(--f-titre); font-size: 30px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-variant-numeric: lining-nums; }
.dd-title .dd-num { color: #e8c87f; }
.dd-title .dd-sep { color: rgba(233,211,162,.55); }
.dd-title .dd-nom { color: var(--laiton-clair); }
.dd-adresse { color: rgba(255,255,255,.72); }
.dd-hero .badge.lg.neutral { background: rgba(255,255,255,.12); color: #fff; }
.dd-actions .btn.ghost { background: rgba(255,255,255,.08); border-color: rgba(233,211,162,.35); color: #fff; }
.dd-actions .btn.ghost:hover { background: rgba(255,255,255,.16); }
.dd-actions .btn.primary { background: linear-gradient(180deg, #d4b06a, var(--laiton)); border-color: #b8924b; color: #1a1406; }
.dd-actions .dd-del { color: #ffb4b4; border-color: transparent; background: transparent; }
.dd-actions .dd-del:hover { background: rgba(255,255,255,.08); }
@media (max-width: 560px) { .dd-title { font-size: 24px; } }

/* Bande du dossier figée en haut pendant le défilement */
.dd-hero { position: sticky; top: 0; z-index: 50; align-items: center; padding-top: 14px; padding-bottom: 14px; }
.dd-hero .dd-title { margin-bottom: 0; }
@media (max-width: 768px) { .dd-hero { top: 44px; } }

/* Bande du dossier compacte (une ligne) */
.dd-hero { padding: 7px 16px; gap: 10px; margin-bottom: 12px; border-radius: 12px; }
.dd-hero-main { flex: 1 1 300px; }
.dd-title { font-size: 21px; margin: 0; gap: 2px 10px; line-height: 1.2; }
.dd-title .dd-kicker { font-family: var(--f-texte); font-size: 10.5px; align-self: center; }
.dd-actions .btn { padding: 4px 10px; font-size: 12.5px; }
@media (max-width: 560px) { .dd-title { font-size: 18px; } }

/* Bons de transport : lignes compactes, actions cote a cote */
.bt-table .row-actions { flex-direction: row; align-items: center; gap: 2px; }
.bt-table tbody tr.bt-row td { padding-top: 3px; padding-bottom: 3px; line-height: 1.25; }
.bt-table tbody tr.bt-row .bt-ico-l { padding: 2px 3px; }

/* Bons : en-tete et ligne d'ajout figes, hauteur ajustee */
.bt-table thead th { padding-top: 6px; padding-bottom: 6px; height: 32px; box-sizing: border-box; }
.bt-table thead th:first-child input { vertical-align: middle; margin: 0 4px 0 0; }
.bt-table thead th:first-child br { display: none; }
.bt-table tr.bt-new-row td { position: sticky; top: 35px; z-index: 2; padding-top: 4px; padding-bottom: 4px; }
.bt-table tr.bt-new-row input, .bt-table tr.bt-new-row select { padding-top: 3px; padding-bottom: 3px; }
/* Formulaire dossier : bande figee comme la fiche */
.df-hero .dd-kicker { margin-right: 2px; }
.bt-table thead th:first-child a { display: inline; }

/* ===================================================================
   Pages de liste compactes (ordinateur) : plus de place pour le tableau.
   =================================================================== */
@media (min-width: 769px) {
  h3.dashboard-scope { display: none; }
  .dashboard-panel .stat-card { display: flex; align-items: baseline; justify-content: center; gap: 8px; padding: 3px 10px; }
  .dashboard-panel .stat-value { font-size: 15px; }
  .dashboard-panel .stat-label { margin-top: 0; font-size: 11px; }
  .dashboard-panel .stat-grid { margin-bottom: 5px; }
  .sticky-table .table th { padding-top: 6px; padding-bottom: 6px; line-height: 1.25; }
  .sticky-table .table thead tr:first-child th { white-space: nowrap; }
  .sticky-table .table thead th.nowrap a { display: inline; }
  .sticky-table .table td { padding-top: 6px; padding-bottom: 6px; }
  /* factures fournisseurs : cartes sur une ligne (libelle, puis nombre et montant) */
  main .ff-kpis { gap: 6px; margin-bottom: 8px; }
  main .ff-kpi { padding: 4px 10px; border-top-width: 2px; border-radius: 10px; }
  main .ff-kpi span { display: block; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  main .ff-kpi b { display: inline; font-size: 17px; margin-right: 6px; }
  main .ff-kpi small { display: inline; font-size: 10.5px; }
  main .ff-ligne-filtre th { padding: 2px 3px !important; }
  main .ff-ligne-filtre input, main .ff-ligne-filtre select { padding: 2px 5px; font-size: 11px; }
  main .ff-dates { gap: 1px; }
  main .ff-dates input { font-size: 10px; padding: 1px 2px; min-width: 0; }
}

/* Menu : precision en petit sous chaque onglet (« Secretariat » / factures fournisseurs) */
.sidebar nav a small { display: block; font-size: 10.5px; font-weight: 400; opacity: .62; margin-top: 1px; letter-spacing: .01em; text-transform: none; }
.sidebar nav a.active small { opacity: .85; }

/* En-tetes des grands registres (Dossiers/Archives, Secretariat, Transit) : vert clair
   des bons de transport, liseré vert fonce ; ligne des filtres comprise */
.table.entete-verte thead th { background: #bfe4cd !important; color: #1d3b2c; box-shadow: 0 2px 0 #1f9d63; }
.table.entete-verte thead th a { color: inherit; }
.table.entete-verte thead tr + tr th { box-shadow: 0 2px 0 #1f9d63; }
.table.entete-verte thead tr:first-child th { box-shadow: none; }
.table.entete-verte thead tr:only-child th, .table.entete-verte thead tr:last-child th { box-shadow: 0 2px 0 #1f9d63; }
.table.entete-verte thead input, .table.entete-verte thead select { background: #fff; border-color: #7fbf9c; }

/* compteur du menu Dossiers (dossiers a facturer) */
.menu-badge { display: inline-block; margin-left: 6px; min-width: 18px; padding: 0 6px; border-radius: 999px; background: #c0392b; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; vertical-align: 1px; cursor: pointer; }

/* menu compact sur ordinateur : un bloc serre, tout visible sans defiler (le tactile garde des zones larges) */
@media (min-width: 901px) {
  .sidebar nav { gap: 3px; padding: 0 10px; }
  .sidebar nav a { padding: 5px 10px; font-size: 13px; line-height: 1.25; border-radius: 7px; }
  .sidebar nav a small { font-size: 10.5px; line-height: 1.2; margin-top: 1px; }
  .nav-sep { margin-top: 7px; padding: 8px 10px 2px; font-size: 9.5px; line-height: 1.2; border-top: 1px solid rgba(255,255,255,.08); }
  .sidebar nav > .nav-sep:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
  .brand { padding-bottom: 10px; margin-bottom: 8px; }
  .sidebar-user { padding-top: 8px; }
}


/* menu lateral : une ligne par rubrique, icone + libelle, detail au survol */
.sidebar nav a { display: flex; align-items: center; gap: 9px; }
.nav-ico { width: 17px; height: 17px; flex: none; opacity: .72; }
.sidebar nav a:hover .nav-ico, .sidebar nav a.active .nav-ico { opacity: 1; }
.nav-lib { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar nav a .menu-badge { margin-left: 4px; flex: none; }
.sidebar nav a.nav-sous { padding-left: 30px; font-size: 12.5px; }
.sidebar nav a.nav-sous .nav-ico { width: 15px; height: 15px; }
.nav-note { font-size: 10px; opacity: .65; flex: none; }
.brand-ligne { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.brand .brand-history-nav { margin-top: 0; gap: 2px; }
.brand .brand-history-nav button { font-size: 15px; line-height: 1; padding: 3px 5px; border-radius: 5px; text-decoration: none; }
.brand .brand-history-nav button:hover { background: rgba(255,255,255,.1); text-decoration: none; }
@media (min-width: 901px) { .sidebar nav a.nav-sous { padding-left: 28px; } }
.brand .brand-nom { font-weight: inherit; }
@media (max-width: 900px) { .brand .brand-history-nav { display: none; } }

/* Tableaux triables au clic (.tri-clic) */
table.tri-clic th.triable { cursor: pointer; user-select: none; white-space: nowrap; }
table.tri-clic th.triable:hover { text-decoration: underline; }
table.tri-clic th.triable::after { content: "\2195"; margin-left: 4px; font-size: .85em; opacity: .35; }
table.tri-clic th.triable[aria-sort="ascending"]::after { content: "\25B2"; opacity: .9; }
table.tri-clic th.triable[aria-sort="descending"]::after { content: "\25BC"; opacity: .9; }
