/* 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: #f4f4f4;
    font-size: 16px;
    transition: margin-left 0.3s ease;
}

body.menu-open {
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Main content */
.main-content {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    transition: opacity 0.3s ease;
}

.main-content.blur {
    opacity: 0.7;
    pointer-events: none;
}

/* Tableaux Responsive */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.9rem;
}

th, td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    word-wrap: break-word;
}

th {
    background-color: #3498db;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

tr:hover {
    background-color: #f5f5f5;
}

/* Cartes du tableau de bord */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card h3 {
    color: #7f8c8d;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card .number {
    font-size: 1.75rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

/* Boutons d'action (sub) */
.btnsub {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    margin: 2px;
    width: 40px;
    height: 40px;
}

.btnsub:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.btnsub-edit {
    background: #f39c12;
}

.btnsub-edit:hover {
    background: #e67e22;
}

.btnsub-delete {
    background: #e74c3c;
}

.btnsub-delete:hover {
    background: #c0392b;
}

.btnsub-cancel {
    background: #95a5a6;
}

.btnsub-cancel:hover {
    background: #7f8c8d;
}

.btnsub-recu {
    background: #27ae60;
}

.btnsub-recu:hover {
    background: #219a52;
}

.btnsub-details {
    background: #9b59b6;
}

.btnsub-details:hover {
    background: #8e44ad;
}

.btnsub-text {
    display: none;
}

.btnsub i {
    font-size: 1.2rem;
    margin: 0;
}

/* Boutons principaux */
.btn {
    display: inline-block;
    padding: 10px 16px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    margin: 2px;
    text-align: center;
    width: auto;
    min-width: 120px;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-edit {
    background: #f39c12;
}

.btn-edit:hover {
    background: #e67e22;
}

.btn-delete {
    background: #e74c3c;
}

.btn-delete:hover {
    background: #c0392b;
}

.btn-cancel {
    background: #95a5a6;
}

.btn-cancel:hover {
    background: #7f8c8d;
}

.btn-success {
    background: #2ecc71;
}

.btn-success:hover {
    background: #27ae60;
}

/* Barre d'actions mobile */
.action-bar {
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-bar .btn {
    width: 100%;
    margin: 2px 0;
}

/* Formulaires Responsive */
form {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 100%;
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: white;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Messages */
.message {
    padding: 1rem;
    margin-bottom: 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Statuts */
.status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.status-normal {
    background: #d4edda;
    color: #155724;
}

.status-low {
    background: #fff3cd;
    color: #856404;
}

.status-out {
    background: #f8d7da;
    color: #721c24;
}

/* Plans de prix responsive */
.pricing-plans {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.pricing-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.pricing-card.current-plan {
    border-color: #3498db;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9f7fe 100%);
}

.plan-header {
    text-align: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #eee;
}

.plan-header h4 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.price {
    margin-bottom: 0.5rem;
}

.amount {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

.period {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.price-yearly {
    color: #27ae60;
    font-size: 0.85rem;
}

.plan-features {
    margin-bottom: 1.5rem;
}

.plan-features ul {
    list-style: none;
    padding: 0;
}

.plan-features li {
    padding: 0.4rem 0;
    color: #2c3e50;
    font-size: 0.9rem;
}

.plan-actions {
    text-align: center;
}

.plan-actions .btn {
    width: 100%;
    margin-bottom: 0.5rem;
}

/* Filtres responsive */
.filter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-form > div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Pied de page */
footer {
    background: #34495e;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
    font-size: 0.9rem;
}

/* Media Queries pour tablettes */
@media (min-width: 768px) {
    body {
        font-size: 16px;
    }
    
    .action-bar {
        flex-direction: row;
        align-items: center;
    }
    
    .action-bar .btn {
        width: auto;
    }
    
    .pricing-plans {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .filter-form {
        flex-direction: row;
        align-items: end;
    }
    
    .filter-form > div {
        flex: 1;
    }
    
    table {
        font-size: 0.95rem;
    }
    
    th, td {
        padding: 12px 10px;
    }
}

/* Media Queries pour desktop */
@media (min-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    
    .dashboard {
        gap: 1.5rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .card .number {
        font-size: 2rem;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    form {
        padding: 2rem;
    }
    
    .pricing-plans {
        gap: 2rem;
    }
    
    .pricing-card {
        padding: 2rem;
    }
}

/* Styles pour très petits écrans */
@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }
    
    .card {
        padding: 1rem;
    }
    
    .card .number {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-width: 100px;
    }
    
    form {
        padding: 1rem;
    }
}

/* Améliorations pour le tactile */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    input, select, textarea {
        min-height: 44px;
    }
}

/* Impression */
@media print {
    .btn, .action-bar, nav {
        display: none !important;
    }
    
    body {
        background: white;
        font-size: 12pt;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Animation smooth pour le menu */
.main-nav {
    transition: all 0.3s ease-in-out;
}