﻿/* ==========================================================================
   ROOT VARIABLES
   ========================================================================== */
:root {
    --primary-color: #003366;
    --header-height: 46px;
    --sidebar-width: 0px;
    --sidebar-width-expanded: 220px;
}

/* ==========================================================================
   GENERAL RESET & BASE
   ========================================================================== */
html, body {
    margin: 0;
    font-family: 'Segoe UI',sans-serif;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-user-select: auto;
    -webkit-touch-callout: default;
    touch-action: manipulation;
}

code {
    color: #c02d76;
}

/* ==========================================================================
   VALIDATION & ERROR UI
   ========================================================================== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none;
    left: 0;
    padding: .6rem 1.25rem .7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: .75rem;
        top: .5rem;
    }

.blazor-error-boundary {
    background: #b32121;
    color: #fff;
    padding: 1rem 1rem 1rem 3.7rem;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* ==========================================================================
   LOADING INDICATOR
   ========================================================================== */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: .6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141*var(--blazor-load-percentage,0%)*.8),500%;
            transition: stroke-dasharray .05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto .2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text,"Loading");
    }

/* ==========================================================================
   LAYOUT CONTAINER
   ========================================================================== */
.layout-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar-container {
    width: var(--sidebar-width);
    transition: width .3s ease-in-out;
    background: linear-gradient(to bottom,#0f1c2e,#001220);
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    z-index: 5;
    overflow: hidden;
}

    .sidebar-container.expanded {
        width: var(--sidebar-width-expanded);
        align-items: flex-start;
        padding-left: .5rem;
    }

    .sidebar-container:not(.expanded) .nav-text {
        display: none;
    }

.nav-menu {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 1rem 0;
    gap: 1.5rem;
}

.nav-link {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.6rem;
    padding: .8rem 1rem;
    border-left: 3px solid transparent;
    transition: background .3s,border-left .3s;
    text-decoration: none;
}

    .nav-link:hover {
        background-color: rgba(255,255,255,.05);
    }

    .nav-link.active {
        background: rgba(255,255,255,.1);
        border-left: 3px solid #fff;
    }

.nav-text {
    font-size: 1rem;
    white-space: nowrap;
    font-weight: 500;
}

.k-icon.nav-icon {
    font-size: 1.8rem;
    color: #fff !important;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.header {
    height: var(--header-height);
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    padding: 0 1rem;
}

.logo {
    height: 3.5rem;
    padding: 0 1rem;
}

.menu-button {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--primary-color);
    cursor: pointer;
}

.toolname {
    border-radius: 50px;
    padding: 5px 15px;
    border: 2px solid #000;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: .1rem;
    text-transform: uppercase;
}

.btn-logout {
    border: 2px solid var(--primary-color);
    background-color: #fff;
    color: var(--primary-color);
    font-weight: bold;
    padding: .5rem 1rem;
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */
.main-content-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: auto;
    height: auto;
}

.main-body {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    background-color: #f6f6f6;
}

/* ==========================================================================
   LOGIN PAGE
   ========================================================================== */
.login-wrapper {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f9f9f9;
    padding: 1rem;
}

.login-box {
    width: 100%;
    max-width: 600px;
    background: #fff;
    border-radius: 12px;
    padding: 2rem 3rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.05);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}

.login-box-small {
    max-width: 340px;
}

.login-input-small {
    font-size: .9rem;
    padding: .4rem .6rem;
}

.login-image {
    width: 110px;
    height: 110px;
    image-rendering: auto;
    margin: 0 auto 1.5rem auto;
    display: block;
}

.login-title {
    font-size: 2rem;
    color: #001b4d;
    margin-bottom: 2rem;
    font-weight: bold;
    text-align: left;
    align-self: flex-start;
    margin-left: .2rem;
}

.login-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 1rem;
    width: 60%;
    align-self: flex-end;
}

    .login-field label {
        font-weight: 600;
        color: #444;
        margin-bottom: .4rem;
    }

.login-input {
    width: 100%;
    font-size: 1rem;
}

.flex-grow {
    flex-grow: 1;
}

.login-button {
    margin-top: 1.5rem;
    background-color: #ff6b6b;
    color: #fff;
    font-weight: bold;
    border-radius: 20px;
    padding: .6rem 2rem;
    width: auto;
    letter-spacing: .05rem;
    align-self: flex-start;
    margin-left: .2rem;
}

.login-error {
    color: red;
    font-weight: bold;
    margin-top: 1rem;
    align-self: center;
    text-align: center;
}

.password-toggle-btn {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* ==========================================================================
   HOME PAGE - CARD GRID
   ========================================================================== */
.card-grid-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem 1rem;
    box-sizing: border-box;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
    gap: clamp(1rem,2vw,2rem);
}

.custom-card {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    padding: clamp(1rem,1.5vw,1.5rem);
    border-radius: .75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    background-color: #fff;
    transition: transform .2s ease-in-out;
}

    .custom-card:hover {
        transform: translateY(-2px);
    }

.card-icon-wrapper {
    background-color: #001b4d;
    color: #fff;
    width: clamp(60px,7vw,80px);
    height: clamp(60px,7vw,80px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto .5rem auto;
    font-size: clamp(1.5rem,3vw,2rem);
}

.vai-btn {
    background-color: #ff6b6b;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: .5rem 1.5rem;
    font-weight: bold;
    font-size: clamp(.85rem,1vw,1rem);
    cursor: pointer;
    transition: background-color .2s ease-in-out;
}

    .vai-btn:hover {
        background-color: #ff4b4b;
    }

/* ==========================================================================
   REPORTS
   ========================================================================== */
.report-wrapper {
    width: 100%;
    max-width: 100%;
    padding: 4px;
    box-sizing: border-box;
}

.report-grid-container {
    width: 100%;
    height: 100%;
    overflow-x: auto;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,.05);
}

.report-filters {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

    .report-filters > div {
        display: flex;
        align-items: flex-end;
    }

.date-range-wrapper {
    display: flex;
    gap: 1rem;
}

.align-btn-report {
    padding-bottom: 0;
}

.toolbar-options label {
    font-weight: 500;
    font-size: .95rem;
}

.toolbar-buttons {
    margin-top: .5rem;
}

.k-checkbox-label {
    display: flex;
    align-items: center;
    font-size: .95rem;
    font-weight: 500;
}

/* ==========================================================================
   BACHECA MESSAGGI
   ========================================================================== */
.bacheca-container {
    display: flex;
    justify-content: center;
    background-color: #f4f4f4;
    min-height: calc(100vh - 100px);
    box-sizing: border-box;
}

.bacheca-wrapper {
    width: 100%;
    max-width: 1000px;
    padding: .5rem;
    box-sizing: border-box;
}

.form-wrapper {
    display: flex;
    justify-content: center;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 600px;
    padding: clamp(1rem,2vw,2rem);
    background-color: #fdfdfd;
    border-radius: .5rem;
    box-shadow: 0 .1rem .4rem rgba(0,0,0,.05);
    box-sizing: border-box;
}

    .form-section label.form-label {
        font-size: clamp(.9rem,1vw,1rem);
        font-weight: 500;
        color: #555;
        margin-bottom: .25rem;
    }

    .form-section .k-textbox, .form-section .k-multiselect, .form-section .k-editor, .form-section .k-upload, .form-section .k-button, .form-section .k-checkbox-label {
        font-size: clamp(.9rem,1vw,1rem);
        width: 100%;
        box-sizing: border-box;
    }

    .form-section .k-editor {
        min-height: 200px;
        height: clamp(200px,40vh,300px);
    }

.company-filter-btn {
    margin-right: .5rem;
    font-size: clamp(.8rem,1vw,1rem);
    padding: .4rem .8rem;
    border-radius: 999px;
}

.file-label {
    margin-top: .5rem;
    font-size: .9rem;
    color: #444;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.message-thread {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
    margin-top: 1.25rem;
}

.message-bubble {
    background-color: #fff;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 .125rem .625rem rgba(0,0,0,.08);
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    box-sizing: border-box;
}

    .message-bubble.sent {
        background-color: #d4f4dd;
        border: 1px solid #b3e6c0;
    }

    .message-bubble.received {
        background-color: #e0f0ff;
        border: 1px solid #b3d1e6;
    }

.message-header {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1vw;
    margin-bottom: .25rem;
}

.avatar-circle {
    --avatar-size: clamp(2.5rem,5vw,3.5rem);
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 50%;
    background-color: #2196f3;
    color: #fff;
    font-weight: 600;
    font-size: calc(var(--avatar-size)*.45);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    padding: 0;
    margin: .5rem;
    box-sizing: border-box;
    aspect-ratio: 1/1;
}

.avatar-text {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    line-height: 1;
    margin: 0;
    padding: 0;
    font-size: inherit;
}

.message-title {
    font-weight: 600;
    font-size: 1rem;
    flex: 1 1 auto;
    line-height: 1.2;
    margin: 0;
    padding: 0;
    word-break: break-word;
}

.message-body {
    font-size: 1rem;
    color: #333;
    margin-top: .25rem;
    white-space: pre-wrap;
    margin-left: 1rem;
}

.message-date {
    font-size: .8rem;
    color: #888;
    white-space: nowrap;
}

.message-actions {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    justify-content: center;
    align-items: flex-start;
}
    /* ==========================================================================
   BACHECA MESSAGGI - BOTTONI ALLINEATI AL DESIGN SYSTEM
   ========================================================================== */

    /* Bottoni azioni nella griglia */
    .message-actions .k-button {
        background: #fff !important;
        border: 2px solid var(--primary-color) !important; /* #003366 */
        color: var(--primary-color) !important;
        border-radius: 6px !important;
        padding: .375rem !important;
        box-shadow: 0 2px 4px rgba(0,51,102,.1) !important;
        transition: all .2s ease !important;
        font-weight: 500 !important;
        min-height: 32px !important;
        min-width: 32px !important;
    }

        .message-actions .k-button:hover {
            background: var(--primary-color) !important;
            color: #fff !important;
            transform: translateY(-1px) !important;
            box-shadow: 0 4px 8px rgba(0,51,102,.2) !important;
        }

        /* Bottoni azioni specifiche per tipo */
        .message-actions .k-button[title="Nuovo"] {
            border-color: #28a745 !important;
            color: #28a745 !important;
        }

            .message-actions .k-button[title="Nuovo"]:hover {
                background: #28a745 !important;
                color: #fff !important;
            }

        .message-actions .k-button[title="Modifica"] {
            border-color: #ff9800 !important;
            color: #ff9800 !important;
        }

            .message-actions .k-button[title="Modifica"]:hover {
                background: #ff9800 !important;
                color: #fff !important;
            }

        .message-actions .k-button[title="Elimina"] {
            border-color: #dc3545 !important;
            color: #dc3545 !important;
        }

            .message-actions .k-button[title="Elimina"]:hover {
                background: #dc3545 !important;
                color: #fff !important;
            }

        .message-actions .k-button[title="Scarica Allegato"] {
            border-color: #17a2b8 !important;
            color: #17a2b8 !important;
        }

            .message-actions .k-button[title="Scarica Allegato"]:hover {
                background: #17a2b8 !important;
                color: #fff !important;
            }

/* Container per layout a coppie dei bottoni */
.form-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.company-buttons-row {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.action-buttons-row {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

/* Bottoni filtro azienda - più piccoli e con larghezza fissa */
.company-filter-btn {
    background-color: #fff !important;
    border: 2px solid var(--primary-color) !important;
    color: var(--primary-color) !important;
    border-radius: 999px !important;
    font-weight: 500 !important;
    transition: all .2s ease !important;
    font-size: .85rem !important;
    padding: .3rem .5rem !important;
    flex: 1 1 48% !important; /* Ogni bottone occupa il 48% della larghezza */
    text-align: center !important;
    min-width: 0 !important;
    white-space: nowrap !important;
}

    .company-filter-btn:hover {
        background-color: var(--primary-color) !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 2px 4px rgba(0,51,102,.2) !important;
    }

/* Bottoni form principale (Invia/Annulla) - più piccoli e con larghezza fissa */
.k-button-primary {
    background-color: #fff !important;
    border: 2px solid #007bff !important;
    color: #007bff !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: .4rem .5rem !important;
    transition: all .2s ease !important;
    /*font-size: .9rem !important;*/
    flex: 1 1 48% !important; /* Ogni bottone occupa il 48% della larghezza */
    text-align: center !important;
    min-width: 0 !important;
}

    .k-button-primary:hover {
        background-color: #007bff !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0,123,255,.2) !important;
    }

.k-button-error {
    background-color: #fff !important;
    border: 2px solid #dc3545 !important;
    color: #dc3545 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: .4rem .5rem !important;
    transition: all .2s ease !important;
    font-size: .9rem !important;
    flex: 1 1 48% !important; /* Ogni bottone occupa il 48% della larghezza */
    text-align: center !important;
    min-width: 0 !important;
}

    .k-button-error:hover {
        background-color: #dc3545 !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(220,53,69,.2) !important;
    }

/* Bottoni gestione allegati (Mantieni/Rimuovi) */
.file-label .k-button {
    background-color: #fff !important;
    border: 2px solid #6c757d !important;
    color: #6c757d !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    transition: all .2s ease !important;
    padding: .25rem .5rem !important;
    font-size: .75rem !important;
    margin-left: .5rem !important;
}

    .file-label .k-button:hover {
        background-color: #6c757d !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 2px 4px rgba(108,117,125,.2) !important;
    }

/* Responsive - Mobile */
@media (max-width: 768px) {
    .message-actions .k-button {
        min-height: 28px !important;
        min-width: 28px !important;
        padding: .25rem !important;
        border-width: 1px !important;
    }

        .message-actions .k-button:hover {
            transform: none !important;
        }

    .k-button-primary,
    .k-button-error {
        width: 100% !important;
        margin-bottom: .5rem !important;
        padding: .75rem 1rem !important;
    }

        .k-button-primary:hover,
        .k-button-error:hover {
            transform: none !important;
        }

    .company-filter-btn {
        font-size: .75rem !important;
        padding: .3rem .6rem !important;
        border-width: 1px !important;
        margin-bottom: .25rem !important;
    }

        .company-filter-btn:hover {
            transform: none !important;
        }

    .file-label .k-button {
        border-width: 1px !important;
        margin-top: .25rem !important;
        margin-left: 0 !important;
    }

        .file-label .k-button:hover {
            transform: none !important;
        }
}

.t-dropzone {
    border: 2px dashed #aaa;
    padding: 1rem;
    text-align: center;
    background-color: #f5f5f5;
    border-radius: .5rem;
    font-size: .95rem;
    color: #444;
}

.attachment-section {
    margin-top: .625rem;
    padding-top: .625rem;
    border-top: 1px solid #e0e0e0;
}

.download-link {
    display: inline-block;
    margin-top: .5rem;
    color: #1976d2;
    font-size: .9rem;
    text-decoration: none;
}

/* ==========================================================================
   WINDOW RESPONSIVE (generico)
   ========================================================================== */
.responsive-window {
    max-width: 100%;
    width: 90vw !important;
    max-height: 95vh;
    height: auto !important;
    padding: 0;
    box-sizing: border-box;
}

.k-window {
    border-radius: 12px;
}

.k-window-content {
    overflow-y: auto;
    max-height: 80vh;
    padding: 1rem;
}

/* ==========================================================================
   SCHEDULER – BASE & COMUNI (valido per tutte le istanze)
   ========================================================================== */
.k-scheduler .k-event {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
}
/* lasciamo gestire il colore via template o .event-fill */
.k-scheduler .k-link {
    cursor: pointer !important;
    user-select: none !important;
    display: inline-block !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    transition: background-color .2s ease !important;
}

    .k-scheduler .k-link:hover {
        background-color: rgba(0,123,255,.1) !important;
    }

.k-scheduler-monthview .k-link {
    width: 100% !important;
    text-align: center !important;
    min-height: 20px !important;
    line-height: 20px !important;
}

.k-scheduler-weekview .k-link, .k-scheduler-dayview .k-link {
    width: 100% !important;
    text-align: center !important;
    min-height: 24px !important;
    line-height: 24px !important;
}

.slot-btn {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1.2;
    color: transparent;
}

    .slot-btn.today {
        font-weight: 700;
    }

    .slot-btn.is-selected {
        background: rgba(49,132,253,.14);
        outline: 1px solid rgba(49,132,253,.45);
        font-weight: 700;
    }

.k-scheduler-monthview td.k-scheduler-cell:has(.slot-btn.is-selected) {
    background: rgba(49,132,253,.10);
    outline: 2px solid rgba(49,132,253,.35);
}

.k-scheduler-weekview .slot-btn.is-selected, .k-scheduler-dayview .slot-btn.is-selected {
    background: rgba(49,132,253,.18);
    outline: 2px solid rgba(49,132,253,.45);
}

/* Template (contenuto) */
.k-event-template {
    padding: .5rem !important;
    border-radius: .375rem !important;
    box-shadow: 0 2px 4px rgba(0,0,0,.1) !important;
    cursor: pointer !important;
    transition: all .2s ease !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

    .k-event-template:hover {
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0,0,0,.15) !important;
    }

.event-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .25rem;
    font-weight: 600;
}

.event-time {
    font-size: .85rem;
    font-weight: 500;
    opacity: .9;
    margin-bottom: .125rem;
}

.event-user {
    font-size: .8rem;
    opacity: .8;
    font-style: italic;
}
/* Mobile compact (Month) */
.event-mobile {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: .8rem !important;
    line-height: 1.2 !important;
    padding: 2px 4px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    width: 100% !important;
    height: 100% !important;
}

.event-title-mobile {
    flex: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-weight: 600 !important;
}

.event-time-mobile {
    flex-shrink: 0 !important;
    font-size: .75rem !important;
    opacity: .8 !important;
}
/* Stella personale */
.my-reservation-star {
    color: #ffd700;
    font-size: 1rem;
    text-shadow: 0 0 2px rgba(0,0,0,.3);
    animation: starGlow 2s ease-in-out infinite alternate;
}

@keyframes starGlow {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 2px #ffd700);
    }

    100% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 4px #ffd700);
    }
}

/* ==========================================================================
   SCHEDULER – MONTH VIEW (compattazione)
   ========================================================================== */
.custom-scheduler-fixed.k-scheduler-monthview .k-scheduler-table tr {
    height: auto !important;
    min-height: 90px !important;
}

.custom-scheduler-fixed.k-scheduler-monthview .k-scheduler-table td {
    vertical-align: top !important;
    padding: 2px !important;
}

.custom-scheduler-fixed.k-scheduler-monthview .k-event {
    height: auto !important;
    min-height: 26px !important;
    max-height: none !important;
    line-height: normal !important;
    margin: 1px !important;
    overflow: visible !important;
}

    .custom-scheduler-fixed.k-scheduler-monthview .k-event[style*="height"] {
        height: auto !important;
        min-height: 26px !important;
    }

/* ==========================================================================
   SCHEDULER – WEEK/DAY (riempimento corretto della durata)
   ========================================================================== */
/* NON impostiamo height/position sul .k-event. Lasciamo l’altezza inline di Telerik. */
.custom-scheduler-fixed.k-scheduler-weekview .k-event-template,
.custom-scheduler-fixed.k-scheduler-dayview .k-event-template {
    height: 100% !important;
    min-height: 100% !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    padding: 4px 6px !important;
    box-sizing: border-box !important;
}

.custom-scheduler-fixed.k-scheduler-weekview .event-desktop,
.custom-scheduler-fixed.k-scheduler-dayview .event-desktop {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.custom-scheduler-fixed.k-scheduler-weekview .event-mobile,
.custom-scheduler-fixed.k-scheduler-dayview .event-mobile {
    display: none !important;
}

.custom-scheduler-fixed.k-scheduler-weekview .event-header,
.custom-scheduler-fixed.k-scheduler-dayview .event-header {
    margin-bottom: 4px !important;
}

.custom-scheduler-fixed.k-scheduler-weekview .event-time,
.custom-scheduler-fixed.k-scheduler-dayview .event-time {
    font-size: .8rem !important;
    margin-bottom: 2px !important;
}

.custom-scheduler-fixed.k-scheduler-weekview .event-user,
.custom-scheduler-fixed.k-scheduler-dayview .event-user {
    font-size: .75rem !important;
    margin-top: auto !important;
}

/* Colora il CONTENITORE evento quando presente .event-fill (altrimenti resta trasparente) */
.k-scheduler .k-event.event-fill > .k-event-template {
    background: transparent !important;
    box-shadow: none !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.k-scheduler .k-event.event-fill .k-event-body,
.k-scheduler .k-event.event-fill .k-scheduler-event-content {
    height: 100% !important;
}

/* ==========================================================================
   PAGE HEADER - FIX SPECIFICO PER STRUTTURA ESISTENTE
   ========================================================================== */

/* Se la struttura non ha .page-header, applichiamo alle pagine sale riunioni */
.sale-riunioni-wrapper {
    padding: 1rem;
}

    /* Aggiungiamo un header artificiale sopra lo scheduler */
    .sale-riunioni-wrapper::before {
        content: '';
        display: block;
        height: 0;
    }

    /* Container che probabilmente contiene titolo e pulsante */
    .sale-riunioni-wrapper > *:first-child,
    .page-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        margin-bottom: 1.5rem !important;
        padding: 0.5rem 0 !important;
        gap: 2rem !important;
    }

    /* Il titolo della pagina */
    h1, .page-title,
    .sale-riunioni-wrapper h1,
    .sale-riunioni-wrapper .page-title {
        margin: 0 !important;
        font-size: clamp(1.4rem, 3vw, 2rem) !important;
        font-weight: 600 !important;
        color: var(--primary-color, #003366) !important;
        white-space: nowrap !important;
        flex: 1 !important;
        text-align: left !important;
    }

        /* Se il titolo è nascosto, mostriamolo */
        .sale-riunioni-wrapper h1[style*="display: none"],
        .page-title[style*="display: none"] {
            display: block !important;
        }

    /* Container per i pulsanti di azione */
    .page-actions,
    .sale-riunioni-wrapper .page-actions {
        display: flex !important;
        gap: 0.75rem !important;
        align-items: center !important;
        flex-shrink: 0 !important;
        margin-left: auto !important; /* Forza l'allineamento a destra */
    }

        /* Tutti i pulsanti nel header */
        .page-actions .k-button,
        .sale-riunioni-wrapper .k-button[title*="Aggiungi"],
        .sale-riunioni-wrapper .k-button[title*="Nuovo"],
        button[title*="Aggiungi"],
        button[title*="Nuovo"] {
            background-color: #fff !important;
            border: 2px solid #28a745 !important;
            color: #28a745 !important;
            border-radius: 6px !important;
            font-weight: 500 !important;
            padding: 0.5rem 1rem !important;
            transition: all 0.2s ease !important;
            white-space: nowrap !important;
            min-height: 40px !important;
            box-shadow: 0 2px 4px rgba(40,167,69,.1) !important;
        }

            .page-actions .k-button:hover,
            .sale-riunioni-wrapper .k-button[title*="Aggiungi"]:hover,
            .sale-riunioni-wrapper .k-button[title*="Nuovo"]:hover,
            button[title*="Aggiungi"]:hover,
            button[title*="Nuovo"]:hover {
                background-color: #28a745 !important;
                color: #fff !important;
                transform: translateY(-1px) !important;
                box-shadow: 0 4px 8px rgba(40,167,69,.2) !important;
            }

    /* Se hai un layout con flexbox o grid, forziamo la struttura corretta */
    .sale-riunioni-wrapper > div:first-of-type {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        margin-bottom: 1.5rem !important;
    }

/* ==========================================================================
   MOBILE RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    .sale-riunioni-wrapper > *:first-child,
    .page-header {
        flex-direction: column !important;
        gap: 1rem !important;
        text-align: center !important;
        padding: 1rem 0 !important;
    }

    h1, .page-title,
    .sale-riunioni-wrapper h1 {
        text-align: center !important;
        margin-bottom: 0.5rem !important;
        font-size: 1.4rem !important;
    }

    .page-actions,
    .sale-riunioni-wrapper .page-actions {
        justify-content: center !important;
        width: 100% !important;
        margin-left: 0 !important;
    }

        .page-actions .k-button,
        .sale-riunioni-wrapper .k-button[title*="Aggiungi"] {
            width: 100% !important;
            max-width: 250px !important;
            padding: 0.75rem 1rem !important;
        }

            .page-actions .k-button:hover,
            .sale-riunioni-wrapper .k-button[title*="Aggiungi"]:hover {
                transform: none !important;
            }
}

/* ==========================================================================
   FIX EMERGENCY - SE NIENTE FUNZIONA
   ========================================================================== */

/* Crea artificialmente l'header se manca */
.sale-riunioni-wrapper:not(:has(.page-header)):not(:has(h1))::before {
    content: "Gestione Sale Riunioni";
    display: block;
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color, #003366);
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
}

/* Assicuriamoci che qualsiasi pulsante con "+" sia verde e a destra */
button:contains("+"),
.k-button:contains("+"),
[title*="Aggiungi"],
[aria-label*="Aggiungi"] {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    background-color: #fff !important;
    border: 2px solid #28a745 !important;
    color: #28a745 !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.2rem !important;
    font-weight: bold !important;
    z-index: 1000 !important;
}

.k-form-field {
    margin-bottom: 1rem;
}

.dialog-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.k-button-primary {
    background-color: #007bff;
    color: #fff;
}

.k-button-error {
    background-color: #dc3545;
    color: #fff;
}

.scheduler-info {
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.sale-riunioni-window {
    max-width: 95vw !important;
    width: 800px !important;
    box-sizing: border-box;
    z-index: 10001 !important;
    position: fixed !important;
}

.sale-riunioni-form {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: .5rem;
    box-shadow: 0 .1rem .3rem rgba(0,0,0,.05);
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1 !important;
}

    .sale-riunioni-form .form-field {
        display: flex;
        flex-direction: column;
        gap: .5rem;
        width: 100%;
        pointer-events: auto !important;
    }

    .sale-riunioni-form .form-label {
        font-size: clamp(.9rem,1vw,1rem);
        font-weight: 500;
        color: #444;
        margin-bottom: .25rem;
    }

    .sale-riunioni-form .k-input, .sale-riunioni-form .k-picker, .sale-riunioni-form .k-dropdown, .sale-riunioni-form .k-datetimepicker {
        width: 100% !important;
        box-sizing: border-box !important;
        min-height: 44px;
        pointer-events: auto !important;
        position: relative !important;
        z-index: 2 !important;
    }

    .sale-riunioni-form .dialog-buttons {
        margin-top: 1.5rem;
        display: flex;
        flex-wrap: wrap;
        gap: .75rem;
        justify-content: flex-end;
        pointer-events: auto !important;
    }

        .sale-riunioni-form .dialog-buttons .k-button {
            min-height: 44px;
            padding: .75rem 1rem;
            border-radius: .25rem;
            font-weight: 500;
            pointer-events: auto !important;
            position: relative !important;
            z-index: 2 !important;
        }
/* palette sale */
.room-color-blue {
    background: linear-gradient(135deg,#e3f2fd 0%,#bbdefb 100%) !important;
    border-left: 4px solid #2196f3 !important;
    color: #0d47a1 !important;
}

.room-color-green {
    background: linear-gradient(135deg,#e8f5e8 0%,#c8e6c9 100%) !important;
    border-left: 4px solid #4caf50 !important;
    color: #1b5e20 !important;
}

.room-color-orange {
    background: linear-gradient(135deg,#fff3e0 0%,#ffcc02 100%) !important;
    border-left: 4px solid #ff9800 !important;
    color: #e65100 !important;
}

.room-color-purple {
    background: linear-gradient(135deg,#f3e5f5 0%,#e1bee7 100%) !important;
    border-left: 4px solid #9c27b0 !important;
    color: #4a148c !important;
}

.room-color-red {
    background: linear-gradient(135deg,#ffebee 0%,#ffcdd2 100%) !important;
    border-left: 4px solid #f44336 !important;
    color: #b71c1c !important;
}

.room-color-teal {
    background: linear-gradient(135deg,#e0f2f1 0%,#b2dfdb 100%) !important;
    border-left: 4px solid #009688 !important;
    color: #004d40 !important;
}

.room-color-default {
    background: linear-gradient(135deg,#f5f5f5 0%,#e0e0e0 100%) !important;
    border-left: 4px solid #757575 !important;
    color: #424242 !important;
}

/* Applicazione palette direttamente al contenitore quando richiesto */
.k-scheduler .k-event.event-fill.room-color-blue {
    background: linear-gradient(135deg,#e3f2fd 0%,#bbdefb 100%) !important;
    border-left: 4px solid #2196f3 !important;
    color: #0d47a1 !important;
}

.k-scheduler .k-event.event-fill.room-color-green {
    background: linear-gradient(135deg,#e8f5e8 0%,#c8e6c9 100%) !important;
    border-left: 4px solid #4caf50 !important;
    color: #1b5e20 !important;
}

.k-scheduler .k-event.event-fill.room-color-orange {
    background: linear-gradient(135deg,#fff3e0 0%,#ffcc02 100%) !important;
    border-left: 4px solid #ff9800 !important;
    color: #e65100 !important;
}

.k-scheduler .k-event.event-fill.room-color-purple {
    background: linear-gradient(135deg,#f3e5f5 0%,#e1bee7 100%) !important;
    border-left: 4px solid #9c27b0 !important;
    color: #4a148c !important;
}

.k-scheduler .k-event.event-fill.room-color-red {
    background: linear-gradient(135deg,#ffebee 0%,#ffcdd2 100%) !important;
    border-left: 4px solid #f44336 !important;
    color: #b71c1c !important;
}

.k-scheduler .k-event.event-fill.room-color-teal {
    background: linear-gradient(135deg,#e0f2f1 0%,#b2dfdb 100%) !important;
    border-left: 4px solid #009688 !important;
    color: #004d40 !important;
}

.k-scheduler .k-event.event-fill.room-color-default {
    background: linear-gradient(135deg,#f5f5f5 0%,#e0e0e0 100%) !important;
    border-left: 4px solid #757575 !important;
    color: #424242 !important;
}

/* ==========================================================================
   AUTOMEZZI – SPECIFICI (wrapper, dialog, palette)
   ========================================================================== */
.automezzi-wrapper {
    padding: 4px;
    position: relative;
}

    .automezzi-wrapper .k-window {
        max-width: 95vw !important;
        box-sizing: border-box;
        z-index: 10001 !important;
        pointer-events: auto !important;
        position: fixed !important;
    }

        .automezzi-wrapper .k-window .k-window-content {
            max-height: 80vh !important;
            overflow-y: auto !important;
            padding: 1.5rem !important;
        }

    .automezzi-wrapper .k-form {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        background-color: #f9f9f9;
        border-radius: .5rem;
        padding: clamp(1rem,2vw,1.5rem);
        box-shadow: 0 .1rem .3rem rgba(0,0,0,.05);
    }

    .automezzi-wrapper .k-form-field {
        display: flex;
        flex-direction: column;
        gap: .5rem;
        width: 100%;
        margin-bottom: 1rem;
    }

    .automezzi-wrapper .k-label, .automezzi-wrapper .k-form-label, .automezzi-wrapper label {
        font-size: clamp(.9rem,1vw,1rem);
        font-weight: 500;
        color: #444;
        margin-bottom: .25rem;
    }

    .automezzi-wrapper .k-input, .automezzi-wrapper .k-picker, .automezzi-wrapper .k-dropdown, .automezzi-wrapper .k-datetimepicker, .automezzi-wrapper .k-numerictextbox, .automezzi-wrapper .k-checkbox, .automezzi-wrapper .k-textbox {
        width: 100% !important;
        box-sizing: border-box !important;
        min-height: 44px;
    }

    .automezzi-wrapper .k-checkbox {
        width: auto !important;
        min-height: auto;
        margin-top: .25rem;
    }

    .automezzi-wrapper .dialog-buttons {
        margin-top: 1.5rem;
        display: flex;
        flex-wrap: wrap;
        gap: .75rem;
        justify-content: flex-end;
    }

        .automezzi-wrapper .dialog-buttons .k-button, .automezzi-wrapper .k-form .k-button {
            min-height: 44px;
            padding: .75rem 1rem;
            border-radius: .25rem;
            font-weight: 500;
        }

    .automezzi-wrapper .k-form-field .k-button {
        width: auto !important;
        margin-right: .5rem;
        margin-bottom: .5rem;
    }

    .automezzi-wrapper input[type="file"] {
        width: 100% !important;
        padding: .75rem !important;
        border: 1px solid #ccc !important;
        border-radius: .25rem !important;
        background-color: #fff !important;
        font-size: 16px !important;
        min-height: 44px !important;
        box-sizing: border-box !important;
    }

    .automezzi-wrapper .validation-summary {
        background-color: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
        border-radius: .25rem;
        padding: .75rem;
        margin-bottom: 1rem;
    }

        .automezzi-wrapper .validation-summary ul {
            margin: 0;
            padding-left: 1.25rem;
        }
/* palette veicoli */
.vehicle-color-blue {
    background: linear-gradient(135deg,#e1f5fe 0%,#b3e5fc 100%) !important;
    border-left: 4px solid #03a9f4 !important;
    color: #01579b !important;
}

.vehicle-color-green {
    background: linear-gradient(135deg,#e8f5e8 0%,#c8e6c9 100%) !important;
    border-left: 4px solid #4caf50 !important;
    color: #1b5e20 !important;
}

.vehicle-color-orange {
    background: linear-gradient(135deg,#fff8e1 0%,#ffecb3 100%) !important;
    border-left: 4px solid #ffc107 !important;
    color: #f57f17 !important;
}

.vehicle-color-purple {
    background: linear-gradient(135deg,#f3e5f5 0%,#e1bee7 100%) !important;
    border-left: 4px solid #9c27b0 !important;
    color: #4a148c !important;
}

.vehicle-color-red {
    background: linear-gradient(135deg,#ffebee 0%,#ffcdd2 100%) !important;
    border-left: 4px solid #f44336 !important;
    color: #b71c1c !important;
}

.vehicle-color-teal {
    background: linear-gradient(135deg,#e0f2f1 0%,#b2dfdb 100%) !important;
    border-left: 4px solid #009688 !important;
    color: #004d40 !important;
}

.vehicle-color-indigo {
    background: linear-gradient(135deg,#e8eaf6 0%,#c5cae9 100%) !important;
    border-left: 4px solid #3f51b5 !important;
    color: #1a237e !important;
}

.vehicle-color-default {
    background: linear-gradient(135deg,#f5f5f5 0%,#e0e0e0 100%) !important;
    border-left: 4px solid #757575 !important;
    color: #424242 !important;
}

/* ==========================================================================
   AUTOMEZZI - EVENTI UNIFICATI
   ========================================================================== */

/* Padding per il contenuto della finestra automezzi */
.automezzi-wrapper .k-window-content {
    max-height: 80vh !important;
    overflow-y: auto !important;
    padding: 2rem !important; /* Aumentato il padding */
}

/* Miglior spacing per i campi del form */
.automezzi-wrapper .k-form-field {
    display: flex;
    flex-direction: column;
    gap: .75rem; /* Aumentato il gap */
    width: 100%;
    margin-bottom: 1.5rem; /* Aumentato il margin */
}

/* Lista eventi esistenti */
.events-list {
    margin-bottom: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
    background-color: #fff;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem; /* Aumentato il padding */
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

    .event-item:last-child {
        border-bottom: none;
    }

    .event-item:hover {
        background-color: #f8f9fa;
    }

.event-badge {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
}

.event-badge-damage {
    background-color: #fff3e0;
    color: #e65100;
    border: 2px solid #ff9800;
}

.event-badge-receipt {
    background-color: #e8f5e8;
    color: #1b5e20;
    border: 2px solid #4caf50;
}

.event-badge-default {
    background-color: #f5f5f5;
    color: #424242;
    border: 2px solid #757575;
}

.event-content {
    flex: 1;
    min-width: 0;
}

.event-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 0.5rem; /* Aumentato il margin */
}

.event-details {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4; /* Migliorato il line-height */
}

.event-date {
    display: block;
    color: #888;
    font-size: 0.75rem;
    margin-top: 0.5rem; /* Aumentato il margin */
}

/* Bottone per aggiungere nuovo evento */
.add-event-btn {
    width: 100% !important;
    margin-top: 1rem !important; /* Aumentato il margin */
    background-color: #fff !important;
    border: 2px dashed var(--primary-color) !important;
    color: var(--primary-color) !important;
    border-radius: 6px !important;
    padding: 1rem !important; /* Aumentato il padding */
    transition: all 0.2s ease !important;
    font-weight: 500 !important;
}

    .add-event-btn:hover {
        background-color: var(--primary-color) !important;
        color: #fff !important;
        border-style: solid !important;
        transform: translateY(-1px) !important;
    }

/* Form per nuovo evento */
.new-event-form {
    margin-top: 1.5rem; /* Aumentato il margin */
    padding: 1.5rem; /* Aumentato il padding */
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.form-row {
    display: flex;
    gap: 1.5rem; /* Aumentato il gap */
    margin-bottom: 1.5rem; /* Aumentato il margin */
}

.form-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Aumentato il gap */
}

.form-col-full {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Aumentato il gap */
}

    .form-col label,
    .form-col-full label {
        font-weight: 500;
        font-size: 0.9rem;
        color: #555;
        margin-bottom: 0.25rem; /* Aggiunto margin per le label */
    }

/* Input nei form eventi con più padding */
.new-event-form .k-input,
.new-event-form .k-textbox,
.new-event-form .k-dropdown,
.new-event-form .k-numerictextbox,
.new-event-form .k-textarea {
    padding: 0.75rem !important; /* Padding più generoso */
    border-radius: 6px !important;
}

/* Bottoni del form eventi */
.event-form-buttons {
    display: flex;
    gap: 1rem; /* Aumentato il gap */
    justify-content: flex-end;
    margin-top: 1.5rem; /* Aumentato il margin */
    padding-top: 1.5rem; /* Aumentato il padding */
    border-top: 1px solid #e0e0e0;
}

    .event-form-buttons .k-button {
        background-color: #fff !important;
        border: 2px solid #007bff !important;
        color: #007bff !important;
        border-radius: 6px !important;
        font-weight: 500 !important;
        padding: 0.75rem 1.5rem !important; /* Padding più generoso */
        transition: all 0.2s ease !important;
    }

        .event-form-buttons .k-button:hover {
            background-color: #007bff !important;
            color: #fff !important;
            transform: translateY(-1px) !important;
            box-shadow: 0 2px 4px rgba(0,123,255,.2) !important;
        }

        .event-form-buttons .k-button[data-action="cancel"] {
            border-color: #6c757d !important;
            color: #6c757d !important;
        }

            .event-form-buttons .k-button[data-action="cancel"]:hover {
                background-color: #6c757d !important;
                color: #fff !important;
                box-shadow: 0 2px 4px rgba(108,117,125,.2) !important;
            }

/* Responsive per eventi */
@media (max-width: 768px) {
    /* Padding ridotto ma ancora generoso su mobile */
    .automezzi-wrapper .k-window-content {
        padding: 1.5rem !important;
    }

    .form-row {
        flex-direction: column;
        gap: 1rem; /* Gap ridotto su mobile */
    }

    .event-form-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

        .event-form-buttons .k-button {
            width: 100% !important;
            padding: 1rem !important;
        }

    .event-item {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.75rem; /* Padding ridotto ma ancora confortevole */
    }

    .event-badge {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.8rem;
    }

    .event-title {
        font-size: 0.85rem;
    }

    .event-details {
        font-size: 0.75rem;
    }

    .event-date {
        font-size: 0.7rem;
    }

    .events-list {
        max-height: 250px;
    }

    .add-event-btn {
        padding: 0.75rem !important;
        font-size: 0.85rem !important;
    }

    .new-event-form {
        padding: 1rem;
    }

    .form-col label,
    .form-col-full label {
        font-size: 0.8rem;
    }
}

.targa {
    color: #000 !important;
    background-color: #fff !important;
    border-left: .6rem solid blue;
    border-right: .6rem solid blue;
}
/* applicazione palette al contenitore quando richiesto */
.k-scheduler .k-event.event-fill.vehicle-color-blue {
    background: linear-gradient(135deg,#e1f5fe 0%,#b3e5fc 100%) !important;
    border-left: 4px solid #03a9f4 !important;
    color: #01579b !important;
}

.k-scheduler .k-event.event-fill.vehicle-color-green {
    background: linear-gradient(135deg,#e8f5e8 0%,#c8e6c9 100%) !important;
    border-left: 4px solid #4caf50 !important;
    color: #1b5e20 !important;
}

.k-scheduler .k-event.event-fill.vehicle-color-orange {
    background: linear-gradient(135deg,#fff8e1 0%,#ffecb3 100%) !important;
    border-left: 4px solid #ffc107 !important;
    color: #f57f17 !important;
}

.k-scheduler .k-event.event-fill.vehicle-color-purple {
    background: linear-gradient(135deg,#f3e5f5 0%,#e1bee7 100%) !important;
    border-left: 4px solid #9c27b0 !important;
    color: #4a148c !important;
}

.k-scheduler .k-event.event-fill.vehicle-color-red {
    background: linear-gradient(135deg,#ffebee 0%,#ffcdd2 100%) !important;
    border-left: 4px solid #f44336 !important;
    color: #b71c1c !important;
}

.k-scheduler .k-event.event-fill.vehicle-color-teal {
    background: linear-gradient(135deg,#e0f2f1 0%,#b2dfdb 100%) !important;
    border-left: 4px solid #009688 !important;
    color: #004d40 !important;
}

.k-scheduler .k-event.event-fill.vehicle-color-indigo {
    background: linear-gradient(135deg,#e8eaf6 0%,#c5cae9 100%) !important;
    border-left: 4px solid #3f51b5 !important;
    color: #1a237e !important;
}

.k-scheduler .k-event.event-fill.vehicle-color-default {
    background: linear-gradient(135deg,#f5f5f5 0%,#e0e0e0 100%) !important;
    border-left: 4px solid #757575 !important;
    color: #424242 !important;
}

/* ==========================================================================
   RESPONSIVE – SCHEDULER (solo regole utili)
   ========================================================================== */
@media (max-width:768px) {
    .event-mobile {
        font-size: .75rem !important;
        gap: 2px !important;
        padding: 1px 3px !important;
    }

    .event-time-mobile {
        font-size: .7rem !important;
    }

    .my-reservation-star {
        font-size: .8rem !important;
    }

    .custom-scheduler-fixed.k-scheduler-monthview .k-event[style*="height"] {
        height: auto !important;
        min-height: 22px !important;
    }

    .custom-scheduler-fixed.k-scheduler-monthview .k-scheduler-table tr {
        min-height: 70px !important;
    }
}

@media (max-width:480px) {
    .event-title-mobile {
        font-size: .75rem !important;
    }

    .my-reservation-star {
        font-size: .7rem !important;
    }

    .custom-scheduler-fixed.k-scheduler-monthview .k-scheduler-table tr {
        min-height: 60px !important;
    }
}


/* ==========================================================================
   GLOBAL WINDOW & OVERLAY FIXES
   ========================================================================== */
.k-overlay {
    z-index: 9999 !important;
    background-color: rgba(0,0,0,.5) !important;
    pointer-events: none !important;
}

.k-dialog-wrapper {
    z-index: 10000 !important;
    pointer-events: none !important;
}

    .k-window, .k-dialog-wrapper .k-window {
        z-index: 10001 !important;
        pointer-events: auto !important;
        position: fixed !important;
        box-shadow: 0 8px 32px rgba(0,0,0,.3) !important;
        border: none !important;
        border-radius: .5rem !important;
    }

        .k-window .k-window-titlebar, .k-dialog-wrapper .k-window .k-window-titlebar {
            background-color: #007bff !important;
            color: #fff !important;
            border-radius: .5rem .5rem 0 0 !important;
            padding: 1rem !important;
            pointer-events: auto !important;
            position: relative !important;
            z-index: 1 !important;
        }

        .k-window .k-window-content, .k-dialog-wrapper .k-window .k-window-content {
            pointer-events: auto !important;
            position: relative !important;
            z-index: 1 !important;
        }

        .k-window .k-window-title, .k-dialog-wrapper .k-window .k-window-title {
            font-weight: 600 !important;
            font-size: 1.1rem !important;
        }

.k-popup, .k-animation-container, .k-list-container {
    z-index: 10010 !important;
    pointer-events: auto !important;
}

/* ==========================================================================
   TELERIK GRID
   ========================================================================== */
.telerik-blazor .k-grid {
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
    padding-left: 1vw;
    padding-right: 2vw;
}

/* ==========================================================================
   GRID ACTION BUTTONS - ALLINEATI CON IL DESIGN SYSTEM
   ========================================================================== */
.grid-action-button {
    background-color: #fff;
    color: var(--primary-color); /* #003366 - coerente con il tema */
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    padding: .375rem .75rem;
    font-weight: 500;
    font-size: .875rem;
    transition: all .2s ease;
    cursor: pointer;
}

    .grid-action-button:hover {
        background-color: var(--primary-color);
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0,51,102,.2);
    }

.grid-action-edit {
    background-color: #fff;
    border: 2px solid #ff9800;
    color: #e65100;
    border-radius: 6px;
}

    .grid-action-edit:hover {
        background-color: #ff9800;
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(255,152,0,.2);
    }

.grid-action-save {
    background-color: #fff;
    border: 2px solid #007bff;
    color: #007bff;
    border-radius: 6px;
    font-weight: 500;
}

    .grid-action-save:hover {
        background-color: #007bff;
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0,123,255,.2);
    }

.grid-action-cancel {
    background-color: #fff;
    border: 2px solid #dc3545;
    color: #dc3545;
    border-radius: 6px;
}

    .grid-action-cancel:hover {
        background-color: #dc3545;
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(220,53,69,.2);
    }

.grid-action-undo {
    background-color: #fff;
    border: 2px solid #6f42c1;
    color: #6f42c1;
    border-radius: 6px;
}

    .grid-action-undo:hover {
        background-color: #6f42c1;
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(111,66,193,.2);
    }

.grid-action-roles {
    background-color: #fff;
    border: 2px solid #17a2b8;
    color: #17a2b8;
    border-radius: 6px;
}

    .grid-action-roles:hover {
        background-color: #17a2b8;
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(23,162,184,.2);
    }

/* Variante per bottoni più piccoli (mobile/compatti) */
@media (max-width: 768px) {
    .grid-action-button,
    .grid-action-edit,
    .grid-action-save,
    .grid-action-cancel,
    .grid-action-undo,
    .grid-action-roles {
        padding: .25rem .5rem;
        font-size: .75rem;
        min-height: 28px;
        min-width: 28px;
        border-width: 1px; /* Bordi più sottili su mobile */
    }

        .grid-action-button:hover,
        .grid-action-edit:hover,
        .grid-action-save:hover,
        .grid-action-cancel:hover,
        .grid-action-undo:hover,
        .grid-action-roles:hover {
            transform: none; /* Rimuoviamo l'animazione di movimento su mobile */
        }
}
/* Variante per bottoni più piccoli (mobile/compatti) */
@media (max-width: 768px) {
    .grid-action-button,
    .grid-action-edit,
    .grid-action-save,
    .grid-action-cancel,
    .grid-action-undo,
    .grid-action-roles {
        padding: .25rem .5rem;
        font-size: .75rem;
        min-height: 28px;
        min-width: 28px;
        border-width: 1px; /* Bordi più sottili su mobile */
    }

        .grid-action-button:hover,
        .grid-action-edit:hover,
        .grid-action-save:hover,
        .grid-action-cancel:hover,
        .grid-action-undo:hover,
        .grid-action-roles:hover {
            transform: none; /* Rimuoviamo l'animazione di movimento su mobile */
        }
}
/* ==========================================================================
   ROLES MANAGEMENT
   ========================================================================== */
.roles-management-container {
    padding: 20px;
}

.custom-listbox .k-listbox-item {
    border-bottom: 1px solid #f0f0f0;
}

    .custom-listbox .k-listbox-item:hover {
        background-color: #f5f5f5;
    }

    .custom-listbox .k-listbox-item.k-selected {
        background-color: #e3f2fd;
        border-color: #2196f3;
    }

/* ==========================================================================
   GESTIONE ACCESSI (pagina)
   ========================================================================== */
.accessi-container {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    background-color: #f8f9fc;
    border-radius: 1rem;
    box-shadow: 0 0 10px rgba(0,0,0,.08);
}

    .accessi-container h2 {
        margin-bottom: 1rem;
        font-size: 1.8rem;
        font-weight: 600;
        color: #2a2a2a;
    }

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (varie)
   ========================================================================== */
@media (max-width:1024px) {
    .btn-logout {
        font-size: .9rem;
        padding: 4px 10px;
    }
}

@media (max-width:768px) {
    .toolname {
        display: none;
    }

    .card-grid-wrapper {
        padding: 1rem;
    }

    .custom-card {
        padding: 1rem;
    }

    .sidebar-container {
        padding-left: .2rem;
        align-items: center;
    }

        .sidebar-container.expanded {
            width: 180px;
            padding-left: .5rem;
            align-items: flex-start;
        }

        .sidebar-container .nav-text {
            display: none;
        }

        .sidebar-container.expanded .nav-text {
            display: inline-block;
        }

    .report-filters {
        flex-direction: column;
        align-items: stretch;
    }

        .report-filters > div {
            width: 100%;
            justify-content: flex-start;
        }

        .report-filters .text-end {
            justify-content: flex-end;
        }

    .k-window {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%,-50%) !important;
        z-index: 10002 !important;
        max-height: 90vh !important;
        width: 95vw !important;
        margin: 0 !important;
    }

        .k-window .k-window-content {
            padding: 1rem !important;
            max-height: 70vh !important;
            overflow-y: auto !important;
        }

        .k-window .k-window-titlebar {
            padding: .75rem !important;
        }

        .k-window .k-window-title {
            font-size: 1rem !important;
        }

    .k-overlay {
        z-index: 9999 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
    }

    .page-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

        .page-header .k-button {
            width: 100%;
            max-width: 250px;
        }

    .scheduler-info {
        font-size: .875rem;
        text-align: center;
        margin-bottom: 15px;
        padding: .75rem;
    }

    .k-scheduler {
        font-size: .875rem;
    }

    .responsive-window {
        width: min(500px,95vw) !important;
    }

    .form-section {
        padding: 1rem;
    }

        .form-section label.form-label {
            font-size: .85rem;
        }

    .company-filter-btn {
        font-size: .75rem;
        padding: .3rem .6rem;
    }

    .form-section .k-button {
        font-size: .85rem;
        padding: .5rem 1rem;
    }

    .form-section .k-editor {
        height: 250px;
    }

    .sale-riunioni-form, .automezzi-wrapper .k-form {
        padding: 1rem;
        gap: 1.5rem;
    }

        .sale-riunioni-form .form-field, .automezzi-wrapper .k-form-field {
            gap: .75rem;
            margin-bottom: 1.5rem;
        }

        .sale-riunioni-form .form-label, .automezzi-wrapper .k-label, .automezzi-wrapper .k-form-label, .automezzi-wrapper label {
            font-size: 1rem;
            font-weight: 600;
        }

        .sale-riunioni-form .k-input, .sale-riunioni-form .k-picker, .sale-riunioni-form .k-dropdown, .sale-riunioni-form .k-datetimepicker,
        .automezzi-wrapper .k-input, .automezzi-wrapper .k-picker, .automezzi-wrapper .k-dropdown, .automezzi-wrapper .k-datetimepicker,
        .automezzi-wrapper .k-numerictextbox, .automezzi-wrapper .k-textbox {
            min-height: 48px;
            font-size: 16px;
        }

        .sale-riunioni-form .dialog-buttons, .automezzi-wrapper .dialog-buttons {
            flex-direction: column;
            align-items: stretch;
            gap: 1rem;
        }

            .sale-riunioni-form .dialog-buttons .k-button, .automezzi-wrapper .dialog-buttons .k-button {
                width: 100%;
                min-height: 48px;
                font-size: 16px;
            }

    .automezzi-wrapper .k-form-field .k-button {
        width: 100% !important;
        margin-right: 0;
        margin-bottom: .75rem;
    }

    .automezzi-wrapper input[type="file"] {
        min-height: 48px !important;
    }

    .automezzi-wrapper .validation-summary {
        font-size: .9rem;
        padding: 1rem;
    }

    .message-bubble {
        padding: .75rem;
        font-size: .9rem;
    }

    .message-title {
        font-size: .95rem;
    }

    .message-body {
        font-size: .85rem;
    }
}

@media (max-width:480px) {
    .login-container {
        padding: 4vh 4vw;
        min-height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        box-sizing: border-box;
    }

    .login-box {
        width: 92vw;
        padding: 1rem;
        border-radius: 1rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: clamp(.5rem,1.5vw,1rem);
        box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.06);
    }

    .login-title {
        font-size: clamp(1.2rem,2.5vw,1.4rem);
        margin-bottom: .5rem;
        align-self: flex-start;
        width: 100%;
        padding-left: .4rem;
    }

    .login-field {
        width: 80%;
        max-width: 100%;
        align-self: flex-end;
        margin-bottom: .5rem;
    }

        .login-field label {
            display: block;
            margin-bottom: .25rem;
            font-size: clamp(.8rem,2vw,.875rem);
        }

    .login-input {
        width: 100%;
        height: clamp(2rem,5vw,2.5rem);
        padding: 0 .75rem;
        font-size: clamp(.85rem,2vw,1rem);
        box-sizing: border-box;
        border-radius: .4rem;
    }

    .password-toggle-btn {
        width: clamp(2rem,5vw,2.5rem);
        height: clamp(2rem,5vw,2.5rem);
        padding: 0;
        border-radius: .4rem;
    }

    .login-button {
        align-self: flex-start;
        padding: .5rem 1.4rem;
        font-size: clamp(.9rem,2vw,1rem);
        border-radius: 999px;
        margin-top: .4rem;
        margin-left: .3rem;
    }

    .custom-card {
        padding: .8rem;
        min-height: 180px;
    }

    .card-icon-wrapper {
        width: 52px;
        height: 52px;
        font-size: 1.4rem;
    }

    .vai-btn {
        padding: .4rem 1rem;
        font-size: .8rem;
    }

    .sidebar-container {
        padding-left: .1rem;
        align-items: center;
    }

        .sidebar-container.expanded {
            width: 160px;
            padding-left: .4rem;
            align-items: flex-start;
        }

    .k-window {
        width: 98vw !important;
        max-height: 95vh !important;
        top: 2vh !important;
        left: 1vw !important;
        transform: none !important;
        margin: 0 !important;
        z-index: 10003 !important;
    }

    .k-overlay {
        z-index: 9997 !important;
    }

    .k-dialog-wrapper {
        z-index: 9998 !important;
    }

        .k-window, .k-dialog-wrapper .k-window {
            z-index: 10003 !important;
        }

    .sale-riunioni-wrapper, .automezzi-wrapper {
        padding: 2px;
    }

        .sale-riunioni-form, .automezzi-wrapper .k-form {
            padding: .75rem;
        }

            .sale-riunioni-form .k-input, .sale-riunioni-form .k-picker, .sale-riunioni-form .k-dropdown, .sale-riunioni-form .k-datetimepicker,
            .automezzi-wrapper .k-input, .automezzi-wrapper .k-picker, .automezzi-wrapper .k-dropdown, .automezzi-wrapper .k-datetimepicker,
            .automezzi-wrapper .k-numerictextbox, .automezzi-wrapper .k-textbox {
                min-height: 50px;
                font-size: 16px;
            }

    .k-popup, .k-animation-container {
        z-index: 10020 !important;
    }

    .event-mobile {
        font-size: .7rem !important;
        gap: 1px !important;
        padding: 1px 2px !important;
    }

    .event-time-mobile {
        font-size: .65rem !important;
    }

    .my-reservation-star {
        font-size: .75rem !important;
    }

    .custom-scheduler-fixed.k-scheduler-monthview .k-scheduler-table tr {
        min-height: 60px !important;
    }

    html {
        font-size: 11px;
    }

    .message-bubble {
        padding: .75rem;
        font-size: .9rem;
    }

    .message-title {
        font-size: .95rem;
    }

    .message-body {
        font-size: .85rem;
    }

    .form-section {
        padding: 1rem;
    }

        .form-section label.form-label {
            font-size: .85rem;
        }

    .company-filter-btn {
        font-size: .75rem;
        padding: .3rem .6rem;
    }

    .form-section .k-button {
        font-size: .85rem;
        padding: .5rem 1rem;
    }

    .form-section .k-editor {
        height: 250px;
    }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */
.vcenter {
    align-items: center;
}

.link-plain {
    text-decoration: none;
    color: inherit;
    cursor: default;
}

    .link-plain:hover, .link-plain:focus, .link-plain:active {
        text-decoration: none;
        color: inherit;
    }

.mt-5 {
    margin-top: 3rem;
}

.text-end {
    text-align: end;
}

/* ==========================================================================
   MOBILE TOUCH OPTIMIZATIONS
   ========================================================================== */
@media (hover:none) and (pointer:coarse) {
    .k-button, .nav-link, .custom-card, .message-actions .k-button {
        min-height: 44px;
        min-width: 44px;
    }

    input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select {
        font-size: 16px;
    }
}

/* ==========================================================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================================================== */
@media (prefers-reduced-motion:reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    .starGlow {
        animation: none;
    }
}

@media (prefers-contrast:high) {
    .k-event-template {
        border: 2px solid currentColor;
    }

    .message-bubble {
        border: 1px solid currentColor;
    }
}

/* ==========================================================================
   BROWSER SPECIFIC FIXES
   ========================================================================== */
@supports (-webkit-appearance:none) {
    .k-input, .k-textbox {
        -webkit-appearance: none;
    }
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */
.k-event-template, .custom-card, .nav-link {
    will-change: transform;
    transform: translateZ(0);
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ==========================================================================
   TELERIK OVERRIDES (generici)
   ========================================================================== */
.k-widget {
    box-sizing: border-box;
}

@media (max-width:768px) {
    .k-animation-container {
        max-width: 95vw !important;
        left: 2.5vw !important;
        right: 2.5vw !important;
    }
}

.k-scheduler-layout {
    overflow-x: auto;
}

.k-scheduler-table {
    min-width: 600px;
}

/* ==========================================================================
   CLASSI RESPONSIVE BOOTSTRAP-STYLE
   ========================================================================== */
.d-block {
    display: block !important;
}

.d-none {
    display: none !important;
}

@media (min-width:769px) {
    .d-md-block {
        display: block !important;
    }

    .d-md-none {
        display: none !important;
    }
}

@media (max-width:768px) {
    .d-md-block {
        display: none !important;
    }

    .d-md-none {
        display: block !important;
    }
}

/* ==========================================================================
   GESTIONE ACCESSI – componenti vari
   ========================================================================== */
.page-container {
    min-height: 100vh;
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
}

.form-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,.1);
    max-width: 400px;
    width: 100%;
}

    .form-card h2 {
        text-align: center;
        margin-bottom: 30px;
        color: #333;
        font-weight: 500;
        font-size: 24px;
    }

.form-group {
    margin-bottom: 20px;
}

    .form-group label {
        display: block;
        margin-bottom: 8px;
        color: #555;
        font-weight: 500;
        font-size: 14px;
    }

    .form-group small {
        display: block;
        margin-top: 5px;
        color: #999;
        font-size: 12px;
        font-style: italic;
    }

.checkbox-group {
    margin: 20px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-direction: column;
}

    .checkbox-group label {
        margin: 0;
        cursor: pointer;
        font-size: 14px;
    }

.button-container {
    text-align: center;
    margin-top: 30px;
}

.submit-button {
    background-color: #ff6b6b !important;
    border-color: #ff6b6b !important;
    color: #fff !important;
    border-radius: 25px !important;
    padding: 12px 40px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    text-transform: uppercase;
    letter-spacing: .5px;
}

    .submit-button:hover {
        background-color: #ff5252 !important;
        border-color: #ff5252 !important;
    }

.link-section {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.link-text {
    margin: 10px 0;
    color: #666;
    cursor: pointer;
    font-size: 14px;
}

.link-highlight {
    color: #ff6b6b;
    text-decoration: underline;
}

.link-text:hover .link-highlight {
    color: #ff5252;
}

.message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    z-index: 1000;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
/* Override Telerik inputs */
.k-textbox, .k-dropdown {
    width: 100% !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    padding: 12px !important;
    font-size: 16px !important;
}

    .k-textbox:focus, .k-dropdown:focus {
        border-color: #667eea !important;
        box-shadow: 0 0 0 2px rgba(102,126,234,.2) !important;
    }

    .k-dropdown .k-dropdown-wrap {
        border: none !important;
    }


/* WEEK/DAY – quando metto .event-fill sul contenitore, il template non deve coprire il colore */
.k-scheduler .k-event.event-fill {
    overflow: hidden;
}

    .k-scheduler .k-event.event-fill .k-scheduler-event-content,
    .k-scheduler .k-event.event-fill .k-event-body,
    .k-scheduler .k-event.event-fill .k-event-template {
        height: 100% !important; /* il contenuto riempie tutta la durata */
    }

    .k-scheduler .k-event.event-fill .k-event-template {
        background: transparent !important; /* elimina il grigio */
        box-shadow: none !important;
    }

/* === WEEK mobile: scroll orizzontale, ri-uso del TUO wrapper .scheduler-hscroll === */
:root {
    /* taratura: orari ~56px + 7 giorni ~92px (modifica a piacere) */
    --week-times-col: 56px;
    --week-day-col: 92px;
    --week-min-width: calc(var(--week-times-col) + 7 * var(--week-day-col));
}

@media (max-width:768px) {

    /* 0) NON tagliare a monte (alcune tue regole mettono overflow-x: hidden) */
    .main-body,
    .sale-riunioni-wrapper,
    .automezzi-wrapper {
        overflow-x: visible !important;
    }

    /* 1) Lo SCROLL orizzontale vive nel wrapper che hai già */
    .scheduler-hscroll {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
    }

        /* 2) Lo scheduler non deve nascondere lo scroll */
        .scheduler-hscroll .k-scheduler {
            overflow-x: visible !important;
        }

        /* 3) WEEK: stessa base minima per head e body, senza width fisse né table-layout: fixed */
        .scheduler-hscroll .k-scheduler-weekview .k-scheduler-head .k-scheduler-table,
        .scheduler-hscroll .k-scheduler-weekview .k-scheduler-content .k-scheduler-table {
            min-width: var(--week-min-width) !important;
            width: auto !important;
            table-layout: auto !important;
        }

        /* 4) Se in passato hai toccato i <col>, riportali ad auto */
        .scheduler-hscroll .k-scheduler-weekview col,
        .scheduler-hscroll .k-scheduler-weekview colgroup col {
            width: auto !important;
        }

        /* 5) Finiture tipografiche (non alterano i calcoli) */
        .scheduler-hscroll .k-scheduler-weekview .k-scheduler-columnheader,
        .scheduler-hscroll .k-scheduler-weekview .k-scheduler-cell {
            white-space: nowrap !important;
            text-align: center !important;
            font-size: 0.82rem !important;
        }
}


/* ==========================================================================
   SCHEDULER WEEK VIEW - SOLO ALLINEAMENTO HEADER
   ========================================================================== */

@media (max-width: 768px) {
    /* Assicurarsi che la pagina rimanga nel viewport */
    .sale-riunioni-wrapper,
    .automezzi-wrapper {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .scheduler-hscroll {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

        /* Week view: mantenere responsive ma sincronizzare header e contenuto */
        .scheduler-hscroll .k-scheduler-weekview .k-scheduler-layout {
            overflow-x: hidden !important;
            width: 100% !important;
        }

        /* Header e contenuto con stesse dimensioni */
        .scheduler-hscroll .k-scheduler-weekview .k-scheduler-head,
        .scheduler-hscroll .k-scheduler-weekview .k-scheduler-content {
            width: 100% !important;
        }

            /* Tabelle sincronizzate */
            .scheduler-hscroll .k-scheduler-weekview .k-scheduler-head .k-scheduler-table,
            .scheduler-hscroll .k-scheduler-weekview .k-scheduler-content .k-scheduler-table {
                width: 100% !important;
                table-layout: fixed !important;
                border-collapse: separate !important;
            }

        /* Colonne con proporzioni ottimizzate - riduciamo ulteriormente la colonna orari */
        .scheduler-hscroll .k-scheduler-weekview .k-scheduler-table colgroup col:first-child {
            width: 12% !important;
        }

        .scheduler-hscroll .k-scheduler-weekview .k-scheduler-table colgroup col:not(:first-child) {
            width: 12.57% !important; /* (100-12)/7 = 12.57% - ancora più spazio per ogni giorno */
        }

        /* Celle header allineate al contenuto */
        .scheduler-hscroll .k-scheduler-weekview .k-scheduler-times,
        .scheduler-hscroll .k-scheduler-weekview th.k-scheduler-columnheader:first-child {
            width: 12% !important;
            font-size: clamp(0.6rem, 1.6vw, 0.75rem) !important;
            padding: 0.15rem !important;
            text-align: center !important;
        }

        .scheduler-hscroll .k-scheduler-weekview th.k-scheduler-columnheader:not(:first-child) {
            width: 12.57% !important;
            text-align: center !important;
            font-size: clamp(0.65rem, 1.8vw, 0.8rem) !important;
            white-space: nowrap !important;
            padding: clamp(0.05rem, 0.3vw, 0.25rem) !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
        }

        /* Celle contenuto allineate all'header */
        .scheduler-hscroll .k-scheduler-weekview td.k-scheduler-cell:first-child {
            width: 12% !important;
            font-size: clamp(0.6rem, 1.6vw, 0.75rem) !important;
            text-align: center !important;
        }

        .scheduler-hscroll .k-scheduler-weekview td.k-scheduler-cell:not(:first-child):not(.k-scheduler-times) {
            width: 12.57% !important;
            text-align: center !important;
            font-size: clamp(0.65rem, 1.8vw, 0.8rem) !important;
            padding: clamp(0.05rem, 0.3vw, 0.25rem) !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
        }

        /* Day e Month view: mantengono la piena responsività */
        .scheduler-hscroll .k-scheduler-dayview .k-scheduler-layout,
        .scheduler-hscroll .k-scheduler-monthview .k-scheduler-layout {
            overflow-x: hidden !important;
            width: 100% !important;
        }

        .scheduler-hscroll .k-scheduler-dayview .k-scheduler-head,
        .scheduler-hscroll .k-scheduler-dayview .k-scheduler-content,
        .scheduler-hscroll .k-scheduler-monthview .k-scheduler-head,
        .scheduler-hscroll .k-scheduler-monthview .k-scheduler-content {
            width: 100% !important;
        }

        .scheduler-hscroll .k-scheduler-dayview .k-scheduler-table,
        .scheduler-hscroll .k-scheduler-monthview .k-scheduler-table {
            width: 100% !important;
            table-layout: fixed !important;
        }
}

/* === Week mobile: colonna orari più stretta (senza px), override inline === */
@media (max-width: 768px) {
    /* Larghezza desiderata della colonna orari:
     - minimo 5.5 caratteri (es. "00:00")
     - cresce un po' con la viewport (10vw)
     - massimo 8 caratteri
  */
    :root {
        --times-col: clamp(5.5ch, 10vw, 8ch);
    }

    /* 1) Header: il "side cell" ha inline min-width:72px -> lo sovrascriviamo */
    .scheduler-hscroll .k-scheduler-weekview .k-scheduler-head .k-scheduler-cell.k-side-cell {
        flex: 0 0 var(--times-col) !important;
        width: var(--times-col) !important;
        min-width: var(--times-col) !important; /* override dell'inline min-width */
        max-width: var(--times-col) !important;
    }

    /* 2) Body: la colonna dei tempi deve avere la stessa larghezza */
    .scheduler-hscroll .k-scheduler-weekview .k-scheduler-times {
        width: var(--times-col) !important;
        min-width: var(--times-col) !important;
        max-width: var(--times-col) !important;
    }

    /* 3) Colgroup della tabella: prima colonna = var(--times-col), il resto si divide */
    .scheduler-hscroll .k-scheduler-weekview .k-scheduler-table {
        table-layout: fixed !important; /* stabile in mobile */
        width: 100% !important;
    }

        .scheduler-hscroll .k-scheduler-weekview .k-scheduler-table colgroup col:first-child {
            width: var(--times-col) !important;
        }

        .scheduler-hscroll .k-scheduler-weekview .k-scheduler-table colgroup col:not(:first-child) {
            width: calc((100% - var(--times-col)) / 7) !important;
        }

    /* (opzionale) un filo di testo più compatto */
    .scheduler-hscroll .k-scheduler-weekview .k-scheduler-columnheader,
    .scheduler-hscroll .k-scheduler-weekview .k-scheduler-cell {
        white-space: nowrap !important;
        text-align: center !important;
        font-size: 0.82rem !important;
    }
}

/* === Week (mobile): colonna ORARI coerente in header e body, senza px fissi === */
@media (max-width: 768px) {
    /* Larghezza “elastica” della colonna orari: 5.5–8 caratteri, scala un po' con la viewport */
    :root {
        --times-col: clamp(5.5ch, 10vw, 8ch);
    }

    /* 1) SIDE-CELL: header + body (override dell'inline min-width:72px) */
    .scheduler-hscroll .k-scheduler-weekview .k-scheduler-head .k-scheduler-cell.k-side-cell,
    .scheduler-hscroll .k-scheduler-weekview .k-scheduler-body .k-scheduler-cell.k-side-cell {
        flex: 0 0 var(--times-col) !important;
        width: var(--times-col) !important;
        min-width: var(--times-col) !important;
        max-width: var(--times-col) !important;
    }

    /* 2) Se la tua build ha anche il blocco .k-scheduler-times (colonna tempi “fissa” a sinistra) */
    .scheduler-hscroll .k-scheduler-weekview .k-scheduler-times {
        width: var(--times-col) !important;
        min-width: var(--times-col) !important;
        max-width: var(--times-col) !important;
    }

    /* 3) Le altre celle (i 7 giorni) si dividono lo spazio restante in modo fluido */
    .scheduler-hscroll .k-scheduler-weekview .k-scheduler-row > .k-scheduler-cell:not(.k-side-cell) {
        flex: 1 1 0% !important;
        min-width: 0 !important; /* consente di stringere quando serve */
    }

    /* (facoltativo) micro-tipografia per non far andare a capo il testo */
    .scheduler-hscroll .k-scheduler-weekview .k-scheduler-columnheader,
    .scheduler-hscroll .k-scheduler-weekview .k-scheduler-cell {
        white-space: nowrap !important;
        text-align: center !important;
        font-size: 0.82rem !important;
    }
}

/* ==========================================================================
   FIX 1: FORM NUOVO MESSAGGIO - DIMENSIONI CONTENUTO RESPONSIVE
   ========================================================================== */

/* Finestra responsive che si adatta al contenuto */
.responsive-window {
    max-width: min(800px, 95vw) !important; /* Massimo 800px o 95% viewport */
    width: auto !important; /* Auto per adattarsi al contenuto */
    min-width: 300px !important; /* Minimo per evitare troppo stretto */
    height: auto !important;
    padding: 0;
    box-sizing: border-box;
}

/* Contenuto del form centrato e con larghezza ottimale */
.k-window-content {
    overflow-y: auto;
    max-height: 85vh;
    padding: 0 !important; /* Rimuoviamo padding qui per controllarlo nel form */
}

/* Form section con larghezza controllata */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 700px; /* Larghezza massima del contenuto */
    margin: 0 auto; /* Centrato orizzontalmente */
    padding: clamp(1rem, 2vw, 2rem);
    background-color: #fdfdfd;
    border-radius: .5rem;
    box-shadow: 0 .1rem .4rem rgba(0,0,0,.05);
    box-sizing: border-box;
}

    /* Assicuriamo che gli elementi del form non si allunghino troppo */
    .form-section .k-textbox,
    .form-section .k-multiselect,
    .form-section .k-editor,
    .form-section .k-upload {
        width: 100%;
        max-width: none; /* Rimuoviamo eventuali max-width che limitano */
        box-sizing: border-box;
    }

    /* Editor con altezza ottimizzata */
    .form-section .k-editor {
        min-height: 200px;
        height: clamp(200px, 30vh, 300px);
    }

/* ==========================================================================
   FIX 2: MOBILE - DIMENSIONI RIDOTTE FILTRI E AZIONI
   ========================================================================== */

@media (max-width: 768px) {

    /* Filtri più compatti */
    .k-grid .k-filtercell .k-textbox,
    .k-grid .k-filtercell .k-input {
        height: 32px !important;
        min-height: 32px !important;
        font-size: 0.8rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    /* Bottoni filtro più piccoli */
    .k-grid .k-filtercell .k-button {
        height: 28px !important;
        min-height: 28px !important;
        width: 28px !important;
        min-width: 28px !important;
        padding: 0.2rem !important;
        font-size: 0.7rem !important;
    }

    /* Azioni nella griglia più compatte */
    .message-actions {
        gap: 0.25rem !important;
        padding: 0.25rem !important;
    }

        .message-actions .k-button {
            height: 28px !important;
            min-height: 28px !important;
            width: 28px !important;
            min-width: 28px !important;
            padding: 0.2rem !important;
            font-size: 0.7rem !important;
            border-radius: 0.25rem !important;
        }

    /* Header delle colonne più compatto */
    .k-grid .k-header {
        height: 35px !important;
        min-height: 35px !important;
        font-size: 0.8rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    /* Celle della griglia più compatte */
    .k-grid td {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.8rem !important;
    }

    /* Avatar più piccoli su mobile */
    .avatar-circle {
        --avatar-size: clamp(2rem, 4vw, 2.5rem) !important;
    }

    /* Titoli messaggi più compatti */
    .message-title {
        font-size: 0.85rem !important;
        line-height: 1.2 !important;
    }

    .message-body {
        font-size: 0.75rem !important;
        margin-left: 0.5rem !important;
    }

    .message-date {
        font-size: 0.7rem !important;
    }

    /* Riduciamo anche la paginazione */
    .k-grid .k-pager {
        height: 35px !important;
        min-height: 35px !important;
    }

        .k-grid .k-pager .k-button {
            height: 28px !important;
            min-height: 28px !important;
            font-size: 0.75rem !important;
        }
}

/* ==========================================================================
   FIX EXTRA: MIGLIORAMENTI GENERALI BACHECA
   ========================================================================== */

/* Bacheca container ottimizzata */
.bacheca-wrapper {
    width: 100%;
    max-width: 1200px; /* Limitiamo la larghezza massima */
    margin: 0 auto; /* Centrato */
    padding: .5rem;
    box-sizing: border-box;
}

/* Griglia con scroll orizzontale su mobile se necessario */
@media (max-width: 768px) {
    .bacheca-wrapper {
        padding: 0.25rem;
    }

    .k-grid {
        overflow-x: auto;
        min-width: 100%;
    }

        /* Assicuriamo che la griglia non vada fuori schermo */
        .k-grid .k-grid-content {
            overflow-x: auto;
        }
}

/* SOLUZIONE 3: FALLBACK - NASCONDI TOOLBAR E USA CONTROLLI ESTERNI */
@media (max-width: 412px) {
    /* Se tutto il resto fallisce, nascondi il toolbar problematico */
    .scheduler-problematic .k-scheduler-header,
    .scheduler-problematic .k-scheduler-toolbar {
        display: none !important;
    }
    /* Aggiungi controlli personalizzati sopra lo scheduler */
    .scheduler-problematic::before {
        content: '';
        display: block;
        height: 50px;
        background: #f8f9fa;
        border-bottom: 1px solid #dee2e6;
    }

    /* ==========================================================================
       RIDUZIONE FONT PER WEEK VIEW SU SCHERMI PICCOLI
       ========================================================================== */

    /* Week view - font più piccoli per far entrare tutto */
    .scheduler-problematic .k-scheduler-weekview .k-scheduler-columnheader,
    .scheduler-problematic .k-scheduler-weekview .k-scheduler-cell {
        font-size: 0.7rem !important;
        padding: 0.15rem 0.1rem !important;
    }

    /* Eventi nella week view più compatti */
    .scheduler-problematic .k-scheduler-weekview .k-event {
        font-size: 0.65rem !important;
        line-height: 1.1 !important;
    }

    .scheduler-problematic .k-scheduler-weekview .k-event-template {
        padding: 2px !important;
        font-size: 0.65rem !important;
    }

    /* Testo specifico degli eventi */
    .scheduler-problematic .k-scheduler-weekview .event-mobile,
    .scheduler-problematic .k-scheduler-weekview .event-desktop {
        font-size: 0.6rem !important;
    }

    .scheduler-problematic .k-scheduler-weekview .event-title-mobile,
    .scheduler-problematic .k-scheduler-weekview .event-title,
    .scheduler-problematic .k-scheduler-weekview .event-time {
        font-size: 0.6rem !important;
        font-weight: 500 !important;
    }
}

/* OVERRIDE MEDIA QUERIES TELERIK CHE CAUSANO IL PROBLEMA */
@media screen and (max-width: 480px) {
    .k-scheduler .k-scheduler-toolbar .k-scheduler-navigation {
        display: none !important;
    }

    .k-scheduler .k-scheduler-toolbar .k-scheduler-views {
        display: block !important;
    }
}

/* Disabilita completamente le transizioni responsive su mobile */
@media (max-width: 412px) {
    * {
        transition-duration: 0s !important;
        animation-duration: 0s !important;
    }
}

/* ==========================================================================
   CLASSE HELPER PER ATTIVARE LA MODALITÀ STABILE
   ========================================================================== */
/* Aggiungi questa classe al tuo scheduler per forzare la stabilità */
.scheduler-stable {
    .k-scheduler-toolbar, .k-toolbar

{
    position: relative !important;
    overflow: visible !important;
}

.k-scheduler-views {
    position: static !important;
}

.k-popup {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
}

}

@media (max-width: 412px) {
    .scheduler-stable .k-scheduler-toolbar {
        height: 50px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .scheduler-stable .k-menu-group {
        display: flex !important;
        align-items: center !important;
        gap: 1rem !important;
    }

    /* Font ancora più piccoli per schermi extra piccoli */
    .scheduler-stable .k-scheduler-weekview .k-scheduler-columnheader,
    .scheduler-stable .k-scheduler-weekview .k-scheduler-cell {
        font-size: 0.65rem !important;
    }

    .scheduler-stable .k-scheduler-weekview .k-event,
    .scheduler-stable .k-scheduler-weekview .event-title {
        font-size: 0.55rem !important;
    }
}

/* Per schermi ancora più piccoli */
@media (max-width: 360px) {
    .scheduler-problematic .k-scheduler-weekview .k-scheduler-columnheader,
    .scheduler-problematic .k-scheduler-weekview .k-scheduler-cell {
        font-size: 0.6rem !important;
        padding: 0.1rem 0.05rem !important;
    }

    .scheduler-problematic .k-scheduler-weekview .k-event,
    .scheduler-problematic .k-scheduler-weekview .event-title {
        font-size: 0.5rem !important;
    }
}

/* ==========================================================================
   LOGIN PAGE - FIX TESTO TAGLIATO
   ========================================================================== */

/* Login box small - dimensioni corrette */
.login-box-small {
    max-width: 400px !important; /* Aumentato da 340px */
    min-width: 320px !important; /* Larghezza minima */
    padding: 2rem 1.5rem !important; /* Padding più generoso */
}

/* Login field - layout migliorato */
.login-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 1.5rem !important; /* Aumentato margin */
    width: 100% !important; /* Larghezza piena invece del 60% */
    align-self: stretch !important; /* Occupa tutta la larghezza */
}

    .login-field label {
        font-weight: 600;
        color: #444;
        margin-bottom: 0.5rem !important; /* Più spazio sotto la label */
        font-size: 0.9rem !important;
        white-space: nowrap; /* Impedisce il wrap delle label */
        width: 100%; /* Larghezza piena per le label */
    }

/* Input styling migliorato */
.login-input-small {
    font-size: 0.9rem !important;
    padding: 0.6rem 0.8rem !important; /* Più padding */
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 44px !important; /* Altezza minima per touch */
}

/* Flex container per password con bottone */
.login-field div[style*="display: flex"] {
    width: 100% !important;
    gap: 0.5rem !important;
    align-items: center !important;
}

    .login-field div[style*="display: flex"] .login-input-small {
        flex: 1 !important; /* Occupa lo spazio rimanente */
    }

/* Password toggle button */
.password-toggle-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    flex-shrink: 0 !important; /* Non si riduce */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border-radius: 6px !important;
}

/* Login title - posizionamento corretto */
.login-title {
    font-size: 1.8rem !important; /* Leggermente più piccolo */
    color: #001b4d;
    margin-bottom: 1.5rem !important;
    font-weight: bold;
    text-align: center !important; /* Centrato per layout più pulito */
    align-self: center !important;
    width: 100% !important;
    margin-left: 0 !important;
}

/* Login button - centrato */
.login-button {
    margin-top: 1.5rem;
    background-color: #ff6b6b;
    color: #fff;
    font-weight: bold;
    border-radius: 20px;
    padding: 0.8rem 2rem !important;
    width: auto;
    letter-spacing: 0.05rem;
    align-self: center !important; /* Centrato */
    margin-left: 0 !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
}

/* Login error - centrato */
.login-error {
    color: red;
    font-weight: bold;
    margin-top: 1rem;
    align-self: center;
    text-align: center;
    width: 100%;
}

/* ==========================================================================
   RESPONSIVE MOBILE - LOGIN
   ========================================================================== */

@media (max-width: 480px) {
    .login-wrapper {
        padding: 1rem !important;
    }

    .login-box-small {
        max-width: 95vw !important;
        min-width: 280px !important;
        padding: 1.5rem 1rem !important;
        margin: 0 auto !important;
    }

    .login-title {
        font-size: 1.5rem !important;
        margin-bottom: 1rem !important;
    }

    .login-field {
        margin-bottom: 1rem !important;
    }

        .login-field label {
            font-size: 0.85rem !important;
            margin-bottom: 0.4rem !important;
        }

    .login-input-small {
        font-size: 16px !important; /* Evita zoom su iOS */
        padding: 0.75rem !important;
        min-height: 48px !important; /* Più alto su mobile */
    }

    .password-toggle-btn {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
    }

    .login-button {
        width: 100% !important;
        padding: 1rem 2rem !important;
        min-height: 48px !important;
        font-size: 1rem !important;
    }
}

/* ==========================================================================
   EXTRA SMALL SCREENS
   ========================================================================== */

@media (max-width: 360px) {
    .login-box-small {
        padding: 1rem 0.75rem !important;
    }

    .login-title {
        font-size: 1.3rem !important;
    }

    .login-field label {
        font-size: 0.8rem !important;
    }

    .login-input-small {
        padding: 0.6rem !important;
    }
}

/* ==========================================================================
   ACCESSIBILITÀ E TOUCH FRIENDLY
   ========================================================================== */

/* Miglioramenti per accessibilità */
.login-field label {
    cursor: pointer; /* Indica che la label è clickabile */
}

/* Focus states migliorati */
.login-input-small:focus {
    outline: 2px solid #667eea !important;
    outline-offset: 2px !important;
    border-color: #667eea !important;
}

.password-toggle-btn:focus {
    outline: 2px solid #667eea !important;
    outline-offset: 2px !important;
}

.login-button:focus {
    outline: 2px solid #ff5252 !important;
    outline-offset: 2px !important;
}

/* Touch friendly per dispositivi mobili */
@media (hover: none) and (pointer: coarse) {
    .login-input-small,
    .password-toggle-btn,
    .login-button {
        min-height: 44px !important;
        min-width: 44px !important;
    }
}

/* ==========================================================================
   AUTOMEZZI - INTEGRAZIONI SPECIFICHE (senza duplicati)
   ========================================================================== */

/* Fix SOLO per il testo placeholder del dropdown */
.k-dropdown .k-dropdown-wrap .k-input {
    color: #495057 !important; /* Testo normale quando selezionato */
}

    /* Quando è vuoto/placeholder */
    .k-dropdown .k-dropdown-wrap .k-input:placeholder-shown {
        color: #6c757d !important; /* Grigio per placeholder */
    }

/* FIX SPECIFICO: Rimuovi il background colorato dalle voci del dropdown */
.k-list-container .k-list-item.k-selected {
    background-color: transparent !important;
    color: inherit !important;
}

/* Solo quando effettivamente selezionata (hover o click) */
.k-list-container .k-list-item:hover {
    background-color: #f8f9fa !important;
}

.k-list-container .k-list-item.k-state-selected {
    background-color: #007bff !important;
    color: #fff !important;
}

/* Griglia eventi automezzi (integrazione con il sistema esistente) */
.events-grid-container {
    margin-bottom: 15px;
}

.events-grid .k-grid-header {
    background-color: #f8f9fa;
    font-weight: 600;
}

.events-grid .k-grid-content {
    max-height: 300px;
    overflow-y: auto;
}

/* Form nuovo evento - integrazione con stili esistenti */
.new-event-form h4 {
    color: #495057;
    margin-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
}

/* Layout form eventi (usa le classi esistenti ma estende) */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: end;
}

.form-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-col-full {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Bottoni sezione eventi - usa la palette esistente ma differenzia */
.event-dialog-buttons .k-button {
    background-color: #fff !important;
    border: 2px solid #28a745 !important; /* Verde per conferma */
    color: #28a745 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.75rem 1.5rem !important;
    transition: all 0.2s ease !important;
}

    .event-dialog-buttons .k-button:hover {
        background-color: #28a745 !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 2px 4px rgba(40,167,69,.2) !important;
    }

    .event-dialog-buttons .k-button[onclick*="Cancel"] {
        border-color: #6c757d !important;
        color: #6c757d !important;
    }

        .event-dialog-buttons .k-button[onclick*="Cancel"]:hover {
            background-color: #6c757d !important;
            color: #fff !important;
            box-shadow: 0 2px 4px rgba(108,117,125,.2) !important;
        }

/* Bottone "Aggiungi Evento" - integrazione con sistema esistente */
.add-event-btn.k-button-primary {
    background-color: #fff !important;
    border: 2px dashed var(--primary-color) !important;
    color: var(--primary-color) !important;
    border-radius: 6px !important;
    padding: 1rem !important;
    transition: all 0.2s ease !important;
    font-weight: 500 !important;
    width: 100% !important;
    margin-top: 1rem !important;
}

    .add-event-btn.k-button-primary:hover {
        background-color: var(--primary-color) !important;
        color: #fff !important;
        border-style: solid !important;
        transform: translateY(-1px) !important;
    }

/* Responsive per eventi - integrazione */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }

    .event-dialog-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

        .event-dialog-buttons .k-button {
            width: 100% !important;
            padding: 1rem !important;
        }

            /* Override transform su mobile per coerenza con sistema esistente */
            .event-dialog-buttons .k-button:hover,
            .add-event-btn.k-button-primary:hover {
                transform: none !important;
            }
}

/* ==========================================================================
   AUTOMEZZI - SEZIONE EVENTI SOLO PER PRENOTAZIONI ESISTENTI
   ========================================================================== */

/* Placeholder per sezioni nascoste (mantiene layout stabile) */
.events-section-placeholder {
    min-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

    .events-section-placeholder.visible {
        opacity: 1;
        pointer-events: auto;
    }

/* ==========================================================================
   FIX DROPDOWN STATES - SPECIFICO PER AUTOMEZZI
   ========================================================================== */

/* Automezzi - fix specifico per tutti i dropdown */
.automezzi-wrapper .k-dropdown .k-dropdown-wrap {
    background-color: #fff !important;
    border: 1px solid #ced4da !important;
}

    .automezzi-wrapper .k-dropdown .k-dropdown-wrap .k-input {
        background-color: transparent !important;
        color: #6c757d !important;
    }

        .automezzi-wrapper .k-dropdown .k-dropdown-wrap .k-input:not(:placeholder-shown):not([value=""]) {
            color: #495057 !important;
            font-weight: 500 !important;
        }

.k-invalid {
    border-color: #dc3545 !important;
}

.form-label span {
    font-weight: bold;
}

/* CSS corretto per nascondere i pulsanti X nei ListBox */

/* Nascondi il contenitore delle azioni (pulsanti X) */
.custom-listbox .k-listbox-actions {
    display: none !important;
}

    /* Alternativa: se vuoi nascondere solo i pulsanti specifici */
    .custom-listbox .k-listbox-actions .k-button {
        display: none !important;
    }

/* Oppure per nascondere tutta la toolbar se presente */
.custom-listbox .k-listbox-toolbar {
    display: none !important;
}

.admin-container {
        padding: 20px;
        max-width: 1400px;
        margin: 0 auto;
    }

    .admin-tabs {
        margin-top: 20px;
    }

    .tab-content {
        padding: 20px;
        min-height: 600px;
    }

    /* Import Section */
    .import-section {
        background: #f8f9fa;
        padding: 20px;
        border-radius: 8px;
        margin-bottom: 20px;
    }

    .upload-area {
        border: 2px dashed #dee2e6;
        padding: 30px;
        text-align: center;
        border-radius: 8px;
        margin: 20px 0;
        background: white;
    }

    .upload-info {
        margin-top: 15px;
        color: #6c757d;
        font-size: 14px;
    }

    .template-section {
        background: white;
        padding: 15px;
        border-radius: 6px;
        margin: 20px 0;
    }

    .preview-section {
        background: white;
        padding: 20px;
        border-radius: 8px;
        margin-top: 20px;
    }

    .preview-grid {
        margin: 15px 0;
    }

    .import-actions {
        display: flex;
        gap: 10px;
        margin-top: 15px;
    }

    .status-valid {
        color: #28a745;
        font-weight: bold;
    }

    .status-error {
        color: #dc3545;
        font-weight: bold;
    }

    /* Export Section */
    .export-section {
        background: #f8f9fa;
        padding: 20px;
        border-radius: 8px;
    }

    .export-filters {
        background: white;
        padding: 20px;
        border-radius: 8px;
        margin-bottom: 20px;
    }

    .filter-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
        align-items: end;
    }

    .filter-group {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

        .filter-group label {
            font-weight: 600;
            color: #495057;
        }

    .export-actions {
        display: flex;
        gap: 15px;
        margin: 20px 0;
        justify-content: center;
    }

    .email-section {
        background: white;
        padding: 20px;
        border-radius: 8px;
        margin-top: 20px;
    }

    .email-form {
        display: grid;
        gap: 15px;
        max-width: 500px;
    }

    /* Visitors Management */
    .visitors-management {
        background: #f8f9fa;
        padding: 20px;
        border-radius: 8px;
    }

    .grid-filters {
        display: flex;
        gap: 15px;
        margin-bottom: 20px;
        align-items: end;
    }

    .search-input {
        flex: 1;
        max-width: 400px;
    }

    .visitors-grid {
        background: white;
        border-radius: 8px;
        overflow: hidden;
    }

    .privacy-accepted {
        color: #28a745;
        font-size: 12px;
    }

    .privacy-missing {
        color: #dc3545;
        font-size: 12px;
    }

    /* Statistics */
    .statistics-section {
        background: #f8f9fa;
        padding: 20px;
        border-radius: 8px;
    }

    .stats-cards {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
        margin-bottom: 30px;
    }

    .stat-card {
        background: white;
        padding: 25px;
        border-radius: 8px;
        text-align: center;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .stat-number {
        font-size: 2.5rem;
        font-weight: bold;
        color: #007bff;
        margin-bottom: 10px;
    }

    .stat-label {
        color: #6c757d;
        font-weight: 500;
    }

    .charts-section {
        background: white;
        padding: 20px;
        border-radius: 8px;
    }

    .chart-container {
        margin-bottom: 30px;
    }

    /* Responsive */
    @media (max-width: 768px) {
        .admin-container

    {
        padding: 10px;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .export-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    }

/* Fix mirato solo per i pulsanti del form bacheca */
.form-section .action-buttons-row .k-button {
    font-size: 0.9rem;
    min-height: 2.5rem;
    padding: 0.5rem 1rem;
    flex: 1 1 48%;
}

/* Mobile */
@media (max-width: 768px) {
    .form-section .action-buttons-row .k-button {
        font-size: 16px; /* evita zoom iOS */
        min-height: 3rem;
    }
}

/* ==========================================================================
   FIX BACHECA MOBILE - ALTEZZA CORRETTA E PULSANTI PROPORZIONATI
   ========================================================================== */

/* Mobile: finestra adattata e pulsanti più piccoli */
@media (max-width: 768px) {
    /* Finestra con altezza massima controllata */
    .responsive-window {
        width: min(500px, 95vw) !important;
        max-width: 95vw !important;
        max-height: 90vh !important;
        height: auto !important;
    }

    /* Contenuto finestra con scroll se necessario */
    .k-window-content {
        max-height: 80vh !important;
        overflow-y: auto !important;
        padding: 0 !important;
    }

    /* Form più compatto */
    .form-section {
        padding: 0.75rem !important;
        gap: 0.5rem !important;
    }

        /* Label compatte */
        .form-section label.form-label {
            font-size: 0.85rem !important;
            margin-bottom: 0.25rem !important;
            font-weight: 600 !important;
        }

        /* Input titolo normale */
        .form-section .k-textbox {
            font-size: 16px !important;
            padding: 0.5rem !important;
            min-height: 40px !important;
        }

        /* Editor più compatto ma funzionale */
        .form-section .k-editor {
            min-height: 200px !important;
            height: 200px !important;
        }

            /* Toolbar editor compatto */
            .form-section .k-editor .k-toolbar {
                padding: 0.25rem !important;
            }

            .form-section .k-editor .k-button {
                font-size: 0.75rem !important;
                padding: 0.25rem !important;
                min-height: 28px !important;
                min-width: 28px !important;
            }

        /* MultiSelect compatto */
        .form-section .k-multiselect {
            font-size: 16px !important;
            min-height: 40px !important;
            padding: 0.375rem !important;
        }

        /* Upload più piccolo */
        .form-section .k-upload .k-button {
            font-size: 0.75rem !important;
            padding: 0.375rem 0.5rem !important;
            min-height: 32px !important;
        }

    /* Bottoni filtro azienda compatti */
    .company-filter-btn {
        font-size: 0.7rem !important;
        padding: 0.375rem 0.5rem !important;
        min-height: 32px !important;
    }

    /* File label compatto */
    .file-label {
        font-size: 0.75rem !important;
        margin-top: 0.25rem !important;
    }

        .file-label .k-button {
            font-size: 0.65rem !important;
            padding: 0.25rem 0.375rem !important;
            min-height: 26px !important;
        }
}

/* PULSANTI AZIONE - Uniformi ma non eccessivi */
.form-section .action-buttons-row {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    margin-top: 0.75rem;
}

    .form-section .action-buttons-row > div {
        flex: 1 1 48%;
    }

    /* Pulsanti identici ma dimensioni ragionevoli */
    .form-section .action-buttons-row .k-button {
        width: 100% !important;
        font-size: 0.85rem !important;
        font-weight: 500 !important;
        padding: 0.5rem 0.75rem !important;
        min-height: 36px !important;
        border-radius: 6px !important;
        border-width: 2px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

/* Mobile: pulsanti ancora più compatti */
@media (max-width: 768px) {
    .form-section .action-buttons-row {
        margin-top: 0.5rem;
        gap: 0.375rem;
    }

        .form-section .action-buttons-row .k-button {
            font-size: 0.8rem !important;
            padding: 0.5rem !important;
            min-height: 34px !important;
        }
}

/* Extra small: layout ottimizzato */
@media (max-width: 480px) {
    .responsive-window {
        width: 98vw !important;
        max-height: 95vh !important;
        top: 2.5vh !important;
        left: 1vw !important;
    }

    .form-section {
        padding: 0.5rem !important;
        gap: 0.375rem !important;
    }

        .form-section .action-buttons-row .k-button {
            font-size: 0.75rem !important;
            padding: 0.375rem !important;
            min-height: 32px !important;
        }

        /* Editor ancora più piccolo se necessario */
        .form-section .k-editor {
            height: 160px !important;
            min-height: 160px !important;
        }
}

/* ==========================================================================
   ADMIN GESTIONE VISITATORI - SOLUZIONE SEMPLICE E DIRETTA
   ========================================================================== */

/* FILTRI - Layout 50/50 semplice */
.admin-gestione-visitatori-page .grid-filters {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 15px !important;
    margin-bottom: 20px !important;
    align-items: center !important;
}

/* HEADER GRIGLIA - Testo nero invece di bianco */
.admin-gestione-visitatori-page .visitors-grid .k-grid-header .k-header {
    color: #333333 !important;
    background: #f8f9fa !important;
    font-weight: 600 !important;
    text-shadow: none !important;
}

/* BARRA BLU - Rimozione definitiva */
.admin-gestione-visitatori-page .visitors-grid {
    overflow: hidden !important;
}

    .admin-gestione-visitatori-page .visitors-grid .k-grid-content {
        overflow-x: auto !important;
        overflow-y: auto !important;
    }

        .admin-gestione-visitatori-page .visitors-grid .k-grid-content::-webkit-scrollbar-track-piece:end {
            background: transparent !important;
        }

        .admin-gestione-visitatori-page .visitors-grid .k-grid-content::-webkit-scrollbar-track-piece:start {
            background: transparent !important;
        }

        .admin-gestione-visitatori-page .visitors-grid .k-grid-content::-webkit-scrollbar-thumb {
            background: #ccc !important;
            border-radius: 4px !important;
        }

        .admin-gestione-visitatori-page .visitors-grid .k-grid-content::-webkit-scrollbar {
            width: 8px !important;
            height: 8px !important;
        }

/* BOTTONI COMANDO - Con classi personalizzate */
.admin-gestione-visitatori-page .btn-edit-custom,
.admin-gestione-visitatori-page .btn-delete-custom,
.admin-gestione-visitatori-page .btn-logout-custom {
    background-color: #fff !important;
    border: 2px solid #6c757d !important;
    color: #6c757d !important;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    padding: 0.375rem 0.75rem !important;
    margin: 2px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    min-height: 32px !important;
    min-width: 32px !important;
}

.admin-gestione-visitatori-page .btn-edit-custom {
    border-color: #ff9800 !important;
    color: #e65100 !important;
}

    .admin-gestione-visitatori-page .btn-edit-custom:hover {
        background-color: #ff9800 !important;
        color: white !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 2px 4px rgba(255,152,0,0.3) !important;
    }

.admin-gestione-visitatori-page .btn-delete-custom {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

    .admin-gestione-visitatori-page .btn-delete-custom:hover {
        background-color: #dc3545 !important;
        color: white !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 2px 4px rgba(220,53,69,0.3) !important;
    }

.admin-gestione-visitatori-page .btn-logout-custom {
    border-color: #28a745 !important;
    color: #28a745 !important;
}

    .admin-gestione-visitatori-page .btn-logout-custom:hover {
        background-color: #28a745 !important;
        color: white !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 2px 4px rgba(40,167,69,0.3) !important;
    }

/* STILI CELLE PERSONALIZZATE - Ripristinati */
.admin-gestione-visitatori-page .azienda-visita {
    font-weight: 600 !important;
    color: #003366 !important;
    background: rgba(0, 51, 102, 0.1) !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    display: inline-block !important;
    text-align: center !important;
}

.admin-gestione-visitatori-page .azienda-ospite {
    font-weight: 500 !important;
    color: #6c757d !important;
    background: #f8f9fa !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    display: inline-block !important;
    text-align: center !important;
}

.admin-gestione-visitatori-page .ingresso-time {
    font-family: 'Courier New', monospace !important;
    font-weight: 600 !important;
    color: #495057 !important;
    background: #f8f9fa !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    border-left: 3px solid #003366 !important;
}

/* Mobile */
@media (max-width: 768px) {
    .admin-gestione-visitatori-page .grid-filters {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .admin-gestione-visitatori-page .btn-edit-custom,
    .admin-gestione-visitatori-page .btn-delete-custom,
    .admin-gestione-visitatori-page .btn-logout-custom {
        font-size: 0.65rem !important;
        padding: 0.25rem 0.5rem !important;
        margin: 1px !important;
        min-height: 28px !important;
        min-width: 28px !important;
    }

        .admin-gestione-visitatori-page .btn-edit-custom:hover,
        .admin-gestione-visitatori-page .btn-delete-custom:hover,
        .admin-gestione-visitatori-page .btn-logout-custom:hover {
            transform: none !important;
        }
}
/* Stili per la scheda Statistiche - da aggiungere al CSS esistente */

.statistics-section {
    padding: 20px;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Cambiato da 4 a 3 colonne */
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    color: #2c3e50;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid #3498db;
}

    .stat-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: #3498db;
}

.stat-label {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
}

.stat-description {
    font-size: 0.8rem;
    opacity: 0.7;
    font-style: italic;
    color: #7f8c8d;
}

.charts-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
}

.chart-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

    .chart-container h4 {
        color: #2c3e50;
        margin-bottom: 10px;
        border-bottom: 3px solid #3498db;
        padding-bottom: 10px;
    }

.chart-description {
    color: #7f8c8d;
    margin-bottom: 20px;
    font-style: italic;
}

.stats-table {
    margin-top: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

    .stats-table h5 {
        color: #2c3e50;
        margin-bottom: 15px;
        font-weight: 600;
    }

    .stats-table .table {
        margin-bottom: 0;
        background: white;
        border-radius: 6px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

        .stats-table .table thead {
            background: #34495e;
            color: white;
        }

        .stats-table .table tbody tr:nth-child(even) {
            background: #f8f9fa;
        }

.no-data-message {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #bdc3c7;
}

.additional-stats {
    margin-top: 25px;
}

    .additional-stats h4 {
        color: #2c3e50;
        margin-bottom: 15px;
    }

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.info-card {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    font-weight: 600;
    color: #2c3e50;
}

.info-value {
    font-weight: bold;
    color: #3498db;
    font-size: 1.1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-number {
        font-size: 2rem;
    }
}

/* Email section - centrata e più larga */
.email-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px auto; /* Centra la sezione */
    max-width: 800px; /* Aumenta la larghezza massima */
    width: 100%; /* Occupa tutto lo spazio disponibile */
}

.email-form {
    display: grid;
    gap: 15px;
    max-width: 100%; /* Rimuove la limitazione a 500px */
    width: 100%;
}

.email-input,
.email-textarea {
    width: 100% !important;
    box-sizing: border-box !important;
}

.email-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Responsive per mobile */
@media (max-width: 768px) {
    .email-section {
        margin: 15px 10px;
        padding: 15px;
        max-width: none;
    }
}

/* ==========================================================================
   ADMIN PIATTI - PULSANTI FLAT STYLE
   ========================================================================== */

/* Pulsante Nuovo Piatto - verde */
.admin-piatti-page .page-header > button:last-child,
.admin-piatti-page button[icon="FontIcon.Plus"] {
    background-color: #fff !important;
    border: 2px solid #28a745 !important;
    color: #28a745 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(40,167,69,0.1) !important;
}

    .admin-piatti-page .page-header > button:last-child:hover {
        background-color: #28a745 !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
    }

/* Pulsante Indietro - blu */
.admin-piatti-page .page-header > button:first-child,
.admin-piatti-page button[icon="FontIcon.ArrowLeft"] {
    background-color: #fff !important;
    border: 2px solid #003366 !important;
    color: #003366 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,51,102,0.1) !important;
}

    .admin-piatti-page .page-header > button:first-child:hover {
        background-color: #003366 !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
    }

/* Pulsanti Modifica nella griglia - arancione */
.admin-piatti-page .k-grid button[title="Modifica"],
.admin-piatti-page .k-grid button:has(span[icon="FontIcon.Pencil"]) {
    background-color: #fff !important;
    border: 2px solid #ff9800 !important;
    color: #e65100 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.375rem 0.75rem !important;
    min-height: 32px !important;
    transition: all 0.2s ease !important;
}

    .admin-piatti-page .k-grid button[title="Modifica"]:hover {
        background-color: #ff9800 !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
    }

/* Pulsanti Elimina nella griglia - rosso */
.admin-piatti-page .k-grid button[title="Elimina"],
.admin-piatti-page .k-grid button:has(span[icon="FontIcon.Trash"]) {
    background-color: #fff !important;
    border: 2px solid #dc3545 !important;
    color: #dc3545 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.375rem 0.75rem !important;
    min-height: 32px !important;
    transition: all 0.2s ease !important;
}

    .admin-piatti-page .k-grid button[title="Elimina"]:hover {
        background-color: #dc3545 !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
    }

/* Pulsanti Update/Cancel in modalità inline - AGGIUNGI QUESTI */
.admin-piatti-page .k-grid button[title="Update"],
.admin-piatti-page .k-grid button[title="Aggiorna"] {
    background-color: #fff !important;
    border: 2px solid #007bff !important;
    color: #007bff !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.375rem 0.75rem !important;
    min-height: 32px !important;
}

    .admin-piatti-page .k-grid button[title="Update"]:hover,
    .admin-piatti-page .k-grid button[title="Aggiorna"]:hover {
        background-color: #007bff !important;
        color: #fff !important;
    }

.admin-piatti-page .k-grid button[title="Cancel"],
.admin-piatti-page .k-grid button[title="Annulla"] {
    background-color: #fff !important;
    border: 2px solid #6c757d !important;
    color: #6c757d !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.375rem 0.75rem !important;
    min-height: 32px !important;
}

    .admin-piatti-page .k-grid button[title="Cancel"]:hover,
    .admin-piatti-page .k-grid button[title="Annulla"]:hover {
        background-color: #6c757d !important;
        color: #fff !important;
    }

/* ==========================================================================
   MENSA MODULE - STILI ALLINEATI AL DESIGN SYSTEM
   ========================================================================== */

/* ==========================================================================
   ADMIN SEGNALAZIONI - PULSANTI FLAT STYLE
   ========================================================================== */

/* Pulsante Indietro */
.admin-notes-page .page-header > button:first-child,
.admin-notes-page button[icon="FontIcon.ArrowLeft"] {
    background-color: #fff !important;
    border: 2px solid #003366 !important;
    color: #003366 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,51,102,0.1) !important;
}

    .admin-notes-page .page-header > button:first-child:hover {
        background-color: #003366 !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0,51,102,0.2) !important;
    }

/* Pulsante Carica nei filtri */
.admin-notes-page .filters button[themecolor="ThemeConstants.Button.ThemeColor.Primary"] {
    background-color: #fff !important;
    border: 2px solid #007bff !important;
    color: #007bff !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,123,255,0.1) !important;
}

    .admin-notes-page .filters button[themecolor="ThemeConstants.Button.ThemeColor.Primary"]:hover {
        background-color: #007bff !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0,123,255,0.2) !important;
    }

/* Pulsanti Risolvi nelle griglie */
.admin-notes-page .k-grid button[icon="FontIcon.Check"],
.admin-notes-page button[themecolor="ThemeConstants.Button.ThemeColor.Success"] {
    background-color: #fff !important;
    border: 2px solid #28a745 !important;
    color: #28a745 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.375rem 0.75rem !important;
    min-height: 32px !important;
    transition: all 0.2s ease !important;
}

    .admin-notes-page .k-grid button[icon="FontIcon.Check"]:hover {
        background-color: #28a745 !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 2px 4px rgba(40,167,69,0.2) !important;
    }

/* ==========================================================================
   ADMIN STATISTICHE - PULSANTI FLAT STYLE
   ========================================================================== */

/* Pulsante Indietro */
.statistics-page .page-header > button:first-child,
.statistics-page button[icon="FontIcon.ArrowLeft"] {
    background-color: #fff !important;
    border: 2px solid #003366 !important;
    color: #003366 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,51,102,0.1) !important;
}

    .statistics-page .page-header > button:first-child:hover {
        background-color: #003366 !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0,51,102,0.2) !important;
    }

/* Pulsante Carica Statistiche */
.statistics-page .filters-card button[themecolor="ThemeConstants.Button.ThemeColor.Primary"] {
    background-color: #fff !important;
    border: 2px solid #007bff !important;
    color: #007bff !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,123,255,0.1) !important;
}

    .statistics-page .filters-card button[themecolor="ThemeConstants.Button.ThemeColor.Primary"]:hover {
        background-color: #007bff !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0,123,255,0.2) !important;
    }

/* ==========================================================================
   ADMIN SETTINGS - PULSANTI FLAT STYLE
   ========================================================================== */

/* Pulsante Indietro */
.settings-page .page-header > button:first-child,
.settings-page button[icon="FontIcon.ArrowLeft"] {
    background-color: #fff !important;
    border: 2px solid #003366 !important;
    color: #003366 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,51,102,0.1) !important;
}

    .settings-page .page-header > button:first-child:hover {
        background-color: #003366 !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0,51,102,0.2) !important;
    }

/* Pulsante Salva Impostazioni */
.settings-page .k-form button[buttontype="ButtonType.Submit"] {
    background-color: #fff !important;
    border: 2px solid #007bff !important;
    color: #007bff !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,123,255,0.1) !important;
}

    .settings-page .k-form button[buttontype="ButtonType.Submit"]:hover {
        background-color: #007bff !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0,123,255,0.2) !important;
    }

/* Pulsante Annulla */
.settings-page .k-form button[buttontype="ButtonType.Button"] {
    background-color: #fff !important;
    border: 2px solid #6c757d !important;
    color: #6c757d !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(108,117,125,0.1) !important;
}

    .settings-page .k-form button[buttontype="ButtonType.Button"]:hover {
        background-color: #6c757d !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(108,117,125,0.2) !important;
    }

/* ==========================================================================
   ADMIN RIEPILOGO - PULSANTI FLAT STYLE
   ========================================================================== */

/* Pulsante Indietro */
.admin-riepilogo-page .page-header > button:first-child,
.admin-riepilogo-page button[icon="FontIcon.ArrowLeft"] {
    background-color: #fff !important;
    border: 2px solid #003366 !important;
    color: #003366 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,51,102,0.1) !important;
}

    .admin-riepilogo-page .page-header > button:first-child:hover {
        background-color: #003366 !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0,51,102,0.2) !important;
    }

/* Pulsante Esporta Excel */
.admin-riepilogo-page button[icon="FontIcon.FileExcel"],
.admin-riepilogo-page button[themecolor="ThemeConstants.Button.ThemeColor.Success"] {
    background-color: #fff !important;
    border: 2px solid #28a745 !important;
    color: #28a745 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(40,167,69,0.1) !important;
}

    .admin-riepilogo-page button[icon="FontIcon.FileExcel"]:hover {
        background-color: #28a745 !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(40,167,69,0.2) !important;
    }

/* Pulsante Stampa */
.admin-riepilogo-page button[icon="FontIcon.Print"] {
    background-color: #fff !important;
    border: 2px solid #6c757d !important;
    color: #6c757d !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(108,117,125,0.1) !important;
}

    .admin-riepilogo-page button[icon="FontIcon.Print"]:hover {
        background-color: #6c757d !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(108,117,125,0.2) !important;
    }

/* ==========================================================================
   SEGNALAZIONI UTENTE - PULSANTI FLAT STYLE
   ========================================================================== */

/* Pulsante Indietro */
.user-notes-page .page-header > button:first-child,
.user-notes-page button[icon="FontIcon.ArrowLeft"] {
    background-color: #fff !important;
    border: 2px solid #003366 !important;
    color: #003366 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,51,102,0.1) !important;
}

    .user-notes-page .page-header > button:first-child:hover {
        background-color: #003366 !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0,51,102,0.2) !important;
    }

/* Pulsante Invia Segnalazione */
.user-notes-page .actions button[themecolor="ThemeConstants.Button.ThemeColor.Primary"] {
    background-color: #fff !important;
    border: 2px solid #007bff !important;
    color: #007bff !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.75rem 1.5rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,123,255,0.1) !important;
}

    .user-notes-page .actions button[themecolor="ThemeConstants.Button.ThemeColor.Primary"]:hover {
        background-color: #007bff !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0,123,255,0.2) !important;
    }

/* Pulsante Annulla */
.user-notes-page .actions button:not([themecolor]) {
    background-color: #fff !important;
    border: 2px solid #6c757d !important;
    color: #6c757d !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.75rem 1.5rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(108,117,125,0.1) !important;
}

    .user-notes-page .actions button:not([themecolor]):hover {
        background-color: #6c757d !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(108,117,125,0.2) !important;
    }

/* ==========================================================================
   ORDINI UTENTE - PULSANTI FLAT STYLE
   ========================================================================== */

/* Pulsante Indietro */
.mensa-ordini-page .page-header > button:first-child,
.mensa-ordini-page button[icon="FontIcon.ArrowLeft"] {
    background-color: #fff !important;
    border: 2px solid #003366 !important;
    color: #003366 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,51,102,0.1) !important;
}

    .mensa-ordini-page .page-header > button:first-child:hover {
        background-color: #003366 !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0,51,102,0.2) !important;
    }

/* Pulsanti +/- Quantità */
.mensa-ordini-page .piatto-quantita-controls button[icon="FontIcon.Plus"],
.mensa-ordini-page .piatto-quantita-controls button[icon="FontIcon.Minus"] {
    background-color: #fff !important;
    border: 2px solid #007bff !important;
    color: #007bff !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,123,255,0.1) !important;
}

.mensa-ordini-page .piatto-quantita-controls button:hover {
    background-color: #007bff !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0,123,255,0.2) !important;
}

.mensa-ordini-page .piatto-quantita-controls button:disabled {
    background-color: #f8f9fa !important;
    border-color: #e9ecef !important;
    color: #adb5bd !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Pulsante Elimina Ordine */
.mensa-ordini-page .ordine-header button[icon="FontIcon.Trash"] {
    background-color: #fff !important;
    border: 2px solid #dc3545 !important;
    color: #dc3545 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(220,53,69,0.1) !important;
}

    .mensa-ordini-page .ordine-header button[icon="FontIcon.Trash"]:hover {
        background-color: #dc3545 !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(220,53,69,0.2) !important;
    }

/* Pulsante Salva Tutti */
.mensa-ordini-page .actions-bar button[icon="FontIcon.Save"] {
    background-color: #fff !important;
    border: 2px solid #007bff !important;
    color: #007bff !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.75rem 1.5rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,123,255,0.1) !important;
}

    .mensa-ordini-page .actions-bar button[icon="FontIcon.Save"]:hover {
        background-color: #007bff !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0,123,255,0.2) !important;
    }

/* Pulsante Annulla */
.mensa-ordini-page .actions-bar button[icon="FontIcon.Cancel"] {
    background-color: #fff !important;
    border: 2px solid #6c757d !important;
    color: #6c757d !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.75rem 1.5rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(108,117,125,0.1) !important;
}

    .mensa-ordini-page .actions-bar button[icon="FontIcon.Cancel"]:hover {
        background-color: #6c757d !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(108,117,125,0.2) !important;
    }

/* ==========================================================================
   RESPONSIVE MOBILE - TUTTE LE PAGINE MENSA
   ========================================================================== */

@media (max-width: 768px) {
    /* Riduci dimensioni pulsanti su mobile */
    .admin-notes-page button,
    .statistics-page button,
    .settings-page button,
    .admin-riepilogo-page button,
    .user-notes-page button,
    .mensa-ordini-page button {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.85rem !important;
        min-height: 40px !important;
    }

    /* Pulsanti quantità più grandi per touch */
    .mensa-ordini-page .piatto-quantita-controls button {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 0.5rem !important;
    }

    /* Rimuovi animazione hover su mobile */
    .admin-notes-page button:hover,
    .statistics-page button:hover,
    .settings-page button:hover,
    .admin-riepilogo-page button:hover,
    .user-notes-page button:hover,
    .mensa-ordini-page button:hover {
        transform: none !important;
    }
}

/* ==========================================================================
   ACCESSIBILITÀ - FOCUS STATES
   ========================================================================== */

/* Focus visibile per tutti i pulsanti */
.admin-notes-page button:focus,
.statistics-page button:focus,
.settings-page button:focus,
.admin-riepilogo-page button:focus,
.user-notes-page button:focus,
.mensa-ordini-page button:focus {
    outline: 2px solid #007bff !important;
    outline-offset: 2px !important;
}

/* Focus per pulsanti di pericolo */
.admin-notes-page button[icon="FontIcon.Trash"]:focus,
.admin-riepilogo-page button[icon="FontIcon.Trash"]:focus,
.mensa-ordini-page button[icon="FontIcon.Trash"]:focus {
    outline-color: #dc3545 !important;
}

/* Focus per pulsanti successo */
.admin-notes-page button[icon="FontIcon.Check"]:focus,
.admin-riepilogo-page button[icon="FontIcon.FileExcel"]:focus {
    outline-color: #28a745 !important;
}

/* ==========================================================================
   MENSA MODULE - PULSANTI UNIFORMI
   ========================================================================== */

/* Pulsante Primario - Salva, Invia, Conferma */
.mensa-btn-primary {
    background: #fff !important;
    border: 2px solid #007bff !important;
    color: #007bff !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.75rem 1.5rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,123,255,0.1) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    cursor: pointer !important;
}

    .mensa-btn-primary:hover:not(:disabled) {
        background: #007bff !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0,123,255,0.2) !important;
    }

    .mensa-btn-primary:disabled {
        opacity: 0.5 !important;
        cursor: not-allowed !important;
        transform: none !important;
    }

/* Pulsante Secondario - Annulla */
.mensa-btn-secondary {
    background: transparent !important;
    border: 2px solid #6f42c1 !important;
    color: #6f42c1 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 0.75rem 1.5rem !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    cursor: pointer !important;
}

    .mensa-btn-secondary:hover:not(:disabled) {
        background: #6f42c1 !important;
        color: #fff !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(111,66,193,0.2) !important;
    }

/* Override specifici Telerik - MASSIMA SPECIFICITÀ */
.user-notes-page .actions .k-button.mensa-btn-primary,
.user-notes-page .actions button.mensa-btn-primary,
.admin-piatti-page .k-form-buttons .k-button.mensa-btn-primary,
.k-button.mensa-btn-primary,
button.mensa-btn-primary {
    background: #fff !important;
    background-color: #fff !important;
    border: 2px solid #007bff !important;
    border-color: #007bff !important;
    color: #007bff !important;
}

    .user-notes-page .actions .k-button.mensa-btn-primary:hover,
    .user-notes-page .actions button.mensa-btn-primary:hover,
    .admin-piatti-page .k-form-buttons .k-button.mensa-btn-primary:hover,
    .k-button.mensa-btn-primary:hover,
    button.mensa-btn-primary:hover {
        background: #007bff !important;
        background-color: #007bff !important;
        border: 2px solid #007bff !important;
        border-color: #007bff !important;
        color: #fff !important;
    }

.user-notes-page .actions .k-button.mensa-btn-secondary,
.user-notes-page .actions button.mensa-btn-secondary,
.admin-piatti-page .k-form-buttons .k-button.mensa-btn-secondary,
.k-button.mensa-btn-secondary,
button.mensa-btn-secondary {
    background: transparent !important;
    background-color: transparent !important;
    border: 2px solid #6f42c1 !important;
    border-color: #6f42c1 !important;
    color: #6f42c1 !important;
}

    .user-notes-page .actions .k-button.mensa-btn-secondary:hover,
    .user-notes-page .actions button.mensa-btn-secondary:hover,
    .admin-piatti-page .k-form-buttons .k-button.mensa-btn-secondary:hover,
    .k-button.mensa-btn-secondary:hover,
    button.mensa-btn-secondary:hover {
        background: #6f42c1 !important;
        background-color: #6f42c1 !important;
        border: 2px solid #6f42c1 !important;
        border-color: #6f42c1 !important;
        color: #fff !important;
    }

/* Responsive Mobile */
@media (max-width: 768px) {
    .mensa-btn-primary,
    .mensa-btn-secondary {
        width: 100% !important;
        padding: 1rem 1.5rem !important;
        justify-content: center !important;
    }

        .mensa-btn-primary:hover,
        .mensa-btn-secondary:hover {
            transform: none !important;
        }
}

/* ==========================================================================
   SETTINGS PAGE - /mensa/admin/settings
   ========================================================================== */

.settings-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

    .settings-page .page-header {
        margin-bottom: 2rem;
    }

        .settings-page .page-header h2 {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            color: #212529;
            margin: 0;
        }

    .settings-page .loading-container {
        display: flex;
        justify-content: center;
        padding: 3rem;
    }

    .settings-page .settings-card {
        background: white;
        border-radius: 8px;
        padding: 2rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .settings-page .help-text {
        margin-top: 0.5rem;
        font-size: 0.875rem;
        color: #6c757d;
        font-style: italic;
    }

    .settings-page .example-section {
        margin-top: 2rem;
        padding: 1.5rem;
        background: #f8f9fa;
        border-radius: 8px;
        border-left: 4px solid #3b82f6;
    }

        .settings-page .example-section h4 {
            margin: 0 0 1rem 0;
            color: #3b82f6;
        }

        .settings-page .example-section p {
            margin: 0.5rem 0;
        }

    .settings-page .example-text {
        color: #495057;
        line-height: 1.6;
    }

/* ==========================================================================
   STATISTICS PAGE - /mensa/admin/statistiche
   ========================================================================== */

.statistics-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

    .statistics-page .page-header {
        margin-bottom: 2rem;
    }

        .statistics-page .page-header h2 {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            color: #212529;
            margin: 0;
        }

    .statistics-page .filters-card {
        background: white;
        border-radius: 8px;
        padding: 1.5rem;
        margin-bottom: 2rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .statistics-page .filters {
        display: flex;
        gap: 1rem;
        align-items: center;
    }

    .statistics-page .loading-container {
        display: flex;
        justify-content: center;
        padding: 3rem;
    }

    .statistics-page .stats-cards {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .statistics-page .stat-card {
        background: white;
        border-radius: 8px;
        padding: 1.5rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .statistics-page .stat-icon {
        width: 60px;
        height: 60px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2rem;
        color: white;
    }

        .statistics-page .stat-icon.primary {
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        }

        .statistics-page .stat-icon.success {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        }

        .statistics-page .stat-icon.warning {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        }

        .statistics-page .stat-icon.info {
            background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
        }

    .statistics-page .stat-content {
        flex: 1;
    }

    .statistics-page .stat-value {
        font-size: 1.75rem;
        font-weight: bold;
        color: #212529;
    }

    .statistics-page .stat-label {
        color: #6c757d;
        font-size: 0.875rem;
    }

    .statistics-page .charts-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
        gap: 2rem;
    }

    .statistics-page .chart-card {
        background: white;
        border-radius: 8px;
        padding: 1.5rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

        .statistics-page .chart-card.full-width {
            grid-column: 1 / -1;
        }

        .statistics-page .chart-card h3 {
            margin: 0 0 1.5rem 0;
            color: #212529;
        }

    .statistics-page .empty-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 5rem;
        color: #6c757d;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

        .statistics-page .empty-state p {
            margin: 1rem 0 0 0;
            font-size: 1.125rem;
        }

/* ==========================================================================
   ADMIN NOTES PAGE - /mensa/admin/segnalazioni
   ========================================================================== */

.admin-notes-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

    .admin-notes-page .page-header {
        margin-bottom: 2rem;
    }

        .admin-notes-page .page-header h2 {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            color: #212529;
            margin: 0;
        }

    .admin-notes-page .filters {
        display: flex;
        gap: 1rem;
        margin-bottom: 2rem;
        padding: 1.5rem;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .admin-notes-page .loading-container {
        display: flex;
        justify-content: center;
        padding: 3rem;
    }

    .admin-notes-page .notes-sections {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .admin-notes-page .section-card {
        background: white;
        border-radius: 8px;
        padding: 1.5rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

        .admin-notes-page .section-card h3 {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin: 0 0 1.5rem 0;
            color: #212529;
            font-size: 1.25rem;
        }

    .admin-notes-page .badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 24px;
        height: 24px;
        padding: 0 8px;
        background: #3b82f6;
        color: white;
        border-radius: 12px;
        font-size: 0.875rem;
        font-weight: 600;
    }

    .admin-notes-page .empty-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 3rem;
        color: #6c757d;
        text-align: center;
    }

        .admin-notes-page .empty-state p {
            margin: 1rem 0 0 0;
            font-size: 1.125rem;
        }

/* ==========================================================================
   ADMIN RIEPILOGO PAGE - /mensa/admin/riepilogo
   ========================================================================== */

.admin-riepilogo-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

    .admin-riepilogo-page .page-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .admin-riepilogo-page .page-title {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin: 0;
        font-size: 1.5rem;
    }

    .admin-riepilogo-page .riepilogo-actions {
        display: flex;
        gap: 1rem;
        align-items: center;
        margin-bottom: 1.5rem;
    }

    .admin-riepilogo-page .loading-container {
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 300px;
    }

    .admin-riepilogo-page .alert {
        padding: 0.75rem 1rem;
        border-radius: 4px;
        margin-bottom: 1rem;
    }

    .admin-riepilogo-page .alert-info {
        background: #d1ecf1;
        color: #0c5460;
        border: 1px solid #bee5eb;
    }

    .admin-riepilogo-page .summary-cards {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .admin-riepilogo-page .summary-card {
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        overflow: hidden;
    }

    .admin-riepilogo-page .card-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 1rem;
    }

        .admin-riepilogo-page .card-header h4 {
            margin: 0;
            font-size: 1rem;
        }

    .admin-riepilogo-page .card-body {
        padding: 1.5rem;
        text-align: center;
    }

    .admin-riepilogo-page .total-count {
        font-size: 2.5rem;
        font-weight: 700;
        color: #667eea;
        margin-bottom: 0.5rem;
    }

    .admin-riepilogo-page .card-label {
        font-size: 0.9rem;
        color: #6c757d;
        text-transform: uppercase;
    }

    .admin-riepilogo-page .quantity-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        padding: 0.25rem 0.75rem;
        background: #e7f3ff;
        color: #0066cc;
        border-radius: 12px;
        font-weight: 600;
    }

    .admin-riepilogo-page .actions-bar {
        display: flex;
        gap: 1rem;
        margin-top: 1.5rem;
        flex-wrap: wrap;
    }

/* ==========================================================================
   MENSA ORDINI PAGE - /mensa/ordini
   ========================================================================== */

.mensa-ordini-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

    .mensa-ordini-page .page-header {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .mensa-ordini-page .page-title {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin: 0;
        font-size: 1.5rem;
    }

    .mensa-ordini-page .loading-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 300px;
        gap: 1rem;
    }

    .mensa-ordini-page .ordine-card {
        background: white;
        border-radius: 8px;
        padding: 1.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .mensa-ordini-page .ordine-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .mensa-ordini-page .data-info {
        display: flex;
        flex-direction: column;
    }

    .mensa-ordini-page .giorno-settimana {
        font-size: 1.2rem;
        font-weight: 600;
        text-transform: capitalize;
    }

    .mensa-ordini-page .data-completa {
        font-size: 0.9rem;
        color: #666;
        text-transform: capitalize;
    }

    .mensa-ordini-page .alert {
        padding: 0.75rem 1rem;
        border-radius: 4px;
        margin-bottom: 1rem;
    }

    .mensa-ordini-page .alert-warning {
        background: #fff3cd;
        color: #856404;
        border: 1px solid #ffeaa7;
    }

    .mensa-ordini-page .allday-switch {
        margin-bottom: 1.5rem;
        padding: 1rem;
        background: #f8f9fa;
        border-radius: 6px;
    }

    .mensa-ordini-page .tipologia-section {
        margin-bottom: 2rem;
    }

    .mensa-ordini-page .tipologia-title {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid #e9ecef;
    }

    .mensa-ordini-page .piatti-grid {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .mensa-ordini-page .piatto-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem;
        background: #f8f9fa;
        border-radius: 6px;
    }

    .mensa-ordini-page .piatto-info {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        flex: 1;
    }

    .mensa-ordini-page .piatto-nome {
        font-weight: 500;
    }

    .mensa-ordini-page .piatto-prezzo {
        font-size: 0.85rem;
        color: #6c757d;
    }

    .mensa-ordini-page .piatto-quantita-controls {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .mensa-ordini-page .quantita-display {
        min-width: 2.5rem;
        text-align: center;
        font-weight: 600;
        font-size: 1.2rem;
        color: #0066cc;
    }

    .mensa-ordini-page .ordine-totale {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        background: #e7f3ff;
        border-radius: 6px;
        margin-top: 1.5rem;
    }

    .mensa-ordini-page .totale-importo {
        font-weight: 700;
        color: #0066cc;
        font-size: 1.3rem;
    }

    .mensa-ordini-page .actions-bar {
        display: flex;
        gap: 1rem;
        margin: 2rem 0;
        flex-wrap: wrap;
    }

    .mensa-ordini-page .riepilogo-settimanale {
        background: #f8f9fa;
        border-radius: 8px;
        padding: 1.5rem;
    }

        .mensa-ordini-page .riepilogo-settimanale h4 {
            margin-top: 0;
        }

    .mensa-ordini-page .totale-settimana {
        display: flex;
        justify-content: space-between;
        padding: 1rem;
        background: white;
        border-radius: 6px;
    }

        .mensa-ordini-page .totale-settimana strong {
            color: #28a745;
            font-size: 1.4rem;
        }

/* Mobile: bottoni più grandi per touch */
@media (max-width: 768px) {
    .mensa-ordini-page .piatto-quantita-controls {
        gap: 1rem;
    }

        .mensa-ordini-page .piatto-quantita-controls .k-button {
            min-width: 44px !important;
            min-height: 44px !important;
            padding: 0.5rem !important;
        }

    .mensa-ordini-page .quantita-display {
        min-width: 3rem;
        font-size: 1.3rem;
    }

    .mensa-ordini-page .piatto-item {
        padding: 1rem;
    }
}

/* ==========================================================================
   USER NOTES PAGE - /mensa/segnalazioni
   ========================================================================== */

.user-notes-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

    .user-notes-page .page-header {
        margin-bottom: 2rem;
    }

        .user-notes-page .page-header h2 {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            color: #212529;
            margin: 0 0 0.5rem 0;
        }

    .user-notes-page .subtitle {
        color: #6c757d;
        margin: 0;
    }

    .user-notes-page .loading-container {
        display: flex;
        justify-content: center;
        padding: 3rem;
    }

    .user-notes-page .notes-card {
        background: white;
        border-radius: 8px;
        padding: 2rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .user-notes-page .section {
        margin-bottom: 2rem;
    }

        .user-notes-page .section:last-of-type {
            margin-bottom: 1.5rem;
        }

        .user-notes-page .section h3 {
            margin: 0 0 0.5rem 0;
            color: #212529;
            font-size: 1.25rem;
        }

    .user-notes-page .help-text {
        margin: 0 0 1rem 0;
        font-size: 0.875rem;
        color: #6c757d;
        font-style: italic;
    }

    .user-notes-page .product-checkbox {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

        .user-notes-page .product-checkbox label {
            cursor: pointer;
            user-select: none;
        }

    .user-notes-page .actions {
        display: flex;
        gap: 1rem;
        justify-content: flex-end;
        padding-top: 1rem;
        border-top: 1px solid #dee2e6;
    }

/* ==========================================================================
   ADMIN PIATTI PAGE - /mensa/admin/piatti
   ========================================================================== */

.admin-piatti-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

    .admin-piatti-page .page-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .admin-piatti-page .page-title {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin: 0;
        font-size: 1.5rem;
    }

    .admin-piatti-page .filter-section {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 1rem;
        padding: 0.75rem 1rem;
        background: #f8f9fa;
        border-radius: 8px;
        border-left: 4px solid #0d6efd;
    }

    .admin-piatti-page .filter-label {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin: 0;
        font-weight: 500;
        cursor: pointer;
        user-select: none;
    }

    .admin-piatti-page .filter-info {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        margin-left: auto;
        color: #6c757d;
        font-size: 0.9rem;
        font-style: italic;
    }

    .admin-piatti-page .loading-container {
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 300px;
    }

    .admin-piatti-page .badge {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0.25rem 0.75rem;
        border-radius: 12px;
        font-size: 0.85rem;
        font-weight: 500;
    }

    .admin-piatti-page .badge-success {
        background: #d4edda;
        color: #155724;
    }

    .admin-piatti-page .badge-secondary {
        background: #e9ecef;
        color: #6c757d;
    }

    /* CSS ORIGINALE DEL FORM */
    .admin-piatti-page .dialog-form-container {
        padding: 1.5rem;
    }

        .admin-piatti-page .dialog-form-container .k-form {
            gap: 1rem;
        }

        .admin-piatti-page .dialog-form-container .k-form-field {
            margin-bottom: 1rem;
        }

        .admin-piatti-page .dialog-form-container .k-form-buttons {
            margin-top: 1.5rem;
            padding-top: 1rem;
            border-top: 1px solid #e9ecef;
            gap: 0.75rem;
        }

/* Mobile */
@media (max-width: 768px) {
    .admin-piatti-page .k-dialog {
        min-width: 95vw;
    }

    .admin-piatti-page .dialog-form-container {
        padding: 1.5rem;
    }

        .admin-piatti-page .dialog-form-container .k-form-buttons {
            flex-direction: column;
        }

            .admin-piatti-page .dialog-form-container .k-form-buttons .k-button {
                width: 100%;
            }
}

/* =======================
   DIALOG NUOVO PIATTO
   ======================= */
.mensa-dialog .k-dialog-content {
    padding: 1.25rem 1.5rem !important; /* respiro ai bordi */
}

.mensa-dialog-form .k-form {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 1rem; /* spazio verticale costante tra i campi */
}

.mensa-dialog-form .k-form-field {
    margin: 0 !important;
    padding: 0 !important;
}

.mensa-dialog-form .k-form-label,
.mensa-dialog-form .k-label.k-form-label {
    margin-bottom: .375rem; /* spazio label–campo */
    font-weight: 600;
}

.mensa-dialog-form .k-input,
.mensa-dialog-form .k-picker,
.mensa-dialog-form .k-dropdownlist,
.mensa-dialog-form .k-date-picker,
.mensa-dialog-form .k-textbox,
.mensa-dialog-form .k-input-inner {
    width: 100% !important; /* input a tutta larghezza */
    box-sizing: border-box;
}

/* area bottoni del form */
.mensa-dialog-form .k-form-buttons {
    margin-top: 1rem !important;
    padding-top: 1rem !important;
    border-top: 1px solid #e9ecef;
    gap: .75rem;
}

/* Mobile: un filo più compatto ma con padding */
@media (max-width: 768px) {
    .mensa-dialog .k-dialog-content {
        padding: 1rem !important;
    }

    .mensa-dialog-form .k-form {
        row-gap: .875rem;
    }
}


/* Dialog Nuovo Piatto: aria ai bordi e spacing coerente */
.k-dialog .k-dialog-content .mensa-dialog-form {
    padding: 1.25rem 1.5rem; /* respiro */
}

.mensa-dialog-form .k-form {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 1rem; /* spazio verticale costante */
}

.mensa-dialog-form .k-form-label,
.mensa-dialog-form .k-label.k-form-label {
    margin-bottom: .375rem;
    font-weight: 600;
}

.mensa-dialog-form .k-input,
.mensa-dialog-form .k-picker,
.mensa-dialog-form .k-dropdownlist,
.mensa-dialog-form .k-date-picker,
.mensa-dialog-form .k-textbox,
.mensa-dialog-form .k-input-inner {
    width: 100% !important;
    box-sizing: border-box;
}

.mensa-dialog-form .k-form-buttons {
    margin-top: 1rem !important;
    padding-top: 1rem !important;
    border-top: 1px solid #e9ecef;
    gap: .75rem;
}

@media (max-width: 768px) {
    .k-dialog .k-dialog-content .mensa-dialog-form {
        padding: 1rem;
    }

    .mensa-dialog-form .k-form {
        row-gap: .875rem;
    }
}

/* FORZA l'header in riga su /mensa/ordini */
.mensa-ordini-page .page-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    margin-bottom: 1.5rem;
}

    /* Titolo allineato con l’icona */
    .mensa-ordini-page .page-header > .page-title {
        margin: 0 !important;
        display: flex;
        align-items: center;
        gap: .5rem;
    }

    /* Il DateRangePicker resta a destra */
    .mensa-ordini-page .page-header > .date-selector {
        margin-left: auto !important;
        display: flex;
        align-items: center;
    }

        .mensa-ordini-page .page-header > .date-selector .k-daterangepicker {
            width: 280px;
            max-width: 100%;
        }

/* Mobile: torna a colonna */
@media (max-width: 768px) {
    .mensa-ordini-page .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

        .mensa-ordini-page .page-header > .date-selector {
            margin-left: 0 !important;
            width: 100%;
        }

            .mensa-ordini-page .page-header > .date-selector .k-daterangepicker {
                width: 100%;
            }
}


.filters-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.export-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.selected-users-info {
    background: #e3f2fd;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: #1976d2;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

    .stat-icon.primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .stat-icon.success {
        background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    }

    .stat-icon.warning {
        background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    }

    .stat-icon.info {
        background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    }

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: bold;
    color: #212529;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
}

.chart-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

    .chart-card.full-width {
        grid-column: 1 / -1;
    }

    .chart-card h3 {
        margin: 0 0 1rem 0;
        color: #212529;
    }

.no-data {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

    .empty-state .k-icon {
        margin-bottom: 1rem;
        opacity: 0.5;
    }

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem;
}

.mensa-home-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.hero-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    color: white;
    border-radius: 12px;
}

    .hero-section h1 {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        margin: 0 0 1rem 0;
        font-size: 2rem;
    }

.subtitle {
    margin: 0;
    opacity: 0.9;
}

.menu-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.menu-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

    .menu-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    }

.card-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: white;
    font-size: 2rem;
}

.user-card {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
}

.admin-card {
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
}

.card-content {
    flex: 1;
}

    .card-content h3 {
        margin: 0 0 0.5rem 0;
        color: #212529;
    }

    .card-content p {
        margin: 0;
        color: #6c757d;
        font-size: 0.9rem;
    }

.card-arrow {
    color: #3b82f6;
}

.card-icon {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: yellow;
    color: black;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ospite-details-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

    .ospite-details-card h4 {
        margin-top: 0;
        color: #495057;
        margin-bottom: 15px;
    }

.details-grid {
    display: grid;
    gap: 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

    .detail-item:last-child {
        border-bottom: none;
    }

    .detail-item .label {
        font-weight: 600;
        color: #6c757d;
    }

    .detail-item .value {
        color: #212529;
    }

.ospite-item {
    padding: 8px;
}

    .ospite-item strong {
        color: #212529;
    }

    .ospite-item small {
        color: #6c757d;
    }



.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

    .empty-state p {
        margin-top: 15px;
    }

.user-autocomplete-item {
    padding: 8px;
}

    .user-autocomplete-item strong {
        color: #212529;
        font-size: 14px;
    }

    .user-autocomplete-item small {
        color: #6c757d;
        font-size: 12px;
    }

.form-input {
    border-radius: 4px;
}


/* ==========================================================================
   GESTIONE ACCESSI - PAGE STYLES
   ========================================================================== */

.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
   
    padding: 2rem 1rem;
    /* Ottimizzazioni per touch */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.form-card {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-card h2 {
    text-align: center;
    color: #2d3748;
    margin: 0 0 2rem 0;
    font-size: 1.75rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 1.5rem;
}

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        color: #4a5568;
        font-weight: 600;
        font-size: 0.95rem;
    }

    .form-group small {
        display: block;
        margin-top: 0.25rem;
        color: #718096;
        font-size: 0.85rem;
    }

.form-input {
    width: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
    /* Ottimizzazioni touch */
    min-height: 44px;
    font-size: 16px !important; /* Previene zoom su iOS */
}

    .form-input:focus {
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

/* Stili specifici per Telerik */
.k-textbox,
.k-input,
.k-dropdown,
.k-autocomplete {
    min-height: 44px !important;
    font-size: 16px !important;
}

.k-input-inner {
    font-size: 16px !important;
    padding: 0.75rem !important;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    /* Touch-friendly */
    padding: 0.5rem 0;
}

    .checkbox-group label {
        margin: 0;
        color: #4a5568;
        font-weight: 500;
        cursor: pointer;
        /* Touch target più grande */
        padding: 0.5rem;
    }

    .checkbox-group .k-checkbox {
        /* Touch target minimo 44x44px */
        min-width: 24px;
        min-height: 24px;
    }

.button-container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.submit-button {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    /* Touch-friendly */
    min-height: 56px;
    touch-action: manipulation;
}

    .submit-button:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }

    .submit-button:active:not(:disabled) {
        transform: translateY(0);
    }

    .submit-button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.link-section {
    margin-top: 2rem;
    text-align: center;
}

.link-text {
    margin: 0.75rem 0;
    color: #718096;
    cursor: pointer;
    transition: color 0.2s ease;
    /* Touch-friendly */
    padding: 0.75rem;
    touch-action: manipulation;
}

    .link-text:hover {
        color: #4a5568;
    }

.link-highlight {
    color: #667eea;
    font-weight: 600;
    text-decoration: underline;
}

    .link-highlight:hover {
        color: #5a67d8;
    }

/* ==========================================================================
   MESSAGGI DI FEEDBACK CON AUTO-DISMISS
   ========================================================================== */

.message {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    min-width: 300px;
    max-width: 90%;
    text-align: center;
    /* Animazioni */
    animation: slideDown 0.3s ease-out, fadeOut 0.3s ease-in 4.7s;
    animation-fill-mode: forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-100%);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

.message-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border-left: 5px solid #2f855a;
}

.message-error {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    border-left: 5px solid #c53030;
}

.message-warning {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    border-left: 5px solid #c05621;
}

.message-info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border-left: 5px solid #2c5282;
}

/* ==========================================================================
   RESPONSIVE - TABLET E MOBILE
   ========================================================================== */

@media (max-width: 768px) {
    .page-container {
        padding: 1rem;
    }

    .form-card {
        padding: 1.5rem;
    }

        .form-card h2 {
            font-size: 1.5rem;
        }

    .message {
        min-width: 250px;
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .form-card {
        padding: 1.25rem;
    }

        .form-card h2 {
            font-size: 1.35rem;
            margin-bottom: 1.5rem;
        }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .submit-button {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }

    .message {
        top: 1rem;
        min-width: 200px;
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   OTTIMIZZAZIONI PWA E TOUCH
   ========================================================================== */

@media (display-mode: standalone) {
    /* Stili specifici per PWA */
    .page-container {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Rimuovi selezione testo su elementi cliccabili */
.link-text,
.submit-button,
.checkbox-group label {
    -webkit-user-select: none;
    user-select: none;
}

    /* Migliora feedback touch */
    .submit-button:active,
    .link-text:active {
        opacity: 0.8;
    }

/* Previeni overflow orizzontale su mobile */
.form-card * {
    max-width: 100%;
    box-sizing: border-box;
}

/* Migliora visibilità focus per accessibilità */
.form-input:focus,
.k-input:focus,
.k-textbox:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Override: evidenzia correttamente le voci selezionate nel dropdown Telerik MultiSelect */
.k-multiselect .k-list-container .k-list-item.k-selected,
.k-multiselect .k-list-container .k-list-item.k-state-selected,
.k-list-container.k-popup .k-list-item.k-selected,
.k-list-container.k-popup .k-list-item.k-state-selected {
    background-color: #007bff !important; /* colore evidenziatura */
    color: #fff !important; /* testo bianco per contrasto */
}

/* hover più leggero per leggibilità */
.k-multiselect .k-list-container .k-list-item:hover,
.k-list-container.k-popup .k-list-item:hover {
    background-color: rgba(0, 123, 255, 0.12) !important;
}

/* ---------- RCD Landing (scoped) ---------- */
/* Regole specifiche per la pagina /rcd, scoperte sotto .rcd-container per evitare effetti collaterali */
.rcd-container {
    padding: 20px;
    position: relative;
}

    .rcd-container .loader-overlay {
        position: absolute;
        inset: 0;
        background-color: rgba(255,255,255,0.75);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 9999;
    }

    .rcd-container .loader-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Manteniamo lo styling specifico del tabstrip solo quando usato in .rcd-container */
    .rcd-container .k-tabstrip-items-wrapper {
        background-color: #f5f5f5;
    }

    .rcd-container .k-tabstrip .k-item.k-active {
        background-color: #0d6efd;
        color: #fff;
    }
/* ---------- fine RCD Landing ---------- */


/* ---------- ExtraTicket - page styles (scoped) ---------- */
.page-extra-ticket {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

    /* Titolo pagina */
    .page-extra-ticket .page-title {
        margin: 0 0 .5rem 0;
        font-size: clamp(1.25rem, 2.5vw, 1.75rem);
        font-weight: 600;
        color: var(--primary-color);
    }

    /* Card filtri: compatto e coerente con il design system */
    .page-extra-ticket .card-filters {
        padding: 0.5rem;
        border-radius: .5rem;
    }

        .page-extra-ticket .card-filters .k-card-body {
            padding-top: .5rem;
            padding-bottom: .5rem;
        }

        .page-extra-ticket .card-filters .form-label {
            font-weight: 600;
            color: #495057;
            margin-bottom: .25rem;
        }

    /* Griglia compatta */
    .page-extra-ticket .grid-compact .k-grid {
        font-size: .95rem;
    }

        .page-extra-ticket .grid-compact .k-grid .k-grid-header .k-header {
            background: #f8f9fa;
            font-weight: 600;
            color: #333;
        }

        /* Celle e template più compatte per leggibilità */
        .page-extra-ticket .grid-compact .k-grid td {
            padding: .45rem .6rem !important;
        }

    /* Pulsanti azione nella griglia (solo dentro questa pagina) */
    .page-extra-ticket .k-grid .k-button {
        border-radius: 6px !important;
        border-width: 2px !important;
        padding: .35rem .6rem !important;
        font-weight: 500 !important;
        min-height: 34px !important;
    }

    /* Barra selezione progetti (selection-bar) */
    .page-extra-ticket .selection-bar {
        padding: .5rem 1rem;
        border-radius: .5rem;
        background: #eef6ff;
        border: 1px solid rgba(3,102,204,.06);
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: .5rem;
    }

        /* Bottoni della selection-bar: dimensioni compatte */
        .page-extra-ticket .selection-bar .k-button {
            min-height: 34px;
            padding: .35rem .6rem;
            border-radius: 6px;
        }

    /* Template Azioni (Apri / Export) spacing */
    .page-extra-ticket .k-grid .k-button + .k-button {
        margin-left: .5rem !important;
    }

/* Responsive: filtri 1-col su mobile */
@media (max-width: 768px) {
    .page-extra-ticket .card-filters .row > [class*="col-"] {
        width: 100%;
        display: block;
    }

    .page-extra-ticket .grid-compact .k-grid {
        font-size: .92rem;
    }

    .page-extra-ticket .selection-bar {
        flex-direction: column;
        align-items: stretch;
        gap: .5rem;
    }

        .page-extra-ticket .selection-bar > div {
            display: flex;
            justify-content: flex-end;
            gap: .5rem;
        }
}

/* Small polish: allinea i DatePicker/TextBox sm alle dimensioni del card */
.page-extra-ticket .k-datepicker,
.page-extra-ticket .k-textbox,
.page-extra-ticket .k-textbox.k-input,
.page-extra-ticket .k-datepicker .k-input {
    min-height: 40px !important;
    padding: .45rem .6rem !important;
    box-sizing: border-box;
}
/* ---------- fine ExtraTicket ---------- */

