/* --- VARIABILI GLOBALI --- */
:root {
    --sidebar-width: 260px;
    --neon-green: #ccff00;
    --dark-bg: #0f0f0f;
    --card-bg: #1a1a1a;
    --text-gray: #e0e0e0;
    --admin-gold: #ffc107;
    /* Colori Ruoli */
    --role-gk: #ffc107;
    --role-def: #198754;
    --role-mid: #0d6efd;
    --role-att: #dc3545;
}

/* --- LAYOUT BASE --- */
body {
    background-color: var(--dark-bg);
    color: var(--text-gray);
    margin: 0;
    display: flex;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, sans-serif;
    overflow-x: hidden;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--card-bg);
    border-right: 1px solid #222;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.05); border-radius: 10px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

.sidebar-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar h4 {
    color: var(--neon-green);
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 1.2rem 0;
    line-height: 1.2;
    text-align: left;
}

.sidebar-profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px; /* Ridotto leggermente per dare più spazio al testo */
}

.user-info-box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0; /* Permette al flex-item di rimpicciolirsi sotto la dimensione del contenuto */
    flex: 1; 
}

.team-logo-sidebar {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid #333;
    flex-shrink: 0;
}

.team-name-sidebar {
    /* Utilizzo clamp per far adattare il font tra 0.65rem e 0.75rem in base allo spazio */
    font-size: clamp(0.65rem, 1.5vw, 0.75rem);
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    flex: 1;
}

/* --- GRUPPO ICONE HEADER (Busta + Campanello) --- */
.header-icons-group {
    display: flex;
    align-items: center;
    gap: 12px; /* Compatto per evitare sovrapposizioni */
    flex-shrink: 0;
}

.notif-link, .msg-link {
    color: #888 !important;
    font-size: 1.1rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.notif-link:hover { color: var(--neon-green) !important; }
.msg-link:hover { color: #00e5ff !important; }

.notif-badge-top {
    position: absolute;
    top: -6px;
    right: -8px;
    background-color: #ff4444;
    color: white;
    font-size: 0.55rem;
    font-weight: 900;
    padding: 1px 4px;
    border-radius: 50%;
    border: 2px solid var(--card-bg);
    line-height: 1;
}

.budget-box-link {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    background: rgba(0,0,0,0.5) !important;
    position: relative;
    overflow: hidden;
}

.budget-box-link:hover {
    border-color: var(--neon-green) !important;
    background: rgba(204, 255, 0, 0.03) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4), 0 0 10px rgba(204, 255, 0, 0.05) !important;
}

/* --- NAVIGAZIONE --- */
.sidebar ul { list-style: none; padding: 0; margin: 0; }

.nav-link-custom {
    color: #bbb;
    text-decoration: none;
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    border-radius: 10px;
    margin-bottom: 5px;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
}

.nav-link-custom i { margin-right: 12px; font-size: 1rem; }

.nav-link-custom:hover, .nav-link-custom.active {
    background-color: rgba(204, 255, 0, 0.05);
    color: var(--neon-green);
}

.nav-link-custom.active {
    background-color: var(--neon-green);
    color: #000;
    font-weight: 700;
}

/* --- BADGE RUOLI --- */
.role-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 900;
    border-radius: 4px;
    text-align: center;
    min-width: 38px;
    text-transform: uppercase;
}

.badge-gk  { background-color: var(--role-gk); color: #000; }
.badge-def { background-color: var(--role-def); color: #fff; }
.badge-mid { background-color: var(--role-mid); color: #fff; }
.badge-att { background-color: var(--role-att); color: #fff; }

/* --- CONTENUTO E UTILITY --- */
.main-content { margin-left: var(--sidebar-width); padding: 2.5rem; flex-grow: 1; }
.dashboard-card { background-color: var(--card-bg); border: 1px solid #333; border-radius: 18px; padding: 1.5rem; margin-bottom: 1.5rem; }
.accent-neon { color: var(--neon-green); }
.text-muted { color: #888 !important; }

/* -----------------------------------------------------------
    FIX AGGRESSIVO VISIBILITÀ TASTI (No Dissolvenza)
----------------------------------------------------------- */
.btn-neon, 
.btn-save-main, 
.btn-save-fixed, 
button[type="submit"], 
.btn {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
    animation: none !important;
    transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in-out !important;
}

/* Stile specifico per il tasto Giallo Sidebar */
.btn-neon, .btn-save-main {
    background-color: var(--neon-green) !important;
    color: #000 !important;
    border: none !important;
    font-weight: 800 !important;
    box-shadow: 0 0 10px rgba(204, 255, 0, 0.2);
}

.btn-neon:hover, .btn-save-main:hover {
    background-color: #fff !important;
    color: #000 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(204, 255, 0, 0.4);
}