/* ============================================================
   AfroPayroll — design system v2 (14/07/2026, demande par Issaka
   Keita : "design pro et futuriste de niveau final application
   Microsoft, Google, Meta"). Refonte visuelle uniquement : tous les
   noms de classes existants sont conserves a l'identique pour ne
   rien casser dans les templates deja en place (voir inventaire
   complet dans templates/*.html) - seules les valeurs (couleurs,
   ombres, rayons, typographie, transitions, micro-interactions)
   changent.
   ============================================================ */

:root {
  /* palette coeur (conservee pour compatibilite avec les usages
     inline eventuels), + tokens etendus pour la profondeur/soin
     visuel */
  --navy: #0b3d5c;
  --navy-dark: #072943;
  --navy-light: #14507a;
  --teal: #0f8b8d;
  --teal-light: #17aaac;
  --teal-dark: #0b6b6c;
  --amber: #d98c0f;
  --purple: #6c5ce7;
  /* Fond sable/dune du Sahara (15/07/2026, demande par Issaka Keita) -
     remplace le gris-bleu neutre d'origine ; les tokens de bordure sont
     re-tintes dans la meme famille chaude pour rester coherents. */
  --grey-bg: #ecdfc0;
  --grey-bg-alt: #e2cf9c;
  --grey-border: #ddc99a;
  --grey-border-strong: #c2a468;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --success: #1e7d4f;
  --success-bg: #e3f5ec;
  --text-primary: #172530;
  --text-secondary: #5c6b76;
  --text-muted: #8a99a3;

  --gradient-brand: linear-gradient(135deg, #0b3d5c 0%, #0f8b8d 100%);
  --gradient-brand-soft: linear-gradient(135deg, rgba(11, 61, 92, 0.06) 0%, rgba(15, 139, 141, 0.06) 100%);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(15, 35, 50, 0.05);
  --shadow-sm: 0 2px 6px rgba(15, 35, 50, 0.06);
  --shadow-md: 0 6px 18px rgba(15, 35, 50, 0.10);
  --shadow-lg: 0 16px 40px rgba(15, 35, 50, 0.16);
  --shadow-focus: 0 0 0 3px rgba(15, 139, 141, 0.18);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;
  margin: 0;
  background:
    radial-gradient(1100px 460px at 100% -10%, rgba(230, 168, 63, 0.25), transparent 60%),
    radial-gradient(900px 420px at -10% 100%, rgba(178, 128, 44, 0.18), transparent 55%),
    var(--grey-bg);
  color: var(--text-primary);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  /* Place reservee au menu vertical fixe a droite (08/07/2026, demande par
     Issaka Keita) - annulee sur petit ecran, cf. media query plus bas. */
  padding-right: 158px;
}

/* Scrollbar soignee (Chromium/Edge) - detail "produit fini" */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--grey-border-strong); border-radius: var(--radius-pill); border: 2px solid var(--grey-bg); }
::-webkit-scrollbar-thumb:hover { background: #a9b6c0; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  background: var(--gradient-brand);
  color: #fff;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 16px rgba(7, 41, 67, 0.28);
  /* Aspect "ecran incurve" (08/07/2026, demande par Issaka Keita) : coins
     bas arrondis sur la barre superieure, en echo au panneau de menu
     flottant a coins arrondis ci-dessous. */
  border-radius: 0 0 20px 20px;
}

.topbar .brand {
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  color: #fff;
}
.topbar .brand::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(217, 140, 15, 0.25);
  margin-right: 10px;
}

.topbar nav { display: flex; align-items: center; flex-wrap: wrap; }
.topbar nav a {
  position: relative;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  margin-right: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 500;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
  white-space: nowrap;
}
.topbar nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.10); }
.topbar nav a.active { color: #fff; background: rgba(255, 255, 255, 0.16); font-weight: 600; }

.topbar .user-box { font-size: 0.82rem; color: rgba(255, 255, 255, 0.78); display: flex; align-items: center; gap: 6px; }
.topbar .user-box a { color: #ffd58a; margin-left: 6px; text-decoration: none; font-weight: 600; }
.topbar .user-box a:hover { text-decoration: underline; }

/* ----------------------------------------------- menu vertical a droite
   (08/07/2026, demande par Issaka Keita) - remplace l'ancienne navigation
   horizontale de .topbar (classes .topbar nav / .topbar nav a conservees
   ci-dessus pour compatibilite mais plus utilisees par base.html). Fixe sur
   le cote droit de l'ecran, sous la barre superieure (marque/utilisateur) ;
   repasse en barre horizontale defilante sous 900px (cf. media query). */
.sidebar-right {
  /* Panneau flottant a coins arrondis (08/07/2026, demande par Issaka Keita
     : "aspect ecran incurve" du menu) - remplace l'ancien bandeau plaque
     bord a bord (top:0, height:100vh, coins droits) par un panneau inset
     (marge haut/bas/droite) avec un rayon prononce sur les 4 coins. Le
     body garde le meme padding-right (158px = 150px de large + 8px de
     marge droite du panneau), donc aucune reprise necessaire ailleurs. */
  position: fixed;
  top: 68px;
  right: 8px;
  bottom: 8px;
  width: 150px;
  height: auto;
  padding-top: 10px;
  padding-bottom: 10px;
  border-radius: 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--gradient-brand);
  box-shadow: 0 10px 30px rgba(7, 41, 67, 0.28);
  z-index: 40;
}
.sidebar-right a {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
  white-space: nowrap;
}
.sidebar-right a .nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; flex-shrink: 0; }
.sidebar-right a:hover { color: #fff; background: rgba(255, 255, 255, 0.10); }
.sidebar-right a.active { color: #fff; background: rgba(255, 255, 255, 0.16); font-weight: 600; }

/* Container plaque contre le menu vertical (08/07/2026, demande par Issaka
   Keita) : marge-droite fixe et fine plutot qu'un centrage auto, qui
   laissait un grand espace vide entre le contenu et le menu sur les larges
   ecrans (l'auto-centrage du bloc max-width dans l'espace restant, bien
   plus large que 1220px sur un ecran large, produisait cet espace). Marge
   du haut egalement reduite. */
.container { max-width: none; margin: 10px 8px 10px 12px; padding: 0 18px; } /* max-width retire (08/07/2026, demande par Issaka Keita) : le centrage auto laissait un grand vide a gauche sur les ecrans larges (marge gauche automatique absorbant tout l espace au-dela de 1220px) - desormais le contenu utilise toute la largeur disponible entre une petite marge gauche fixe et le menu vertical a droite. */

/* Pages "compactes" (08/07/2026, demande par Issaka Keita) : Employes et
   Paie mensuelle (liste + detail d'une periode) contiennent de larges
   tableaux de travail - on reduit encore l'espace haut/lateral autour
   d'elles (par rapport au reste de l'application) pour laisser le maximum
   de place au tableau. Applique via {% block body_class %}compact-page{%
   endblock %} dans le template (cf. base.html). */
body.compact-page .container { padding: 0 8px; margin-top: 4px; }
body.compact-page h1 { margin-bottom: 8px; }
body.compact-page .card { padding: 12px 14px; margin-bottom: 12px; }

/* ---------------------------------------------------------- tabs-nav --- */
/* Onglets (12/07/2026) - utilises par la page Listes de reference pour
   remplacer un long defilement unique par des sections consultables une a
   une. Generique : reutilisable par toute autre page ayant besoin du meme
   decoupage (.tabs-nav + boutons .tab-btn[data-tab], panneaux .tab-panel
   affiches/masques via JS, cf. lists_view.html). */
.tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--grey-border);
  padding-bottom: 0;
}
.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 9px 14px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.tab-btn:hover { background: var(--grey-bg-alt); }
.tab-btn.active {
  background: #fff;
  color: var(--navy-dark);
  border-color: var(--grey-border);
  border-bottom: 1px solid #fff;
  margin-bottom: -1px;
}

/* ------------------------------------------------------------------ card */
.card {
  background: #fff;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}
.card:hover { box-shadow: var(--shadow-sm); border-color: var(--grey-border-strong); }

h1 {
  color: var(--navy-dark);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 18px 0;
}
h2 {
  color: var(--teal-dark);
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.005em;
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ----------------------------------------------------------------- icon */
/* Icones SVG inline (12/07/2026, remplacement des emojis - cf. icons.py) -
   generique, utilisee partout ou une icone accompagne du texte (nav,
   titres de section, boutons). currentColor : herite automatiquement la
   couleur du texte parent, pas de gestion de couleur separee necessaire. */
.icon { display: inline-block; flex-shrink: 0; vertical-align: -0.15em; }

/* --------------------------------------------------------------- badges */
.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--grey-bg-alt);
  color: var(--text-secondary);
}
.badge-brouillon { background: #eef0f2; color: #5c6b76; }
.badge-valide_preparateur { background: #fdf1da; color: #a9660a; }
.badge-cloture { background: var(--success-bg); color: var(--success); }

/* --------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
th, td { padding: 9px 11px; border-bottom: 1px solid var(--grey-border); text-align: left; }
th {
  background: var(--navy-dark);
  color: #fff;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
}
tbody tr { transition: background-color 0.1s var(--ease); }
tbody tr:nth-child(even) { background: #fafbfd; }
tbody tr:hover { background: #eef6f6; }
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }
.text-right { text-align: right; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---------------------------------------------------------------- boutons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 17px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 0.87rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: var(--teal);
  box-shadow: var(--shadow-xs);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease), background-color 0.12s var(--ease), opacity 0.12s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); opacity: 0.96; }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-xs); }
.btn-navy { background: var(--navy); }
.btn-navy:hover { background: var(--navy-light); }
.btn-teal { background: var(--teal); }
.btn-teal:hover { background: var(--teal-light); }
.btn-amber { background: var(--amber); }
.btn-danger { background: var(--danger); }
.btn-outline { background: #fff; color: var(--navy); border: 1.5px solid var(--grey-border-strong); box-shadow: none; }
.btn-outline:hover { border-color: var(--navy); background: var(--grey-bg-alt); color: var(--navy-dark); }

/* --------------------------------------------------------- nav-toggle --- */
/* Bouton hamburger (12/07/2026, audit UI) - masque sur grand ecran, ou le
   menu vertical fixe (.sidebar-right) reste toujours entierement visible. */
.nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-toggle:hover { background: rgba(255, 255, 255, 0.24); }

/* ----------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 22px; }
@media (max-width: 900px) {
  body { padding-right: 0; }
  .nav-toggle { display: flex; }
  /* Le detail du role (ex. "(admin_validateur)") allonge inutilement la
     barre superieure sur petit ecran, au point de forcer un retour a la
     ligne disgracieux avant les liens FR/EN/Deconnexion - masque sous
     600px, le nom complet suffit a identifier le compte connecte. */
  .sidebar-right {
    /* Repasse d'un panneau flottant fixe a un menu deroulant plein-
       largeur : ferme par defaut (display:none), ouvert via le bouton
       hamburger (cf. basculerMenuNavigation() dans base.html) - remplace
       l'ancienne barre horizontale a defilement (overflow-x:auto) qui ne
       signalait par aucun indice visuel la presence d'elements caches
       au-dela du bord de l'ecran (la moitie des sections de l'application
       etaient de fait injoignables en usage tablette/mobile).
       display:none et display:flex uniquement (ci-dessous) demandes en
       !important : la regle `display: flex` posee inline plus haut dans la
       feuille de style (regle desktop) a la meme specificite qu'un
       selecteur de classe simple et pourrait sinon l'emporter selon
       l'ordre de chargement. */
    display: none !important;
    position: static;
    width: 100%;
    height: auto;
    padding-top: 0;
    flex-direction: column;
    overflow-x: visible;
    overflow-y: visible;
    box-shadow: none;
    border-radius: 0;
    top: auto; right: auto; bottom: auto;
    margin-bottom: 10px;
  }
  .sidebar-right.nav-open { display: flex !important; }
  .sidebar-right a { padding: 11px 16px; font-size: 0.85rem; white-space: normal; }
}
@media (max-width: 600px) {
  .user-role-detail { display: none; }
}
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
  .topbar nav a { margin-right: 2px; padding: 6px 9px; }
  .container { margin: 14px auto; padding: 0 12px; }
}

label { display: block; font-size: 0.8rem; font-weight: 650; color: var(--text-secondary); margin-bottom: 4px; letter-spacing: 0.01em; }
input, select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  transition: border-color 0.14s var(--ease), box-shadow 0.14s var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: var(--grey-border-strong); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: var(--shadow-focus);
}
input[type=checkbox] { width: auto; accent-color: var(--teal); }

/* -------------------------------------------- afficher/masquer mot de passe */
.password-field { position: relative; }
.password-field input { padding-right: 38px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color 0.14s var(--ease), background-color 0.14s var(--ease);
}
.password-toggle:hover { color: var(--navy); background: var(--grey-bg-alt); }
.password-toggle svg { display: block; }

/* ----------------------------------------------------------------- flash */
.flash {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 0.89rem;
  border-left: 4px solid transparent;
  box-shadow: var(--shadow-xs);
}
.flash-success { background: var(--success-bg); color: var(--success); border-left-color: var(--success); }
.flash-danger { background: var(--danger-bg); color: var(--danger); border-left-color: var(--danger); }
.flash-warning { background: #fdf1da; color: #8a5a00; border-left-color: var(--amber); }

/* ------------------------------------------------------------------- kpi */
.kpi-row { display: flex; gap: 16px; flex-wrap: wrap; }
.kpi {
  background: #fff;
  border: 1px solid var(--grey-border);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  flex: 1;
  min-width: 170px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi:nth-child(5n+1) { border-left-color: var(--navy); }
.kpi:nth-child(5n+2) { border-left-color: var(--teal); }
.kpi:nth-child(5n+3) { border-left-color: var(--amber); }
.kpi:nth-child(5n+4) { border-left-color: var(--success); }
.kpi:nth-child(5n+5) { border-left-color: var(--purple); }
.kpi .value {
  font-size: 1.65rem;
  font-weight: 750;
  color: var(--navy-dark);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.kpi .label { font-size: 0.78rem; color: var(--text-secondary); margin-top: 3px; }
.kpi .kpi-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 5px; }
.kpi .kpi-icon { display: flex; margin-bottom: 6px; opacity: 0.85; color: var(--navy); }

/* -------------------------------------------------- en-tete de page (dashboard) */
.dash-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}
.dash-header h1 { margin-bottom: 4px; }
.dash-subtitle { color: var(--text-secondary); font-size: 0.92rem; margin: 0; }

/* Petit intitule de section en majuscules, avec un trait d'accent teal -
   sert a hierarchiser visuellement les groupes de KPI du dashboard
   (Apercu / Effectifs / Conges / Paie / Cumuls annuels) sans avoir a
   utiliser un <h2> a chaque fois (trop lourd visuellement pour un simple
   separateur de section). */
.section-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 28px 0 10px;
  display: flex;
  align-items: center;
}
.section-eyebrow:first-of-type { margin-top: 0; }
.section-eyebrow::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient-brand);
  margin-right: 9px;
}

/* ---------------------------------------------------------------- footer */
.footer-note { font-size: 0.78rem; color: var(--text-muted); text-align: center; margin: 28px 0; }

.anomalie { color: var(--danger); font-weight: 700; }

/* Tableau a entete et 2 premieres colonnes figees, avec defilement
   horizontal ET vertical (07/07/2026) - utilise sur le tableau des
   bulletins de la page Periode (beaucoup de colonnes + beaucoup de lignes).
   Volontairement scope a .table-freeze-scroll (et non ajoute a .table-wrap
   globalement) pour ne pas modifier la mise en forme des autres tableaux de
   l'application (Listes, Employes...) qui n'ont pas besoin de colonnes
   figees. Le conteneur a une hauteur maximale bornee (max-height) pour que
   le defilement vertical se produise DANS le tableau plutot que sur toute
   la page. */
.table-freeze-scroll {
  max-height: 65vh;
  overflow: auto;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}
.table-freeze-scroll table { margin: 0; }
.table-freeze-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}
.table-freeze-scroll th:nth-child(1),
.table-freeze-scroll td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 90px;
  max-width: 90px;
  background: #fff;
}
.table-freeze-scroll th:nth-child(2),
.table-freeze-scroll td:nth-child(2) {
  position: sticky;
  left: 90px;
  z-index: 2;
  width: 170px;
  max-width: 170px;
  white-space: normal;
  background: #fff;
  box-shadow: 2px 0 4px -2px rgba(0, 0, 0, 0.2);
}
.table-freeze-scroll thead th:nth-child(1),
.table-freeze-scroll thead th:nth-child(2) {
  z-index: 4;
  background: var(--navy-dark);
}
.table-freeze-scroll tbody tr:hover td:nth-child(1),
.table-freeze-scroll tbody tr:hover td:nth-child(2) {
  background: #eef6f6;
}
.table-freeze-scroll tbody tr.row-solde-tout-compte td {
  background: #fdf1da;
}
.table-freeze-scroll tbody tr.row-solde-tout-compte:hover td {
  background: #fbe4ae;
}

/* ------------------------------------------------ dashboard compact (14/07/2026)
   Demande par Issaka Keita : tenir le tableau de bord dans un seul coup
   d'oeil, sans defilement. Volontairement scope a .dashboard-compact
   (classe posee uniquement sur templates/dashboard.html) pour ne pas
   reduire les cartes/KPI des AUTRES pages (Periode, etc.) qui partagent
   les memes classes generiques .card/.kpi/.section-eyebrow. */
.dashboard-compact .dash-header { margin-bottom: 10px; }
.dashboard-compact h1 { font-size: 1.28rem; margin-bottom: 2px; }
.dashboard-compact .dash-subtitle { font-size: 0.76rem; }
.dashboard-compact .section-eyebrow {
  margin: 10px 0 6px;
  font-size: 0.66rem;
}
.dashboard-compact .section-eyebrow:first-of-type { margin-top: 0; }
.dashboard-compact .kpi-row { gap: 8px; }
.dashboard-compact .kpi {
  padding: 7px 10px;
  border-left-width: 3px;
  min-width: 128px;
  flex: 1 1 128px;
}
.dashboard-compact .kpi:hover { transform: none; box-shadow: var(--shadow-sm); }
.dashboard-compact .kpi .value { font-size: 1.04rem; font-weight: 700; }
.dashboard-compact .kpi .label { font-size: 0.61rem; margin-top: 1px; line-height: 1.15; }
.dashboard-compact .kpi .kpi-sub { font-size: 0.56rem; margin-top: 1px; }
.dashboard-compact .kpi .kpi-icon { margin-bottom: 2px; }
.dashboard-compact .kpi .kpi-icon svg { width: 18px; height: 18px; }
.dashboard-compact .card { padding: 10px 14px; margin-bottom: 0; }
.dashboard-compact .card h2 { font-size: 0.85rem; margin-bottom: 8px; }
.dashboard-compact .card .btn { padding: 5px 10px; font-size: 0.76rem; margin-bottom: 4px; }
.dashboard-compact table { font-size: 0.74rem; }
.dashboard-compact th, .dashboard-compact td { padding: 3px 7px; }
.dashboard-compact .dash-bottom-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-top: 14px;
}
.dashboard-compact .dash-bottom-row .card { flex: 1 1 280px; min-width: 260px; }
@media (max-width: 700px) {
  .dashboard-compact .dash-bottom-row { flex-direction: column; }
}

/* ------------------------------------------------------------- timesheet */
.badge-soumis { background: #fdf1da; color: #a9660a; }
.badge-approuve { background: var(--success-bg); color: var(--success); }
.badge-rejete { background: var(--danger-bg); color: var(--danger); }
.badge-non_soumis { background: #eef0f2; color: #5c6b76; }
.badge-en_attente { background: #fdf1da; color: #a9660a; }

.ts-nav-mois {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.ts-nav-mois .ts-mois-label {
  font-weight: 700;
  color: var(--navy-dark);
  font-size: 1.02rem;
  min-width: 130px;
  text-align: center;
}

.ts-grid-wrap { overflow-x: auto; border-radius: var(--radius-md); }
table.ts-grid { font-size: 0.76rem; }
table.ts-grid th, table.ts-grid td { padding: 5px 6px; text-align: center; white-space: nowrap; }
table.ts-grid th.ts-col-projet, table.ts-grid td.ts-col-projet { text-align: left; min-width: 190px; white-space: normal; }
table.ts-grid td.ts-weekend, table.ts-grid th.ts-weekend { background: var(--grey-bg-alt); color: var(--text-muted); }
table.ts-grid input.ts-heures {
  width: 44px;
  padding: 3px 2px;
  text-align: center;
  font-size: 0.76rem;
}
table.ts-grid td.ts-weekend input { display: none; }
table.ts-grid td.ts-total-ligne, table.ts-grid th.ts-total-ligne { font-weight: 700; background: #f4f7f8; }
table.ts-grid tfoot td { font-weight: 700; background: var(--navy-dark); color: #fff; }
.ts-actions-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.ts-commentaire-rejet {
  background: var(--danger-bg);
  color: var(--danger);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.87rem;
}
