* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; scrollbar-width: thin; scrollbar-color: #383b48 #1a1b23; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #1a1b23; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #383b48; border-radius: 4px; border: 2px solid #1a1b23; }
::-webkit-scrollbar-thumb:hover { background: #00bcd4; }

body { background-color: #0d0e12; color: white; height: 100vh; display: flex; overflow: hidden; }

/* === TOPBAR ET MENU MOBILE === */
.mobile-topbar { display: none; }
.mobile-menu-overlay { display: none; }

.sidebar { width: 280px; background-color: #1a1b23; display: flex; flex-direction: column; padding: 30px 20px; border-right: 1px solid #25262d; flex-shrink: 0; z-index: 100; transition: right 0.3s ease; }
.logo-container { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.logo-img { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; }
.logo-text { font-size: 16px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: white; }
.logo-subtext { font-weight: 400; color: #6b6d7a; text-transform: capitalize; font-size: 14px; letter-spacing: 0.5px;}

.sidebar-team-badge { background: rgba(0, 188, 212, 0.1); border: 1px solid rgba(0, 188, 212, 0.2); color: #00bcd4; padding: 8px 12px; border-radius: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; margin-bottom: 25px; letter-spacing: 1px; text-align: center; }

.avatar { width: 50px; height: 50px; background-color: #2b2d37; border-radius: 8px; margin-right: 15px; flex-shrink: 0; background-size: cover; background-position: center; border: 1px solid #383b48; }
.profile-section { display: flex; align-items: center; margin-bottom: 50px; padding-top: 15px; border-top: 1px solid #25262d; overflow: hidden; }
#playerPseudo { font-weight: bold; font-size: 12px; color: white; word-break: break-all; display: block; margin-bottom: 2px; }
.role { color: #00bcd4; font-size: 10px; font-weight: bold; text-transform: uppercase; }

.nav-sidebar { display: block; width: 100%; padding: 12px 15px; margin-bottom: 10px; background-color: #2b2d37; color: #a0a2ad; text-decoration: none; border-radius: 6px; font-size: 12px; font-weight: bold; transition: 0.3s; }
.nav-sidebar.active { background-color: #383b48; color: white; border-left: 3px solid #00bcd4; }
.bottom-section { margin-top: auto; padding-top: 15px; border-top: 1px solid #25262d; }

/* Sous-titres de catégories dans la sidebar */
.nav-section-title { color: #6b6d7a; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; margin: 22px 0 10px 4px; }
.nav-section-title.nav-section-first { margin-top: 5px; }

/* === CONTENU PRINCIPAL === */
.main-content { flex: 1; padding: 40px; overflow-y: auto; background: radial-gradient(circle at top right, #16171d, #0d0e12); }
.header, .page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; }
.header h1, .page-header h1 { font-size: 32px; font-weight: 800; letter-spacing: -1px; margin-bottom: 5px; text-transform: uppercase; }

/* === BOUTONS ET INPUTS === */
.btn-nav, .btn-add { background: #00bcd4; color: #0d0e12; border: none; padding: 12px 24px; border-radius: 6px; font-weight: 800; cursor: pointer; transition: 0.3s; text-transform: uppercase; font-size: 12px; letter-spacing: 1px; }
.btn-nav:hover, .btn-add:hover { background: #0097a7; transform: translateY(-2px); }
.btn-nav:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary { background: #2b2d37; color: white; border: 1px solid #383b48; }
.btn-secondary:hover { background: #383b48; }

input, select { width: 100%; padding: 14px; background: #0d0e12 !important; border: 1px solid #25262d; color: white !important; border-radius: 6px; margin-top: 10px; outline: none; font-size: 14px; }
.admin-only { display: none; }

/* === MODALES GLOBALES === */
.modal-overlay, .overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 999; }
.btn-modal { padding: 12px 24px; border-radius: 6px; font-weight: bold; font-size: 12px; transition: 0.2s; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; border: none; }
.btn-modal-cancel { background: #2b2d37; color: white; border: 1px solid #383b48; }
.btn-modal-cancel:hover { background: #383b48; }
.btn-modal-confirm { background: #ef4444; color: white; }
.btn-modal-confirm:hover { background: #dc2626; }

/* === SKELETON LOADERS === */
/* Placeholder gris pulsant pendant le chargement des data Firestore */
.skeleton {
    background: linear-gradient(90deg, #1a1b23 0%, #25262d 50%, #1a1b23 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}
.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-block { height: 60px; margin-bottom: 10px; border-radius: 8px; }
.skeleton-card { height: 90px; border-radius: 8px; }
@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === ERROR STATES (encadré rouge + bouton retry) === */
.error-state {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 20px 15px;
    text-align: center;
    color: #f87171;
    font-size: 13px;
}
.error-state-icon { font-size: 28px; margin-bottom: 10px; display: block; line-height: 1; }
.error-state-msg { color: #fca5a5; margin-bottom: 14px; line-height: 1.5; }
.error-state-btn { background: #ef4444; color: white; border: none; padding: 8px 18px; border-radius: 6px; font-weight: 800; cursor: pointer; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; transition: 0.2s; }
.error-state-btn:hover { background: #dc2626; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239,68,68,0.3); }


/* === RESPONSIVE MOBILE === */
@media (max-width: 768px) {
    body { flex-direction: column; }
    .mobile-topbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; background-color: #1a1b23; border-bottom: 1px solid #25262d; }
    .mobile-logo-text { font-size: 16px; font-weight: 800; letter-spacing: 1.5px; color: white; }
    .mobile-logo-text span { font-weight: 400; color: #6b6d7a; }
    .btn-burger { background: none; border: none; color: white; font-size: 28px; cursor: pointer; padding: 0; }
    
    .mobile-menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 90; opacity: 0; transition: opacity 0.3s ease; }
    .mobile-menu-overlay.active { display: block; opacity: 1; }

    .sidebar { position: fixed; top: 0; right: -300px; width: 280px; height: 100vh; padding: 20px; border-left: 1px solid #25262d; border-right: none; box-shadow: -5px 0 25px rgba(0,0,0,0.5); }
    .sidebar.open { right: 0; }

    .main-content { padding: 20px; padding-bottom: 30px; height: calc(100vh - 60px); }
    .header, .page-header { flex-direction: column; align-items: stretch; gap: 15px; margin-bottom: 20px; }
    .header h1, .page-header h1 { font-size: 24px !important; margin-bottom: 10px !important; }

    /* Sidebar compacte sur mobile */
    .sidebar-team-badge { margin-bottom: 15px; }
    .profile-section { margin-bottom: 25px; padding-top: 12px; }
    .nav-sidebar { padding: 9px 13px; margin-bottom: 6px; }
    .nav-section-title { margin: 14px 0 7px 4px; }
    .nav-section-title.nav-section-first { margin-top: 2px; }
    .bottom-section { padding-top: 10px; }
}