﻿/*
 * 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;
}


/* ================================================================
   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;
}

/* 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: 96vw;
    max-width: 1500px;
    height: 92vh;
}

/* --- 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 --- */
.dg-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #f3f4f6;
}

/* La griglia usa grid-template-columns passato inline via ng-style/style */
.dg-stock-grid {
    display: grid;
    gap: 10px;
    width: 100%;
    height: 100%;
    align-items: start;
}

/* --- 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: #f8f9fb;
    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: 10px !important;
    padding: 4px 6px !important;
}

/* --- 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;
}