/*
  You can add custom CSS rules or import files here.
*/


/* Import the Radzen CSS files */
@import './styles-generated.css';

/* LoginControl: Logout — testo #35a0d7, senza sfondo (Variant.Text + override tema) */
.login-control-logout.rz-button {
    color: #35a0d7 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.login-control-logout.rz-button:hover {
    background: rgba(53, 160, 215, 0.1) !important;
    color: #35a0d7 !important;
}

/* POS map tooltip card */
.leaflet-tooltip.pos-map-tooltip {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.pos-map-tooltip-card {
    min-width: 190px;
    width: max-content;
    max-width: min(320px, 70vw);
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.97);
    border-left: 5px solid #6b7280;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.20);
    color: #1f2937;
    font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    white-space: normal;
    box-sizing: border-box;
}

.pos-map-tooltip-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pos-map-tooltip-desc {
    margin-top: 4px;
    font-size: 0.85rem;
    line-height: 1.25;
    color: #4b5563;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pos-map-tooltip-status {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.pos-map-tooltip-card-normal {
    border-left-color: #2fb344;
}

.pos-map-tooltip-card-warning {
    border-left-color: #35a0d7;
}

.pos-map-tooltip-card-alert {
    border-left-color: #f59f00;
}

.pos-map-tooltip-card-error {
    border-left-color: #e03131;
}

.pos-map-tooltip-card-unknown {
    border-left-color: #495057;
}

.pos-map-tooltip-status-normal {
    background: #e8f7ef;
    color: #1f7a43;
}

.pos-map-tooltip-status-warning {
    background: #e7f5ff;
    color: #1864ab;
}

.pos-map-tooltip-status-alert {
    background: #fff4db;
    color: #a15c00;
}

.pos-map-tooltip-status-error {
    background: #ffe3e3;
    color: #c92a2a;
}

.pos-map-tooltip-status-unknown {
    background: #f1f3f5;
    color: #495057;
}

/* POS map cluster: stesso colore per tutti i cluster, a prescindere dal numero di marker.
   Sovrascrive le classi small/medium/large di Leaflet.markercluster (verde/giallo/arancio). */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(53, 160, 215, 0.3);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: rgba(53, 160, 215, 0.85);
    color: #ffffff;
}

/* Radzen Notification: default.css fissa ~250px e il testo lungo (es. ex.Message) esce dai margini */
.rz-notification-item-wrapper {
    width: auto !important;
    max-width: min(560px, 92vw) !important;
    min-width: min(18rem, 92vw) !important;
}

.rz-notification-message-wrapper {
    min-width: 0;
}

.rz-notification-message,
.rz-notification-title,
.rz-notification-content {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

/* Radzen Alert / Confirm: max-width 400px in default.css; messaggi lunghi senza a capo */
.rz-dialog-alert,
.rz-dialog-confirm {
    max-width: min(520px, 94vw) !important;
    box-sizing: border-box;
}

.rz-dialog-alert-message,
.rz-dialog-confirm-message {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Font: Source Sans Pro (come in Radzen 4 / setup precedente) */
html, body {
    font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Spacing between form rows in dialogs and forms (replaces Bootstrap row margin) */
.rz-dialog-content > div,
form.rz-templatform > div,
form.rz-form > div {
    margin-bottom: 1rem;
    gap: 1rem;
}
.rz-dialog-content > div:last-child,
form.rz-templatform > div:last-child,
form.rz-form > div:last-child {
    margin-bottom: 0;
}

.rz-datatable-thead th .rz-column-title, .rz-grid-table thead th .rz-column-title {
    font-size: 0.85rem;
    /*text-transform: uppercase;*/
    /*color: #3a474d;*/
    /*padding: 0 0 0.625rem 0.625rem;*/
    font-weight: bold;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.rz-fileupload-buttonbar > .rz-fileupload-choose {
    /*font-size: 1.0625rem;*/
    background-color: #ff6d41;
    padding: 0px;
    /*height: 1rem;*/
    /*min-width: 140px;*/
    text-align: center;
    /*align-content: center;*/
    /*vertical-align:sub;*/
    width: 100%;
}

/*.rz-fileupload-choose:hover {
    color: black;
}
*/ /*.rz-fileupload-buttonbar > .rz-fileupload-choose rz-button {
    padding: 0px;
}
*/
.rz-grid-table .rz-cell-data .rz-fileupload .rz-button {
    padding: 0px;
    line-height: 1.5rem;
}

/* Upload nella colonna azioni del grid: stessa dimensione dei pulsanti Small icon-only */
.rz-grid-table .rz-cell-data .rz-fileupload .rz-fileupload-choose,
.rz-grid-table .rz-cell-data .rz-fileupload .rz-fileupload-buttonbar .rz-button {
    height: 1.75rem !important;
    min-height: 1.75rem;
    width: 1.75rem !important;
    min-width: 1.75rem;
    max-width: 1.75rem;
    padding: 0 !important;
    line-height: 1.75rem;
    font-weight: normal;
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}
.rz-grid-table .rz-cell-data .rz-fileupload .rz-fileupload-buttonbar {
    width: auto !important;
}

.rz-fileupload .rz-button .rzi {
    vertical-align: middle;
}

.rz-fileupload .rz-button .rz-button-text {
    line-height: 2rem;
    /*vertical-align: sub;*/
}

.rz-fileupload-buttonbar {
    background-color: #ff6d41;
    padding: 0px;
    /*width: fit-content;*/
}

.rz-fileupload-content {
    min-height: 0px;
    height: 0px;
    min-width: 0px;
    width: 0px;
    padding: 0px;
    visibility: collapse;
}

.rz-fileupload-files {
    min-height: 0px;
    height: 0px;
    min-width: 0px;
    width: 0px;
    padding: 0px;
    visibility: collapse;
}

.rz-fileupload-row {
    min-height: 0px;
    height: 0px;
    min-width: 0px;
    width: 0px;
    padding: 0px;
    visibility: collapse;
}

.ui-datalist-data > li, .ui-g > div {
    border-width: 0px;
}

/* ========== CorrectionPL (pagina correzione pre-correzione) - stili globali in styles.css ========== */
/* Prefisso .cpl- e scope .cpl-dialog-layout per distinguere da stili locali */

/* Dialog correzione: adattamento a schermi piccoli (mai più grandi del viewport) */
.rz-dialog:has(.cpl-dialog-layout),
.rz-dialog:has(.cr-dialog-layout) {
    max-width: 100vw;
    max-height: 100vh;
}

    .rz-dialog:has(.cpl-dialog-layout) .rz-dialog-content,
    .rz-dialog:has(.cr-dialog-layout) .rz-dialog-content {
        max-height: calc(100vh - 80px);
        display: flex;
        flex-direction: column;
        padding: 5px !important;
    }

/* Layout dialog: colonna con body scrollabile e footer sticky in basso */
.cpl-dialog-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.cpl-dialog-body {
    flex: 1 1 auto;
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Layout wizard con tabs verticali a sinistra e contenuto a destra */
.cpl-wizard-layout {
    display: flex;
    flex-direction: row;
    height: 100%;
    min-height: 0;
    gap: 0;
}

.cpl-wizard-tabs {
    flex: 0 0 40%;
    min-width: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid rgba(0,0,0,.08);
    background: rgba(0,0,0,.02);
}

.cpl-wizard-content {
    flex: 0 0 60%;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
}

.cpl-step-content {
    width: 100%;
    height: 100%;
}

/* Tabs verticali Radzen */
.cpl-step-tabs.rz-tabview {
    width: 100%;
}

    .cpl-step-tabs.rz-tabview .rz-tabview-nav {
        flex-direction: column;
        width: 100%;
        border-right: none;
    }

        .cpl-step-tabs.rz-tabview .rz-tabview-nav li {
            width: 100%;
            margin: 0;
            border-bottom: 1px solid rgba(0,0,0,.08);
        }

            .cpl-step-tabs.rz-tabview .rz-tabview-nav li a {
                width: 100%;
                padding: 12px 16px;
                text-align: left;
                justify-content: flex-start;
            }

            .cpl-step-tabs.rz-tabview .rz-tabview-nav li.rz-tabview-selected a {
                background: rgba(0,0,0,.08);
                font-weight: 600;
            }

    .cpl-step-tabs.rz-tabview .rz-tabview-panels {
        display: none; /* Nascondiamo i panel di Radzen, usiamo il contenuto custom */
    }

/* Selezione linea prodotto (fuori dai tab) */
.cpl-productline-selector {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0,0,0,.08);
    background: rgba(0,0,0,.02);
    flex-shrink: 0;
}

/* Intestazione superiore con informazioni formula */
.cpl-toprow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.08);
    flex-shrink: 0;
}

.cpl-toprow-left {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
}

.cpl-toprow-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(0,0,0,.8);
}

.cpl-toprow-units {
    flex-shrink: 0;
}

/* Footer della dialog: sempre in basso al centro */
.cpl-dialog-footer {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    flex-shrink: 0;
    margin-top: auto;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(0,0,0,.08);
    background: var(--rz-base-background-color, #fff);
    width: 100%;
}

/* Card sinistra come ChromaShop FormulaCorrection */
.cpl-left-card {
    background: var(--rz-base-background-color, #fff);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.cpl-info-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

    .cpl-info-row .cpl-field-label {
        width: 120px;
        flex-shrink: 0;
    }

/* Anteprima colori Target | Batch come ChromaShop (Std / Trial) */
.cpl-color-preview {
    display: flex;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    max-width: 280px;
}

.cpl-color-preview-box {
    flex: 1;
    height: 48px;
    min-width: 80px;
    border: 1px solid rgba(0,0,0,.15);
}

.cpl-color-preview-labels {
    display: flex;
    gap: 0;
    max-width: 280px;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #666;
}

    .cpl-color-preview-labels span {
        flex: 1;
        text-align: center;
    }

/* Card destra (QC + LAB + Riflettanze) */
.cpl-right-card {
    background: var(--rz-base-background-color, #fff);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* Griglia delta come ChromaShop (ΔE*, ΔL*, Δa*, Δb*, Met) */
.cpl-delta-grid-wrap {
    border: 1px solid #d3d3d3;
    padding: 6px;
    margin-bottom: 8px;
}

.cpl-delta-header, .cpl-delta-values {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    text-align: center;
}

.cpl-delta-header {
    font-weight: 600;
    font-size: 0.95rem;
    padding-bottom: 4px;
}

.cpl-delta-values {
    border-top: 1px solid #d3d3d3;
    padding-top: 6px;
    font-size: 1rem;
}

.cpl-passfail-bar {
    padding: 8px;
    text-align: center;
    border-radius: 4px;
    font-weight: 600;
}

/* Tab Diagramma LAB / Riflettanze nel Controllo qualità (solo uno visibile, meno spazio) */
.cpl-qc-subtabs {
    width: 100%;
    min-height: 200px;
}

.cpl-qc-subtabs .cpl-qc-subtab-panel {
    padding: 0.5rem 0;
    min-height: 120px;
}

/* Diagramma LAB nel tab Controllo qualità (CorrectionPL) – dimensioni leggermente maggiori */
.cpl-qc-subtabs .lab-diagram-wrap {
    width: 340px;
    max-width: 100%;
    height: 180px;
    min-height: 120px;
}

.cpl-field-label {
    width: 100%;
    font-weight: 600;
    opacity: .85;
}

/* Fieldset */
.cpl-fieldset-inner {
    padding: .4rem .6rem .6rem .6rem;
}

.cpl-hint {
    font-size: small;
    color: #666;
    width: 100%;
    display: block;
    margin-bottom: 10px;
}

/* Diagramma LAB come ChromaShop (WPF), ingrandito 2x per leggibilità */
.cpl-lab-diagram-wrap {
    width: 320px;
    height: 170px;
}

    .cpl-lab-diagram-wrap svg {
        width: 100%;
        height: 100%;
        display: block;
    }

/* Anteprima Target | Campione sotto i dropdown nel tab Campione */
.cpl-dialog-layout .cpl-campione-color-preview {
    margin-top: 16px;
    max-width: 320px;
}

.cpl-color-option {
    margin-top: -5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0.25rem;
    min-height: 1.75rem; /* swatch 15px + riga testo; non più height: 1rem che tagliava il quadratino */
}

.cpl-color-option-text {
    margin: 0;
    padding: 0;
    line-height: 1.35;
}

.cpl-dialog-layout .cpl-color-option-swatch {
    /* display inline-block da SetBackColorListColors; qui solo coerenza con flex */
    flex-shrink: 0;
}

/* Correzione avanzata */
.cpl-advanced-correction-fieldset {
    margin-top: 5px;
}

.cpl-advanced-correction {
    padding: .4rem .6rem;
}

.cpl-original-colorants {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0.5rem;
}

.cpl-colorant-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,.12);
    min-height: 28px;
    background: var(--rz-base-background-color, #fff);
}

.cpl-colorant-chip-swatch {
    flex-shrink: 0;
    border-radius: 2px;
    border: 1px solid rgba(0,0,0,.15);
}

.cpl-colorant-chip-code {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(0,0,0,.8);
    white-space: nowrap;
}

/* Chip originali: già selezionati, disattivati (solo lettura) — cornice più evidente */
.cpl-colorant-chip--disabled {
    opacity: 0.9;
    cursor: default;
    border: 2px solid rgba(0,0,0,.35);
    background: rgba(0,0,0,.06);
    box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}

/* Chip nella griglia correzione avanzata: selezionabili (stesso aspetto degli originali) */
.cpl-colorant-chip--selectable {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.cpl-colorant-chip--selectable:hover {
    border-color: rgba(0,0,0,.25);
    background: rgba(0,0,0,.02);
}

.cpl-colorant-chip--selectable:focus {
    outline: none;
}

.cpl-colorant-chip--selectable:focus-visible {
    outline: 2px solid var(--rz-primary, #3b82f6);
    outline-offset: 2px;
}

.cpl-colorant-chip--selectable.cpl-colorant-chip--selected {
    border-color: var(--rz-primary, #3b82f6);
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 0 0 1px var(--rz-primary, #3b82f6);
}

/* Dropdown coloranti aggiuntivi (come FormulationPL) */
.cpl-dropdown-option.cpl-dropdown-option--colorant {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.25rem;
    min-height: 2rem;
}

.cpl-dropdown-option--colorant .cpl-dropdown-swatch {
    flex-shrink: 0;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,.15);
}

.cpl-dropdown-option--colorant .cpl-dropdown-text {
    font-size: 0.875rem;
}

/* ========== CorrectionResults (dialog risultati correzione) - stili globali in styles.css ========== */
/* Prefisso .cr- per distinguere da stili locali di altri componenti */

/* Layout dialog: colonna con body scrollabile e footer sticky in basso */
.cr-dialog-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.cr-dialog-body {
    flex: 1 1 auto;
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
/* Footer: flex layout (no absolute) - resta in basso grazie al flex del parent */
.cr-dialog-footer {
    width: 100%;
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(0,0,0,.08);
    background: var(--rz-base-background-color, #fff);
}

.cr-dialog-footer-buttons {
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cr-dialog-footer-buttons .cr-dialog-footer-btn {
    min-width: 140px;
    flex: 1 1 0;
}

/* Card structure (CorrectionResults refactor) */
.cr-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.cr-card-header {
    padding: 6px 8px;
    background: rgba(0,0,0,.06);
    font-weight: 600;
    font-size: 1rem;
}
.cr-card-body {
    padding: 8px;
}

/* Colorant row (semplificato) */
.cr-colorant-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0,0,0,.06);
}
.cr-colorant-row:last-child {
    border-bottom: none;
}
.cr-color-box {
    width: 20px;
    height: 12px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,.15);
}
.cr-color-code {
    font-weight: 500;
    min-width: 60px;
}
.cr-color-value {
    margin-left: auto;
    font-size: 0.9rem;
}
.cr-colorant-list {
    margin: 8px 0;
}

/* Layout dialog ChromaShop (CorrectedFormulaView) */
.cr-header-close {
    margin-left: auto;
}

.cr-toprow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.08);
    flex-shrink: 0;
}

.cr-toprow-left {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
}

.cr-toprow-label {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(0,0,0,.8);
}

.cr-toprow-units {
    flex-shrink: 0;
}

/* Griglia 1:2 fissa (come col-md-4 / col-md-8): il flex faceva variare le larghezze al cambio tab / contenuto */
.cr-panels.row {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 6px 6px 6px;
    margin-top: 0;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow: hidden;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    column-gap: 0;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}

.cr-panels.row > .cr-panel.col-md-4,
.cr-panels.row > .cr-panel.col-md-8 {
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
}

.cr-panel {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.08);
    height: 100%;
    min-height: 0;
}

.cr-panel--border {
    border-right: 1px solid rgba(0,0,0,.08);
}

.cr-panel--reformulated {
    background-color: rgba(33, 150, 243, 0.04);
}
/* Riga unica: Origine e tab Aggiunta/Riformulata stesso stile e stessa altezza */
.cr-header-row {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 8px;
    background: rgba(0,0,0,.06);
    border-bottom: 1px solid rgba(0,0,0,.08);
    font-size: 0.875rem;
    font-weight: 500;
}

.cr-header-tab {
    color: rgba(0,0,0,.75);
}

.cr-header-tab--active {
    color: rgba(0,0,0,.9);
}
/* Tab Radzen: stesse dimensioni e stile di cr-header-row */
.cr-correction-tabs.rz-tabview .rz-tabview-nav {
    max-height: 40px;
    background: rgba(0,0,0,.06);
    border-bottom: 1px solid rgba(0,0,0,.08);
    padding: 0;
}

    .cr-correction-tabs.rz-tabview .rz-tabview-nav li {
        margin: 0;
    }

        .cr-correction-tabs.rz-tabview .rz-tabview-nav li a {
            font-size: 0.875rem !important;
            font-weight: 500 !important;
            padding: 0 8px !important;
            min-height: 40px;
            display: flex;
            align-items: center;
        }

    .cr-correction-tabs.rz-tabview .rz-tabview-nav .rz-tabview-selected a {
        font-weight: 600;
    }

.cr-panel-body--no-top-padding {
    padding-top: 0 !important;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cr-panel-header {
    padding: 6px 8px;
    background: rgba(0,0,0,.06);
    font-weight: 600;
    font-size: 1rem;
}

.cr-panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.cr-panel-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 8px;
    text-align: center;
}

/* Tab Origine: front (ΔE, 4 metriche, base, lista, Dettagli) — stesso layout colonna Aggiunta: contenuto sopra, bottone Dettagli fisso in fondo */
.cr-origine-front {
    padding-top: 4px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow: hidden;
}

.cr-origine-deltae {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 6px;
    min-height: 52px;
}

    .cr-origine-deltae .rz-text {
        font-weight: 700;
        font-size: 1.25rem;
        line-height: 1.2;
    }

.cr-origine-label {
    font-size: 0.75rem;
    color: rgba(0,0,0,.6);
    white-space: nowrap;
    flex-basis: 100%;
    text-align: center;
    margin-top: 2px;
}

.cr-origine-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(58px, 1fr));
    gap: 8px 10px;
    text-align: center;
}

.cr-origine-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    font-size: 0.9rem;
    min-width: 0;
    min-height: 56px;
}

    .cr-origine-metric > span:first-of-type {
        line-height: 1.2;
        font-variant-numeric: tabular-nums;
    }

.cr-origine-metric-label {
    font-size: 0.68rem;
    color: rgba(0,0,0,.55);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.cr-origine-sep {
    margin: 4px 0;
    border: none;
    border-top: 1px solid rgba(0,0,0,.08);
}

.cr-origine-base {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.cr-origine-base-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cr-origine-base-qty {
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    margin-left: 8px;
}

.cr-origine-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.cr-correction-tabs .rz-tabview-panel {
    padding: 3px;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tab Origine: back (Dettagli = LAB + tabella delta) */
.cr-origine-back {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
}

.cr-origine-back-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .cr-origine-back-header span {
        font-size: 0.95rem;
        font-weight: 500;
    }

/* Tab Aggiunta: Delta E sopra le metriche (come Origine) */
.cr-aggiunta-front {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    width: 100%;
}
/* Come Origine: 4 colonne (Metamerismo, Coprenza, Prezzo, Riflessione) */
.cr-aggiunta-metrics {
    width: 100%;
    grid-template-columns: repeat(4, minmax(58px, 1fr));
    gap: 8px 10px;
}

    .cr-aggiunta-metrics .cr-origine-metric {
        min-width: 0;
        min-height: 56px;
    }

.cr-aggiunta-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.cr-aggiunta-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cr-aggiunta-btn-icon {
    min-width: 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
}

    .cr-aggiunta-btn-icon .rz-button-icon {
        margin: 0;
    }

/* Riformulata: riga DeltaE + Metamerism come WPF */
.cr-reformulated-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.cr-reformulated-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.cr-reformulated-base {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.9rem;
}
/* Contenuto tab Aggiunta/Riformulata: due colonne 50% | 50% fisse (grid, non flex che ridefiniva le basi) */
.cr-tab-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    min-height: 0;
    height: 100%;
    width: 100%;
    padding: 3px !important;
    overflow: hidden;
    box-sizing: border-box;
}

.cr-tab-left {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow: hidden;
}

.cr-tab-right {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow: hidden;
}

/* Pannello grafico stile ChromaShop: grafico sopra, due bottoni sotto per LAB / Riflettanze. Altezza fissa per evitare resize del dialog al cambio vista. */
.cr-graph-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 240px;
    min-height: 240px;
    flex-shrink: 0;
}

.cr-graph-panel .cr-graph-area {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    overflow: hidden;
}

.cr-graph-panel .cr-graph-area .cr-lab-wrap,
.cr-graph-panel .cr-graph-area .cr-reflectance-wrap {
    width: 100%;
    min-height: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cr-graph-panel .cr-graph-area .cr-reflectance-wrap .rz-chart {
    min-height: 180px;
}

.cr-graph-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 4px 0;
}

.cr-graph-toggle-btn {
    min-width: 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
}

.cr-graph-toggle-btn--active {
    background: rgba(0, 0, 0, 0.08);
}

    .cr-tab-right .cr-lab-wrap {
        width: 100%;
        flex: 1;
        max-height: 190px;
    }

    .cr-tab-right .cr-reflectance-wrap {
        width: 100%;
        flex-shrink: 0;
        min-height: 200px;
    }

    .cr-tab-right .cr-delta-table-wrap {
        width: 100%;
        flex-shrink: 0;
        margin-top: 4px;
    }

.cr-lab-and-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.cr-lab-wrap {
    width: 100%;
    max-width: 100%;
}

.cr-delta-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 4px;
    background: #fafafa;
}

.cr-delta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

    .cr-delta-table th,
    .cr-delta-table td {
        padding: 4px 8px;
        text-align: right;
    }

    .cr-delta-table th {
        font-weight: 600;
        background: rgba(0,0,0,.04);
    }

    .cr-delta-table .cr-delta-label {
        text-align: right;
        font-weight: 500;
    }

    .cr-delta-table .cr-delta-val {
        font-variant-numeric: tabular-nums;
    }

/* Responsive: su schermi piccoli, tab-content e pannelli a colonna singola */
@media (max-width: 768px) {
    .cr-panels.row {
        grid-template-columns: 1fr;
    }

    .cr-tab-content {
        grid-template-columns: 1fr;
    }
}

/* Header */
.cpl-title {
    font-size: x-large;
    font-weight: 700;
}

/* Divider */
.cpl-divider {
    border: none;
    background-color: rgba(0,0,0,.08);
    height: 1px;
    margin: 1rem 0;
}

/* 3-column grid */
.cpl-grid {
    margin: 0;
}

.cpl-col {
    padding: 0 15px;
}

.cpl-col--border {
    border-right: 1px solid rgba(0,0,0,.08);
}

.cpl-col--reformulated {
    background-color: rgba(33, 150, 243, 0.03);
    border-radius: 4px;
    padding: 10px 15px;
}

.cpl-col-header {
    margin-bottom: 1rem;
    display: grid;
    gap: .35rem;
}

.cpl-col-title {
    font-weight: 700;
}

.cpl-metrics {
    margin-bottom: 1rem;
    display: grid;
    gap: .5rem;
}

/* ΔL* Δa* Δb* ΔC* ΔH* su due colonne */
.cpl-delta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.cpl-list {
    width: 100%;
}

/* Lista coloranti: una riga per colorante, nessuna griglia a 2 colonne */
.cpl-colorants .rz-datalist-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Margin zero, padding solo sinistra/destra per gli item delle colorant card */
.cpl-colorants .rz-g > div,
.cpl-colorants .rz-datalist-data > li,
.cpl-colorants--addition .rz-g > div,
.cpl-colorants--addition .rz-datalist-data > li {
    margin: 0 !important;
    padding: 0 2px !important;
}

/* Card = una riga: colonna 1 = RGB + codice, colonna 2 = quantità (colonna distinta), altezza 36px contenuto centrato */
.cpl-colorant-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(80px, auto);
    align-items: center;
    gap: 8px 10px;
    background: var(--rz-base-background-color, #fff);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 6px;
    padding: 0 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    overflow: hidden;
    box-sizing: border-box;
}

/* Colonna colorante: barra RGB + codice, allineati al centro della riga 36px */
.cpl-colorant-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
    height: 36px;
}

/* Colonna quantità: larghezza minima, testo centrato verticalmente nella riga 36px */
.cpl-colorant-right {
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 36px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 70px;
    flex-shrink: 0;
}

.cpl-colorant-bar {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    flex: 0 0 22px;
    flex-shrink: 0;
}

.cpl-colorant-code {
    font-size: 12px;
    font-weight: 600;
    color: rgba(0,0,0,.75);
    line-height: 36px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.cpl-colorant-value {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: rgba(0,0,0,.65);
    line-height: 36px;
    display: flex;
    align-items: center;
}

/* Aggiunta: colonna quantità con quantità aggiunta e totale sulla stessa riga, centrati in 36px */
.cpl-colorant-value--two-cols {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
    line-height: 36px;
}

    .cpl-colorant-value--two-cols .cpl-addition {
        font-weight: 600;
        color: rgba(0, 120, 0, .9);
        line-height: 36px;
        display: flex;
        align-items: center;
    }

    .cpl-colorant-value--two-cols .cpl-total {
        font-size: 12px;
        color: rgba(0,0,0,.65);
        line-height: 36px;
        display: flex;
        align-items: center;
    }

/* ========== Correction PL - stili locali da CorrectionPL.razor (tab header, swatch, grid) ========== */
/* Scoped sotto .cpl-dialog-layout per non interferire con altre pagine */

.cpl-dialog-layout .rz-tabs-nav li a,
.cpl-dialog-layout .rz-tabview-nav li a {
    height: auto !important;
    display: block !important;
    white-space: normal !important;
    padding-top: 8px;
    padding-bottom: 8px;
}

.cpl-dialog-layout .rz-tabs-nav li,
.cpl-dialog-layout .rz-tabview-nav li {
    align-items: flex-start;
}

.cpl-dialog-layout .tabhdr-swatch {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cpl-dialog-layout .tabhdr-swatch-row,
.cpl-dialog-layout .tabhdr-swatch-labels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 0;
}

.cpl-dialog-layout .tabhdr-swatch-box {
    height: 34px;
    border: 1px solid rgba(0,0,0,.25);
}

.cpl-dialog-layout .tabhdr-swatch-row .tabhdr-swatch-box:first-child {
    border-right: none;
    border-radius: 4px 0 0 4px;
}

.cpl-dialog-layout .tabhdr-swatch-row .tabhdr-swatch-box:last-child {
    border-radius: 0 4px 4px 0;
}

.cpl-dialog-layout .tabhdr-swatch-labels span {
    text-align: center;
    font-size: 12px;
    line-height: 1;
    opacity: .8;
}

.cpl-dialog-layout .tabhdr-title {
    font-weight: 600;
    line-height: 1;
    font-size: 14px;
    text-align: left;
}

.cpl-dialog-layout .tabhdr {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cpl-dialog-layout .tabhdr-caption {
    text-align: left;
    font-size: 12px;
    line-height: 1;
    opacity: .8;
}

.cpl-dialog-layout .tabhdr-colorant-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-start;
    align-items: center;
}

.cpl-dialog-layout .tabhdr-colorant-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0,0,0,.2);
    flex-shrink: 0;
}

.cpl-dialog-layout .cpl-colorants-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.rz-align-items-normal {
    align-items: center !important;
}

/* popup chat AI */
.cs-aichat {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.cs-aichat__fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--rz-primary, #1f6feb);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cs-aichat__fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.cs-aichat__fab .rzi,
.cs-aichat__fab .notranslate {
    font-size: 26px;
}

.cs-aichat__panel {
    display: none;
    flex-direction: column;
    width: 360px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 140px);
    background: var(--rz-base-background-color, #fff);
    border: 1px solid var(--rz-border-color, rgba(0, 0, 0, 0.12));
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.cs-aichat__panel--open {
    display: flex;
}

.cs-aichat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--rz-primary, #1f6feb);
    color: #fff;
    flex-shrink: 0;
}

.cs-aichat__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.cs-aichat__close {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
}

.cs-aichat__body {
    flex: 1;
    min-height: 0;
    display: flex;
}

.cs-aichat__body .rz-chat {
    flex: 1;
    min-height: 0;
}

