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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --warning-bg: #fef9c3;
  --warning-border: #ca8a04;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --credit-color: #166534;
  --nav-bg: #1e293b;
  --nav-text: #f1f5f9;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ─── NAVIGATION ────────────────────────────────────────────────────────────── */
nav {
  background: var(--nav-bg);
  color: var(--nav-text);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.nav-links a {
  color: var(--nav-text);
  text-decoration: none;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  white-space: nowrap;
  opacity: 0.85;
  transition: opacity 0.15s, background 0.15s;
}

.nav-links a:hover { opacity: 1; background: rgba(255,255,255,0.1); }
.nav-links a.nav-active { opacity: 1; background: var(--primary); }
.nav-sep { width: 1px; background: rgba(255,255,255,0.2); align-self: stretch; margin: 6px 2px; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.nav-user .initiales {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.nav-user a { color: var(--nav-text); text-decoration: none; opacity: 0.7; }
.nav-user a:hover { opacity: 1; }

/* ─── MAIN ──────────────────────────────────────────────────────────────────── */
main {
  width: 100%;
  padding: 1rem 1.5rem;
}

h1 { font-size: 1.4rem; margin-bottom: 1rem; color: var(--text); }
.filtre-actif { font-size: 0.83rem; display: inline-flex; align-items: center; gap: 0.4rem; background: #dbeafe; padding: 0.2rem 0.5rem; border-radius: 4px; }
h2 { font-size: 1.1rem; margin: 1.2rem 0 0.6rem; }
h3 { font-size: 0.95rem; margin: 1rem 0 0.5rem; }

/* ─── LOGIN ─────────────────────────────────────────────────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  width: 360px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.login-box h1 { text-align: center; margin-bottom: 1.5rem; }

.login-box label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  margin-top: 0.75rem;
}

.login-box input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
}

.login-box button {
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.6rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
}

.login-box button:hover { background: var(--primary-dark); }

/* ─── ACCUEIL CARDS ─────────────────────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.card:hover {
  box-shadow: 0 2px 10px rgba(37,99,235,0.15);
  border-color: var(--primary);
}

.card h2 { font-size: 0.95rem; color: var(--primary); margin-bottom: 0.4rem; }
.card p { font-size: 0.83rem; color: var(--text-muted); }

/* ─── BOUTONS ───────────────────────────────────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-danger, .btn-check {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border-radius: 4px;
  border: none;
  font-size: 0.83rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }

.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); padding: 0.2rem 0.5rem; }
.btn-danger:hover { background: #fee2e2; }

.btn-check {
  background: #dcfce7;
  color: var(--success);
  border: 1px solid #86efac;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
}
.btn-check:hover { background: #bbf7d0; }

.btn-group { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

/* ─── FORMULAIRES ───────────────────────────────────────────────────────────── */
.filtres {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.filtres-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.filtres label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.83rem;
  font-weight: 500;
}

.filtre-champ {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.filtres select, .filtres input[type="number"], .filtres input[type="date"] {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  font-size: 0.83rem;
}

.form-group { margin-bottom: 0.75rem; }
.form-group label { display: block; font-size: 0.83rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.25rem; }
.form-group input, .form-group select, .form-group textarea {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.form-upload { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 1.25rem; max-width: 600px; }
.form-annexe { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 1.25rem; max-width: 600px; margin-top: 1rem; }

/* ─── TABLEAUX ──────────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; overflow-y: clip; }

table { border-collapse: collapse; width: 100%; font-size: 0.83rem; }
th { background: #f1f5f9; padding: 0.4rem 0.6rem; text-align: left; border: 1px solid var(--border); white-space: nowrap; }
td { padding: 0.3rem 0.6rem; border: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: #f8fafc; }

.montant { text-align: right; font-variant-numeric: tabular-nums; }
.credit { color: var(--credit-color); }
.negatif { color: var(--danger); }
.total-row td { background: #f1f5f9; }

/* Qualification */
.tableau-qualification { width: 100%; }
.tableau-qualification .date { white-space: nowrap; width: 90px; }
.tableau-qualification .tit { text-align: center; width: 50px; }
.tableau-qualification .lib { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tableau-qualification .qual-cell { width: 240px; }
.tableau-qualification .notes-cell { min-width: 140px; }

/* thead background */
.tableau-qualification thead th,
.tableau-qualification thead td {
  background: #f1f5f9;
}

/* Filtre row */
.filtre-row td {
  padding: 3px 4px;
  background: #eef2ff;
  border-top: 2px solid #c7d2fe;
}
.filtre-row input[type="text"],
.filtre-row select {
  width: 100%;
  border: 1px solid #c7d2fe;
  border-radius: 3px;
  padding: 2px 4px;
  font-size: 0.78rem;
  background: #fff;
  box-sizing: border-box;
}
.filtre-row input[type="text"]:focus,
.filtre-row select:focus {
  outline: 2px solid var(--primary);
  border-color: var(--primary);
}

.select-qual {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.2rem 0.3rem;
  font-size: 0.8rem;
}

.input-notes {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 0.2rem 0.3rem;
  font-size: 0.8rem;
  background: transparent;
}
.input-notes:hover, .input-notes:focus { border-color: var(--border); background: #fff; outline: none; }

.check-ok { color: var(--success); font-weight: bold; }

.non-qual td { background: #fff7ed; }
.auto-qual td { background: #f0fdf4; }

/* Boutons vérifié */
.btn-verifie {
  border: none; border-radius: 4px; cursor: pointer;
  width: 28px; height: 22px; font-size: 0.85rem; font-weight: bold; line-height: 1;
}
.btn-non-verifie { background: #f97316; color: #fff; }
.btn-non-verifie:hover { background: #ea580c; }
.btn-verifie-ok { background: #22c55e; color: #fff; }
.btn-verifie-ok:hover { background: #16a34a; }

/* Entêtes triables */
.th-sort { color: inherit; text-decoration: none; display: block; }
.th-sort:hover { text-decoration: underline; }

/* Toolbar qualification */
.qual-toolbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  position: sticky; top: 52px; z-index: 9;
  background: var(--bg); padding: 0.3rem 0; margin: 0;
  border-bottom: 1px solid var(--border);
}
.qual-toolbar .compte { margin: 0; }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.8rem; }

.filtre-totaux {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 0.45rem 0.75rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
}
.filtre-total-item { color: var(--text); }
.filtre-total-item.credit { color: var(--credit-color); }
.filtre-total-item.debit { color: var(--danger); }
.filtre-total-item.solde.credit { color: var(--credit-color); }
.filtre-total-item.solde.debit { color: var(--danger); }

/* Export button in navbar */
.btn-export-nav {
  background: #059669; color: #fff;
  border-radius: 4px; padding: 0.25rem 0.8rem;
  font-size: 0.82rem; text-decoration: none;
  white-space: nowrap; transition: background 0.15s;
}
.btn-export-nav:hover { background: #047857; }

/* Load more */
.load-more { text-align: center; padding: 1rem; }
.load-more a { font-size: 0.9rem; padding: 0.5rem 1.5rem; }

/* Info vide */
.info-vide { color: var(--text-muted); font-style: italic; margin: 1rem 0; }

.tableau-qualification .verifie-cell { text-align: center; width: 36px; }

/* ─── TOTAUX ────────────────────────────────────────────────────────────────── */
.famille-titre {
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.9rem;
  margin-top: 1.5rem;
  margin-bottom: 0.25rem;
}

.tableau-totaux { margin-bottom: 0.5rem; }
.tableau-totaux .montant { min-width: 90px; }
.tableau-totaux a { color: inherit; text-decoration: none; display: block; }
.tableau-totaux a:hover { text-decoration: underline; color: var(--primary); }

.famille-autres td { color: var(--text-muted); font-style: italic; }

/* ─── RAPPORT ───────────────────────────────────────────────────────────────── */
.rapport-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.rapport-header h1 { margin: 0; }
.rapport-header select {
  font-size: 1.1rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  background: #fff;
}

.rapport-textes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}
@media (max-width: 900px) { .rapport-textes { grid-template-columns: 1fr; } }

.rapport-bloc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 0;
}

.tableau-rapport { width: 100%; max-width: 800px; }
.tableau-rapport .montant { width: 120px; }
.tableau-rapport a { color: inherit; text-decoration: none; }
.tableau-rapport a:hover { text-decoration: underline; color: var(--primary); }

.rapport-bloc textarea {
  width: 100%;
  font-family: monospace;
  font-size: 0.83rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem;
  resize: vertical;
  background: #f8fafc;
  margin-bottom: 0.5rem;
}

/* ─── MESSAGES ──────────────────────────────────────────────────────────────── */
.succes {
  background: #dcfce7;
  color: var(--success);
  border: 1px solid #86efac;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.erreur {
  background: #fee2e2;
  color: var(--danger);
  border: 1px solid #fca5a5;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.alerte {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.alerte ul { margin: 0.5rem 0 0.5rem 1.25rem; }
.alerte li { margin-bottom: 0.2rem; }

.info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-top: 1.25rem;
  font-size: 0.83rem;
  color: #1e40af;
}

.info h3 { color: #1e40af; margin-bottom: 0.4rem; }
.info code { background: #dbeafe; padding: 0.15rem 0.3rem; border-radius: 3px; }

/* ─── STATUS SAUVEGARDE ─────────────────────────────────────────────────────── */
#sauvegarde-status {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  pointer-events: none;
  transition: opacity 0.3s;
}

.status-ok { background: #dcfce7; color: var(--success); border: 1px solid #86efac; }
.status-erreur { background: #fee2e2; color: var(--danger); border: 1px solid #fca5a5; }

/* ─── PAGINATION ────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 0.3rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.pagination a {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.83rem;
}

.pagination a:hover { background: #e2e8f0; }
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─── PIÈCES JOINTES ────────────────────────────────────────────────────────── */
.pj-th { text-align: center; width: 48px; }
.pj-cell { text-align: center; white-space: nowrap; width: 48px; }

.btn-pj-upload {
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.5;
  transition: opacity 0.15s;
  display: inline-block;
}
.btn-pj-upload:hover { opacity: 1; }

.btn-pj-view {
  font-size: 1rem;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.btn-pj-view:hover { opacity: 1; }

.btn-pj-del {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0 2px;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.btn-pj-del:hover { opacity: 1; }

/* ─── ADMIN RÉFÉRENTIELS ────────────────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.admin-tab {
  padding: 0.4rem 1rem;
  border-radius: 4px 4px 0 0;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-bottom: none;
  transition: background 0.15s;
}
.admin-tab:hover { background: #e2e8f0; color: var(--text); }
.admin-tab-active { background: var(--surface); color: var(--primary); border-color: var(--border); font-weight: 700; }

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

/* ─── ÉVOLUTION ─────────────────────────────────────────────────────────────── */
.tableau-evolution th, .tableau-evolution td { min-width: 80px; }

/* ─── DIVERS ────────────────────────────────────────────────────────────────── */
.compte { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 0.5rem; }
.vide { color: var(--text-muted); font-style: italic; margin: 0.75rem 0; }
small { color: var(--text-muted); font-size: 0.78rem; }
code { background: #f1f5f9; padding: 0.15rem 0.3rem; border-radius: 3px; font-size: 0.85em; }

/* ─── RESPONSIVE MOBILE (portrait) ─────────────────────────────────────────── */

/* Qualification : masquer colonnes secondaires en portrait */
@media (max-width: 768px) and (orientation: portrait) {
  .col-hide-mobile { display: none !important; }

  main { padding: 0.5rem 0.5rem; }

  .filtres { padding: 0.5rem 0.75rem; }
  .filtres-row { gap: 0.5rem; }

  /* Tableau totaux : empilage carte par ligne */
  .tableau-totaux,
  .tableau-totaux thead,
  .tableau-totaux tbody,
  .tableau-totaux tfoot,
  .tableau-totaux tr,
  .tableau-totaux th,
  .tableau-totaux td { display: block; width: 100%; box-sizing: border-box; }

  .tableau-totaux thead { display: none; }

  .tableau-totaux tbody tr,
  .tableau-totaux tfoot tr {
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    background: var(--surface);
    overflow: hidden;
  }

  .tableau-totaux td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 0.35rem 0.6rem;
    min-width: unset;
  }

  .tableau-totaux td:last-child { border-bottom: none; }

  .tableau-totaux td[data-label=""] { justify-content: flex-end; }

  .tableau-totaux td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: left;
    flex-shrink: 0;
    margin-right: 0.5rem;
  }

  .tableau-totaux td[data-label=""]::before { display: none; }

  .tableau-totaux .famille-titre { margin-top: 1rem; }

  /* Barre totaux filtre */
  .filtre-totaux { gap: 0.75rem; font-size: 0.82rem; }

  /* ── Tableau qualification : mode carte ─────────────────────────────────── */

  /* Désactiver le layout table sur toute la structure */
  .tableau-qual-main,
  .tableau-qual-main thead,
  .tableau-qual-main tbody { display: block; width: 100%; box-sizing: border-box; }

  /* Masquer la ligne d'en-têtes de colonnes */
  .tableau-qual-main thead tr:first-child { display: none !important; }

  /* Ligne de filtres : flex wrap */
  .tableau-qual-main thead tr.filtre-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.5rem;
  }
  .tableau-qual-main thead tr.filtre-row td {
    flex: 1 1 calc(50% - 0.175rem);
    border: none;
    padding: 0;
    min-width: 0;
  }
  .tableau-qual-main thead tr.filtre-row td.col-hide-mobile { display: none !important; }
  .tableau-qual-main thead tr.filtre-row td input,
  .tableau-qual-main thead tr.filtre-row td select { width: 100%; box-sizing: border-box; }

  /* Chaque ligne de données = une carte */
  .tableau-qual-main tbody tr {
    display: grid;
    grid-template-areas:
      "date tit verifie"
      "lib  lib  lib"
      "debit credit credit"
      "qual  qual   qual"
      "notes notes  pj";
    grid-template-columns: auto 1fr auto;
    gap: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.6rem;
    background: var(--surface);
    width: 100%;
    box-sizing: border-box;
  }
  .tableau-qual-main tbody tr:hover td { background: transparent; }

  /* Réinitialiser tous les td de la carte */
  .tableau-qual-main tbody td {
    border: none;
    padding: 0.1rem 0;
    display: block;
    box-sizing: border-box;
    background: transparent !important;
  }

  /* Positionnements dans la grille */
  .tableau-qual-main tbody td.date    { grid-area: date; font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
  .tableau-qual-main tbody td.tit     { grid-area: tit; font-size: 0.8rem; color: var(--text-muted); padding-left: 0.3rem; }
  .tableau-qual-main tbody td.lib     { grid-area: lib; font-weight: 500; white-space: normal; overflow: visible; text-overflow: unset; max-width: none; font-size: 0.9rem; }
  .tableau-qual-main tbody td.debit-cell  { grid-area: debit; font-size: 0.85rem; text-align: left; }
  .tableau-qual-main tbody td.credit  { grid-area: credit; font-size: 0.85rem; text-align: left; padding-left: 0.75rem; }
  .tableau-qual-main tbody td.qual-cell { grid-area: qual; }
  .tableau-qual-main tbody td.qual-cell select { width: 100%; }
  .tableau-qual-main tbody td.verifie-cell { grid-area: verifie; text-align: right; }
  .tableau-qual-main tbody td.notes-cell  { grid-area: notes; }
  .tableau-qual-main tbody td.notes-cell input { width: 100%; box-sizing: border-box; font-size: 0.82rem; }
  .tableau-qual-main tbody td.pj-cell     { grid-area: pj; text-align: right; }
  .tableau-qual-main tbody td.col-hide-mobile { display: none !important; }

  /* Couleurs de fond sur la carte entière via outline */
  .tableau-qual-main tbody tr.non-qual  { border-color: #fed7aa; background: #fff7ed; }
  .tableau-qual-main tbody tr.auto-qual { border-color: #bbf7d0; background: #f0fdf4; }

  /* Tableau rapport (annexes) : empilage carte par ligne */
  .tableau-rapport thead { display: none; }

  .tableau-rapport tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    background: var(--surface);
    overflow: hidden;
  }

  .tableau-rapport td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 0.35rem 0.6rem;
  }

  .tableau-rapport td:last-child { border-bottom: none; }
  .tableau-rapport td[data-label=""] { justify-content: flex-end; }

  .tableau-rapport td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: left;
    flex-shrink: 0;
    margin-right: 0.5rem;
  }

  .tableau-rapport td[data-label=""]::before { display: none; }
}
