/* ==========================================================================
   Charte graphique — Risler & Burilovic / SwissLife
   Rouge de marque : #E30127   ·   Encre (noir logo) : #1D1D1B
   ========================================================================== */
:root {
  --brand: #E30127;
  --brand-dark: #a3011c;
  --brand-light: #fdf2f4;
  --encre: #1D1D1B;
}

@keyframes slidein {
  from { transform: translateX(1rem); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* Barres de défilement discrètes, teintées marque */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f6f6f6; }
::-webkit-scrollbar-thumb { background: #c9c9c7; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

/* Sélection de texte aux couleurs de la marque */
::selection { background: var(--brand); color: #fff; }

/* Champs de saisie : focus rouge de marque */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px rgba(227, 1, 39, 0.15);
}

/* Accessibilité clavier sur les boutons */
button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- Lisibilité des chiffres ----------
   Chiffres à largeur fixe : les montants s'alignent verticalement colonne
   par colonne, ce qui rend les ordres de grandeur immédiatement comparables. */
.tabular,
td[class*="text-right"],
th[class*="text-right"],
.kpi-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Montants : légèrement espacés pour respirer */
td[class*="text-right"] {
  letter-spacing: 0.015em;
}

/* Valeur des indicateurs : chiffres resserrés mais aérés */
.kpi-value {
  letter-spacing: -0.015em;
}

/* ---------- Tableaux ---------- */
thead th { position: relative; }

/* En-têtes de colonnes : plus d'air et hiérarchie typographique claire */
thead th {
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7d7d7a;
  font-weight: 600;
  white-space: nowrap;
}

/* Lignes de tableau : survol teinté marque + séparateurs discrets */
tbody tr { transition: background-color .12s ease; }
tbody tr:hover { background-color: rgba(227, 1, 39, 0.04); }

/* Ligne de total : détachée du corps du tableau */
tbody tr.ligne-total,
tfoot tr {
  background: #f6f6f6;
  font-weight: 600;
  border-top: 2px solid #c9c9c7;
}

/* ---------- Animations d'apparition ---------- */
@keyframes fadeup {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim-in { animation: fadeup .28s ease both; }

/* Cartes : léger relief au survol pour signaler l'interactivité */
.carte-hover { transition: box-shadow .18s ease, transform .18s ease; }
.carte-hover:hover {
  box-shadow: 0 6px 20px -6px rgba(29, 29, 27, 0.18);
  transform: translateY(-1px);
}

/* Filet de marque en haut des cartes de section */
.brand-rule { border-top: 3px solid var(--brand); }

/* Impression des états : logo conservé, navigation masquée */
@media print {
  #main-nav, button, #btn-account, #btn-logout { display: none !important; }
  header { border: none !important; box-shadow: none !important; }
  footer { display: none !important; }
  body { background: #fff; }
  section { break-inside: avoid; border: 1px solid #e7e7e6 !important; }
  a[href]::after { content: none !important; }
}
