/* ============================================================
   BJ Performance — Dark & Sport Theme
   ============================================================ */

/* Variables */
:root {
    --bg-primary:   #0d0d0d;
    --bg-secondary: #1a1a1a;
    --bg-card:      rgba(255,255,255,0.05);
    --bg-card-hover:rgba(255,255,255,0.08);
    --accent:       #e63946;
    --accent-hover: #c1121f;
    --text-primary: #ffffff;
    --text-secondary:#a0a0a0;
    --border:       rgba(255,255,255,0.1);
    --glass-bg:     rgba(255,255,255,0.04);
    --glass-border: rgba(255,255,255,0.12);
    --shadow-red:   0 0 30px rgba(230,57,70,0.15);
    --radius:       12px;
    --transition:   0.3s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100%;
}

#content { flex: 1; }

a { text-decoration: none; color: inherit; transition: color var(--transition); }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    background: rgba(13,13,13,0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

body.body-public,
body.body-admin {
    padding-top: 98px;
}

.navbar-brand img {
    height: 72px;
    width: auto;
}

.nav-item .nav-link,
.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    transition: color var(--transition), background var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.nav-item .nav-link a,
.navbar-nav .nav-link a {
    color: inherit;
}
.nav-item .nav-link:hover,
.navbar-nav .nav-link:hover {
    color: var(--text-primary) !important;
    background: var(--bg-card);
}
.nav-item .nav-link.active a,
.navbar-nav .nav-link.active {
    color: var(--accent) !important;
}

/* Hamburger animé */
.navbar-toggler {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
}
.navbar-toggler:focus { box-shadow: 0 0 0 2px rgba(230,57,70,0.3); }
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Bouton connexion dans navbar */
.btn-nav-login {
    background: var(--accent);
    color: #fff !important;
    border: none;
    padding: 0.45rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    transition: background var(--transition), transform var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.btn-nav-login:hover {
    background: var(--accent-hover);
    color: #fff !important;
    transform: translateY(-1px);
}

/* Badge messages non lus */
.badge-messages {
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    vertical-align: middle;
}

/* ============================================================
   HERO BANNER
   ============================================================ */
.hero-banner {
    position: relative;
    width: 100%;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-secondary);
}

.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(230,57,70,0.15) 0%, rgba(13,13,13,0.8) 60%, var(--bg-primary) 100%);
    z-index: 1;
}

.hero-banner img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    animation: fadeInUp 0.8s ease;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.hero-content h1 .accent { color: var(--accent); }

.hero-content p {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* ============================================================
   BOUTONS
   ============================================================ */
.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
}

.btn-accent::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.btn-accent:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(230,57,70,0.35);
}

.btn-accent:hover::before { left: 150%; }

.btn-outline-accent {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--accent);
    font-weight: 600;
    padding: 0.65rem 1.75rem;
    border-radius: 8px;
    border: 2px solid var(--accent);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}
.btn-outline-accent:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}
.btn-ghost:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.2);
}

/* Overrides Bootstrap pour les pages admin */
.btn-primary {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
    transition: all var(--transition);
}
.btn-primary:hover {
    background: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
    transform: translateY(-1px);
}
.btn-danger { transition: all var(--transition); }
.btn-danger:hover { transform: translateY(-1px); }

/* ============================================================
   GLASS CARDS
   ============================================================ */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.glass-card:hover {
    transform: translateY(-4px);
    border-color: rgba(230,57,70,0.3);
    box-shadow: var(--shadow-red);
}

/* ============================================================
   CARDS PRODUITS
   ============================================================ */
.product-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    height: 100%;
}

.product-card:hover {
    transform: translateY(-6px);
    border-color: rgba(230,57,70,0.4);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), var(--shadow-red);
}

.product-card .card-img-wrap {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #111;
}

.product-card .card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.product-card:hover .card-img-wrap img { transform: scale(1.05); }

/* Badge état */
.badge-etat {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.badge-neuf     { background: #2ecc71; color: #fff; }
.badge-occasion { background: #f39c12; color: #1a1a1a; }

.product-card .card-body {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.5rem;
}

.product-card .card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.product-card .card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.product-card .card-meta span { display: flex; align-items: center; gap: 3px; }

.product-card .card-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
    margin-top: auto;
}

.product-card .card-footer-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.65rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 600;
    transition: all var(--transition);
    cursor: pointer;
}
.product-card .card-footer-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ============================================================
   FILTRES BOUTIQUE
   ============================================================ */
.filter-bar {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-bar h5 {
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-select {
    background: var(--bg-primary) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
    border-radius: 8px !important;
    padding: 0.6rem 1rem;
    transition: border-color var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23a0a0a0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
}

.filter-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(230,57,70,0.15) !important;
    outline: none;
}
.filter-select option { background: var(--bg-secondary); color: var(--text-primary); }
.filter-select:disabled { opacity: 0.4; cursor: not-allowed; }

/* Pagination */
.pagination-wrap { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; margin-top: 2rem; }
.page-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition);
    min-width: 42px;
    text-align: center;
}
.page-btn:hover, .page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Tri */
.sort-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.sort-bar label { color: var(--text-secondary); font-size: 0.9rem; }

/* ============================================================
   PAGE DÉTAIL PIÈCE
   ============================================================ */
.piece-detail-img {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    border: 1px solid var(--border);
}
.piece-detail-img img {
    max-height: 450px;
    width: 100%;
    object-fit: contain;
    padding: 1.5rem;
}

.piece-info-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}

.piece-info-box h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.piece-price-big {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
}

.piece-meta-list { list-style: none; padding: 0; margin: 1rem 0; }
.piece-meta-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}
.piece-meta-list li:last-child { border-bottom: none; }
.piece-meta-list li .label { color: var(--text-secondary); width: 140px; flex-shrink: 0; }
.piece-meta-list li .value { color: var(--text-primary); font-weight: 600; }

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 1rem 0;
    margin-bottom: 0;
}
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-secondary); }
.breadcrumb-item a { color: var(--text-secondary); }
.breadcrumb-item a:hover { color: var(--accent); }
.breadcrumb-item.active { color: var(--text-primary); }

/* ============================================================
   FORMULAIRES (Contact / Login)
   ============================================================ */
.form-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
}

.form-label { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0.4rem; }

.form-control, .form-select {
    background: var(--bg-primary) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
    border-radius: 8px !important;
    padding: 0.65rem 1rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control::placeholder { color: var(--text-secondary); opacity: 0.7; }
.form-control:focus, .form-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(230,57,70,0.15) !important;
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    outline: none;
}
.form-select option { background: var(--bg-secondary); color: var(--text-primary); }

.input-group-text {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-secondary) !important;
}

/* ============================================================
   SECTION PAGE D'ACCUEIL
   ============================================================ */
.section-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.section-title .accent { color: var(--accent); }

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 3rem;
}

.service-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.service-card:hover {
    transform: translateY(-6px);
    border-color: rgba(230,57,70,0.4);
    box-shadow: var(--shadow-red);
}
.service-card .service-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
}
.service-card h4 { font-weight: 700; margin-bottom: 0.75rem; }
.service-card p { color: var(--text-secondary); font-size: 0.95rem; }

/* Section CTA */
.cta-section {
    background: linear-gradient(135deg, rgba(230,57,70,0.1), rgba(230,57,70,0.05));
    border: 1px solid rgba(230,57,70,0.2);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: #0a0a0a;
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-logo { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); margin-bottom: 0.5rem; }
.footer-logo span { color: var(--accent); }

.footer-desc { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.7; }

.footer-heading { color: var(--text-primary); font-weight: 700; font-size: 1rem; margin-bottom: 1rem; }

.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links li a { color: var(--text-secondary); font-size: 0.9rem; transition: color var(--transition); }
.footer-links li a:hover { color: var(--accent); }

.footer-social { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.social-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: all var(--transition);
}
.social-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
}

.footer-divider { border-color: var(--border); margin: 2rem 0 1.5rem; }

.footer-copy { color: var(--text-secondary); font-size: 0.85rem; text-align: center; }
.footer-copy span { color: var(--accent); }

/* Cookie banner */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.8rem;
    text-align: center;
    z-index: 9999;
    display: none;
    max-width: 500px;
    width: calc(100% - 2rem);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.cookie-banner p { margin-bottom: 0.75rem; }
.cookie-banner .cookie-btns { display: flex; gap: 0.75rem; justify-content: center; }

/* ============================================================
   ADMIN — SIDEBAR LAYOUT
   ============================================================ */
.admin-wrapper {
    min-height: calc(100vh - 98px);
}

.admin-sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
    position: fixed;
    top: 98px;
    left: 0;
    height: calc(100vh - 98px);
    overflow-y: auto;
    z-index: 100;
}

.admin-main {
    margin-left: 260px;
}


.admin-sidebar .admin-logo {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.admin-sidebar .admin-logo h5 { color: var(--text-primary); font-weight: 800; font-size: 1rem; margin-bottom: 2px; }
.admin-sidebar .admin-logo p { color: var(--accent); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

.sidebar-nav { list-style: none; padding: 0; }
.sidebar-nav li { margin-bottom: 4px; }
.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition);
}
.sidebar-nav li a:hover, .sidebar-nav li a.active {
    background: rgba(230,57,70,0.1);
    color: var(--accent);
}
.sidebar-nav li a i { width: 18px; text-align: center; }

/* ---- Couleurs sidebar par section ---- */
/* Icônes colorées en permanence */
.sidebar-nav a[href="admin_pieces.php"] i { color: var(--accent); }
.sidebar-nav a[href="messages.php"] i     { color: #2ecc71; }
.sidebar-nav a[href="gestion_admins.php"] i { color: #3498db; }
.sidebar-nav a[href="suivi_colis.php"] i  { color: #FFCD00; }

/* Hover / active par section */
.sidebar-nav a[href="admin.php"]:hover,
.sidebar-nav a[href="admin.php"].active,
.sidebar-nav a[href="admin_pieces.php"]:hover,
.sidebar-nav a[href="admin_pieces.php"].active {
    background: rgba(230,57,70,0.1);
    color: var(--accent);
}
.sidebar-nav a[href="messages.php"]:hover,
.sidebar-nav a[href="messages.php"].active {
    background: rgba(46,204,113,0.12);
    color: #2ecc71;
}
.sidebar-nav a[href="gestion_admins.php"]:hover,
.sidebar-nav a[href="gestion_admins.php"].active {
    background: rgba(52,152,219,0.12);
    color: #3498db;
}
.sidebar-nav a[href="suivi_colis.php"]:hover,
.sidebar-nav a[href="suivi_colis.php"].active {
    background: rgba(255,205,0,0.1);
    color: #FFCD00;
}
.sidebar-nav a[href="todos.php"] i { color: #f39c12; }
.sidebar-nav a[href="todos.php"]:hover,
.sidebar-nav a[href="todos.php"].active {
    background: rgba(243,156,18,0.12);
    color: #f39c12;
}
.sidebar-nav a[href="facturation.php"] i { color: #9b59b6; }
.sidebar-nav a[href="facturation.php"]:hover,
.sidebar-nav a[href="facturation.php"].active {
    background: rgba(155,89,182,0.12);
    color: #9b59b6;
}

.sidebar-divider { border-color: var(--border); margin: 1rem 0; }

.admin-main {
    padding: 2rem;
    overflow-x: hidden;
    min-height: calc(100vh - 98px);
}

/* Admin stat cards */
.stat-badge-bubble {
    position: absolute;
    top: -12px; right: -12px;
    background: var(--accent);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    min-width: 30px;
    height: 30px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    box-shadow: 0 3px 10px rgba(230,57,70,0.5);
    white-space: nowrap;
}
.stat-card {
    position: relative;
    overflow: visible;
    border-radius: 20px;
    width: 158px;
    height: 158px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.25rem;
    transition: all var(--transition);
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.stat-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 5.5rem;
    opacity: 0.22;
    border-radius: 0;
    background: transparent !important;
    pointer-events: none;
}
.stat-icon.red     { color: #fff; opacity: 0.32; }
.stat-icon.blue    { color: #fff; }
.stat-icon.green   { color: #fff; opacity: 0.32; }
.stat-icon.orange  { color: #fff; }
.stat-icon.laposte { color: #003189; }
.stat-icon.purple  { color: #fff; }
.stat-info { position: relative; z-index: 1; }

.stat-card-pieces  { background: rgba(230,57,70,0.85);  border: 3px solid var(--accent); }
.stat-card-messages{ background: rgba(46,204,113,0.85); border: 3px solid #2ecc71; }
.stat-card-admins  { background: rgba(52,152,219,0.85); border: 3px solid #3498db; }
.stat-card-colis   { background: rgba(255,205,0,0.9);   border: 3px solid #FFCD00; }
.stat-card-todos         { background: rgba(243,156,18,0.85); border: 3px solid #f39c12; }
.stat-card-facturation   { background: rgba(155,89,182,0.85); border: 3px solid #9b59b6; }

.stat-info .stat-value { font-size: 2.1rem; font-weight: 900; color: #fff; line-height: 1; text-shadow: 0 2px 6px rgba(0,0,0,0.8), 0 0 4px rgba(0,0,0,0.7); }
.stat-info .stat-label { font-size: 0.72rem; font-weight: 900; margin-top: 3px; color: rgba(255,255,255,0.85); text-transform: uppercase; letter-spacing: 0.3px; text-shadow: 0 1px 5px rgba(0,0,0,0.8), 0 0 3px rgba(0,0,0,0.6); }

.stat-card-colis .stat-info .stat-value,
.stat-card-colis .stat-info .stat-label  { color: #003189; text-shadow: none; }
.stat-card-colis .stat-info .stat-label  { color: rgba(0,49,137,0.8); }

/* Admin tables */
.admin-table {
    width: 100%;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}
.admin-table thead tr { background: rgba(230,57,70,0.1); }
.admin-table th { padding: 0.9rem 1rem; color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-table td { padding: 0.9rem 1rem; border-top: 1px solid var(--border); vertical-align: middle; color: var(--text-primary); font-size: 0.9rem; }
.admin-table tr:hover td { background: var(--bg-card); }

/* Admin message cards */
.msg-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    transition: border-color var(--transition);
}
.msg-card { border-top: 3px solid #2ecc71; }
.msg-card.unread { border-left: 3px solid #2ecc71; }
.msg-card .msg-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.msg-card .msg-name { font-weight: 700; color: var(--text-primary); }
.msg-card .msg-date { color: var(--text-secondary); font-size: 0.8rem; }
.msg-card .msg-meta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.msg-card .msg-meta span { color: var(--text-secondary); font-size: 0.85rem; display: flex; align-items: center; gap: 4px; }
.msg-card .msg-text {
    background: #fff;
    color: #1a1a1a;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    border-radius: 18px 18px 18px 4px;
    padding: 0.85rem 1.1rem;
    position: relative;
    font-size: 0.92rem;
    line-height: 1.6;
    margin-top: 0.75rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    display: block;
}
.msg-card .msg-text::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: -8px;
    width: 0; height: 0;
    border-style: solid;
    border-width: 5px 9px 5px 0;
    border-color: transparent #fff transparent transparent;
}
.msg-card .msg-actions { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }

/* Admin form cards */
.admin-form-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.admin-form-card h5 { color: var(--text-primary); font-weight: 700; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.5rem; }
.admin-form-card h5 i { color: var(--accent); }

/* Cards colorées par section */
.card-pieces  { border-top: 3px solid var(--accent); }
.card-pieces h5 i  { color: var(--accent); }

.card-messages { border-top: 3px solid #2ecc71; }
.card-messages h5 i { color: #2ecc71; }

.card-admins  { border-top: 3px solid #3498db; }
.card-admins h5 i  { color: #3498db; }

.card-colis   { border-top: 3px solid #FFCD00; }
.card-colis h5 i   {
    background: #FFCD00;
    color: #003189;
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* Image preview */
.img-preview {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    padding: 0.5rem;
    margin-top: 0.5rem;
    display: none;
}

/* ── Zone drag & drop image upload ── */
.img-drop-zone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.img-drop-zone:hover,
.img-drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(230,57,70,0.05);
    color: var(--text-primary);
}
.img-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.6rem;
}
.img-upload-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    border: 2px solid var(--border);
}
.img-upload-card.img-upload-main { border-color: var(--accent); }
.img-upload-card img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.img-upload-badge {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: var(--accent); color: #fff;
    font-size: 0.65rem; font-weight: 700;
    text-align: center; padding: 2px 0;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.img-upload-del {
    position: absolute; top: 4px; right: 4px;
    background: rgba(0,0,0,0.7); color: #fff;
    border: none; border-radius: 50%;
    width: 22px; height: 22px; font-size: 0.65rem;
    cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.15s;
}
.img-upload-card:hover .img-upload-del { opacity: 1; }

/* ── Autocomplete suggestions ── */
.ac-wrapper { position: relative; }
.ac-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0; right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    z-index: 9999;
    max-height: 260px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    display: none;
}
.ac-dropdown.open { display: block; }
.ac-item {
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    font-size: 0.92rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.12s;
}
.ac-item:hover, .ac-item.ac-active {
    background: rgba(230,57,70,0.12);
    color: var(--accent);
}
.ac-item i { color: var(--accent); font-size: 0.8rem; flex-shrink: 0; }
.ac-item mark {
    background: transparent;
    color: var(--accent);
    font-weight: 700;
}

/* Admin login page */
.admin-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 2rem;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-content {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    color: var(--text-primary);
}
.modal-header { border-bottom-color: var(--border) !important; }
.modal-footer { border-top-color: var(--border) !important; }
.btn-close { filter: invert(1); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    border-radius: 8px !important;
    font-weight: 500;
    border: none !important;
}
.alert-success { background: rgba(46,204,113,0.15) !important; color: #2ecc71 !important; }
.alert-danger  { background: rgba(230,57,70,0.15) !important; color: #ff6b6b !important; }
.alert-info    { background: rgba(52,152,219,0.15) !important; color: #74b9ff !important; }
.alert-warning { background: rgba(243,156,18,0.15) !important; color: #fdcb6e !important; }

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--text-secondary);
    gap: 1rem;
}
.spinner-accent { color: var(--accent); }

/* ============================================================
   UTILITAIRES
   ============================================================ */
.text-accent { color: var(--accent) !important; }
.bg-card { background: var(--bg-card) !important; }
.border-custom { border-color: var(--border) !important; }
.text-muted { color: var(--text-secondary) !important; }

/* Mentions légales / confidentialité */
.mentions-container {
    max-width: 800px;
    margin: 3rem auto;
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    line-height: 1.8;
}
.mentions-container h1, .mentions-container h2, .mentions-container h3 { color: var(--text-primary); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.animate-fade-up  { animation: fadeInUp 0.6s ease forwards; }
.animate-fade-in  { animation: fadeIn 0.4s ease forwards; }

/* Délais d'animation pour les cards en grille */
.grid-item:nth-child(1) { animation-delay: 0.05s; }
.grid-item:nth-child(2) { animation-delay: 0.1s; }
.grid-item:nth-child(3) { animation-delay: 0.15s; }
.grid-item:nth-child(4) { animation-delay: 0.2s; }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.lightbox-overlay.active { display: flex; }
.lightbox-overlay img {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    user-select: none;
}
.lightbox-close {
    position: fixed;
    top: 1rem; right: 1.25rem;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10000;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
    background: none;
    border: none;
    padding: 0;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    opacity: 0.7;
    background: none;
    border: none;
    padding: 0.5rem;
    transition: opacity 0.2s;
    z-index: 10000;
}
.lightbox-nav:hover { opacity: 1; }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-counter {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

/* ============================================================
   GALERIE PIÈCE (piece.php)
   ============================================================ */
.piece-gallery { position: relative; }
.piece-main-img {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}
.piece-main-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.piece-main-img img:hover { transform: scale(1.03); }

.gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.gallery-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--border);
    transition: border-color 0.2s, transform 0.2s;
    opacity: 0.75;
}
.gallery-thumb:hover { opacity: 1; transform: scale(1.05); }
.gallery-thumb.active { border-color: var(--accent); opacity: 1; }

/* ============================================================
   CARROUSEL CARDS BOUTIQUE
   ============================================================ */
.card-carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}
.carousel-slide {
    display: none;
    width: 100%;
    height: 100%;
}
.carousel-slide.active { display: block; }
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    width: 28px; height: 28px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    padding: 0;
    line-height: 1;
    transition: background 0.2s;
}
.carousel-btn:hover { background: rgba(0,0,0,0.8); }
.carousel-prev { left: 4px; }
.carousel-next { right: 4px; }
.carousel-dots {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 10;
}
.carousel-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.2s;
}
.carousel-dot.active { background: #fff; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
    .admin-sidebar {
        width: 220px;
    }
    .hero-banner { min-height: 450px; }
}

@media (max-width: 767px) {
    .admin-wrapper { display: block; }
    .admin-main { margin-left: 0; }
    .admin-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    /* ---- Bottom nav bar fixe (style app mobile) ---- */
    .admin-sidebar {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        top: auto !important;
        width: 100% !important;
        height: auto !important;
        z-index: 999;
        padding: 0;
        border-right: none;
        border-top: 1px solid var(--border);
        border-bottom: none;
        background: var(--bg-secondary);
        overflow: visible;
    }
    .admin-sidebar .admin-logo { display: none; }
    .admin-sidebar .sidebar-divider { display: none; }
    .admin-sidebar ul.sidebar-nav:last-of-type { display: none; }
    .sidebar-nav li:has(a[href="gestion_admins.php"]),
    .sidebar-nav li:has(a[href="facturation.php"]) { display: none; }

    .sidebar-nav {
        display: flex;
        flex-wrap: nowrap;
        gap: 0;
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .sidebar-nav li { flex: 1; margin: 0; }
    .sidebar-nav li a {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.65rem 0.25rem 0.55rem;
        border-radius: 0;
        font-size: 0.68rem;
        font-weight: 600;
        text-align: center;
        justify-content: center;
        border-bottom: none;
        border-top: 3px solid transparent;
        width: 100%;
        letter-spacing: 0.2px;
    }
    .sidebar-nav li a:hover,
    .sidebar-nav li a.active {
        background: transparent !important;
    }
    .sidebar-nav li a.active { border-top-color: currentColor; }
    .sidebar-nav li a i {
        font-size: 1.35rem;
        width: auto;
        margin: 0;
    }
    /* Badge messages en bottom nav */
    .sidebar-nav li { position: relative; }
    .sidebar-nav .badge-messages {
        position: absolute;
        top: 6px; right: calc(50% - 22px);
        font-size: 0.6rem;
        min-width: 16px; height: 16px;
        padding: 0 4px;
        border-radius: 8px;
    }

    .admin-main { padding: 1rem 1rem calc(75px + env(safe-area-inset-bottom)); }
    .hero-banner { min-height: 350px; }
    .piece-info-box { padding: 1.25rem; }
    .filter-bar { padding: 1rem; }

    /* Tableau colis dashboard → cards empilées */
    .card-colis .table-responsive { overflow-x: visible; }
    .card-colis .admin-table,
    .card-colis .admin-table tbody { display: block; width: 100%; }
    .card-colis .admin-table thead { display: none; }
    .card-colis .admin-table tbody tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: 8px;
        margin-bottom: 0.75rem;
        padding: 0.5rem 0.75rem;
        background: var(--bg-card);
    }
    .card-colis .admin-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid rgba(255,255,255,0.05);
        padding: 0.4rem 0;
        font-size: 0.85rem;
    }
    .card-colis .admin-table td:first-child { border-top: none; }
    .card-colis .admin-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-right: 0.75rem;
        flex-shrink: 0;
    }

    /* Titres de page admin centrés */
    .admin-main > h2 { text-align: center; font-size: 1.4rem; }

    /* Headers de cards admin → empilés et centrés */
    .admin-form-card .d-flex.justify-content-between {
        flex-direction: column;
        align-items: center !important;
        gap: 0.75rem;
        text-align: center;
    }
    .admin-form-card .d-flex.justify-content-between h5 { text-align: center; }
    .admin-form-card .d-flex.justify-content-between input,
    .admin-form-card .d-flex.justify-content-between button { width: 100%; max-width: 100% !important; }

    /* Table suivi colis → cards mobile */
    .card-colis .table-responsive { overflow: visible; }
    #suivi-table { display: block; border: none; background: transparent; }
    #suivi-table thead { display: none; }
    #suivi-table tbody { display: flex; flex-direction: column; gap: 0.75rem; }
    #suivi-table tbody tr {
        display: block;
        border: 1px solid var(--border);
        border-top: 3px solid #FFCD00;
        border-radius: 12px;
        padding: 0.75rem 1rem;
        background: var(--bg-secondary);
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    #suivi-table tbody tr:hover td { background: transparent; }
    #suivi-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 0.35rem 0;
        border-top: 1px solid rgba(255,255,255,0.05);
        font-size: 0.92rem;
    }
    #suivi-table tbody tr td:first-child { border-top: none; }
    #suivi-table tbody td::before {
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--text-secondary);
        margin-right: 0.75rem;
        flex-shrink: 0;
        letter-spacing: 0.3px;
        padding-top: 2px;
    }
    #suivi-table tbody td:last-child {
        justify-content: flex-end;
        border-top: 1px solid var(--border);
        padding-top: 0.6rem;
        margin-top: 0.25rem;
        gap: 0.5rem;
    }
    #suivi-table tbody td:last-child::before { display: none; }
    #suivi-table tbody td:last-child .d-flex { flex-wrap: nowrap; gap: 0.5rem; }
    #suivi-table tbody td:last-child form.d-inline { display: flex; }
    #suivi-table tbody td:last-child .btn { font-size: 0.88rem; padding: 0.5rem 1rem; }
    #suivi-table .btn-secondary::after { content: ' Notes'; }
    #suivi-table .btn-danger::after { content: ' Supprimer'; }
    /* Ligne édition notes */
    #suivi-table tbody tr[id^="note-row"] { border-top: none; border-radius: 0 0 12px 12px; padding: 0.5rem; margin-top: -0.5rem; }
    #suivi-table tbody tr[id^="note-row"] td { display: block; border: none; padding: 0.5rem 0; }
    #suivi-table tbody tr[id^="note-row"] td::before { display: none; }

    /* Table admins → cards mobile */
    #admins-table { display: block; border: none; background: transparent; }
    #admins-table thead { display: none; }
    #admins-table tbody { display: flex; flex-direction: column; gap: 0.75rem; }
    #admins-table tbody tr {
        display: block;
        border: 1px solid var(--border);
        border-top: 3px solid #3498db;
        border-radius: 12px;
        padding: 0.75rem 1rem;
        background: var(--bg-secondary);
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    #admins-table tbody tr:hover td { background: transparent; }
    #admins-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.35rem 0;
        border-top: 1px solid rgba(255,255,255,0.05);
        font-size: 0.95rem;
    }
    #admins-table tbody tr td:first-child { display: none; }
    #admins-table tbody tr td:nth-child(2) { border-top: none; }
    #admins-table tbody td::before {
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--text-secondary);
        margin-right: 0.75rem;
        flex-shrink: 0;
    }
    #admins-table tbody td:nth-child(2)::before { display: none; }
    #admins-table tbody td:last-child {
        justify-content: flex-end;
        border-top: 1px solid var(--border);
        padding-top: 0.6rem;
    }
    #admins-table tbody td:last-child::before { display: none; }
    #admins-table td:last-child form.d-inline { display: flex; width: 100%; }
    #admins-table td:last-child .btn { width: 100%; justify-content: center; font-size: 0.92rem; padding: 0.55rem; }
    #admins-table .btn-danger::after { content: ' Supprimer'; }

    /* ---- Gestion pièces : tableau → cards mobile ---- */
    .card-pieces .table-responsive { overflow: visible; }

    #pieces-table { display: block; border: none; background: transparent; }
    #pieces-table thead { display: none; }
    #pieces-table tbody { display: flex; flex-direction: column; gap: 0.85rem; }

    #pieces-table tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        border: 1px solid var(--border);
        border-radius: 12px;
        overflow: hidden;
        background: var(--bg-secondary);
        box-shadow: 0 2px 10px rgba(0,0,0,0.18);
    }
    #pieces-table tbody tr:hover td { background: transparent; }

    /* Image — pleine largeur en haut */
    #pieces-table tbody tr td:nth-child(1) {
        grid-column: 1 / 4; grid-row: 1;
        padding: 0;
        border: none;
        background: var(--bg-primary);
    }
    #pieces-table tbody tr td:nth-child(1) img {
        width: 100% !important; height: 160px !important;
        border-radius: 0;
        object-fit: cover;
        display: block;
    }

    /* Nom + référence */
    #pieces-table tbody tr td:nth-child(2) {
        grid-column: 1 / 4; grid-row: 2;
        padding: 0.85rem 1rem 0.2rem;
        border: none;
        text-align: center;
        font-size: 1.35rem;
    }
    #pieces-table tbody tr td:nth-child(2) strong { font-size: 1.35rem; }
    #pieces-table tbody tr td:nth-child(2) small  { font-size: 1rem; }

    /* Marque / Modèle */
    #pieces-table tbody tr td:nth-child(3) {
        grid-column: 1 / 4; grid-row: 3;
        padding: 0 1rem 0.75rem;
        border: none;
        font-size: 1.2rem;
        text-align: center;
    }
    #pieces-table tbody tr td:nth-child(3) small { font-size: 1.1rem; }

    /* Prix */
    #pieces-table tbody tr td:nth-child(4) {
        grid-column: 1; grid-row: 4;
        padding: 0.7rem 0.5rem;
        border-top: 1px solid var(--border);
        display: flex; align-items: center; justify-content: center;
        font-size: 1.2rem;
    }

    /* Type (badge) */
    #pieces-table tbody tr td:nth-child(5) {
        grid-column: 2; grid-row: 4;
        padding: 0.7rem 0.3rem;
        border-top: 1px solid var(--border);
        display: flex; align-items: center; justify-content: center;
        font-size: 1.1rem;
    }

    /* Stock */
    #pieces-table tbody tr td:nth-child(6) {
        grid-column: 3; grid-row: 4;
        padding: 0.7rem 0.5rem;
        border-top: 1px solid var(--border);
        display: flex; align-items: center; justify-content: center;
        font-size: 1.1rem; color: var(--text-secondary);
        gap: 3px;
    }
    #pieces-table tbody tr td:nth-child(6)::before {
        content: 'Stk ';
        font-size: 0.85rem; font-weight: 700;
        text-transform: uppercase; color: var(--text-secondary);
    }

    /* Actions — pleine largeur en bas */
    #pieces-table tbody tr td:nth-child(7) {
        grid-column: 1 / 4; grid-row: 5;
        padding: 0.6rem 0.75rem;
        border-top: 1px solid var(--border);
        background: rgba(230,57,70,0.04);
        display: flex;
    }
    #pieces-table tbody tr td:nth-child(7) .d-flex {
        width: 100%; gap: 0.5rem !important; flex-wrap: nowrap !important;
    }
    #pieces-table tbody tr td:nth-child(7) .btn {
        flex: 1; display: inline-flex; align-items: center;
        justify-content: center; gap: 0.4rem;
        font-size: 0.92rem; padding: 0.6rem 0.5rem;
    }
    #pieces-table tbody tr td:nth-child(7) form.d-inline {
        flex: 1; display: flex;
    }
    #pieces-table tbody tr td:nth-child(7) form.d-inline .btn { width: 100%; }

    /* Libellé des boutons visible sur mobile */
    #pieces-table .btn-warning::after { content: ' Modifier'; }
    #pieces-table .btn-danger::after  { content: ' Supprimer'; }
}

@media (max-width: 575px) {
    /* 1 seul résultat → card pleine largeur */
    #pieces-grid .grid-item:only-child {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    /* Stat cards : rectangulaires sobres sur mobile */
    .stat-card {
        border-radius: 20px;
        width: 100%;
        height: auto;
        min-height: 80px;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        padding: 1rem 1.2rem;
        gap: 1rem;
        text-align: left;
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border) !important;
        border-left: 4px solid !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }
    .stat-card-pieces   { border-left-color: var(--accent) !important; }
    .stat-card-messages { border-left-color: #2ecc71 !important; }
    .stat-card-admins   { border-left-color: #3498db !important; }
    .stat-card-colis    { border-left-color: #FFCD00 !important; }
    .stat-card-todos         { border-left-color: #f39c12 !important; }
    .stat-card-facturation   { border-left-color: #9b59b6 !important; }

    .stat-icon {
        position: static;
        transform: none;
        width: 40px; height: 40px;
        font-size: 1.2rem;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        opacity: 1 !important;
    }
    .stat-icon.red     { background: rgba(230,57,70,0.15) !important;  color: var(--accent); }
    .stat-icon.green   { background: rgba(46,204,113,0.15) !important; color: #2ecc71; }
    .stat-icon.blue    { background: rgba(52,152,219,0.15) !important; color: #3498db; }
    .stat-icon.laposte { background: rgba(255,205,0,0.15) !important;  color: #FFCD00; }
    .stat-icon.orange  { background: rgba(243,156,18,0.15) !important; color: #f39c12; }
    .stat-icon.purple  { background: rgba(155,89,182,0.15) !important; color: #9b59b6; }

    .stat-info {
        position: static;
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
    }
    .stat-info .stat-value {
        font-size: 1.8rem;
        color: var(--text-primary) !important;
        text-shadow: none !important;
    }
    .stat-info .stat-label {
        font-size: 0.72rem;
        color: var(--text-secondary) !important;
        text-shadow: none !important;
    }

    /* Navbar admin mobile — logo centré + boutons en dessous */
    .navbar-admin .container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    .navbar-admin .navbar-brand {
        width: 100%;
        text-align: center;
        margin: 0;
    }
    .admin-nav-actions {
        width: 100%;
        justify-content: center !important;
        margin: 0 !important;
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }
    .admin-nav-actions .btn-accent,
    .admin-nav-actions .btn-ghost {
        font-size: 0.95rem !important;
        padding: 0.55rem 1.4rem !important;
    }
    .admin-nav-actions span { display: none; }

    /* Footer mobile */
    .site-footer { padding: 2rem 0 1.5rem; }
    .site-footer .row { text-align: center; }
    .site-footer .col-lg-4,
    .site-footer .col-md-6,
    .site-footer .col-lg-2 { margin-bottom: 1.5rem; }
    .footer-logo { font-size: 1.6rem; }
    .footer-desc { font-size: 1rem; }
    .footer-heading { font-size: 1.1rem; margin-bottom: 0.75rem; }
    .footer-links li a { font-size: 1rem; }
    .footer-social { justify-content: center; }
    .social-btn { width: 46px; height: 46px; font-size: 1.3rem; }
    .footer-copy { font-size: 0.9rem; padding: 0 1rem; }
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 1.75rem; }
    .product-card .card-price { font-size: 1.2rem; }
}

/* ============================================================
   PUBLIC BOTTOM NAV BAR (mobile)
   ============================================================ */
/* Masqué sur desktop, visible uniquement via media query mobile */
@media (min-width: 992px) {
    .public-bottom-nav {
        display: none !important;
    }
}

@media (max-width: 991px) {
    /* Masquer hamburger + collapse sur mobile public */
    .navbar-public .navbar-toggler { display: none !important; }
    .navbar-public .navbar-collapse { display: none !important; }

    /* Logo centré sur mobile public */
    .navbar-public .container {
        justify-content: center !important;
    }
    .navbar-public .navbar-brand {
        margin: 0 auto;
    }

    /* Padding-bottom pour la bottom nav fixe */
    body.body-public {
        padding-bottom: calc(65px + env(safe-area-inset-bottom, 0px));
    }

    /* Bottom nav visible et fixe */
    .public-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1050;
        background: var(--bg-secondary);
        border-top: 1px solid var(--border);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
    }

    .pbn-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 0.6rem 0.25rem;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 0.68rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        transition: color 0.2s;
        position: relative;
    }

    .pbn-item i {
        font-size: 1.25rem;
        line-height: 1;
    }

    .pbn-item:hover,
    .pbn-item.active {
        color: var(--accent);
        text-decoration: none;
    }

    .pbn-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 25%;
        right: 25%;
        height: 2px;
        background: var(--accent);
        border-radius: 0 0 2px 2px;
    }
}
