/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header et navigation avec icônes */
header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 300;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    min-width: auto;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.nav-link i {
    font-size: 1.1em;
    width: 16px;
    text-align: center;
}

.nav-text {
    white-space: nowrap;
}

/* Dashboard */
.dashboard {
    padding: 2rem 0;
}

.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
}

.welcome-section h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #3498db;
}

.stat-card h3 {
    color: #7f8c8d;
    margin-bottom: 1rem;
    font-size: 1rem;
    text-transform: uppercase;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Boutons */
.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

.btn-small {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    margin: 0 0.25rem;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Module header */
.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid #ddd;
}

.module-header h2 {
    color: #2c3e50;
    font-size: 1.5rem;
}

/* Search sections */
.search-section {
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    gap: 1rem;
    max-width: 500px;
}

.search-box input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.data-table th {
    background: #34495e;
    color: white;
    font-weight: 600;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 96vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    max-height: calc(96vh - 120px);
    padding-right: 5px;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.close:hover {
    color: #e74c3c;
}

/* Form styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Rayons grid */
.rayons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.rayon-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-left: 4px solid #e74c3c;
}

.rayon-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.rayon-articles {
    margin: 1rem 0;
}

.article-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ecf0f1;
}

.quantite {
    background: #3498db;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

.no-articles {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
}

/* Caisse styles */
.caisse-container {
    padding: 2rem 0;
}

.caisse-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.scan-section,
.panier-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.scan-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.scan-box input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.article-scanned {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 5px;
    border-left: 4px solid #27ae60;
}

.article-info {
    margin-top: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.label {
    font-weight: 600;
    color: #2c3e50;
}

.price {
    color: #27ae60;
    font-weight: bold;
}

/* Panier styles */
.panier-items {
    min-height: 200px;
    margin-bottom: 2rem;
}

.panier-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

.panier-item:last-child {
    border-bottom: none;
}

.panier-item-info {
    flex: 1;
}

.panier-item-name {
    font-weight: 600;
    color: #2c3e50;
}

.panier-item-price {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.panier-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    background: #bdc3c7;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: #95a5a6;
}

.empty-panier {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 2rem;
}

.panier-total {
    border-top: 2px solid #ecf0f1;
    padding-top: 1rem;
    margin-bottom: 2rem;
}

.total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.total-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: #27ae60;
}

.panier-actions {
    display: flex;
    gap: 1rem;
}

/* Paiement styles */
.paiement-info {
    text-align: center;
}

.total-a-payer {
    margin-bottom: 2rem;
}

.monnaie-rendue {
    margin: 1rem 0;
}

.monnaie-amount {
    font-size: 1.2rem;
    color: #e74c3c;
    font-weight: bold;
}

.confirmation {
    text-align: center;
}

.confirmation-details {
    margin: 2rem 0;
}

.vente-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
}

.confirmation-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Styles pour la fidélisation */
.fidelisation-container {
    padding: 2rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.fidelisation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.regles-section,
.clients-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.regles-list,
.clients-list {
    margin-top: 1.5rem;
}

.regle-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #3498db;
}

.regle-card.actif {
    border-left-color: #27ae60;
}

.regle-card.inactif {
    border-left-color: #95a5a6;
    opacity: 0.7;
}

.regle-info h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.regle-details {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.regle-details span {
    background: #ecf0f1;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

.status {
    background: #3498db !important;
    color: white;
}

.regle-card.actif .status {
    background: #27ae60 !important;
}

.regle-card.inactif .status {
    background: #95a5a6 !important;
}

.regle-actions {
    display: flex;
    gap: 0.5rem;
}

.client-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #e74c3c;
}

.client-info h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.client-details {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.client-details span {
    background: #ecf0f1;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

.client-actions {
    display: flex;
    gap: 0.5rem;
}

/* Section fidélisation dans la caisse */
.fidelisation-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #f39c12;
}

.fidelisation-form {
    margin-top: 1rem;
}

.fidelisation-form .form-group {
    display: flex;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.fidelisation-form .form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    flex: 0 0 auto;
}

.fidelisation-form .form-group input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.fidelite-info {
    background: white;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #ecf0f1;
}

.remise {
    color: #27ae60;
    font-weight: bold;
}

.remise-line {
    color: #e74c3c;
}

.empty-message {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .caisse-grid {
        grid-template-columns: 1fr;
    }
    
    .fidelisation-grid {
        grid-template-columns: 1fr;
    }
    
    .main-nav {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .module-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .search-box,
    .scan-box {
        flex-direction: column;
    }
    
    .form-actions,
    .panier-actions,
    .confirmation-actions {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .fidelisation-form .form-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .regle-details,
    .client-details {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Section styles */
.section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* Cartes d'action pour la fidélisation */
.cartes-section {
    text-align: center;
}

.cartes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.carte-action-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 2.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    text-align: center;
}

.carte-action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
}

.carte-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.carte-action-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.carte-action-card p {
    color: #6c757d;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.info-text {
    color: #6c757d;
    font-style: italic;
    margin-top: 1rem;
    text-align: center;
}
