/* ============================================================
   TECHDEFENSE — Thème France Élégant — RESPONSIVE
   Palette : Bleu Marine #002395 · Blanc #FFFFFF · Rouge #ED2939
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Source+Sans+3:wght@300;400;600&display=swap');

:root {
    --bleu:        #002395;
    --rouge:       #ED2939;
    --blanc:       #FFFFFF;
    --bleu-clair:  #dce2f3;
    --bleu-pale:   #f0f3fc;
    --gris-clair:  #F4F4F0;
    --gris-texte:  #2a2a2a;
    --gris-moyen:  #888;
    --ombre:       0 2px 12px rgba(0,35,149,0.10);
    --ombre-forte: 0 4px 24px rgba(0,35,149,0.16);
}

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

body {
    width: 100%;
    max-width: 1060px;
    margin: 0 auto;
    background-color: var(--gris-clair);
    font-family: 'Source Sans 3', 'Segoe UI', Tahoma, sans-serif;
    color: var(--gris-texte);
    font-size: 15px;
    line-height: 1.6;
}

body::before {
    content: '';
    display: block;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right,
        var(--bleu) 33.33%,
        var(--blanc) 33.33%, var(--blanc) 66.66%,
        var(--rouge) 66.66%
    );
}

/* ============================================================
   HEADER
   ============================================================ */
header {
    background-color: var(--bleu);
    color: var(--blanc);
    display: flex;
    align-items: stretch;
    min-height: 72px;
    box-shadow: var(--ombre-forte);
    position: relative;
}

header::before {
    content: '';
    display: block;
    width: 8px;
    background-color: var(--rouge);
    flex-shrink: 0;
}

.header-inner {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 0 20px;
    gap: 14px;
}

header img {
    height: 46px;
    display: block;
    border: 2px solid rgba(255,255,255,0.22);
    border-radius: 4px;
    padding: 2px;
    flex-shrink: 0;
}

header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--blanc);
    flex: 1;
    min-width: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

header h1 span {
    display: block;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.60);
    margin-top: 3px;
}

/* ============================================================
   BURGER BUTTON
   ============================================================ */
.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 4px;
    cursor: pointer;
    padding: 7px;
    flex-shrink: 0;
}

.burger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--blanc);
    border-radius: 2px;
    transition: all 0.25s;
}

.burger-btn.ouvert span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.burger-btn.ouvert span:nth-child(2) { opacity: 0; }
.burger-btn.ouvert span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================================================
   NAV HAUTE
   ============================================================ */
nav#menu_haut { display: flex; align-items: center; }

nav#menu_haut ul {
    list-style: none;
    display: flex;
    gap: 4px;
}

nav#menu_haut ul li a {
    text-decoration: none;
    color: rgba(255,255,255,0.82);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: 3px;
    border: 1px solid transparent;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
}

nav#menu_haut ul li a:hover,
nav#menu_haut ul li a.actif {
    background-color: var(--rouge);
    color: var(--blanc);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.contenu-principal {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 12px 28px;
}

/* ============================================================
   MENU GAUCHE
   ============================================================ */
nav#menu_gauche {
    width: 208px;
    flex-shrink: 0;
    background-color: var(--blanc);
    border: 1px solid var(--bleu-clair);
    border-top: 4px solid var(--bleu);
    box-shadow: var(--ombre);
}

nav#menu_gauche h1 {
    background-color: var(--bleu);
    color: var(--blanc);
    font-family: 'Source Sans 3', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding: 12px 16px;
    margin: 0;
}

nav#menu_gauche ul {
    list-style: none;
    padding: 8px 0;
}

nav#menu_gauche ul li a {
    display: block;
    text-decoration: none;
    color: var(--gris-texte);
    font-size: 14px;
    padding: 9px 16px 9px 20px;
    border-left: 3px solid transparent;
    transition: all 0.16s;
}

nav#menu_gauche ul li a:hover,
nav#menu_gauche ul li a.active {
    background-color: var(--bleu-pale);
    color: var(--bleu);
    border-left-color: var(--rouge);
    font-weight: 600;
}

/* ============================================================
   SECTION
   ============================================================ */
section {
    flex: 1;
    min-width: 0;
    background-color: var(--blanc);
    border: 1px solid var(--bleu-clair);
    border-top: 4px solid var(--bleu);
    box-shadow: var(--ombre);
    padding: 28px 28px;
    overflow: auto;
    min-height: 400px;
}

section h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--bleu);
    border-bottom: 2px solid var(--bleu-clair);
    padding-bottom: 12px;
    margin-bottom: 24px;
}

section h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 17px;
    color: var(--gris-texte);
    margin-bottom: 14px;
    line-height: 1.45;
}

/* ============================================================
   ARTICLES PRODUITS
   ============================================================ */
article {
    display: flex;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid var(--bleu-clair);
    align-items: flex-start;
}
article:last-child { border-bottom: none; }

article img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 1px solid var(--bleu-clair);
    border-radius: 4px;
    flex-shrink: 0;
}

aside { flex: 1; min-width: 0; }

aside h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 16px;
    color: var(--bleu);
    border: none;
    padding: 0;
    margin-bottom: 6px;
    display: block;
}

aside p { font-size: 14px; color: #555; margin-bottom: 6px; }
aside p strong { color: var(--rouge); font-size: 15px; }
aside a { vertical-align: middle; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    border-top: 3px solid var(--bleu);
    background-color: var(--blanc);
    box-shadow: 0 -2px 8px rgba(0,35,149,0.07);
    margin-top: 4px;
}

footer::after {
    content: '';
    display: block;
    height: 5px;
    background: linear-gradient(to right,
        var(--bleu) 33.33%,
        var(--blanc) 33.33%, var(--blanc) 66.66%,
        var(--rouge) 66.66%
    );
}

nav#menu_bas { padding: 4px 0; }

nav#menu_bas ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    padding: 6px 16px;
    gap: 2px;
}

nav#menu_bas ul li { display: inline-block; }

nav#menu_bas ul li a {
    text-decoration: none;
    color: var(--gris-moyen);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 12px;
    transition: color 0.14s;
}

nav#menu_bas ul li a:hover,
nav#menu_bas ul li a.actif { color: var(--bleu); }

footer p {
    color: var(--gris-moyen);
    text-align: right;
    font-size: 11px;
    font-style: italic;
    padding: 4px 16px 10px;
}

/* ============================================================
   TABLEAUX
   ============================================================ */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
}

table thead {
    background-color: var(--bleu);
    color: var(--blanc);
}

table thead th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.05em;
    font-size: 11px;
    text-transform: uppercase;
    white-space: nowrap;
}

table tbody tr {
    border-bottom: 1px solid var(--bleu-clair);
    transition: background 0.14s;
}
table tbody tr:hover { background-color: var(--bleu-pale); }
table tbody td { padding: 9px 12px; }

a.supprimer { color: var(--rouge); text-decoration: none; font-weight: 600; font-size: 12px; }
a.supprimer:hover { text-decoration: underline; }

/* ============================================================
   DASHBOARD STATS
   ============================================================ */
.stats {
    display: flex;
    gap: 12px;
    margin: 20px 0 28px;
    flex-wrap: wrap;
}

.stat-box {
    background: var(--bleu);
    color: var(--blanc);
    padding: 16px 20px;
    border-radius: 4px;
    text-align: center;
    flex: 1;
    min-width: 90px;
    border-bottom: 4px solid var(--rouge);
    box-shadow: var(--ombre);
    transition: transform 0.14s;
}
.stat-box:hover { transform: translateY(-2px); }

.stat-box .nb {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.2em;
    font-weight: 700;
    display: block;
}

.stat-box .label {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.72);
    display: block;
    margin-top: 3px;
}

/* ============================================================
   DIVERS
   ============================================================ */
.message { color: var(--rouge); font-weight: 600; }
img { border: none; max-width: 100%; height: auto; }

/* ============================================================
   PAGE D'ACCUEIL
   ============================================================ */
.hero-banner {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--bleu) 60%, var(--rouge) 100%);
}

.hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
    border-radius: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,35,149,0.85) 50%, rgba(0,35,149,0.30) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 32px;
}

.hero-titre {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 28px;
    color: var(--blanc);
    border: none;
    padding: 0;
    margin: 0 0 6px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hero-sous-titre {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    font-weight: 300;
}

.hero-cta {
    display: inline-block;
    background: var(--rouge);
    color: var(--blanc);
    padding: 9px 22px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 3px;
    width: fit-content;
    transition: background 0.18s, transform 0.12s;
    border-bottom: 3px solid #a00018;
}

.hero-cta:hover {
    background: #c0001e;
    transform: translateY(-1px);
}

.home-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.home-stat {
    flex: 1;
    min-width: 90px;
    background: var(--bleu);
    color: var(--blanc);
    border-radius: 4px;
    padding: 14px 12px;
    text-align: center;
    border-bottom: 3px solid var(--rouge);
    box-shadow: var(--ombre);
    transition: transform 0.14s;
}
.home-stat:hover { transform: translateY(-2px); }

.home-stat-nb {
    display: block;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.8em;
    font-weight: 700;
}

.home-stat-label {
    display: block;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.70);
    margin-top: 2px;
}

.home-tip {
    background: var(--bleu-pale);
    border-left: 4px solid var(--rouge);
    padding: 14px 18px;
    font-size: 13px;
    color: #444;
    margin-bottom: 0;
    border-radius: 0 3px 3px 0;
}

.categorie-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--blanc);
    border: 1px solid var(--bleu-clair);
    border-top: 3px solid var(--bleu);
    border-radius: 4px;
    padding: 16px 12px;
    text-decoration: none;
    min-width: 90px;
    flex: 1;
    box-shadow: var(--ombre);
    transition: border-top-color 0.16s, transform 0.14s, box-shadow 0.14s;
}

.cat-card:hover {
    border-top-color: var(--rouge);
    transform: translateY(-3px);
    box-shadow: var(--ombre-forte);
}

.cat-icon { font-size: 26px; line-height: 1; }

.cat-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bleu);
    text-align: center;
}

/* ============================================================
   3D VIEWER — masqué en dessous de 1300px
   ============================================================ */
#viewer3d-container {
    position: fixed;
    left: 0;
    top: 90px;
    bottom: 0;
    width: calc((100vw - 1060px) / 2);
    min-width: 80px;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   TABLETTE (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
    #viewer3d-container { display: none !important; }

    nav#menu_gauche { width: 180px; }

    section { padding: 20px 18px; }

    header h1 { font-size: 19px; }

    nav#menu_haut ul li a {
        padding: 7px 10px;
        font-size: 11px;
    }
}

/* ============================================================
   MOBILE (≤ 660px)
   ============================================================ */
@media (max-width: 660px) {
    /* Viewport */
    .header-inner {
        flex-wrap: nowrap;
        padding: 0 12px;
    }

    header {
        min-height: 58px;
        position: sticky;
        top: 0;
        z-index: 200;
    }

    header h1 { font-size: 16px; }
    header h1 span { display: none; }

    /* Burger */
    .burger-btn { display: flex; }

    /* Nav mobile */
    nav#menu_haut {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bleu);
        z-index: 150;
        border-top: 2px solid var(--rouge);
        box-shadow: 0 8px 20px rgba(0,0,0,0.28);
    }

    nav#menu_haut.ouvert { display: block; }

    nav#menu_haut ul {
        flex-direction: column;
        gap: 0;
        padding: 6px 0 10px;
    }

    nav#menu_haut ul li a {
        display: block;
        padding: 13px 20px;
        font-size: 13px;
        letter-spacing: 0.06em;
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }

    /* Layout colonne */
    .contenu-principal {
        flex-direction: column;
        padding: 10px 8px 20px;
        gap: 10px;
    }

    /* Sidebar → barre horizontale */
    nav#menu_gauche {
        width: 100%;
        border-top-width: 3px;
    }

    nav#menu_gauche ul {
        display: flex;
        flex-wrap: wrap;
        padding: 4px 0;
        gap: 0;
    }

    nav#menu_gauche ul li {
        flex: 1;
        min-width: 110px;
    }

    nav#menu_gauche ul li a {
        text-align: center;
        font-size: 12px;
        padding: 8px 8px;
        border-left: none;
        border-bottom: 2px solid transparent;
    }

    nav#menu_gauche ul li a:hover,
    nav#menu_gauche ul li a.active {
        border-left-color: transparent;
        border-bottom-color: var(--rouge);
    }

    /* Section pleine largeur */
    section {
        width: 100%;
        min-width: 0;
        padding: 14px 12px;
        min-height: unset;
    }

    section h1 { font-size: 18px; }

    /* Hero */
    .hero-banner { height: 140px; }
    .hero-overlay { padding: 0 16px; }
    .hero-titre { font-size: 18px; }
    .hero-sous-titre { display: none; }
    .hero-cta { font-size: 10px; padding: 7px 14px; }

    /* Stats accueil 2 colonnes */
    .home-stat {
        flex-basis: calc(50% - 8px);
        min-width: calc(50% - 8px);
    }

    /* Catégories 3 par ligne */
    .cat-card {
        flex-basis: calc(33.33% - 8px);
        min-width: calc(33.33% - 8px);
        padding: 10px 6px;
    }
    .cat-icon { font-size: 20px; }
    .cat-label { font-size: 9px; letter-spacing: 0; }

    /* Articles */
    article { gap: 10px; }
    article img { width: 80px; height: 80px; }
    aside h1 { font-size: 14px; }
    aside p { font-size: 12px; }

    /* Tables scroll */
    section > table,
    .table-responsive table {
        min-width: 500px;
    }

    /* Wrapper tables si pas déjà wrappé */
    section table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Footer */
    nav#menu_bas ul { justify-content: center; }
    footer p { text-align: center; padding: 6px 12px 10px; }

    /* Stats dashboard */
    .stat-box {
        flex-basis: calc(50% - 6px);
        min-width: calc(50% - 6px);
    }
}

/* ============================================================
   TRÈS PETIT MOBILE (≤ 380px)
   ============================================================ */
@media (max-width: 380px) {
    header h1 { font-size: 14px; }

    .cat-card {
        flex-basis: calc(50% - 4px);
        min-width: calc(50% - 4px);
    }

    article img { width: 60px; height: 60px; }

    .hero-banner { height: 120px; }
    .hero-titre { font-size: 16px; }
}
