html, body {
    overflow-x: hidden;
}

body {
    font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif;
	font-weight:400;
	line-height:1.5;
	color:#212529;

    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    justify-content: space-between; /* Pour positionner les éléments en haut et en bas */
	/*justify-content: center;*/
    align-items: center; 
	padding-bottom: 50px; /* Hauteur de la barre de navigation */
	margin-bottom: 50px; /* Hauteur de la barre de navigation */
	
}

.login-container {
    max-width: 400px;
    margin: 20px auto;
    background-color: #fff;
    padding: 20px 30px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
	text-align:center;
}
/*
.login-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 90%;
}
*/

.login-container img {
    max-width: 100%;
    height: auto;
}


.container {
    margin-top: 20px;
	padding: 20px;
    width: 90%;
    max-width: 100%;
    text-align: center;
    flex-grow: 1; /* Permet de faire grandir la section principale pour occuper l'espace disponible */
}

.search-bar {
    width: 90%;
    padding: 10px;
    font-size: 1.2em;
    margin: 0 auto 20px auto;  /* Centrage horizontal et marge en bas */
    border-radius: 5px;
    border: 1px solid #ddd;
	box-sizing: border-box;
}

#rechcli {
  position: absolute;
  width:80%;
  z-index: 9999;
}




.client-list {
    margin-top: 20px;
    list-style: none;
    padding: 0;
}
.client-item {
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: pointer;
    text-align: left;
}

a {
    display: block;
    margin-top: 15px;
    color: #007bff;
    text-decoration: none;
    text-align: center; /* Centrer le lien de déconnexion */
}

a:hover {
    text-decoration: underline;
}

a.nostyle {
  color: inherit;
  text-decoration: none;
}

a.email {
  display:inline;
  padding:0px;
}

button {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
}

button.gris {
    background-color: #969696;
    color: white;
    border: none;
    cursor: pointer;
}

button.rouge {
    width: 100%;
    padding: 3px;
    margin: 3px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
	background-color: red;
    color: white;
    border: none;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}


h2 {
    margin-top: 0;
    color: #333;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
}

label.soc {
    display: block;
	text-align:left;
	font: 16px;
    margin-bottom: 8px;
    color: #555;
}

input[type="text"], input[type="password"], input[type="email"], select {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

input[type="submit"], button {
    background-color: green;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

input[type="submit"]:hover {
    background-color: #005B27;
}

input[type="button"] {
    background-color: blue;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}


.content {
    margin-top: 20px;
    width: 90%;
    max-width: 100%;
    text-align: center;
    flex-grow: 1; /* Permet de faire grandir la section principale pour occuper l'espace disponible */
	display: flex; /* Ajout pour un meilleur contrôle */
    flex-direction: column; /* Alignement vertical des éléments */
    align-items: center; /* Centre les éléments à l'intérieur */
	justify-content: center; /* Centre le contenu */
    margin: 0 auto; /* Assure le centrage horizontal */
    overflow: hidden; /* Évite le dépassement */
    box-sizing: border-box; /* Corrige le calcul des marges/paddings */
}
.client-details {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    text-align: left;
    border-left: 4px solid #007bff;
}
.button {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.2em;
}
.button:hover {
    background-color: #0056b3;
}



/* nav.js - Boutons de navigation*/	
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    background: #333;
    padding: 5px;
}

.bottom-nav button {
    color: white;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.bottom-nav button.active {
    background: #007bff; /* Couleur de mise en évidence */
    color: white;
    border-radius: 5px;
    padding: 10px 15px;
    font-weight: bold;
}



/*  page facture */
/*
.facture {
    border: 2px solid #000;
    padding: 5px;
    margin: 10px 0;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
	 border-radius: 10px;
}
*/
/*  page facture */
.avoir {
    background-color: #EAFFA8;
}

.details {
    display: none;
    padding-top: 10px;
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 300px; /* Force une largeur minimum */
    font-size: 0.9em;
}

th, td {
    border: 1px solid #ddd;
    padding: 10px 8px;
    text-align: left;
    white-space: nowrap; /* Évite le retour à la ligne */
}

th {
    background-color: #343a40;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

th.register, td.register {
    border: 1px solid #ccc; /* Bordures fines et grises */
    padding: 2px; /* Espacement des cellules */
    text-align: left; /* Alignement du texte */
	font-size:11pt;
}

input[type="text"].register, select.register {
	font-size:10pt;
    padding: 3px;
    border: 1px solid #ccc;
    border-radius: 2px;
}

td.droite {
	text-align: right; /* Alignement du texte */	
}


/* Page Notes */
.note { border: 1px solid #ddd; padding: 10px; margin: 10px 0; border-radius: 5px; background: #f9f9f9; }
.note h3 { margin: 0; }
.note small { color: #666; }
.edit-form { display: none; margin-top: 10px; }


/* Styles généraux */
.radio-container {
    display: flex;
    flex-direction: column; /* Afficher les radios l'un en dessous de l'autre */
    gap: 10px;
    align-items: center;
}

/* Cacher les boutons radio natifs */
.radio-container input[type="radio"] {
    display: none;
}

/* Style des labels (images cliquables) */
.radio-container label {
    display: inline-block;
    width: 300px; /* Ajuste la taille */
    height: 122px;
    border-radius: 10px;
    border: 3px solid #f5f5dc; /* Beige */
    background-color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    background-size: contain; /* Ajuste l'image à la taille du label */
    background-repeat: no-repeat;
    background-position: center;
}

/* Effet au survol */
.radio-container label:hover {
    border-color: #888; /* Gris moyen */
	border: 7px solid #888;
}

/* Effet quand sélectionné */
.radio-container input[type="radio"]:checked + label {
    border-color: #555; /* Gris foncé */
	border: 7px solid #555;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Exemple d'utilisation avec des images */
#option1 + label {
    background-image: url('../icons/237060A.png');
}

#option2 + label {
    background-image: url('../icons/JPBSAS.png');
}


#logContent {
  max-height: 800px;
  max-height: 1000px;
  overflow-y: auto;
}

/* Status badges pour les montants */
.status-amount {
    display: inline-block;
    font-size: 1.1em;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 5px 5px 5px 0;
    background: linear-gradient(135deg, #28a745, #20c997); /* vert */
    color: white;
    border: 1px solid #28a745;
}

.status-gris {
    background: linear-gradient(135deg, #6c757d, #adb5bd);
    border-color: #6c757d;
}

.status-rouge {
	background: linear-gradient(135deg, #842029, #e35d6a);
	border-color: #842029;
}

.status-orange {
	background: linear-gradient(135deg, #995c00, #ffb84d);
	border-color: #995c00;
}


/* Classes globales pour les évolutions (desktop ET mobile) */
.evolution-positive {
    color: #28a745 !important;
    font-weight: bold;
}

.evolution-negative {
    color: #dc3545 !important;
    font-weight: bold;
}

/* Application spécifique pour les cellules de tableau */
td.evolution-positive,
th.evolution-positive {
    color: #28a745 !important;
}

td.evolution-negative,
th.evolution-negative {
    color: #dc3545 !important;
}

/* Cards mobile pour remplacer les tables */
.mobile-cards {
    display: none;
}

@media (max-width: 768px) {
    /* Masquer les tables sur mobile */
    .table-container {
        display: none;
    }
    
    /* Afficher les cards sur mobile */
    .mobile-cards {
        display: block;
        margin: 10px 0;
    }
    
    .mobile-card {
        background: white;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .card-header {
        font-weight: bold;
        color: #495057;
        border-bottom: 1px solid #e9ecef;
        padding-bottom: 8px;
        margin-bottom: 8px;
    }
    
    .card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
        border-bottom: 1px solid #f8f9fa;
    }
    
    .card-row:last-child {
        border-bottom: none;
    }
    
    .card-label {
        font-weight: 600;
        color: #6c757d;
        font-size: 0.9em;
    }
    
    .card-value {
        text-align: right;
        color: #495057;
        font-weight: 500;
    }
    
    .evolution-positive {
        color: #28a745;
        font-weight: bold;
    }
    
    .evolution-negative {
        color: #dc3545;
        font-weight: bold;
    }
    
    /* Ajustements du container pour mobile */
    .client-details {
        margin: 10px 0;
        padding: 12px;
    }
    
    /* Améliorer la lisibilité des emails et liens */
    .email {
        word-break: break-all;
        display: inline-block;
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    .client-details {
        padding: 10px;
        font-size: 0.95em;
    }
    
    h2 {
        font-size: 1.3em;
    }
    
    .status-amount {
        font-size: 1em;
        padding: 6px 10px;
    }
}

/* Styles pour les articles - À ajouter à drz.css après les autres styles */

/* Amélioration du style des cartes produits */
.mobile-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-header {
    font-weight: bold;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
    margin-bottom: 12px;
    line-height: 1.3;
}

.card-header strong {
    color: #343a40;
    font-size: 1.05em;
}

.card-header small {
    color: #6c757d;
    font-style: italic;
    display: block;
    margin-top: 4px;
}

/* Tables responsive pour les ventes */
.sales-table {
    font-size: 0.85em;
}

.sales-table th {
    background: #495057;
    color: white;
    text-align: center;
    font-size: 0.9em;
}

.sales-table td {
    vertical-align: top;
    padding: 8px;
}

.sales-table .article-name {
    max-width: 200px;
    word-wrap: break-word;
}

.sales-table .article-name small {
    color: #6c757d;
    font-style: italic;
    display: block;
    margin-top: 2px;
    line-height: 1.2;
}

.n-product {
    border-left: 3px solid #28a745;
}

.n-1-product {
    border-left: 3px solid #6c757d;
}


/* Responsive pour les tables de ventes */
@media (max-width: 992px) {
    .sales-table {
        font-size: 0.8em;
    }
    
    .sales-table .article-name {
        max-width: 150px;
    }
}

@media (max-width: 768px) {
    .sales-table {
        min-width: 400px; /* Force le scroll horizontal */
    }
}

/* CSS responsive pour les factures - À ajouter à drz.css */

/* Styles de base pour les factures */
.facture {
    border: 2px solid #000;
    padding: 15px;
    margin: 10px 0;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 10px;
    background: white;
}

.facture:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.avoir {
    background-color: #EAFFA8;
    border-color: #4CAF50;
}

/* VERSION DESKTOP (par défaut) */
.facture-desktop {
    display: block;
}

.facture-mobile {
    display: none;
}

.facture-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.doc-type {
    font-weight: bold;
    font-size: 1.1em;
    color: #2c3e50;
}

.doc-date {
    color: #666;
    font-size: 0.95em;
}

.facture-content {
    margin: 10px 0;
}

.facture-client {
    font-size: 1.05em;
    margin: 8px 0;
    color: #34495e;
}

.facture-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.montant {
    font-size: 1.1em;
}

.montant strong {
    color: #27ae60;
    font-size: 1.2em;
}

.representant {
    color: #7f8c8d;
    font-size: 0.9em;
}

/* RESPONSIVE MOBILE */
@media (max-width: 768px) {
    .facture {
        padding: 12px;
        margin: 8px 0;
    }
    
    /* Masquer version desktop */
    .facture-desktop {
        display: none;
    }
    
    /* Afficher version mobile */
    .facture-mobile {
        display: block;
    }
    
    .mobile-facture-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 6px;
        padding-bottom: 4px;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .mobile-doc-info {
        flex: 1;
		line-height: 1.2;
    }
    
    .mobile-doc-type {
        display: inline;
        font-weight: bold;
        font-size: 0.9em;
        color: #2c3e50;
        margin-right: 4px;
    }
    
    .mobile-doc-number {
        display: inline;
        font-size: 0.85em;
        color: #666;
    }
    
    .mobile-doc-date {
        color: #666;
        font-size: 0.8em;
        text-align: right;
        flex-shrink: 0;
        margin-left: 8px;
        align-self: left;
    }
    
    .mobile-facture-body {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 3px 8px;
        align-items: center;;
    }
    
    .mobile-client {
        font-size: 0.9em;
        color: #34495e;
        font-weight: 500;
        grid-column: 1;
        grid-row: 1;
        line-height: 1.2;
    }
    
    .mobile-montant {
        font-size: 0.95em;
        grid-column: 2;
        grid-row: 1 / 3;
        text-align: right;
        align-self: center;
    }
    
    .mobile-montant strong {
        color: #27ae60;
        font-size: 1.1em;
        display: block;
    }
    
    .mobile-rep {
        color: #7f8c8d;
        font-size: 0.75em;
        grid-column: 1;
        grid-row: 2;
    }

}

/* Très petits écrans */
@media (max-width: 480px) {
    .facture {
        padding: 10px;
        margin: 6px 0;
    }
    
    .mobile-facture-header {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    
    .mobile-doc-date {
        text-align: left;
        margin-left: 0;
        font-size: 0.8em;
    }
    
    .mobile-montant strong {
        font-size: 1.1em;
    }
}

/* Animation pour les détails */
.details {
    display: none;
    padding-top: 15px;
    margin-top: 10px;
    border-top: 1px solid #ddd;
    background: #f8f9fa;
    margin: 10px -15px -15px -15px;
    padding: 15px;
    border-radius: 0 0 8px 8px;
}

@media (max-width: 768px) {
    .details {
        margin: 10px -12px -12px -12px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .details {
        margin: 10px -10px -10px -10px;
        padding: 10px;
    }
}

/* CSS pour les détails de facture  */
/* CSS pour les détails de facture - À ajouter à drz.css */

.invoice-details-container {
    margin: 15px 0;
}

/* VERSION TABLE (Desktop) */
.invoice-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    background: white;
}

.invoice-table th {
    background: #495057;
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #dee2e6;
}

.invoice-table td {
    padding: 10px 8px;
    border: 1px solid #dee2e6;
    vertical-align: top;
}

.article-cell {
    max-width: 200px;
}

.article-cell strong {
    color: #2c3e50;
    font-size: 0.95em;
}

.article-libelle {
    color: #6c757d;
    line-height: 1.3;
    display: block;
    margin-top: 3px;
}

.qty-cell, .price-cell, .remise-cell, .total-cell {
    white-space: nowrap;
    font-weight: 500;
}

.total-cell {
    background: #f8f9fa;
    font-weight: bold;
    color: #28a745;
}

.remise-cell {
    color: #dc3545;
    font-weight: bold;
}

/* VERSION MOBILE CARDS */
.mobile-invoice-cards {
    display: none;
}

@media (max-width: 768px) {
    /* Masquer table sur mobile */
    .table-container {
        display: none;
    }
    
    /* Afficher cards sur mobile */
    .mobile-invoice-cards {
        display: block;
    }
    
    .invoice-line-card {
        background: white;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        margin-bottom: 8px;
        padding: 10px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .card-article-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 4px;
        padding-bottom: 4px;
        border-bottom: 1px solid #e9ecef;
    }
    
    .article-code {
        color: #2c3e50;
        font-size: 0.95em;
        flex: 1;
        margin-right: 8px;
    }
    
    .card-total {
        color: #28a745;
        font-weight: bold;
        font-size: 1em;
        flex-shrink: 0;
    }
    
    .card-article-libelle {
        color: #6c757d;
        font-size: 0.85em;
        line-height: 1.2;
        margin-bottom: 6px;
        font-style: italic;
    }
    
    .card-details-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
    
    .card-detail-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 2px 0;
    }
    
    .detail-label {
        color: #6c757d;
        font-size: 0.85em;
        font-weight: 500;
    }
    
    .detail-value {
        color: #495057;
        font-weight: 600;
        font-size: 0.9em;
    }
    
    .remise-highlight {
        color: #dc3545 !important;
        background: #f8d7da;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 0.8em;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .invoice-line-card {
        padding: 8px;
        margin-bottom: 6px;
    }
    
    .card-details-grid {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    
    .card-detail-item {
        border-bottom: 1px solid #f1f3f4;
        padding: 3px 0;
    }
    
    .card-detail-item:last-child {
        border-bottom: none;
    }
    
    .article-code {
        font-size: 0.9em;
    }
    
    .card-total {
        font-size: 0.95em;
    }
    
    .card-article-libelle {
        margin-bottom: 4px;
        font-size: 0.8em;
    }
}

/* Amélioration pour les tables sur tablettes */
@media (max-width: 992px) and (min-width: 769px) {
    .invoice-table {
        font-size: 0.85em;
    }
    
    .invoice-table th,
    .invoice-table td {
        padding: 8px 6px;
    }
    
    .article-cell {
        max-width: 150px;
    }
}

