/* ==========================================================================
   Fichier : assets/css/admin.css
   Description : Styles principaux pour l'administration de BobyShop
   ========================================================================== */

/* ---------------------------
   Variables de thème
--------------------------- */
:root {
    --primary: #e60000;
    --primary-dark: #cc0000;
    --secondary: #333;
    --background: #f8f9fa;
    --white: #ffffff;
    --gray-light: #f1f1f1;
    --gray-medium: #ccc;
    --gray-dark: #666;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --font-family: 'Segoe UI', Arial, sans-serif;
}

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

html {
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background: var(--background);
    color: var(--secondary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ---------------------------
   Layout général
--------------------------- */
.admin-main {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-container h1 {
    margin-bottom: 20px;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
    text-align: center;
}

/* ---------------------------
   HEADER
--------------------------- */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--secondary);
    padding: 10px 20px;
    color: var(--white);
}

.admin-header-left .admin-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
    color: var(--white);
}

.admin-header-left img {
    height: 40px;
    width: 40px;
    border-radius: 50%;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    background: var(--primary);
    padding: 8px 15px;
    border-radius: 8px;
    color: var(--white);
    transition: background 0.3s ease;
}

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

/* ---------------------------
   NAVIGATION
--------------------------- */
.admin-nav {
    background: #222;
}

.admin-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
}

.admin-nav ul li {
    flex: 1;
}

.admin-nav ul li a {
    display: block;
    padding: 12px;
    color: var(--white);
    text-align: center;
    transition: background 0.3s;
}

.admin-nav ul li a:hover,
.admin-nav ul li a.active {
    background: var(--primary);
}

/* ---------------------------
   Boutons
--------------------------- */
.btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
    transition: 0.3s ease;
    cursor: pointer;
    border: none;
    background: var(--gray-dark);
    color: var(--white);
}

.btn:hover {
    opacity: 0.9;
}

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

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

.btn-success {
    background: var(--success);
}

.btn-info {
    background: var(--info);
}

.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-danger {
    background: var(--danger);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.btn.active {
    background: var(--primary);
    color: var(--white);
}

/* ---------------------------
   Alertes
--------------------------- */
.alert {
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

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

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

/* ---------------------------
   Onglets
--------------------------- */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.tab-link {
    padding: 10px 20px;
    border-radius: 6px;
    background: var(--gray-light);
    color: var(--secondary);
    font-weight: 500;
    transition: 0.3s ease;
}

.tab-link:hover {
    background: var(--gray-medium);
}

.tab-link.active {
    background: var(--primary);
    color: var(--white);
}

/* ---------------------------
   Actions et recherche
--------------------------- */
.admin-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-form input[type="text"] {
    padding: 8px 10px;
    border: 1px solid var(--gray-medium);
    border-radius: 6px;
    min-width: 220px;
    font-size: 0.9rem;
}

/* ---------------------------
   Tableaux
--------------------------- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.admin-table th,
.admin-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-light);
    text-align: left;
    font-size: 0.9rem;
}

.admin-table thead {
    background: var(--primary);
    color: var(--white);
}

.admin-table tr:hover {
    background: #f9f9f9;
}

.admin-table td .btn {
    margin-right: 5px;
}

/* Badge de stock */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
}

.badge-success {
    background: var(--success);
    color: var(--white);
}

.badge-warning {
    background: var(--warning);
    color: #000;
}

.badge-error {
    background: var(--danger);
    color: var(--white);
}

/* ---------------------------
   Pagination
--------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 8px;
    flex-wrap: wrap;
}

.page-link {
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--gray-light);
    color: var(--secondary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: 0.3s ease;
}

.page-link:hover {
    background: var(--gray-medium);
}

.page-link.active {
    background: var(--primary);
    color: var(--white);
}

/* Masquer le modal par défaut */
.modal.hidden {
    display: none;
}

/* ---------------------------
   Modale (pop-up)
--------------------------- */
.modal {
    position: fixed;
    display: block;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    position: relative;
    animation: fadeIn 0.3s ease;
}

.modal-header {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Animation modale */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------
   Responsive
--------------------------- */
@media (max-width: 992px) {
    .admin-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        width: 100%;
        justify-content: space-between;
    }

    .search-form input[type="text"] {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .admin-table th, 
    .admin-table td {
        padding: 8px;
        font-size: 0.8rem;
    }

    .btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .tabs {
        flex-direction: column;
    }

    .tab-link {
        width: 100%;
        text-align: center;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form input[type="text"],
    .search-form button {
        width: 100%;
    }
}
/* ---------------------------
   FOOTER ADMIN
--------------------------- */
.admin-footer {
    background: #111;
    color: var(--white);
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid var(--gray-dark);
    margin-top: 20px;
}

.admin-footer-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.admin-footer-container p {
    margin: 0;
}

/* Responsive footer */
@media (max-width: 768px) {
    .admin-footer-container {
        font-size: 0.8rem;
        padding: 10px;
    }
}
/* ============================
   Dashboard Responsive (Stats)
============================ */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important; /* Force 2 colonnes avec !important */
    gap: 10px; /* Réduit l'espace */
    margin-bottom: 20px;
}

/* Responsive spécifique pour mobile si besoin de surcharger d'autres règles */
@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

.stat-card {
    background: var(--white);
    border-radius: 8px;
    padding: 8px 12px; /* Padding très réduit */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
    
    /* Layout horizontal compact */
    display: grid;
    grid-template-areas: "icon value" "icon label";
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    align-items: center;
    text-align: left;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.08);
}

.stat-card i {
    grid-area: icon;
    font-size: 1.1rem;
    color: var(--primary);
    margin: 0;
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.04);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card h3 {
    grid-area: value;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 0;
    line-height: 1;
    align-self: end;
}

.stat-card p {
    grid-area: label;
    color: var(--gray-dark);
    font-size: 0.75rem;
    margin: 0;
    line-height: 1;
    align-self: start;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================
   Table Responsive
============================ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 600px;
}

/* ============================
   Section commandes
============================ */
.dashboard-section {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

/* ============================
   SLIDER ADMIN - MOBILE OPTIMIZATIONS
============================ */
@media (max-width: 768px) {
    /* Tableau Slider en mode Cartes */
    .slider-table {
        display: block;
    }
    
    .slider-table thead {
        display: none;
    }
    
    .slider-table tbody {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
    }
    
    .slider-table tr {
        display: grid;
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas: 
            "image title"
            "image badge"
            "actions actions";
        gap: 10px;
        background: #fff;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        border: 1px solid var(--gray-light);
    }
    
    /* Image */
    .slider-table td:nth-child(2) {
        grid-area: image;
        padding: 0;
        border: none;
        display: flex;
        align-items: flex-start;
        justify-content: center;
    }
    
    .slider-table td:nth-child(2) img {
        width: 80px;
        height: 50px;
        object-fit: cover;
        border-radius: 4px;
    }
    
    /* Titre */
    .slider-table td:nth-child(3) {
        grid-area: title;
        padding: 0;
        border: none;
        text-align: left;
    }
    
    /* Badge Statut */
    .slider-table td:nth-child(5) {
        grid-area: badge;
        padding: 0;
        border: none;
        text-align: left;
        align-self: start;
    }
    
    /* Actions */
    .slider-table td:last-child {
        grid-area: actions;
        padding: 10px 0 0 0;
        border-top: 1px solid #eee;
        display: flex;
        justify-content: space-between;
        width: 100%;
        margin-top: 5px;
    }
    
    .slider-table td:last-child .btn {
        flex: 1;
        margin: 0 5px;
        justify-content: center;
    }
    
    /* Masquer Ordre et Bouton info sur mobile pour simplifier */
    .slider-table td:nth-child(1),
    .slider-table td:nth-child(4) {
        display: none;
    }
}
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Force 2 colonnes */
    gap: 10px; /* Réduit l'espace */
    margin-bottom: 20px;
}

.action-card {
    background: var(--white);
    padding: 12px; /* Réduit padding */
    border-radius: 8px; /* Coins moins arrondis */
    display: flex;
    align-items: center;
    gap: 10px; /* Réduit gap */
    text-decoration: none;
    color: var(--secondary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 3px solid transparent; /* Bordure plus fine */
    font-size: 0.9rem; /* Texte plus petit */
}

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

.action-card .icon-box {
    width: 32px; /* Icône plus petite */
    height: 32px;
    border-radius: 6px; /* Carré arrondi plutôt que rond pour gagner de la place visuelle */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--white);
    flex-shrink: 0;
}

.action-card span {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
}

/* Couleurs spécifiques par action */
.action-sale { border-color: #28a745; }
.action-sale .icon-box { background: #28a745; }

.action-product { border-color: #007bff; }
.action-product .icon-box { background: #007bff; }

.action-slide { border-color: #6610f2; }
.action-slide .icon-box { background: #6610f2; }

.action-orders { border-color: #fd7e14; }
.action-orders .icon-box { background: #fd7e14; }

/* ============================
   DASHBOARD - STOCK FAIBLE
============================ */
.stock-alert-section {
    margin-top: 30px;
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stock-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.85rem;
}

.stock-critical {
    background: #ffebee;
    color: #dc3545;
    border: 1px solid #ffcdd2;
}

.stock-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.loader {
    display: none;
    text-align: center;
    padding: 20px;
    color: var(--gray-dark);
    font-size: 1rem;
}

/* ============================
   Responsive
============================ */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
/* Recherche produits */
.search-results {
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results div {
    padding: 10px;
    cursor: pointer;
}

.search-results div:hover {
    background: #f0f0f0;
}

/* Total */
.total-display {
    text-align: right;
    margin-top: 20px;
    font-size: 1.2rem;
    font-weight: bold;
}
/* === Formulaire produit === */
.admin-form-container {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0 8px rgba(0,0,0,0.05);
    max-width: 900px;
    margin: auto;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.admin-form-group {
    display: flex;
    flex-direction: column;
}

.admin-form-group label {
    font-weight: 600;
    margin-bottom: 6px;
}

.admin-form-group input,
.admin-form-group select,
.admin-form-group textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

.admin-form-group textarea {
    resize: vertical;
}

/* Aperçu image */
.image-upload {
    display: flex;
    flex-direction: column;
}

.image-preview-container {
    margin-top: 10px;
    text-align: center;
}

.image-preview-container img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 10px;
    border: 1px solid #ddd;
}

/* Actions */
.admin-form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.btn {
    background: #007bff;
    color: #fff;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    font-size: 1rem;
}

.btn:hover {
    background: #0056b3;
}

.btn-cancel {
    background: #e0e0e0;
    color: #333;
}

.btn-cancel:hover {
    background: #ccc;
}

/* Responsive */
@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .admin-form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn, .btn-cancel {
        width: 100%;
    }
}
/* === Formulaire Catégorie === */
.admin-form-container {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 20px auto;
}

.admin-form-container h1 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
}

.admin-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.admin-form-group label {
    font-weight: 600;
    margin-bottom: 8px;
}

.admin-form-group input,
.admin-form-group textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

.admin-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.helper-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

/* Boutons d'action */
.admin-form-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #ddd;
}

/* Messages */
.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

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

/* Responsive */
@media (max-width: 768px) {
    .admin-form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
/* === Formulaire Catégorie === */
.admin-form-container {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 20px auto;
}

.admin-form-container h1 {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 25px;
    color: #333;
}

.admin-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.admin-form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #222;
}

.admin-form-group input,
.admin-form-group textarea {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.admin-form-group input:focus,
.admin-form-group textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 4px rgba(0, 123, 255, 0.4);
    outline: none;
}

.admin-form-group textarea {
    resize: vertical;
    min-height: 90px;
}

.helper-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

/* === Actions du formulaire === */
.admin-form-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #ddd;
}

/* === Messages === */
.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

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

/* === Responsive === */
@media (max-width: 768px) {
    .admin-form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
.admin-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.admin-modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
}

/* ============================
   MOBILE ADMIN IMPROVEMENTS
============================ */

/* Bouton Menu Mobile */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 15px;
    padding: 5px;
}

/* Responsive Navigation & Layout */
@media (max-width: 992px) {
    .mobile-menu-btn {
        display: block;
    }

    /* Header Ajustements */
    .admin-header {
        padding: 10px 15px;
    }
    
    .admin-header-left .admin-logo span {
        display: none; /* Masquer le texte du logo sur mobile si besoin */
    }
    
    .admin-header-right .admin-user {
        display: none; /* Masquer le nom d'utilisateur sur mobile */
    }

    /* Navigation Mobile Verticale */
    .admin-nav {
        display: none; /* Caché par défaut */
        background: #222;
        border-bottom: 2px solid var(--primary);
    }

    .admin-nav.active {
        display: block;
        animation: slideDown 0.3s ease-out;
    }

    .admin-nav ul {
        flex-direction: column;
    }

    .admin-nav ul li a {
        text-align: left;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .admin-nav ul li a:hover {
        padding-left: 25px; /* Petit effet de décalage */
    }

    .logout-btn span {
        display: none; /* Garder juste l'icône si on veut */
    }
}

/* Animation Menu */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================
   MOBILE FORMS (Slider, Products, etc.)
============================ */
@media (max-width: 768px) {
    /* Form Container : utiliser toute la largeur */
    .admin-form-container {
        width: 100%;
        max-width: 100%;
        border-radius: 0; /* Moins d'arrondi pour gagner de l'espace */
        padding: 15px;
        margin: 0;
        box-shadow: none; /* Alléger le visuel */
    }

    /* Champs de formulaire plus hauts pour le tactile */
    .admin-form-group input,
    .admin-form-group select,
    .admin-form-group textarea {
        font-size: 16px; /* Évite le zoom auto sur iOS */
        padding: 12px; /* Plus facile à taper */
    }

    /* Labels plus visibles */
    .admin-form-group label {
        font-size: 1rem;
        margin-bottom: 8px;
        display: block;
    }

    /* Checkbox plus grosse */
    input[type="checkbox"] {
        transform: scale(1.2);
        margin-right: 8px;
    }

    /* Boutons pleine largeur et plus hauts */
    .admin-form-actions {
        flex-direction: column-reverse; /* Annuler en bas, Enregistrer en haut */
        gap: 12px;
        margin-top: 30px;
    }

    .admin-form-actions .btn {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
    }

    /* Grille interne (Grid-2) passe en colonne unique */
    .grid-2 {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
}
/* ============================
   PRODUCTS TABLE & IMAGE MODAL
============================ */
.product-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.product-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.no-image {
    color: #ccc;
    font-size: 0.8rem;
    font-style: italic;
}

/* Image Modal (Lightbox) */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.modal-content-img {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    border-radius: 4px;
    animation: zoom 0.3s;
}

@keyframes zoom {
    from {transform:scale(0)}
    to {transform:scale(1)}
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-modal:hover {
    color: #bbb;
}

/* ============================
   PAGINATION MOBILE
============================ */
@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        gap: 5px;
        padding: 10px 0;
    }

    .page-link {
        padding: 8px 12px;
        font-size: 0.9rem;
        flex: 1 0 auto; /* Permet aux boutons de s'étirer */
        text-align: center;
        max-width: 60px; /* Limite la largeur pour garder une grille propre */
    }

    /* Boutons Précédent / Suivant prennent plus de place */
    .page-link:first-child, 
    .page-link:last-child {
        max-width: none;
        flex-basis: 40%;
        font-weight: bold;
    }
}
/* ============================
   PRODUCTS MOBILE RESPONSIVE
============================ */
@media (max-width: 768px) {
    /* Tableau Produits en mode Cartes */
    .admin-table thead {
        display: none;
    }
    
    .admin-table tbody {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 15px;
    }
    
    .admin-table tr {
        display: grid;
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas: 
            "image name"
            "image meta"
            "actions actions";
        gap: 10px;
        background: #fff;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        border: 1px solid var(--gray-light);
        margin-bottom: 0; /* Reset marge tableau standard */
    }
    
    /* Image */
    .admin-table td:nth-child(1) { /* Colonne Image */
        grid-area: image;
        padding: 0;
        border: none;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        text-align: center;
        min-height: auto;
    }
    
    .product-thumb {
        width: 70px;
        height: 70px;
    }
    
    /* Nom */
    .admin-table td:nth-child(2) { /* Colonne Nom */
        grid-area: name;
        padding: 0;
        border: none;
        text-align: left;
        font-size: 1rem;
        display: block;
    }
    
    /* Meta (Catégorie + Prix + Stock) */
    .admin-table td:nth-child(3), /* Cat */
    .admin-table td:nth-child(4), /* Prix */
    .admin-table td:nth-child(5) { /* Stock */
        grid-area: meta;
        padding: 0;
        border: none;
        text-align: left;
        display: inline-block;
        font-size: 0.85rem;
        color: var(--gray-dark);
        margin-right: 10px;
        min-height: auto;
    }
    
    /* Astuce pour regrouper Cat/Prix/Stock sur une ligne virtuelle */
    .admin-table td:nth-child(3)::after { content: " • "; }
    .admin-table td:nth-child(4)::after { content: " • "; }
    
    /* Actions */
    .admin-table td:last-child {
        grid-area: actions;
        padding: 10px 0 0 0;
        border-top: 1px solid #eee;
        display: flex;
        justify-content: space-between;
        width: 100%;
        margin-top: 5px;
        background: transparent; /* Override background gris mobile */
    }
    
    .admin-table td:last-child .btn {
        flex: 1;
        margin: 0 5px;
        justify-content: center;
    }
}
@media (max-width: 768px) {
    .admin-table, .admin-table tbody, .admin-table tr, .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table thead {
        display: none; /* Masquer les en-têtes de colonnes */
    }

    .admin-table tr {
        margin-bottom: 15px;
        border: 1px solid var(--gray-medium);
        border-radius: 8px;
        background: var(--white);
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        overflow: hidden;
    }

    .admin-table td {
        text-align: right;
        padding: 10px 15px;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%; /* Espace pour le label */
        min-height: 40px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .admin-table td:last-child {
        border-bottom: none;
        justify-content: center;
        padding-left: 15px;
    }

    /* Ajouter des labels via CSS data-label (nécessitera d'ajouter data-label="Titre" dans le HTML) 
       OU simplement laisser flex faire le job si le contenu est simple.
       Pour une solution générique sans modifier tout le HTML, on garde le display flex simple.
    */
    
    /* Ajustement des actions */
    .admin-table td:last-child {
        background: #f8f9fa;
        gap: 10px;
    }
    
    /* Ajustements Dashboard Stats */
    .dashboard-stats {
        grid-template-columns: 1fr; /* 1 colonne sur mobile */
    }
}

