/*html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}*/

.ng-pageslide {
    background-color: white;
}
body.ng-pageslide-body-open::before {
    content: '.';
    display: block;
    position: fixed;
    top: 0;
    background-color: rgb(0,0,0);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    opacity: 0.5;
    transition: opacity 1s;
    opacity: 0.5;
    pointer-events: all;
}


body.ng-pageslide-body-closed::before {
    transition: opacity 1s;
    content: '.';
    display: block;
    position: absolute;
    top: 0;
    background-color: rgb(0,0,0);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
}

.pageslider-content {
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
    position: absolute;
    width: inherit;
    height: 100%;
}

.pageslider-head {
    position: fixed;
    width: inherit;
    background: #3c454d;
    color: #fff;
    padding: 15px 20px;
    border: none;
    height: 60px;
    z-index: 100;
}

.pageslider-body {
    overflow-y: auto;
    padding-top: 60px !important;
    width: inherit;
    overflow-x: hidden;
    height: inherit;
    padding-bottom: 80px !important;
}

.pageslider-footer {
    position: fixed;
    bottom: 0;
    width: inherit;
    margin: 0;
    border-top: 2px solid #dfe0e1;
    background: #ebeced;
    /*height: 80px;*/
    padding: 0px 5px;
}
.tenant{
    font-size:1.2rem;
    color:#333;
}
    .tenant .default {
        font-size: 1rem;
        color: #333;
        background-color:#ebeced
    }

select[multiple] {
    min-height: 200px;
    overflow-y: auto;
}
/*.pagination {
    display: inline-block;
    padding-left: 0;
    margin: 20px 0;
    border-radius: 4px;
}*/

    .pagination > li {
        display: inline;
    }

        .pagination > li > a,
        .pagination > li > span {
            position: relative;
            float: left;
            padding: 6px 12px;
            margin-left: -1px;
            line-height: 1.42857143;
            color: #313a46;
            text-decoration: none;
            background-color: #fff;
            border: 1px solid #ddd;
        }

        .pagination > li:first-child > a,
        .pagination > li:first-child > span {
            margin-left: 0;
            border-top-left-radius: 4px;
            border-bottom-left-radius: 4px;
        }

        .pagination > li:last-child > a,
        .pagination > li:last-child > span {
            border-top-right-radius: 4px;
            border-bottom-right-radius: 4px;
        }

        .pagination > li > a:hover,
        .pagination > li > span:hover,
        .pagination > li > a:focus,
        .pagination > li > span:focus {
            z-index: 2;
            color: #23527c;
            background-color: #eee;
            border-color: #ddd;
        }

.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover,
.pagination > .active > a:focus,
.pagination > .active > span:focus {
    z-index: 3;
    color: #fff;
    cursor: default;
    background-color: #313a46;
    border-color: #313a46;
}

    .pagination > .disabled > span,
    .pagination > .disabled > span:hover,
    .pagination > .disabled > span:focus,
    .pagination > .disabled > a,
    .pagination > .disabled > a:hover,
    .pagination > .disabled > a:focus {
        color: #777;
        cursor: not-allowed;
        background-color: #fff;
        border-color: #ddd;
    }

.pull-left {
    float: left !important;
}

.pull-right {
    float: right !important;
}

.pull-none {
    float: none !important;
}

.pagination-label {
    margin-top: 5px;
    display: inline-block;
}

.pagination {
    margin: 0;
    display: flex;
    justify-content: flex-end;
}

.select-box-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.width-100 {
    width: 100px !important;
}
.text-center {
    text-align: center !important;
}

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}
.icon-lg {
    font-size: 1.5rem;
    font-weight: 600;
}
/*.table > :not(caption) > * > * {
    padding: .5rem .5rem !important;
}*/
.table-buttons .btn, table tbody td .btn {
    padding: 0; /* Rimuove il padding interno del pulsante */
    margin: 0; /* Rimuove eventuali margini */
    line-height: 1; /* Assicura che il pulsante non si allarghi inutilmente */
}
.table-buttons i, table tbody td i {
    font-size: 1.2rem; /* Aumenta la dimensione dell'icona */
    width: auto; /* Assicura che la larghezza si adatti al contenuto */
    height: auto; /* Assicura che l'altezza si adatti al contenuto */
}

.form-control-sm,
.form-control-sm:focus {
    border-color: #ddd !important;
    outline: none !important;
}
.drop-box {
    background: #F8F8F8;
    border: 5px dashed #DDD;
    width: 100%;
    height: 150px;
    text-align: center;
    padding-top: 25px;
    margin: 10px;
}

.category-list {
    overflow-y: auto;
    /*max-height: 500px;*/
}

    .category-list > table {
        width: 100%;
        margin-bottom: 5px;
    }

        .category-list > table > tbody tr {
            height: 35px;
            background-color: #d5d8da;
            border: 1px solid #aaa;
        }

        .category-list > table > tbody > tr > .check {
            height: 20px;
            width: 60px;
            /*background-color: #ebeced;*/
            text-align: center;
        }

            .category-list > table > tbody > tr > .check > input {
                height: 20px;
                width: 20px;
            }

        .category-list > table > tbody > tr > .testo {
            text-align: left;
            background-color: #fff;
            padding-left: 5px;
            font-size: 14px;
        }

.dropdown-menu .divider {
    height: 1px;
    margin: 9px 0;
    overflow: hidden;
    background-color: #e5e5e5;
}
.dropdown-menu > .active > a, .dropdown-menu > .active > a:focus, .dropdown-menu > .active > a:hover {
    color: #fff;
    text-decoration: none;
    background-color: #337ab7;
    outline: 0;
}
.dropdown-menu > li > a {
    display: block;
    padding: 3px 20px;
    clear: both;
    font-weight: 400;
    line-height: 1.42857143;
    color: #333;
    white-space: nowrap;
}
.img-100{
    max-width:100px;
}
.img-300 {
    max-width: 300px;
    height:auto;
}
.scroll-container {
    max-height: 400px; /* Imposta un'altezza massima */
    overflow-y: auto; /* Aggiunge la barra di scorrimento verticale */
    border: 1px solid #ddd; /* Aggiunge un bordo leggero per visibilit� */
    padding: 5px; /* Spaziatura interna */
}
.table-striped > tbody > tr:nth-of-type(odd).st-selected td {
    background-color: #357EBD !important;
    color: #FFFFFF !important;
}
td.flex {
    /*display: flex;*/
    flex-wrap: wrap;
}

    td.flex span {
        margin-right: 5px; /* Spazio tra gli elementi */
    }

/* 8.10 Panel Setting */

.panel {
    border: none;
    /*-webkit-box-shadow: 0 2px 0 rgba(0,0,0,0.07);
    box-shadow: 0 2px 0 rgba(0,0,0,0.07);*/
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    border-radius: 0;
}

.panelSconto {
    border: 2px solid rgba(0,0,0,0.07);
    /*border-radius: 5px;*/
    border-color: rgba(0,0,0,0.07);
    /*-webkit-box-shadow: 2px 2px 5px #888888;
    box-shadow: 2px 2px 5px #888888;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;*/
    /*-webkit-box-shadow: 0 2px 0 rgba(0,0,0,0.07);
    box-shadow: 0 2px 0 rgba(0,0,0,0.07);
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;*/
}

    .panelSconto .panel-body {
        padding: 1px;
    }

.panel .panel-heading {
    padding: 15px 20px;
    border: none;
}

    .panel .panel-heading .panel-title {
        font-size: 18px;
        font-weight: normal;
        line-height: 20px;
    }

        .panel .panel-heading .panel-title small {
            font-weight: 300;
            margin-left: 3px;
            color: #fff;
            color: rgba(255,255,255,0.5);
        }

.panel.panel-default .panel-heading .panel-title small,
.panel.panel-white .panel-heading .panel-title small {
    color: #000;
    color: rgba(0,0,0,0.5);
    font-weight: normal;
}

.panel.panel-default .panel-heading .panel-title,
.panel.panel-inverse .panel-heading .panel-title,
.panel.panel-purple .panel-heading .panel-title,
.panel.panel-primary .panel-heading .panel-title,
.panel.panel-success .panel-heading .panel-title,
.panel.panel-warning .panel-heading .panel-title,
.panel.panel-danger .panel-heading .panel-title,
.panel.panel-info .panel-heading .panel-title,
.panel.panel-lime .panel-heading .panel-title,
.panel.panel-grey .panel-heading .panel-title {
    font-weight: 300;
}

.panel .panel-heading .panel-heading-btn {
    float: right;
}

.panel .panel-body {
    padding: 20px;
}

.panel.panel-white .panel-heading {
    background: #ffffff;
}

.panel.panel-default .panel-heading {
    background: #ebeced;
}

    .panel.panel-white .panel-heading .panel-title,
    .panel.panel-default .panel-heading .panel-title {
        font-weight: normal;
    }

.panel.panel-inverse .panel-heading {
    background: #3c454d;
    color: #fff;
}

.panel.panel-primary .panel-heading {
    background: #2184DA;
    color: #fff;
}

.panel.panel-success .panel-heading {
    background: #17B6A4;
    color: #fff;
}

.panel.panel-warning .panel-heading {
    background: #fcaf41;
    color: #fff;
}

.panel.panel-purple .panel-heading {
    background: #9b59b6;
    color: #fff;
}

.panel.panel-danger .panel-heading {
    background: #F04B46;
    color: #fff;
}

.panel.panel-grey .panel-heading {
    background: #aab3ba;
    color: #fff;
}

.panel.panel-grey .panel-heading {
    background: #717b85;
    color: #fff;
}

.panel.panel-info .panel-heading {
    background: #38AFD3;
    color: #fff;
}

.panel.panel-lime .panel-heading {
    background: #65C56F;
    color: #fff;
}

.panel .panel-heading-btn {
    float: right;
}

    .panel .panel-heading-btn > .btn {
        box-shadow: 0 1px rgba(0,0,0,0.125);
    }

        .panel .panel-heading-btn > .btn + .btn {
            margin-left: 5px;
        }

.panel .panel-footer {
    border-top: 2px solid #dfe0e1;
    background: #ebeced;
    padding: 10px 20px 40px 10px;
    /*border-bottom-right-radius: 6px;
    border-bottom-left-radius: 6px;*/
}

.panel.panel-expand {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 1060;
    margin-bottom: 0;
    border-radius: 0;
}

    .panel.panel-expand .panel-heading,
    .panel.panel-expand .panel-body {
        -webkit-border-radius: 0;
        -moz-border-radius: 0;
        border-radius: 0;
    }

.panel .panel-heading .label,
.panel .panel-heading .badge {
    padding-bottom: 1px;
    top: -1px;
}

    .panel .panel-heading .label.pull-left,
    .panel .panel-heading .label.pull-right,
    .panel .panel-heading .badge.pull-left,
    .panel .panel-heading .badge.pull-right {
        top: 1px;
        padding-top: 4px;
        padding-bottom: 3px;
    }

.panel > .alert {
    padding: 10px 20px;
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    border-radius: 0;
    margin: 0;
}

.panel > .form-control {
    border: none;
}

.panel .panel-toolbar {
    padding: 10px 20px;
    border-bottom: 2px solid #dfe0e1;
    background: #ebeced;
    height: 84px;
}

.panel.panel-with-tabs .nav.nav-tabs {
    margin-top: -15px;
}

.panel.panel-with-tabs.panel-inverse .nav.nav-tabs > li.active > a {
    color: #fff;
}

.panel.panel-with-tabs.panel-inverse .nav.nav-tabs > li > a {
    color: #fff;
    color: rgba(255,255,255,0.4);
}

.panel.panel-with-tabs.panel-inverse .nav.nav-tabs > li:not(.active):after {
    background: #3C454D;
}

.panel-body.panel-form {
    padding: 0;
}

    .panel-body.panel-form .form-group {
        padding: 15px;
        margin: 0;
    }

        .panel-body.panel-form .form-group + .form-group {
            border-top: 2px dashed #EAEDEF;
        }

    .panel-body.panel-form .form-horizontal .form-group {
        padding-left: 0;
        padding-right: 0;
    }

@media (max-width: 767px) {
    .panel.panel-with-tabs .nav.nav-tabs > li {
        float: left;
    }
    .content-page {
        padding: 0 !important;
    }

    .card-body {
        padding: 2px 2px !important;
    }

    body {
        font-size: 0.75rem !important;
    }

    .form-select, .form-control {
        font-size: .75rem !important;
        line-height: 1 !important;
    }
     .btn {
        font-size: .75rem !important;
        line-height: 1.2 !important;
    }
    .side-nav .side-nav-link {
        padding: 10px 10px;
    }
    .leftside-menu .logo {
        margin-top: 10px;
    }
    .button-close-fullsidebar i {
        font-size: 30px;
    }
}
.form-inline {
    display: inline-flex;
    height: 100%;
}
.uil-2x {
    font-size: 2rem;
}
.m-b-0 {
    margin-bottom: 0px !important;
}

.m-b-1 {
    margin-bottom: 1px !important;
}

.m-b-2 {
    margin-bottom: 2px !important;
}

.m-b-3 {
    margin-bottom: 3px !important;
}

.m-b-4 {
    margin-bottom: 4px !important;
}

.m-b-5 {
    margin-bottom: 5px !important;
}

.m-b-10 {
    margin-bottom: 10px !important;
}

.m-b-15 {
    margin-bottom: 15px !important;
}

.m-b-20 {
    margin-bottom: 20px !important;
}

.m-b-25 {
    margin-bottom: 25px !important;
}

.m-b-30 {
    margin-bottom: 30px !important;
}

.m-b-35 {
    margin-bottom: 35px !important;
}

.m-b-40 {
    margin-bottom: 40px !important;
}
.m-r-0 {
    margin-right: 0px !important;
}

.m-r-1 {
    margin-right: 1px !important;
}

.m-r-2 {
    margin-right: 2px !important;
}

.m-r-3 {
    margin-right: 3px !important;
}

.m-r-4 {
    margin-right: 4px !important;
}

.m-r-5 {
    margin-right: 5px !important;
}

.m-r-10 {
    margin-right: 10px !important;
}

.m-r-15 {
    margin-right: 15px !important;
}

.m-r-20 {
    margin-right: 20px !important;
}

.m-r-25 {
    margin-right: 25px !important;
}

.m-r-30 {
    margin-right: 30px !important;
}

.m-r-35 {
    margin-right: 35px !important;
}

.m-r-40 {
    margin-right: 40px !important;
}
.riga-documento > .riferimento {
    text-transform: uppercase;
    font-weight: bold;
}

/*.riga-documento > [class*="col-"] {
    padding-left: 2px !important;
    padding-right: 2px !important;
}*/

multiselect .dropdown-item {
    padding:2px;
}
multiselect .dropdown-menu > li > a {
    padding: 3px 3px;
}

/* START COLORI STATO BADGE */
[class*="fatturato" i], [class*="parzialmentefatturato" i], [class*="scontrinata" i],
[class*="venduto" i], [class*="fatturata" i] {
    background: #3498db !important;
    color: #fff !important;
}

[class*="confermato" i], [class*="parziale" i], [class*="inrevisione" i] {
    background: #f39c12 !important;
    color: #fff !important;
}

[class*="parzialmentepagato" i], [class*="pagato" i] {
    background: #252525 !important;
    color: #fff !important;
}

[class*="interna" i] {
    background: #FF8C00 !important;
    color: #fff !important;
}
[class*="pagamentoaccettato" i] {
    background: #32CD32 !important;
    color: #fff !important;
}

[class*="inattesadiassegno" i], [class*="inattesadipagamentoconbonificobancario" i] {
    background: #4169E1 !important;
    color: #fff !important;
}

[class*="preparazioneincorso" i], [class*="lista" i] {
    background: #FF8C00 !important;
    color: #fff !important;
}

[class*="spedito" i] {
    background: #8A2BE2 !important;
    color: #fff !important;
}

[class*="annullato" i] {
    background: #DC143C !important;
    color: #fff !important;
}

[class*="consegnato" i], [class*="confermata" i] {
    background: #108510 !important;
    color: #fff !important;
}

[class*="rifornimento" i] {
    background: #FF69B4 !important;
    color: #383838 !important;
}

[class*="inlavorazione" i], [class*="inpreparazionespedizione" i] {
    background: #fffc08 !important;
    color: black !important;
}

[class*="registrato" i], [class*="emesso" i], [class*="registrata" i], [class*="inarrivo" i] {
    background: #7f8c8d !important;
    color: #fff !important;
}

[class*="annullato" i], [class*="stornato" i], [class*="insoluta" i], [class*="debito" i], [class*="annullata" i] {
    background: #e74c3c !important;
    color: #fff !important;
}

[class*="lavorato" i], [class*="evaso" i], [class*="evasa" i], [class*="saldata" i], [class*="credito" i], [class*="scontrinato" i], [class*="parzialmenteevaso" i] {
    background: #16a086 !important;
    color: #fff !important;
}
/* END COLORI STATO BADGE */
td.arrow-cell {
    padding: 0 !important;
}
td.icon {
    padding: 0 !important;
    text-align:center;
}

/*CARD COMBO*/
.panel-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.panel-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
}

.combo-tabs .nav-link {
    position: relative;
    padding: 0.75rem 1.5rem;
    border: none;
    color: #6c757d;
    font-weight: 500;
}

    .combo-tabs .nav-link.active {
        color: #0d6efd;
        background: transparent;
        border-bottom: 2px solid #0d6efd;
    }

.combo-tab-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close-tab {
    border: none;
    background: transparent;
    color: #6c757d;
    padding: 0;
    font-size: 0.75rem;
    line-height: 1;
}

    .btn-close-tab:hover {
        color: #dc3545;
    }

.table-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .table-card .card-body {
        flex-grow: 1;
    }

.combo-item:hover {
    background-color: #f8f9fa;
}

.form-floating label {
    color: #6c757d;
}

/*CARD All You Can Eat*/
.all-you-can-eat-card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
    padding: 1.25rem 1.5rem;
}

.ayce-tabs .nav-link {
    padding: 0.75rem 1.25rem;
    color: #6c757d;
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    transition: all 0.2s;
}

    .ayce-tabs .nav-link.active {
        color: #0d6efd;
        border-bottom-color: #0d6efd;
        background: transparent;
    }

.ayce-tab-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close-tab {
    border: none;
    background: transparent;
    color: #6c757d;
    padding: 0;
    font-size: 0.75rem;
    line-height: 1;
}

    .btn-close-tab:hover {
        color: #dc3545;
    }

.categories-card {
    border: 1px solid #e9ecef;
}

    .categories-card .card-header {
        background-color: white;
        border-bottom: 1px solid #e9ecef;
    }

.category-item:hover {
    background-color: #f8fafc;
}

.form-floating label {
    color: #6c757d;
}

.mdi {
    vertical-align: middle;
    font-size: 1.1em;
}

.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .global-loader .spinner {
        border: 5px solid #f3f3f3;
        border-top: 5px solid #3498db;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
#gritter-notice-wrapper {
    z-index: 99999 !important;
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    pointer-events: none; /* opzionale: evita click-block */
}
.riga-documento {
    background: lightgrey;
    padding: 5px 5px 10px 5px;
    text-transform: uppercase;
    font-weight: bold;
}
a.disabled {
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.65;
}
.color-lightseagreen {
    color: lightseagreen;
}

.border-color-lightseagreen {
    border-color: lightseagreen !important;
}
/* bordo e sfondo come vuoi tu */
.input-ls {
    background-color: #fff !important;
    border-color: lightseagreen !important;
}

    /* se in alcuni punti usi disabled, mantieni il bianco e testo leggibile */
    .input-ls:disabled,
    .input-ls[disabled] {
        background-color: #fff !important;
        opacity: 1 !important; /* evita l�effetto �sbiadito� */
    }
.riga-info {
    background: #ebeced;
    padding: 5px 5px 10px 5px;
    text-transform: uppercase;
    font-weight: bold;
    color:rgb(0,0,0);
}

/* Tag Input - Multi-select categorie */
.id-categorie-taginput {
    position: relative;
}
.taginput-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-height: 38px;
    cursor: text;
    padding: 4px 8px;
}
.taginput-tag {
    display: inline-flex;
    align-items: center;
    background-color: #e8f0fe;
    color: #1a73e8;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    white-space: nowrap;
}
.taginput-remove {
    margin-left: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
    opacity: 0.7;
}
.taginput-remove:hover {
    opacity: 1;
}
.taginput-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 80px;
    font-size: 13px;
    background: transparent;
}
.taginput-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.taginput-dropdown-item {
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
}
.taginput-dropdown-item:hover {
    background-color: #f0f4ff;
}

/* === FIX COLORI TABLE-* BOOTSTRAP PER MAC/SAFARI ===
   Il tema Hyper applica `.table>:not(caption)>*>* { background-color: var(--ct-table-bg) !important; }`
   che con !important sovrascrive i background delle celle a prescindere dal blend-mode Bootstrap.
   Per vincere dobbiamo (a) usare selettori con maggiore specificità e (b) ricalcare il pattern
   ">:not(caption)>*>*" ma aggiungendo la classe della cella (o la classe sulla riga). */
.table > :not(caption) > * > td.table-success,
.table > :not(caption) > * > th.table-success,
.table > :not(caption) > tr.table-success > td,
.table > :not(caption) > tr.table-success > th {
    background-color: #c7e6d5 !important;
    background-image: none !important;
    color: #0a3622 !important;
}
.table > :not(caption) > * > td.table-warning,
.table > :not(caption) > * > th.table-warning,
.table > :not(caption) > tr.table-warning > td,
.table > :not(caption) > tr.table-warning > th {
    background-color: #ffe8a6 !important;
    background-image: none !important;
    color: #664d03 !important;
}
.table > :not(caption) > * > td.table-danger,
.table > :not(caption) > * > th.table-danger,
.table > :not(caption) > tr.table-danger > td,
.table > :not(caption) > tr.table-danger > th {
    background-color: #f5c2c7 !important;
    background-image: none !important;
    color: #58151c !important;
}
.table > :not(caption) > * > td.table-info,
.table > :not(caption) > * > th.table-info,
.table > :not(caption) > tr.table-info > td,
.table > :not(caption) > tr.table-info > th {
    background-color: #b6effb !important;
    background-image: none !important;
    color: #055160 !important;
}
.table > :not(caption) > * > td.table-secondary,
.table > :not(caption) > * > th.table-secondary,
.table > :not(caption) > tr.table-secondary > td,
.table > :not(caption) > tr.table-secondary > th {
    background-color: #d3d6d8 !important;
    background-image: none !important;
    color: #41464b !important;
}
/* Striping sulle celle colorate: ne eliminiamo l'overlay che le scurirebbe */
.table-striped > tbody > tr > td.table-success,
.table-striped > tbody > tr > td.table-warning,
.table-striped > tbody > tr > td.table-danger,
.table-striped > tbody > tr > td.table-info,
.table-striped > tbody > tr > td.table-secondary {
    background-image: none !important;
}

/* Striping su righe colorate: rimuoviamo l'overlay scuro applicato dallo striping (Hyper + Bootstrap) */
.table-striped > tbody > tr.table-success > *,
.table-striped > tbody > tr.table-warning > *,
.table-striped > tbody > tr.table-danger > *,
.table-striped > tbody > tr.table-info > *,
.table-striped > tbody > tr.table-secondary > *,
.table-striped > tbody > tr.table-active > *,
.table-striped > tbody > tr:nth-of-type(odd).table-success > *,
.table-striped > tbody > tr:nth-of-type(odd).table-warning > *,
.table-striped > tbody > tr:nth-of-type(odd).table-danger > *,
.table-striped > tbody > tr:nth-of-type(odd).table-info > *,
.table-striped > tbody > tr:nth-of-type(odd).table-secondary > *,
.table-striped > tbody > tr:nth-of-type(odd).table-active > * {
    --ct-table-bg-type: transparent !important;
    --ct-table-color-type: inherit !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-bg-type: transparent !important;
    background-image: none !important;
}

/* Riga selezionata: forziamo il colore evidenziato anche sulle righe dispari */
.table-striped > tbody > tr.table-info > td,
.table-striped > tbody > tr.table-info > th,
.table-striped > tbody > tr:nth-of-type(odd).table-info > td,
.table-striped > tbody > tr:nth-of-type(odd).table-info > th {
    background-color: #b6effb !important;
    color: #055160 !important;
}

/* Flyout AYCE: larghezza pageslide */
.ayce-flyout .pageslider-content {
    width: 640px;
    max-width: 100vw;
}

/* Flyout AYCE: righe checkbox+inputs */
.ayce-flyout .ayce-row {
    transition: background-color 0.15s ease, border-color 0.15s ease;
    border: 1px solid transparent;
}

.ayce-flyout .ayce-row:hover {
    background-color: #f8f9fa;
}

.ayce-flyout .ayce-row-active {
    background-color: #e7f5ee;
    border-color: #b6e3c8;
}

.ayce-flyout .ayce-row-active:hover {
    background-color: #d8eddf;
}

/* Colonne quantita / tipo limite: larghezze fisse da tablet in su */
.ayce-flyout .ayce-col-qta,
.ayce-flyout .ayce-col-tipo {
    margin-left: 0.5rem;
}

.ayce-flyout .ayce-col-qta {
    width: 110px;
}

.ayce-flyout .ayce-col-tipo {
    width: 140px;
}

/* Mobile: pageslide a tutto schermo + inputs su seconda riga */
@media (max-width: 575.98px) {
    .ayce-flyout .pageslider-content {
        width: 100vw !important;
    }

    .ayce-flyout .ayce-row {
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }

    /* Il label deve occupare tutto lo spazio rimanente nella prima riga,
       così i due input vanno sotto su una seconda riga */
    .ayce-flyout .ayce-row > label {
        flex: 1 1 calc(100% - 40px);
        min-width: 0;
    }

    .ayce-flyout .ayce-col-qta,
    .ayce-flyout .ayce-col-tipo {
        width: auto;
        flex: 1 1 0;
        margin-left: 0;
    }

    .ayce-flyout .ayce-col-qta {
        margin-right: 0.25rem;
    }

    .ayce-flyout .ayce-col-tipo {
        margin-left: 0.25rem;
    }

    /* Search nel header sticky un po' più compatto */
    .ayce-flyout .pageslider-head {
        padding: 0.75rem 1rem;
    }
}
/* ==========================================================================
   SCHEDA PRODOTTO (/statistiche/analisi → tipo "Scheda prodotto")
   Palette tenue: verde smorzato in entrata, ambra in uscita, rosso desaturato
   sulle righe eliminate. Le sotto-righe restano leggibili anche in stampa B/N.
   ========================================================================== */

.scheda-movimenti > tbody > tr > td {
    vertical-align: middle;
}

/* Il tema Hyper colora le righe via --ct-table-bg-type: va neutralizzato,
   altrimenti sovrascrive i nostri sfondi (stessa trappola delle striped). */
.scheda-movimenti > tbody.scheda-in > tr > td,
.scheda-movimenti > tbody.scheda-out > tr > td,
.scheda-movimenti > tbody.scheda-eliminata > tr > td {
    --bs-table-accent-bg: transparent;
    --ct-table-bg-type: transparent;
}

/* ⚠️ Il tema Hyper impone `.table>:not(caption)>*>* { background-color: var(--ct-table-bg)
   !important }` con --ct-table-bg: transparent: un background-color senza !important su una
   cella NON si vede, per quanto specifico sia il selettore (!important batte la specificità).
   Invece di rincorrerlo con altri !important si valorizza la variabile che il tema stesso
   legge: --ct-table-bg per Hyper, --bs-table-bg per il Bootstrap "nudo" del layout di
   default. Il background-color resta come fallback per chi non usa nessuna delle due. */
.scheda-movimenti > tbody.scheda-in > tr:first-child > td {
    --ct-table-bg: #f2f8f6;
    --bs-table-bg: #f2f8f6;
    background-color: #f2f8f6;
}

.scheda-movimenti > tbody.scheda-out > tr:first-child > td {
    --ct-table-bg: #fdf8f0;
    --bs-table-bg: #fdf8f0;
    background-color: #fdf8f0;
}

.scheda-movimenti > tbody.scheda-eliminata > tr:first-child > td {
    --ct-table-bg: #fbf3f4;
    --bs-table-bg: #fbf3f4;
    background-color: #fbf3f4;
    color: #9a8285;
}

.scheda-barrato {
    text-decoration: line-through;
    opacity: 0.65;
}

.scheda-badge-in {
    background-color: #d9ebe5;
    color: #2f6b5c;
}

.scheda-badge-out {
    background-color: #f7e6cd;
    color: #8a5f22;
}

.scheda-badge-eliminata {
    background-color: #f0d8da;
    color: #97444c;
}

/* Sotto-riga con le personalizzazioni: rientrata, più piccola, sfondo appena
   accennato per legarla visivamente alla riga che la precede. */
.scheda-movimenti > tbody > tr.scheda-dettaglio > td {
    --ct-table-bg: #fafafa;
    --bs-table-bg: #fafafa;
    background-color: #fafafa;
    padding-top: 0.2rem;
    padding-bottom: 0.35rem;
    padding-left: 2.25rem;
    font-size: 0.8125rem;
    border-top: 0;
}

.scheda-freccia {
    color: #b4b4b4;
    margin-right: 0.35rem;
}

.scheda-badge-opzione {
    background-color: #e6eef5;
    color: #3d6183;
    font-weight: 500;
}

.scheda-badge-aggiunto {
    background-color: #e2f0e8;
    color: #35704f;
    font-weight: 500;
}

.scheda-badge-rimosso {
    background-color: #f6e7e7;
    color: #8f4a4a;
    font-weight: 500;
}

.scheda-badge-variante {
    background-color: #efeaf5;
    color: #5f4c7a;
    font-weight: 500;
}

.scheda-testata {
    background-color: #fbfbfc;
}

/* Riga e relativa sotto-riga non devono mai finire su pagine diverse. */
@media print {
    .scheda-movimenti > tbody {
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   BARRA FILTRI COMPATTA (/statistiche/analisi)
   Recupera altezza stringendo label e gutter, senza toccare i controlli:
   restano cliccabili e leggibili come nel resto dell'app.
   ========================================================================== */

/* Etichette su UNA riga sempre: se una va a capo, il campo sotto parte più in basso e
   sfalsa l'intera riga di filtri. Ellissi invece di wrap, con title per il testo intero. */
.filtri-compatti .control-label {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.75rem;
    line-height: 1.1;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filtri-compatti .form-group {
    margin-bottom: 0;
}

/* Il pulsante del dropdown "Tipi documento acquisto" deve essere indistinguibile da un
   <select class="form-control">: stesso box model, stessa altezza.
   NIENTE display:flex — trasformerebbe testo e caret in flex item e cambierebbe l'altezza
   calcolata rispetto agli altri campi della riga. Il caret si posiziona in assoluto. */
.filtri-compatti .dropdown > .form-control.dropdown-toggle {
    position: relative;
    padding-right: 2rem;
    background-color: #fff;
    text-align: left;
    cursor: pointer;
}

.filtri-compatti .dropdown > .form-control.dropdown-toggle::after {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
}

.filtri-compatti .dropdown-menu .form-check {
    margin-bottom: 0.15rem;
}

/* Preset periodo: sette pulsanti in cinque colonne, senza andare a capo. */
.filtri-compatti .btn-group-sm > .btn {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
    white-space: nowrap;
}

/* Personalizzazioni della Scheda prodotto: la card è alta ESATTAMENTE come quella del
   grafico che le sta a fianco (row + card h-100 nel template) e la lista scorre dentro.
   Il corpo è una colonna flex: titolo e nota a piede restano fissi, l'area scrollabile
   occupa tutto lo spazio che avanza. */
.scheda-pers-card > .card-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.scheda-pers-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
}

/* flex-basis 0 (non auto) è il punto chiave: l'altezza del contenuto NON entra nel calcolo
   dell'altezza naturale della card, altrimenti una lista di trenta voci allungherebbe la
   riga e trascinerebbe con sé anche la card del grafico. Il min-height evita che l'area si
   riduca a una fessura quando la card è bassa. */
.scheda-pers-scroll {
    flex: 1 1 0;
    min-height: 90px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.2rem;
}

.scheda-pers-scroll > table {
    margin-bottom: 0;
}

/* ⚠️ Intestazione ancorata: serve uno sfondo OPACO, altrimenti il testo delle righe che le
   scorrono sotto si legge in trasparenza attraverso l'header. Il tema Hyper forza
   `background-color: var(--ct-table-bg) !important` (= transparent) su ogni cella, quindi il
   colore va passato dalla variabile che il tema legge — vedi il blocco "SCHEDA PRODOTTO". */
.scheda-pers-scroll > table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 2;
    --ct-table-bg: #f6f7f9;
    --bs-table-bg: #f6f7f9;
    background-color: #f6f7f9;
    /* La tabella è bordered: senza questo il bordo superiore scorre via con le righe. */
    box-shadow: inset 0 -1px 0 var(--bs-border-color, #dee2e6);
}

/* Il bordo del contenitore sostituisce quello esterno della tabella: niente doppia linea. */
.scheda-pers-scroll > table > tbody > tr > td:first-child,
.scheda-pers-scroll > table > thead > tr > th:first-child {
    border-left: 0;
}

.scheda-pers-scroll > table > tbody > tr > td:last-child,
.scheda-pers-scroll > table > thead > tr > th:last-child {
    border-right: 0;
}

/* In stampa il contenuto non va troncato: la stampa costruisce comunque il proprio HTML,
   ma se qualcuno stampa la pagina a video deve vedere tutte le voci.
   flex: 0 0 auto è obbligatorio: con flex-basis 0 l'area stampata sarebbe alta zero. */
@media print {
    .scheda-pers-scroll {
        flex: 0 0 auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
        border: 0;
    }
}

/* Permessi operatore: selettore segmentato a 4 vie (RUOLO/NO/PIN/SI).
   Colori semantici come in cassa: rosso = negato, ambra = con PIN amministratore,
   verde = consentito, grigio scuro = eredita (non impostato). */
.perm-seg {
    display: inline-flex;
    border: 1px solid #d8dee3;
    border-radius: 999px;
    overflow: hidden;
    vertical-align: middle;
}

.perm-seg button {
    border: 0;
    background: #fff;
    color: #7C9196;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 0;
    width: 52px;
    cursor: pointer;
    border-left: 1px solid #d8dee3;
    line-height: 1.2;
}

.perm-seg button:first-child {
    border-left: 0;
}

.perm-seg button.on.seg-ruolo { background: #5a6b73; color: #fff; }
.perm-seg button.on.seg-no    { background: #C62828; color: #fff; }
.perm-seg button.on.seg-pin   { background: #E65100; color: #fff; }
.perm-seg button.on.seg-si    { background: #2E7D32; color: #fff; }

.perm-riga {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
}

.perm-riga .perm-nome {
    font-size: 13.5px;
    flex: 1;
}

.perm-matrice td {
    vertical-align: middle;
}

.perm-legenda {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 10px;
    font-size: 11.5px;
    color: #6c757d;
}

.perm-legenda i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 4px;
}

/* ==================== ASSISTENTE AI ==================== */

.assistente-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 220px);
    min-height: 420px;
}

.assistente-messaggi {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 4px;
}

.assistente-benvenuto {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.assistente-riga {
    display: flex;
    margin-bottom: 12px;
}

.assistente-riga-utente {
    justify-content: flex-end;
}

.assistente-bolla {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    background-color: #f1f3f5;
    border: 1px solid #e2e6ea;
}

.assistente-bolla-utente {
    background-color: #d7ecff;
    border-color: #bcdfff;
}

.assistente-bolla-errore {
    background-color: #fdecea;
    border-color: #f5c6cb;
}

.assistente-testo {
    white-space: pre-wrap;
    word-break: break-word;
}

.assistente-kpi {
    margin-top: 8px;
}

.assistente-tabella {
    margin-top: 8px;
    max-height: 320px;
    overflow-y: auto;
    background-color: #fff;
}

.assistente-meta {
    margin-top: 6px;
    font-size: 11px;
}

.assistente-input {
    margin-top: 10px;
}

@media print {
    .assistente-card {
        height: auto;
    }
}

.assistente-voto a {
    color: #adb5bd;
    margin-right: 6px;
    text-decoration: none;
    font-size: 13px;
}

.assistente-voto a:hover {
    color: #495057;
}

.assistente-grafico {
    margin-top: 8px;
    background-color: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    padding: 8px;
}

/* Elenco vendite dell'assistente: un blocco per vendita (testata + righe) */
.assistente-vendite {
    margin-top: 8px;
    max-height: 420px;
    overflow-y: auto;
}

.assistente-vendita {
    background-color: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.assistente-vendita-testata {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e2e6ea;
    font-size: 12px;
}

.assistente-vendita-righe td {
    padding: 3px 10px;
    font-size: 12px;
}

.assistente-vendita-qta {
    width: 52px;
    white-space: nowrap;
    color: #6c757d;
}

.assistente-vendita-importo {
    width: 90px;
    white-space: nowrap;
}
