﻿:root {
    --primary-color: #3B7A57; /* Verde bosco */
    --primary-hover: #2F5E45;
    --danger-color: #B91C1C;
    --success-color: #15803D;
    --secondary-color: #E5E7EB;
    --bg-color: #F3F4F6;
    --text-color: #1F2937;
    --border-radius: 0.5rem;
    --font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --input-border: #D1D5DB;
    --sidebar-bg: linear-gradient(180deg, rgb(9 45 20 / 32%), rgb(87 233 148 / 17%));
    --sidebar-hover: rgba(255, 255, 255, 0.25);
    --sidebar-active: rgba(255, 255, 255, 0.2);
    --sidebar-text: white;
    --bs-nav-link-font-size: 1.17rem;
    --sidebar-border: rgba(255, 255, 255, 0.05);
    --topbar-bg: rgb(0 55 10 / 32%);
    --topbar-text: #ffffff;
    --sidebar-bg-img: url('/images/Sfondo2.png'); /* opzionale */
    --sidebar-bg-img-opacity: 0.85; /* quanto visibile è l'immagine sopra il gradiente */
}

body {
    background-color: var(--bg-color);
    font-family: var(--font-family);
    margin: 0;
}


/* HEADER */
h1, h2, h3 {
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
}


/* Pagine */
.pagine {
    background-color: var(--primary-color);
    color: white;
}

.pagine2 {
    --bs-btn-color: #112515;
    --bs-btn-hover-color: white;
    --bs-btn-hover-bg: #51a663;
    --bs-btn-hover-border-color: #fff;
    --bs-btn-focus-shadow-rgb: 13, 110, 253;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #51a663;
    --bs-btn-active-border-color: #51a663;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}


/* MAIN BUTTON FISSO IN ALTO A DESTRA */
button.main-fixed-button {
    position: fixed;
    top: 0.5rem;
    right: 1.5rem;
    z-index: 1000;
    background-color: #3B7A57;
    color: white;
    padding: 0.6rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
}

    button.main-fixed-button:hover {
        background-color: #650000;
    }
button.main-fixed-button-1 {
    position: fixed;
    top: 0.5rem;
    right: 7rem;
    z-index: 1000;
    background-color: #3B7A57;
    color: white;
    padding: 0.6rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
}
button.main-fixed-button-1:hover {
    background-color: #650000;
}

/* BOTTONI BASE */
button, .btn {
    border: none;
    border-radius: var(--border-radius);
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    margin: 0.2rem 0.4rem 0.4rem 0;
    display: inline-block;
    box-shadow: 5px 2px 6px rgb(0 0 0 / 26%);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

    /* Escludi i bottoni specifici */
    .btn.btn-sm.btn-light.px-1 {
        box-shadow: none !important;
    }

/* STANDARDIZZAZIONE BOTTONI FUNZIONALI */
.btn-sm {
    font-size: 0.8rem;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

    .btn-success:hover {
        background-color: #166534;
    }

.btn-secondary {
    background-color: var(--secondary-color);
    color: #1F2937;
}

    .btn-secondary:hover {
        background-color: #CBD5E1;
    }

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

    .btn-primary:hover {
        background-color: var(--primary-hover);
    }

.text-red-500 {
    color: var(--danger-color);
}

    .text-red-500:hover {
        text-decoration: underline;
    }

.form-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* INPUT */

input[type="text"], .form-control, .form-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: white;
    color: var(--text-color);
}

    input[type="text"]:focus {
        border-color: var(--primary-color);
        outline: none;
    }

/*Text area*/
textarea, .form-textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    font-size: 0.92rem;
    background-color: white;
    text-align: left;
    color: var(--text-color);
    resize: vertical; /* permette l’allungamento verticale */
    line-height: 1.4;
    overflow-wrap: break-word; /* va a capo se supera la larghezza */
    word-break: break-word;
    vertical-align: top;
}

.required-input {
    border: 1px solid #ff000080;
}

/* COLORI DI BACKGROUND E RIGHE */
.bg-yellow-100 {
    background-color: #FEF9C3;
}

.bg-green-500 {
    background-color: var(--success-color);
}

    .bg-green-500:hover {
        background-color: #166534;
    }

/* SPACING */
.mb-4 {
    margin-bottom: 1rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

/* TABELLE */
th, td {
    padding: .2rem .2rem !important;
    text-align: center;
    border-bottom: 0px solid #2438234a;
    vertical-align: top;
}

    /* LAYOUT BOTTONI IN TABELLA */
    td > .btn,
    td > button,
    td > .text-red-500 {
        display: inline-block;
        margin-bottom: 0.25rem;
    }

.my-table-container {
    max-height: 500px; /* Altezza massima visibile, modificabile a piacere */
    overflow-y: auto;
}

.my-table thead th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 2;
}

/* SIDEBAR */
.sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    height: 100%;
    padding-top: 1rem;
    position: relative;
    overflow: hidden;
}

    .sidebar nav,
    .sidebar .nav-item,
    .sidebar a {
        position: relative;
        z-index: 1;
        --bs-nav-link-hover-color: #e79e2e;
    }

    .sidebar a {
        color: var(--sidebar-text);
        text-decoration: none;
        padding: 0.90rem 0.5rem;
        display: block;
        transition: background-color 0.2s ease;
        border-left: 4px solid #ffe1e17a;
    }

        .sidebar a:hover {
            background-color: var(--sidebar-hover);
        }

        .sidebar a.active {
            background-color: var(--sidebar-active);
            border-left: 4px solid white;
        }

/* TOPBAR */
.topbar {
    background: var(--topbar-bg);
    color: var(--topbar-text);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    position: relative;
    z-index: 10;
}


    .topbar > * {
        position: relative;
        z-index: 1;
    }

.layout-background {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
    overflow: hidden;
    z-index: 0;
}

    .layout-background::before {
        content: "";
        position: fixed; /* <-- sfondo non si muove con lo scroll */
        inset: 0;
        background-image: var(--sidebar-bg-img);
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center;
        opacity: var(--sidebar-bg-img-opacity);
        z-index: -1; /* sotto tutto */
        pointer-events: none;
    }

.no-layout-background {
    background-color: var(--bg-color) !important;
}


/* RESPONSIVE (se ti serve in futuro) */
@media (max-width: 768px) {
    button.main-fixed-button {
        top: 1rem;
        right: 1rem;
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

.btn-notifiche {
    background: none;
    border: none;
    position: relative;
    font-size: 1.5rem;
    cursor: pointer;
}

.badge {
    background: red;
    color: white;
    border-radius: 50%;
    padding: 0 6px;
    font-size: 0.7rem;
    position: absolute;
    top: -5px;
    right: -5px;
}

.panel-notifiche {
    position: absolute;
    right: 0;
    top: 3.5rem;
    width: 600px;
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    z-index: 100;
    padding: 0.5rem;
}

.testo-limitato {
    max-height: 4.3em; /* circa 3 righe */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.notifica-item {
    border-bottom: 1px solid #eee;
    padding: 0.5rem 0;
    cursor: pointer;
    max-height: 230px;
}

    .notifica-item.nuova strong {
        color: #007bff;
    }

    .notifica-item.alert {
        border-right: 5px solid red;
    }

    .notifica-item.notifica {
        border-right: 5px solid blue;
    }

    .notifica-item.messaggio {
        border-right: 5px solid green;
    }

    .notifica-item.servizio {
        border-right: 5px solid yellow;
    }

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 9999;
    max-width: 90vw; /* limite per schermi piccoli */
}

.toast {
    background-color: #323232;
    color: white;
    padding: clamp(0.75rem, 1vw + 0.5rem, 1rem);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0.85;
    transform: scale(0.95);
    transition: opacity 0.4s ease, transform 0.3s ease, filter 0.3s ease;
    backdrop-filter: blur(3px);
    font-size: clamp(0.85rem, 0.9vw + 0.5rem, 1rem);
    word-wrap: break-word;
    min-width: 220px;
    max-width: 350px;
}

    /* Effetto al passaggio del mouse */
    .toast:hover {
        opacity: 1;
        transform: scale(1.03);
        filter: brightness(1.05);
    }

    /* Colori per i vari tipi */
    .toast.info {
        background-color: rgba(33, 150, 243, 0.9);
    }

    .toast.success {
        background-color: rgba(76, 175, 80, 0.9);
    }

    .toast.warning {
        background-color: rgba(255, 152, 0, 0.9);
    }

    .toast.error {
        background-color: rgba(244, 67, 54, 0.9);
    }

    /* Mostra i toast anche senza la classe .show */
    .toast:not(.show) {
        display: flex !important;
    }

/* Effetti di entrata e uscita (fade in/out) */
.toast-enter {
    opacity: 0;
    transform: translateY(-10px);
}

.toast-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.toast-exit {
    opacity: 1;
}

.toast-exit-active {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}









/*.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 9999;
}

.toast {
    background-color: #323232;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: opacity 0.3s ease-in-out;
    display: flex;
}

    .toast.info {
        background-color: #2196f3;
    }

    .toast.success {
        background-color: #4caf50;
    }

    .toast.warning {
        background-color: #ff9800;
    }

    .toast.error {
        background-color: #f44336;
    }
    .toast:not(.show) {
        display: flex !important;
    }
*/
