/* ============================= */
/* 1. Styles généraux            */
/* ============================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #000050;       /* bleu nuit */
    color: #f0f0f0;                  /* texte clair */
    min-height: 100vh;
}
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    background-color: #000050;
    color: #f0f0f0;
}

.layout {
    display: flex;
    flex: 1; /* Prend tout l'espace dispo avant le footer */
}

/* ============================= */
/* 2. Header                      */
/* ============================= */
.site-header {
    min-height: 60px;
    background-color: #070c5b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    border-bottom: 1px solid #222;
}
.site-header h1 {
    font-size: 1.2rem;
    color: #fff;
}
.site-header .user-actions {
    display: flex;
    align-items: center;
}
.site-header .username {
    margin-right: 1rem;
}
.btn-logout {
    background-color: #440000;
    color: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    text-decoration: none;
}

/* ============================= */
/* 3. Navigation (menu principal) */
/* ============================= */
nav.site-menu {
    width: 240px;
    background-color: #070c5b;
    transition: transform 0.3s ease;
    overflow-y: auto;
}
ul.menu-principal {
    list-style: none;
}
ul.menu-principal > li {
    border-bottom: 1px solid #222;
}
ul.menu-principal li a {
    display: block;
    padding: 0.75rem 1rem;
    color: #f0f0f0;
    text-decoration: none;
}
ul.menu-principal li a:hover,
ul.menu-principal li.active > a {
    background-color: #333399;
}

/* ============================= */
/* 4. Sous-menu                   */
/* ============================= */
ul.sous-menu {
    list-style: none;
    padding-left: 1rem;
    display: none;
}
li.open > ul.sous-menu { display: block; }

ul.sous-menu li a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}
ul.menu-principal li.active > ul.sous-menu {
    display: block;
}

/* style du lien actif */
li.active > a { background-color: #333399; }

/* ============================= */
/* 5. Onglets                     */
/* ============================= */
ul.tabs {
    list-style: none;
    display: flex;
    border-bottom: 1px solid #222;
    margin-bottom: 1rem;
}
ul.tabs li {
    margin-right: 1rem;
}
ul.tabs li a {
    color: #f0f0f0;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: none;
}
ul.tabs li a.active {
    background-color: #000080;
    border-color: #000080 #000080 #000060;
    border-radius: 4px 4px 0 0;
}
@media (max-width: 768px) {
    nav.menu-principal {
        width: 100%;
        display: none;
        flex-direction: column;
        gap: 10px;
        margin: 0;
    }

    nav.site-menu.open {
        display: flex;
    }

    ul.menu-principal,
    ul.sous-menu {
        flex-direction: column;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    ul.sous-menu {
        display: none; /* on masque sauf si activé */
    }

    li.open > ul.sous-menu {
        display: block;
    }

    #menu-toggle {
        display: block;
    }
}
/* Par défaut : on affiche le texte, pas l’icône */
.btn-logout .logout-icon {
    display: none;
}
.btn-logout .logout-text {
    display: inline;
}

/* En mobile, on inverse : texte masqué, icône affichée */
@media (max-width: 768px) {
    .btn-logout .logout-text {
        display: none;
    }
    .btn-logout .logout-icon {
        display: inline;
        font-size: 1.2rem;
        margin-left: 0.2rem;
    }
}
/* Masquer en version mobile */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}


/* ============================= */
/* 6. Contenu principal           */
/* ============================= */
main.content {
    flex-grow: 1;
    padding: 1rem;
}

/* ============================= */
/* 7. Bouton hamburger (mobile)   */
/* ============================= */
#menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    padding: 0.75rem;
    cursor: pointer;
}

/* ============================= */
/* 8. Responsive (mobile)         */
/* ============================= */
@media (max-width: 768px) {
    /* Header reste en haut */
    .layout {
        flex-direction: column;
    }
    /* Afficher le bouton menu */
    #menu-toggle {
        display: block;
    }
    /* Masquer le menu par défaut */
    nav.site-menu {
        position: absolute;
        top: 60px;
        left: 0;
        transform: translateX(-100%);
        width: 80%;
        height: calc(100% - 60px);
        z-index: 1000;
    }
    /* Quand la classe .open est appliquée */
    nav.site-menu.open {
        transform: translateX(0);
    }
    /* Ajustement du contenu */
    main.content {
        padding: 1rem 0.5rem;
    }
}
/* Section Support */
.support-section {
    margin: 1rem;
}
.support-section h2 {
    margin-bottom: 0.5rem;
    color: #fff;
}
.support-section p {
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Formulaire de support */
.support-form label {
    display: block;
    margin-top: 1rem;
    font-weight: bold;
}
.support-form input,
.support-form textarea {
    width: 100%;
    padding: 0.6rem;
    margin-top: 0.3rem;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #000080;
    color: #f0f0f0;
}
.support-form button {
    margin-top: 1.2rem;
    padding: 0.8rem 1.5rem;
    background-color: #002080;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.support-form button:hover {
    background-color: #0030a0;
}
.construction {
    text-align: center;
    margin-top: 2rem;
}
.construction h2 {
    font-size: 1.5rem;
    color: #fff;
}
.construction p {
    margin-top: 1rem;
    color: #ccc;
}
.construction a {
    color: #66f;
    text-decoration: underline;
}
/* ======= Section accueil (dashboard) ======= */
.welcome-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}
.welcome-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}
.welcome-header .welcome-subtitle {
    font-size: 1.1rem;
    color: #cccccc;
    margin-bottom: 1.5rem;
}

/* ======= Cartes d’accès rapide ======= */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
.card {
    background-color: #001040;
    border: 1px solid #002060;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: #f0f0f0;
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.card:hover {
    background-color: #002060;
    transform: translateY(-5px);
}
.card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.card-title {
    font-size: 1.1rem;
    font-weight: bold;
}

/* ======= Responsive small ======= */
@media (max-width: 600px) {
    .welcome-header h2 {
        font-size: 1.5rem;
    }
    .welcome-header .welcome-subtitle {
        font-size: 1rem;
    }
    .card {
        padding: 1rem;
    }
    .card-icon {
        font-size: 2rem;
    }
    .card-title {
        font-size: 1rem;
    }
}
/* ===== Menu design avec icônes ===== */
nav.site-menu {
    background: #070c5b;
    min-width: 240px;
    position: relative;
    transition: transform .3s ease;
}
.menu-principal, .sous-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}
.menu-principal > li, .sous-menu > li {
    border-bottom: 1px solid #111;
}
nav.site-menu li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #eee;
    text-decoration: none;
    transition: background .2s;
}
nav.site-menu li a .icone {
    width: 24px;
    text-align: center;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}
nav.site-menu li a .libelle {
    flex-grow: 1;
}

/* Item actif */
nav.site-menu li.active > a,
nav.site-menu li a:hover {
    background: #002080;
}

/* Sous-menu (niveau 1+) masqué par défaut */
.sous-menu {
    display: none;
}
nav.site-menu li.open > .sous-menu {
    display: block;
}

/* Styles pour le bouton hamburger mobile */
#menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    padding: 0.75rem;
    cursor: pointer;
}

/* Responsive mobile */
@media (max-width: 768px) {
    nav.site-menu {
        position: absolute;
        left: 0; top: 60px;
        height: calc(100% - 60px);
        transform: translateX(-100%);
        z-index: 1000;
        max-width: 240px;
    }
    nav.site-menu.open {
        transform: translateX(0);
    }
    #menu-toggle {
        display: block;
    }
}
/* Grille responsive des widgets */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

/* Carte de chaque widget */
.widget-card {
    background: #001040;
    border: 1px solid #002060;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Titre */
.widget-card header {
    background: #000080;
    padding: 0.5rem;
}
.widget-card header h3 {
    color: #fff;
    font-size: 1rem;
    margin: 0;
}

/* Container pour forcer le ratio 16:9 */
.iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    flex-grow: 1;
}
.iframe-container iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* Responsive mobile */
@media (max-width: 600px) {
    .widgets-grid {
        grid-template-columns: 1fr;
    }
}

/* Zone d'édition Summernote */
.note-editor .note-editable {
    color: black !important;
    background: #fff !important;
    text-align: left !important;
    min-height: 200px;            /* confort */
}
/* Évite que l’éditeur soit centré par un parent .text-center éventuel */
.note-editor.note-frame {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* --- Floating Action Buttons --- */
.fab-container{
    position: fixed;
    right: 24px;
    bottom: max(66px, env(safe-area-inset-bottom, 16px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1050; /* au-dessus des cartes */
}

.fab{
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    text-decoration: none;
    box-shadow: 0 10px 20px rgba(0,0,0,.18), 0 6px 6px rgba(0,0,0,.12);
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.96;
}

.fab:focus { outline: none; box-shadow: 0 0 0 4px rgba(13,110,253,.25), 0 10px 20px rgba(0,0,0,.18); }
.fab:hover { transform: translateY(-2px); opacity: 1; }

.fab-primary{
    background: var(--bs-primary);
    color: #fff;
}
.fab-primary:hover{ background: #0b5ed7; }

.fab-secondary{
    background: var(--bs-secondary);
    color: #fff;
}
.fab-secondary:hover{ background: #5c636a; }

.fab-success { background:#198754; color:#fff; }
.fab-success:hover { background:#157347; color:#fff; }
.fab-success.disabled { opacity:.5; pointer-events:none; }
.d-inline-block[data-bs-toggle="tooltip"] { cursor: not-allowed; }

/* Optionnel: cacher les FAB à l’impression */
@media print{
    .fab-container{ display: none !important; }
}

/* Mini FAB sur mobile */
@media (max-width: 576px) {
    .fab-container{
        right: 16px;
        bottom: max(16px, env(safe-area-inset-bottom, 12px));
        gap: 10px;
    }
    .fab{
        width: 38px;
        height: 38px;
        font-size: 18px;          /* icône un poil plus petite */
        box-shadow: 0 8px 16px rgba(0,0,0,.18), 0 4px 6px rgba(0,0,0,.12);
    }
    .fab:hover{ transform: translateY(-1px); }
}

.select2-results__option {
    color: black !important;
}

.checkbox-td {
    text-align: center;
    vertical-align: middle;
}

.checkbox-import_four {
    margin: 0;
}

/* Cache le bouton quand inutile */
.fab.is-hidden { display: none; }

/* Petit état "loading" (optionnel) */
.fab.is-loading { opacity: 0.6; pointer-events: none; }

/* Expander dans pages/produits-list.php et btn toggle */
.expander-head, .expander-cell { width:40px; }
.toggle-children[aria-expanded="true"] .bi { transform: rotate(90deg); }
.child-row td { background-color: var(--bs-light); }
.child-bullet { margin-right:.5rem; opacity:.8; }
.hidden-by-filter {
    display: none !important;
}

/* Ne s'applique qu'aux boutons dans le <td class="products_list_actions"> */
.products_list_actions .btn .badge {
    font-size: 0.6rem;
    padding: 0.2em 0.35em;
    line-height: 1;          /* bien centré */
    min-width: auto;         /* pas de largeur mini imposée */
}

/* Classes Utilisées pour griser les boutons et checkbox de sélection dans les pages d'import StatWeb - ajout 12/09/2025 */
.is-disabled-control { opacity: .55; cursor: not-allowed !important; }
.is-disabled-wrap { cursor:not-allowed; }
.checkbox-td input[disabled] { opacity: .55; cursor: not-allowed; }
.checkbox-import_four[disabled] { opacity: .6; cursor: not-allowed; }
.checkbox-import_four[disabled]:checked { outline: 2px solid #aaa; }
.checkbox-import-marque[disabled] { opacity: .55; cursor: not-allowed; }
.checkbox-import-product[disabled],
.checkbox-import-product[data-locked="1"] {
    pointer-events: none; /* plus de clic possible */
}
.is-disabled-wrap { cursor: not-allowed; }

/* Boîte d’aide : s’applique partout (pas seulement dans #costs-block) */
/* Lien "Comprendre les calculs" — on laisse Bootstrap gérer via .text-white-50
   → on ne force PAS de couleur ici pour ne pas diverger entre pages */
.costs-help-box{
    background:#f3f4f6;
    color:#212529;
    border:1px solid rgba(0,0,0,.05);
    border-radius:.5rem;
    padding:.75rem 1rem;
}

#notify-container {
    margin-top: 3rem;
}