/* Styles généraux */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    color: #333;
}

/* Navbar sobre */
.navbar {
    background-color: #ffffff;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 70%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 60px;
}

.navbar-brand {
    color: #2c3e50;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.navbar-brand:hover {
    color: #34495e;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-item {
    color: #6c757d;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.navbar-item:hover {
    color: #495057;
    background-color: #f8f9fa;
}

.navbar-logout {
    color: #dc3545;
    border: 1px solid #dc3545;
}

.navbar-logout:hover {
    background-color: #dc3545;
    color: white;
}

.navbar-register {
    color: white;
    background-color: #007bff;
    border: 1px solid #007bff;
}

.navbar-register:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* Menu mobile */
.navbar-burger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 4px;
}

.navbar-burger span {
    width: 20px;
    height: 2px;
    background-color: #6c757d;
    margin: 2px 0;
    transition: 0.3s;
}

.navbar-mobile {
    display: none;
    background-color: #ffffff;
    border-top: 1px solid #e9ecef;
    padding: 0;
}

.navbar-mobile.active {
    display: block;
}

.navbar-mobile-item {
    display: block;
    color: #6c757d;
    text-decoration: none;
    padding: 1rem 24px;
    border-bottom: 1px solid #f8f9fa;
    font-weight: 500;
}

.navbar-mobile-item:hover {
    background-color: #f8f9fa;
    color: #495057;
}

/* Main content */
.main-content {
    padding: 24px 0;
    min-height: calc(100vh - 84px);
}

.container {
    max-width: 75%;
    margin: 0 auto;
    padding: 0 24px;
}

/* Flash messages */
.flash-messages {
    max-width: 80%;
    margin: 0 auto;
    padding: 0 24px;
}

.flash-message {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    font-weight: 500;
}

.flash-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.flash-error {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

/* Conteneur principal unifié pour toutes les pages */
.profile-container {
    background-color: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    border: 1px solid #e9ecef;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Header unifié pour toutes les pages */
.profile-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9ecef;
}

.profile-header h1 {
    color: #2c3e50;
    margin: 0 0 6px 0;
    font-weight: 700;
    font-size: 1.75rem;
}

.profile-header p {
    color: #6c757d;
    margin: 0;
    font-size: 1rem;
}

/* User info */
.user-info {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.user-info h2 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 1.2rem;
}

.user-detail {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    padding: 6px 0;
}

.user-detail strong {
    min-width: 140px;
    color: #495057;
    font-weight: 600;
}

.navigation {
    text-align: center;
    margin-top: 20px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-admin {
    background-color: #ffeaa7;
    color: #2d3436;
}

.badge-user {
    background-color: #74b9ff;
    color: white;
}

.badge-self {
    background-color: #e7f3ff;
    color: #0066cc;
    margin-left: 8px;
}

/* Grille de produits - Largeur minimum 220px par carte */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Media queries pour optimiser l'affichage selon la taille d'écran */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
    }
}

.product-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    border: 1px solid #e9ecef;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    /* Fix pour éviter le redimensionnement */
    min-height: 180px;
    max-height: 180px;
    display: block;
}

.product-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; /* Permet au flex item de se rétrécir si nécessaire */
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
    line-height: 1.4;
    flex-shrink: 0; /* Le titre ne se réduit pas */
}

/* Container pour le prix et la date de mise à jour - collé en bas */
.product-pricing {
    margin-top: auto; /* Pousse le contenu vers le bas */
    margin-bottom: 0;
}

.product-price {
    font-size: 1.25rem;
    color: #007bff;
    font-weight: 700;
    margin-bottom: 8px;
}

.product-url {
    margin-top: 16px;
}

.product-url a {
    color: #007bff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.product-url a:hover {
    text-decoration: underline;
}

/* Styles pour les contrôles de subscription */
.product-subscription {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.btn-follow {
    padding: 0 16px;
    font-size: 0.875rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 500;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px; /* Largeur minimale pour éviter le débordement */
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

/* Override spécifique pour les boutons "Suivre" avec classes multiples */
.btn.btn-primary.btn-sm.btn-follow {
    height: 28px !important;
    min-width: 80px !important;
    padding: 0 16px !important;
    font-size: 0.875rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
}

.subscription-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-quantity {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background-color: #f8f9fa;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
    color: #495057;
}

.btn-quantity:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.btn-minus:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-plus:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.quantity-input {
    width: 50px;
    height: 28px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    background-color: white;
    outline: none;
    padding: 0;
    margin: 0;
}

.quantity-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.no-products {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    margin-top: 20px;
}

.no-products h2 {
    margin-bottom: 16px;
    font-weight: 600;
}

.no-products p {
    margin: 0;
}

/* Onglets admin */
.admin-tabs {
    display: flex;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.tab-button {
    flex: 1;
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-button:hover {
    background-color: #e9ecef;
    color: #495057;
}

.tab-button.active {
    background-color: #007bff;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.tab-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Tables admin */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f8f9fa;
}

.admin-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.admin-table tr:hover {
    background-color: #f8f9fa;
}

/* Badges admin */
.status-badge,
.role-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-inactive {
    background-color: #f8d7da;
    color: #842029;
}

.role-admin {
    background-color: #fff3cd;
    color: #856404;
}

.role-user {
    background-color: #cff4fc;
    color: #055160;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    margin: 4px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
}

.btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.btn-success {
    background-color: #28a745;
}

.btn-success:hover {
    background-color: #1e7e34;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.25rem;
    text-decoration: none;
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    color: white;
}

.btn-danger:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
}

.btn-warning {
    background-color: #ffc107;
    color: #000;
}

.btn-warning:hover {
    background-color: #e0a800;
}

/* Disabled button states */
.btn:disabled,
.btn-success:disabled,
.btn-danger:disabled,
.btn-secondary:disabled,
.btn-warning:disabled,
.btn-primary:disabled,
.btn-small:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Formulaires */
.form-container {
    max-width: 500px;
    margin: 0 auto;
    background-color: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    border: 1px solid #e9ecef;
}

.form-container h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 24px;
    font-weight: 600;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.form-links {
    text-align: center;
    margin-top: 24px;
}

.form-links a {
    color: #007bff;
    text-decoration: none;
    font-size: 0.95rem;
}

.form-links a:hover {
    text-decoration: underline;
}

/* Messages */
.error {
    color: #842029;
    font-size: 0.9rem;
    margin-bottom: 16px;
    padding: 16px 20px;
    background-color: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 8px;
}

.success-message {
    background-color: #d1e7dd;
    color: #0f5132;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #badbcc;
}

/* Éléments admin spécifiques */
.product-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.no-image {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #6c757d;
    font-size: 1.5rem;
}

/* Liens URL dans la table */
.url-link {
    color: #007bff;
    text-decoration: none;
    font-size: 0.875rem;
}

.url-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Prix dans la table */
.price {
    font-weight: bold;
    color: #28a745;
}

/* Modal */
.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: 10% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.25rem;
}

.close {
    color: #6c757d;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.modal form {
    padding: 24px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f8f9fa;
}

/* Toggle switches pour admin */
.toggle-switch {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.toggle-switch.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-label {
    display: block;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 12px;
    position: relative;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.toggle-label.disabled {
    cursor: not-allowed;
    background-color: #dc3545; /* Rouge pour désactivé */
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Toggle actif - utilisateurs normaux */
.toggle-switch input[type="checkbox"]:checked + .toggle-label {
    background-color: #28a745;
}

/* Toggle actif - utilisateur courant (désactivé mais avec couleur) */
.toggle-switch input[type="checkbox"]:checked + .toggle-label.disabled {
    background-color: #28a745; /* Vert pour actif même si désactivé */
}

.toggle-switch input[type="checkbox"]:checked + .toggle-label .toggle-slider {
    transform: translateX(26px);
}

.toggle-switch:not(.disabled):hover .toggle-label {
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
}

.toggle-switch.disabled:hover .toggle-label {
    box-shadow: none;
}

/* Switch/Toggle styles pour les colonnes Actif et Admin */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.switch input:checked + .slider {
    background-color: #28a745;
}

.switch input:focus + .slider {
    box-shadow: 0 0 1px #28a745;
}

.switch input:checked + .slider:before {
    transform: translateX(26px);
}

.switch input:disabled + .slider {
    cursor: not-allowed;
    opacity: 0.6;
}

.switch input:disabled + .slider:before {
    cursor: not-allowed;
}

/* Style pour les switches désactivés mais cochés (utilisateur courant) */
.switch input:checked:disabled + .slider {
    background-color: #28a745;
    opacity: 0.8;
}

/* Hover effect pour les switches actifs */
.switch:not(:has(input:disabled)):hover .slider {
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
}

/* Sections de produits */
.products-section {
    margin-bottom: 40px;
}

.products-section h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.products-section:first-of-type h3 {
    border-bottom-color: #28a745;
}

.products-section:last-of-type h3 {
    border-bottom-color: #6c757d;
}

/* Styles pour la barre de recherche */
.search-container {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-bottom: 24px;
    position: relative;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 16px 20px;
    font-size: 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    box-sizing: border-box;
    outline: none;
}

.search-input:focus {
    border-color: #007bff;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-input::placeholder {
    color: #6c757d;
    font-weight: 400;
}

/* Bouton + carré à côté de la recherche */
.add-product-btn {
    width: 56px;
    height: 56px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.add-product-btn:hover {
    background-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* Animation pour les cartes temporairement suivies */
.product-card[data-temp-followed="true"] {
    border: 2px solid #28a745;
    background-color: #f8fff9;
    transform: scale(1.02);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

/* Styles responsive pour la barre de recherche */
@media (max-width: 768px) {
    .search-input {
        padding: 14px 16px;
        font-size: 14px;
    }
}

/* Styles pour les produits suivis en lignes */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.product-row {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    border: 1px solid #e9ecef;
    padding: 20px;
    display: grid;
    grid-template-columns: 80px 2fr 120px 120px 150px;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.product-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.product-row-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    flex-shrink: 0;
}

.product-row-info {
    flex: 1;
    min-width: 0;
}

.product-row-price-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
    min-width: 120px;
}

.price-unit {
    font-size: 1.1rem;
    color: #495057;
    font-weight: 600;
}

.price-unavailable {
    font-size: 0.95rem;
    color: #6c757d;
    font-style: italic;
}

/* Section prix total à droite */
.product-row-price-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
    min-width: 120px;
}

.product-row-price-total .price-total {
    font-size: 1.1rem;
    color: #28a745;
    font-weight: 700;
}

.product-row-price-total .price-unavailable {
    font-size: 0.95rem;
    color: #6c757d;
    font-style: italic;
}

.product-row-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 1.4;
}

.product-row-price {
    font-size: 1.2rem;
    color: #007bff;
    font-weight: 700;
    margin-bottom: 4px;
}

.product-row-updated {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0;
}

.product-row-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.product-row-actions .btn {
    padding: 8px 16px;
    font-size: 0.875rem;
    white-space: nowrap;
}

.product-row-actions .subscription-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #f8f9fa;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* Responsive pour les produits en lignes */
@media (max-width: 768px) {
    .product-row {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 16px;
    }
    
    .product-row-price-center {
        min-width: auto;
        width: 100%;
    }
    
    .product-row-price-total {
        min-width: auto;
        width: 100%;
    }
    
    .product-row-image {
        width: 60px;
        height: 60px;
    }
    
    .product-row-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Styles pour les actions des cartes de produits */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 16px;
    justify-content: center;
    align-items: center;
}

/* Bouton "Voir" plus petit, aligné à gauche */
.product-actions .btn-outline-primary {
    align-self: flex-start;
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Bouton "Suivre" centré en bas */
.product-actions .btn-follow {
    align-self: stretch;
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    border-radius: 8px;
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-weight: 500;
}

.product-actions .btn-follow:hover {
    background-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* Assurer que la carte utilise flexbox pour pousser les actions vers le bas */
.product-card {
    display: flex;
    flex-direction: column;
}

.product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Styles spécifiques pour les boutons dans les cartes */
.product-card .btn-outline-primary {
    border: 1px solid #007bff;
    color: #007bff;
    background-color: transparent;
}

.product-card .btn-outline-primary:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* Override pour les boutons dans les actions de cartes */
.product-actions .btn {
    margin: 0;
}

/* Assurer que les contrôles de subscription temporaires sont bien centrés */
.product-actions .subscription-controls {
    align-self: center;
    width: 80%;
    max-width: 150px;
    justify-content: center;
}

/* Styles pour les liens de noms de produits */
.product-name-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.2s ease;
}

.product-name-link:hover {
    text-decoration: none;
    color: #007bff;
}

.product-name-link .product-name {
    cursor: pointer;
}

.product-name-link .product-row-name {
    cursor: pointer;
    transition: color 0.2s ease;
}

.product-name-link:hover .product-name,
.product-name-link:hover .product-row-name {
    color: #007bff;
}

/* Styles mise à jour pour les actions sans bouton Voir */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 16px;
    justify-content: center;
    align-items: center;
}

/* Mise à jour du bouton Suivre pour occuper plus d'espace */
.product-actions .btn-follow {
    align-self: stretch;
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    border-radius: 8px;
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-weight: 500;
}

.product-actions .btn-follow:hover {
    background-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* Styles pour les notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.notification.success {
    background-color: #28a745;
}

.notification.error {
    background-color: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Styles pour l'état vide */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    margin-top: 20px;
}

.empty-state h3 {
    color: #6c757d;
    margin-bottom: 16px;
    font-size: 1.5rem;
}

.empty-state p {
    color: #6c757d;
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Styles pour les contrôles de quantité temporaires */
.temp-quantity-controls {
    margin-top: 12px;
}

.temp-quantity-controls .quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

/* Statistiques de la collection */
.collection-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 24px;
    margin: 0 auto;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: #fff;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Style pour le total par produit */
.product-row-total {
    font-weight: bold;
    color: #28a745;
    font-size: 1.1rem;
    margin-top: 4px;
}

.product-row-price {
    color: #6c757d;
    font-size: 0.9rem;
}

/* ===== STYLES POUR LES CARTES DE COLLECTION ===== */

.collection-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    border: 1px solid #e9ecef;
    padding: 20px;
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    /* Pas de hauteur fixe - laissons les cartes s'adapter naturellement */
}

.collection-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    /* Pas de transform pour éviter les chevauchements */
}

/* Amélioration de la structure des cartes de collection */
.collection-card .product-image {
    margin-bottom: 16px;
    width: 100%;
    height: 120px;
    object-fit: contain;
    background-color: #f8f9fa;
    border-radius: 8px;
    flex-shrink: 0;
}

.collection-card .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Styles pour le nom du produit dans les cartes de collection */
.collection-card .product-name {
    font-size: 1.0rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.3;
    height: 2.6em; /* Fixe la hauteur pour exactement 2 lignes */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.collection-card .product-name-link {
    text-decoration: none;
    color: inherit;
}

.collection-card .product-name-link:hover .product-name {
    color: #007bff;
    transition: color 0.2s ease;
}

.collection-pricing {
    margin: 12px 0;
    min-height: 75px; /* Hauteur minimum pour uniformiser */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.collection-pricing .price-unit {
    font-size: 0.95rem;
    color: #28a745;
    margin-bottom: 4px;
    font-weight: 700;
}

.collection-pricing .price-total {
    font-size: 1.1rem;
    color: #495057;
    font-weight: 500;
    margin-bottom: 6px;
}

.collection-pricing .price-updated {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
}

.collection-pricing .price-unavailable {
    font-size: 0.9rem;
    color: #dc3545;
    font-weight: 500;
}

/* Styles pour la section prix d'achat */
.purchase-price-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
}

.purchase-price-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 6px;
    font-weight: 500;
}

.purchase-price-input-container {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.purchase-price-input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: #fff;
    outline: none;
    transition: border-color 0.2s ease;
}

.purchase-price-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.purchase-price-input::placeholder {
    color: #adb5bd;
    font-style: italic;
}

.currency {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.purchase-total {
    font-size: 0.9rem;
    color: #17a2b8;
    font-weight: 600;
    margin-top: 4px;
}

.admin-controls {
    margin-bottom: 10px;
}

/* Styles pour les statistiques avec plus/moins value */
.profit-positive {
    color: #28a745 !important;
}

.profit-negative {
    color: #dc3545 !important;
}

.collection-card .product-actions {
    margin-top: auto;
    padding-top: 16px;
    flex-shrink: 0;
}

/* Ajustements pour les produits grid dans la collection */
#collectionGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 20px;
    /* Utilisation d'une grille avec hauteurs automatiques mais alignées */
    grid-auto-rows: minmax(min-content, max-content);
    align-items: stretch;
}

/* Responsive pour les cartes de collection */
@media (max-width: 768px) {
    #collectionGrid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .collection-card {
        padding: 16px;
    }
    
    .collection-pricing .price-unit {
        font-size: 0.9rem;
    }
    
    .collection-pricing .price-total {
        font-size: 1.0rem;
    }
}

@media (max-width: 480px) {
    #collectionGrid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .collection-card {
        padding: 14px;
    }
}

/* Styles pour la section des graphiques supprimés - pas besoin de cadre */

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.chart-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
}

.chart-controls select {
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background-color: #ffffff;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 250px;
}

.chart-controls select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.chart-controls select:hover {
    border-color: #cbd5e0;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 16px;
    box-sizing: border-box;
    overflow: hidden;
}

.chart-container canvas {
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
}

/* Responsive pour les graphiques */
@media (max-width: 768px) {
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-controls select {
        min-width: 100%;
        width: 100%;
    }
      .chart-container {
        height: 300px;
        padding: 12px;
    }
}

/* ===== Onglets Produits (Scellé / Cartes) ===== */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    background: #f1f3f5;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    border-radius: 8px;
    transition: all .2s ease;
    position: relative;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.tab-btn.active {
    background: #ffffff;
    color: #007bff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tab-btn.active:after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 4px;
    height: 3px;
    background: linear-gradient(90deg,#007bff,#28a745);
    border-radius: 2px;
}

/* Tab content (réutilise .tab-content.global) */
.tab-content {
    animation: fadeIn .25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .chart-container {
        height: 250px;
        padding: 8px;
    }
    
    .chart-header h2 {
        font-size: 1.25rem;
    }
}

/* Styles pour la section historique */
.history-section {
    margin-top: 2rem;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.history-section h2 {
    margin: 0 0 1.5rem 0;
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.price-history-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.price-history-table th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
}

.price-history-table td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.price-history-table tbody tr:hover {
    background-color: #f8f9fa;
}

.price-history-table .price {
    font-weight: 600;
    color: #28a745;
    font-size: 1.1rem;
}

.price-history-table a {
    color: #007bff;
    text-decoration: none;
}

.price-history-table a:hover {
    text-decoration: underline;
}

.no-data {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.no-data h3 {
    margin: 0 0 1rem 0;
    color: #495057;
}

/* Responsive pour les tableaux */
@media (max-width: 768px) {
    .history-section {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .price-history-table th,
    .price-history-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .price-history-table th:nth-child(4),
    .price-history-table td:nth-child(4) {
        display: none; /* Masquer la colonne source sur mobile */
    }
}