/* ============================================
   LINK HOVER / ACTIVE PER TUTTO IL SITO
   ============================================ */

/* link normali */
a {
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* hover: sfondo leggermente scuro */
a:hover {
    background-color: #e0e0e0 !important;
}

/* click (active): sfondo più scuro */
a:active {
    background-color: #cfcfcf !important;
}

/* link del menu laterale */
nav a:hover {
    background-color: #d0d0d0 !important;
}

nav a:active {
    background-color: #bcbcbc !important;
}

/* link stile Maintenance (page-num, page-num-rac) */
.page-num:hover,
.page-num-rac:hover {
    background-color: #e0e0e0 !important;
}

.page-num:active,
.page-num-rac:active {
    background-color: #cfcfcf !important;
}
/* ============================
   SPAZIATURA BLOCCHI MENU
   ============================ */
.menu-spazio {
    margin: 0 !important;
    padding: 0 !important;
}

/* il titolo usa lo stesso ritmo dei link */
.menu-spazio h4 {
    margin: 0 !important;
    padding: 6px 12px !important;
    font-size: 16px;
    line-height: 1.2 !important;
    border-bottom: 1px solid #d4d4d4;
}

/* righe interne identiche ai link */
.menu-spazio .menu-riga {
    display: block !important;
    padding: 6px 12px !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    border-bottom: 1px solid #d4d4d4;
}

/* ============================
   BASE
   ============================ */
html, body {
    margin: 0;
    padding: 0;
    background: #f4f4f4;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
}

/* ============================
   HEADER
   ============================ */
header {
    background: #f2f2f2;
    color: #333;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid #ccc;

    /* ⭐ NON deve avere z-index né position */
}

/* ============================
   FOOTER
   ============================ */
.footer-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
    background: #f2f2f2;
    border-top: 1px solid #ccc;
    font-size: 14px;
    z-index: 10000;
}

/* ============================
   BARRA INFO
   ============================ */
.barra-info {
    background: transparent;
    color: #000;
    font-size: 16px;
    font-weight: bold;
    padding: 0 10px;
    white-space: nowrap;
}

/* ============================
   LOGO GRANDE
   ============================ */
.logo-big {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-big img {
    height: 40px;
}
/* ============================
   LOGO PICCOLO
   ============================ */
.logo-small {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.logo-small-img {
    height: 40px !important;
    opacity: 0.8;
}
/* ============================
   HAMBURGER
   ============================ */
.hamburger {
    width: 30px;
    height: 22px;
    cursor: pointer;
    position: fixed;
    right: 10px;
    top: 15px;
    z-index: 10003; /* ⭐ SEMPRE sopra tutto */
    max-width: 30px;
    overflow: hidden;
}

.hamburger span {
    background: #333;
    height: 4px;
    width: 100%;
    position: absolute;
    left: 0;
    transition: 0.3s;
    border-radius: 2px;
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 9px; }
.hamburger span:nth-child(3) { top: 18px; }

/* ANIMAZIONE X */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 9px;
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 9px;
}


/* ============================
   MENU LATERALE
   ============================ */
nav {
    width: 250px;
    background: #e6e6e6;
    color: #333;
    position: fixed;
    top: 0;
    right: 0;
    padding-top: 60px;
    border-left: 1px solid #ccc;

    /* ⭐ fondamentale: crea un layer separato */
    transform: translateX(100%);
    transition: transform 0.3s ease;

    z-index: 10002; /* ⭐ sopra header e footer */
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

nav.open {
    transform: translateX(0);
}

/* ============================
   LINK DEL MENU
   ============================ */
nav a {
    display: block;
    padding: 6px 12px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #d4d4d4;
    font-size: 16px;
    line-height: 1.2 !important;
}

nav a:hover {
    background: #dcdcdc;
}
/* DATA SCADUTA */
.input-scaduta {
    background: #d90000 !important;
    color: #fff !important;
    font-weight: bold;
}
/* PULSANTI AZIONI */
.action-buttons {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.action-buttons button {
    padding: 10px 16px;
    font-size: 15px;
    border: none;
    background: #333;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
}

.action-buttons button:hover {
    background: #555;
}

/* ============================
   HEADER MOBILE — LOGO + HAMBURGER IN ALTO
   ============================ */
@media (max-width: 768px) {

    header {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-top: 60px;

        /* ⭐ NON deve creare stacking context */
        position: static !important;
        z-index: auto !important;
    }

    .logo-big {
        width: 100%;
        display: flex;
        justify-content: flex-start;
    }

    .hamburger {
        position: fixed;   /* ⭐ indipendente dall’header */
        top: 15px;
        right: 15px;
        z-index: 10003;    /* ⭐ sempre sopra tutto */
    }
}


    .barra-info {
        width: 100%;
        font-size: 18px;
        margin-top: 5px;
        padding-left: 0;
        text-align: left;           /* ⭐ sotto il logo */
    }

/* ============================================
   RIPRISTINO GRIGLIA MOBILE IN BOX/CARD
   ============================================ */
@media (max-width: 600px) {

    .tabella-responsive {
        width: 100%;
        border-collapse: collapse;
    }

    .tabella-responsive thead {
        display: none;
    }

    .tabella-responsive tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ccc;
        padding: 10px;
        border-radius: 8px;
        background: #fff;
    }

    .tabella-responsive td {
        display: block;
        text-align: left;
        padding: 6px 0;
        width: 100%;
    }

    .tabella-responsive td::before {
        content: attr(data-label) ": ";
        font-weight: bold;
        display: inline-block;
        margin-right: 5px;
    }
}
