@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;400;600&display=swap');

* {
    font-weight: 500 !important;
    font-family: 'Inter', sans-serif !important;
}

body {
    color: #2D2D2F;
    font-size: .875rem;
    background-color: #f7f7f7;
    font-family: 'Inter', sans-serif !important;
}

.main_signin {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#signin_content {
    background-color: white;
    padding: 20px;
}

.normallink {
    color: var(--piq-orange);
    text-decoration: underline;
}

.main_logo_image {
    width: 100%;
}

.normallink:hover {
    color: #2D2D2F;
}

.feather {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

td .feather {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    cursor: pointer;
}

/* Table action icons – pure-CSS tooltip (no JS, no Popper, no overflow) */
.piq-table-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 3px;
    line-height: 0;
    vertical-align: middle;
}
.piq-table-tip::before,
.piq-table-tip::after {
    display: none;
    pointer-events: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
}
.piq-table-tip::before {
    content: '';
    bottom: calc(100% + 2px);
    border: 6px solid transparent;
    border-top-color: #212529;
}
.piq-table-tip::after {
    content: attr(data-tip);
    bottom: calc(100% + 8px);
    padding: 5px 10px;
    background: #212529;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.piq-table-tip:hover::before,
.piq-table-tip:hover::after,
.piq-table-tip:focus-within::before,
.piq-table-tip:focus-within::after {
    display: block;
}
.table td .piq-table-tip .feather {
    vertical-align: middle;
}
/* Compact action columns */
.table td:has(.piq-table-tip) {
    white-space: nowrap;
}
.table td:has(.piq-table-tip) a {
    display: inline-block;
    margin: 0;
    padding: 0;
    line-height: 0;
    vertical-align: middle;
}

.page-item.active .page-link{
    color:#2D2D2F;
    background-color:#dee2e6;
    border-color:#dee2e6;
}

.page-link {
    color: #2D2D2F;
    border: 1px solid #dee2e6;
}

.button_large {
    width: 100%;
}

.page-link:hover {
    color:#2D2D2F;
    background-color:#dee2e6;
    border: 1px solid #dee2e6;
}

.btn-toolbar button, select {
    margin-right: 5px;
}

@supports ((position: -webkit-sticky) or (position: sticky)) {
    .sidebar-sticky {
        position: -webkit-sticky;
        position: sticky;
    }
}

.nav-link {
    font-weight: 500;
    font-size: 1rem;
    color: #282723;
    margin-left: 15px;
    text-transform: capitalize;
}

.nav-link .feather {
    margin-right: 4px;
    color: #282723;
}

.nav-link.active {
    color: #FFFFFF;
}

/*.nav-link:hover,
.nav-link:hover .feather,
.nav-link.active .feather {
    color: #FFFFFF;
}*/

/*
 * Content
 */

[role="main"] {
    padding-top: 133px; /* Space for fixed navbar */
    /*height: 500px;*/
}

@media (min-width: 768px) {
    [role="main"] {
        padding-top: 8px; /* Space for fixed navbar */
    }
}

/*
 * Navbar
 */

.navbar-brand {
    padding-top: .75rem;
    padding-bottom: .75rem;
    padding-left: 20px;
    padding-right: 20px;
    font-size: 1rem;
    background-color: #FFFFFF;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25);
}

.navbar .form-control {
    padding: .75rem 1rem;
    border-width: 0;
    border-radius: 0;
}

.form-control-dark {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .1);
}

.form-control-dark:focus {
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .25);
}

/* Rende i placeholder più tenui in tutti i browser */
.form-control::placeholder {
    color: #ced4da; /* Un grigio molto chiaro */
    opacity: 0.8;
}

/* Specifico per Internet Explorer/Edge vecchio */
.form-control:-ms-input-placeholder {
    color: #ced4da;
}

/* Specifico per Edge nuovo */
.form-control::-ms-input-placeholder {
    color: #ced4da;
}

.bd-placeholder-img {
    font-size: 1.125rem;
    text-anchor: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

@media (min-width: 768px) {
    .bd-placeholder-img-lg {
        font-size: 3.5rem;
    }
}

.piqapart_logo {
    height: 25px;
}

.bg-piqapart {
    background-color: #FF9B00;
}

.bg-login_pane {
    background-color: #FFFFFF !important;

}

.bg-login_pane a {
    color: #2D2D2F;
}

.scan_image {
    max-width: 100%;
    height: auto;
    max-height: 300px;
}

#piqapart_camera {
    background-color: #f8f9fa;
    width: 800px;
    height: 600px;
    border: 1px solid transparent;
    border-radius: .25rem;


    float: left;
    display: none;
}

#piqapart_camera_show {
    background-color: #f8f9fa;
    width: 800px;
    height: 600px;
    border: 1px solid transparent;
    border-radius: .25rem;


    float: left;
}

#piqapart_canvas {
    display: none;

}

#piqapart_result {
    width: calc(100% - 815px);
    height: 600px;
    background-color: #f8f9fa;
    border: 1px solid transparent;
    border-radius: .25rem;



    float: left;
    margin-left: 10px;
    padding: 20px;
}

#piqaparter_item {
    margin: auto;
    width: 400px;
    height: 93px;
    position: relative;
    background-repeat: no-repeat;
    background-size: cover;
}

#piqaparter_item input {
    position: absolute;
    width: 200px;
    text-align: center;
    background: transparent;
    color: white;
    border: 0px;
    left: 100px;
    top: 8px;
    font-weight: 900 !important;
    font-size: 50px;
}

#piqaparter_item p {
    position: absolute;
    width: 200px;
    text-align: center;
    background: transparent;
    color: white;
    border: 0px;
    left: 100px;
    top: 15px;
    font-weight: 900 !important;
    font-size: 50px;
}

#videoSource {
    display: none;
}

#save_settings {
    display: none;
}

#close_settings {
    display: none;
}

.role_alert_button {
    margin-left: 35px;
}

#welcome_page {
    text-align: center;
}

#welcome_minifigs {
    margin-top: 150px;
    width: 350px;
}

#welcome_title {
    padding-top: 50px;
    padding-bottom: 50px;
}

.footer {
    background: #f6f8fa;
    border-top: 1px solid #e3e8ee;
    padding: 8px 16px;
    color: #697386;
    font-size: .75rem;
    min-height: 35px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 4px;
    margin-top: auto;
    width: 100%;
    box-sizing: border-box;
}
.footer a {
    color: #697386;
    text-decoration: none;
}
.footer a:hover {
    color: #1a1f36;
    text-decoration: underline;
}
.footer .footer-legal a {
    color: #697386;
}
.footer .footer-legal a:hover {
    color: #1a1f36;
}

#footer_info {
    margin-top: 100px;
}

#loginpan {
    color: #2D2D2F;
    padding: 65px;
}

.login_logo {
    height: 50px;
    margin-right: 38px;
}

.terms_image {
    position: absolute;
    top: 15px;
    right: 15px;
    height: 50px;
}

.terms_text {
    font-size: 1.2vw;
}

.terms_footer_image {
    position:fixed;
    right:0;
    bottom:0;
    margin:0;
    padding:0;
}

.display_image {
    width:100%;
}

.display_image_container {
    position: relative;
    top: 0px;
    left: 0px;
    float: left;
    margin: 1px;
}

.display_image_small {
    position: relative;
    top: 0;
    left: 0;
    height: 100px;
    cursor:zoom-in;
    cursor:-webkit-zoom-in;
    cursor:-moz-zoom-in;
}

.remove_image {
    position: absolute;
    top: 3px;
    right: 3px;
    /*color: #ff0000;*/
    cursor: pointer;
    z-index: 99;
}

#piqapart_result_images {
    width: 100%;
    float: left;
}

#piqapart_result_images img {
    max-height: 150px;
    float: left;
    margin: 1px;
}

.item_warning {
    color: #dc3545 !important;
}

.item_ok {
    color: #28a745 !important;
}

.custom-control {
    &.material-checkbox {
        --color: #26a69a;

        .material-control-input{
            display: none;
            &:checked~.material-control-indicator{
                border-color: var(--color);
                transform: rotateZ(45deg) translate(1px, -5px);
                width: 10px;
                border-top: 0px solid #FFFFFF;
                border-left: 0px solid #FFFFFF;
            }
        }
        .material-control-indicator{
            display: inline-block;
            position: absolute;
            top: 4px;
            left: 0;
            width: 16px;
            height: 16px;
            border: 2px solid #aaa;
            transition: .3s;
        }
    }

    &.fill-checkbox{
        --color: #26a69a;

        .fill-control-input{
            display: none;
            &:checked~.fill-control-indicator{
                background-color: var(--color);
                border-color: var(--color);
                background-size: 80%;
            }
        }
        .fill-control-indicator{
            border-radius: 3px;
            display: inline-block;
            position: absolute;
            top: 4px;
            left: 0;
            width: 16px;
            height: 16px;
            border: 2px solid #aaa;
            transition: .3s;
            background: transperent;
            background-size: 0%;
            background-position: center;
            background-repeat: no-repeat;
            background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E");
        }
    }

    &.overflow-checkbox{
        .overflow-control-input{
            display: none;

            &:checked~.overflow-control-indicator{
                &::after{
                    transform: rotateZ(45deg) scale(1);
                    top: -6px;
                    left: 5px;
                }

                &::before{
                    opacity: 1;
                }
            }
        }
        .overflow-control-indicator{
            border-radius: 3px;
            display: inline-block;
            position: absolute;
            top: 4px;
            left: 0;
            width: 16px;
            height: 16px;
            border: 2px solid #aaa;

            &::after{
                content: '';
                display: block;
                position: absolute;
                width: 16px;
                height: 16px;
                transition: .3s;
                transform: rotateZ(90deg) scale(0);
                width: 10px;
                border-bottom: 4px solid #aaa;
                border-right: 4px solid #aaa;
                border-radius: 3px;
                top: -2px;
                left: 2px;
            }

            &::before{
                content: '';
                display: block;
                position: absolute;
                width: 16px;
                height: 16px;
                transition: .3s;
                width: 10px;
                border-right: 7px solid #FFFFFF;
                border-radius: 3px;
                transform: rotateZ(45deg) scale(1);
                top: -4px;
                left: 5px;
                opacity: 0;
            }
        }
    }

    &.material-switch{
        --color: #26a69a;
        padding-left: 0;

        .material-switch-control-input{
            display: none;
            &:checked~.material-switch-control-indicator{

                &::after{
                    background-color: var(--color);
                    left: 17px;
                }
            }
        }
        .material-switch-control-indicator{
            display: inline-block;
            position: relative;
            margin: 0 10px;
            top: 4px;
            width: 32px;
            height: 16px;
            background: #ddd;
            border-radius: 16px;
            transition: .3s;

            &::after{
                content: '';
                display: block;
                position: absolute;
                width: 18px;
                height: 18px;
                border-radius: 50%;
                transition: .3s;
                top: -1px;
                left: -1px;
                background: #fdfdfd;
                box-shadow: 0 2px 10px #aaa;
            }
        }
    }

    &.ios-switch{
        --color: #4cd964;
        padding-left: 0;

        .ios-switch-control-input{
            display: none;

            &:active~.ios-switch-control-indicator{
                &::after{
                    width: 20px;
                }
            }

            &:checked{
                ~.ios-switch-control-indicator{
                    border: 10px solid var(--color);

                    &::after{
                        top: -8px;
                        left: 4px;
                    }
                }

                &:active~.ios-switch-control-indicator{
                    &::after{
                        left: 0px;
                    }
                }
            }
        }
        .ios-switch-control-indicator{
            display: inline-block;
            position: relative;
            margin: 0 10px;
            top: 4px;
            width: 32px;
            height: 20px;
            background: #FFFFFF;
            border-radius: 16px;
            transition: .3s;
            border: 2px solid #ddd;

            &::after{
                content: '';
                display: block;
                position: absolute;
                width: 16px;
                height: 16px;
                border-radius: 16px;
                transition: .3s;
                top: 0px;
                left: 0px;
                background: #FFFFFF;
                box-shadow: 0 0 2px #aaa, 0 2px 5px #999;
            }
        }
    }

    &.border-switch{
        --color: #4cd964;
        padding-left: 0;

        .border-switch-control-input{
            display: none;
            &:checked~.border-switch-control-indicator{
                border-color: var(--color);

                &::after{
                    left: 14px;
                    background-color: var(--color);
                }
            }
        }
        .border-switch-control-indicator{
            display: inline-block;
            position: relative;
            margin: 0 10px;
            top: 4px;
            width: 32px;
            height: 20px;
            background: #FFFFFF;
            border-radius: 16px;
            transition: .3s;
            border: 2px solid #ccc;

            &::after{
                content: '';
                display: block;
                position: absolute;
                width: 12px;
                height: 12px;
                border-radius: 50%;
                transition: .3s;
                top: 2px;
                left: 2px;
                background: #ccc;
            }
        }
    }

    &.teleport-switch{
        --color: #4cd964;
        padding-left: 0;

        .teleport-switch-control-input{
            display: none;
            &:checked~.teleport-switch-control-indicator{
                border-color: var(--color);

                &::after{
                    left: -14px;
                }

                &::before{
                    right: 2px;
                    background-color: var(--color);
                }
            }
        }
        .teleport-switch-control-indicator{
            display: inline-block;
            position: relative;
            margin: 0 10px;
            top: 4px;
            width: 32px;
            height: 20px;
            background: #FFFFFF;
            border-radius: 16px;
            transition: .3s;
            border: 2px solid #ccc;
            overflow: hidden;

            &::after{
                content: '';
                display: block;
                position: absolute;
                width: 12px;
                height: 12px;
                border-radius: 50%;
                transition: .3s;
                top: 2px;
                left: 2px;
                background: #ccc;
            }

            &::before{
                content: '';
                display: block;
                position: absolute;
                width: 12px;
                height: 12px;
                border-radius: 50%;
                transition: .3s;
                top: 2px;
                right: -14px;
                background: #ccc;
            }
        }
    }
}

.list-group{
    &:first-child .list-group-control:first-child {
        border-top-left-radius: .25rem;
        border-top-right-radius: .25rem;
    }

    &::last-child .list-group-control:last-child {
        border-bottom-left-radius: .25rem;
        border-bottom-right-radius: .25rem;
    }

    &.list-group-flush{
        &:last-child{
            .list-group-control:last-child {
                border-bottom: 0;
                margin-bottom: 0;
            }
        }

        &:first-child{
            .list-group-control:first-child {
                border-top: 0;
            }
        }

        .list-group-control {
            border-right: 0;
            border-left: 0;
            border-radius: 0;
        }
    }

    .list-group-control{
        position: relative;
        display: block;
        margin-bottom: -1px;
        background-color: #FFFFFF;
        border: 1px solid rgba(0,0,0,.125);

        .custom-control{
            margin: 0;
            padding: .75rem 1.25rem;
            padding-left: 3rem;
            display: block;

            .custom-control-indicator, .material-control-indicator, .fill-control-indicator, .overflow-control-indicator{
                top: 1rem;
                left: 1.25rem;
            }
        }
    }
}

.feather_big_ng {
    width: 100px;
    height: 100px;
    color: #dc3545;
}

.feather_big_ok {
    width: 100px;
    height: 100px;
    color: #28a745;
}

.feather_big_ko {
    width: 100px;
    height: 100px;
    color: #ffd800;
}

.feather_big {
    width: 100px;
    height: 100px;
}

.text_center {
    text-align: center;
    margin-top: 35px;
}

#plotter_log {
    margin-top: 35px;
    background-color: #ebebeb;
    height: 100%;
    overflow: scroll;
}

.log_warning {
    color: #856404;
    background-color: #ffeeba;
}

.log_stop {
    color: #721c24;
    background-color: #f8d7da;
}

.log_ok {
    color: #155724;
    background-color: #d4edda;
}

#grabbed_image {
    height: 512px;
}

.cover_image {
    height: 100px;
    max-height: 100px;
}

#welcome_logo_piqapart {
    width: 200px;
}

.dataTables_wrapper {
    background-color: #ffffff;
    padding: 5px;
}

/* Compact DataTables: meno padding verticale nelle celle */
table.dataTable thead th,
table.dataTable thead td {
    padding: 6px 10px !important;
    font-size: .8rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    background-color: #ffd89e !important;
    color: #1a1f36 !important;
    border-bottom: 2px solid #ff9b00 !important;
}
table.dataTable tbody td,
table.dataTable tbody th {
    padding: 5px 10px !important;
    font-size: .8125rem !important;
    line-height: 1.4 !important;
    vertical-align: middle !important;
}
table.dataTable tfoot th,
table.dataTable tfoot td {
    padding: 5px 10px !important;
    font-size: .8rem !important;
    line-height: 1.4 !important;
}
/* Filtri di colonna (input nella thead) */
table.dataTable thead tr:last-child th input,
table.dataTable thead tr:last-child td input {
    padding: 3px 6px !important;
    font-size: .75rem !important;
    height: auto !important;
}

/* Input filtro nelle colonne DataTables */
.table_filter {
    display: block !important;
    width: 100% !important;
    margin-top: 4px !important;
    padding: 3px 8px !important;
    font-size: .72rem !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    height: auto !important;
    color: #1a1f36 !important;
    background-color: #fff !important;
    border: 1px solid #d8dee4 !important;
    border-radius: 4px !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.06) !important;
    transition: border-color .15s ease, box-shadow .15s ease !important;
}
.table_filter:focus {
    border-color: #ff9b00 !important;
    box-shadow: 0 0 0 2px rgba(255,155,0,.2) !important;
    outline: none !important;
}
.table_filter::placeholder {
    color: #a0aec0 !important;
    font-style: italic;
}

/* Evita che le frecce di ordinamento DataTables vadano sopra l'input */
table.dataTable thead th {
    position: relative !important;
    padding-right: 22px !important;
    vertical-align: top !important;
}
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
    background-position: right 6px top 8px !important;
    background-size: 12px !important;
}

th {
    background-color: #ffd89e;
    color: #1a1f36;
    font-weight: 600 !important;
    text-align: center;
    border-bottom: 2px solid #ff9b00 !important;
}

/* ─── Product-colored table headers (applied via body.prod-*) ─── */
body.prod-count table.dataTable thead th,
body.prod-count table.dataTable thead td,
body.prod-count #page-content th {
    background-color: #e0ecfb !important;
    color: #002d7a !important;
    border-bottom: 2px solid #0055DE !important;
}
body.prod-count #page-content .table_filter {
    background-color: #f0f5fd !important;
    border-color: #a6c8f7 !important;
    color: #002d7a !important;
}
body.prod-count #page-content .table_filter::placeholder {
    color: #4d7ec2 !important;
}
body.prod-count #page-content .table_filter:focus {
    background-color: #ffffff !important;
    border-color: #0055DE !important;
    box-shadow: 0 0 0 2px rgba(0, 85, 222, .2) !important;
}

body.prod-quality table.dataTable thead th,
body.prod-quality table.dataTable thead td,
body.prod-quality #page-content th {
    background-color: #ede0fc !important;
    color: #3a0f75 !important;
    border-bottom: 2px solid #7A2CF5 !important;
}
body.prod-quality #page-content .table_filter {
    background-color: #f7f1fe !important;
    border-color: #c9a8f5 !important;
    color: #3a0f75 !important;
}
body.prod-quality #page-content .table_filter::placeholder {
    color: #7d5cb8 !important;
}
body.prod-quality #page-content .table_filter:focus {
    background-color: #ffffff !important;
    border-color: #7A2CF5 !important;
    box-shadow: 0 0 0 2px rgba(122, 44, 245, .2) !important;
}

body.prod-assembly table.dataTable thead th,
body.prod-assembly table.dataTable thead td,
body.prod-assembly #page-content th {
    background-color: #ffe4cc !important;
    color: #5c2400 !important;
    border-bottom: 2px solid #FF6B00 !important;
}
body.prod-assembly #page-content .table_filter {
    background-color: #fff4ea !important;
    border-color: #f5b880 !important;
    color: #5c2400 !important;
}
body.prod-assembly #page-content .table_filter::placeholder {
    color: #b86420 !important;
}
body.prod-assembly #page-content .table_filter:focus {
    background-color: #ffffff !important;
    border-color: #FF6B00 !important;
    box-shadow: 0 0 0 2px rgba(255, 107, 0, .2) !important;
}

body.prod-documentation table.dataTable thead th,
body.prod-documentation table.dataTable thead td,
body.prod-documentation #page-content th {
    background-color: #d4f1f5 !important;
    color: #004d57 !important;
    border-bottom: 2px solid #00A4B8 !important;
}
body.prod-documentation #page-content .table_filter {
    background-color: #eef9fa !important;
    border-color: #8fd8e2 !important;
    color: #004d57 !important;
}
body.prod-documentation #page-content .table_filter::placeholder {
    color: #4d8f99 !important;
}
body.prod-documentation #page-content .table_filter:focus {
    background-color: #ffffff !important;
    border-color: #00A4B8 !important;
    box-shadow: 0 0 0 2px rgba(0, 164, 184, .2) !important;
}

/* ─── Editor pages: visual identity based on product ─── */
body.piq-editor::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 10000;
    background: #d8dee4;
    pointer-events: none;
}
body.piq-editor.prod-count::before      { background: #0055DE; }
body.piq-editor.prod-quality::before    { background: #7A2CF5; }
body.piq-editor.prod-assembly::before   { background: #FF6B00; }
body.piq-editor.prod-documentation::before { background: #00A4B8; }

/* Top info bar with doc/assembly code */
.editor-topbar {
    background: #f6f9fc;
    border-bottom: 1px solid #e3e8ee;
}
body.piq-editor.prod-count .editor-topbar {
    background: #f0f5fd !important;
    border-bottom-color: rgba(0, 85, 222, .28) !important;
    box-shadow: inset 3px 0 0 #0055DE;
}
body.piq-editor.prod-assembly .editor-topbar {
    background: #fff5ec !important;
    border-bottom-color: rgba(255, 107, 0, .28) !important;
    box-shadow: inset 3px 0 0 #FF6B00;
}
body.piq-editor.prod-documentation .editor-topbar {
    background: #eef9fa !important;
    border-bottom-color: rgba(0, 164, 184, .28) !important;
    box-shadow: inset 3px 0 0 #00A4B8;
}

/* Editor exit button (Esci dall'editor) */
.editor-exit-btn {
    color: #fff !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 6px !important;
    margin: 6px 8px !important;
    padding: 9px 14px !important;
    font-size: .82rem !important;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background .15s, box-shadow .15s;
}
.editor-exit-btn svg,
.editor-exit-btn i { color: #fff !important; }

body.prod-count .editor-exit-btn {
    background: linear-gradient(180deg, #2272f0 0%, #0055DE 100%) !important;
    box-shadow: 0 2px 6px rgba(0, 85, 222, .3) !important;
}
body.prod-count .editor-exit-btn:hover {
    background: linear-gradient(180deg, #4088f4 0%, #0055DE 100%) !important;
    box-shadow: 0 3px 10px rgba(0, 85, 222, .45) !important;
    color: #fff !important;
}
body.prod-assembly .editor-exit-btn {
    background: linear-gradient(180deg, #FF8533 0%, #FF6B00 100%) !important;
    box-shadow: 0 2px 6px rgba(255, 107, 0, .3) !important;
}
body.prod-assembly .editor-exit-btn:hover {
    background: linear-gradient(180deg, #FF9B57 0%, #FF6B00 100%) !important;
    box-shadow: 0 3px 10px rgba(255, 107, 0, .45) !important;
    color: #fff !important;
}
body.prod-documentation .editor-exit-btn {
    background: linear-gradient(180deg, #1abace 0%, #00A4B8 100%) !important;
    box-shadow: 0 2px 6px rgba(0, 164, 184, .3) !important;
}
body.prod-documentation .editor-exit-btn:hover {
    background: linear-gradient(180deg, #33cde0 0%, #00A4B8 100%) !important;
    box-shadow: 0 3px 10px rgba(0, 164, 184, .45) !important;
    color: #fff !important;
}

/* Section titles within editor content (header_cell_title) */
body.piq-editor.prod-count .header_cell_title,
body.piq-editor.prod-count .tech_content_header .header_cell_title { color: #002d7a !important; }
body.piq-editor.prod-assembly .header_cell_title,
body.piq-editor.prod-assembly .tech_content_header .header_cell_title { color: #5c2400 !important; }
body.piq-editor.prod-documentation .header_cell_title,
body.piq-editor.prod-documentation .tech_content_header .header_cell_title { color: #004d57 !important; }

/* Sidebar brand accent for editor */
body.piq-editor.prod-count #sidebar .sidebar-brand { border-bottom: 2px solid rgba(0, 85, 222, .35); }
body.piq-editor.prod-assembly #sidebar .sidebar-brand { border-bottom: 2px solid rgba(255, 107, 0, .35); }
body.piq-editor.prod-documentation #sidebar .sidebar-brand { border-bottom: 2px solid rgba(0, 164, 184, .35); }

.main_wrapper {
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 100vh;
    width: 100%;
    padding-bottom: 0;
}

#public_key {
    font-weight: 600 !important;
    font-size: 18px;
}

#private_key {
    font-weight: 600 !important;
    font-size: 18px;
}

#email {
    font-weight: 600 !important;
    font-size: 18px;
}

.highlight_row {
    background-color: #fff0d6 !important;
    color: #1a1f36 !important;
    border-left: 3px solid #ff9b00 !important;
}

.highlight_input {
    color: #111 !important;
    background-color: rgba(255,155,0,.14) !important;
    border-color: rgba(255,155,0,.75) !important;
}

.modal-large {
    max-width: 65% !important;
}

/* Legacy table-cell status classes — restyled as soft pills */
.bg_active,
.bg_not_active,
.bg_hybrid {
    font-weight: 600 !important;
    text-align: center;
    font-size: .72rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    vertical-align: middle !important;
}
.bg_active {
    color: #1f7a30;
    background-color: #dcf5df;
}
.bg_not_active {
    color: #b42318;
    background-color: #fde5e3;
}
.bg_hybrid {
    color: #8a6d00;
    background-color: #fff3cd;
}

/* Inline status labels */
.text_enfa_red,
.text_enfa_green,
.text_enfa_blue {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px 2px 9px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600 !important;
    letter-spacing: .04em;
    text-transform: uppercase;
    line-height: 1.5;
    vertical-align: middle;
    border: 1px solid transparent;
}
.text_enfa_red {
    color: #b42318;
    background: #fee2e2;
    border-color: rgba(180, 35, 24, .18);
}
.text_enfa_red::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b42318;
    display: inline-block;
    flex: none;
}
.text_enfa_green {
    color: #1f7a30;
    background: #e8f5e9;
    border-color: rgba(31, 122, 48, .18);
}
.text_enfa_green::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1f7a30;
    display: inline-block;
    flex: none;
    box-shadow: 0 0 0 0 rgba(31, 122, 48, .5);
    animation: piq-status-pulse 1.8s infinite;
}
.text_enfa_blue {
    color: #0055DE;
    background: #e3f0ff;
    border-color: rgba(0, 85, 222, .18);
}
.text_enfa_blue::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #0055DE;
    display: inline-block;
    flex: none;
}

/* Unified PIQ status pill (new preferred API) */
.piq-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    line-height: 1.4;
    vertical-align: middle;
    border: 1px solid transparent;
    white-space: nowrap;
}
.piq-status-pill .piq-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex: none;
}
.piq-status-pill.piq-on {
    background: #e8f5e9;
    color: #1f7a30;
    border-color: rgba(31, 122, 48, .2);
}
.piq-status-pill.piq-on .piq-status-dot {
    background: #1f7a30;
    box-shadow: 0 0 0 0 rgba(31, 122, 48, .55);
    animation: piq-status-pulse 1.8s infinite;
}
.piq-status-pill.piq-off {
    background: #fee2e2;
    color: #b42318;
    border-color: rgba(180, 35, 24, .2);
}
.piq-status-pill.piq-off .piq-status-dot { background: #b42318; }
.piq-status-pill.piq-muted {
    background: #f1f5f9;
    color: #64748b;
    border-color: rgba(100, 116, 139, .2);
}
.piq-status-pill.piq-muted .piq-status-dot { background: #94a3b8; }
.piq-status-pill.piq-warn {
    background: #fff7ed;
    color: #b45309;
    border-color: rgba(180, 83, 9, .2);
}
.piq-status-pill.piq-warn .piq-status-dot { background: #b45309; }

@keyframes piq-status-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(31, 122, 48, .55); }
    70%  { box-shadow: 0 0 0 7px rgba(31, 122, 48, 0); }
    100% { box-shadow: 0 0 0 0   rgba(31, 122, 48, 0); }
}

/* Device action toggle buttons (download/upload on-off icons) */
.piq-dev-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: 4px;
    transition: opacity .15s ease, transform .1s ease;
    cursor: pointer;
}
.piq-dev-toggle svg { width: 17px; height: 17px; transition: stroke .15s ease; }
.piq-dev-toggle:hover { transform: translateY(-1px); }
a.piq-dev-toggle.piq-on,
a.piq-dev-toggle.piq-on .piq-table-tip,
a.piq-dev-toggle.piq-on svg { color: #16a34a !important; stroke: #16a34a !important; }
a.piq-dev-toggle.piq-on:hover svg { stroke: #15803d !important; }
a.piq-dev-toggle.piq-off,
a.piq-dev-toggle.piq-off .piq-table-tip,
a.piq-dev-toggle.piq-off svg { color: #dc2626 !important; stroke: #dc2626 !important; }
a.piq-dev-toggle.piq-off:hover svg { stroke: #b91c1c !important; }















.inline-radio-group {
    display: flex;
    flex-wrap: wrap; /* Permette ai pulsanti di andare a capo se lo spazio è insufficiente */
    gap: 20px;       /* Spazio tra i radio button */
    align-items: center;
}
#imageContainer {
    position: relative;
    display: inline-block;
    width: 100%;
}

.overlay-rect {
    position: absolute;
    /* Un colore di sfondo per renderli visibili */
    background-color: rgba(255, 0, 0, 0.5);
    border: 1px solid red;
    z-index: 10; /* Assicurati che siano sopra l'immagine */
    cursor: pointer;
}

#manage_search {
    display: flex;
    align-items: center; /* Questo è ciò che allinea verticalmente tutti gli elementi */
    gap: 15px;
}

.spacer {
    width: 2px;
    height: 30px; /* Altezza per visibilità, puoi personalizzarla */
    background-color: #ccc; /* Un colore per rendere visibile il separatore */
    margin: 0 10px; /* Aggiunge spazio laterale al separatore */
}

#search_button {
    margin-top: 10px; /* Aggiusta il valore finché non è allineato */
}

.image-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* Spazio tra le immagini */
    justify-content: flex-start; /* Allinea le immagini all'inizio della riga */
    align-items: center; /* Allinea verticalmente al centro */
}

.image-container img {
    max-width: 150px; /* Dimensioni massime delle miniature */
    height: auto;
    border: 1px solid #ccc; /* Un bordo per delimitare le immagini */
    padding: 5px;
    box-sizing: border-box; /* Assicura che padding e bordo siano inclusi nella dimensione totale */
}

#reset_filters,
#reset_doc_filters {
    margin-left: 30px;
    margin-bottom: 10px;
}

.top_items_left {
    width: 33%;
    float: left;
    text-align: left;
}

.top_items_center {
    width: 33%;
    float: left;
    text-align:center !important;
}

.top_items_right {
    width: 33%;
    float: left;
    text-align: right;
}

.bottom_items_left {
    width: 33%;
    float: left;
    text-align: left;
}

.bottom_items_center {
    width: 33%;
    float: left;
    text-align:center !important;
}

.bottom_items_right {
    width: 33%;
    float: left;
    text-align: right;
}

.top_assembly_left {
    width: 33%;
    float: left;
    text-align: left;
}

.top_assembly_center {
    width: 33%;
    float: left;
    text-align:center !important;
}

.top_assembly_right {
    width: 33%;
    float: left;
    text-align: right;
}

.bottom_assembly_left {
    width: 33%;
    float: left;
    text-align: left;
}

.bottom_assembly_center {
    width: 33%;
    float: left;
    text-align:center !important;
}

.bottom_assembly_right {
    width: 33%;
    float: left;
    text-align: right;
}

.top_documentation_left {
    width: 33%;
    float: left;
    text-align: left;
}

.top_documentation_center {
    width: 33%;
    float: left;
    text-align:center !important;
}

.top_documentation_right {
    width: 33%;
    float: left;
    text-align: right;
}

.bottom_documentation_left {
    width: 33%;
    float: left;
    text-align: left;
}

.bottom_documentation_center {
    width: 33%;
    float: left;
    text-align:center !important;
}

.bottom_documentation_right {
    width: 33%;
    float: left;
    text-align: right;
}

.top_users_left {
    width: 33%;
    float: left;
    text-align: left;
}

.top_users_center {
    width: 33%;
    float: left;
    text-align:center !important;
}

.top_users_right {
    width: 33%;
    float: left;
    text-align: right;
}

.bottom_users_left {
    width: 33%;
    float: left;
    text-align: left;
}

.bottom_users_center {
    width: 33%;
    float: left;
    text-align:center !important;
}

.bottom_users_right {
    width: 33%;
    float: left;
    text-align: right;
}

div.dt-buttons {
    float: none !important;
}

.dataTables_info {
    padding-top: 0px !important;
}

.btn-primary {
    color: #1a1f36 !important;
    background: #e3e8ee !important;
    border: 1px solid #d0d5dd !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    font-size: .875rem !important;
    transition: background .15s ease, box-shadow .15s ease, transform .08s ease;
}
.btn-primary:hover {
    background: #d5dbe3 !important;
    border-color: #c0c8d0 !important;
    box-shadow: none;
}
.btn-primary:active,
.btn-primary.active {
    background: #cdd3db !important;
    border-color: #b8c0c8 !important;
    box-shadow: none;
}
.btn-primary:disabled {
    opacity: .55;
    cursor: default;
    box-shadow: none !important;
}

.btn-background {
    color: #000000 !important;
    background: #54D7FF !important;
    border-color: #54D7FF !important;
}

.btn-sm {
    padding: 3px 8px !important;
    font-size: .75rem !important;
    line-height: 1.4 !important;
    border-radius: 5px !important;
}

.badge {
    padding: .4em !important;
}

.badge-secondary {
    background-color: #5c5a5a !important;
}

.badge.badge-attn {
    background-color: #F9E2BF !important;
    color: #111 !important;                   /* testo scuro leggibile */
    border: 1px solid !important;     /* bordo leggero per stacco */
    border-color: #FCBB56 !important;
    font-weight: 700 !important;
    padding: .25rem .6rem !important;         /* un filo più grande del badge default */
    border-radius: 999px !important;          /* pill leggero */
    line-height: 1.2 !important;
    cursor: pointer !important;               /* mano al passaggio */
    box-shadow: 0 0 0 1px rgba(0,0,0,.04) inset !important;
}

/* Stati interazione */
.badge.badge-attn:hover {
    transform: translateY(0px);
    box-shadow: 0 8px 18px rgba(15,23,42,.10);
}

.badge.badge-attn:focus {
    outline: 2px solid #7C6F00 !important;    /* focus visibile */
    outline-offset: 2px !important;
}

#breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "" !important;
    padding: 0 !important;
}

#breadcrumb .breadcrumb {
    padding: 4px 0 !important;
    margin: 0 !important;
    background: transparent !important;
    flex-wrap: wrap;
    gap: 4px;
}

#breadcrumb .breadcrumb-item {
    padding: 0 !important;
    display: flex;
    align-items: center;
}

/* Tag breadcrumb stile bottone */
.bc-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px 2px 9px;
    font-size: .75rem;
    font-weight: 500;
    color: #3c4257;
    background: #fff;
    border: 1px solid #d8dee4;
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
    transition: background .12s ease, border-color .12s ease;
    line-height: 1.4;
}
.bc-tag:hover {
    background: #f4f5f7;
    border-color: #c0c8d0;
    color: #1a1f36;
}
.bc-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    font-size: 12px;
    line-height: 1;
    color: #697386;
    border-radius: 3px;
    transition: background .1s ease, color .1s ease;
    pointer-events: auto;
}
.bc-tag:hover .bc-remove {
    color: #1a1f36;
}


#search_list {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1e293b;
}

/* Sezione Codice */
.search_code-section {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    border: 1px solid #f1f5f9;
}

.search_code-section h2 {
    color: #0f172a;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Gruppo Giorno */
.search_day-group {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
    margin-bottom: 20px;
}

.search_day-header {
    color: #059669;
    font-size: 1.3em;
    margin-bottom: 20px;
    border-left: 4px solid #059669;
    padding-left: 12px;
    font-weight: 700;
}

/* Griglia Flexbox */
.search_all-scans-container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}

/* Card Scansione Base */
.search_scan-container {
    flex-grow: 0;
    flex-shrink: 0;

    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;

    cursor: pointer;
    order: 0;

    height: 411px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;

    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Larghezze Colonne */
.search_scan-multi {
    width: calc(33.333% - 16px);
}

.search_scan-single {
    width: calc(19.166% - 19.166px);
    background-color: #eff6ff;
    border-color: #93c5fd;
}

/* Stato Espanso */
.search_scan-expanded {
    width: 100%;
    height: auto;
    cursor: zoom-out;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #94a3b8;
    max-height: none;
    overflow: visible;
    z-index: 10;
}

/* Hover Effect */
.search_scan-container:not(.search_scan-expanded):hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* --- STATI COLORATI MODERNI --- */

.search_scan-ok {
    background-color: #f0fdf4;
    border: 1px solid #86efac;
}
.search_scan-ok .search_scan-title {
    color: #15803d;
}

.search_scan-warning {
    background-color: #fefce8;
    border: 1px solid #fde047;
}
.search_scan-warning .search_scan-title {
    color: #a16207;
}

.search_scan-ng {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
}
.search_scan-ng .search_scan-title {
    color: #b91c1c;
}


/* Titolo e Intestazione Card (Contiene Orario) */
.search_scan-title {
    font-weight: 700;
    color: #334155;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #cbd5e1;

    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.search_scan-title span:first-child {
    flex-grow: 1;
}

/* Orario Super Visibile */
.search_scan-time {
    flex-shrink: 0;
    background-color: #334155;
    color: #ffffff;
    font-family: 'Monaco', 'Consolas', monospace;
    font-weight: 700;
    font-size: 1.1em;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
    margin-top: 0;
}

/* Griglia Immagini */
.search_image-flex-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-grow: 1;
    align-items: center;
}

.search_scan-single .search_image-flex-row {
    justify-content: center;
    height: 10%;
}

/* Wrapper Immagine */
.search_image-wrapper {
    flex: 1;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px;

    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;

    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.03);
}

/* Immagine generica (default per tutte le immagini multi-scan) */
.search_image-wrapper img {
    /* Il default è l'adattamento più flessibile */
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    cursor: default;
}

/* REGOLA CRITICA: Immagine all'interno del container di conteggio (singolo) */
.search_single-count-img {
    /* Forza l'altezza al 100% e lascia che la larghezza si adatti proporzionalmente */
    width: auto !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Etichetta Bottone (Conteggio, Controllo Qualità...) */
.search_image-label {
    position: absolute;
    bottom: 0;
    left: 0;

    width: 100%;
    background-color: #3b82f6;
    color: white;
    font-weight: 600;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 0;
    border-radius: 0 0 8px 8px;
    text-align: center;
    cursor: pointer;
    z-index: 5;
    transition: background-color 0.2s;
}

.search_image-label:hover {
    background-color: #2563eb;
}





/* ===== SIDEBAR MENU (Stripe-style) ===== */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 230px;
    background: #fff;
    border-right: 1px solid #e3e8ee;
    display: flex;
    flex-direction: column;
    z-index: 1030;
    overflow-y: auto;
    overflow-x: hidden;
}

#sidebar .sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid #e3e8ee;
}
#sidebar .sidebar-brand img {
    height: 26px;
    width: auto;
}

#sidebar .sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 12px 10px;
    flex: 1;
}

#sidebar .sidebar-nav .sidebar-section-label {
    font-size: .6875rem;
    font-weight: 600;
    color: #8898aa;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 16px 10px 6px;
    margin: 0;
}

#sidebar .sidebar_divider {
    height: 1px;
    background: #e3e8ee;
    margin: 6px 14px;
}

/* Sidebar item unificato: usato da menu principale, tech.php e flux.php */
#sidebar .sidebar-nav .sidebar-link,
#sidebar .sidebar-nav .sidebar_item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin: 1px 0;
    border-radius: 6px;
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1.5;
    color: #3c4257;
    text-decoration: none !important;
    transition: background .12s ease, color .12s ease;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
}

#sidebar .sidebar-nav .sidebar-link svg,
#sidebar .sidebar-nav .sidebar-link i,
#sidebar .sidebar-nav .sidebar_item svg,
#sidebar .sidebar-nav .sidebar_item i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #697386;
    transition: color .12s ease;
}

#sidebar .sidebar-nav .sidebar-link:hover,
#sidebar .sidebar-nav .sidebar_item:hover {
    background: #f4f5f7;
    color: #1a1f36;
}
#sidebar .sidebar-nav .sidebar-link:hover svg,
#sidebar .sidebar-nav .sidebar-link:hover i,
#sidebar .sidebar-nav .sidebar_item:hover svg,
#sidebar .sidebar-nav .sidebar_item:hover i {
    color: #1a1f36;
}

#sidebar .sidebar-nav .sidebar-link.active,
#sidebar .sidebar-nav .sidebar_item.active {
    background: #f4f5f7;
    color: #1a1f36;
    font-weight: 600;
    position: relative;
}
#sidebar .sidebar-nav .sidebar-link.active::before,
#sidebar .sidebar-nav .sidebar_item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: #ff9b00;
    border-radius: 0 3px 3px 0;
}
#sidebar .sidebar-nav .sidebar-link.active svg,
#sidebar .sidebar-nav .sidebar-link.active i,
#sidebar .sidebar-nav .sidebar_item.active svg,
#sidebar .sidebar-nav .sidebar_item.active i {
    color: #1a1f36;
}

/* Product-specific active marker colors (applied per item or via parent .sidebar-nav) */
#sidebar .sidebar-nav .prod-count.active::before,
#sidebar .sidebar-nav.prod-count .sidebar-link.active::before,
#sidebar .sidebar-nav.prod-count .sidebar_item.active::before { background: #0055DE; }

#sidebar .sidebar-nav .prod-quality.active::before,
#sidebar .sidebar-nav.prod-quality .sidebar-link.active::before,
#sidebar .sidebar-nav.prod-quality .sidebar_item.active::before { background: #7A2CF5; }

#sidebar .sidebar-nav .prod-assembly.active::before,
#sidebar .sidebar-nav.prod-assembly .sidebar-link.active::before,
#sidebar .sidebar-nav.prod-assembly .sidebar_item.active::before { background: #FF6B00; }

#sidebar .sidebar-nav .prod-documentation.active::before,
#sidebar .sidebar-nav.prod-documentation .sidebar-link.active::before,
#sidebar .sidebar-nav.prod-documentation .sidebar_item.active::before { background: #00A4B8; }

/* Accent icon color on active product items */
#sidebar .sidebar-nav .prod-count.active svg,
#sidebar .sidebar-nav .prod-count.active i,
#sidebar .sidebar-nav.prod-count .sidebar-link.active svg,
#sidebar .sidebar-nav.prod-count .sidebar-link.active i,
#sidebar .sidebar-nav.prod-count .sidebar_item.active svg,
#sidebar .sidebar-nav.prod-count .sidebar_item.active i { color: #0055DE; }

#sidebar .sidebar-nav .prod-quality.active svg,
#sidebar .sidebar-nav .prod-quality.active i,
#sidebar .sidebar-nav.prod-quality .sidebar-link.active svg,
#sidebar .sidebar-nav.prod-quality .sidebar-link.active i,
#sidebar .sidebar-nav.prod-quality .sidebar_item.active svg,
#sidebar .sidebar-nav.prod-quality .sidebar_item.active i { color: #7A2CF5; }

#sidebar .sidebar-nav .prod-assembly.active svg,
#sidebar .sidebar-nav .prod-assembly.active i,
#sidebar .sidebar-nav.prod-assembly .sidebar-link.active svg,
#sidebar .sidebar-nav.prod-assembly .sidebar-link.active i,
#sidebar .sidebar-nav.prod-assembly .sidebar_item.active svg,
#sidebar .sidebar-nav.prod-assembly .sidebar_item.active i { color: #FF6B00; }

#sidebar .sidebar-nav .prod-documentation.active svg,
#sidebar .sidebar-nav .prod-documentation.active i,
#sidebar .sidebar-nav.prod-documentation .sidebar-link.active svg,
#sidebar .sidebar-nav.prod-documentation .sidebar-link.active i,
#sidebar .sidebar-nav.prod-documentation .sidebar_item.active svg,
#sidebar .sidebar-nav.prod-documentation .sidebar_item.active i { color: #00A4B8; }
#sidebar .sidebar-nav .sidebar_item:focus {
    outline: none;
    box-shadow: none !important;
}

#sidebar .sidebar-divider {
    border: none;
    border-top: 1px solid #e3e8ee;
    margin: 8px 16px;
}

#sidebar .sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid #e3e8ee;
}

#sidebar .sidebar-footer .sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: .8125rem;
    font-weight: 500;
    color: #697386;
    text-decoration: none;
    transition: background .12s ease, color .12s ease;
}
#sidebar .sidebar-footer .sidebar-link:hover {
    background: #f4f5f7;
    color: #1a1f36;
}
#sidebar .sidebar-footer .sidebar-link svg,
#sidebar .sidebar-footer .sidebar-link i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Main content offset */
#page-content {
    margin-left: 230px;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Rimuove i padding multipli di Bootstrap annidato nella sidebar layout */
#page-content > .container-fluid {
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;
}
#page-content > .container-fluid > .row {
    margin-left: 0;
    margin-right: 0;
}
#page-content > .container-fluid > .row > main[role="main"] {
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/* Fix main_wrapper for sidebar layout */
.main_wrapper {
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    min-height: 100vh !important;
    width: 100% !important;
    padding-bottom: 0 !important;
}

/* Mobile sidebar */
@media (max-width: 991px) {
    #sidebar { width: 200px; }
    #page-content { margin-left: 200px; }
}
@media (max-width: 767px) {
    #sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    #sidebar.sidebar-open { transform: translateX(0); }
    #page-content { margin-left: 0; }
    .sidebar-toggle-btn { display: block !important; }
}

/* Settings: toggle switch arancione quando attivo */
.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #ff9b00 !important;
    border-color: #ff9b00 !important;
}
.custom-switch .custom-control-input:checked ~ .custom-control-label::after {
    background-color: #fff !important;
}
.custom-switch .custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 .2rem rgba(255, 155, 0, .25) !important;
}

/* Hide old navbar elements when sidebar is present */
.navbar.navbar--pills { display: none !important; }


/* ===== RADIO -> PILL BUTTONS (ARANCIONE PIQAPART) ===== */

.group{
    display:inline-block;
    margin: 0 10px 10px 0;
}

.class-radio{
    position:absolute;
    opacity:0;
    pointer-events:none;
}

.class-label{
    display:inline-flex;
    align-items:center;
    gap:10px;

    background: #FFFFFF;
    border: 1px solid rgba(15,23,42,.16);
    border-radius: 999px;
    padding: 12px 18px;

    font-weight: 800;
    font-size: 13px;
    color: var(--piq-ink);

    box-shadow: 0 10px 22px rgba(15,23,42,.08);
    cursor:pointer;
    user-select:none;

    transition: background .15s ease, border-color .15s ease, transform .08s ease, box-shadow .15s ease;
}

.class-label:hover{
    background: #FFFFFF;
    border-color: rgba(15,23,42,.28);
    transform: translateY(-1px);
}

/* cerchietto a sinistra (non selezionato) */
.class-label::before{
    content:"";
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(15,23,42,.22);
    background: transparent;
    display:inline-block;
}

/* selezionato (arancione) */
.class-radio:checked + .class-label{
    background: var(--piq-orange);
    background: #F9E2BF;
    border-color: rgba(255,155,0,.65);
    border-color: #FCBB56;

    box-shadow: 0 14px 28px rgba(255,155,0,.24);
    transform: none;
}

/* ✓ quando selezionato */
.class-radio:checked + .class-label::before{
    content:"✓";
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(17,24,39,.30);
    display:inline-flex;
    align-items:center;
    justify-content:center;

    font-weight: 950;
    font-size: 12px;

    background: rgba(255,255,255,.22);
}

/* focus tastiera */
.class-radio:focus + .class-label{
    outline: none;
    box-shadow: 0 0 0 4px rgba(255,155,0,.22), 0 10px 22px rgba(15,23,42,.08);
}

/* opzionale: wrapper per tante pill */
.radio-toolbar{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

/* Dropdown con look pill (stesso stile delle radio) */
.group.group-dropdown{
    display: block;
    width: 100%;
}

.class-select-wrap{
    position: relative;
    display: block;
    width: 100%;
}

.class-select-wrap::before{
    display: none;
}

.class-select-wrap::after{
    content: "▾";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #697386;
    font-size: 11px;
    pointer-events: none;
}

.class-select{
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    border-radius: 6px;
    border: 1px solid #d8dee4;
    background: #fff;
    color: #3c4257;
    font-weight: 500;
    font-size: .8125rem;
    padding: 7px 32px 7px 12px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.class-select:hover{
    background: #f4f5f7;
    border-color: #c0c8d0;
}

.class-select:focus{
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 31, 54, .12);
}

.class-select-wrap.is-selected .class-select{
    background: #f4f5f7;
    border-color: #3c4257;
    font-weight: 600;
}

.class-select-wrap.is-selected::before{
    display: none;
}

/* === DROPDOWN CUSTOM === */
.custom-dropdown{
    position: relative;
}

.custom-select-trigger{
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    padding: 6px 28px 6px 12px;
    background: #fff;
    border: 1px solid #d8dee4;
    border-radius: 6px;
    font-size: .8125rem;
    font-weight: 500;
    color: #3c4257;
    transition: background .12s ease, border-color .12s ease;
    position: relative;
}
.custom-select-trigger::after{
    content: "▾";
    position: absolute;
    right: 10px;
    color: #697386;
    font-size: 11px;
}
.custom-select-trigger:hover{
    background: #f4f5f7;
    border-color: #c0c8d0;
}
.custom-dropdown.open .custom-select-trigger{
    background: #f4f5f7;
    border-color: #3c4257;
}
.custom-select-trigger.has-selection{
    background: #f4f5f7;
    border-color: #3c4257;
    font-weight: 600;
    color: #1a1f36;
}

.custom-dropdown-options{
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.1), 0 0 0 1px rgba(0,0,0,.06);
    z-index: 1100;
    opacity: 0;
    transform: translateY(-4px);
    transition: max-height .2s ease, opacity .15s ease, transform .15s ease;
    padding: 4px 0;
}

.custom-dropdown.open .custom-dropdown-options{
    max-height: 400px;
    overflow-y: auto;
    opacity: 1;
    transform: translateY(0);
}

.custom-option{
    background: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 2px 6px;
    font-weight: 500;
    font-size: .8125rem;
    color: #3c4257;
    cursor: pointer;
    user-select: none;
    transition: background .12s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-option::before{
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid #d8dee4;
    background: #fff;
    flex-shrink: 0;
    transition: all .12s ease;
}

.custom-option:hover{
    background: #f4f5f7;
}

.custom-option.selected{
    background: #f4f5f7;
    font-weight: 600;
    color: #1a1f36;
}

.custom-option.selected::before{
    content: "✓";
    width: 14px;
    height: 14px;
    border: 1px solid #3c4257;
    background: #f4f5f7;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
}

/* Scrollbar personalizzata per le opzioni */
.custom-dropdown-options::-webkit-scrollbar{
    width: 8px;
}

.custom-dropdown-options::-webkit-scrollbar-track{
    background: rgba(15,23,42,.04);
    border-radius: 10px;
}

.custom-dropdown-options::-webkit-scrollbar-thumb{
    background: rgba(15,23,42,.15);
    border-radius: 10px;
}

.custom-dropdown-options::-webkit-scrollbar-thumb:hover{
    background: rgba(15,23,42,.25);
}

/* Centra e ridimensiona il menu a tendina nella colonna */
.inline-radio-group{
    width: 80%;
    min-width: 400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}




/* Base bottoni */
.btn{
    border-radius: 6px !important;
    letter-spacing: .1px;
    padding: 5px 12px !important;
    font-weight: 500;
    font-size: .8125rem;
    line-height: 1.5;
    border: 1px solid #d8dee4 !important;
    transition: background .15s ease, box-shadow .15s ease, border-color .15s ease;
}

/* Media/Step item selezionato (documentation & assembly) */
.media-item.media-item-active,
.media-item.media-item-active:hover,
.step-item.step-item-active,
.step-item.step-item-active:hover {
    background: #007bff !important;
    border-color: #0056b3 !important;
    color: #fff !important;
    box-shadow: 0 0 0 3px rgba(0,123,255,.3) !important;
}
.media-item.media-item-active .text-muted,
.step-item.step-item-active .text-muted {
    color: rgba(255,255,255,.75) !important;
}
.media-item.media-item-active .opacity-50 {
    opacity: 1 !important;
}

/* Testo step: colore base scuro */
.step-item .step-title-text,
.step-item .step-id-text {
    color: #1a1f36;
}

/* Step evidenziato durante riproduzione video */
.step-item.btn-secondary.step-video-playing,
.step-item.btn-secondary.step-video-playing:hover {
    background: #28a745 !important;
    border-color: #1e7e34 !important;
    color: #fff !important;
    box-shadow: 0 0 0 3px rgba(40,167,69,.35) !important;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}
.step-item.step-video-playing .text-muted,
.step-item.step-video-playing .step-title-text,
.step-item.step-video-playing .step-id-text,
.step-item.step-video-playing .badge {
    color: #fff !important;
}
.step-item .edit-step-btn {
    background: #fff !important;
    color: #212529 !important;
}
.step-item.step-video-playing .edit-step-btn,
.step-item.step-video-playing .delete-step-btn {
    background: #fff !important;
    color: #212529 !important;
}

/* Segmento AI illuminato sulla barra video */
.ai-step-layer {
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}
.ai-step-layer.ai-step-layer-active {
    opacity: 0.9 !important;
    box-shadow: 0 0 8px 2px rgba(255,255,255,0.7), inset 0 0 0 2px #fff;
    z-index: 8 !important;
}

/* Media/Step-item base: sfondo bianco */
.media-item.btn-secondary,
.step-item.btn-secondary {
    background: #fff !important;
    color: #1a1f36 !important;
}
.media-item.btn-secondary.media-item-active,
.media-item.btn-secondary.media-item-active:hover {
    background: #007bff !important;
    border-color: #0056b3 !important;
    color: #fff !important;
    box-shadow: 0 0 0 3px rgba(0,123,255,.3) !important;
}

/* Icone dentro bottoni (feather / svg) */
.btn svg,
.btn i{
    width: 14px;
    height: 14px;
    vertical-align: middle;
}


/* Focus accessibile */
.btn:focus,
.btn:focus-visible{
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(26, 31, 54, .12) !important;
}

/* Outline primary */
.btn-outline-primary{
    background: #fff !important;
    border: 1px solid #d8dee4 !important;
    color: #3c4257 !important;
    font-weight: 500 !important;
}
.btn-outline-primary:hover{
    background: #f4f5f7 !important;
    border-color: #c0c8d0 !important;
}

/* Secondary più “soft” */
.btn-secondary{
    background: #fff !important;
    border: 1px solid #d8dee4 !important;
    color: #3c4257 !important;
}
.btn-secondary:hover{
    background: #f4f5f7 !important;
    border-color: #c0c8d0 !important;
}

/* Danger */
.btn-danger{
    background: #fff !important;
    border: 1px solid #d8dee4 !important;
    color: #cd3d64 !important;
}
.btn-danger:hover{
    background: #fef2f2 !important;
    border-color: #cd3d64 !important;
}

div.dt-buttons>.dt-button,
div.dt-buttons>.dt-button.btn-sm,
.dataTables_wrapper .dt-button {
    border-radius: 6px !important;
    font-size: .75rem !important;
    font-weight: 500 !important;
    padding: 4px 10px !important;
    line-height: 1.4 !important;
    background: #fff !important;
    color: #3c4257 !important;
    border: 1px solid #d8dee4 !important;
    box-shadow: none !important;
    transition: background .12s ease, border-color .12s ease !important;
}
div.dt-buttons>.dt-button:hover,
.dataTables_wrapper .dt-button:hover {
    background: #f4f5f7 !important;
    border-color: #c0c8d0 !important;
    box-shadow: none !important;
}
div.dt-buttons>.dt-button svg,
.dataTables_wrapper .dt-button svg {
    width: 12px !important;
    height: 12px !important;
    margin-right: 4px !important;
}

:root{
    --piq-orange: #FF9B00;
    --piq-orange-700: #E38800;
    --piq-ink: #0f172a;
    --piq-border: rgba(15,23,42,.14);
}

/* ===== SELECT (e INPUT) – stile PIQAPART ===== */
select,
.form-select{
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-color: rgba(255,255,255,.95);
    border: 1px solid var(--piq-border);
    border-radius: 12px;
    padding: 10px 40px 10px 12px;  /* spazio a destra per freccia */
    color: var(--piq-ink);
    font-weight: 800;
    font-size: 13px;
    line-height: 1.2;

    box-shadow: 0 10px 22px rgba(15,23,42,.06);
    transition: box-shadow .15s ease, border-color .15s ease, transform .08s ease;

    /* freccia custom */
    background-image:
        linear-gradient(45deg, transparent 50%, var(--piq-ink) 50%),
        linear-gradient(135deg, var(--piq-ink) 50%, transparent 50%),
        linear-gradient(to right, transparent, transparent);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 13px) 50%,
        100% 0;
    background-size:
        6px 6px,
        6px 6px,
        2.5em 2.5em;
    background-repeat: no-repeat;

    cursor: pointer;
}

select:hover,
.form-select:hover{
    border-color: rgba(15,23,42,.26);
    transform: translateY(-1px);
}

/* Focus arancione */
select:focus,
.form-select:focus{
    outline: none;
    border-color: rgba(255,155,0,.65);
    box-shadow: 0 0 0 4px rgba(255,155,0,.22), 0 10px 22px rgba(15,23,42,.06);
    transform: none;
}

/* Disabilitato */
select:disabled,
.form-select:disabled{
    opacity: .65;
    cursor: not-allowed;
    box-shadow: none;
}

/* Opzioni: (limitato, dipende dal browser) */
select option{
    color: var(--piq-ink);
}

/* ===== opzionale: se vuoi uniformare anche input/textarea ===== */
input[type="text"],
input[type="number"],
input[type="date"],
textarea,
.form-control{
    border: 1px solid var(--piq-border);
    border-radius: 12px;
    /*padding: 10px 12px;*/
    background: rgba(255,255,255,.95);
    color: var(--piq-ink);
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(15,23,42,.06);
    transition: box-shadow .15s ease, border-color .15s ease;
}

input:focus,
textarea:focus,
.form-control:focus{
    outline: none;
    border-color: rgba(255,155,0,.65);
    box-shadow: 0 0 0 4px rgba(255,155,0,.22), 0 10px 22px rgba(15,23,42,.06);
}


/* L'elemento che "segue" il mouse */
.sortable-drag {
    opacity: 1 !important;
    border-color: rgba(255,155,0,.65);
    box-shadow: 0 0 0 4px rgba(255,155,0,.22), 0 10px 22px rgba(15,23,42,.06);
    background-color: rgba(255,255,255,.85) !important; /* Colore pieno durante il movimento */
    cursor: grabbing !important;
}

/* Lo spazio vuoto che indica dove cadrà l'elemento */
.sortable-ghost {
    opacity: 0.4;
    background-color: #e9ecef !important;
    border: 2px dashed #007bff !important;
}

/* Evita selezioni di testo fastidiose durante il drag */
#step_list_container .btn {
    user-select: none;
}

/* Stile per la scrollbar (webkit browsers) */
#step_list_container::-webkit-scrollbar {
    width: 8px;
}

#step_list_container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#step_list_container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#step_list_container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Raggruppamento visivo per i menu count-quality */
.navbar-nav .nav-group-count-quality-wrap {
    margin: 0;
}

.navbar-nav .nav-group-count-quality {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.navbar-nav .nav-group-count-quality-link {
    margin: 0;
}

.navbar-nav .nav-group-count-quality-link + .nav-group-count-quality-link {
    border-left: none;
}

.navbar-nav .nav-group-count-quality-link:hover {
    background-color: inherit;
    transform: none;
}

.navbar-nav .nav-group-count-quality-link.active {
    background-color: inherit;
    font-weight: inherit;
}

.tooltip {
    pointer-events: none;
    opacity: 1 !important;
}
.tooltip-inner {
    background-color: #212529;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.bs-tooltip-top .arrow::before,
.bs-tooltip-auto[x-placement^="top"] .arrow::before { border-top-color: #212529; }
.bs-tooltip-bottom .arrow::before,
.bs-tooltip-auto[x-placement^="bottom"] .arrow::before { border-bottom-color: #212529; }
.bs-tooltip-left .arrow::before,
.bs-tooltip-auto[x-placement^="left"] .arrow::before { border-left-color: #212529; }
.bs-tooltip-right .arrow::before,
.bs-tooltip-auto[x-placement^="right"] .arrow::before { border-right-color: #212529; }

/* ─── Home page ─── */
.home-hero {
    text-align: center;
    padding: 48px 20px 32px;
    margin-bottom: 32px;
}
.home-hero-logo {
    max-width: 200px;
    margin-bottom: 24px;
}
.home-hero-title {
    font-size: 2rem;
    font-weight: 600 !important;
    color: var(--piq-ink);
    margin-bottom: 6px;
}
.home-hero-subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 20px;
}
.home-hero-desc {
    max-width: 680px;
    margin: 0 auto;
    font-size: .925rem;
    color: #4b5563;
    line-height: 1.65;
}

.home-section-title {
    font-size: 1.15rem;
    font-weight: 600 !important;
    color: var(--piq-ink);
    margin-bottom: 6px;
    padding-left: 4px;
}
.home-section-desc {
    font-size: .875rem;
    color: #6b7280;
    margin-bottom: 24px;
    padding-left: 4px;
}

.home-card {
    background: #fff;
    border: 1px solid var(--piq-border);
    border-radius: 10px;
    padding: 28px 24px;
    height: 100%;
    transition: box-shadow .2s ease, transform .15s ease;
}
.home-card:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
    transform: translateY(-2px);
}
.home-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 155, 0, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}
.home-card-icon svg {
    width: 22px;
    height: 22px;
    color: var(--piq-orange);
}
.home-card-title {
    font-size: .95rem;
    font-weight: 600 !important;
    color: var(--piq-ink);
    margin-bottom: 10px;
}
.home-card-text {
    font-size: .825rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 0;
}

.home-feature {
    background: #fff;
    border: 1px solid var(--piq-border);
    border-radius: 10px;
    padding: 24px 22px;
    height: 100%;
}
.home-feature-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(255, 155, 0, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.home-feature-icon svg {
    width: 18px;
    height: 18px;
    color: var(--piq-orange);
}
.home-feature-title {
    font-size: .9rem;
    font-weight: 600 !important;
    color: var(--piq-ink);
    margin-bottom: 8px;
}
.home-feature-text {
    font-size: .825rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 0;
}

/* ─── Home page: product detail cards (3-step procedure) ─── */
.home-products-stack {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px;
    margin-bottom: 36px;
    align-items: stretch;
}
.home-product {
    --p-accent: #FF9B00;
    --p-tint-strong: rgba(255, 155, 0, .16);
    --p-tint-soft: rgba(255, 155, 0, .06);
    background: linear-gradient(180deg, var(--p-tint-strong) 0%, var(--p-tint-soft) 130px, #fff 130px, #fff 100%);
    border: 1px solid var(--piq-border);
    border-radius: 16px;
    padding: 26px 22px 22px;
    transition: box-shadow .2s ease, transform .15s ease, border-color .2s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.home-product::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--p-accent);
}
.home-product:hover {
    box-shadow: 0 12px 32px rgba(15, 23, 42, .12);
    transform: translateY(-3px);
    border-color: var(--p-accent);
}
/* Product-specific accents */
.home-product.p-count        { --p-accent: #0055DE; --p-tint-strong: rgba(0, 85, 222, .14); --p-tint-soft: rgba(0, 85, 222, .04); }
.home-product.p-quality      { --p-accent: #7A2CF5; --p-tint-strong: rgba(122, 44, 245, .14); --p-tint-soft: rgba(122, 44, 245, .04); }
.home-product.p-assembly     { --p-accent: #FF6B00; --p-tint-strong: rgba(255, 107, 0, .16); --p-tint-soft: rgba(255, 107, 0, .05); }
.home-product.p-documentation{ --p-accent: #00A4B8; --p-tint-strong: rgba(0, 164, 184, .14); --p-tint-soft: rgba(0, 164, 184, .04); }

.home-product-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 22px;
}
.home-product-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 16px;
}
.home-product-icon svg {
    width: 30px;
    height: 30px;
    color: var(--p-accent);
    stroke-width: 2;
}
.home-product-head-text { width: 100%; }
.home-product-title {
    font-size: 1.1rem;
    font-weight: 700 !important;
    color: var(--piq-ink);
    margin: 0 0 8px;
    line-height: 1.25;
}
.home-product-desc {
    font-size: .8rem;
    color: #4b5563;
    line-height: 1.55;
    margin: 0;
}
.home-product-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px dashed rgba(15, 23, 42, .1);
    flex: 1;
}
.home-step {
    background: #fff;
    border: 1px solid var(--piq-border);
    border-radius: 12px;
    padding: 14px 14px 14px 16px;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.home-step:hover {
    border-color: var(--p-accent);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .06);
}
.home-step-num {
    position: absolute;
    top: -9px;
    left: 14px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: var(--p-accent);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .2);
    z-index: 1;
    letter-spacing: .02em;
}
.home-step-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--p-tint-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 4px;
}
.home-step-icon svg {
    width: 18px;
    height: 18px;
    color: var(--p-accent);
}
.home-step-body { flex: 1; min-width: 0; padding-top: 2px; }
.home-step-title {
    font-size: .85rem;
    font-weight: 600 !important;
    color: var(--piq-ink);
    margin: 0 0 3px;
    line-height: 1.3;
}
.home-step-text {
    font-size: .76rem;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}
.home-step-arrow { display: none; }

#home_my_products_section,
#home_other_products_section {
    text-align: center;
}
.home-section-title.home-section-title--dash {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.home-section-title--dash::before {
    content: "";
    width: 4px;
    height: 22px;
    border-radius: 3px;
    background: #ea580c;
    flex-shrink: 0;
}
.home-section-title-other {
    color: #6b7280;
    margin-top: 40px;
}
.home-section-title-other::before {
    background: #d1d5db;
}
.home-products-inactive .home-product {
    cursor: pointer;
}

@media (max-width: 575px) {
    .home-products-stack { flex-direction: column; align-items: center; }
    .home-product { padding: 22px 18px 18px; min-width: 0 !important; flex: 1 1 100% !important; max-width: 100%; }
}

/* Profilo: selettore lingua (stile Documenti / Note) */
.profile-page-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

.profile-user-section {
    width: 100%;
    background: #fff;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    box-shadow:
        0 0 0 1px rgba(50, 50, 93, .06),
        0 2px 5px rgba(50, 50, 93, .08),
        0 1px 1.5px rgba(0, 0, 0, .05);
    overflow: hidden;
}
.profile-user-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1f36;
    padding: 20px 28px 16px;
    border-bottom: 1px solid #eee;
}
.profile-user-section-header svg {
    width: 22px;
    height: 22px;
    color: #ff9b00;
    flex-shrink: 0;
}
.profile-user-lang-row {
    padding: 20px 28px;
}

.profile-lang-pwd-row {
    display: flex;
    gap: 16px;
    width: 100%;
}
.profile-lang-pwd-col {
    display: flex;
    flex-direction: column;
}
.profile-lang-pwd-lang {
    flex: 0 0 70%;
    max-width: 70%;
}
.profile-lang-pwd-pwd {
    flex: 0 0 calc(30% - 16px);
    max-width: calc(30% - 16px);
}
.profile-lang-pwd-col > .profile-user-section {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.profile-pwd-body {
    padding: 20px 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.profile-pwd-body .profile-language-lead {
    margin-bottom: 14px;
}
.profile-pwd-eye {
    border-color: #ced4da;
    color: #697386;
    padding: 0.25rem 0.6rem;
}
.profile-pwd-eye:hover {
    background: #f1f5f9;
    color: #1a1f36;
}
@media (max-width: 768px) {
    .profile-lang-pwd-row {
        flex-direction: column;
    }
    .profile-lang-pwd-lang,
    .profile-lang-pwd-pwd {
        flex: none;
        max-width: 100%;
    }
}

.profile-language-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1f36;
    margin-bottom: 8px;
}

.profile-language-heading svg {
    width: 22px;
    height: 22px;
    color: #ff9b00;
    flex-shrink: 0;
}

.profile-language-lead {
    font-size: .875rem;
    color: #697386;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Stesso pattern di #doc_section_toggle (documentation.php) */
.profile-lang-toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #f4f5f7 !important;
    border: 1px solid #d8dee4;
    border-radius: 6px;
    padding: 4px;
}

.profile-lang-toggle .profile-lang-btn,
.profile-lang-toggle .profile-lang-btn.btn,
.profile-lang-toggle .profile-lang-btn.btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0;
    padding: 8px 14px !important;
    font-size: .8125rem !important;
    font-weight: 500 !important;
    border-radius: 4px !important;
    background: transparent !important;
    color: #697386 !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
    line-height: 1.35 !important;
    white-space: nowrap;
}

.profile-lang-toggle .profile-lang-btn:hover {
    background: #fff0d6 !important;
    color: #1a1f36 !important;
}

.profile-lang-toggle .profile-lang-btn.active,
.profile-lang-toggle .profile-lang-btn.active.btn-primary {
    background: #ff9b00 !important;
    border: 1px solid #e88d00 !important;
    color: #fff !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 3px rgba(255, 155, 0, .3) !important;
}

.profile-lang-toggle .profile-lang-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 155, 0, .22) !important;
}

.profile-lang-feedback {
    display: block;
    margin-top: 16px;
    min-height: 1.25rem;
    font-size: .8125rem;
    text-align: center;
    color: #697386;
}

.profile-lang-feedback.text-success {
    color: #0d7a4f !important;
}

.profile-lang-feedback.text-danger {
    color: #cd3d64 !important;
}

@media (max-width: 576px) {
    .profile-lang-toggle .profile-lang-btn {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
    }
}

/* Documentation: sezione unificata full-width */
.profile-doc-section {
    width: 100%;
    background: #fff;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    box-shadow:
        0 0 0 1px rgba(50, 50, 93, .06),
        0 2px 5px rgba(50, 50, 93, .08),
        0 1px 1.5px rgba(0, 0, 0, .05);
    overflow: hidden;
}
.profile-doc-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1f36;
    padding: 20px 28px 16px;
    border-bottom: 1px solid #eee;
}
.profile-doc-section-header svg {
    width: 22px;
    height: 22px;
    color: #ff9b00;
    flex-shrink: 0;
}
.profile-doc-row {
    display: flex;
    gap: 0;
    width: 100%;
    align-items: stretch;
}
.profile-doc-col {
    flex: 2 1 0;
    min-width: 0;
}
.profile-doc-col:last-child {
    flex: 1 1 0;
}
.profile-doc-row > .profile-doc-col + .profile-doc-col {
    border-left: 1px solid #eee;
}
@media (max-width: 860px) {
    .profile-doc-row {
        flex-direction: column;
    }
    .profile-doc-row > .profile-doc-col + .profile-doc-col {
        border-left: none;
        border-top: 1px solid #eee;
    }
}

.profile-credits-card {
    width: 100%;
    background: #fff;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    box-shadow:
        0 0 0 1px rgba(50, 50, 93, .06),
        0 2px 5px rgba(50, 50, 93, .08),
        0 1px 1.5px rgba(0, 0, 0, .05);
    padding: 28px 28px 24px;
}
.profile-doc-section .profile-credits-card {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.profile-credits-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1f36;
    margin-bottom: 4px;
}

.profile-credits-heading svg {
    width: 22px;
    height: 22px;
    color: #ff9b00;
    flex-shrink: 0;
}

.profile-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: .8125rem;
    font-weight: 600;
    border-radius: 6px;
    margin-bottom: 16px;
}
.profile-plan-badge.plan-free       { background: #f0f0f0; color: #555; }
.profile-plan-badge.plan-pro        { background: #fff3cd; color: #856404; }
.profile-plan-badge.plan-business   { background: #cce5ff; color: #004085; }
.profile-plan-badge.plan-enterprise { background: #d4edda; color: #155724; }

.profile-credits-hint {
    font-size: .8125rem;
    color: #697386;
    margin-bottom: 16px;
}

.profile-credits-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8125rem;
}
.profile-credits-table th {
    text-align: left;
    font-weight: 600;
    color: #1a1f36;
    padding: 8px 10px;
    border-bottom: 2px solid #ff9b00;
    background: #ffd89e;
    font-size: .8rem;
}
.profile-credits-table th:last-child {
    text-align: right;
}
.profile-credits-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #eee;
    color: #1a1f36;
}
.profile-credits-table td:last-child {
    text-align: right;
    font-weight: 600;
}
.profile-credits-table tr:last-child td {
    border-bottom: none;
}
.profile-credits-unlimited {
    color: #28a745;
}
.profile-credits-zero {
    color: #dc3545;
}
.profile-credits-low {
    color: #e08600;
}

/* Plan upgrade cards */
.profile-plans-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 12px;
}
.profile-plans-grid.plans-count-3 { grid-template-columns: repeat(3, 1fr); }
.profile-plans-grid.plans-count-2 { grid-template-columns: repeat(2, 1fr); }
.profile-plans-grid.plans-count-1 { grid-template-columns: 1fr; }
@media (max-width: 700px) {
    .profile-plans-grid,
    .profile-plans-grid.plans-count-3,
    .profile-plans-grid.plans-count-2 {
        grid-template-columns: 1fr;
    }
}
.profile-plan-card {
    border: 1px solid #dee2e6;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: box-shadow .15s;
}
.profile-plan-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,.08);
}
.profile-plan-card.plan-card-current {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,.2);
}
.profile-plan-card-header {
    padding: 14px 16px 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.profile-plan-card-header.plan-header-free       { background: #f8f9fa; }
.profile-plan-card-header.plan-header-pro        { background: #fff8e1; }
.profile-plan-card-header.plan-header-business   { background: #e3f2fd; }
.profile-plan-card-header.plan-header-enterprise { background: #e8f5e9; }
.profile-plan-card-name {
    font-weight: 700;
    font-size: 15px;
}
.profile-plan-card-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    background: #007bff;
    color: #fff;
}
.profile-plan-card-body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.profile-plan-card-price {
    margin-bottom: 12px;
    font-size: 13px;
    color: #555;
}
.plan-price-amount {
    font-size: 22px;
    font-weight: 700;
    color: #212529;
}
.plan-price-cycle {
    font-size: 13px;
    color: #777;
    margin-left: 2px;
}
.profile-plan-card-features {
    flex: 1;
    margin-bottom: 14px;
}
.plan-features-title {
    font-size: 11px;
    text-transform: uppercase;
    color: #999;
    letter-spacing: .5px;
    margin-bottom: 6px;
}
.plan-feature-row {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    padding: 3px 0;
    border-bottom: 1px solid #f0f0f0;
}
.plan-feature-row:last-child {
    border-bottom: none;
}
.profile-plan-buy-btn,
.profile-plan-contact-btn {
    align-self: stretch;
    margin-top: auto;
}

.profile-sub-banner {
    margin: 10px 0 14px;
}
.profile-sub-banner .alert {
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 8px;
}
.profile-sub-banner-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.profile-sub-banner-alert {
    flex: 1;
    min-width: 0;
}
.profile-sub-alert-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}
.profile-sub-alert-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}
.profile-sub-banner .alert strong {
    font-size: 13px;
}
.profile-sub-banner .alert small {
    font-size: 12px;
    line-height: 1.4;
}
.profile-sub-renew-inline {
    font-weight: 400;
    font-size: 12px;
    color: inherit;
    opacity: .75;
}
.profile-sub-action-btn {
    font-size: 12px;
    padding: 6px 16px;
    white-space: nowrap;
    flex-shrink: 0;
}

.profile-doc-payments {
    margin-top: 0;
    border-top: 1px solid #e9ecef;
    padding: 18px 20px;
}
.profile-doc-payments .badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.profile-doc-payments .badge-success { background: #d4edda; color: #155724; }
.profile-doc-payments .badge-danger  { background: #f8d7da; color: #721c24; }
.profile-doc-payments .badge-warning { background: #fff3cd; color: #856404; }
.profile-payment-download-link {
    color: #007bff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.profile-payment-download-link:hover {
    text-decoration: underline;
}

.profile-activity-sub {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 11px;
    background: rgba(0,0,0,0.06);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}
.badge-primary {
    background: #007bff;
    color: #fff;
}

.profile-billing-body {
    padding: 20px 28px 24px;
}
.profile-billing-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1f36;
    margin-bottom: 4px;
}
.profile-billing-heading svg:first-child {
    width: 20px;
    height: 20px;
    color: #ff9b00;
    flex-shrink: 0;
}
.profile-billing-biz-badge {
    font-size: .7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.profile-billing-biz-badge.biz-on {
    background: #cce5ff;
    color: #004085;
}
.profile-billing-biz-badge.biz-off {
    background: #f0f0f0;
    color: #555;
}
.profile-billing-edit-inline {
    margin-left: auto;
    font-size: .75rem;
    padding: 4px 12px;
}

.profile-biz-toggle {
    display: inline-flex;
    gap: 2px;
    background: #f4f5f7;
    border: 1px solid #d8dee4;
    border-radius: 5px;
    padding: 2px;
}
.profile-biz-btn {
    font-size: .75rem !important;
    padding: 4px 12px !important;
    border: none !important;
    border-radius: 3px !important;
    background: transparent !important;
    color: #697386 !important;
    font-weight: 500 !important;
    cursor: pointer;
}
.profile-biz-btn:hover {
    background: #fff0d6 !important;
    color: #1a1f36 !important;
}
.profile-biz-btn.active {
    background: #ff9b00 !important;
    color: #fff !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 3px rgba(255, 155, 0, .3) !important;
}
.profile-billing-hint {
    font-size: .8125rem;
    color: #697386;
    margin-bottom: 16px;
}
.profile-billing-subtitle {
    font-size: .8rem;
    font-weight: 600;
    color: #1a1f36;
    margin: 14px 0 8px;
    padding-bottom: 4px;
    border-bottom: 2px solid #ff9b00;
}
.profile-billing-subtitle:first-child {
    margin-top: 0;
}
.profile-billing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8125rem;
}
.profile-billing-table td {
    padding: 4px 8px 4px 0;
    vertical-align: top;
    color: #1a1f36;
}
.profile-billing-table .profile-billing-lbl {
    font-weight: 600;
    color: #697386;
    white-space: nowrap;
    width: 1%;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .3px;
}

/* Modal form fields */
.profile-billing-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}
.profile-billing-row .profile-billing-field {
    flex: 1 1 0;
    min-width: 0;
}
.profile-billing-field {
    margin-bottom: 12px;
}
.profile-billing-field label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: #697386;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 4px;
}
.profile-billing-field input {
    width: 100%;
    padding: 8px 12px;
    font-size: .875rem;
    border: 1px solid #d8dee4;
    border-radius: 6px;
    background: #fff;
    color: #1a1f36;
    transition: border-color .15s;
}
.profile-billing-field input:focus,
.profile-billing-field select:focus {
    outline: none;
    border-color: #ff9b00;
    box-shadow: 0 0 0 3px rgba(255, 155, 0, .15);
}
.profile-billing-select {
    width: 100%;
    padding: 8px 12px;
    font-size: .875rem;
    border: 1px solid #d8dee4;
    border-radius: 6px;
    background: #fff;
    color: #1a1f36;
    transition: border-color .15s;
    appearance: auto;
}
.profile-billing-field input[readonly] {
    background: #f7f8fa;
    color: #697386;
    cursor: not-allowed;
}
.profile-billing-feedback {
    font-size: .8125rem;
    min-height: 1.25rem;
}
@media (max-width: 640px) {
    .profile-billing-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ===========================================================
   AI PROCESSING UI (shared) - toast, banner, coffee placeholder
   Default accent: orange (#FF9B00 - Assembly)
   Override per prodotto con classe su <body>
   =========================================================== */
:root {
    --ai-accent: #ff9b00;
    --ai-accent-tint: rgba(255, 155, 0, .18);
    --ai-accent-soft: rgba(255, 155, 0, .08);
}
body.prod-documentation {
    --ai-accent: #00A4B8;
    --ai-accent-tint: rgba(0, 164, 184, .18);
    --ai-accent-soft: rgba(0, 164, 184, .08);
}
body.prod-count {
    --ai-accent: #0055DE;
    --ai-accent-tint: rgba(0, 85, 222, .18);
    --ai-accent-soft: rgba(0, 85, 222, .08);
}
body.prod-assembly {
    --ai-accent: #FF6B00;
    --ai-accent-tint: rgba(255, 107, 0, .18);
    --ai-accent-soft: rgba(255, 107, 0, .08);
}

/* Spinner keyframe generico (idempotente) */
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* Banner in cima al pannello step / media */
.ai-processing-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: var(--ai-accent-soft);
    border: 1px solid var(--ai-accent-tint);
    color: #1a1f36;
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.3;
}
.ai-processing-banner .ai-banner-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--ai-accent-tint);
    border-top-color: var(--ai-accent);
    border-radius: 50%;
    animation: ai-spin .8s linear infinite;
    flex-shrink: 0;
}

/* Coffee placeholder nel contenitore degli step */
.ai-coffee-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}
.ai-coffee-placeholder-icon {
    margin-bottom: 18px;
    animation: ai-coffee-bob 2s ease-in-out infinite;
}
.ai-coffee-placeholder-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1f36;
    margin-bottom: 8px;
}
.ai-coffee-placeholder-msg {
    font-size: .95rem;
    color: #64748b;
    max-width: 360px;
    line-height: 1.5;
    margin-bottom: 18px;
}
.ai-coffee-placeholder-sub {
    font-size: .8rem;
    color: #94a3b8;
}
.ai-coffee-placeholder-sub i {
    color: var(--ai-accent);
    margin-right: 4px;
}
@keyframes ai-coffee-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* Toast fissa in basso a destra */
.ai-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.08);
    padding: 20px 24px;
    max-width: 340px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    animation: ai-toast-in .4s ease-out;
    border-left: 4px solid var(--ai-accent);
}
.ai-toast.closing { animation: ai-toast-out .3s ease-in forwards; }
.ai-toast-icon { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.ai-toast-body { flex: 1; min-width: 0; position: relative; }
.ai-toast-title { font-weight: 700; font-size: .9rem; color: #1a1f36; margin-bottom: 4px; }
.ai-toast-msg   { font-size: .82rem; color: #64748b; line-height: 1.4; }
.ai-toast-close {
    position: absolute;
    top: -6px;
    right: -6px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 2px;
}
.ai-toast-close:hover { color: #475569; }
@keyframes ai-toast-in  { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ai-toast-out { from { opacity: 1; transform: translateY(0); }  to { opacity: 0; transform: translateY(20px); } }

/* Vapore sulla tazzina SVG */
.ai-steam { animation: ai-steam-rise 1.2s ease-in-out infinite; opacity: 0; }
.ai-steam-1 { animation-delay: 0s; }
.ai-steam-2 { animation-delay: .4s; }
.ai-steam-3 { animation-delay: .8s; }
@keyframes ai-steam-rise {
    0%   { opacity: 0; transform: translateY(0); }
    50%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-4px); }
}

/* Overlay che blocca le sezioni mentre l'AI lavora */
.ai-block-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(255,255,255,.88);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 40px;
    border-radius: inherit;
}
.ai-block-overlay .ai-block-msg {
    max-width: 500px;
    background: #fff;
    border: 1px solid var(--ai-accent-tint);
    border-left: 4px solid var(--ai-accent);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    padding: 14px 18px;
    font-size: .85rem;
    color: #334155;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.ai-block-overlay .ai-banner-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--ai-accent-tint);
    border-top-color: var(--ai-accent);
    border-radius: 50%;
    animation: ai-spin .8s linear infinite;
    flex-shrink: 0;
}

/* AI job sidebar widget */
.ai-job-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.75rem;
    color: #475569;
    line-height: 1.3;
}
.ai-job-item .ai-job-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top-color: #FF9B00;
    border-radius: 50%;
    animation: ai-spin 0.8s linear infinite;
    flex-shrink: 0;
}
.ai-job-item .ai-job-check {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #16a34a;
}
.ai-job-item .ai-job-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ai-job-item .ai-job-elapsed {
    font-size: 0.65rem;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}
.ai-job-item.done { color: #16a34a; }
.ai-job-item.done .ai-job-elapsed { color: #16a34a; }

/* Flow view coffee overlay during AI processing */
.fe-ai-coffee-overlay {
    position: absolute;
    inset: 0;
    z-index: 15;
    background: rgba(255,255,255,.92);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Stato disabilitato "visibile" per i bottoni durante processing AI */
.ai-disabled {
    opacity: .5 !important;
    pointer-events: none !important;
    filter: grayscale(.3);
}

/* Documentation section toggle tabs */
#doc_section_toggle {
    display: inline-flex;
    align-items: center;
    background: #f0f2f5;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}
.doc-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #555;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.doc-tab-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}
.doc-tab-btn:hover {
    background: #e2e6ea;
    color: #333;
}
.doc-tab-btn.active {
    background: #ff9b00;
    color: #fff;
    box-shadow: 0 1px 3px rgba(255, 155, 0, 0.35);
    font-weight: 600;
}
.doc-tab-btn.active:hover {
    background: #e88e00;
    color: #fff;
}

.step-carousel-viewport {
    background: #f8f9fa;
}
.step-carousel-viewport img {
    max-height: 200px;
    width: 100%;
    object-fit: contain;
    margin: 0 auto;
}
.step-carousel-slide {
    position: relative;
}
.step-carousel-slide .step-slide-img-wrap {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
    position: relative;
    overflow: hidden;
}
.step-carousel-slide .step-slide-img-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24' fill='none' stroke='%23c5c9ce' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpolyline points='21 15 16 10 5 21'/%3E%3C/svg%3E") center center / 40px 40px no-repeat;
    pointer-events: none;
    z-index: 0;
}
.step-carousel-slide .step-slide-img-wrap.img-ready::before {
    display: none;
}
.step-carousel-slide .step-slide-img-wrap img {
    position: relative;
    z-index: 1;
}
.step-carousel-overlay {
    z-index: 2;
}
.step-no-image-placeholder {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    color: #adb5bd;
    flex-direction: column;
    gap: 6px;
}
.step-carousel-prev,
.step-carousel-next {
    border-radius: 50%;
    width: 26px;
    height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.step-carousel-export-count {
    margin-top: 2px;
}
.btn-xs {
    padding: 1px 6px;
    font-size: 0.65rem;
    line-height: 1.4;
    border-radius: 3px;
}
.lightbox-close-btn:hover {
    background: rgba(255,255,255,0.2) !important;
    color: #f1f5f9 !important;
}
.lightbox-prev-btn:hover:not(:disabled),
.lightbox-next-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.25) !important;
    border-color: rgba(255,255,255,0.3) !important;
}
.step-slide-controls {
    background: #fafbfc;
    border-top: 1px solid #eee;
}
.step-img-variant-row .btn.btn-primary {
    pointer-events: none;
}
#step-add-img-floating-menu a:hover {
    background: #f0f2f5;
}