/* ============================
   BASE LAYOUT
============================ */
body {
    margin: 0;
    padding: 0;
    background: #f5f7fa;
	Zbackground: red;
    overflow-x: hidden; /* blocca solo lo scroll orizzontale */
    overflow-y: auto;   /* permette lo scroll verticale */
    font-family: Arial, sans-serif;
}

body.home {
    background-image: url("../image/artdelfut_002.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

/* Overlay per la trasparenza */
body.home::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4); /* Cambia 0.4 per più/meno trasparenza */
    z-index: -1;
}


/* ============================
   TOPBAR
============================ */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: #0d6efd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 900;
    color: #fff;
}

/* Hamburger */
.topbar .hamburger {
    position: absolute;
    top: 22px;
    left: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #fff;
    z-index: 950;
    transition: transform 0.2s ease;
}

.topbar .hamburger:hover {
    transform: scale(1.15);
}

/* Logo + titolo */
.left {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 60px;
}

.logo {
    height: 42px;
}

.portal-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

/* ============================
   AREA UTENTE TOPBAR
============================ */
.right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon-wrapper {
    position: relative;
    cursor: pointer;
}

.icon-wrapper i {
    font-size: 22px;
    color: #fff;
}

.badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #e63946;
    color: white;
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 50%;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    cursor: pointer;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.dropdown {
    display: none;
    position: absolute;
    top: 40px;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 160px;
    padding: 10px 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.dropdown a {
    display: block;
    padding: 8px 15px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
	border-bottom:1px solid #eee;
}

.dropdown a:hover {
    background: #f5f5f5;
}

/* ============================
   SIDEBAR
============================ */
:root {
    --sidebar-width: 220px;
    --sidebar-width-collapsed: 70px;
    --topbar-height: 80px;
}

.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--topbar-height));
    background: #085CA8;
    overflow-y: auto;
	overflow-x: hidden !important;
    padding-top: 10px;
    z-index: 1000;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar collassata */
.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}

/* Link sidebar */
.sidebar .nav-link {
    color: #ffffff;
    padding: 12px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
}

.sidebar .nav-link:hover {
    background: rgba(255,255,255,0.15);
}

.sidebar .nav-link.active {
    background: rgba(0,0,0,0.25);
    font-weight: 600;
}

/* Sidebar collassata: icone centrate */
.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
    gap: 0;
}

/* Fade del testo */
.sidebar .nav-link span {
    transition: opacity 0.2s ease, width 0.2s ease;
}

.sidebar.collapsed .nav-link span {
    opacity: 0;
    width: 0;
    display: none;
}

/* Tooltip base */
.sidebar .nav-link::after {
    content: attr(data-title);
    position: absolute;
    left: calc(var(--sidebar-width-collapsed) + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Mostra tooltip SOLO quando sidebar è collassata */
.sidebar.collapsed .nav-link:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(5px);
}

/* ============================
   MAIN CONTENT
============================ */
.main-content {
    position: relative;
    top: var(--topbar-height);
    left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    height: calc(100vh - var(--topbar-height));
    overflow-y: auto;
    overflow-x: hidden !important; /* ← FIX DEFINITIVO */
    padding: 25px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.collapsed {
    left: var(--sidebar-width-collapsed);
    width: calc(100% - var(--sidebar-width-collapsed));
}

/* ============================
   BOX E SEZIONI
============================ */
.section-box {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: 0.3s;
}

.section-box:hover {
    transform: translateY(-5px);
}

.section-box h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.carousel-box { 
    border: 1px solid #888;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);    
}

.password-toggle {
    cursor: pointer;
    color: #666;
}

.link-bianco {
    color: #fff;
    text-decoration: none;
}

.link-bianco:hover {
    font-weight: bold;
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #0d6efd;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.card-badge-group {
    position: absolute;
    bottom: 16px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.card-badge-round {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Pulsante Torna Su */
#backToTop {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: #0d6efd;
    color: white;
    border: none;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    transition: all 0.25s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 900;
}

#backToTop:hover {
    transform: scale(1.12);
    box-shadow: 0 8px 22px rgba(0,0,0,0.35);
}

#backToTop.show {
    opacity: 1;
    pointer-events: auto;
}

/* ============================
   TABELLE
============================ */
.table-wrapper {
    background: #ffffff;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #e0e0e0;
}

.table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.table-custom thead th {
    background: #f7f7f7;
    color: #333;
    font-weight: 600;
    padding: 12px;
    border-bottom: 2px solid #e0e0e0;
}

.table-custom tbody tr:nth-child(odd) {
    background: #fafafa;
}

.table-custom tbody tr:nth-child(even) {
    background: #f0f0f0;
}

.table-custom tbody tr:hover {
    background: #e8f3ff !important;
    transition: 0.2s;
}

.table-custom td {
    padding: 10px 12px;
    vertical-align: middle;
}

/* Pulsanti */
.btn-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
}

/* Badge */
.badge-status {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-new {
    background: #ffebee;
    color: #c62828;
}

.badge-ok {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-pending {
    background: #fff8e1;
    color: #ff8f00;
}

/* Righe alternate per tabelle admin */
table.table-striped-custom tbody tr:nth-child(odd) {
    background-color: #fafafa !important;
}

table.table-striped-custom tbody tr:nth-child(even) {
    background-color: #eee !important;
}

table.table-striped-custom tbody tr:hover {
    background-color: #e3f2fd !important;
    transition: 0.2s ease-in-out;
}

table.table-striped-custom thead th {
    background: #f7f7f7 !important;
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
}

table.table-striped-custom td,
table.table-striped-custom th {
    padding: 12px 10px;
    vertical-align: middle;
}

/* FIX DEFINITIVO: tabella scrollabile, layout stabile */
.table-responsive,
.card-body {
    overflow-x: auto !important;
}

table {
    width: 100% !important;
    table-layout: auto !important;
}

/* Bottoni azioni più compatti */
.action-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    transition: 0.2s ease-in-out;
}

.action-btn:hover {
    transform: scale(1.12);
}

/* Badge tabella più piccoli */
.table-badge-round {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 0.85rem;
}

.badge-round {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 600;
    font-size: .9rem;
}

.text-truncate-custom {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* FIX overflow orizzontale */
.main-content {
    overflow-x: hidden !important;
}

/* La tabella scorre solo lei */
.table-responsive,
.card-body {
    overflow-x: auto !important;
}

.dashboard-circle {
    Zwidth: 44px;
    Zheight: 44px;
	padding: 2px 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: bold;
    color: #fff;
    margin: 10px auto;
    background: var(--circle-color, #0d6efd);
    box-shadow: 0 0 10px rgba(0,0,0,0.15);
	cursor: help;
}

.dashboard-circle-left {
    Zwidth: 44px;
    Zheight: 44px;
	padding: 2px 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: bold;
    color: #fff;
    Zmargin: 10px auto;
	margin: 6px 10px;
    background: var(--circle-color, #0d6efd);
    box-shadow: 0 0 10px rgba(0,0,0,0.15);
	cursor: help;
}

.user-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #6c757d; /* grigio elegante, identico allo stile precedente */
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 1px;
    flex-shrink: 0;
}

/* Sidebar collassata: solo icone principali */




