:root { 
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --success: #2ecc71;
    --warning: #f39c12;
}

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

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: var(--dark);
    line-height: 1.6;
}

.header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
      url("https://images.unsplash.com/photo-1517248135467-4c7edcad34c4?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80")
      center/cover;
    opacity: 0.2;
    z-index: 0;
}

.header h1 {
    position: relative;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.header p {
    position: relative;
    font-size: 1.1rem;
    opacity: 0.9;
    z-index: 1;
}

.nav {
    display: flex;
    justify-content: center;
    background: white;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav a {
    margin: 0 0.5rem;
    text-decoration: none;
    color: var(--dark);
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.nav a i {
    margin-right: 8px;
    font-size: 0.9rem;
}

.nav a:hover {
    background: var(--secondary);
    color: white;
    transform: translateY(-2px);
}

/* style par défaut pour .active, sera écrasé sectionnellement */
.nav a.active {
    background: var(--primary);
    color: white;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light);
    display: flex;
    align-items: center;
    position: relative;
}

.card h2 i {
    margin-right: 10px;
    color: var(--secondary);
}

/* ==================== */
/* SECTION ADMIN AMÉLIORÉE */
/* ==================== */

#admin-tab {
  display: none;
}

#admin {
  display: none;
}

/* ==================== */
/* SECTION COMMANDE AMÉLIORÉE */
/* ==================== */
#commande .card {
    padding: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}
#commande .card h2 {
    font-size: 1.8rem;
    border-bottom: none;
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}
#commande .card h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 3px;
}
#commande .card h2 i {
    font-size: 1.4rem;
    color: var(--secondary);
}
#commandeForm {
    display: grid;
    gap: 1.5rem;
}
#supplier-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.supplier-item-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}
.supplier-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(52, 152, 219, 0.2);
}
.supplier-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.supplier-item-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary);
}
.supplier-item-price {
    font-weight: 700;
    color: var(--accent);
    background: rgba(231, 76, 60, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
}
.supplier-item-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
#commandeForm button[type="submit"] {
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--success), #27ae60);
    border: none;
    border-radius: 8px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
}
#commandeForm button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}
.commande-total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 1.5rem 0;
    font-size: 1.2rem;
}
.commande-total-label {
    font-weight: 500;
    margin-right: 1rem;
}
#commande-total {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.payment-method-option input[type="radio"] {
  display: none; /* on masque le bouton radio */
}

.payment-method-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}

.payment-method-label:hover {
  border-color: #ccc;
}

.payment-method-option input[type="radio"]:checked + .payment-method-label {
  border-color: #2ecc71;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.3);
}

/* ==================== */
/* SECTION FIDÉLITÉ AMÉLIORÉE */
/* ==================== */
#fidelite .card {
    padding: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}
#fidelite .card h2 {
    font-size: 1.8rem;
    border-bottom: none;
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}
#fidelite .card h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #f39c12, #e67e22);
    border-radius: 3px;
}
#fidelite .card h2 i {
    font-size: 1.4rem;
    color: #f39c12;
}

#fidelite .table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

#fidelite .table th {
    background: var(--section-secondary);
    color: white;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.client-fidelite-container {
    display: grid;
    gap: 1.5rem;
}
.client-search {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.client-search input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #e0e3e7;
    border-radius: 8px;
    font-size: 1rem;
}
.client-search button {
    padding: 0 1.5rem;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.client-search button:hover {
    background: var(--primary);
}
.client-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.client-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}
.client-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(243, 156, 18, 0.3);
}
.client-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.client-name {
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--primary);
}
.client-level {
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
}
.client-details {
    margin-bottom: 1.5rem;
}
.client-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.client-detail-label {
    color: #7f8c8d;
    font-weight: 500;
}
.client-detail-value {
    font-weight: 600;
}
.client-points {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
}
.client-points-value {
    font-size: 2rem;
    font-weight: 700;
    color: #f39c12;
    line-height: 1;
}
.client-points-label {
    font-size: 0.9rem;
    color: #7f8c8d;
}
.client-actions {
    display: flex;
    gap: 0.8rem;
}
.client-btn {
    flex: 1;
    padding: 0.7rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}
.client-btn-primary {
    background: var(--secondary);
    color: white;
}
.client-btn-primary:hover {
    background: var(--primary);
}
.client-btn-secondary {
    background: #f8f9fa;
    color: var(--dark);
}
.client-btn-secondary:hover {
    background: #e0e3e7;
}
.points-form {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-top: 2rem;
}
.points-form h3 {
    margin-bottom: 1.5rem;
    color: var(--primary);
}
.form-group {
    margin-bottom: 1.2rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.form-group input,
.form-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #e0e3e7;
    border-radius: 8px;
    font-size: 1rem;
}
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* ==================== */
/* SECTION BANQUE AMÉLIORÉE */
/* ==================== */
#banque .card {
    padding: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}
#banque .card h2 {
    font-size: 1.8rem;
    border-bottom: none;
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}
#banque .card h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    border-radius: 3px;
}
#banque .card h2 i {
    font-size: 1.4rem;
    color: #27ae60;
}
.bank-container {
    display: grid;
    gap: 2rem;
}
.bank-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.bank-summary-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}
.bank-summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
.bank-summary-card.total {
    border-top: 4px solid #2ecc71;
}
.bank-summary-card.carte {
    border-top: 4px solid #3498db;
}
.bank-summary-card.espece {
    border-top: 4px solid #f39c12;
}
.bank-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}
.bank-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: white;
    font-size: 1.2rem;
}
.bank-card-icon.total {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}
.bank-card-icon.carte {
    background: linear-gradient(135deg, #2980b9, #3498db);
}
.bank-card-icon.espece {
    background: linear-gradient(135deg, #e67e22, #f39c12);
}
.bank-card-title {
    font-weight: 600;
    color: var(--primary);
}
.bank-card-amount {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin: 1.5rem 0;
}
.bank-card-amount.total {
    color: #2ecc71;
}
.bank-card-amount.carte {
    color: #3498db;
}
.bank-card-amount.espece {
    color: #f39c12;
}
.bank-card-footer {
    font-size: 0.9rem;
    color: #7f8c8d;
    text-align: center;
}
.bank-transactions {
    margin-top: 2rem;
}
.bank-transactions h3 {
    margin-bottom: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
}
.bank-transactions h3 i {
    margin-right: 10px;
    color: #3498db;
} 
.transaction-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}
.transaction-table th {
    background: #f8f9fa;
    color: var(--primary);
    font-weight: 600;
    padding: 1rem;
    text-align: left;
}
.transaction-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f3f4;
}
.transaction-table tr:last-child td {
    border-bottom: none;
}
.transaction-table tr:hover {
    background: #f8f9fa;
}
.transaction-amount.positive {
    color: #2ecc71;
    font-weight: 600;
}
.transaction-amount.negative {
    color: #e74c3c;
    font-weight: 600;
}
.transaction-method {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}
.transaction-method.carte {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
}
.transaction-method.espece {
    background: rgba(243, 156, 18, 0.1);
    color: #d35400;
}
.bank-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* ==================== */
/* SECTION HISTORIQUE AMÉLIORÉE */
/* ==================== */
#historique .card {
    padding: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}
#historique .card h2 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light);
    display: flex;
    align-items: center;
    position: relative;
}
#historique .card h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #9b59b6, #8e44ad);
    border-radius: 3px;
}
#historique .card h2 i {
    margin-right: 10px;
    color: #9b59b6;
    font-size: 1.4rem;
}
#historique .table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}
#historique .table th {
    background: #8e44ad;
    color: white;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}
#historique .table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}
#historique .table tr:last-child td {
    border-bottom: none;
}
#historique .table tr:hover {
    background-color: #f8f9fa;
}
#historique .table .type-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}
#historique .table .type-badge.vente {
    background: rgba(46, 204, 113, 0.1);
    color: #27ae60;
}
#historique .table .type-badge.commande {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
}
#historique .table .montant {
    font-weight: 600;
}
#historique .table .montant.positif {
    color: #109648;
}
#historique .table .montant.negatif {
    color: #b92b1b;
}
#historique .table .methode {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}
#historique .table .methode.carte {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
}
#historique .table .methode.espece {
    background: rgba(243, 156, 18, 0.1);
    color: #d35400;
}

.history-vente {
  background-color: #005217;
}
.history-commande {
  background-color: #5f0404;
}

/* Styles responsive historique */
@media (max-width: 768px) {
    #historique .card {
        padding: 1.5rem;
    }
    #historique .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    #historique .table th,
    #historique .table td {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}

#historique .table tbody tr.history-vente > td {
  background-color: #e6ffed !important;
}
#historique .table tbody tr.history-commande > td {
  background-color: #ffe6e6 !important;
}

/* ==================== */
/* SECTION STOCK AMÉLIORÉE */
/* ==================== */
#stock .card {
    padding: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}
#stock .card h2 {
    font-size: 1.8rem;
    border-bottom: none;
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}
#stock .card h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #e67e22, #d35400);
    border-radius: 3px;
}
#stock .card h2 i {
    font-size: 1.4rem;
    color: #e67e22;
}

#stock .table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

#stock .table th {
    background: var(--section-secondary);
    color: white;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.stock-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}
.stock-search {
    flex: 1;
    max-width: 400px;
}
.stock-search input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #e0e3e7;
    border-radius: 8px;
    font-size: 1rem;
}
.add-stock-btn {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.add-stock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}
#stock-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.stock-item-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    position: relative;
}
.stock-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(230, 126, 34, 0.3);
}
.stock-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.stock-item-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary);
}
.stock-item-category {
    font-size: 0.8rem;
    color: #7f8c8d;
    background: #f8f9fa;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
}
.stock-item-details {
    margin-bottom: 1.5rem;
}
.stock-item-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}
.stock-item-label {
    color: #7f8c8d;
    font-weight: 500;
}
.stock-item-value {
    font-weight: 600;
}
.stock-quantity {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}
.stock-quantity-value {
    font-size: 2rem;
    font-weight: 700;
    color: #e67e22;
    line-height: 1;
}
.stock-quantity-label {
    font-size: 0.9rem;
    color: #7f8c8d;
}
.low-stock {
    color: #e74c3c !important;
}
.stock-actions {
    display: flex;
    gap: 0.8rem;
}
.stock-btn {
    flex: 1;
    padding: 0.7rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.stock-btn-primary {
    background: #e67e22;
    color: white;
}
.stock-btn-primary:hover {
    background: #d35400;
}
.stock-btn-secondary {
    background: #f8f9fa;
    color: var(--dark);
}
.stock-btn-secondary:hover {
    background: #e0e3e7;
}

/* Modal stock */
.stock-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.stock-modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
}
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.stock-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f1f3f4;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stock-modal-title {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 600;
}
.stock-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
    transition: all 0.2s ease;
}
.stock-modal-close:hover {
    color: var(--accent);
}
.stock-modal-body {
    padding: 1.5rem;
}
.form-group {
    margin-bottom: 1.2rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #e0e3e7;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #e67e22;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}
.stock-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #f1f3f4;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}
.modal-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}
.modal-btn-cancel {
    background: #f8f9fa;
    color: var(--dark);
}
.modal-btn-cancel:hover {
    background: #e0e3e7;
}
.modal-btn-submit {
    background: #e67e22;
    color: white;
}
.modal-btn-submit:hover {
    background: #d35400;
    transform: translateY(-2px);
}

/* Responsive stock */
@media (max-width: 768px) {
    .stock-controls {
        flex-direction: column;
    }
    .stock-search {
        max-width: 100%;
    }
    .add-stock-btn {
        width: 100%;
        justify-content: center;
    }
    #stock-items {
        grid-template-columns: 1fr;
    }
}

/* Alertes stock */
#alerts-container {
    margin-bottom: 1rem;
}
.stock-alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}
.stock-alert::before {
    content: "⚠️";
    margin-right: 0.5rem;
}
.stock-alert.critical {
    background-color: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #b91c1c;
}
.stock-alert.warning {
    background-color: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}
.stock-alert.info {
    background-color: #dbeafe;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}
.table tr.low-stock {
    background-color: #fff7ed;
}
.table tr.critical-stock {
    background-color: #fff1f1;
}
.table tr.low-stock td:nth-child(2),
.table tr.critical-stock td:nth-child(2) {
    font-weight: bold;
}
.table tr.critical-stock td:nth-child(2) {
    color: #ef4444;
}
.table tr.low-stock td:nth-child(2) {
    color: #f59e0b;
}

/* ==================== */
/* SECTION MENU AMÉLIORÉE */
/* ==================== */
#menu .card {
    padding: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}
#menu .card h2 {
    font-size: 1.8rem;
    border-bottom: none;
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}
#menu .card h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 3px;
}
#menu .card h2 i {
    font-size: 1.4rem;
    color: var(--secondary);
}
#venteForm {
    display: grid;
    gap: 1.5rem;
}
#menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.menu-item-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}
.menu-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(52, 152, 219, 0.2);
}
.menu-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.menu-item-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary);
}
.menu-item-price {
    font-weight: 700;
    color: var(--secondary);
    background: rgba(52, 152, 219, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
}
.menu-item-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.quantity-control {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}
.quantity-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 0.8rem;
    font-size: 1rem;
    cursor: pointer;
    color: var(--dark);
    transition: all 0.2s ease;
}
.quantity-btn:hover {
    background: rgba(52, 152, 219, 0.1);
    color: var(--secondary);
}
.quantity-input {
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 600;
    padding: 0.5rem 0;
}
#employe-vente {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #e0e3e7;
    border-radius: 8px;
    background-color: #f8f9fa;
    font-size: 1rem;
    transition: all 0.3s ease;
}
#employe-vente:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background-color: white;
}
.payment-methods-container {
    margin: 1.5rem 0;
}
.payment-methods-title {
    display: block;
    margin-bottom: 1rem;
    font-weight: 500;
    color: var(--primary);
    font-size: 1.1rem;
}
.payment-methods-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.payment-method-option {
    position: relative;
    flex: 1;
    min-width: 120px;
}
.payment-method-option input {
    position: absolute;
    opacity: 0;
}
.payment-method-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.2rem 1rem;
    border: 2px solid #e0e3e7;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
}
.payment-method-label:hover {
    border-color: var(--secondary);
}
.payment-method-option input:checked + .payment-method-label {
    border-color: var(--success);
    background-color: rgba(46, 204, 113, 0.05);
}
.payment-method-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}
.payment-method-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark);
}
.total-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 1.5rem 0;
    font-size: 1.2rem;
}
.total-label {
    font-weight: 500;
    margin-right: 1rem;
}
#menu-total {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}
#venteForm button[type="submit"] {
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--success), #27ae60);
    border: none;
    border-radius: 8px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
}
#venteForm button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}
#data-status {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    background: #f8f9fa;
}

/* ==================== */
/* SECTION DONNÉES */
/* ==================== */
#donnees .card {
    padding: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}
#donnees .card h2 {
    font-size: 1.8rem;
    border-bottom: none;
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}
#donnees .card h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 3px;
}
#donnees .card h2 i {
    font-size: 1.4rem;
    color: var(--secondary);
    margin-right: 0.5rem;
}
#donnees .card p {
    color: var(--light);
    margin-bottom: 1.5rem;
}
.data-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.data-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    text-align: center;
}
.data-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(52, 152, 219, 0.2);
}
.data-card-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}
.data-card-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.data-card-desc {
    font-size: 0.9rem;
    color: var(--light);
    margin-bottom: 1.5rem;
}
.data-card-btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}
.data-card-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}
.data-status {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    background: #f8f9fa;
    text-align: center;
    font-weight: 500;
    color: var(--dark);
}

/* GLOBAL TABLE & BUTTONS */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
}
th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}
th {
    background-color: var(--primary);
    color: white;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}
tr:nth-child(even) { background-color: #f9f9f9; }
tr:hover { background-color: #f1f5f9; }

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}
.btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: #1a252f; }
.btn-accent  { background: var(--accent); }
.btn-accent:hover  { background: #c0392b; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #27ae60; }

.input-group { margin-bottom: 1rem; }
input[type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border 0.3s ease;
}
input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.footer {
  /* gradient raccord avec le header/nav */
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--light);
  
  /* espacement et centrage */
  padding: 2rem 1rem;
  text-align: center;
  
  /* petit relief en haut */
  border-top: 4px solid var(--secondary);
  box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
}

.footer p {
  margin: 0;
  line-height: 1.4;
}

.footer p + p {
  /* cible le deuxième <p> */
  margin-top: 0.5rem;
  font-size: 0.9rem;
  opacity: 0.8;
  
  /* icône + texte alignés */
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer i {
  /* icône mise en valeur */
  color: var(--success);
  font-size: 1.1rem;
}

/* optionnel : lien “Haut de page” */
.footer .back-to-top {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.4rem 0.8rem;
  background: rgba(255,255,255,0.15);
  color: var(--light);
  border-radius: 20px;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.3s ease, transform 0.3s ease;
}
.footer .back-to-top:hover {
  background: var(--success);
  transform: translateY(-2px);
}

/* MEDIA QUERIES GLOBALES */
@media (max-width: 768px) {
    .nav {
        flex-wrap: wrap;
        padding: 0.5rem;
    }
    .nav a {
        margin: 0.25rem;
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    .header h1 { font-size: 2rem; }
    #menu-items { grid-template-columns: 1fr; }
    .payment-method-option { min-width: calc(50% - 0.5rem); }
}
@media (max-width: 576px) {
    .header h1 { font-size: 1.8rem; }
    .header p { font-size: 0.9rem; }
    .nav a {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    .card { padding: 1rem; }
    .card h2 { font-size: 1.2rem; }
    .btn { padding: 0.5rem 1rem; font-size: 0.9rem; }
    .payment-methods-grid { flex-direction: column; }
    .payment-method-option { min-width: 100%; }
    .footer {
        padding: 1.5rem 0.5rem;
    }
    .footer p + p {
        display: block;
    }
}

/* ==================== */
/* VARIABLES SECTIONNELLES & OVERRIDES */
/* ==================== */
/* Déclarations de couleur par section */
#commande  { --section-primary: #34dbb7; --section-secondary: #0c9169; }
#fidelite  { --section-primary: #f39c12; --section-secondary: #ac580f; }
#banque    { --section-primary: #cc2e2e; --section-secondary: #861111; }
#historique{ --section-primary: #e622dc; --section-secondary: #83038f; }
#stock     { --section-primary: #9e9d46; --section-secondary: #7f8611; }
#menu      { --section-primary: #3498db; --section-secondary: #061c64; }
#donnees   { --section-primary: #73cc49; --section-secondary: #3e9217; }

/* Gradient du lien actif dans la nav */
.nav a[href="#commande"].active   { background: linear-gradient(135deg, #34dbb7, #0c9169); }
.nav a[href="#fidelite"].active   { background: linear-gradient(135deg, #f39c12, #ac580f); }
.nav a[href="#banque"].active     { background: linear-gradient(135deg, #cc2e2e, #861111); }
.nav a[href="#historique"].active { background: linear-gradient(135deg, #e622dc, #83038f); }
.nav a[href="#stock"].active      { background: linear-gradient(135deg, #9e9d46, #7f8611); }
.nav a[href="#menu"].active       { background: linear-gradient(135deg, #3498db, #061c64); }
.nav a[href="#donnees"].active    { background: linear-gradient(135deg, #73cc49, #3e9217); }

/* Couleur des titres et gradient de soulignement */
#commande   .card h2, #commande   .card h2 i { color: var(--section-primary); }
#fidelite   .card h2, #fidelite   .card h2 i { color: var(--section-primary); }
#banque     .card h2, #banque     .card h2 i { color: var(--section-primary); }
#historique .card h2, #historique .card h2 i { color: var(--section-primary); }
#stock      .card h2, #stock      .card h2 i { color: var(--section-primary); }
#menu       .card h2, #menu       .card h2 i { color: var(--section-primary); }
#donnees    .card h2, #donnees    .card h2 i { color: var(--section-primary); }

#commande   .card h2::after { background: linear-gradient(90deg, var(--section-secondary), var(--section-primary)); }
#fidelite   .card h2::after { background: linear-gradient(90deg, var(--section-secondary), var(--section-primary)); }
#banque     .card h2::after { background: linear-gradient(90deg, var(--section-secondary), var(--section-primary)); }
#historique .card h2::after { background: linear-gradient(90deg, var(--section-secondary), var(--section-primary)); }
#stock      .card h2::after { background: linear-gradient(90deg, var(--section-secondary), var(--section-primary)); }
#menu       .card h2::after { background: linear-gradient(90deg, var(--section-secondary), var(--section-primary)); }
#donnees    .card h2::after { background: linear-gradient(90deg, var(--section-secondary), var(--section-primary)); }

/* Bordure des cartes (optionnel) */
#commande   .card { border-color: var(--section-secondary); }
#fidelite   .card { border-color: var(--section-secondary); }
#banque     .card { border-color: var(--section-secondary); }
#historique .card { border-color: var(--section-secondary); }
#stock      .card { border-color: var(--section-secondary); }
#menu       .card { border-color: var(--section-secondary); }
#donnees    .card { border-color: var(--section-secondary); }
