/* --- Layout général --- */
:root {
    --egest-blue: #062867;
    --egest-purple: #a026df;
    --egest-white: #FFFFFF;
    --egest-gradient: linear-gradient(135deg, #062867 0%, #7E25D7 100%);

    --navy: #1a2456;
    --navy-light: #223072;
    --purple: #a026df;
    --purple-light: #daadf1;
    --gradient-brand: linear-gradient(135deg, var(--navy) 0%, var(--purple) 100%);
}

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

html,
body {
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    --color-lavender: #E6E6FA;
    --color-primary: darkslategrey;
    --color-secondary: #f68e5f;
    --color-tertiary: #ffeee6;

    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    min-width: 0;
    max-width: 100%;

    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #1a1a1a;
    background-color: var(--color-lavender);
    overflow-x: hidden;
}

/* Mise en forme des titres */
h1 {
    text-align: center;
    /*margin: 10px;*/
    font-size: 36px;
    font-weight: 900;
    font-family: serif;
    color: #4a90e2;
}

.h1-t {
    /*text-align: center;*/
    /*margin: 10px;*/
    font-size: 36px;
    font-weight: 900;
    font-family: serif;
    color: #4a90e2;
}

h2 {
    margin: 10px;
    font-size: 12px;
    font-weight: 600;
    color: darkslategrey;
}

.client_infos_div {
  border: 1px solid #573333;
  margin-left: auto;
  text-align: left;
  align-content: left;
  color: azure;
  align-self: right;
  align-items: left;
}

h3 {
    margin: 10px;
    font-size: 12px;
    font-weight: 500;
  text-align: center;
    color: var(--color-secondary);
}

a {
    /*display  block;
    margin-top: 14px; */
    text-align: center;
    color: darkolivegreen;
    font-weight: 600;
    font-style: bold;
    text-decoration: none;
}

p {
    display: block;
    margin-top: 24px;
    text-align: center;
    color: dimgrey;
    text-decoration: none;
}

p1 {
    display: block;
    width: 100%;
    margin-left: 1px;
    margin-top: 24px;
    text-align: center;
    color: dimgrey;
    text-decoration: none;
}

/* --- Sidebar --- */
.sidebar {
    flex: 0 0 220px;
    width: 220px;
    min-width: 220px;
    height: 100%;
    align-self: stretch;

    background: #4f5569;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    transition:
        width 0.2s ease,
        flex-basis 0.2s ease,
        transform 0.2s ease;
}

.sidebar-menu a, .action-bouton {
    display: flex;
    flex-direction: row;
    align-items: center;
    vertical-align: center;
    background-color: #00000000;
    color: aliceblue;
    font-size: 12px;
    padding: 4px 4px;
    /*margin-left: 10px;*/
    flex-shrink: 0;
    gap: 10px;
}

.sidebar-header {
    display: flex;
    max-height: 72px;
    height: 100%;
    align-items: center;
    gap: 8px;
    padding: 18px 16px 10px 16px;
    border-bottom: 1px solid #2a2a2a;
}

.sidebar-header .logo {
    width: 32px;
    height: 32px;
}

.app-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: #f5f5f5;
    white-space: nowrap;
}

.menu {
    display: flex;
    flex-direction: column;
    align-self: center;
    align-items: flex-start;
    padding: 16px 0px 0px 0px;
    gap: 10px;
    flex-shrink: 0;
}

.ligne-cliquable {
    cursor: pointer;
}

.ligne-cliquable:hover {
    background: #262626;
}

.menu a img, .section-header a img,
.sidebar-menu a img {
    width: 32px;
    height: 32px;
    /*flex-shrink: 0;
    object-fit: contain;*/
}

.section-header a {
    display: flex;
    flex-direction: row;
    text-decoration: none;
    font-size: 0.85rem;
    margin-left: auto;
    margin-right: 10px;
}

.section-header a span {
    display: flex;
    flex-direction: row;
    color: #6aa9ff;
    margin-inline-start: 5px;
    align-self: center;
    margin-top: 12px;
}

.menu a {
    display: flex;
    flex-direction: row;
    padding: 8px 0px;
    align-items: center;
    border-radius: 2px;
    color: #cfcfcf;
    text-decoration: none;
    column-gap: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
}

.menu a:hover {
   /* background: #2a2a2a;*/
    color: #6aa9ff;
}

/* Sidebar rétractée : icônes seules */
.sidebar.collapsed {
    flex: 0 0 60px;
    width: 60px;
    min-width: 60px;
    overflow: hidden;
    align-content: start;
}

.sidebar.collapsed .sidebar-header .head-logo-icon {
    display: none;
}

.sidebar.collapsed .app-name,
.sidebar.collapsed .menu a {
    font-size: 0;
}

.sidebar.collapsed .menu a::first-letter {
    font-size: 0;
}

/* --- Zone principale --- */
.main-area {
    flex: 1 1 auto;

    width: calc(100% - 60px);
    max-width: calc(100% - 60px);
    min-width: 0;

    display: flex;
    flex-direction: column;

    margin: 0;
    padding: 0;

    box-sizing: border-box;
}

.topbar {
    display: flex;

    width: 100%;
    max-width: none;
    min-width: 0;

    height: 72px;
    min-height: 72px;
    max-height: 72px;

    box-sizing: border-box;

    gap: 14px;
    padding: 8px;

    background: #4f5569;
    border-bottom: 1px solid #2a2a2a;
}

.menu-toggle {
    background: none;
    border: none;
    align-self: center;
    color: #e4e4e4;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.menu-toggle:hover {
    background: #2a2a2a;
}

.topbar-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: #2F4F4F;
    font-weight: 900;
    font-size: 24px;
    margin-top: auto;
    margin-bottom: auto;
    margin-left: 10px;
}

.topbar-logo {
    transition: opacity 0.15s ease;
    align-self: center;
}
/* pour l’apparence du logo dans topbar */
body.sidebar-visible .topbar-logo {
    display: none;
}
/* ---- */
.content {
    display: block;
    width: 100%;
    padding: 5px;
    box-sizing: border-box;
}

/* --- Messages flash rangés --- */
.message-box {
    margin-bottom: 20px;
}

.erreurs {
    list-style: none;
}

.erreurs li {
    background: #2a2a2a;
    color: #f5c542;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 6px;
    border-left: 3px solid #f5c542;
    font-size: 0.9rem;
}

/* --- Profil widget --- */
.profil-widget {
    margin-left: auto;
    align-self: center;
    
}

.profil-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #6aa9ff;
    color: #121212;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.profil-icon {
    width: 32px;
    height: 32px;
    align-self: center;
}

.profil-infos {
    flex: 1;
}

.profil-name {
    align-self: center;
}

.profil-infos h2 {
    font-size: 1rem;
    margin-bottom: 12px;
    
}

.profil-infos p {
    font-size: 0.85rem;
    color: #999;
}

.profil-lien {
    display: flex;
    flex-direction: row;
    gap: 10px;
    color: #6aa9ff;
    font-size: 0.85rem;
    text-decoration: none;
   /* white-space: nowrap;*/
}

/* --- Stats dashboard --- */

.stats-admin-grille {
  display: flex;
  height: fit-content;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.stat-carte {
    background: #1e1e1e;
    padding: 16px;
    border-radius: 10px;
    display: flex;
  height: fit-content;
    flex-direction: column;
    gap: 4px;
}

.stat-lien {
    justify-content: space-between;
    flex-direction: row;
    align-items: center;
    text-decoration: none;
    color: #e4e4e4;
}

.stat-fleche {
    color: #6aa9ff;
    font-size: 1.2rem;
}

.stat-label {
    font-size: 0.8rem;
    color: #999;
}

.stat-valeur {
    font-size: 1.5rem;
    font-weight: 700;
    color: lavender;
}

/* --- Détail entreprise --- */
.entreprise-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: 120px;
    background: #1e1e1e;
    padding: 10px 5px 10px 5px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

/* --- Section aperçu entreprises --- */
.section-header {
    display: flex;
    width: 100%;
    padding: 5px 5px 5px 5px;
    background: #00000015;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.section-header h2 {
    font-size: 1.05rem;
}

.page-title {
    display: flex;
    width: 100%;
    max-height: 50px;
    height: 100%;
    background: #00000010;
    padding-left: 16px;
}

.cartes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.carte-entreprise {
    display: block;
    background: #1e1e1e;
    padding: 16px;
    border-radius: 10px;
    color: #e4e4e4;
    text-decoration: none;
    transition: background 0.15s ease;
}

.carte-entreprise:hover {
    background: #262626;
}

.logo-mini {
    width: 100%;
    max-height: 48px;
    height: 100%;
    border-radius: 0px;
    margin-top: 0px;
    padding: 2px;
    object-fit: cover;
    margin-bottom: 10px;
}

.logo-detail {
    max-width: 218px;
    max-height: 52px;
    align-self: flex-start;
    
}

.transactions-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 6px;
    font-size: 0.78rem;
    color: #999;
}

.transactions-section {
  border: 2px solid var(--entreprise-secondary);
  border-radius: 12px;
  background: var(--egest-white);
}

.stat-recette { color: #4caf50; }
.stat-depense { color: #e57373; }
.stat-bilan { color: #e47719; }

.logo-placeholder {
    max-width: 100px;
    max-height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #6aa9ff;
    color: #121212;
    font-weight: 300;
}

.carte-entreprise h3 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.slogan {
    color: #999;
    font-style: italic;
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.slogan-t {
    color: #fff;
    font-style: italic;
    font-size: 0.8rem;
    margin-bottom: 6px;
    margin-top: 2px;
}

.secteurs-tags {
    display: flex;
    font-size: 0.75rem;
    margin-left: 2px;
    align-self: flex-start;
    color: #6aa9ff;
}

/* --- État vide --- */
.etat-vide {
    background: #1e1e1e;
    padding: 30px 20px;
    border-radius: 10px;
    text-align: center;
}

.etat-vide p {
    color: #999;
    margin-bottom: 14px;
}

.bouton-primaire {
    color: #fff;
    width: 25%;
    font-size: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 13px;
    border: 2px solid var(--egest-purple);
    border-radius: 8px;
    background: var(--egest-blue);
    /*color: var(--df-primary-dark);*/
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    transition: .15s ease;
}
.bouton-primaire:hover {
  color: #351a3f;
  background: #33757d;
  border: 2px solid var(--egest-blue);
  
}

a, .action-bouton:hover, .lien-retour:hover {
    color: var(--purple-light);
}

.sidebar a.active {
    background: var(--gradient-brand);
    color: #fff;
}

input, select, textarea {
    padding: 10px 12px;
    border: 1px solid #333;
    border-radius: 6px;
    font-size: 1rem;
    background-color: #2a2a2a;
    color: #e4e4e4;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6aa9ff;
}

button {
    padding: 10px 12px;
    background-color: #6aa9ff;
    color: #121212;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background-color: #4a8ce0;
}

/* --- Responsive mobile --- */
/* Ancien bloc supprimé : contenait un commentaire mal imbriqué qui faisait
   fuiter ses règles hors du @media et les appliquait globalement.
   Les règles mobiles utiles sont désormais dans les @media plus bas
   (820px et 640px). */


.logo-icon {
    max-width: 32px;
    width: 100%;
    max-height: 32px;
    height: 100%;
    flex-shrink: 0;
  /*  border-radius: 8px; */
}

.head-logo-icon {
    width: 80%;
    height: 36px;
    flex-shrink: 0;
  /*  border-radius: 8px; */
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-slogan {
    font-size: 0.68rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .sidebar-brand {
    display: none;
}

/* --- Pages d'authentification --- */
.page-auth {
    display: flex;
    flex-direction: column;
   /* justify-items: center;
    align-items: center; */
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    display: flex;
    flex-direction: column;
    justify-self: center;
    align-self: center;
    margin-top: 84px;
    max-width: 420px;
    width: 100%;
}

.auth-logo {
    height: 48px;
    margin-left: 18%;
    margin-right: 18%;
    margin-bottom: 24px;
    justify-self: center;
}

.auth-container h1 {
    margin-bottom: 16px;
    justify-self: center;
}

.auth-container form {
    width: 100%;
}

/* --- Cartes entreprise : infos supplémentaires --- */
.carte-meta {
    font-size: 0.72rem;
    color: #777;
    margin-top: 6px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.info-carte {
    background: #1e1e1e;
    padding: 14px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-carte-large {
    grid-column: span 2;
}

.info-valeur {
    font-size: 1rem;
    font-weight: 600;
    color: azure;
}

.description-carte {
    background: #1e1e1e;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 24px;
}

.description-carte h2 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.description-carte p {
    color: #ccc;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* --- Transactions --- */
.form-transaction {
    max-width: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.form-transaction select,
.form-transaction input {
    flex: 1;
    min-width: 120px;
}

.transactions-liste {
    list-style: none;
    display: flex;
    flex-direction: column;
  scroll-behavior: auto;
  margin: 10px;
    gap: 8px;
}

.badge {
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-recette {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}

.badge-depense {
    background: rgba(229, 115, 115, 0.15);
    color: #e57373;
}

.transaction-date {
    color: #888;
    margin-left: auto;
}

.transaction-desc {
    width: 100%;
    color: #999;
    font-size: 0.8rem;
}

.texte-secondaire {
    color: #888;
    font-size: 0.99rem;
    margin-bottom: 10px;
}

/* --- Bilan --- */
.stats-bilan {
    grid-template-columns: repeat(2, 1fr);
}

.benefice-carte {
    background: #1e1e1e;
    padding: 18px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 24px;
}

.benefice-valeur {
    font-size: 1.8rem;
    font-weight: 700;
    color: lavender;
}
.positif { color: #4caf50;
           border-left: 4px solid #4caf50;
           padding-left: 8px;
         }
.negatif { color: #e57373;
           border-left: 4px solid #e57373; 
           padding-left: 8px;
         }
.positif-bg { border-left: 4px solid #4caf50; }
.negatif-bg { border-left: 4px solid #e57373; }

.detail-section h2 {
    font-size: 1.05rem;
    margin-bottom: 12px;
}

/* --- Paramètres --- */
.parametres-section h2 {
    font-size: 1rem;
    margin-bottom: 12px;
}

/* --- Formulaires (existants, contexte préservé) --- */
form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
    width: 100%;
    background: white;
    text-align: left;
    padding: 24px;
    border-radius: 10px;
    /** box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    background: #1e1e1e;
    */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.form-large {
    display: flex;
    flex-direction: column;
    max-width: 1180px;
    width: 100%;
    gap: 12px;
    background: azure;
    text-align: left;
    padding: 24px;
    border-radius: 10px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 26px;
    /** box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    background: #1e1e1e;
    */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.doc-form-select {
  /*max-width: 100px;
  width: 80%;*/
  margin-left: auto;
  align-content: left;
  margin-bottom: 10px;
}

.doc-form-select1 {
  /*max-width: 100px;
  width: 80%;*/
  margin-bottom: 10px;
  margin-top: 10px;
}

.doc-form-div1 {
  display: flex;
  flex-direction: row;
}

.doc-form-client {
  display: flex;
  flex-direction: column;
  width: 50%;
  gap: 10px;
}

.doc-form-client2 {
  display: flex;
  flex-direction: column;
  background: lavender;
  width: 100%;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
}

.doc-form-client div {
  gap: 10px;
}

.doc-form-clt {
  display: flex;
  flex-direction: row;
}

.doc-form-clt input {
  width: 75%;
}

.doc-form-date {
  display: flex;
  flex-direction: column;
  margin-left: auto;
  gap: 10px;
}

.doc-form-date label {
  margin-left: auto;
}

.d-c {
    max-width: 500px;
    justify-self: center;
    margin-left: auto;
    margin-right: auto;
    margin-top: 24px;
}

.form-large h2 {
    font-size: 1.5rem;
    color: #777;
    margin-top: 8px;
    margin-bottom: 12px;
}

.actions-rapides {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: aliceblue;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 64px;
}

.action-bouton {
    background: #1e1e1e;
    color: #e4e4e4;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    border: 1px solid #2a2a2a;
    transition: border-color 0.15s ease;
}

.action-bouton:hover {
    border-color: #6aa9ff;
    color: #6aa9ff;
}

.lien-retour {
    display: inline-block;
    margin-top: 16px;
    color: var(--egest-blue);
    /*color: #999;*/
    font-size: 0.85rem;
    text-decoration: none;
}

.lien-retour:hover {
    /*color: #6aa9ff;*/
  color: var(--egest-purple);
}

table a {
    color: #6aa9ff;
    text-decoration: none;
    font-size: 0.85rem;
}

.tableau-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #2a2a2a;
}

#table-lignes td {
    padding: 6px 8px;
}
#table-lignes select,
#table-lignes input {
    width: 100%;
    min-width: 90px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: #1a1a1a;
}

table thead {
    background: #222;
}

table th {
    text-align: left;
    padding: 12px 14px;
    color: #9ab4d9;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #2a2a2a;
    white-space: nowrap;
}

table td {
    padding: 11px 14px;
    border-bottom: 1px solid #232323;
    vertical-align: middle;
    color: #fff;
    white-space: nowrap;
}

table tbody tr:hover {
    background: #202020;
}

table tbody tr:last-child td {
    border-bottom: none;
}

.transaction-annulee {
    opacity: 0.5;
}

.badge-annulee {
    font-size: 0.75rem;
    color: #999;
    margin-left: auto;
}

.inline-form {
    margin-left: auto;
  margin: 1px;
  padding: 1px;
}

.bouton-danger {
    background: transparent;
    color: #e57373;
    border: 1px solid #e57373;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
}

.bouton-danger:hover {
    background: rgba(229, 115, 115, 0.1);
}

.statut-badge {
    padding: 2px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.statut-en-service { background: rgba(76, 175, 80, 0.15); color: #4caf50; }
.statut-licencié { background: rgba(229, 115, 115, 0.15); color: #e57373; }
.statut-démissionné { background: rgba(245, 197, 66, 0.15); color: #f5c542; }
.statut-inactif { background: rgba(153, 153, 153, 0.15); color: #999; }

.historique-titre {
    margin-top: 28px;
    margin-bottom: 12px;
    font-size: 1rem;
}

.historique-liste {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.historique-liste li {
    background: #1e1e1e;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
}

.historique-meta {
    color: #777;
    font-size: 0.78rem;
}

.page-legale {
    max-width: 700px;
    line-height: 1.6;
}

.page-legale h2 {
    margin-top: 24px;
    font-size: 1.05rem;
    color: var(--purple-light, #6aa9ff);
}

.page-legale ul {
    padding-left: 20px;
    margin: 8px 0;
}

.page-legale li {
    margin-bottom: 6px;
}

.footer-app {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 4px 8px;
    text-align: center;
    font-size: 0.7rem;
}

.footer-app a {
    color: #777;
    text-decoration: none;
}

.footer-app a:hover {
    color: var(--purple-light, #6aa9ff);
}

/* Champs date avec bouton */
.date-field {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

.date-native-hidden {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
    border: none;
}

.date-field input[type="date"] {
    flex: 1;
}

.date-field-btn {
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 0 12px;
    cursor: pointer;
    font-size: 1rem;
}

/*input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    width: 100%;
    cursor: pointer;
} */

/* Liste transactions repensée */
.transaction-item {
    display: flex;
    flex-direction: row;
    gap: 16px;
    cursor: pointer;
    background: #1e1e1e;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: background 0.15s ease;
    align-items: flex-start;
}

.transaction-item:hover {
    background: #262626;
}

.transaction-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.transaction-col-montant {
    flex: 0 0 auto;
    min-width: 110px;
    max-width: 20%;
}

.transaction-col-classification {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 60%;
    margin-top: 15px;
}

.transaction-classification {
    white-space: normal;
    word-break: break-word;
    color: #ccc;
}

.transaction-col-meta {
    flex: 0 0 auto;
    min-width: 130px;
    text-align: right;
    align-items: flex-end;
    margin-left: auto;
    
}

.transaction-annulation {
    color: #e57373;
    font-size: 0.75rem;
}
/*
@media (max-width: 480px) {
    .transaction-item {
        flex-wrap: wrap;
    }
    .transaction-col-meta {
        text-align: left;
        align-items: flex-start;
        width: 100%;
    }
} */

.transaction-montant {
    font-size: 1.1rem;
    font-weight: 700;
    color: antiquewhite;
    margin-left: 15px;
}

.transaction-operateur {
    color: #999;
    font-size: 0.78rem;
}

/*.transaction-classification {
    font-size: 0.8rem;
    color: #c9a6ff;
    font-weight: 600;
}*/

.transaction-projet {
    font-size: 0.78rem;
    color: #7ba8d9;
    margin-left: 15px;
}

.transaction-description {
    font-size: 0.8rem;
    color: #ccc;
    font-style: italic;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 50;
    align-items: center;
    justify-content: center;
}

.modal-overlay.visible {
    display: flex;
}

.modal {
    background: #1e1e1e;
    padding: 24px;
    border-radius: 12px;
    max-width: 420px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}

.modal h3 {
    margin-bottom: 12px;
    font-size: 1.4rem;
}

.modal p {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.modal .bouton-danger {
    width: 100%;
    margin-top: 12px;
    padding: 10px;
}

/* =========================================================
   Formulaire document — design moderne + responsive
   Les styles sont volontairement isolés avec le préfixe .df-
   ========================================================= */

.df-page {
    --df-primary: #4f8df7;
    --df-primary-dark: #2563eb;
    --df-text: #172033;
    --df-muted: #6b7280;
    --df-border: #e5e7eb;
    --df-bg: #f5f7fb;
    --df-card: #ffffff;
    --df-soft: #f8fafc;
    --df-danger: #dc2626;
    --df-success: #16a34a;
    width: 100%;
    max-width: none;
    min-width: 0;

    margin-right: auto;
    padding: 22px 20px 40px;

    box-sizing: border-box;
    background: lavender;
    color: var(--df-text);
}

.df-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.df-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
    color: var(--df-primary-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.df-hero h1 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.15;
    letter-spacing: -.02em;
}

.df-subtitle {
    margin: 7px 0 0;
    color: var(--df-muted);
    font-size: 14px;
}

.df-status {
    display: inline-flex;
    align-items: center;
    margin-top: 12px;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid var(--df-border);
    border-radius: 999px;
    background: var(--df-card);
    color: var(--df-muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}

.df-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
}

.df-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.df-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--df-border);
    border-radius: 12px;
    background: rgba(255,255,255,.8);
    color: var(--df-muted);
    font-size: 13px;
    font-weight: 700;
}

.df-step-number {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #eef4ff;
    color: var(--df-primary-dark);
    font-size: 12px;
    flex: 0 0 auto;
}

.df-step.active {
    border-color: #cfe0ff;
    background: #f8fbff;
    color: var(--df-text);
}

.df-form {
    display: flex;

    width: 100%;
    max-width: none;
    min-width: 0;

    flex-direction: column;
    gap: 18px;
}

.df-card {
    background: var(--df-card);
    border: 1px solid var(--df-border);
    border-radius: 16px;
    box-shadow: 0 5px 18px rgba(15, 23, 42, .05);
    overflow: hidden;
}

.df-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 19px 20px 15px;
    border-bottom: 1px solid #eef0f4;
}

.df-card-title {
    display: flex;
    align-items: center;
    gap: 11px;
}

.df-card-icon {
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    border-radius: 10px;
    background: #eef4ff;
    color: var(--df-primary-dark);
    font-size: 17px;
}

.df-card-head h2 {
    margin: 0;
    font-size: 17px;
    letter-spacing: -.01em;
}

.df-card-head p {
    margin: 3px 0 0;
    color: var(--df-muted);
    font-size: 12px;
}

.df-card-body {
    padding: 20px;
}

.df-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
    gap: 18px;
}

.df-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.df-field {
    min-width: 0;
    gap: 12px;
}

.df-field label {
    display: block;
    margin: 0 0 7px;
    color: #4b5563;
    font-size: 12px;
    font-weight: 800;
}

.df-input,
.df-select {
    width: 100%;
    min-height: 43px;
    box-sizing: border-box;
    border: 1px solid var(--df-border);
    border-radius: 10px;
    background: #fff;
    color: var(--df-text);
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.df-input::placeholder {
    color: #9ca3af;
}

.df-input:focus,
.df-select:focus {
    border-color: #8ab2ff;
    box-shadow: 0 0 0 3px rgba(79, 141, 247, .12);
}

.df-input[readonly] {
    background: #f8fafc;
    color: #596273;
}

.df-client-info {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eef0f4;
}

.df-info-label {
    display: block;
    margin-bottom: 4px;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.df-info-value {
    display: block;
    overflow: hidden;
    color: #374151;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.df-client-info.is-hidden {
    display: none;
}

.df-document-grid {
    display: grid;
    gap: 14px;
}

.df-readonly-document {
    display: flex;
    align-items: center;
    min-height: 43px;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--df-border);
    border-radius: 10px;
    background: #f8fafc;
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
}

.df-product-card .df-card-body {
    padding: 0;
}

.df-product-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 16px 20px;
    border-bottom: 1px solid #eef0f4;
}

.df-product-count {
    color: var(--df-muted);
    font-size: 13px;
}

.df-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.df-products-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: none;
}

.df-products-table th {
    padding: 11px 12px;
    background: #fff;
    border-bottom: 1px solid var(--df-border);
    color: #4b5563;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
}

.df-products-table th:nth-child(3),
.df-products-table th:nth-child(4),
.df-products-table th:nth-child(5) {
    text-align: right;
}

.df-products-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
    background: #fff;
    color: #374151;
    font-size: 13px;
}

.df-products-table tr:last-child td {
    border-bottom: 0;
}

.df-products-table .df-input,
.df-products-table .df-select {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 13px;
}

.df-col-product { width: 36%; }
.df-col-unit { width: 13%; }
.df-col-qty { width: 13%; }
.df-col-price { width: 17%; }
.df-col-total { width: 16%; }
.df-col-action { width: 5%; }

.df-number {
    text-align: right;
}

.df-line-total {
    color: var(--df-text);
    font-size: 13px;
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
}

.df-delete {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-left: auto;
    border: 1px solid #fee2e2;
    border-radius: 9px;
    background: #fff;
    color: var(--df-danger);
    cursor: pointer;
    font-size: 14px;
    transition: .15s ease;
}

.df-delete:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

.df-empty {
    padding: 28px 20px;
    color: var(--df-muted);
    text-align: center;
    font-size: 13px;
}

.df-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid #cfe0ff;
    border-radius: 9px;
    background: #f8fbff;
    color: var(--df-primary-dark);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    transition: .15s ease;
}

.df-add:hover {
    background: #eef4ff;
}

.df-summary {
    display: flex;
    justify-content: flex-end;
    padding: 0 20px 20px;
}

.df-total-box {
    width: min(100%, 340px);
    padding: 17px 18px;
    border: 1px solid #dbe7ff;
    border-radius: 13px;
    background: #f8fbff;
}

.df-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--df-muted);
    font-size: 13px;
}

.df-total-row strong {
    color: var(--df-text);
    font-size: 18px;
}

.df-total-label {
    color: #374151;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.df-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 2px;
}

.df-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 17px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}

.df-btn:active {
    transform: translateY(1px);
}

.df-btn-secondary {
    border-color: var(--entreprise-primary);
    background: #fff;
    color: #374151;
}

.df-btn-secondary:hover {
    background: #f8fafc;
}

.df-btn-primary {
    border-color: var(--entreprise-primary);
    background: var(--color-lavender);
    color: var(--egest-blue);
    box-shadow: 0 5px 14px rgba(79, 141, 247, .20);
}

.df-btn-primary:hover {
    background: var(--df-primary-dark);
}

.df-btn-client {
    white-space: nowrap;
}

.df-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(4px);
}

.df-modal-overlay.visible {
    display: flex;
}

.df-modal {
    width: min(100%, 480px);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 22px;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
}

.df-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 18px;
}

.df-modal h3 {
    margin: 0;
    font-size: 20px;
}

.df-modal-subtitle {
    margin: 5px 0 0;
    color: var(--df-muted);
    font-size: 13px;
}

.df-modal-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: #f3f4f6;
    color: #4b5563;
    cursor: pointer;
}

.df-modal-fields {
    display: grid;
    gap: 13px;
}

.df-modal-actions {
    display: flex;
    gap: 9px;
    justify-content: flex-end;
    margin-top: 18px;
}

.df-error {
    margin-top: 8px;
    color: var(--df-danger);
    font-size: 12px;
}

/*@media (max-width: 820px) {
    .df-page {
        padding: 16px 12px 30px;
    }

    .df-top-grid {
        grid-template-columns: 1fr;
    }

    .df-steps {
        grid-template-columns: 1fr;
    }

    .df-step:not(.active) {
        display: none;
    }

    .df-hero {
        align-items: flex-start;
    }
} */

/*@media (max-width: 640px) {
    .df-page {
      width: 100%;
      max-width: 100%;
      padding: 12px 9px 24px;
    }

    .df-hero,
    .df-hero h1{
        display: block;
        padding-right: auto;
        margin-right: auto;
    }

    .df-card {
        border-radius: 13px;
    }

    .df-card-head,
    .df-card-body {
        padding: 15px;
    }

    .df-search-row {
        grid-template-columns: 1fr;
    }

    .df-btn-client {
        width: 100%;
    }

    .df-client-info {
        grid-template-columns: 1fr;
    }

    .df-product-toolbar {
        align-items: stretch;
        flex-direction: column;
        padding: 14px 15px;
    }

    .df-add {
        width: 100%;
    }

    .df-table-wrap {
        overflow: visible;
    }

    .df-products-table {
        min-width: 0;
        display: block;
    }

    .df-products-table thead {
        display: none;
    }

    .df-products-table tbody,
    .df-products-table tr,
    .df-products-table td {
        display: block;
        width: auto;
    }

    .df-products-table tr {
        position: relative;
        margin: 12px;
        padding: 12px;
        border: 1px solid var(--df-border);
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 3px 10px rgba(15, 23, 42, .04);
    }

    .df-products-table td {
        padding: 0 0 10px;
        border: 0;
    }

    .df-products-table td:last-child {
        padding-bottom: 0;
    }

    .df-products-table td[data-label]::before {
        display: block;
        margin-bottom: 5px;
        color: #6b7280;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .05em;
        text-transform: uppercase;
    }

    .df-products-table td[data-label="Produit"]::before { content: "Produit"; }
    .df-products-table td[data-label="Unité"]::before { content: "Unité"; }
    .df-products-table td[data-label="Quantité"]::before { content: "Quantité"; }
    .df-products-table td[data-label="Prix unitaire"]::before { content: "Prix unitaire"; }
    .df-products-table td[data-label="Montant"]::before { content: "Montant"; }

    .df-products-table td[data-label="Unité"],
    .df-products-table td[data-label="Quantité"] {
        display: inline-block;
        width: calc(50% - 6px);
        margin-right: 7px;
        vertical-align: top;
    }

    .df-products-table td[data-label="Quantité"] {
        margin-right: 0;
    }

    .df-products-table td[data-label="Prix unitaire"] {
        display: inline-block;
        width: calc(50% - 6px);
        margin-right: 7px;
        vertical-align: top;
    }

    .df-products-table td[data-label="Montant"] {
        display: inline-block;
        width: calc(50% - 6px);
        vertical-align: top;
        padding-left: 8px;
    }

    .df-line-total {
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        box-sizing: border-box;
        padding: 8px 10px;
        border: 1px solid var(--df-border);
        border-radius: 10px;
        background: #f8fafc;
    }

    .df-products-table td[data-label="Action"] {
        position: absolute;
        top: 10px;
        right: 10px;
    }

    .df-products-table td[data-label="Action"]::before {
        display: none;
    }

    .df-products-table .df-input,
    .df-products-table .df-select {
        padding-right: 42px;
    }

    .df-products-table td[data-label="Produit"] {
        padding-right: 42px;
    }

    .df-summary {
        padding: 0 15px 15px;
    }

    .df-total-box {
        width: 100%;
    }

    .df-actions {
        flex-direction: column-reverse;
    }

    .df-actions .df-btn {
        width: 100%;
    }

    .df-modal-actions {
        flex-direction: column;
    }

    .df-modal-actions .df-btn {
        width: 100%;
    }
}*/


/* =========================================================
   LAYOUT FINAL — correction globale
   ========================================================= */

html {
    min-width: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

.app-layout {
    display: flex;
    flex: 1 1 auto;
    align-items: stretch;
    min-width: 0;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    margin: 0;
    padding: 0;
}

.main-area {
    flex: 1 1 auto;
    width: 0;
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/*.content {
    flex: 0 0 auto;
    padding: 5px;
    margin-left: auto;
    margin-right: auto;
}*/

/* Le formulaire moderne ne subit pas les limites des formulaires génériques. */
.df-form {
    max-width: 100%;
    margin-right: auto;
    margin-left: auto;
}

/* Empêche les médias/éléments larges de créer un débordement horizontal. */
img,
video,
canvas,
svg,
iframe {
    max-width: 100%;
}

.abo-statut {
    margin-bottom: 20px;
}

.badge-abo {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-essai { background: rgba(106, 169, 255, 0.15); color: #6aa9ff; }
.badge-actif { background: rgba(76, 175, 80, 0.15); color: #4caf50; }
.badge-expire { background: rgba(229, 115, 115, 0.15); color: #e57373; }

.plans-grille, .modes-grille {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    color: var(--egest-purple)
}

.plan-carte, .mode-carte {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #1e1e1e;
    color: var(--purple);
    border: 2px solid #2a2a2a;
    border-radius: 12px;
    padding: 16px 12px;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.plan-carte input, .mode-carte input {
    position: absolute;
    opacity: 0;
}

.plan-carte:has(input:checked), .mode-carte:has(input:checked) {
    border-color: var(--purple, #7b2ff7);
    background: rgba(123, 47, 247, 0.08);
}

.plan-nom { 
  font-weight: 700; 
  font-size: 1rem; 
  
}
.plan-prix { 
  font-size: 1.15rem; 
  font-weight: 800; 
  color: var(--purple-light, #9c5cff); 
  
}
.plan-detail { 
  font-size: 0.75rem; 
  color: #999; 
  
}

.abo-instruction {
    background: #1e1e1e;
    padding: 12px 14px;
    border-radius: 8px;
    border-left: 3px solid var(--purple, #7b2ff7);
    margin: 16px 0;
}

.statut-en-attente { 
  background: rgba(245, 197, 66, 0.15); 
  color: #f5c542; 
  padding: 3px 10px; 
  border-radius: 20px; 
  font-size: 0.75rem; 
  
}
.statut-validee { 
  background: rgba(76, 175, 80, 0.15); 
  color: #4caf50; 
  padding: 3px 10px; 
  border-radius: 20px; 
  font-size: 0.75rem; 
  
}
.statut-rejetee { 
  background: rgba(229, 115, 115, 0.15);
  color: #e57373;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
}

.statut-certifiee {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    padding: 3px 3px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 100;
}

.theme-entreprise {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.theme-couleurs {
  display: flex;
  flex-direction: row;
  gap: 12px;
}

/* =========================================================
   E-GEST — AFFICHAGE DESKTOP FORCÉ
   Même mise en page sur téléphone, tablette et ordinateur.
   ========================================================= */

html,
body {
    min-width: 1200px;
  /*max-width: 1220px;*/
}

body {
    overflow-x: auto;
}

.app-layout {
    min-width: 1200px;
  /*max-width: 1220px;*/
    width: 100%;
}

/* La sidebar conserve son comportement desktop */
.sidebar {
    position: relative;
    top: auto;
    left: auto;
    bottom: auto;
    transform: none;
}

.sidebar:not(.collapsed) {
    transform: none;
}

.df-color-picker{
  width: 48px;
  height: 48px;
}

/* Désactivation du comportement mobile de la sidebar */
/*@media (max-width: 640px) {
    .sidebar {
        position: relative;
        width: 220px;
        transform: none;
    }

    .sidebar.collapsed {
        width: 60px;
        transform: none;
    }

    .sidebar:not(.collapsed) {
        width: 220px;
        transform: none;
    }

    .main-area {
        min-width: 0;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}*/

/* Les formulaires et tableaux restent en disposition desktop */
/*@media (max-width: 480px) {
    .transaction-item {
        flex-wrap: nowrap;
    }
}*/

/*@media (max-width: 820px) {
    .df-page {
        padding: 20px;
    }
} */


/* =========================================================
   E-GEST — HAUTEUR DESKTOP FORCÉE
   La structure occupe toute la hauteur disponible.
   ========================================================= */

html {
    min-width: 1080px;
    min-height: 1920px;
  max-width: 1440px;
  max-height: 3440px;
    height: 100%;
}

body {
    min-width: 1080px;
    min-height: 1920px;
  max-width: 1440px;
  max-height: 3440px;
    height: 100%;
    margin: 0;
}

.app-layout {
    min-width: 1080px;
    min-height: 1920px;
  max-width: 1440px;
  max-height: 3440px;
    height: 100vh;
}

.sidebar {
    min-height: 100vh;
}

.main-area {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-area > .content {
    flex: 1;
}

/* =========================================================
   THÈME DE L'ENTREPRISE
   ========================================================= */

:root {
    --entreprise-primary: #062867;
    --entreprise-secondary: #7E25D7;
    --entreprise-accent: #4A42C8;

    --entreprise-primary-light: color-mix(
        in srgb,
        var(--entreprise-primary) 10%,
        white
    );

    --entreprise-primary-lighter: color-mix(
        in srgb,
        var(--entreprise-primary) 5%,
        white
    );

    --entreprise-primary-dark: color-mix(
        in srgb,
        var(--entreprise-primary) 80%,
        black
    );

    --entreprise-secondary-light: color-mix(
        in srgb,
        var(--entreprise-secondary) 10%,
        white
    );
}

/* =========================================================
   THÈME ENTREPRISE — TABLEAUX
   ========================================================= */

table th {
    background-color: var(--entreprise-primary);
    color: #ffffff;
    border-color: var(--entreprise-primary);
}

table td {
    border-color: var(--entreprise-secondary-light);
}

table tbody tr:nth-child(even) {
    background-color: var(--entreprise-primary-lighter);
}

/*.bouton-primaire {
    border-radius: 8px;
    background-color: var(--egest-blue);
    border-color: var(--entreprise-primary);
}

.bouton-primaire:hover {
    background-color: var(--entreprise-primary-dark);
    border-color: var(--entreprise-primary-dark);
} */

.bouton-secondaire {
    border-color: var(--entreprise-secondary);
    color: var(--entreprise-secondary);
}

.bouton-secondaire:hover {
    background-color: var(--entreprise-secondary);
    color: #ffffff;
}

a {
    --couleur-lien-entreprise: var(--entreprise-primary);
}

.content a:not(.bouton-primaire):not(.bouton-secondaire) {
    color: black;
}

.content a:not(.bouton-primaire):not(.bouton-secondaire):hover {
    color: lavender;
}

.section-header h2,
.page-title {
    color: var(--entreprise-primary);
}

.card,
.stat-card,
.section-card {
    border-color: var(--entreprise-primary-light);
}

.stat-card .stat-value {
    color: var(--entreprise-primary);
}

/* =========================================================
   CONTRASTE — LIENS ET BOUTONS DU THÈME ENTREPRISE
   ========================================================= */

/* Boutons d'actions rapides */
.content a.action-bouton {
    background-color: var(--egest-blue);
    color: #ffffff !important;
    border-color: var(--entreprise-primary);
}

.content a.action-bouton:hover {
    background-color: var(--entreprise-secondary);
    border-color: var(--entreprise-secondary);
    color: #ffffff !important;
}

/* Liens présents dans les tableaux */
.content table a {
    color: var(--entreprise-secondary) !important;
    font-weight: 600;
}

.content table a:hover {
    color: var(--entreprise-secondary-light) !important;
}

/* Lien de retour */
.content a.lien-retour {
    color: var(--entreprise-primary) !important;
    font-weight: 600;
}

.content a.lien-retour:hover {
    color: var(--entreprise-secondary) !important;
}

/* =========================================================
   LISTE DES DOCUMENTS — STYLE UNIFORME
   ========================================================= */

.content table tbody tr {
    background: #000000;
}

.content table tbody tr:hover {
    background: #000000;
}

.content table tbody td {
    border-bottom: 2px solid var(--entreprise-primary);
}

.content table tbody tr:last-child td {
    border-bottom: none;
}

.table-documents tbody tr {
    background: #000000;
}

.section-header span {
  color: var(--entreprise-primary);
  font-weight: 700;

  .documents-stats {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 18px;
    font-weight: 600;
}

.documents-stats-total {
    color: var(--egest-purple);
}

.documents-stats-devis {
    color: var(--entreprise-accent);
}

.documents-stats-proformas {
    color: var(--entreprise-secondary);
}

.documents-stats-factures {
    color: var(--entreprise-primary);
}
}

.documents-compteurs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.compteur {
    font-weight: 600;
    white-space: nowrap;
}

.compteur strong {
    font-weight: 800;
}

.compteur-separateur {
    color: #555;
}


/* Ancien bloc mobile obsolète supprimé — remplacé par les @media actifs plus haut (820px, 640px). */
