/* ===========================================================
   🌾 STYLE.CSS — VERSION PROPRE (CLAAS d'Or RP)
   - Reset + variables
   - Header + menu + panel admin
   - Cards / blocs / profils
   - Footer
   - Panel modération
   - Messenger flottant
   - Liens & boutons
   - Dark mode global
=========================================================== */

/* =======================
   VARIABLES
======================= */
:root{
    --green:#8FD83A;
    --gold:#d9b44a;
    --beige:#E9E5C7;
    --black:#0f0f0f;
    --grey:#2b2b2b;
}

/* =======================
   RESET DE BASE
======================= */
*{
    box-sizing:border-box;
}

body{
    margin:0;
    font-family:Segoe UI,system-ui,-apple-system,sans-serif;
    background:var(--beige);
    color:#222;
    transition:background .3s,color .3s;
}

.wrap{
    width:min(1280px,92vw);
    margin:0 auto;
}

/* ===========================================================
   HEADER PREMIUM
=========================================================== */

.topbar{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:10px 25px;
    background:#000;
    border-bottom:2px solid var(--green);
    position:sticky;
    top:0;
    z-index:9999;
}

.tb-left,
.tb-center,
.tb-right{
    display:flex;
    align-items:center;
}

/* --- Zone gauche --- */
.tb-left{
    gap:8px;
    min-width:230px;
}
.tb-logo{
    font-size:22px;
}
.tb-title{
    color:#fff;
    font-size:18px;
    font-weight:600;
}

/* --- Menu central --- */
.tb-center{
    flex:1;
    justify-content:center;
    gap:10px;
}
.tb-center a{
    display:inline-block;
    padding:6px 14px;
    font-size:14px;
    text-decoration:none;
    white-space:nowrap;
    background:#1a1a1a;
    color:#ddd;
    border-radius:10px;
    border:1px solid var(--green);
    transition:.22s;
}
.tb-center a:hover{
    background:var(--green);
    color:#000 !important;
    transform:translateY(-1px);
}

/* --- Zone droite --- */
.tb-right{
    gap:10px;
    min-width:260px;
    justify-content:flex-end;
}
.tb-user{
    color:#fff;
    font-size:14px;
    display:flex;
    align-items:center;
    gap:8px;
}

/* Badge rôle dans le header (plus compact) */
.tb-user .role-badge{
    padding:2px 8px;
    font-size:12px;
    border-radius:999px;
}

/* Bouton connexion / déconnexion */
.tb-logout{
    background:#1a1a1a;
    color:#ddd;
    padding:6px 10px;
    border-radius:8px;
    text-decoration:none;
    border:1px solid var(--green);
    transition:.22s;
}
.tb-logout:hover{
    background:var(--green);
    color:#000;
}

/* Boutons icônes (theme, messenger) */
.tb-btn{
    background:#1a1a1a;
    color:#ddd;
    border:1px solid var(--green);
    padding:8px;
    border-radius:10px;
    cursor:pointer;
    transition:.22s;
}
.tb-btn:hover{
    background:var(--green);
    color:#000;
}

/* ===========================================================
   PANEL ADMIN DANS LE HEADER
=========================================================== */

.tb-panel{
    position:relative;
}

.tb-panel-toggle{
    background:#1a1a1a;
    color:#eee;
    border:1px solid var(--green);
    padding:6px 12px;
    border-radius:10px;
    cursor:pointer;
    transition:.2s;
}
.tb-panel-toggle:hover{
    background:var(--green);
    color:#000;
}

/* Menu déroulant */
.tb-panel-menu{
    position:absolute;
    top:38px;
    right:0;
    background:#111;
    border:1px solid var(--green);
    border-radius:10px;
    padding:6px 0;
    display:none;
    min-width:170px;
    z-index:10000;
}
.tb-panel-menu a{
    display:block;
    padding:8px 14px;
    text-decoration:none;
    color:#eee;
    font-size:14px;
}
.tb-panel-menu a:hover{
    background:var(--green);
    color:#000;
}

/* Ouvert (classe .show gérée en JS) */
.tb-panel-menu.show{
    display:block;
}

/* ===========================================================
   HERO BANNER
=========================================================== */
.hero-banner img{
    width:100%;
    height:300px;
    object-fit:cover;
    border-bottom:2px solid var(--green);
}

/* ===========================================================
   CARDS / BLOCS
=========================================================== */
.card,
.page-box,
.block,
.content-box{
    background:#fffaf0;
    border:1px solid #e2d4a6;
    border-radius:14px;
    box-shadow:0 6px 18px rgba(0,0,0,.08);
    padding:18px 20px;
    color:#222;
}
.card + .card{
    margin-top:16px;
}

/* ===========================================================
   GRILLE MODS
=========================================================== */
.mods-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
    gap:20px;
    margin-top:20px;
}
.mod-card{
    background:#fffaf0;
    border:1px solid #d4c89a;
    border-radius:12px;
    padding:12px;
    text-align:center;
}
.mod-card .thumb{
    width:100%;
    height:140px;
    object-fit:cover;
    border-radius:10px;
    cursor:pointer;
    border:1px solid #ccc;
}

/* ===========================================================
   DROPDOWN GÉNÉRIQUE
=========================================================== */
.dropdown{
    position:relative;
}
.dropdown-menu{
    position:absolute;
    top:38px;
    left:0;
    background:#2b2b2b;
    border:1px solid #444;
    border-radius:8px;
    padding:8px;
    display:none;
    z-index:1000;
}
.dropdown-menu.show{
    display:block;
}
.dropdown-menu a{
    display:block;
    padding:6px 10px;
    color:#f5f5f5;
    text-decoration:none;
}
.dropdown-menu a:hover{
    background:var(--green);
    color:#111;
}

/* ===========================================================
   LIGHTBOX
=========================================================== */
.lightbox{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.85);
    display:flex;
    align-items:center;
    justify-content:center;
    z-index:9999;
}
.lightbox img{
    max-width:90vw;
    max-height:90vh;
    border:2px solid var(--green);
    border-radius:10px;
}

/* ===========================================================
   SIDEBAR PROFIL (BURGER)
=========================================================== */
.profile-sidebar{
    position:fixed;
    top:0;
    right:-280px;
    width:280px;
    height:100vh;
    background:#111;
    color:#eee;
    box-shadow:-6px 0 20px rgba(0,0,0,0.35);
    padding:25px;
    display:flex;
    flex-direction:column;
    gap:14px;
    transition:right .3s;
    z-index:99998;
}
.profile-sidebar.open{
    right:0;
}
.profile-sidebar h3{
    margin:0 0 12px;
    font-size:20px;
    font-weight:700;
}

/* Contenu du sidebar (liens, boutons) */
.profile-sidebar a{
    display:block;
    padding:10px 14px;
    background:#1f2937;
    color:#fff;
    border-radius:10px;
    font-size:15px;
    font-weight:500;
    text-decoration:none;
}
.profile-sidebar a:hover{
    background:var(--green);
    color:#000;
}

/* ===========================================================
   PAGE PROFIL
=========================================================== */
.profile-view{
    background:#fffaf0;
    border:1px solid #e2d4a6;
    border-radius:18px;
    box-shadow:0 10px 26px rgba(0,0,0,.08);
    overflow:hidden;
    margin:20px auto;
}
.profile-banner{
    height:160px;
    background:linear-gradient(90deg,var(--green),var(--gold));
}
.profile-header{
    display:flex;
    gap:20px;
    padding:20px 22px 10px;
    align-items:flex-end;
}
.profile-avatar{
    width:100px;
    height:100px;
    border-radius:50%;
    border:4px solid #fff;
    background-size:cover;
    background-position:center;
    margin-top:-60px;
}

/* ===========================================================
   BULLE PM (icône bas droite, si utilisée)
=========================================================== */
.chat-bubble-pm{
    position:fixed;
    bottom:22px;
    right:22px;
    width:62px;
    height:62px;
    background:var(--green);
    border-radius:50%;
    color:#111;
    font-size:30px;
    display:flex;
    justify-content:center;
    align-items:center;
    box-shadow:0 0 18px rgba(0,0,0,.35);
    cursor:pointer;
    transition:.25s;
    z-index:9999;
}
.chat-bubble-pm:hover{
    transform:scale(1.10);
}

/* ===========================================================
   FOOTER
=========================================================== */
.site-footer{
    text-align:center;
    padding:20px 0 35px;
    background:#000;
    border-top:2px solid var(--green);
    color:#fff;
}

.site-footer .motto{
    font-size:15px;
    margin-bottom:15px;
    color:var(--green);
}

.site-footer .social-icons{
    list-style:none;
    display:flex;
    justify-content:center;
    gap:26px;
    padding:10px 0 20px;
    margin:0;
}

.site-footer .social-icons img{
    width:52px;
    height:52px;
    padding:10px;
    border-radius:16px;
    background:rgba(255,255,255,0.06);
    border:2px solid rgba(158,253,56,0.35);
    box-shadow:0 0 8px rgba(0,0,0,0.25);
    transition:.22s ease-in-out;
}
.site-footer .social-icons img:hover{
    transform:scale(1.15) translateY(-3px);
    border-color:var(--green);
    box-shadow:0 0 18px rgba(158,253,56,0.7);
    background:rgba(158,253,56,0.08);
}

.site-footer .copy{
    margin-top:10px;
    font-size:14px;
    color:#ccc;
}

.site-footer .backtop a{
    display:inline-block;
    margin-top:8px;
    padding:6px 18px;
    border-radius:10px;
    background:var(--green);
    color:#000;
    text-decoration:none;
    font-weight:600;
    border:1px solid #78d92a;
}
.site-footer .backtop a:hover{
    background:#caff80;
    box-shadow:0 0 12px rgba(158,253,56,0.6);
}

/* ===========================================================
   PANEL MODÉRATION / ADMIN
=========================================================== */
.mod-panel{
    width:min(1200px,94vw);
    margin:20px auto 40px;
    display:flex;
    flex-direction:column;
    gap:25px;
}

.mod-panel-header{
    background:#fffaf0;
    border-left:6px solid var(--green);
    padding:20px 24px;
    border-radius:14px;
    box-shadow:0 4px 14px rgba(0,0,0,0.06);
    margin:20px 0;
}
.mod-panel-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(320px,1fr));
    gap:22px;
    margin-top:20px;
}
.mod-panel-card{
    background:#fffaf0;
    border:1px solid #e2d4a6;
    border-radius:14px;
    padding:20px 22px;
    box-shadow:0 6px 18px rgba(0,0,0,.08);
}
.mod-panel-card h2{
    margin-top:0;
    font-size:20px;
    display:flex;
    align-items:center;
    gap:10px;
}
.mod-panel-card p{
    margin:6px 0 12px;
    font-size:15px;
}

/* Sous-sections */
.mod-section{
    background:#fffaf0;
    border:1px solid #e0d9bb;
    border-left:4px solid var(--green);
    padding:18px 22px 22px;
    border-radius:14px;
    box-shadow:0 6px 18px rgba(0,0,0,0.07);
}
.mod-section h2{
    margin:0 0 12px;
    font-size:20px;
    display:flex;
    align-items:center;
    gap:10px;
}
.mod-section p{
    margin:4px 0 10px;
    font-size:15px;
}
.mod-tip{
    margin-top:12px;
    padding:10px 14px;
    background:#eaf9d8;
    border:1px solid #bfe29f;
    border-radius:10px;
    font-size:14px;
}

/* Boutons staff */
.btn-staff{
    display:inline-block;
    padding:8px 18px;
    font-size:14px;
    font-weight:600;
    margin:4px 0;
    background:#1a1a1a;
    color:#eee !important;
    border-radius:10px;
    border:1px solid var(--green);
    cursor:pointer;
    transition:.22s;
}
.btn-staff:hover{
    background:var(--green);
    color:#000 !important;
    transform:translateY(-2px);
    box-shadow:0 0 8px rgba(158,253,56,0.45);
}
.btn-staff.danger{
    background:#4a0000;
    border-color:#c22;
}
.btn-staff.danger:hover{
    background:#ff4444;
    border-color:#ff4444;
}
.btn-staff.warning{
    background:#4a3700;
    border-color:#d4a000;
}
.btn-staff.warning:hover{
    background:#ffdd66;
    border-color:#ffcc33;
    color:#000 !important;
}

/* Grille utilisateur */
.mod-user-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:22px;
    margin-top:20px;
}
@media(max-width:900px){
    .mod-user-grid{
        grid-template-columns:1fr;
    }
}

/* Badges */
.badge-role{
    background:var(--green);
    padding:4px 8px;
    border-radius:8px;
    color:#000;
    font-weight:600;
}
.badge-status{
    padding:4px 8px;
    border-radius:8px;
    font-weight:600;
}
.badge-banned{ background:#ff4444; }
.badge-suspended{ background:#ffcc33; }
.badge-ok{ background:#8FD83A; }

/* Tableaux */
.mod-table{
    width:100%;
    border-collapse:collapse;
    margin-top:12px;
    border-radius:12px;
    overflow:hidden;
}
.mod-table th{
    background:var(--green);
    color:#000;
    padding:10px;
    font-size:14px;
}
.mod-table td{
    padding:10px;
    background:#fffaf0;
    border-bottom:1px solid #dcd3b2;
    font-size:14px;
}
.mod-table tr:hover td{
    background:#f3ffd6;
}

/* ===========================================================
   BADGES DE RÔLES GÉNÉRAUX
=========================================================== */
.role-badge{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:4px 10px;
    border-radius:8px;
    font-size:13px;
    font-weight:600;
    color:#fff;
    box-shadow:0 2px 6px rgba(0,0,0,.35);
    border:1px solid rgba(255,255,255,0.15);
    transition:transform .18s, background .18s;
}
.role-badge:hover{
    transform:scale(1.05);
    background:rgba(158,253,56,0.15);
}

/* ===========================================================
   FLASH MESSAGES
=========================================================== */
.alert{
    padding:12px 16px;
    border-radius:8px;
    font-weight:600;
    margin:12px auto;
    width:min(1240px,92vw);
    animation:flashSlide .4s ease-out;
}
.alert-success{
    background:#d9ffd9;
    color:#178000;
    border:1px solid #79cc79;
}
.alert-error{
    background:#ffd6d6;
    color:#8b0000;
    border:1px solid #e38a8a;
}
.alert-warning{
    background:#fff3c4;
    color:#8a6d00;
    border:1px solid #e3c868;
}
@keyframes flashSlide{
    from{transform:translateY(-10px);opacity:0;}
    to{transform:translateY(0);opacity:1;}
}

/* ===========================================================
   MESSENGER FLOTTANT
=========================================================== */
.messenger-panel{
    position:fixed;
    bottom:90px;
    right:30px;
    width:420px;
    max-height:70vh;
    display:none;
    flex-direction:column;
    background:#050505;
    border-radius:18px;
    border:1px solid var(--green);
    box-shadow:0 0 20px rgba(0,0,0,0.8);
    overflow:hidden;
    z-index:999999; /* Toujours au-dessus */
    color:#f5f5f5;
    font-size:14px;
}

/* Header messenger */
.msgr-header{
    background:linear-gradient(90deg,#9EFD38,#d9b44a);
    color:#000;
    font-weight:600;
    padding:8px 12px;
    display:flex;
    justify-content:space-between;
    align-items:center;
}
.msgr-header .msgr-close{
    border:none;
    background:transparent;
    cursor:pointer;
    font-size:16px;
}

/* Corps messenger */
.msgr-body{
    display:grid;
    grid-template-columns:40% 60%;
    height:100%;
}
.msgr-sidebar{
    border-right:1px solid rgba(158,253,56,0.2);
    background:#0b0b0b;
}
.msgr-main{
    background:#111;
    display:flex;
    flex-direction:column;
}

/* Conversations */
.msgr-conversations{
    flex:1;
    overflow:auto;
    background:#111;
}
.conv-row{
    display:flex;
    align-items:center;
    gap:8px;
    padding:6px 10px;
    cursor:pointer;
    border-bottom:1px solid #181818;
}
.conv-row:hover{
    background:rgba(158,253,56,0.08);
}
.conv-row.active{
    background:rgba(158,253,56,0.18);
}
.conv-name{
    font-weight:600;
    font-size:13px;
}
.conv-last{
    font-size:11px;
    color:#aaa;
}

/* Messages */
.msgr-messages{
    flex:1;
    padding:8px 10px;
    overflow-y:auto;
}
.msgr-message{
    margin-bottom:6px;
    display:flex;
    gap:6px;
}
.msgr-message.me{
    justify-content:flex-end;
}
.msgr-bubble{
    max-width:70%;
    padding:6px 8px;
    border-radius:12px;
    background:#1e1e1e;
    font-size:13px;
}
.msgr-message.me .msgr-bubble{
    background:#9EFD38;
    color:#000;
}

/* Saisie */
.msgr-input{
    border-top:1px solid #222;
    padding:6px;
    display:flex;
    gap:6px;
}
.msgr-input textarea{
    flex:1;
    resize:none;
    border-radius:10px;
    border:1px solid #333;
    background:#050505;
    color:#eee;
    padding:4px 6px;
    min-height:32px;
}
.msgr-input button{
    border-radius:10px;
    border:1px solid #9EFD38;
    background:#9EFD38;
    color:#000;
    padding:4px 10px;
    cursor:pointer;
    font-weight:600;
}

/* ===========================================================
   LIENS & BOUTONS GENERIQUES
=========================================================== */

.card a,
.shortcut-links a,
.block a,
.page-box a{
    display:inline-block;
    background:#1a1a1a;
    color:#dcdcdc;
    padding:6px 14px;
    border-radius:10px;
    text-decoration:none;
    font-size:14px;
    border:1px solid var(--green);
    transition:.18s;
    white-space:nowrap;
}
.card a:hover,
.shortcut-links a:hover,
.block a:hover,
.page-box a:hover{
    background:var(--green);
    color:#000;
    transform:translateY(-1px);
}

/* Boutons formulaires */
.btn.primary{
    background:#8FD83A;
    color:#000;
    border:none;
    font-weight:bold;
    padding:10px 22px;
    border-radius:6px;
    cursor:pointer;
}
.btn.primary:hover{
    background:#a6ff4d;
}

/* ===========================================================
   BURGER + MENU MOBILE
=========================================================== */
.burger{
    font-size:26px;
    background:#1a1a1a;
    color:#fff;
    border:1px solid var(--green);
    border-radius:10px;
    padding:6px 10px;
    cursor:pointer;
}
.burger:hover{
    background:var(--green);
    color:#000;
}

/* Menu mobile (si utilisé plus tard) */
.mobile-menu{
    display:none;
    position:fixed;
    top:62px;
    left:0;
    width:100%;
    background:#000;
    border-top:2px solid var(--green);
    padding:15px 0;
    flex-direction:column;
    z-index:9999;
}
.mobile-menu a{
    display:block;
    padding:14px 22px;
    color:#eee;
    background:#111;
    border-bottom:1px solid #222;
    text-decoration:none;
}
.mobile-menu a:hover{
    background:var(--green);
    color:#000;
}
.mobile-menu.open{
    display:flex !important;
}

/* Affichage burger en mobile uniquement pour la NAV
   (le burger profil en header reste visible) */
@media(max-width:900px){
    .tb-center{ display:none; }
}

/* ===========================================================
   🌙 DARK MODE GLOBAL (body.dark)
=========================================================== */

body.dark{
    background:#111;
    color:#eee;
}

/* header */
body.dark .topbar{
    background:#000;
}
body.dark .tb-title,
body.dark .tb-user{
    color:#eee;
}

/* nav */
body.dark .tb-center a{
    background:#111;
    color:#e8e8e8;
    border-color:#333;
}

/* header buttons */
body.dark .tb-btn,
body.dark .tb-logout{
    background:#111;
    color:#fff;
    border-color:#333;
}

/* cards / blocs */
body.dark .card,
body.dark .page-box,
body.dark .block,
body.dark .content-box,
body.dark .profile-view,
body.dark .mod-card,
body.dark .mod-panel-card,
body.dark .mod-section{
    background:#1a1a1a;
    color:#eee;
    border-color:#333;
}

/* inputs */
body.dark input,
body.dark textarea,
body.dark select{
    background:#111;
    color:#fff;
    border:1px solid #333;
}

/* footer */
body.dark .site-footer{
    background:#000;
}
body.dark .site-footer .social-icons img{
    background:rgba(255,255,255,0.1);
    border-color:rgba(158,253,56,0.45);
}
body.dark .site-footer .copy{
    color:#aaa;
}

/* tables */
body.dark .mod-table td{
    background:#1a1a1a;
    border-color:#333;
    color:#eee;
}
body.dark .mod-table tr:hover td{
    background:#152108;
}

/* dropdowns */
body.dark .tb-panel-menu,
body.dark .dropdown-menu{
    background:#0e0e0e;
    border-color:#3a3a3a;
}
body.dark .tb-panel-menu a,
body.dark .dropdown-menu a{
    color:#eee;
}

/* liens généraux */
body.dark a{
    color:#caff75;
}
body.dark a:hover{
    color:#e2ffb7;
}

/* sidebar profil */
body.dark .profile-sidebar{
    background:#050505;
    color:#eee;
}

/* messenger bordure en dark */
body.dark .messenger-panel{
    border-color:#3a3a3a;
}

/* ===========================================================
   💬 MESSENGER PANEL — FIX COMPLET
=========================================================== */

.messenger-panel{
    position:fixed;
    right:20px;
    bottom:90px;
    width:360px;
    height:520px;
    background:#111;
    border:2px solid var(--green);
    border-radius:14px;
    display:none;
    flex-direction:column;
    box-shadow:0 0 18px rgba(0,0,0,.45);
    z-index:999999;
    overflow:hidden;
}

/* HEADER */
.msgr-header{
    background:#000;
    color:#fff;
    padding:12px 16px;
    font-size:17px;
    font-weight:600;
    display:flex;
    justify-content:space-between;
    align-items:center;
    border-bottom:2px solid var(--green);
}
.msgr-close{
    background:none;
    border:none;
    color:#fff;
    font-size:20px;
    cursor:pointer;
}

/* BODY */
.msgr-body{
    display:flex;
    height:100%;
}

/* SIDEBAR (Conversations) */
.msgr-sidebar{
    width:120px;
    background:#0e0e0e;
    border-right:1px solid #222;
    overflow-y:auto;
}
.msgr-conversations{
    padding:8px;
}
.msgr-conversations div{
    padding:10px;
    background:#1a1a1a;
    border-radius:8px;
    margin-bottom:8px;
    color:#fff;
    cursor:pointer;
}
.msgr-conversations div:hover{
    background:var(--green);
    color:#000;
}

/* MAIN CHAT */
.msgr-main{
    flex:1;
    display:flex;
    flex-direction:column;
    background:#181818;
}

.msgr-messages{
    flex:1;
    padding:12px;
    overflow-y:auto;
    color:#fff;
}

/* INPUT */
.msgr-input{
    display:flex;
    border-top:1px solid #333;
    padding:10px;
    gap:10px;
}
#messengerInput{
    flex:1;
    background:#111;
    color:#fff;
    border:1px solid #333;
    border-radius:10px;
    padding:8px;
    resize:none;
    height:55px;
}
#messengerSend{
    background:var(--green);
    color:#000;
    border:none;
    padding:12px 16px;
    border-radius:10px;
    cursor:pointer;
    font-weight:600;
}
#messengerSend:hover{
    background:#caff80;
}

/* MODE NUIT */
body.dark .messenger-panel{
    background:#000;
    border-color:#3a3a3a;
}
body.dark .msgr-header{
    background:#0e0e0e;
}
body.dark .msgr-main{
    background:#0a0a0a;
}

/************************************************************
 FIX MODE NUIT — NAV ET CONTOURS PREMIUM
*************************************************************/

/* BARRE DU HAUT */
body.dark .topbar{
    background:#000;
    border-bottom:2px solid var(--green);
}

/* MENU CENTRAL */
body.dark .tb-center a{
    background:#0f0f0f;
    color:#eaeaea;
    border:1px solid var(--green);
}

body.dark .tb-center a:hover{
    background:var(--green);
    color:#000 !important;
}

/* BOUTONS DROITE (logout / soleil / messenger / burger) */
body.dark .tb-btn,
body.dark .tb-logout{
    background:#0f0f0f;
    color:#fff;
    border:1px solid var(--green);
}

body.dark .tb-btn:hover,
body.dark .tb-logout:hover{
    background:var(--green);
    color:#000;
}

/* DROPDOWNS ADMIN / FERMES */
body.dark .tb-panel-menu{
    background:#0b0b0b;
    border:1px solid var(--green);
}

body.dark .tb-panel-menu a{
    color:#eee;
}

body.dark .tb-panel-menu a:hover{
    background:var(--green);
    color:#000;
}

/* TITRES EN MODE NUIT */
body.dark h1,
body.dark h2,
body.dark .farm-title{
    color:#9efd38 !important;
}

/************************************************************
 FIX CARDS MODE NUIT
*************************************************************/
body.dark .card,
body.dark .page-box,
body.dark .block,
body.dark .content-box,
body.dark .profile-view,
body.dark .mod-card,
body.dark .mod-panel-card,
body.dark .mod-section{
    background:#151515;
    color:#eee;
    border:1px solid #333;
}

/************************************************************
 FIX MESSENGER MODE NUIT
*************************************************************/
body.dark .messenger-panel{
    background:#050505;
    border:1px solid var(--green);
}

body.dark .msgr-header{
    background:#000;
    border-bottom:2px solid var(--green);
}

body.dark .msgr-main{
    background:#101010;
}

.mod-table {
    width: 100%;
    border-collapse: collapse;
}

.mod-table th,
.mod-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.mod-table th {
    background: #f2f2f2;
    text-align: left;
}

.mod-table .center {
    text-align: center;
}

.msg-cell {
    max-width: 400px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Boutons */

.btn-staff {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    background: #6ab04c;
    color: white;
    margin-right: 4px;
}

.btn-staff.info { background:#2980b9; }
.btn-staff.danger { background:#c0392b; }

.alert {
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
}

.alert.success { background:#d4edda; }
.alert.danger { background:#f8d7da; }

/* ============================
   LIVRE D’OR — FORMULAIRE
============================ */

/* --- MODE JOUR PAR DÉFAUT --- */
.guestbook-form textarea {
    background: #fdf7e6 !important;
    color: #1a1a1a !important;
    border: 2px solid #9efd38 !important;
    border-radius: 14px !important;
    padding: 14px !important;
    font-size: 15px !important;
    line-height: 1.5;
}

.guestbook-form textarea::placeholder {
    color: #777 !important;
}

.guestbook-form label {
    color: #5a8f1f !important;
    font-weight: 700;
}

/* Bouton */
.guestbook-form .btn.primary {
    background: #9efd38 !important;
    color: #1a1a1a !important;
    border-radius: 999px !important;
    padding: 10px 22px !important;
    font-weight: 700;
}

/* --- MODE NUIT --- */
body.dark .guestbook-form textarea {
    background: #0b0b0b !important;
    color: #baff64 !important;
    border-color: #9efd38 !important;
}

body.dark .guestbook-form textarea::placeholder {
    color: #6c8f30 !important;
}

body.dark .guestbook-form label {
    color: #baff64 !important;
}

/* BOUTON NUIT */
body.dark .guestbook-form .btn.primary {
    background: #9efd38 !important;
    color: #000 !important;
}

/* ============================
   LIVRE D’OR — FORMULAIRE FIX
============================ */

/* Form wrapper */
.guestbook-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

/* Label */
.guestbook-form label {
    font-weight: 700;
    font-size: 14px;
}

/* TEXTE */
.guestbook-form textarea {
    width: 100% !important;
    min-height: 120px !important;
    resize: vertical;
    box-sizing: border-box;
}

/* BOUTON */
.guestbook-form .btn.primary {
    align-self: flex-start;
    margin-top: 8px;
}

/* ===============================
   FIX HEADER FINAL — CLAAS RP
================================ */

/* Conteneur général */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    width: 100%;
    box-sizing: border-box;
}

/* Zones gauche / centre / droite */
.tb-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tb-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
    overflow: hidden;
}

.tb-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* Boutons menu uniformes */
.tb-center a,
.tb-panel-toggle {
    padding: 5px 10px;
    font-size: 0.9rem;
    line-height: 1;
    white-space: nowrap;
}

/* Sous menus */
.tb-panel {
    position: relative;
}

.tb-panel-menu {
    position: absolute;
    top: 35px;
    right: 0;
    min-width: 180px;
    z-index: 10000;
}

/* Correction du bouton "Fermes" flottant */
.tb-panel-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Responsive : quand l’écran rétrécit */
@media (max-width: 1200px) {
    .tb-center {
        justify-content: flex-start;
    }
}

/* Petit écran → menu central caché */
@media (max-width: 900px) {
    .tb-center {
        display: none;
    }

    .burger {
        display: inline-flex;
    }
}

/* ===============================
   FIX MENU DÉROULANT (DROPDOWN)
================================ */

/* Autorise l'affichage hors de la barre */
.topbar,
.tb-panel,
.tb-center {
    overflow: visible !important;
}

/* Affichage du sous-menu */
.tb-panel-menu {
    display: none;
    position: absolute;
    top: 42px;
    right: 0;
    background: #0b0b0b;
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(0,0,0,.45);
    padding: 6px;
}

/* affichage au hover */
.tb-panel:hover .tb-panel-menu,
.tb-panel:focus-within .tb-panel-menu {
    display: block;
}

/* liens du sous menu */
.tb-panel-menu a {
    display: block;
    padding: 8px 12px;
    white-space: nowrap;
    border-radius: 6px;
    color: #fff;
}

.tb-panel-menu a:hover {
    background: #98e12c;
    color: #000;
}
