/* =========================================
   IMPORT FONTS - Elegant, distinctive pairing
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* =========================================
   VARIABLES CSS GLOBALES
   ========================================= */
:root {
    color-scheme: light dark;
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #eff6ff;
    --color-primary-50: #f0f7ff;
    --color-accent: #0ea5e9;
    --color-danger: #dc2626;
    --color-danger-light: #fee2e2;
    --color-success: #16a34a;
    --color-warning: #d97706;
    --color-text-main: #0f172a;
    --color-text-secondary: #334155;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --color-bg-app: #f0f4ff;
    --color-bg-card: #ffffff;
    --nav-width-desktop: 210px;
    --nav-height-mobile: 64px;
    --radius-card: 16px;
    --radius-btn: 10px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-card: 0 4px 20px rgba(37, 99, 235, 0.07), 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-nav: 1px 0 0 rgba(226, 232, 240, 0.8);
    --shadow-modal: 0 20px 60px rgba(15, 23, 42, 0.15), 0 4px 16px rgba(15, 23, 42, 0.08);
    --font-primary: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   RESET & BASE
   ========================================= */
*, *::before, *::after { box-sizing: border-box; }

.hidden { display: none !important; }

/* =========================================
   RESPONSIVE VISIBILITY HELPERS
========================================= */
@media (max-width: 767px) {
    .hide-on-mobile { display: none !important; }
}
@media (min-width: 768px) {
    .hide-on-desktop { display: none !important; }
}

body {
    font-family: var(--font-body);
    color: var(--color-text-main);
    background-color: #f0f4ff;
    background-image:
        radial-gradient(ellipse 80% 50% at 20% -20%, rgba(37, 99, 235, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 110%, rgba(14, 165, 233, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse 50% 30% at 50% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 70%);
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

/* Elegant Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1, h2, h3, h4, h5 {
    font-family: var(--font-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text-main);
    line-height: 1.2;
}

h1.text-2xl {
    font-size: 1.5rem;
    font-weight: 800; /* ExtraBold */
    margin-bottom: 1.25rem;
    color: #111827; /* Gray-900 pour un contraste fort */
    letter-spacing: -0.025em;
}

h2.text-4xl {
    font-size: 1.875rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* =========================================
   CARDS — Clean, crisp, elevated
   ========================================= */
.bg-white,
.bg-white.rounded-xl {
    background-color: #ffffff !important; /* CHANGÉ : 100% Opaque */
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: var(--shadow-card) !important;
    border-radius: var(--radius-card) !important;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.bg-white:hover,
.bg-white.rounded-xl:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06) !important;
}

/* Prevent hover lift on interactive elements */
input.bg-white, select.bg-white, button.bg-white,
table .bg-white, thead .bg-white {
    padding: revert;
    border-radius: revert;
        box-shadow: none !important;
    transform: none !important;
        background: #ffffff !important;
        border: none !important;
}

/* =========================================
   TABLES — Modern, airy
   ========================================= */
th, td {
    padding: 12px 16px;
    font-size: 0.875rem;
    transition: background-color var(--transition-fast);
}

thead th {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted);
    background-color: #f8fafc;
    border-bottom: 1px solid var(--color-border);
}

tbody tr:hover td {
    background-color: rgba(37, 99, 235, 0.025);
}

#page-rapports thead th { color: #e2e8f0; }

/* =========================================
   FORM ELEMENTS — Polished, spacious
   ========================================= */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
select {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-btn);
    background-color: #ffffff;
    color: var(--color-text-main);
    transition: all var(--transition-base);
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    -webkit-appearance: none;
    appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), 0 1px 2px rgba(15, 23, 42, 0.04);
}

input::placeholder { color: #94a3b8; }

input[readonly] {
    background-color: #f8fafc;
    color: var(--color-text-muted);
    cursor: default;
    border-color: #f1f5f9;
}

/* =========================================
   BUTTONS — Refined, confident
   ========================================= */
button {
    font-family: var(--font-primary);
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: all var(--transition-base);
}

.bg-blue-600, button.bg-blue-600 {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3) !important;
}

.bg-blue-600:hover, button.bg-blue-600:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af) !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4) !important;
    transform: translateY(-1px);
}

.bg-blue-600:active, button.bg-blue-600:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.25) !important;
}

/* =========================================
   NAVIGATION — Kweeli-style sidebar / bottom
   ========================================= */
.top-tabs {
    background: #ffffff;
    border-right: 1px solid #f1f5f9;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    padding: 0 6px;
    z-index: 50;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: background-color var(--transition-smooth), border-color var(--transition-smooth);
    box-shadow: none;
}

.top-tabs::-webkit-scrollbar { display: none; }

/* Logo area in sidebar */
.top-tabs::before {
    content: '';
    display: none;
}

.tab {
    font-family: var(--font-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    margin: 2px 1px;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-base);
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
    min-width: 58px;
    border: none;
    background: transparent;
    white-space: nowrap;
    letter-spacing: 0;
    position: relative;
}

.tab i, .tab svg {
    width: 18px;
    height: 18px;
    margin-bottom: 3px;
    flex-shrink: 0;
    transition: transform var(--transition-base);
}

.tab:hover {
    background-color: #eff6ff;
    color: var(--color-primary);
}

.tab:hover i, .tab:hover svg {
    transform: scale(1.1);
}

.tab.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(37, 99, 235, 0.06));
    color: var(--color-primary);
    box-shadow: none;
}

.tab.active::after {
    content: '';
    position: absolute;
    background: var(--color-primary);
    border-radius: 999px;
}

#bottom-logout-btn { margin-top: auto; }

#bottom-logout-btn:hover {
    background-color: #fff1f2;
    color: var(--color-danger);
}

/* =========================================
   RESPONSIVE: DESKTOP (> 768px)
   ========================================= */
@media (min-width: 768px) {
    .top-tabs {
        flex-direction: column;
        width: var(--nav-width-desktop);
        min-height: 100vh;
        height: 100vh;
        padding: 20px 10px;
        border-right: 1px solid #f1f5f9;
        overflow-x: visible;
        overflow-y: auto;
        box-shadow: 1px 0 0 #f1f5f9;
    }

    .tab {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        padding: 10px 14px;
        width: 100%;
        margin-bottom: 2px;
        font-size: 0.82rem;
        border-radius: 10px;
        min-width: auto;
    }

    .tab i, .tab svg {
        margin-bottom: 0;
        margin-right: 10px;
        width: 16px;
        height: 16px;
    }

    .tab.active {
        background: linear-gradient(135deg, #eff6ff, #dbeafe);
        color: var(--color-primary);
    }

    .tab.active::after {
        right: -10px;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 20px;
    }

    .top-tabs .flex-1 { display: block; flex-grow: 1; }

    main { padding: 1.5rem 1.75rem; }
}

/* =========================================
   RESPONSIVE: MOBILE (< 768px)
   ========================================= */
@media (max-width: 767px) {
    .top-tabs {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: var(--nav-height-mobile);
        border-top: 1px solid #f1f5f9;
        justify-content: space-around;
        padding: 0 4px;
        background: #ffffff;
        box-shadow: 0 -1px 0 #f1f5f9, 0 -4px 20px rgba(15, 23, 42, 0.06);
    }

    main {
        padding-bottom: calc(var(--nav-height-mobile) + 16px);
        padding-top: 8px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .tab {
        padding: 6px 8px;
        min-width: 52px;
    }

    .tab div { font-size: 10px; font-weight: 600; margin-top: 3px; letter-spacing: 0.01em; }

    .tab.active::after {
        top: -3px;
        left: 50%;
        transform: translateX(-50%);
        width: 24px;
        height: 3px;
    }

    .top-tabs .flex-1 { display: none; }
    #bottom-logout-btn { display: none; }

    th, td {
        padding: 8px 10px !important; /* Plus d'espace pour respirer (Touch target size) */
        font-size: max(12px, 0.8rem) !important; /* Ne jamais descendre sous 12px pour la lisibilité */
        white-space: nowrap;
    }
}

/* =========================================
   LOGIN PAGE — Premium card design
   ========================================= */
#auth-container {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0eaff 40%, #f5f0ff 100%);
    background-attachment: fixed;
}

#auth-container::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 30% 20%, rgba(37, 99, 235, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 70% 80%, rgba(14, 165, 233, 0.1) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

#auth-container > div {
    position: relative;
    z-index: 1;
    background: #ffffff !important;
    border: 1px solid var(--color-border) !important;
    box-shadow: 0 24px 64px rgba(37, 99, 235, 0.12), 0 4px 16px rgba(15, 23, 42, 0.08) !important;
    border-radius: 24px !important;
    transform: none !important;
}

#auth-container > div:hover {
    transform: none !important;
    box-shadow: 0 24px 64px rgba(37, 99, 235, 0.12), 0 4px 16px rgba(15, 23, 42, 0.08) !important;
}

/* =========================================
   GLOBAL SEARCH — Kweeli-style pill
   ========================================= */
#global-search-container {
    background-color: #ffffff !important;
    border-bottom: 1px solid rgba(241, 245, 249, 0.8) !important;
    padding: 10px 16px;
}

#global-search-input {
    border-radius: 999px !important;
    border: 1.5px solid #e2e8f0 !important;
    background: #ffffff !important;
    padding-left: 3rem !important;
    font-size: 0.9375rem !important;
    font-family: var(--font-body) !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06) !important;
    transition: all var(--transition-base) !important;
    height: 46px;
}

#global-search-input:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), 0 1px 4px rgba(15, 23, 42, 0.06) !important;
    background: #ffffff !important;
}

#global-search-container i {
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

#global-search-results {
    border-radius: 16px !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12) !important;
    overflow: hidden;
    margin-top: 6px !important;
}

/* =========================================
   SHOP HEADER — Refined top bar
   ========================================= */
#global-shop-header {
    background: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 10px 20px !important;
}

/* =========================================
   PAGE CONTENT — Generous spacing
   ========================================= */
.page-content {
    padding: 1.25rem 1.25rem;
    animation: pageIn 0.2s ease forwards;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   DASHBOARD STATS CARDS — KPI pills
   ========================================= */
#page-dashboard .grid > div {
    border-radius: 16px !important;
    padding: 20px !important;
    position: relative;
    overflow: hidden;
}

#page-dashboard .grid > div::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.06;
    background: currentColor;
}

/* =========================================
   DELETED ROWS
   ========================================= */
.deleted-row {
    background-color: #f8fafc;
    color: #9ca3af;
    text-decoration: line-through;
    font-style: italic;
    pointer-events: none;
}

.deleted-row button { display: none; }

/* =========================================
   UTILITY ANIMATIONS
   ========================================= */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* =========================================
   STATUS BADGES
   ========================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-primary);
    letter-spacing: 0.02em;
    line-height: 1.5;
}

.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-orange { background: #fff7ed; color: #c2410c; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-gray   { background: #f1f5f9; color: #475569; }

/* =========================================
   SCANNER
   ========================================= */
#reader, #reader a, #reader button { color: #ffffff !important; }

.viewfinder-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.viewfinder-box {
    width: 75%;
    height: 50%;
    border: 2px solid rgba(37, 99, 235, 0.9);
    border-radius: 16px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    position: relative;
}

.viewfinder-box::before, .viewfinder-box::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: #2563eb;
    border-style: solid;
}

.viewfinder-box::before {
    top: -2px; left: -2px;
    border-width: 3px 0 0 3px;
    border-radius: 10px 0 0 0;
}

.viewfinder-box::after {
    bottom: -2px; right: -2px;
    border-width: 0 3px 3px 0;
    border-radius: 0 0 10px 0;
}

.scan-line {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #2563eb, #60a5fa, transparent);
    animation: scan-anim 2.5s ease-in-out infinite;
    border-radius: 1px;
}

@keyframes scan-anim {
    0%   { top: 5%; opacity: 1; }
    50%  { top: 90%; opacity: 0.8; }
    100% { top: 5%; opacity: 1; }
}

.scan-feedback {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 18px;
    border-radius: 999px;
    color: white;
    font-weight: 700;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    z-index: 10;
    backdrop-filter: blur(8px);
    transition: opacity 0.5s;
    white-space: nowrap;
}

/* Engrenages Loader */
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes spin-reverse-slow {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

.animate-spin-slow {
    animation: spin-slow 4s linear infinite;
}
.animate-spin-reverse-slow {
    animation: spin-reverse-slow 4s linear infinite;
}

/* =========================================
   MODALS — Polished overlays
   ========================================= */
[id$="-modal"] > .bg-white,
[id$="-modal"] > div > .bg-white {
    border-radius: 20px !important;
    border: 1px solid rgba(226, 232, 240, 0.6) !important;
    box-shadow: var(--shadow-modal) !important;
    transform: none !important;
}

[id$="-modal"] > .bg-white:hover,
[id$="-modal"] > div > .bg-white:hover {
    transform: none !important;
    box-shadow: var(--shadow-modal) !important;
}

/* =========================================
   DARK MODE
   ========================================= */
body.dark {
    --color-text-main: #f1f5f9;
    --color-text-secondary: #cbd5e1;
    --color-text-muted: #94a3b8;
    --color-border: #1e293b;
    --color-bg-app: #020617;
    --color-bg-card: #0f172a;
    --color-primary-light: rgba(59, 130, 246, 0.12);

    background-color: #020617;
    background-image:
        radial-gradient(ellipse 80% 50% at 20% -20%, rgba(37, 99, 235, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 110%, rgba(14, 165, 233, 0.1) 0%, transparent 55%);
}

body.dark .bg-white,
body.dark .bg-white.rounded-xl {
    background-color: #0f172a !important; /* CHANGÉ : 100% Opaque (Bleu nuit foncé) */
    border-color: rgba(30, 41, 59, 0.8) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

body.dark .bg-white:hover,
body.dark .bg-white.rounded-xl:hover {
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.2), 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

body.dark .top-tabs {
    background: #0f172a;
    border-right-color: #1e293b;
    border-top-color: #1e293b;
    box-shadow: 0 -1px 0 #1e293b;
}

body.dark .tab { color: #64748b; }
body.dark .tab:hover { background-color: rgba(37, 99, 235, 0.1); color: #60a5fa; }
body.dark .tab.active { background: rgba(37, 99, 235, 0.15); color: #60a5fa; }

body.dark #auth-container {
    background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #0c1436 100%);
}

body.dark #auth-container > div {
    background: var(--color-bg-card) !important;
    border-color: var(--color-border) !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4) !important;
}

body.dark #global-search-input {
    background: #0f172a !important;
    border-color: #1e293b !important;
    color: #f1f5f9 !important;
}

body.dark #global-search-input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

body.dark #global-search-results {
    background: #0f172a !important;
    border-color: #1e293b !important;
    color: #f1f5f9 !important;
}

body.dark #global-search-results [class*="text-gray-"],
body.dark #global-search-results [class*="text-slate-"] {
    color: #f1f5f9 !important;
}

body.dark #global-shop-header {
    background: #0f172a !important;
    border-bottom-color: #1e293b !important;
}

/* Dark mode text colors */
body.dark h1, body.dark h2, body.dark h3, body.dark h4, body.dark h5 {
    color: #f1f5f9;
}

body.dark .text-gray-800, body.dark .text-gray-900 { color: #f1f5f9 !important; }
body.dark .text-gray-700 { color: #e2e8f0 !important; }
body.dark .text-gray-600 { color: #e2e8f0 !important; } /* Plus clair et lisible */
body.dark .text-gray-500 { color: #cbd5e1 !important; } /* Plus clair et lisible */
body.dark .text-gray-400 { color: #94a3b8 !important; } /* Plus clair et lisible */

body.dark .text-slate-900, body.dark .text-slate-800 { color: #f1f5f9 !important; }
body.dark .text-slate-700, body.dark .text-slate-600 { color: #e2e8f0 !important; }
body.dark .text-slate-500 { color: #cbd5e1 !important; }
body.dark .text-slate-400 { color: #94a3b8 !important; }

/* Dark form elements */
body.dark input[type="text"],
body.dark input[type="email"],
body.dark input[type="password"],
body.dark input[type="number"],
body.dark input[type="tel"],
body.dark input[type="search"],
body.dark select {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
    color: #f1f5f9 !important;
}

body.dark input[type="text"]:focus,
body.dark input[type="email"]:focus,
body.dark input[type="password"]:focus,
body.dark input[type="number"]:focus,
body.dark input[type="tel"]:focus,
body.dark select:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

body.dark input::placeholder { color: #64748b !important; } /* Placeholder lisible */

/* Dark backgrounds */
body.dark .bg-gray-50, body.dark .bg-gray-100 { background-color: #0f172a !important; }
body.dark .bg-gray-200 { background-color: #1e293b !important; }
body.dark .bg-white.dark\:bg-slate-800\/60 { background-color: #0f172a !important; }

/* Dark table headers */
body.dark thead th, body.dark thead {
    background-color: #0f172a !important;
    color: #94a3b8 !important; /* Contraste amélioré sur fond sombre */
    border-bottom-color: #1e293b !important;
}

body.dark tbody tr:hover td { background-color: rgba(37, 99, 235, 0.04); }
body.dark .divide-y > * { border-color: #1e293b !important; }
body.dark .border-b { border-color: #1e293b !important; }
body.dark .border-t { border-color: #1e293b !important; }
body.dark .border-gray-200 { border-color: #1e293b !important; }
body.dark .border-gray-100 { border-color: #1e293b !important; }

/* Rendre le texte principal des tableaux Clients et Fournisseurs totalement blanc en mode sombre */
body.dark #credits-table-body td, body.dark #suppliers-table-body td { color: #f1f5f9 !important; }
body.dark #credits-table-body td [class*="text-gray-"], body.dark #credits-table-body td [class*="text-slate-"],
body.dark #suppliers-table-body td [class*="text-gray-"], body.dark #suppliers-table-body td [class*="text-slate-"] {
    color: #f1f5f9 !important;
}

/* Dark colored text */
body.dark .text-blue-600 { color: #60a5fa !important; }
body.dark .text-blue-700 { color: #93c5fd !important; }
body.dark .text-blue-800 { color: #93c5fd !important; }
body.dark .text-green-600 { color: #4ade80 !important; }
body.dark .text-green-700 { color: #86efac !important; }
body.dark .text-red-600 { color: #f87171 !important; }
body.dark .text-red-700 { color: #fca5a5 !important; }
body.dark .text-orange-600 { color: #fb923c !important; }
body.dark .text-orange-700 { color: #fdba74 !important; }
body.dark .text-purple-600 { color: #c084fc !important; }
body.dark .text-purple-700 { color: #d8b4fe !important; }

/* Dark colored backgrounds */
body.dark .bg-blue-50 { background-color: rgba(37, 99, 235, 0.1) !important; }
body.dark .bg-blue-100 { background-color: rgba(59, 130, 246, 0.15) !important; }
body.dark .bg-green-50 { background-color: rgba(22, 163, 74, 0.08) !important; }
body.dark .bg-green-100 { background-color: rgba(34, 197, 94, 0.15) !important; }
body.dark .bg-red-50 { background-color: rgba(220, 38, 38, 0.08) !important; }
body.dark .bg-red-100 { background-color: rgba(239, 68, 68, 0.15) !important; }
body.dark .bg-orange-50 { background-color: rgba(234, 88, 12, 0.08) !important; }
body.dark .bg-orange-100 { background-color: rgba(249, 115, 22, 0.15) !important; }
body.dark .bg-yellow-100 { background-color: rgba(234, 179, 8, 0.15) !important; }
body.dark .bg-purple-50 { background-color: rgba(124, 58, 237, 0.08) !important; }
body.dark .bg-purple-100 { background-color: rgba(139, 92, 246, 0.15) !important; }
body.dark .bg-indigo-50 { background-color: rgba(99, 102, 241, 0.08) !important; }

/* Dark table header colors */
body.dark .bg-orange-50.text-orange-900 { 
    background-color: rgba(234, 88, 12, 0.08) !important; 
    color: #fdba74 !important;
}
body.dark .bg-red-50.text-red-900 { 
    background-color: rgba(220, 38, 38, 0.08) !important; 
    color: #fca5a5 !important;
}

/* Dark modal corrections */
body.dark #dashboard-generic-modal,
body.dark #edit-product-modal,
body.dark #credit-sale-modal,
body.dark #add-client-modal,
body.dark #confirm-modal,
    body.dark #prompt-modal,
    body.dark #add-supplier-modal,
    body.dark #edit-supplier-modal,
body.dark #invoice-modal,
body.dark #momo-modal,
body.dark #order-modal,
body.dark #print-labels-modal,
body.dark #barcode-assoc-modal,
body.dark #scanner-modal {
    background-color: rgba(2, 6, 23, 0.85) !important;
    backdrop-filter: blur(8px);
}

body.dark #dashboard-generic-modal .bg-white,
body.dark #edit-product-modal .bg-white,
body.dark #credit-sale-modal .bg-white,
body.dark #add-client-modal .bg-white,
body.dark #confirm-modal .bg-white,
    body.dark #prompt-modal .bg-white,
    body.dark #add-supplier-modal .bg-white,
    body.dark #edit-supplier-modal .bg-white,
body.dark #invoice-modal .bg-white,
body.dark #momo-modal .bg-white,
body.dark #order-modal .bg-white,
body.dark #print-labels-modal .bg-white,
body.dark #barcode-assoc-modal .bg-white,
body.dark #scanner-modal .bg-white {
    background: #0f172a !important;
    border: 1px solid #1e293b !important;
}

body.dark #dashboard-generic-modal .bg-gray-50,
body.dark #edit-product-modal .bg-gray-50,
body.dark #print-labels-modal .bg-gray-50 {
    background-color: #020617 !important;
}

body.dark #edit-product-modal input,
body.dark #edit-product-modal select,
body.dark #credit-sale-modal input,
body.dark #add-client-modal input,
body.dark #momo-modal input,
body.dark #order-modal input,
body.dark #barcode-assoc-modal input,
    body.dark #barcode-assoc-modal select,
    body.dark #prompt-modal input,
    body.dark #add-supplier-modal input,
    body.dark #edit-supplier-modal input {
    background-color: #020617 !important;
    border: 1px solid #1e293b !important;
    color: #f1f5f9 !important;
}

/* Date input dark mode */
body.dark input[type="date"] {
    background-color: #0f172a !important;
    border: 1px solid #1e293b !important;
    color: #f1f5f9 !important;
    border-radius: 0.5rem;
    padding: 0.4rem;
}

body.dark input[type="date"]::-webkit-datetime-edit { color: #e2e8f0 !important; }
body.dark input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.7; cursor: pointer; }
body.dark .text-gray-400.font-bold { color: #94a3b8 !important; }

body.dark #btn-dash-filter,
body.dark #btn-filter-reports {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: #ffffff !important;
}

body.dark #caisse-initiale-input {
    background-color: #020617 !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

/* Dark current date display */
body.dark #current-date-display {
    color: #60a5fa !important;
    background-color: rgba(37, 99, 235, 0.15) !important;
    border: 1px solid rgba(37, 99, 235, 0.3) !important;
}

/* Scroll to top */
#scroll-to-top {
    border-radius: 999px !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3) !important;
}

/* =========================================
   SPECIAL COMPONENT FIXES
   ========================================= */

/* Sales page cart empty state */
#cart-table-body td.italic { font-family: var(--font-body); }

/* Empêcher le débordement horizontal du panier sur mobile */
@media (max-width: 767px) {
    #cart-table-body td:first-child {
        white-space: normal !important;
        word-break: break-word;
    }
    #pos-section-cart th,
    #cart-table-body td {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
}

/* Search results items */
.search-result-item {
    border-radius: 0;
    transition: background-color var(--transition-fast);
}

body.dark .search-result-item:hover {
    background-color: #1e293b !important;
}

/* Immersion banner */
#immersion-banner {
    background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
}

/* Subscription blocked screen */
#subscription-blocked-screen > div {
    border-radius: 24px !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2) !important;
    transform: none !important;
}

/* Date filter containers */
body.dark .flex.items-center.gap-2.bg-white,
body.dark [class*="bg-white"]:has(input[type="date"]) {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
}

/* Mobile money buttons */
.momo-net-btn.selected {
    border-color: var(--color-primary) !important;
    background: rgba(37, 99, 235, 0.06) !important;
}

/* Report page special dark */
body.dark #page-rapports thead th { color: #94a3b8; }

body.dark .bg-white.rounded-xl.shadow-sm.border-l-4.border-green-500,
body.dark .bg-white.rounded-xl.shadow-sm.border-l-4.border-red-500 {
    background-color: #0f172a !important;
}

body.dark .text-xl.font-bold.text-green-600 { color: #4ade80 !important; }
body.dark .text-xl.font-bold.text-red-600 { color: #f87171 !important; }
body.dark .text-2xl.font-bold.text-blue-800 { color: #60a5fa !important; }

   /* =========================================
   DARK MODE — TABLEAUX DANS LES MODALES
   ========================================= */

body.dark #dashboard-generic-modal tbody tr td {
    color: #e2e8f0 !important;
    background-color: #0f172a !important;
    border-bottom-color: #1e293b !important;
}

body.dark #dashboard-generic-modal tbody tr:hover td {
    background-color: #1e293b !important;
}

body.dark #dashboard-generic-modal thead th {
    background-color: #1e293b !important;
    color: #94a3b8 !important;
    border-bottom-color: #334155 !important;
}
/* =========================================
   HAMBURGER DRAWER — Mobile only
   ========================================= */

/* Sur mobile, cacher les onglets secondaires de la barre du bas */
@media (max-width: 767px) {
    .secondary-tab {
        display: none !important;
    }
}

/* Overlay sombre derrière le drawer */
.hamburger-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 150;
    transition: opacity 0.25s ease;
    opacity: 0;
}

.hamburger-overlay.open {
    display: block;
    opacity: 1;
}

/* Drawer panneau vertical */
.hamburger-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100dvh;
    background: #ffffff;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
    will-change: transform;
}

.hamburger-drawer.open {
    transform: translateX(0);
}

/* En-tête du drawer */
.hamburger-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.hamburger-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: #f8fafc;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.hamburger-close-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Corps du drawer */
.hamburger-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

/* Label de section */
.hamburger-section-label {
    font-family: var(--font-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    padding: 0 8px;
    margin: 0 0 6px 0;
}

/* Boutons du drawer */
.drawer-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #334155;
    font-family: var(--font-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    margin-bottom: 2px;
}

.drawer-tab:hover {
    background: #eff6ff;
    color: #2563eb;
}

.drawer-tab.active {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #2563eb;
}

.drawer-tab i, .drawer-tab svg {
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.drawer-tab:hover i,
.drawer-tab:hover svg {
    transform: scale(1.1);
}

/* =========================================
   DARK MODE — DRAWER
   ========================================= */
body.dark .hamburger-drawer {
    background: #0f172a;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

body.dark .hamburger-drawer-header {
    border-bottom-color: #1e293b;
}

body.dark .hamburger-close-btn {
    background: #1e293b;
    color: #94a3b8;
}

body.dark .hamburger-close-btn:hover {
    background: rgba(220, 38, 38, 0.15);
    color: #f87171;
}

body.dark .drawer-tab {
    color: #cbd5e1;
}

body.dark .drawer-tab:hover {
    background: rgba(37, 99, 235, 0.12);
    color: #60a5fa;
}

body.dark .drawer-tab.active {
    background: rgba(37, 99, 235, 0.15);
    color: #60a5fa;
}
/* =========================================
   TYPOGRAPHIE RESPONSIVE — Mobile (Kweeli style)
   Inspiré de l'app Kweeli : compact, épuré,
   hiérarchie claire entre titres et données
   ========================================= */

@media (max-width: 767px) {

    /* --- Base body --- */
    body {
        font-size: 13px !important;
        line-height: 1.5 !important;
    }

    /* --- Titres de pages (ex: "Dashboard", "Stock") --- */
    h1, .page-title {
        font-size: clamp(1.25rem, 4vw + 0.5rem, 1.5rem) !important; /* Typographie Fluide */
        font-weight: 800 !important;
        letter-spacing: -0.03em !important;
        line-height: 1.2 !important;
    }

    /* --- Sous-titres de sections --- */
    h2 {
        font-size: clamp(0.9rem, 3vw + 0.2rem, 1rem) !important; 
        font-weight: 700 !important;
        letter-spacing: -0.02em !important;
    }

    h3, h4 {
        font-size: 0.875rem !important;     /* ~14px */
        font-weight: 600 !important;
    }

    /* --- Labels KPI (CA TOTAL, COMMANDES...) --- */
    .kpi-label,
    .text-xs.uppercase,
    .stat-label,
    [class*="kpi"] .label,
    .dashboard-card .label {
        font-size: 0.65rem !important; /* Micro-typographie */
        font-weight: 700 !important;
        letter-spacing: 0.05em !important;
        text-transform: uppercase !important;
        color: #94a3b8 !important;
    }

    /* --- Valeurs KPI (montants, chiffres clés) --- */
    .kpi-value,
    .stat-value,
    .text-2xl,
    .text-3xl,
    [class*="kpi"] .value {
        font-size: clamp(1.1rem, 5vw, 1.35rem) !important; /* Fluide selon la largeur */
        font-weight: 700 !important;
        letter-spacing: -0.02em !important;
        line-height: 1.2 !important;
    }

    /* --- Boutons --- */
    button, .btn {
        font-size: 0.8125rem !important;
        font-weight: 600 !important;
    }

    /* --- Inputs et selects --- */
    input, select, textarea {
        font-size: 0.875rem !important;     /* ~14px — évite zoom auto iOS */
    }

    /* --- Navigation barre du bas --- */
    .tab div,
    .tab span {
        font-size: 0.625rem !important;     /* ~10px */
        font-weight: 600 !important;
        letter-spacing: 0.02em !important;
    }

    /* --- Icônes de navigation --- */
    .tab i, .tab svg {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }

    /* --- Badges et tags --- */
    .badge, [class*="badge"],
    .tag, [class*="tag"] {
        font-size: 0.625rem !important;
        font-weight: 700 !important;
        letter-spacing: 0.05em !important;
    }

    /* --- En-têtes de tableaux --- */
    thead th {
        font-size: 0.65rem !important;      /* Micro-typographie */
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
        color: #94a3b8 !important;
    }

    /* --- Cards / cartes --- */
    .card, [class*="card"] {
        font-size: 0.8125rem !important;
    }

    /* --- Titres dans le drawer hamburger --- */
    .hamburger-section-label {
        font-size: 0.6rem !important;
        letter-spacing: 0.1em !important;
    }

    .drawer-tab span {
        font-size: 0.875rem !important;
        font-weight: 600 !important;
    }

    /* --- Search bar placeholder --- */
    input::placeholder {
        font-size: 0.8125rem !important;
        font-weight: 400 !important;
    }

    /* --- Toast notifications --- */
    #toast-container span {
        font-size: 0.8125rem !important;
    }

    /* --- Modal titres --- */
    .modal-title,
    [id*="modal"] h2,
    [id*="modal"] h3 {
        font-size: 1rem !important;
        font-weight: 700 !important;
        letter-spacing: -0.02em !important;
    }

    /*Affichage en liste pour les graphiques*/
    .display-liste {
        display: -webkit-inline-box;
    }

    /*Redéfinition du tableau de bord pour que les cartes soit plus grand*/
    #page-dashboard .grid > div {
        grid-column: span 2;
    }

     /*Petite Polices pour le Stock faible et autre*/
     h3.font-bold.text-red-700.text-sm.group-hover\:text-red-800 {
        font-size: 16px;
    }
}

/* ═══════════════════════════════════════════════════
   DASHBOARD REDESIGN — Gradient App Mobile Style
   À ajouter à la FIN de style.css
═══════════════════════════════════════════════════ */

/* ─── ROOT ─────────────────────────────────────── */
.dash-root {
    padding: 0 !important;
    background: transparent;
}

/* ─── HERO HEADER ─────────────────────────────── */
.dash-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 20px 16px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 45%, #0ea5e9 100%);
    border-radius: 0 0 28px 28px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.dash-hero::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}

.dash-hero::after {
    content: '';
    position: absolute;
    bottom: -30px; left: 30%;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}

.dash-hero-left { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.dash-hero-right { position: relative; z-index: 1; }

/* Force le filtre de date à prendre toute la largeur et se centrer sur mobile */
@media (max-width: 767px) {
    .dash-hero-right {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 4px;
    }
}

.dash-hero-brand { display: flex; align-items: center; gap: 14px; }

.dash-logo {
    width: 48px; height: 48px;
    border-radius: 14px;
    object-fit: contain;
    background: rgba(255,255,255,0.15);
    padding: 4px;
    border: 2px solid rgba(255,255,255,0.25);
}

.dash-greeting {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255,255,255,0.75);
    margin: 0 0 2px;
    letter-spacing: 0.01em;
}

.dash-shopname {
    font-family: var(--font-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    margin: 0 !important;
    letter-spacing: -0.025em !important;
    line-height: 1.1 !important;
}

/* Date filter dans le hero */
.dash-date-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 6px 10px;
    backdrop-filter: blur(8px);
}

.dash-date-input {
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    outline: none !important;
    box-shadow: none !important;
    width: 110px;
    padding: 0 !important;
}

.dash-date-input::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.7; cursor: pointer; }
.dash-date-sep { color: rgba(255,255,255,0.6); font-size: 0.8rem; }

.dash-filter-btn {
    background: rgba(255,255,255,0.2) !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    padding: 6px 8px !important;
    display: flex;
    align-items: center;
    box-shadow: none !important;
    transition: background 0.15s ease;
}

.dash-filter-btn:hover {
    background: rgba(255,255,255,0.3) !important;
    transform: none !important;
}

/* ─── TRIAL BANNER ────────────────────────────── */
.dash-trial {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 16px 16px;
    padding: 10px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

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

.dash-trial-text { flex: 1; }

.dash-trial-badge {
    background: rgba(255,255,255,0.9);
    color: #d97706;
    font-weight: 800;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.dash-trial-close {
    background: transparent !important;
    border: none !important;
    color: rgba(255,255,255,0.7) !important;
    padding: 4px !important;
    box-shadow: none !important;
}

.dash-trial-close:hover { color: #ffffff !important; transform: none !important; }

/* ─── KPI GRID ────────────────────────────────── */
.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 16px;
    margin-bottom: 20px;
}

/* Carte KPI — base */
.kpi-card {
    border-radius: 18px !important;
    padding: 16px !important;
    position: relative;
    overflow: hidden;
    border: none !important;
    transform: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    cursor: default;
}

.kpi-card:hover {
    transform: translateY(-3px) !important;
}

/* Barre décorative du bas */
.kpi-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 0 0 18px 18px;
    opacity: 0.5;
}

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.kpi-icon-wrap {
    width: 38px; height: 38px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 999px;
}

.kpi-value {
    font-family: var(--font-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 1.35rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
    line-height: 1.1 !important;
    margin-bottom: 4px;
}

.kpi-label {
    font-size: 0.68rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.07em !important;
    opacity: 0.65;
}

/* Couleurs par variante */
.kpi-slate { background: linear-gradient(135deg, #f8fafc, #f1f5f9); box-shadow: 0 4px 16px rgba(71,85,105,0.1) !important; }
.kpi-slate .kpi-value { color: #334155; }
.kpi-slate .kpi-label { color: #64748b; }
.kpi-icon-slate { background: #e2e8f0; color: #475569; }
.kpi-bar-slate { background: linear-gradient(90deg, #94a3b8, #64748b); }

.kpi-blue { background: linear-gradient(135deg, #eff6ff, #dbeafe); box-shadow: 0 4px 20px rgba(37,99,235,0.15) !important; }
.kpi-blue .kpi-value { color: #1d4ed8; }
.kpi-blue .kpi-label { color: #3b82f6; }
.kpi-icon-blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; }
.kpi-bar-blue { background: linear-gradient(90deg, #2563eb, #0ea5e9); }

.kpi-green { background: linear-gradient(135deg, #f0fdf4, #dcfce7); box-shadow: 0 4px 20px rgba(22,163,74,0.12) !important; }
.kpi-green .kpi-value { color: #15803d; }
.kpi-green .kpi-label { color: #22c55e; }
.kpi-icon-green { background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; }
.kpi-bar-green { background: linear-gradient(90deg, #16a34a, #4ade80); }

.kpi-orange { background: linear-gradient(135deg, #fff7ed, #ffedd5); box-shadow: 0 4px 20px rgba(234,88,12,0.12) !important; }
.kpi-orange .kpi-value { color: #c2410c; }
.kpi-orange .kpi-label { color: #f97316; }
.kpi-icon-orange { background: linear-gradient(135deg, #ea580c, #c2410c); color: #fff; }
.kpi-bar-orange { background: linear-gradient(90deg, #f97316, #fb923c); }

.kpi-red { background: linear-gradient(135deg, #fef2f2, #fee2e2); box-shadow: 0 4px 20px rgba(220,38,38,0.12) !important; }
.kpi-red .kpi-value { color: #b91c1c; }
.kpi-red .kpi-label { color: #ef4444; }
.kpi-icon-red { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; }
.kpi-bar-red { background: linear-gradient(90deg, #dc2626, #f87171); }

/* Trends */
.kpi-trend-up { background: #dcfce7; color: #15803d; }
.kpi-trend-down { background: #fee2e2; color: #b91c1c; }
.kpi-trend-warn { background: #fff7ed; color: #c2410c; }
.kpi-trend-neutral { background: #f1f5f9; color: #64748b; }

/* ─── CHARTS GRID ─────────────────────────────── */
.dash-charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 16px;
    margin-bottom: 20px;
}

.dash-chart-card {
    background: #ffffff !important;
    border-radius: 20px !important;
    border: 1px solid #f1f5f9 !important;
    box-shadow: 0 4px 20px rgba(15,23,42,0.06) !important;
    overflow: hidden;
    transform: none !important;
    transition: box-shadow 0.2s ease !important;
}

.dash-chart-card:hover {
    box-shadow: 0 8px 32px rgba(37,99,235,0.1) !important;
    transform: translateY(-2px) !important;
}

.dash-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #f8fafc;
}

.dash-chart-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.dash-chart-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dash-dot-blue { background: linear-gradient(135deg, #2563eb, #0ea5e9); }
.dash-dot-purple { background: linear-gradient(135deg, #7c3aed, #c026d3); }

.dash-chart-sub {
    font-size: 0.7rem;
    font-weight: 500;
    color: #94a3b8;
}

.dash-chart-body {
    padding: 12px 16px 16px;
    height: 220px;
    position: relative;
}

.dash-chart-body canvas { width: 100% !important; height: 100% !important; }

/* ─── SHORTCUTS ───────────────────────────────── */
.dash-shortcuts-header {
    display: flex;
    align-items: center;
    padding: 4px 16px 10px;
}

.dash-shortcuts-title {
    font-family: var(--font-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.dash-shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 16px 24px;
}

.shortcut-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    border-radius: 16px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.shortcut-card::before {
    content: '';
    position: absolute;
    bottom: -20px; right: -20px;
    width: 70px; height: 70px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.04;
}

.shortcut-card:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.shortcut-icon-wrap {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.shortcut-content { flex: 1; min-width: 0; }

.shortcut-name {
    font-family: var(--font-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shortcut-desc {
    font-size: 0.68rem;
    font-weight: 400;
    opacity: 0.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.shortcut-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 999px;
    flex-shrink: 0;
    font-family: var(--font-primary, 'Plus Jakarta Sans', sans-serif);
}

.shortcut-arrow {
    flex-shrink: 0;
    opacity: 0.4;
    transition: transform 0.15s ease;
}

.shortcut-card:hover .shortcut-arrow { transform: translateX(3px); opacity: 0.7; }

/* Variantes couleur */
.shortcut-red {
    background: linear-gradient(135deg, #fff5f5, #ffe4e6);
    border-color: #fecdd3;
}
.shortcut-red .shortcut-icon-wrap { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.shortcut-red .shortcut-name { color: #be123c; }
.shortcut-red .shortcut-desc { color: #be123c; }
.shortcut-red .shortcut-arrow { color: #be123c; }
.shortcut-badge-red { background: #dc2626; color: #fff; }

.shortcut-blue {
    background: linear-gradient(135deg, #eff6ff, #e0f2fe);
    border-color: #bae6fd;
}
.shortcut-blue .shortcut-icon-wrap { background: linear-gradient(135deg, #2563eb, #0ea5e9); color: #fff; }
.shortcut-blue .shortcut-name { color: #1d4ed8; }
.shortcut-blue .shortcut-desc { color: #1d4ed8; }
.shortcut-blue .shortcut-arrow { color: #1d4ed8; }

.shortcut-green {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #bbf7d0;
}
.shortcut-green .shortcut-icon-wrap { background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; }
.shortcut-green .shortcut-name { color: #15803d; }
.shortcut-green .shortcut-desc { color: #15803d; }
.shortcut-green .shortcut-arrow { color: #15803d; }

.shortcut-purple {
    background: linear-gradient(135deg, #faf5ff, #f3e8ff);
    border-color: #e9d5ff;
}
.shortcut-purple .shortcut-icon-wrap { background: linear-gradient(135deg, #7c3aed, #6d28d9); color: #fff; }
.shortcut-purple .shortcut-name { color: #6d28d9; }
.shortcut-purple .shortcut-desc { color: #6d28d9; }
.shortcut-purple .shortcut-arrow { color: #6d28d9; }

/* ═══════════════════════════════════════════════
   DESKTOP (≥ 768px)
═══════════════════════════════════════════════ */
@media (min-width: 768px) {

    .dash-hero {
        border-radius: 20px;
        margin: 16px 16px 20px;
        padding: 24px 28px 20px;
    }

    .dash-shopname { font-size: 1.5rem !important; }

    .dash-date-input { width: 130px; font-size: 0.8rem !important; }

    /* KPIs — 5 colonnes sur desktop */
    .dash-kpi-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 14px;
        padding: 0 16px;
    }

    .kpi-value { font-size: 1.2rem !important; }

    /* Charts — 3+2 colonnes */
    .dash-charts-grid {
        grid-template-columns: 3fr 2fr;
        padding: 0 16px;
    }

    .dash-chart-body { height: 260px; }

    /* Shortcuts — 4 colonnes */
    .dash-shortcuts-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .shortcut-card { padding: 18px 16px; }
}

/* ═══════════════════════════════════════════════
   DARK MODE OVERRIDES
═══════════════════════════════════════════════ */
body.dark .dash-hero {
    background: linear-gradient(135deg, #0c1a3d 0%, #1d3a7a 45%, #0c4a6e 100%);
}

body.dark .dash-trial {
    background: linear-gradient(135deg, #b45309, #c2410c);
}

body.dark .kpi-slate { background: linear-gradient(135deg, #1e293b, #0f172a) !important; }
body.dark .kpi-slate .kpi-value { color: #cbd5e1 !important; }
body.dark .kpi-slate .kpi-label { color: #64748b !important; }

body.dark .kpi-blue { background: linear-gradient(135deg, rgba(37,99,235,0.15), rgba(59,130,246,0.1)) !important; }
body.dark .kpi-blue .kpi-value { color: #93c5fd !important; }
body.dark .kpi-blue .kpi-label { color: #60a5fa !important; }

body.dark .kpi-green { background: linear-gradient(135deg, rgba(22,163,74,0.12), rgba(34,197,94,0.08)) !important; }
body.dark .kpi-green .kpi-value { color: #86efac !important; }
body.dark .kpi-green .kpi-label { color: #4ade80 !important; }

body.dark .kpi-orange { background: linear-gradient(135deg, rgba(234,88,12,0.12), rgba(249,115,22,0.08)) !important; }
body.dark .kpi-orange .kpi-value { color: #fdba74 !important; }
body.dark .kpi-orange .kpi-label { color: #fb923c !important; }

body.dark .kpi-red { background: linear-gradient(135deg, rgba(220,38,38,0.12), rgba(239,68,68,0.08)) !important; }
body.dark .kpi-red .kpi-value { color: #fca5a5 !important; }
body.dark .kpi-red .kpi-label { color: #f87171 !important; }

body.dark .dash-chart-card {
    background: #0f172a !important;
    border-color: #1e293b !important;
}

body.dark .dash-chart-header { border-bottom-color: #1e293b; }
body.dark .dash-chart-title { color: #e2e8f0 !important; }

body.dark .shortcut-red { background: linear-gradient(135deg, rgba(220,38,38,0.12), rgba(239,68,68,0.08)) !important; border-color: rgba(220,38,38,0.2) !important; }
body.dark .shortcut-red .shortcut-name { color: #fca5a5 !important; }
body.dark .shortcut-red .shortcut-desc { color: #f87171 !important; }
body.dark .shortcut-red .shortcut-arrow { color: #f87171 !important; }

body.dark .shortcut-blue { background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(14,165,233,0.08)) !important; border-color: rgba(37,99,235,0.2) !important; }
body.dark .shortcut-blue .shortcut-name { color: #93c5fd !important; }
body.dark .shortcut-blue .shortcut-desc { color: #60a5fa !important; }
body.dark .shortcut-blue .shortcut-arrow { color: #60a5fa !important; }

body.dark .shortcut-green { background: linear-gradient(135deg, rgba(22,163,74,0.12), rgba(34,197,94,0.08)) !important; border-color: rgba(22,163,74,0.2) !important; }
body.dark .shortcut-green .shortcut-name { color: #86efac !important; }
body.dark .shortcut-green .shortcut-desc { color: #4ade80 !important; }
body.dark .shortcut-green .shortcut-arrow { color: #4ade80 !important; }

body.dark .shortcut-purple { background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(109,40,217,0.08)) !important; border-color: rgba(124,58,237,0.2) !important; }
body.dark .shortcut-purple .shortcut-name { color: #d8b4fe !important; }
body.dark .shortcut-purple .shortcut-desc { color: #c084fc !important; }
body.dark .shortcut-purple .shortcut-arrow { color: #c084fc !important; }

body.dark .dash-shortcuts-title { color: #475569 !important; }

/* ═══════════════════════════════════════════════════════════
   CORRECTIFS ERGONOMIE MOBILE — Vieux appareils & petits écrans
   À ajouter à la FIN de style.css
   Cible : Android < 8, iOS < 13, écrans < 360px, GPU faibles
═══════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────
   1. FALLBACKS backdrop-filter
   backdrop-filter non supporté sur Android WebView < 76,
   UC Browser, Samsung Internet < 12. On détecte avec @supports
   et on fournit un fond opaque en fallback.
───────────────────────────────────────────────────────── */
@supports not (backdrop-filter: blur(1px)) {
    .top-tabs {
        background: #ffffff !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    body.dark .top-tabs {
        background: #0f172a !important;
    }

    #global-search-container {
        background: #f8fafc !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    body.dark #global-search-container {
        background: #0f172a !important;
    }

    #auth-container > div {
        background: #ffffff !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    body.dark #auth-container > div {
        background: #0f172a !important;
    }

    .bg-white,
    .bg-white.rounded-xl {
        background: #ffffff !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    body.dark .bg-white,
    body.dark .bg-white.rounded-xl {
        background: #0f172a !important;
    }

    .hamburger-drawer {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        background: #ffffff !important;
    }

    body.dark .hamburger-drawer {
        background: #0f172a !important;
    }
}

/* ─────────────────────────────────────────────────────────
   2. background-attachment: fixed — bug iOS Safari
   Sur iOS, fixed crée un rendu "congelé" (fond statique
   qui ne suit pas le scroll). On le désactive sur mobile.
───────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    body {
        background-attachment: scroll !important;
        /* Radial gradients simplifiés — moins lourds pour GPU faible */
        background-image:
            radial-gradient(ellipse 100% 40% at 50% 0%, rgba(37, 99, 235, 0.07) 0%, transparent 70%) !important;
    }
}

/* ─────────────────────────────────────────────────────────
   3. Animations — désactivées pour GPU faibles
   Utilise prefers-reduced-motion ET une classe JS .perf-mode
   qu'on peut appliquer sur les vieux appareils détectés.
───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Classe .perf-mode applicable via JS sur vieux appareils */
body.perf-mode *,
body.perf-mode *::before,
body.perf-mode *::after {
    animation: none !important;
    transition: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background-attachment: scroll !important;
}

body.perf-mode .bg-white,
body.perf-mode .bg-white.rounded-xl {
    background: #ffffff !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
}

body.perf-mode.dark .bg-white,
body.perf-mode.dark .bg-white.rounded-xl {
    background: #1e293b !important;
}

/* ─────────────────────────────────────────────────────────
   4. Très petits écrans (< 360px) — Galaxy S5, Moto E, etc.
   La nav du bas déborde quand min-width: 52px × 7 onglets
───────────────────────────────────────────────────────── */
@media (max-width: 359px) {

    /* Nav : icônes seulement, pas de label texte */
    .tab div,
    .tab span {
        display: none !important;
    }

    .tab {
        min-width: 40px !important;
        padding: 8px 4px !important;
    }

    .tab i, .tab svg {
        width: 1.1rem !important;
        height: 1.1rem !important;
        margin-bottom: 0 !important;
    }

    /* Nav hauteur réduite */
    :root { --nav-height-mobile: 52px; }

    .top-tabs {
        height: 52px !important;
    }

    /* Titres plus compacts */
    h1, .page-title {
        font-size: 1.2rem !important;
    }

    h2 { font-size: 0.9rem !important; }
    h3, h4 { font-size: 0.8rem !important; }

    /* KPI valeurs plus compactes */
    .kpi-value, .text-2xl, .text-3xl {
        font-size: 1.05rem !important;
    }

    /* Inputs plus compacts */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    select {
        padding: 8px 10px !important;
        font-size: 0.875rem !important;
        height: auto !important;
    }

    /* Barre de recherche moins haute */
    #global-search-input {
        height: 38px !important;
        font-size: 0.8rem !important;
        padding-left: 2.5rem !important;
    }

    /* Padding pages réduit */
    .page-content {
        padding: 0.75rem 0.75rem !important;
    }

    main {
        padding-left: 8px !important;
        padding-right: 8px !important;
        padding-bottom: calc(52px + 12px) !important;
    }

    /* Tableaux encore plus compacts */
    th, td {
        padding: 5px 6px !important;
        font-size: 0.75rem !important; /* Min 12px. En dessous de ça, c'est illisible */
    }

    /* Boutons moins hauts */
    button, .btn {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        font-size: 0.8rem !important;
    }

    /* Cartes KPI : 2 colonnes forcées */
    .dash-kpi-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        padding: 0 8px !important;
    }

    .kpi-card {
        padding: 12px !important;
    }

    /* Hero dashboard compact */
    .dash-hero {
        padding: 14px 14px 12px !important;
        border-radius: 0 0 20px 20px !important;
        margin-bottom: 14px !important;
    }

    .dash-shopname {
        font-size: 1rem !important;
    }

    /* Masquer le filtre de dates dans le hero sur très petit écran */
    .dash-date-filter {
        display: none !important;
    }

    /* Shortcuts : 1 colonne sur très petit écran */
    .dash-shortcuts-grid {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
        padding: 0 8px 16px !important;
    }

    /* Modales : plein écran */
    [id$="-modal"] > div,
    [id$="-modal"] > .bg-white {
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 16px !important;
    }
}

/* ─────────────────────────────────────────────────────────
   5. Écrans moyens (360px–479px) — ajustements fins
   iPhone SE 1ère gen, Galaxy A10, Redmi 9A…
───────────────────────────────────────────────────────── */
@media (min-width: 360px) and (max-width: 479px) {

    /* Nav : réduire légèrement */
    .tab {
        min-width: 46px !important;
        padding: 6px 5px !important;
    }

    .tab div, .tab span {
        font-size: 0.58rem !important;
    }

    /* Barre de recherche */
    #global-search-input {
        height: 40px !important;
        font-size: 0.85rem !important;
    }

    /* KPIs : conserver 2 colonnes */
    .dash-kpi-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .kpi-value {
        font-size: 1.1rem !important;
    }

    /* Shortcuts : 2 colonnes */
    .dash-shortcuts-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Charts : hauteur réduite pour laisser de l'espace */
    .dash-chart-body {
        height: 180px !important;
    }

    /* Page content padding */
    .page-content {
        padding: 0.9rem 0.9rem !important;
    }
}

/* ─────────────────────────────────────────────────────────
   6. Hover désactivé sur touch — évite le "hover bloqué"
   Sur Android, le :hover reste actif après le tap,
   ce qui cause des effets visuels persistants indésirables.
───────────────────────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {

    .bg-white:hover,
    .bg-white.rounded-xl:hover {
        transform: none !important;
        box-shadow: var(--shadow-card) !important;
    }

    .tab:hover {
        background-color: transparent !important;
        color: #64748b !important;
    }

    .tab.active:hover {
        background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(37, 99, 235, 0.06)) !important;
        color: var(--color-primary) !important;
    }

    button:hover {
        transform: none !important;
    }

    .bg-blue-600:hover,
    button.bg-blue-600:hover {
        transform: none !important;
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3) !important;
    }

    .shortcut-card:hover {
        transform: none !important;
    }

    .shortcut-card:hover .shortcut-arrow {
        transform: none !important;
    }

    /* Active states pour feedback tactile à la place du hover */
    .tab:active {
        background-color: #eff6ff !important;
        color: var(--color-primary) !important;
    }

    button:active {
        opacity: 0.82 !important;
        transform: scale(0.98) !important;
    }

    .shortcut-card:active {
        transform: scale(0.98) !important;
        opacity: 0.9 !important;
    }
}

/* ─────────────────────────────────────────────────────────
   7. Fix overflow horizontal global — contenu qui dépasse
   Fréquent sur vieux appareils avec tableaux larges.
───────────────────────────────────────────────────────── */
@media (max-width: 767px) {

    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    /* Conteneurs flex/grid : pas de débordement */
    .flex, [class*="grid"] {
        min-width: 0;
    }

    /* Modales : ne pas dépasser l'écran */
    [id$="-modal"] {
        padding: 12px !important;
    }

    [id$="-modal"] > div {
        max-width: calc(100vw - 24px) !important;
    }

    /* Empêcher le zoom iOS sur les inputs (déjà 0.875rem mais on force) */
    input, select, textarea {
        font-size: max(16px, 0.875rem) !important;
        -webkit-text-size-adjust: 100%;
    }
}

/* ─────────────────────────────────────────────────────────
   8. Fix p, span, div, td, th — règle trop large
   La règle actuelle "p, span, div, td, th" avec !important
   écrase même les éléments structurels et casse les icônes.
   On la restreint aux seuls contextes textuels.
───────────────────────────────────────────────────────── */
@media (max-width: 767px) {

    /* Restreindre aux éléments texte dans le contenu */
    .page-content p,
    .page-content span:not(.lucide):not([data-lucide]),
    .page-content li {
        font-size: 0.8125rem;
    }

    /* Icônes Lucide : ne jamais forcer la taille via font-size */
    i[data-lucide],
    svg.lucide,
    [class*="lucide"] {
        font-size: inherit !important;
    }
}

/* ─────────────────────────────────────────────────────────
   10. CORRECTION ULTIME LAYOUT CATALOGUE DESKTOP
   Contourne la non-compilation des classes Tailwind
   pour garantir l'affichage côte à côte sur ordinateur.
───────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
    .desktop-layout-fix { flex-direction: row !important; flex-wrap: nowrap !important; }
    .desktop-main-fix { flex: 1 1 0% !important; width: auto !important; }
    .desktop-floating-btn-fix { display: none !important; }
    .desktop-hide-top-categories { display: none !important; }
    .desktop-hide-hamburger { display: none !important; }
    .desktop-hide-cart-close { display: none !important; }
    
    .desktop-sidebar-fix {
        display: flex !important; 
        flex-direction: column !important;
        position: sticky !important;
        top: 6rem !important;
        flex: 0 0 260px !important;
        width: 260px !important;
        height: calc(100vh - 120px) !important;
        background: #ffffff !important;
        border-radius: 1.5rem !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 4px 20px rgba(37, 99, 235, 0.07) !important;
        overflow: hidden !important;
        z-index: 10 !important;
    }
    
    .desktop-cart-fix {
        display: flex !important; 
        position: sticky !important;
        inset: auto !important;      /* 1. On annule l'affichage plein écran du mobile d'abord */
        top: 6rem !important;        /* 2. On fige le haut APRES l'annulation ! */
        background: transparent !important;
        flex: 0 0 350px !important;
        width: 350px !important;
        height: calc(100vh - 120px) !important;
        padding: 0 !important;
        z-index: 10 !important;
    }
    .desktop-cart-fix > div {
        height: 100% !important;
        max-height: none !important;
        border-radius: 1.5rem !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 4px 20px rgba(37, 99, 235, 0.07) !important;
        transform: none !important;
    }
}

/* ─────────────────────────────────────────────────────────
   11. FIX ANTI-FORCED DARK MODE (GLOBAL)
   Empêche les téléphones Android (Xiaomi, Samsung...) de rendre 
   le texte flou et fluorescent en mode clair sur toute l'appli.
───────────────────────────────────────────────────────── */
body:not(.dark) * {
    text-shadow: none !important; /* Supprime l'effet néon généré par l'OS */
}

/* Verrouillage des textes sombres principaux (ex: Noms des produits) */
body:not(.dark) .text-gray-900 { color: #111827 !important; }
body:not(.dark) .text-gray-800 { color: #1f2937 !important; }
body:not(.dark) .text-slate-900 { color: #0f172a !important; }
body:not(.dark) .text-slate-800 { color: #1e293b !important; }

/* Règles spécifiques conservées pour le panneau IA */
body:not(.dark) #ai-assistant-panel .bg-white { background-color: #ffffff !important; }
body:not(.dark) #ai-assistant-panel .text-slate-700 { color: #334155 !important; }
body:not(.dark) #ai-assistant-panel .text-slate-600 { color: #475569 !important; }
body:not(.dark) #ai-assistant-panel .text-slate-500 { color: #64748b !important; }
body:not(.dark) #ai-assistant-panel .text-slate-400 { color: #94a3b8 !important; }
body:not(.dark) #ai-assistant-panel .text-white { color: #ffffff !important; }
body:not(.dark) #ai-assistant-panel .text-purple-700 { color: #7e22ce !important; }
body:not(.dark) #ai-assistant-panel .text-purple-500 { color: #a855f7 !important; }
body:not(.dark) #ai-assistant-panel .bg-purple-600 { background-color: #9333ea !important; }
@media (min-width: 1280px) {
    .desktop-sidebar-fix { flex: 0 0 280px !important; width: 280px !important; }
    .desktop-cart-fix { flex: 0 0 400px !important; width: 400px !important; }
}
@media (min-width: 1536px) {
    .desktop-sidebar-fix { flex: 0 0 300px !important; width: 300px !important; }
    .desktop-cart-fix { flex: 0 0 450px !important; width: 450px !important; }
}
