/* ═══════════════════════════════════════════════════════════════
   [Marketplace-Responsive] STYLES RESPONSIVE COMPLET
   NautiSphere Pro - Espace Vendeur
   Mobile First Approach
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────
   [Marketplace-Responsive] VARIABLES CSS
   ───────────────────────────────────────────────────────────────── */

:root {
    --mp-sidebar-width: 260px;
    --mp-sidebar-collapsed: 72px;
    --mp-header-height: 88px; /* Harmonisé avec nexus-skipper-ai.html (56px logo + 32px padding) */
    --mp-header-height-mobile: 72px; /* Harmonisé : 48px logo + 24px padding */
    --mp-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --mp-overlay-bg: rgba(0, 0, 0, 0.5);
    --mp-primary: #0f172a;
    --mp-accent: #0891b2;
    --mp-accent-light: #06b6d4;

    /* ═══════════════════════════════════════════════════════════════
       [Navbar-Identity] Variables harmonisées avec nexus-skipper-ai.html
       Pilotables via admin sliders
       ═══════════════════════════════════════════════════════════════ */
    --navbar-gap-logo-title: 16px;       /* margin-left, supporte -10px à +50px */
    --navbar-gap-title-slogan: 0px;      /* margin-top slogan */
    --navbar-margin-left: 0px;           /* padding-left brand area */
    --navbar-vertical-offset: 0px;       /* margin-top text container */
    /* --navbar-logo-size RETIRÉE le 2026-08-18 : la géométrie du carré de
       marque vient de --nexus-brand-mark-size-public / -pro
       (css/nexus-responsive-nav.css), source unique pour les cinq portails.
       Elle n'avait plus qu'un usage, retiré dans le même commit. */
    --navbar-logo-radius: 8px;           /* rounded-lg */
    --navbar-title-size: 1.125rem;       /* text-lg = 18px */
    --navbar-title-bold-weight: 700;
    --navbar-title-light-weight: 300;
    --navbar-slogan-size: 0.75rem;       /* text-xs = 12px */
    --navbar-slogan-color: #6b7280;      /* text-gray-500 */
    --navbar-logo-gradient-from: #06b6d4; /* cyan-500 */
    --navbar-logo-gradient-to: #2563eb;   /* blue-600 */
}

/* ─────────────────────────────────────────────────────────────────
   [Marketplace-Responsive] LAYOUT PRINCIPAL
   ───────────────────────────────────────────────────────────────── */

.marketplace-container,
.marketplace-wrapper {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    background: #f8fafc;

    /* ─────────────────────────────────────────────────────────────
       COMPENSATION DU HEADER FIXE — SOURCE UNIQUE

       Le header est en `position: fixed` : il ne pousse rien. Sa hauteur
       doit être rendue au flux, et elle l'est ICI, une seule fois, par la
       variable qui pilote déjà `.mp-header { height }`. Elle suit donc
       automatiquement la surcharge à 5rem sous 768px (css/sphere-nav.css).

       Ne compensez le header nulle part ailleurs. Cette hauteur était
       auparavant comptée deux fois — `pt-16 md:pt-20` sur ce wrapper ET
       `margin-top` sur `.mp-main-content` — trois fois sous 768px, où les
       blocs mobiles la rajoutaient dans un `padding-top: calc()`. 80px
       d'air en trop au-dessus du premier bloc, 160px sous 768px.

       Le wrapper est en flex et ses autres enfants (aside) sont en fixed :
       ce padding ne déplace que <main>, seul enfant en flux. Même
       mécanisme que PRO et BUSINESS depuis 5c7f5ff.

       DIVERGENCE ASSUMEE AVEC PRO ET BUSINESS À PARTIR DE 1280px.
       Leurs wrappers portent `xl:pt-0` : leur header est révélé par un
       @media (max-width: 1279px), il disparaît au-delà, donc toute
       compensation y deviendrait de l'air en trop. Le header de sphere,
       lui, n'est masqué à AUCUNE largeur — `.mp-header` n'a pas une seule
       règle de masquage. La compensation doit donc rester active jusqu'en
       haut de l'échelle. N'ajoutez pas d'annulation à 1280 par symétrie
       avec les deux autres portails : elle ferait passer le contenu sous
       le header. Les structures diffèrent parce que les headers diffèrent ;
       l'air final, lui, est identique aux trois portails (32px).

       La respiration du contenu, elle, appartient à <main> et à lui seul
       (`p-4 md:p-6 lg:p-8`). Une intention, une déclaration.
       ───────────────────────────────────────────────────────────── */
    padding-top: var(--mp-header-height);
}

/* ─────────────────────────────────────────────────────────────────
   [Marketplace-Responsive] HEADER
   ───────────────────────────────────────────────────────────────── */

.marketplace-header,
.mp-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mp-header-height);
    background: white;
    border-bottom: 1px solid #e2e8f0;
    z-index: 40;
    padding: 0 16px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-toggle-btn,
.mp-menu-toggle {
    display: none; /* Visible sur mobile/tablette */
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #374151;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.menu-toggle-btn:hover,
.mp-menu-toggle:hover {
    background: #f3f4f6;
}

.menu-toggle-btn:focus-visible,
.mp-menu-toggle:focus-visible {
    outline: 2px solid var(--mp-accent);
    outline-offset: 2px;
}

.header-logo,
.mp-header-logo {
    display: flex;
    align-items: center;
    /* gap contrôlé via inline style et CSS var --navbar-gap-logo-title */
    text-decoration: none;
}

/* PAS DE width / height ICI. La géométrie du carré de marque est portée par
   css/nexus-responsive-nav.css, source unique pour les cinq portails. Cette
   règle ne décrit plus que son APPARENCE — dégradé, rayon, typo de la lettre —
   c'est-à-dire ce qui s'affiche quand aucune image de logo n'est configurée.
   Les deux notions ont été confondues jusqu'au 2026-08-18 : ce sont les 56px
   d'ici qui étaient en concurrence à spécificité égale avec la règle générique,
   égalité tranchée par le seul ordre de chargement. Ne pas réintroduire. */
.header-logo .logo-icon,
.mp-header-logo .logo-icon {
    background: linear-gradient(135deg, var(--navbar-logo-gradient-from, #06b6d4), var(--navbar-logo-gradient-to, #2563eb));
    border-radius: var(--navbar-logo-radius, 8px); /* rounded-lg comme skipper-ai */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); /* shadow-lg */
}

.header-logo .logo-text,
.mp-header-logo .logo-text {
    display: flex;
    flex-direction: column;
}

.header-logo .logo-title,
.mp-header-logo .logo-title {
    font-size: var(--navbar-title-size, 1.125rem); /* text-lg comme skipper-ai */
    line-height: 1.2;
    color: #1f2937; /* text-gray-800 comme skipper-ai */
}

/* Harmonisation title-main et title-complement avec skipper-ai */
.mp-header-logo .title-main {
    font-weight: var(--navbar-title-bold-weight, 700);
}

.mp-header-logo .title-complement {
    font-weight: var(--navbar-title-light-weight, 300);
    opacity: 0.85;
}

/* Slogan harmonisé avec skipper-ai */
.mp-header-logo .logo-text p,
.mp-header-logo #marketplace-slogan {
    font-size: var(--navbar-slogan-size, 0.75rem) !important;
    color: var(--navbar-slogan-color, #6b7280) !important; /* text-gray-500 comme skipper-ai */
    margin-top: 0;
}

.header-logo .logo-subtitle,
.mp-header-logo .logo-subtitle {
    font-size: 0.75rem;
    color: #64748b;
}

.header-right,
.mp-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-chat,
.mp-btn-chat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #001e57, #00b9d1);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}

.btn-chat:hover,
.mp-btn-chat:hover {
    box-shadow: 0 4px 12px rgba(0, 185, 209, 0.3);
    transform: translateY(-1px);
}

.btn-notifications,
.mp-btn-icon {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn-notifications:hover,
.mp-btn-icon:hover {
    background: #f1f5f9;
    color: #334155;
}

.notification-badge,
.mp-notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.profile-btn:hover {
    background: #f8fafc;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.profile-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e293b;
}

.profile-email {
    font-size: 0.75rem;
    color: #64748b;
}

.profile-chevron {
    color: #94a3b8;
}

/* ─────────────────────────────────────────────────────────────────
   [Marketplace-Responsive] SIDEBAR
   ───────────────────────────────────────────────────────────────── */

.marketplace-sidebar,
.mp-sidebar {
    position: fixed;
    top: var(--mp-header-height);
    left: 0;
    bottom: 0;
    width: var(--mp-sidebar-width);
    background: white;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    z-index: 45;
    transition: transform var(--mp-transition), width var(--mp-transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header,
.mp-sidebar-header {
    display: none; /* Visible sur mobile */
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #001e57, #00b9d1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo .logo-icon,
.mp-sidebar-header .logo-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}

.sidebar-logo .logo-title,
.mp-sidebar-header .logo-title {
    color: white;
    font-weight: 600;
}

.sidebar-close-btn,
.mp-sidebar-close {
    display: flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar-close-btn:hover,
.mp-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-nav,
.mp-sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item,
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.nav-item:hover,
.sidebar-link:hover {
    background: #f3f4f6;
    color: #1e293b;
}

.nav-item.active,
.sidebar-link.active {
    background: #e6f7fb;
    color: #001e57;
    border-left: 4px solid #00b9d1;
    margin-left: -4px;
    padding-left: 16px;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e5e7eb;
    color: #374151;
}

.nav-badge.pro {
    background: var(--mp-accent);
    color: white;
}

.nav-badge.credits {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.nav-separator {
    height: 1px;
    background: #e5e7eb;
    margin: 16px 0;
}

.sidebar-footer,
.mp-sidebar-footer {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
}

.sidebar-version {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Overlay */
.sidebar-overlay,
.mp-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--mp-overlay-bg);
    backdrop-filter: blur(2px);
    z-index: 44;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--mp-transition), visibility var(--mp-transition);
}

.sidebar-overlay.is-visible,
.mp-sidebar-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ─────────────────────────────────────────────────────────────────
   [Marketplace-Responsive] CONTENU PRINCIPAL
   ───────────────────────────────────────────────────────────────── */

/* RESPIRATION DU CONTENU — pilotée par <main> lui-même.
   Ni `margin-top` ni `padding` verticaux ici : la compensation du header
   appartient à `.marketplace-wrapper`, et la respiration aux utilitaires
   `p-4 md:p-6 lg:p-8` déjà portés par <main> (nexus-sphere.html:1812).
   C'est l'échelle 16/24/32 de PRO et BUSINESS. Redéclarer un padding ici
   l'écraserait : cette feuille est chargée après le CDN Tailwind. */
.marketplace-main,
.mp-main-content {
    flex: 1;
    margin-left: var(--mp-sidebar-width);
    min-width: 0;
    transition: margin-left var(--mp-transition);
}

.content-section {
    display: none;
}

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

.section-header,
.mp-section-header {
    margin-bottom: 24px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #001e57, #00b9d1);
    border-radius: 16px;
    color: white;
}

.section-title,
.mp-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.section-subtitle,
.mp-section-subtitle {
    margin-top: 4px;
    font-size: 0.875rem;
    opacity: 0.9;
}

/* ─────────────────────────────────────────────────────────────────
   [Marketplace-Responsive] CARDS D'ACTIONS RAPIDES
   ───────────────────────────────────────────────────────────────── */

.quick-actions-grid,
.mp-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.quick-action-card,
.mp-quick-action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 12px;
    color: white;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.action-primary {
    background: linear-gradient(135deg, #001e57, #00b9d1);
}

.action-secondary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.action-tertiary {
    background: linear-gradient(135deg, #10b981, #059669);
}

.action-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-text {
    display: flex;
    flex-direction: column;
}

.action-title {
    font-weight: 600;
    font-size: 1rem;
}

.action-subtitle {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* ─────────────────────────────────────────────────────────────────
   [Marketplace-Responsive] CARDS STATISTIQUES
   ───────────────────────────────────────────────────────────────── */

.stats-grid,
.mp-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card,
.mp-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-card-highlight {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-color: #a7f3d0;
}

.stat-icon,
.mp-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-blue {
    background: #dbeafe;
    color: #2563eb;
}

.stat-icon-cyan {
    background: #cffafe;
    color: #0891b2;
}

.stat-icon-amber {
    background: #fef3c7;
    color: #d97706;
}

.stat-icon-green {
    background: #d1fae5;
    color: #059669;
}

.stat-icon-purple {
    background: #ede9fe;
    color: #7c3aed;
}

.stat-content,
.mp-stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label,
.mp-stat-label {
    font-size: 0.875rem;
    color: #64748b;
}

.stat-sublabel {
    font-size: 0.75rem;
    color: #94a3b8;
}

.stat-value,
.mp-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 4px;
}

.stat-value-large {
    font-size: 2rem;
}

/* ─────────────────────────────────────────────────────────────────
   [Marketplace-Responsive] GRAPHIQUES
   ───────────────────────────────────────────────────────────────── */

.charts-grid,
.mp-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card,
.mp-chart-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.chart-header,
.mp-chart-header {
    margin-bottom: 16px;
}

.chart-title,
.mp-chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.chart-container,
.mp-chart-container {
    height: 200px;
    position: relative;
}

/* ─────────────────────────────────────────────────────────────────
   [Marketplace-Responsive] MESSAGES RÉCENTS
   ───────────────────────────────────────────────────────────────── */

.recent-section,
.mp-recent-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.recent-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.recent-link {
    font-size: 0.875rem;
    color: var(--mp-accent);
    text-decoration: none;
    font-weight: 500;
}

.recent-link:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════
   [Marketplace-Responsive] RESPONSIVE : MOBILE (< 640px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 639px) {

    /* Header — masquer hamburger et Skipper AI < lg (grille Vue d'ensemble remplace) */
    .menu-toggle-btn,
    .mp-menu-toggle {
        display: none !important;
    }

    .btn-chat,
    .mp-btn-chat {
        display: none !important;
    }

    .header-logo .logo-text,
    .mp-header-logo .logo-text {
        display: none;
    }

    .btn-chat .btn-text,
    .mp-btn-chat .btn-text {
        display: none;
    }

    .btn-chat,
    .mp-btn-chat {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }

    .profile-info {
        display: none;
    }

    .profile-chevron {
        display: none;
    }

    .profile-btn {
        padding: 6px;
        border: none;
    }

    /* Sidebar en overlay */
    .marketplace-sidebar,
    .mp-sidebar {
        top: 0;
        transform: translateX(-100%);
        width: 280px;
    }

    .marketplace-sidebar.is-open,
    .mp-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }

    .sidebar-header,
    .mp-sidebar-header {
        display: flex;
    }

    .sidebar-close-btn,
    .mp-sidebar-close {
        display: flex;
    }

    .sidebar-overlay.is-visible,
    .mp-sidebar-overlay.is-visible {
        display: block;
    }

    /* Contenu principal */
    /* Padding retiré : il rejouait la compensation du header dans un
       `calc()`, alors que `.marketplace-wrapper` la porte déjà. Seule la
       marge gauche reste à annuler ici (sidebar masquée). La respiration
       vient de `p-4` sur <main>. */
    .marketplace-main,
    .mp-main-content,
    .mp-main-content.ml-64,
    #marketplace-main.ml-64 {
        margin-left: 0 !important;
    }

    /* Section header */
    .section-header,
    .mp-section-header {
        padding: 16px;
        border-radius: 12px;
    }

    .section-title,
    .mp-section-title {
        font-size: 1.25rem;
    }

    /* Actions rapides en colonne */
    .quick-actions-grid,
    .mp-quick-actions {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .quick-action-card,
    .mp-quick-action-card {
        padding: 16px;
    }

    .action-icon {
        width: 40px;
        height: 40px;
    }

    /* Stats en grille 2x2 */
    .stats-grid,
    .mp-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card,
    .mp-stat-card {
        padding: 16px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .stat-icon,
    .mp-stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-value,
    .mp-stat-value {
        font-size: 1.25rem;
    }

    .stat-value-large {
        font-size: 1.5rem;
    }

    /* Graphiques en colonne */
    .charts-grid,
    .mp-charts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .chart-container,
    .mp-chart-container {
        height: 180px;
    }

    /* Body scroll lock */
    body.mp-sidebar-open {
        overflow: hidden;
    }
}

/* ═══════════════════════════════════════════════════════════════
   [Marketplace-Responsive] RESPONSIVE : TABLETTE PORTRAIT (640px - 767px)
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 640px) and (max-width: 767px) {

    /* Masquer hamburger et Skipper AI < lg */
    .menu-toggle-btn,
    .mp-menu-toggle {
        display: none !important;
    }

    .btn-chat,
    .mp-btn-chat {
        display: none !important;
    }

    .header-logo .logo-subtitle,
    .mp-header-logo .logo-subtitle {
        display: none;
    }

    /* Sidebar en overlay */
    .marketplace-sidebar,
    .mp-sidebar {
        top: 0;
        transform: translateX(-100%);
    }

    .marketplace-sidebar.is-open,
    .mp-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }

    .sidebar-header,
    .mp-sidebar-header {
        display: flex;
    }

    .sidebar-close-btn,
    .mp-sidebar-close {
        display: flex;
    }

    .sidebar-overlay.is-visible,
    .mp-sidebar-overlay.is-visible {
        display: block;
    }

    /* Contenu principal */
    /* Idem 640-767 : la compensation vivait dans le `calc()`, elle est
       désormais sur le wrapper. Respiration = `p-4` sur <main>, soit 16px,
       la valeur de PRO et BUSINESS sous 768px (les 20px propres à sphere
       étaient un écart, pas une intention). */
    .marketplace-main,
    .mp-main-content,
    .mp-main-content.ml-64,
    #marketplace-main.ml-64 {
        margin-left: 0 !important;
    }

    /* Actions rapides */
    .quick-actions-grid,
    .mp-quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-actions-grid .quick-action-card:last-child,
    .mp-quick-actions .mp-quick-action-card:last-child {
        grid-column: span 2;
    }

    /* Stats */
    .stats-grid,
    .mp-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Graphiques */
    .charts-grid,
    .mp-charts-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   [Marketplace-Responsive] RESPONSIVE : TABLETTE PAYSAGE (768px - 1023px)
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 768px) and (max-width: 1023px) {

    /* Masquer hamburger et Skipper AI < lg */
    .menu-toggle-btn,
    .mp-menu-toggle {
        display: none !important;
    }

    .btn-chat,
    .mp-btn-chat {
        display: none !important;
    }

    /* Sidebar entièrement masquée < lg — la grille Vue d'ensemble remplace la navigation */
    .marketplace-sidebar,
    .mp-sidebar,
    #marketplace-sidebar,
    aside.mp-sidebar,
    aside.w-64.mp-sidebar {
        transform: translateX(-100%) !important;
        width: 0 !important;
        overflow: hidden !important;
        z-index: 45;
    }

    /* Masquer les labels et badges en mode rétracté */
    .marketplace-sidebar .nav-label,
    .marketplace-sidebar .nav-badge,
    .marketplace-sidebar .sidebar-version,
    .marketplace-sidebar .sidebar-logo .logo-title,
    .mp-sidebar .nav-label,
    .mp-sidebar span.nav-label,
    .mp-sidebar [class*="badge"]:not(.hidden),
    .mp-sidebar [class*="count"],
    .mp-sidebar .mp-sidebar-footer,
    #marketplace-sidebar .nav-label,
    #marketplace-sidebar span.nav-label,
    #marketplace-sidebar [class*="badge"],
    #marketplace-sidebar [class*="count"] {
        opacity: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
        transition: opacity 0.2s, width 0.2s;
    }

    /* Masquer le footer sidebar et hr */
    .mp-sidebar .mp-sidebar-footer,
    #marketplace-sidebar .mp-sidebar-footer,
    .mp-sidebar hr,
    #marketplace-sidebar hr {
        display: none !important;
    }

    /* Expansion au hover */
    .marketplace-sidebar:hover,
    .mp-sidebar:hover,
    #marketplace-sidebar:hover,
    .marketplace-sidebar.is-open,
    .mp-sidebar.is-open,
    #marketplace-sidebar.is-open {
        width: var(--mp-sidebar-width) !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    }

    /* Afficher les labels au hover */
    .marketplace-sidebar:hover .nav-label,
    .marketplace-sidebar:hover .nav-badge,
    .marketplace-sidebar:hover .sidebar-version,
    .marketplace-sidebar:hover .sidebar-logo .logo-title,
    .mp-sidebar:hover .nav-label,
    .mp-sidebar:hover span.nav-label,
    .mp-sidebar:hover [class*="badge"]:not(.hidden),
    .mp-sidebar:hover [class*="count"],
    .mp-sidebar:hover .mp-sidebar-footer,
    #marketplace-sidebar:hover .nav-label,
    #marketplace-sidebar:hover span.nav-label,
    #marketplace-sidebar:hover [class*="badge"],
    #marketplace-sidebar:hover [class*="count"],
    .mp-sidebar.is-open .nav-label,
    .mp-sidebar.is-open [class*="badge"]:not(.hidden),
    .mp-sidebar.is-open .mp-sidebar-footer,
    #marketplace-sidebar.is-open .nav-label,
    #marketplace-sidebar.is-open [class*="badge"] {
        opacity: 1 !important;
        width: auto !important;
        padding: revert !important;
        margin: revert !important;
    }

    /* Afficher footer et hr au hover */
    .mp-sidebar:hover .mp-sidebar-footer,
    #marketplace-sidebar:hover .mp-sidebar-footer,
    .mp-sidebar:hover hr,
    #marketplace-sidebar:hover hr,
    .mp-sidebar.is-open .mp-sidebar-footer,
    #marketplace-sidebar.is-open .mp-sidebar-footer,
    .mp-sidebar.is-open hr,
    #marketplace-sidebar.is-open hr {
        display: block !important;
    }

    /* Liens sidebar centrés en mode rétracté */
    .marketplace-sidebar .nav-item,
    .marketplace-sidebar .sidebar-link,
    .mp-sidebar .sidebar-link,
    #marketplace-sidebar .sidebar-link,
    #marketplace-sidebar a.sidebar-link {
        justify-content: center !important;
        padding: 12px !important;
        gap: 0 !important;
    }

    /* Icônes centrées */
    .mp-sidebar .sidebar-link i,
    #marketplace-sidebar .sidebar-link i,
    .mp-sidebar .sidebar-link .fa,
    #marketplace-sidebar .sidebar-link .fa {
        margin: 0 auto !important;
        width: auto !important;
    }

    /* Liens sidebar au hover - retour normal */
    .marketplace-sidebar:hover .nav-item,
    .marketplace-sidebar:hover .sidebar-link,
    .mp-sidebar:hover .sidebar-link,
    #marketplace-sidebar:hover .sidebar-link,
    #marketplace-sidebar:hover a.sidebar-link,
    .mp-sidebar.is-open .sidebar-link,
    #marketplace-sidebar.is-open .sidebar-link {
        justify-content: flex-start !important;
        padding: 12px 16px !important;
        gap: 12px !important;
    }

    /* Icônes au hover - retour normal */
    .mp-sidebar:hover .sidebar-link i,
    #marketplace-sidebar:hover .sidebar-link i,
    .mp-sidebar.is-open .sidebar-link i,
    #marketplace-sidebar.is-open .sidebar-link i {
        margin: 0 !important;
    }

    /* Contenu principal - pleine largeur (sidebar masquée) */
    .marketplace-main,
    .mp-main-content,
    .mp-main-content.ml-64,
    #marketplace-main,
    #marketplace-main.ml-64,
    main.mp-main-content,
    main.ml-64 {
        margin-left: 0 !important;
        transition: margin-left var(--mp-transition);
    }

    /* Actions rapides */
    .quick-actions-grid,
    .mp-quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Stats */
    .stats-grid,
    .mp-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Graphiques */
    .charts-grid,
    .mp-charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Masquer le header sidebar sur tablette */
    .sidebar-header,
    .mp-sidebar-header {
        display: none !important;
    }

    /* Masquer le bouton close */
    .sidebar-close-btn,
    .mp-sidebar-close {
        display: none !important;
    }

    /* Overlay invisible sur tablette (sidebar fixe) */
    .sidebar-overlay,
    .mp-sidebar-overlay {
        display: none !important;
        visibility: hidden !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   [Marketplace-Responsive] RESPONSIVE : DESKTOP (1024px - 1279px)
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 1024px) and (max-width: 1279px) {

    .menu-toggle-btn,
    .mp-menu-toggle {
        display: none;
    }

    .marketplace-sidebar,
    .mp-sidebar {
        transform: translateX(0);
    }

    .sidebar-header,
    .mp-sidebar-header {
        display: none;
    }

    .sidebar-close-btn,
    .mp-sidebar-close {
        display: none;
    }

    .sidebar-overlay,
    .mp-sidebar-overlay {
        display: none !important;
    }

    /* Stats */
    .stats-grid,
    .mp-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .stat-card,
    .mp-stat-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ═══════════════════════════════════════════════════════════════
   [Marketplace-Responsive] RESPONSIVE : GRAND DESKTOP (>= 1280px)
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 1280px) {

    .menu-toggle-btn,
    .mp-menu-toggle {
        display: none;
    }

    .marketplace-sidebar,
    .mp-sidebar {
        transform: translateX(0);
    }

    .sidebar-header,
    .mp-sidebar-header {
        display: none;
    }

    .sidebar-overlay,
    .mp-sidebar-overlay {
        display: none !important;
    }

    /* Stats en ligne */
    .stats-grid,
    .mp-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .stat-card,
    .mp-stat-card {
        flex-direction: row;
        align-items: flex-start;
    }

    /* Graphiques */
    .charts-grid,
    .mp-charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ═══════════════════════════════════════════════════════════════
   [Marketplace-Responsive] ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes mp-slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes mp-slideOutLeft {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

@keyframes mp-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes mp-fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.mp-animate-slideIn {
    animation: mp-slideInLeft 0.3s ease-out forwards;
}

.mp-animate-slideOut {
    animation: mp-slideOutLeft 0.3s ease-in forwards;
}

.mp-animate-fadeIn {
    animation: mp-fadeIn 0.3s ease-out forwards;
}

/* ═══════════════════════════════════════════════════════════════
   [Marketplace-Responsive] SAFE AREAS (iPhone X+)
   ═══════════════════════════════════════════════════════════════ */

@supports (padding: env(safe-area-inset-bottom)) {
    .marketplace-sidebar,
    .mp-sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .marketplace-main,
    .mp-main-content {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
}

/* ═══════════════════════════════════════════════════════════════
   [Marketplace-Responsive] UTILITAIRES
   ═══════════════════════════════════════════════════════════════ */

/* Touch-friendly zones */
.mp-touch-target {
    min-width: 44px;
    min-height: 44px;
}

/* Hide scrollbar but keep functionality */
.mp-hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.mp-hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Focus visible pour accessibilité */
.mp-focus-visible:focus-visible {
    outline: 2px solid var(--mp-accent);
    outline-offset: 2px;
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
}

/* Prevent content shift when scrollbar appears/disappears */
html {
    overflow-y: scroll;
}

/* ═══════════════════════════════════════════════════════════════
   [Marketplace-Responsive] DARK MODE (préparation)
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
    /* Styles dark mode à implémenter si nécessaire */
}
