﻿/*
 * app-variables.css
 * Token di design centralizzati per l'intera applicazione.
 * Consolida: css/Variables/variabili.css + variabili app-wide.
 * Le variabili SCADA specifiche (spie, zoom) sono mantenute qui per coerenza.
 */

:root {
    /* ---- BORDI E RAGGI ---- */
    --objectBorder: 0.1rem;
    --objectBorderRadius: 0.2rem;
    --primaryBorderColor: rgba(127, 127, 127, 0.5);
    /* ---- SPAZIATURA OGGETTI ---- */
    --objectPaddingTop: 0.8rem;
    --objectPaddingRight: 1rem;
    /* ---- POPUP ---- */
    --popupIndex: 1040;
    --popupBg: rgba(0, 0, 0, 0.8);
    --popupContentBg: whitesmoke;
    --popupBorderRadius: 1.2rem;
    --popupBoxShadow: 4px 6px 13px black;
    /* ---- ALTEZZE GRUPPI DOSAGGIO ---- */
    --headerStock: 4.5rem;
    --scaleHeight: 20rem;
    /* ---- TIPOGRAFIA ---- */
    --fontSizeSmall: 1rem;
    --fontSizeMedium: 1.2rem;
    --fontSizeBig: 2.5rem;
    /* ---- SKIP / SPAZIATURE GLOBALI ---- */
    --widthSkip: 3rem;
    --heightSkip: 2rem;
    --textCenterSkip: center;
    /* ---- SPIE (componenti SCADA) ---- */
    --spiaHeight: 1rem;
    --spiaWidthFactor: 1;
    --spiaBorderWidth: 0.1rem;
    --spiaBorderWidthSmall: 0.1rem;
    --spiaBorderWidthMedium: 0.2rem;
    --spiaBorderWidthBig: 0.35rem;
    --spiaBorderRadius: 0%;
    --spiaAdjustment: 1;
    --spiaSmall: 0.8rem;
    --spiaMedium: 1rem;
    --spiaBig: 1.5rem;
    --spiaVeryBig: 2rem;
    --spiaToggleTopSmall: 0.8rem;
    --spiaToggleleftSmall: 0.8rem;
    --spiaToggleTopMedium: 0.6rem;
    --spiaToggleleftMedium: 0.4rem;
    --spiaToggleTopBig: 0.8rem;
    --spiaToggleleftBig: 0.6rem;
    --spiaToggleTopVeryBig: 1rem;
    --spiaToggleleftVeryBig: 0.8rem;
    --spiaToogleColor: transparent;
    --spiaImageBig: 15rem;
    --spiaAnimation: '';
    --spiaBorderColor: black;
    /* ---- POSIZIONAMENTO ASSOLUTO ---- */
    --absoluteX: 50%;
    --absoluteY: 50%;
    --absoluteXTranslation: -50%;
    --absoluteYTranslation: -50%;
    /* ---- COLORI SEMANTICI (stati impianto) ---- */
    --colorBlack: black;
    --colorGreen: lightgreen;
    --colorLimegreen: limegreen;
    --colorRed: red;
    --colorYellow: yellow;
    --colorBlue: deepskyblue;
    --colorBrown: sandybrown;
    --colorLightgray: lightgray;
    --colorGray: gray;
    --colorWhite: whitesmoke;
    --colorOrange: rgb(239, 130, 6);
    /* ---- ZOOM SCADA ---- */
    --zoom: 60.5%;
    --nozoom: 100%;
    /* ---- TABLET MENU (legacy, mantenuto per compatibilità) ---- */
    --tabletMenu_Dock_Grid_colum: 7;
    /* ---- CHAT / AI WIDGET ---- */
    --chat-primary: #4f46e5;
    --chat-primary-dark: #4338ca;
    --chat-primary-light: #c7d2fe;
    --chat-error: #ef4444;
    --chat-gray-50: #f9fafb;
    --chat-gray-100: #f3f4f6;
    --chat-gray-200: #e5e7eb;
    --chat-gray-300: #d1d5db;
    --chat-gray-400: #9ca3af;
    --chat-gray-500: #6b7280;
    --chat-gray-700: #374151;
    --chat-gray-800: #1f2937;
    --chat-text-color: #374151;
    --chat-border-radius: 12px;
    --chat-transition: 0.3s all ease;
}



/* ============================================================
   CompuNet Sidebar — cn- namespace
   Nessun conflitto con stili esistenti
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600&family=Share+Tech+Mono&display=swap');

/* --- Contenitore principale --- */
.cn-sb {
    width: 100%;
    height: 100%;
    background: #2b2d35;
    display: flex;
    flex-direction: column;
    font-family: 'Rajdhani', sans-serif;
    border-right: 1px solid #3a3d4a;
    overflow: hidden;
    position: relative;
}

    .cn-sb::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: linear-gradient(90deg, transparent, #4fc3f7, transparent);
        z-index: 1;
    }

/* --- Header (Menu + coordinate) --- */
.cn-sb-head {
    padding: 12px 14px 10px;
    border-bottom: 1px solid #3a3d4a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #23252d;
    flex-shrink: 0;
}

.cn-sb-head-title {
    font-size: 14px;
    font-weight: 600;
    color: #4fc3f7;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin: 0;
}

.cn-sb-head-coords {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: #8a9bb5;
    letter-spacing: 0.05em;
}

/* --- Icona edit --- */
.cn-sb-icon-row {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 0 10px;
    border-bottom: 1px solid #3a3d4a;
    flex-shrink: 0;
}

.cn-sb-edit-badge {
    width: 36px;
    height: 36px;
    border: 1px solid #4fc3f7;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4fc3f7;
    font-size: 17px;
    background: #323540;
}

/* --- Area categorie scrollabile --- */
.cn-sb-cats {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: #3a3d4a transparent;
}

    .cn-sb-cats::-webkit-scrollbar {
        width: 4px;
    }

    .cn-sb-cats::-webkit-scrollbar-track {
        background: transparent;
    }

    .cn-sb-cats::-webkit-scrollbar-thumb {
        background: #3a3d4a;
        border-radius: 2px;
    }

/* --- Singola categoria (accordion) --- */
.cn-cat {
    border-bottom: 1px solid #33363f;
}

.cn-cat-hd {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s;
    position: relative;
    height: 36px;
}

    .cn-cat-hd:hover {
        background: #33363f;
    }

    .cn-cat-hd.active {
        background: #2e3140;
    }

        .cn-cat-hd.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background: #4fc3f7;
        }

/* Icona categoria */
.cn-cat-ico {
    width: 38px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #6a7a95;
    flex-shrink: 0;
    border-right: 1px solid #33363f;
    transition: color 0.12s;
}

.cn-cat-hd.active .cn-cat-ico,
.cn-cat-hd:hover .cn-cat-ico {
    color: #4fc3f7;
}

/* Label categoria */
.cn-cat-lbl {
    font-size: 13px;
    font-weight: 600;
    color: #b0bdd0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex: 1;
    padding-left: 11px;
    transition: color 0.12s;
    margin: 0;
}

.cn-cat-hd.active .cn-cat-lbl,
.cn-cat-hd:hover .cn-cat-lbl {
    color: #e8f4fd;
}

/* Freccia accordion */
.cn-cat-arr {
    font-size: 9px;
    color: #5a6a80;
    padding-right: 13px;
    transition: transform 0.18s, color 0.12s;
    flex-shrink: 0;
}

.cn-cat-hd.active .cn-cat-arr {
    transform: rotate(90deg);
    color: #4fc3f7;
}

/* Body accordion (griglia componenti) */
.cn-cat-body {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 7px 10px 9px 12px;
    background: #242630;
    border-top: 1px solid #33363f;
}

    .cn-cat-body.open {
        display: grid;
    }

/* Singolo bottone componente */
.cn-comp-btn {
    background: #2b2d35;
    border: 1px solid #3a3d4a;
    border-radius: 3px;
    padding: 6px 6px;
    color: #c0cce0;
    font-size: 11px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    text-align: center;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .cn-comp-btn:hover {
        background: #323545;
        border-color: #4fc3f7;
        color: #4fc3f7;
    }

/* --- Divisore --- */
.cn-sb-div {
    height: 1px;
    background: #3a3d4a;
    flex-shrink: 0;
}

/* --- Area azioni (footer) --- */
.cn-sb-actions {
    padding: 10px 10px 12px;
    border-top: 1px solid #3a3d4a;
    background: #23252d;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.cn-sb-gear {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 0 8px;
    color: #5a6a80;
    font-size: 17px;
    letter-spacing: 0.2em;
}

/* Bottone azione generico */
.cn-act-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    border: 1px solid transparent;
    background: transparent;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
}

    .cn-act-btn:hover {
        background: #33363f;
        border-color: #3a3d4a;
    }

    /* Bottone primario (Duplicate) */
    .cn-act-btn.cn-act-primary {
        background: #1a3a5c;
        border: 1px solid #2e6aaa;
        margin-bottom: 4px;
    }

        .cn-act-btn.cn-act-primary:hover {
            background: #1f4570;
            border-color: #4fc3f7;
        }

    /* Bottone disabilitato */
    .cn-act-btn.cn-act-disabled {
        opacity: 0.3;
        pointer-events: none;
        cursor: default;
    }

/* Icona azione */
.cn-act-ico {
    width: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #4fc3f7;
    flex-shrink: 0;
}

/* Label azione */
.cn-act-lbl {
    font-size: 12px;
    font-weight: 600;
    color: #b0bdd0;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0;
}

.cn-act-btn.cn-act-primary .cn-act-lbl {
    color: #7dd4f5;
}

.cn-act-btn:hover .cn-act-lbl {
    color: #e8f4fd;
}

.btn-minimal {
    width: max-content !important;
}

/*RECIPE DETAILS v2 (rd2)*/
.rd2-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999
}

.rd2-popup {
    background: #fff;
    border: 1px solid #ddd;
    border-top: 3px solid #2563eb;
    border-radius: 10px;
    width: 860px;
    max-width: 96vw;
    max-height: 76vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12)
}

.rd2-header {
    background: #f8f9fb;
    padding: .9rem 1.25rem .7rem;
    border-bottom: 1px solid #e5e7eb;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem
}

.rd2-header-center {
    grid-column: 2;
    text-align: center
}

    .rd2-header-center span {
        display: block;
        font-size: 11px;
        font-weight: 600;
        color: #2563eb;
        letter-spacing: .06em;
        text-transform: uppercase;
        margin-bottom: 2px
    }

    .rd2-header-center strong {
        display: block;
        font-size: 15px;
        font-weight: 600;
        color: #111827
    }

.rd2-ctrl {
    grid-column: 3;
    display: flex;
    align-items: center;
    justify-content: flex-end
}

.rd2-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
    transition: background .15s
}

    .rd2-toggle-wrap:hover {
        background: #e2e8f0
    }

.rd2-toggle-lbl {
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap
}

.rd2-toggle {
    position: relative;
    width: 38px;
    height: 22px;
    flex-shrink: 0
}

    .rd2-toggle input {
        opacity: 0;
        width: 0;
        height: 0;
        position: absolute
    }

.rd2-toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 22px;
    transition: background .2s;
    cursor: pointer
}

    .rd2-toggle-slider::before {
        content: '';
        position: absolute;
        width: 16px;
        height: 16px;
        left: 3px;
        top: 3px;
        background: #fff;
        border-radius: 50%;
        transition: transform .2s;
        box-shadow: 0 1px 4px rgba(0,0,0,0.25)
    }

.rd2-toggle input:checked + .rd2-toggle-slider {
    background: #2563eb
}

    .rd2-toggle input:checked + .rd2-toggle-slider::before {
        transform: translateX(16px)
    }

.rd2-toggle-state {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    min-width: 26px;
    text-align: center
}

.rd2-toggle-on {
    color: #2563eb
}

.rd2-toggle-off {
    color: #9ca3af
}

.rd2-history {
    background: #eff6ff;
    border-bottom: 1px solid #bfdbfe;
    padding: .55rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .6rem
}

.rd2-history-ico {
    width: 26px;
    height: 26px;
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

    .rd2-history-ico svg {
        width: 13px;
        height: 13px;
        fill: #2563eb
    }

.rd2-history-lbl {
    font-size: 10px;
    font-weight: 700;
    color: #1d4ed8;
    letter-spacing: .07em;
    text-transform: uppercase;
    flex-shrink: 0
}

.rd2-history-sel {
    flex: 1;
    background: #fff;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    color: #111827;
    font-size: 12px;
    padding: 5px 8px;
    outline: none;
    cursor: pointer
}

    .rd2-history-sel:focus {
        border-color: #2563eb
    }

.rd2-history-btn {
    background: #2563eb;
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    cursor: pointer;
    letter-spacing: .04em;
    text-transform: uppercase;
    flex-shrink: 0
}

    .rd2-history-btn:hover {
        background: #1d4ed8
    }

.rd2-buyers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fff
}

.rd2-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #fff
}

.rd2-table-wrap {
    padding: .75rem 1.25rem
}

.rd2-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px
}

    .rd2-table thead tr {
        border-bottom: 2px solid #e5e7eb
    }

    .rd2-table thead th {
        color: #6b7280;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 10px;
        letter-spacing: .06em;
        padding: 6px 8px;
        text-align: left
    }

    .rd2-table tbody tr {
        border-bottom: 1px solid #f3f4f6;
        transition: background .12s
    }

        .rd2-table tbody tr:hover {
            background: #f9fafb
        }

    .rd2-table td {
        padding: 6px 8px;
        color: #374151;
        vertical-align: middle
    }

.rd2-mat-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: .03em
}

.rd2-qty-total {
    color: #2563eb;
    font-weight: 600
}

.rd2-unit {
    color: #9ca3af;
    font-size: 11px
}

.rd2-splitted {
    background: #f59e0b;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase
}

.rd2-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    padding: .75rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    background: #f8f9fb
}

.rd2-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: .4rem
}

    .rd2-field label {
        font-size: 10px;
        font-weight: 600;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: .05em
    }

        .rd2-field label.rd2-req {
            color: #dc2626
        }

.rd2-select, .rd2-input {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    color: #111827;
    font-size: 12px;
    padding: 6px 8px;
    outline: none;
    width: 100%;
    cursor: pointer;
    margin-top: 3px
}

    .rd2-select:focus, .rd2-input:focus {
        border-color: #2563eb
    }

.rd2-footer {
    background: #f8f9fb;
    border-top: 1px solid #e5e7eb;
    padding: .7rem 1.25rem;
    display: flex;
    gap: .75rem
}

.rd2-btn-cancel {
    flex: 1;
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    border-radius: 6px;
    padding: 10px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600
}

    .rd2-btn-cancel:hover {
        background: #f3f4f6
    }

.rd2-btn-start {
    flex: 2;
    background: #16a34a;
    border: none;
    color: #fff;
    border-radius: 6px;
    padding: 10px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase
}

    .rd2-btn-start:hover {
        background: #15803d
    }

    .rd2-btn-start:disabled {
        background: #d1d5db;
        color: #9ca3af;
        cursor: not-allowed
    }

.rd2-bmx-bucket {
    margin: 0 auto;
    max-width: 22rem;
    height: 90%;
    max-height: 15rem;
    color: #000;
    text-align: center;
    font-weight: 600;
    display: flex;
    align-items: flex-start;
    justify-content: center
}

    .rd2-bmx-bucket span {
        width: 8rem;
        height: 2rem;
        color: #f5f5f5;
        text-align: center;
        background: rgba(27,27,27,0.5);
        z-index: 2;
        border-top-right-radius: 6%;
        border-bottom-right-radius: 6%;
        display: flex;
        align-items: center;
        justify-content: center
    }

/* ADD RECIPE v2 (ar2) */
.ar2-popup {
    width: 960px
}

.ar2-header {
    background: #f8f9fb;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 1rem
}

.ar2-tabs {
    display: flex;
    align-items: center;
    background: #e5e7eb;
    border-radius: 8px;
    padding: 3px;
    flex-shrink: 0
}

    .ar2-tabs input[type="radio"] {
        display: none
    }

    .ar2-tabs label {
        padding: 5px 14px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 700;
        color: #6b7280;
        cursor: pointer;
        text-transform: uppercase;
        letter-spacing: .05em;
        transition: background .15s, color .15s;
        margin: 0;
        white-space: nowrap
    }

    .ar2-tabs input[type="radio"]:checked + label {
        background: #fff;
        color: #2563eb;
        box-shadow: 0 1px 4px rgba(0,0,0,0.08)
    }

.ar2-search {
    display: flex;
    gap: .4rem;
    align-items: center;
    flex: 1
}

.ar2-search-input {
    flex: 1;
    margin-top: 0 !important;
    max-width: 340px
}

.ar2-search-btn {
    background: #2563eb;
    border: none;
    border-radius: 5px;
    color: #fff;
    padding: 6px 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

    .ar2-search-btn svg {
        width: 14px;
        height: 14px;
        fill: #fff
    }

    .ar2-search-btn:hover {
        background: #1d4ed8
    }

.ar2-bmx-bar {
    padding: .5rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8f9fb;
    display: flex;
    flex-direction: column;
    gap: .4rem
}

.ar2-bmx-mixers,
.ar2-bmx-types {
    display: flex;
    gap: .3rem;
    flex-wrap: wrap
}

.ar2-bmx-btn {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    color: #374151;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .04em;
    transition: background .12s, color .12s, border-color .12s
}

.ar2-bmx-btn--active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff
}

.ar2-bmx-btn:hover:not(.ar2-bmx-btn--active) {
    background: #f3f4f6
}

.ar2-row--verified {
    background: rgba(22,163,74,0.06) !important
}

.ar2-row--testing {
    background: rgba(234,88,12,0.07) !important
}

.ar2-row--new {
    background: rgba(220,38,38,0.06) !important
}

.ar2-check-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin: 0
}

    .ar2-check-label span {
        font-size: 12px;
        font-weight: 600;
        color: #111827
    }

.ar2-status {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: .04em
}

.ar2-status--verified {
    background: #dcfce7;
    color: #15803d
}

.ar2-status--testing {
    background: #fff7ed;
    color: #c2410c
}

.ar2-status--new {
    background: #fee2e2;
    color: #dc2626
}

.ar2-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    color: #fff
}

.ar2-badge--gray {
    background: #6b7280
}

.ar2-badge--blue {
    background: #0ea5e9
}

@media (max-width: 1100px) {
    .ar2-popup {
        width: 96vw
    }

    .ar2-header {
        flex-wrap: wrap
    }
}

/*
 * app-utilities.css
 * Classi di utilità generali per eliminare gli stili inline dagli HTML.
 * Non toccare componenti SCADA / MixerView.
 * Queste classi NON modificano il layout visivo — sostituiscono 1:1 gli inline style.
 */

/* ================================================================
   STOCK DETAIL ROWS  (materialStockDetails.html)
   Sostituisce il pattern ripetuto:
     style="font-size:11px; width:100%;"
     style="width:100%; text-align:center;"
     style="width:100%; background-color:#ccc; font-weight:bold;"
   ================================================================ */

.stk-row {
    font-size: 11px;
    width: 100%;
}

.stk-lbl {
    width: 100%;
    text-align: center;
}

.stk-val {
    width: 100%;
    background-color: #ccc;
    font-weight: bold;
}

/* Modificatori di colore per .stk-val */
.stk-val--success {
    color: forestgreen;
}

.stk-val--warning {
    color: darkorange;
}

.stk-val--muted {
    color: gray;
}

.stk-val--note {
    color: cornflowerblue;
}


/* ================================================================
   PROGRESS BAR LAYOUT  (materialStockDetails.html)
   Sostituisce i pattern della barra di riempimento stock.
   ================================================================ */

/* Griglia esterna: riga superiore / corpo / riga inferiore */
.prg-grid {
    display: grid;
    grid-template-rows: 10% 80% 10%;
}

/* Due colonne uguali per la doppia barra (reale / calcolata) */
.prg-cols {
    display: grid;
    grid-template-columns: 50% 50%;
}

/* Wrapper di ogni singola barra verticale */
.prg-bar-wrap {
    display: grid;
    grid-template-rows: 90% 10%;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Padding interno della barra */
.prg-inner {
    margin: 10%;
}

/* Etichetta ruotata dentro la barra */
.prg-bar-lbl {
    color: black;
    position: absolute;
    left: 50%;
    transform: rotate(-90deg) translate(-50%, -50%);
}

/* Etichetta percentuale sotto la barra */
.prg-pct {
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    font-family: cursive;
}


/* ================================================================
   DG DETAILS  (dgDetails.html)
   ================================================================ */

/* Pannello singolo stock nel grid dosing group */
.dg-stock-item {
    display: inline-block;
    width: 100%;
    min-width: 25rem;
    height: max-content;
}

.dg-stock-wrap {
    min-height: 0;
    margin-right: 0 !important;
    height: auto !important;
}
/* Wrapper inline a tutta larghezza */
.d-inline-full {
    display: inline-block;
    width: 100%;
}


/* ================================================================
   RECIPE DETAILS  (recipeDetails.html)
   ================================================================ */

/* Etichetta chiave distributore (font piccolo, uppercase, grigio) */
.rd2-dist-key-label {
    font-size: 10px;
    color: #6b7280;
    text-transform: uppercase;
}

/* Margine top piccolo — sostituisce style="margin-top:.4rem" */
.mt-sm {
    margin-top: 0.4rem;
}


/* ================================================================
   HELPERS GENERICI
   (solo dove non già coperti da Bootstrap/theme)
   ================================================================ */

/* Griglia con flow orizzontale */
.grid-flow-col {
    display: grid;
    grid-auto-flow: column;
}

/* Griglia con flow verticale */
.grid-flow-row {
    display: grid;
    grid-auto-flow: row;
}

/* Display none utility */
.d-none {
    display: none !important;
}


/* ===== Overlay: ruota dispositivo (tablet in portrait) ===== */
.rotate-device-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a2742;
    z-index: 999998;
    align-items: center;
    justify-content: center;
}

.rotate-device-content {
    text-align: center;
    color: #ffffff;
}

.rotate-device-icon {
    font-size: 6rem;
    animation: rotate-hint 2s ease-in-out infinite;
    display: inline-block;
}

.rotate-device-content p {
    font-size: 1.4rem;
    margin-top: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

@keyframes rotate-hint {
    0% {
        transform: rotate(0deg);
    }

    40% {
        transform: rotate(-90deg);
    }

    60% {
        transform: rotate(-90deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

/* Mostra l'overlay solo su touch device con schermo medio (tablet) in portrait */
@media screen and (orientation: portrait) and (pointer: coarse) and (min-width: 600px) {
    .rotate-device-overlay {
        display: flex;
    }
}
/* ==========================================================*/


/* ============================================================
   DG Details popup — dg- namespace
   ============================================================ */

/* --- Popup wrapper --- */
.dg-popup {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 98vw;
    max-width: 1920px;
    height: 96vh;
}

/* --- Header --- */
.dg-popup-head {
    background: #f8f9fb;
    border-bottom: 1px solid #e5e7eb;
    border-top: 3px solid #2563eb;
    padding: 10px 1.25rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dg-popup-head-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.dg-popup-head-sub {
    font-size: 10px;
    font-weight: 600;
    color: #2563eb;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 1px;
}

.dg-popup-head-name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

/* Close button dentro l'header */
.dg-popup-close {
    background: #dc2626;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 7px 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .12s;
}

    .dg-popup-close:hover {
        background: #b91c1c;
    }

/* --- Body: griglia stock (sopra la bilancia) --- */
.dg-popup-body {
    flex: 1 1 auto;
    overflow: hidden;
    padding: 10px;
    background: #f3f4f6;
    min-height: 0;
    display: flex;
    align-items: stretch;
}

/* Griglia stock: auto-fit centra le card, sovrascrive repeat(6,1fr) di popup.css */
.dg-stock-grid,
.DGDetails_container {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 300px)) !important;
    grid-auto-rows: 1fr !important;
    justify-content: center;
    align-items: stretch;
    align-content: start;
    width: 100%;
    gap: 10px;
    flex: 1;
    height: 100%;
}

/* --- Singola stock card --- */
.dg-stk-wrap {
    display: block;
    width: 100%;
    height: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.dg-stk-card {
    min-height: auto !important;
    min-width: auto !important;
    padding: 0 !important;
    border: none !important;
    overflow: visible;
    width: 100% !important;
}

.dg-stk-head {
    background: #2b2d35;
    color:white;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 12px 6px;
    text-align: center;
    position: relative;
}

.dg-stk-name {
    font-size: 1.1rem !important;
    line-height: 1.3rem !important;
    display: block;
}

.dg-stk-mat {
    font-size: 11px;
    color: #2563eb;
    font-weight: 500;
    margin-top: 1px;
}

.dg-stk-hopper-btn {
    position: absolute !important;
    right: 6px;
    top: 4px;
    border-bottom-left-radius: 50% !important;
    border-bottom-right-radius: 50% !important;
}

/* --- Dati stock --- */
.dg-stk-data-lbl {
    padding: 6px 8px;
    font-size: 1rem !important;
}

.dg-stk-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 2px;
}

.dg-stk-row {
    display: grid;
    grid-template-columns: 64% 36%;
    border-bottom: 1px solid #f3f4f6;
    padding: 3px 0;
    align-items: center;
    min-height: 1.8rem;
    text-align: center;
}

.dg-stk-row-lbl {
    font-size: 10px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
    padding-right: 4px;
}

.dg-stk-row-val {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    font-family: 'Share Tech Mono', monospace, sans-serif;
}

.dg-val-green {
    color: #16a34a;
}

.dg-val-orange {
    color: #d97706;
}

.dg-val-blue {
    color: #2563eb;
}

.dg-val-muted {
    color: #9ca3af;
}

.dg-stk-level-lbl {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-align: center;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.dg-stk-btngroup {
    padding: 6px 8px !important;
}

.dg-stk-btn {
    font-size: 11px !important;
    padding: 6px 8px !important;
    min-height: 2.2rem !important;
    font-weight: 600 !important;
    white-space: normal !important;
    line-height: 1.2 !important;
}

.materialStockdtl_btnCement {
    border-top: 2px solid #2563eb !important;
    background: #f8f9fb;
    padding: 4px 0;
}

/* Retro hopper-back: leggibile senza rotazione */
.hopperdetails_back {
    padding: 8px 10px;
    border-radius: 6px;
}

.hopperdetails_back .materialStockdtl_data_lbl_nameStock {
    font-size: 1.3rem;
    display: block;
    text-align: center;
    margin-bottom: 6px;
    color: #111827;
}

/* --- Balance footer --- */
.dg-popup-balance {
    border-top: 2px solid #e5e7eb;
    background: #f8f9fb;
    padding: 10px 1.25rem;
    flex-shrink: 0;
    overflow-x: auto;
}

.dg-bal-card {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    padding: 12px 14px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    color: black !important;
}

.dg-bal-name {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.dg-bal-seq {
    font-size: 11px;
    color: #6b7280;
    font-weight: 400;
    margin-left: 4px;
}

.dg-bal-formula {
    font-size: 11px !important;
    color: #374151 !important;
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    margin-bottom: 4px;
}

.dg-bal-state {
    font-size: 11px;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 4px;
    padding-bottom: 3px;
    text-align: center;
}

.dg-bal-weight-row {
    text-align: center;
    position: relative;
    margin-bottom: 4px;
}

.dg-bal-weight {
    font-size: 3rem !important;
    font-weight: 700 !important;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    margin-bottom: 0 !important;
    display: block;
}

.dg-bal-timing {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 6px;
    border-top: 1px solid #e5e7eb;
    padding-top: 6px;
}

.dg-bal-timing-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dg-bal-timing-lbl {
    font-size: 10px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
}

.dg-bal-timing-val {
    font-size: 12px;
    color: #111827;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    font-weight: 500;
}

.dg-bal-setpoint {
    font-size: 14px !important;
    color: #2563eb !important;
    font-weight: 700 !important;
}

.dg-bal-mode {
    width: 100%;
    text-align: center;
    padding: 4px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-top: 6px;
}

.dg-bal-altistart-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    font-size: 11px;
    margin-bottom: 2px;
}

.dg-bal-led {
    width: 15px;
    height: 15px;
    border: 2px solid #374151;
    margin-left: auto;
    margin-right: auto;
    border-radius: 2px;
}

/* ── Color identity chip (colored dot = scale's colorCode) ── */
.dg-bal-color-chip {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(0, 0, 0, 0.18);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
    display: inline-block;
}

/* Name row: chip + text inline-centered */
.dg-bal-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 5px 10px;
    border-radius: 5px;
    margin-bottom: 4px;
}

/* ============================================================
   WAYBILL POPUP — wb- namespace
   ============================================================ */

/* Overlay (position: fixed/absolute set via ng-style) */
.wb-overlay {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999999;
}

/* Popup card */
.wb-popup {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-top: 3px solid #2563eb;
    border-radius: 10px;
    width: 600px;
    max-width: 96vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

/* Narrower variant for sub-popups (carrier, yard) */
.wb-popup--narrow {
    width: 460px;
}

/* Header */
.wb-header {
    background: #f8f9fb;
    padding: .75rem 1.25rem .6rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
    flex-shrink: 0;
}

.wb-header-label {
    font-size: 10px;
    font-weight: 600;
    color: #2563eb;
    letter-spacing: .07em;
    text-transform: uppercase;
    margin-bottom: 2px;
    display: block;
}

.wb-header-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    display: block;
}

/* Scrollable body */
.wb-body {
    flex: 1;
    overflow-y: auto;
    padding: .85rem 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #fff;
}

/* Field row: label (30%) + control (70%) */
.wb-field {
    display: grid;
    grid-template-columns: 28% 72%;
    align-items: center;
    gap: .4rem;
    margin-bottom: .55rem;
}

.wb-field > label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0;
}

/* select + add-button wrapper inside a wb-field */
.wb-field-with-btn {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: .4rem;
}

/* Inputs and selects */
.wb-select,
.wb-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    color: #111827;
    font-size: 12px;
    padding: 5px 8px;
    outline: none;
    cursor: pointer;
    margin: 0;
}

    .wb-select:focus,
    .wb-input:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    }

.wb-textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    color: #111827;
    font-size: 12px;
    padding: 5px 8px;
    outline: none;
    resize: vertical;
    min-height: 60px;
}

    .wb-textarea:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    }

/* Checkbox rows */
.wb-check-field {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem 0;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: .2rem;
}

    .wb-check-field label {
        font-size: 12px;
        font-weight: 500;
        color: #374151;
        cursor: pointer;
        margin: 0;
    }

/* Section separator title (e.g. Extra Fields) */
.wb-section-title {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #1d4ed8;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin: .8rem 0 .5rem;
    padding-top: .6rem;
    border-top: 1px solid #e5e7eb;
}

/* Extra fields scrollable container */
.wb-extra-container {
    max-height: 17rem;
    overflow-y: auto;
}

/* Grid row for extra-field header / data rows */
.wb-extra-row {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: repeat(5, 20%);
    gap: .3rem;
    align-items: end;
    margin-bottom: .4rem;
}

/* Single column in the extra-fields grid */
.wb-extra-col {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.wb-extra-col-lbl {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
    text-align: center;
}

/* Footer */
.wb-footer {
    background: #f8f9fb;
    border-top: 1px solid #e5e7eb;
    padding: .65rem 1.25rem;
    display: flex;
    gap: .6rem;
    flex-shrink: 0;
}

.wb-btn-cancel {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #6b7280;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
    flex-shrink: 0;
    transition: background .12s, border-color .12s, color .12s;
}

    .wb-btn-cancel:hover {
        background: #fee2e2;
        border-color: #dc2626;
        color: #dc2626;
    }

.wb-btn-confirm {
    flex: 1;
    background: #16a34a;
    border: none;
    color: #fff;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    transition: background .12s;
}

    .wb-btn-confirm:hover {
        background: #15803d;
    }

/* ─── ngdialog confirm template styles ─── */
.wb-confirm-body {
    padding: 1.5rem 1.25rem 1rem;
    text-align: center;
}

.wb-confirm-icon {
    font-size: 2.2rem;
    color: #dc2626;
    margin-bottom: .5rem;
    display: block;
}

.wb-confirm-title {
    font-size: 15px;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: .4rem;
}

.wb-confirm-msg {
    font-size: 13px;
    color: #374151;
    margin: 0;
}

.wb-confirm-footer {
    border-top: 1px solid #e5e7eb;
    padding: .65rem 1.25rem;
    display: flex;
    gap: .6rem;
    background: #f8f9fb;
}

/* Wide variant for table/list popups */
.wb-popup--wide {
    width: 960px;
    max-width: 92vw;
}

/* Header with close button on the right (flex layout) */
.wb-header--split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}

/* Close button inside the header */
.wb-header-close {
    background: #dc2626;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .05em;
    padding: 6px 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .12s;
}

    .wb-header-close:hover {
        background: #b91c1c;
    }

/* Filter bar (date pickers + filter button) */
.wb-filter-bar {
    padding: .6rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8f9fb;
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: center;
    flex-shrink: 0;
}

.wb-filter-btn {
    background: #2563eb;
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background .12s;
}

    .wb-filter-btn:hover {
        background: #1d4ed8;
    }

/* Scrollable table container */
.wb-table-wrap {
    flex: 1;
    overflow-y: auto;
    padding: .75rem 1.25rem;
    min-height: 200px;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #fff;
}

/* Table */
.wb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

    .wb-table thead tr {
        border-bottom: 2px solid #e5e7eb;
    }

    .wb-table thead th {
        color: #6b7280;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 10px;
        letter-spacing: .06em;
        padding: 6px 8px;
        text-align: left;
    }

    .wb-table tbody tr {
        border-bottom: 1px solid #f3f4f6;
        transition: background .12s;
    }

        .wb-table tbody tr:nth-child(even) {
            background: #f9fafb;
        }

        .wb-table tbody tr:hover {
            background: #eff6ff;
        }

    .wb-table td {
        padding: 7px 8px;
        color: #374151;
        vertical-align: middle;
    }

/* ── Yard cards ─────────────────────────────────── */

.wb-yard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.wb-customer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
}

/* ── List search bar ─────────────────────────────── */

.wb-list-search {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.wb-list-search-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0 12px;
    max-width: 420px;
}

    .wb-list-search-inner i {
        color: #9ca3af;
        font-size: 13px;
        flex-shrink: 0;
    }

    .wb-list-search-inner input {
        border: none;
        outline: none;
        background: transparent;
        padding: 8px 0;
        font-size: 13px;
        color: #374151;
        width: 100%;
    }

        .wb-list-search-inner input::placeholder {
            color: #9ca3af;
        }

.wb-yard-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: box-shadow .15s;
}

    .wb-yard-card:hover {
        box-shadow: 0 2px 8px rgba(0,0,0,.08);
    }

.wb-yard-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    margin-top: 2px;
}

.wb-yard-card-content {
    flex: 1;
    min-width: 0;
}

.wb-yard-card-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 5px;
}

.wb-yard-card-code {
    font-size: 11px;
    font-weight: 700;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #eff6ff;
    border-radius: 4px;
    padding: 1px 6px;
    flex-shrink: 0;
}

.wb-yard-card-desc {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wb-yard-card-rows {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wb-yard-card-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

    .wb-yard-card-row i {
        width: 13px;
        text-align: center;
        color: #9ca3af;
        font-size: 11px;
    }

.wb-yard-card-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

/* ── List footer stats bar ───────────────────────── */

.wb-list-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.wb-list-footer-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    color: #6b7280;
}

    .wb-list-footer-stat i {
        width: 26px;
        height: 26px;
        border-radius: 6px;
        background: #eff6ff;
        color: #2563eb;
        font-size: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .wb-list-footer-stat strong {
        font-size: 16px;
        font-weight: 700;
        color: #111827;
        line-height: 1;
    }

    .wb-list-footer-stat span {
        font-size: 11px;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: .04em;
    }

/* ── Card action buttons ─────────────────────────── */

.wb-card-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: background .15s, transform .1s;
    padding: 0;
    outline: none;
}

    .wb-card-btn:active {
        transform: scale(.92);
    }

.wb-card-btn--edit {
    background: #eff6ff;
    color: #2563eb;
}

    .wb-card-btn--edit:hover {
        background: #dbeafe;
        color: #1d4ed8;
    }

.wb-card-btn--delete {
    background: #fef2f2;
    color: #dc2626;
}

    .wb-card-btn--delete:hover {
        background: #fee2e2;
        color: #b91c1c;
    }


/* ================================================================
   MATERIAL STOCK DETAILS — msd- namespace  (materialStockDetails.html)
   Refactor completo: layout flex column, retro leggibile, nastro allineato
   ================================================================ */

/* Card contenitore — altezza uniforme, si adatta al contenitore senza tagli */
.msd-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
    min-width: 0 !important;
    border-radius: 6px;
    overflow: hidden;
    font-family: 'Rajdhani', sans-serif;
}

.msd-disabled {
    box-shadow: 0 0 1rem rgba(255, 0, 0, 0.85) !important;
}

/* --- INTESTAZIONE --- */
.msd-head {
    background: #2b2d35;
    color: #fff;
    padding: 8px 36px 6px 12px;
    text-align: center;
    position: relative;
    flex-shrink: 0;
}

.msd-head-name {
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.3;
}

.msd-head-mat {
    font-size: 11px;
    color: #4fc3f7;
    font-weight: 500;
    margin-top: 1px;
}

.msd-head-back-btn {
    position: absolute;
    right: 6px;
    top: 6px;
    background: #4fc3f7;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.msd-head-back-btn:hover {
    background: #0ea5e9;
}

/* --- BODY: barre + dati affiancati, altezza fissa = card - head - extractor - btns --- */
.msd-body {
    display: grid;
    grid-template-columns: 30% 70%;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

/* --- COLONNA BARRE --- */
.msd-bars {
    display: flex;
    flex-direction: column;
    background: #f8f9fb;
    border-right: 1px solid #e5e7eb;
    padding: 0 4px;
}

.msd-bar-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .06em;
    text-align: center;
    text-transform: uppercase;
    padding: 2px 0;
    flex-shrink: 0;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.msd-bar-badge--top { }
.msd-bar-badge--bot { }

.msd-bars-inner {
    flex: 1;
    display: flex;
    gap: 4px;
    padding: 4px 2px;
    min-height: 0;
}

.msd-bar-col {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.msd-bar-wrap {
    flex: 1;
    position: relative;
    min-height: 0;
}

.msd-bar-lbl {
    color: #000;
    position: absolute;
    left: 50%;
    transform: rotate(-90deg) translate(-50%, -50%);
    font-size: 9px;
    white-space: nowrap;
}

.msd-bar-pct {
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    color: #374151;
    flex-shrink: 0;
    padding: 2px 0;
}

/* --- COLONNA DATI: FRONTE --- */
.msd-data {
    /* auto-fit: tutte le righe entrano senza scroll, distribuite in colonna */
    display: flex;
    flex-direction: column;
    padding: 4px 0;
    min-height: 0;
    overflow: hidden;
}

/* fallback: se proprio non ci sta (troppe righe opzionali), scrolla anziché tagliare */
.msd-data {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb #fff;
}
.msd-data::-webkit-scrollbar { width: 3px; }
.msd-data::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

.msd-dosing {
    background: linear-gradient(to bottom, rgba(145,232,66,.12), rgba(145,232,66,.25));
}

.msd-row {
    display: grid;
    grid-template-columns: 55% 45%;
    align-items: center;
    border-bottom: 1px solid #f3f4f6;
    padding: 4px 8px;
    /* righe normali: comprimibili per far stare tutto senza scroll (auto-fit) */
    flex: 0 1 auto;
    min-height: 1.6rem;
}

/* righe umidità: SEMPRE leggibili — label MAI troncate, parentesi sempre intere */
.msd-row--moist {
    flex: 0 0 auto;
    min-height: 2.4rem;            /* riga più alta: ospita label a capo */
    background: #f9fafb;
    grid-template-columns: 62% 38%; /* più spazio alla label */
    align-items: center;
    padding-top: 5px;
    padding-bottom: 5px;
}
/* label: va a capo invece di troncare (no ellipsis, no nowrap) */
.msd-row--moist .msd-lbl {
    font-size: 10px;               /* leggermente ridotto per compensare il wrap */
    line-height: 1.15;
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    flex-wrap: wrap;
}
.msd-row--moist .msd-lbl__text {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
}
/* parentesi (punti sonda / % assorbimento): mai mandate a capo né tagliate */
.msd-row--moist .msd-lbl__fixed {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 10px;
}
/* valori: dimensione piena, parentesi blu non si comprimono */
.msd-row--moist .msd-val {
    font-size: 13px;
    flex-wrap: wrap;
}
.msd-row--moist .msd-val .msd-val--blue {
    flex: 0 0 auto;
    white-space: nowrap;
}

.msd-row--qty {
    background: #eff6ff;
    border-bottom: 1px solid #bfdbfe;
}

/* righe carico (Start/Stop loading): label lunga → più spazio, valore spostato a destra */
.msd-row--load {
    grid-template-columns: 68% 32%;
}
.msd-row--load .msd-lbl {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
}

.msd-lbl {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 600;
    padding-right: 4px;
    line-height: 1.2;
    display: flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* label text truncates with ellipsis when too long (e.g. RU) */
.msd-lbl__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* parenthesised value (probe points) always stays visible */
.msd-lbl__fixed {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* label with a sub-line (e.g. calculated moisture + absorption %) stacks vertically */
.msd-lbl--stacked {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    overflow: visible;
    white-space: normal;
}

/* sub-line wraps fully instead of being clipped */
.msd-lbl__sub {
    white-space: normal;
    overflow: visible;
    line-height: 1.1;
}

.msd-val {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    display: flex;
    align-items: center;
    gap: 4px;
}

.msd-val--muted  { color: #9ca3af; }
.msd-val--green  { color: #16a34a; }
.msd-val--orange { color: #d97706; }
.msd-val--blue   { color: #2563eb; }

.msd-add-btn {
    background: #2b2d35;
    border: none;
    border-radius: 4px;
    color: #fff;
    width: 20px;
    height: 20px;
    font-size: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .12s;
    margin-left: auto;
}

.msd-add-btn:hover { background: #2563eb; }

.msd-moisture-ctrl {
    display: flex;
    align-items: center;
    gap: 4px;
}

.msd-moisture-input {
    width: 55px;
    height: 20px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    font-size: 11px;
    padding: 0 4px;
}

/* --- COLONNA DATI: RETRO RISERVA --- */
.msd-back {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 14px 12px;
    background: #f8f9fb;
    overflow-y: auto;
}

.msd-back-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #374151;
    text-align: center;
}

.msd-back-code {
    font-size: 11px;
    color: #6b7280;
    font-family: 'Share Tech Mono', monospace;
}

.msd-back-qty-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    width: 100%;
    box-sizing: border-box;
}

.msd-back-qty {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Share Tech Mono', monospace;
    color: #111827;
    flex: 1;
    text-align: center;
}

.msd-add-btn--lg {
    width: 32px;
    height: 32px;
    font-size: 15px;
    border-radius: 6px;
}

/* --- ESTRATTORI --- */
.msd-extractor {
    border-top: 1px solid #e5e7eb;
    background: #f8f9fb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    flex-shrink: 0;
    min-height: 4rem;
}

/* Coclea: la direttiva extractors diventa div.extrator_body — forziamo visibilità */
.msd-extractor .extrator_body {
    width: 100%;
    min-height: 3rem;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.msd-extractor .extractor_body_grid {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.msd-extractor .extractor_body_group {
    min-width: 5rem;
}

.msd-extractor--belt {
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
    position: relative;
    min-height: 4rem;
}

/* Nastro: layout con ruote e corpo
   Le .leftWheel/.rightWheel originali hanno position:absolute rispetto
   al parent con position:relative — sfruttiamo quello comportamento
   mettendo .msd-belt come contenitore position:relative di altezza corretta */
.msd-belt {
    position: relative;
    width: 100%;
    height: 3.6rem;
}

/* Nasconde le ruote originali — le ridisegniamo via ::before/::after sul corpo */
.msd-belt .leftWheel,
.msd-belt .rightWheel {
    display: none !important;
}

/* Corpo nastro a tutta larghezza con ruote simulate */
.msd-belt-body {
    position: absolute;
    left: 2.4rem;
    right: 2.4rem;
    top: 50%;
    transform: translateY(-50%);
    height: 2.4rem;
    background: #d6e3eb;
    background-image: linear-gradient(to bottom, #d6e3eb, #c5ccd1);
    border-radius: 4px;
    box-shadow: inset 0 3px 8px rgba(0,0,0,.25), 0 1px 3px rgba(0,0,0,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* Ruota sinistra simulata */
.msd-belt-body::before {
    content: '';
    position: absolute;
    left: -2.4rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(to bottom, #18191a, #e8f1f7);
    border: 3px solid #555;
    box-shadow: 2px 0 6px rgba(0,0,0,.4);
    z-index: 2;
}

/* Ruota destra simulata */
.msd-belt-body::after {
    content: '';
    position: absolute;
    right: -2.4rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(to bottom, #18191a, #e8f1f7);
    border: 3px solid #555;
    box-shadow: -2px 0 6px rgba(0,0,0,.4);
    z-index: 2;
}

.msd-belt-body .materialStockdtl_belt_extractor {
    margin: 0 !important;
    float: none !important;
    position: absolute;
    z-index: 3;
}

.msd-belt-freq {
    font-size: 12px;
    font-weight: 700;
    font-family: 'Share Tech Mono', monospace;
    color: #374151;
    background: #e0eaf0;
    border-radius: 4px;
    padding: 2px 10px;
}

.msd-extractor--nozzle {
    gap: 12px;
}

.msd-nozzle-img {
    width: 60px;
    height: 30px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
}

/* --- POSIZIONE CORRENTE --- */
.msd-position {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    padding: 4px;
    border-radius: 0 0 8px 8px;
    flex-shrink: 0;
}

/* --- PULSANTI MANUALI --- */
.msd-btns {
    border-top: 2px solid #2563eb;
    background: #f0f4ff;
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 6px 8px;
    flex-shrink: 0;
}

.msd-btn {
    background: #3b3f4f;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 10px 12px;
    cursor: pointer;
    min-height: 2.8rem;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    overflow: visible;
    transition: background .12s, transform .08s;
    user-select: none;
    touch-action: none;
}

.msd-btn:hover   { background: #4f5470; }
.msd-btn:active  { background: #2b2d35; transform: scale(.96); }


/* ================================================================
   BALANCE DETAILS — bal- namespace  (balanceDetails.html)
   Layout flex row compatto, senza width:75rem inline
   ================================================================ */

/* Strip orizzontale che contiene le card bilancia */
.bal-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

/* Singola card bilancia */
.bal-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 1px 6px rgba(0,0,0,.08);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    flex: 1 1 320px;
    min-width: 280px;
}

/* Colonna principale dati */
.bal-card-inner {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 180px;
    flex: 0 0 auto;
}

/* Nome + chip identità */
.bal-identity {
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 5px;
    padding: 4px 8px;
}

.bal-chip {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(0,0,0,.15);
}

.bal-name {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    letter-spacing: .04em;
    font-family: 'Rajdhani', sans-serif;
}

.bal-seq {
    font-size: 11px;
    color: #6b7280;
}

/* Formula */
.bal-formula {
    font-size: 11px;
    color: #374151;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    padding: 3px 8px;
}

/* Stato */
.bal-state {
    font-size: 11px;
    color: #6b7280;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 3px;
}

/* Peso grande */
.bal-weight-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    justify-content: center;
}

.bal-weight {
    font-size: 2.6rem;
    font-weight: 700;
    font-family: 'Share Tech Mono', monospace, sans-serif;
    line-height: 1;
}

.bal-tare {
    font-size: 11px;
    color: #6b7280;
    font-family: 'Share Tech Mono', monospace;
}

/* Metriche (delay, discharge, setpoint, capacity) */
.bal-metrics {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-top: 1px solid #f3f4f6;
    padding-top: 5px;
    margin-top: 2px;
}

.bal-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.bal-metric-lbl {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
}

.bal-metric-val {
    font-size: 13px;
    font-family: 'Share Tech Mono', monospace;
    font-weight: 600;
    color: #111827;
}

.bal-metric-val--blue { color: #2563eb; font-size: 15px; font-weight: 700; }

.bal-metric--setpoint .bal-metric-lbl { color: #2563eb; }

.bal-metric--warn {
    color: #d97706;
    font-size: 11px;
    font-weight: 600;
}

.bal-metric--danger {
    color: #dc2626;
    font-size: 11px;
    font-weight: 600;
}

/* Modo auto/man */
.bal-mode {
    text-align: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-top: 4px;
    font-family: 'Rajdhani', sans-serif;
}

/* Sezione mobile */
.bal-movable {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-left: 1px dashed #e5e7eb;
    padding-left: 12px;
    min-width: 130px;
}

.bal-movable-extractors,
.bal-movable-btns {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

.bal-movable-ext-row {
    display: flex;
    gap: 4px;
    align-items: center;
}

.bal-movable-idx {
    font-size: 10px;
    color: #6b7280;
    width: 14px;
}

.bal-icon-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    color: #374151;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: background .1s;
    padding: 0;
}

.bal-icon-btn:hover { background: #e5e7eb; }
.bal-icon-btn:active { background: #d1d5db; transform: scale(.92); }

.bal-mode-btn {
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
}

.bal-movable-leds {
    display: flex;
    gap: 4px;
    margin-top: 2px;
}

.bal-led-badge {
    width: 28px;
    height: 24px;
    background: #e5e7eb;
    border: 2px solid #9ca3af;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
}

.bal-led-badge--on {
    background: #16a34a;
    border-color: #15803d;
    color: #fff;
}

/* Spie spostamento */
.bal-move-spie {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
    border-left: 1px dashed #e5e7eb;
    padding-left: 10px;
}

.bal-spia-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.bal-spia-lbl {
    font-size: 10px;
    color: #374151;
    font-weight: 500;
}

/* Altistart */
.bal-altistart {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-left: 1px dashed #e5e7eb;
    padding-left: 10px;
    min-width: 140px;
}

.bal-altistart-name {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 2px;
}

.bal-altistart-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: #374151;
}

.bal-led {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    border: 2px solid #374151;
    flex-shrink: 0;
}


