﻿:root {
    --rz-primary: #bba338 !important;
    --primary-color: #7b5334;
    --primary-color-dark: #463120;
    --rz-panel-menu-item-active-background-color: #bba3387a !important;
    --rz-panel-menu-item-2nd-level-active-background-color: #bba3387a !important;
    --rz-panel-menu-item-active-color: black !important;
    --rz-panel-menu-item-2nd-level-active-color: black !important;
    --rz-panel-menu-item-2nd-level-margin-block: 0px !important;
    --rz-panel-menu-item-2nd-level-margin-inline: 0px !important;
    --rz-panel-menu-item-2nd-level-border-radius: 0px !important;
    --rz-input-font-size: 13px !important;
    --rz-input-disabled-color: #424242 !important;
    --rz-dropdown-item-selected-background-color: #bba3387a !important;
    --rz-dropdown-item-selected-color: #463120 !important;
    --rz-dropdown-item-active-background-color: #bba3387a !important;
    --rz-dropdown-item-active-color: #463120 !important;

}

.rz-state-highlight.rz-menuitem, .rz-state-highlight.rz-autocomplete-list-item, .rz-state-highlight.rz-multiselect-item, .rz-autocomplete-items li.rz-state-highlight, .rz-dropdown-items li.rz-state-highlight, .rz-multiselect-items li.rz-state-highlight, .rz-dropdown-item.rz-state-highlight {
    background-color: var(--rz-panel-menu-item-active-background-color) !important;
    color: var(--primary-color-dark) !important;
}

.rz-chkbox-box.rz-state-active:hover {
    background-color: var(--rz-panel-menu-item-active-background-color) !important;
    color: var(--primary-color-dark) !important;
}


.rz-header {
    background: var(--primary-color) !important;
    color: white !important;
}

.rz-panel-menu {
    background: none !important;
}

.rz-sidebar-toggle:focus-visible, .rz-sidebar-toggle:hover {
    background: var(--primary-color-dark) !important;
}

.rz-sidebar-toggle {
    margin: 0px !important;
}



/*LOGIN --- inizio --- */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-dark) 100%);
}

.login-card {
    width: 380px;
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    animation: fadeIn 0.4s ease-in-out;
}

.login-footer {
    margin-top: 2rem;
    color: white;
    font-size: 13px;
    opacity: 0.8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/*LOGIN --- fine --- */




:not(.rz-form-field-content) > .rz-colorpicker.rz-state-disabled, :not(.rz-form-field-content) > .rz-numeric.rz-state-disabled, :not(.rz-form-field-content) > .rz-listbox.rz-state-disabled, :not(.rz-form-field-content) > .rz-autocomplete-input:disabled, :not(.rz-form-field-content) > .rz-state-disabled.rz-autocomplete, :not(.rz-form-field-content) > .rz-state-disabled.rz-multiselect, :not(.rz-form-field-content) > .rz-state-disabled.rz-dropdown, .rz-timespanpicker:not(.rz-form-field-content) > .rz-inputtext:disabled, :not(.rz-form-field-content) > .rz-colorpicker:disabled, .rz-lookup-search :not(.rz-form-field-content) > input:disabled, :not(.rz-form-field-content) > .rz-numeric:disabled, .rz-datepicker:not(.rz-form-field-content) > .rz-inputtext:disabled, :not(.rz-form-field-content) > .rz-multiselect:disabled, :not(.rz-form-field-content) > .rz-dropdown:disabled, :not(.rz-form-field-content) > .mask:disabled, :not(.rz-form-field-content) > .rz-textarea:disabled, :not(.rz-form-field-content) > .rz-textbox:disabled {
    cursor: not-allowed !important;
}

.rz-form-field.rz-state-disabled :not(.rz-button).rz-state-disabled, .rz-form-field.rz-state-disabled :not(.rz-button):disabled {
    cursor: not-allowed !important;
}

.rz-chkbox-box.rz-state-disabled {
    cursor: not-allowed !important;
}

.rz-cell-filter-content {
    display: contents !important;
}

.rz-form-field-content {
    display: block !important;
}

.rz-form-field-label:last-child {
    color: var(--rz-input-placeholder-color) !important;
    font-size: var(--rz-input-font-size) !important;
}

.rz-textarea {
    width: 100% !important;
}

.bntOrange {
    color: orange !important;
    background-color: #ffa5003b !important;
}

.rz-datatable-data td .rz-cell-data, .rz-grid-table td .rz-cell-data {
    white-space: break-spaces !important;
}

.rz-datatable-emptymessage {
    font-size: smaller !important;
}


/* ==========================================
   RESPONSIVENESS — Laptop / schermi piccoli
   ========================================== */

/* Permetti scroll orizzontale nel body quando le griglie sono più larghe del viewport */
.rz-body {
    overflow-x: auto !important;
    overflow-y: auto !important;
    min-width: 0 !important;
}

/* Le griglie Radzen scrollano orizzontalmente invece di tagliare il contenuto */
.rz-data-grid {
    min-width: 0;
}

/* Evita che i bottoni nella colonna azioni vengano tagliati */
.rz-grid-table .rz-cell-data .rz-stack,
.rz-datatable .rz-cell-data .rz-stack {
    flex-wrap: nowrap;
    min-width: max-content;
}

/* Header: wrap su schermi molto stretti per evitare overflow */
@media (max-width: 1100px) {
    .rz-header .rz-stack {
        gap: 0.25rem !important;
    }
    /* Abbrevia il nome utente se troppo lungo */
    .rz-header span {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Pannello filtri: su laptop stretto le colonne si impilano correttamente */
@media (max-width: 1280px) {
    .rz-card .rz-row {
        flex-wrap: wrap;
    }
}

/* Pulsanti header toolbar: riduci il testo su schermi piccoli */
@media (max-width: 900px) {
    .rz-header .rz-button-text {
        display: none;
    }
}

/* Evita che RadzenFormField si espanda oltre il contenitore */
.rz-form-field {
    max-width: 100%;
    min-width: 0;
}

/* Griglia: paginazione su schermi stretti */
@media (max-width: 768px) {
    .rz-paginator {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    .rz-paginator-summary {
        width: 100%;
        text-align: center;
    }
}

/* Convenzione griglie Fase 5: titoli colonne mai troncati, scroll orizzontale sempre visibile */
.rz-grid-table th .rz-column-title,
.rz-data-grid-data th,
.rz-data-grid-data .rz-column-title-content {
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    line-height: 1.2;
}

.rz-data-grid {
    overflow-x: scroll !important;
}

/* Scrollbar visibile sempre, non solo on-hover */
.rz-data-grid::-webkit-scrollbar {
    height: 12px;
    background: #f0f0f0;
}
.rz-data-grid::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
}