
/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   SKELETON DI NAVIGAZIONE  â€“  feedback istantaneo
   (appare mentre il fetch Ã¨ in corso, poi viene sostituito)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.nav-skeleton {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.nav-skel-bar {
    height: 15px;
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        var(--bg-secondary, #1e293b) 25%,
        var(--bg-hover,    #334155) 50%,
        var(--bg-secondary, #1e293b) 75%
    );
    background-size: 200% 100%;
    animation: nav-skel-shimmer 1.3s infinite linear;
}
@keyframes nav-skel-shimmer {
    0%   { background-position:  200% 0; }
    100% { background-position: -200% 0; }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   SKELETON DI PAGINA  â€“  produzione / richieste / acquisti
   Sostituisce il contenuto mentre il fetch GAS Ã¨ in corso.
   Uso: <div class="page-skeleton"> in caricaSezioneConCache
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.page-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    animation: page-skel-fade-in .22s ease;
}
@keyframes page-skel-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.skel-card {
    background: var(--bg-secondary, #1e293b);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.skel-line {
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        var(--bg-secondary, #1e293b) 25%,
        var(--bg-hover,    #334155) 50%,
        var(--bg-secondary, #1e293b) 75%
    );
    background-size: 200% 100%;
    animation: nav-skel-shimmer 1.3s infinite linear;
}
.skel-line.skel-title  { height: 14px; width: 55%; }
.skel-line.skel-badge  { height: 10px; width: 28%; border-radius: 20px; }
.skel-line.skel-body   { height: 10px; width: 88%; }
.skel-line.skel-body-sm{ height: 10px; width: 65%; }
/* Offset animazione per ogni card */
.page-skeleton .skel-card:nth-child(2) .skel-line { animation-delay: .12s; }
.page-skeleton .skel-card:nth-child(3) .skel-line { animation-delay: .24s; }
.page-skeleton .skel-card:nth-child(4) .skel-line { animation-delay: .36s; }
.page-skeleton .skel-card:nth-child(5) .skel-line { animation-delay: .48s; }

/* Header skeleton (titolo sezione) */
.skel-header {
    height: 18px;
    width: 40%;
    border-radius: 8px;
    margin-bottom: 4px;
    background: linear-gradient(
        90deg,
        var(--bg-secondary, #1e293b) 25%,
        var(--bg-hover,    #334155) 50%,
        var(--bg-secondary, #1e293b) 75%
    );
    background-size: 200% 100%;
    animation: nav-skel-shimmer 1.3s infinite linear;
}
/* Impostazioni: azioni e preferenze notifiche */
.settings-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s, border-color .18s;
}
.settings-action-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); }
.settings-action-btn.settings-btn-danger { border-color: #ef444455; color: #fca5a5; }
.settings-action-btn.settings-btn-danger:hover { background: rgba(239,68,68,0.12); }

.notif-pref-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    font-size: 0.88rem;
    color: #cbd5e1;
}
.notif-pref-row:last-child { border-bottom: none; }
.notif-pref-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #242424;
    cursor: pointer;
    flex-shrink: 0;
}

/* ================================================================
   ML - PIPISTRELLO  |  Pianificazione Mensile & Fabbisogno
   Palette: app standard (#242424/ #2563eb / #f8fafc / #1e293b)
   Eccezioni: verde/rosso/azzurro sulle colonne funzionali
   ================================================================ */
.pip-page {
    padding: 8px 4px 60px;
    max-width: none;
    width: 100%;
    margin: 0 auto;
    font-family: inherit;
}

/* --- HEADER --- */
.pip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #242424;
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 14px;
    gap: 12px;
}
.pip-header-title { display: flex; align-items: center; gap: 12px; }
.pip-header-icon  { font-size: 2rem; display: flex; align-items: center; }
.pip-header-brand {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em;
    color: #9ca3af; text-transform: uppercase;
}
.pip-header-product { font-size: 1rem; font-weight: 700; color: #ffffff; }

.pip-reset-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    color: #d1d5db; border-radius: 8px; padding: 7px 14px;
    font-size: 0.82rem; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    transition: background 0.15s; white-space: nowrap;
}
.pip-reset-btn:hover { background: rgba(255,255,255,0.16); color: #fff; }

/* --- TASTO SALVA --- */
.pip-save-btn {
    background: #2563eb;
    border: 1px solid #1d4ed8;
    color: #fff; border-radius: 8px; padding: 7px 16px;
    font-size: 0.82rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    transition: background 0.15s, opacity 0.15s; white-space: nowrap;
}
.pip-save-btn:hover:not(:disabled) { background: #1d4ed8; }
.pip-save-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.pip-save-btn.pip-save-loading { background: #64748b; border-color: #475569; }
.pip-save-btn.pip-save-ok      { background: #16a34a; border-color: #15803d; }
.pip-save-btn.pip-save-err     { background: #dc2626; border-color: #b91c1c; }

/* --- CARD QTÃ€ --- */
.pip-qty-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.pip-qty-label {
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
    color: #64748b; text-transform: uppercase; margin-bottom: 10px;
}
.pip-qty-inputs {
    display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap;
}
.pip-qty-item {
    flex: 1; min-width: 90px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.pip-qty-item label {
    font-size: 0.78rem; font-weight: 600; color: #374151;
    text-align: center; line-height: 1.3;
}
.pip-qty-item label small { font-size: 0.7rem; color: #9ca3af; font-weight: 400; }

.pip-qty-input {
    width: 100%; text-align: center;
    font-size: 1.5rem; font-weight: 700;
    color: #1e293b;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px; padding: 8px 4px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    -moz-appearance: textfield;
}
.pip-qty-input::-webkit-inner-spin-button,
.pip-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.pip-qty-input:focus {
    border-color: #242424;
    box-shadow: 0 0 0 3px rgba(36,36,36,0.10);
}

.pip-qty-total-box {
    flex: 0 0 auto; min-width: 80px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: #242424; border-radius: 10px;
    padding: 8px 16px; gap: 2px;
}
.pip-qty-total-label {
    font-size: 0.65rem; font-weight: 700;
    letter-spacing: 0.1em; color: #9ca3af; text-transform: uppercase;
}
.pip-qty-total-val { font-size: 1.7rem; font-weight: 800; color: #ffffff; line-height: 1; }

/* --- PIANIFICAZIONE MESI FUTURI --- */
.pip-pf-card { margin-top: 14px; }
.pip-pf-add {
    display: inline-flex; align-items: center; gap: 6px;
    background: #242424; color: #fff; border: none;
    border-radius: 9px; padding: 8px 14px;
    font-size: 0.8rem; font-weight: 700; cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.pip-pf-add:hover { background: #000; }
.pip-pf-add:active { transform: scale(0.97); }

.pip-pf-empty {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    text-align: center; color: #94a3b8;
    padding: 26px 16px; border: 1.5px dashed #e2e8f0; border-radius: 14px;
    background: #f8fafc;
}
.pip-pf-empty i { font-size: 1.6rem; color: #cbd5e1; }
.pip-pf-empty p { margin: 0; font-size: 0.85rem; max-width: 420px; line-height: 1.4; }

.pip-pf-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px; margin-bottom: 16px;
}
.pip-pf-month {
    background: #fff; border: 1.5px solid #e2e8f0; border-radius: 12px;
    padding: 12px; box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    display: flex; flex-direction: column; gap: 10px;
}
.pip-pf-month-head { display: flex; align-items: center; gap: 8px; }
.pip-pf-label {
    flex: 1; min-width: 0;
    font-size: 0.9rem; font-weight: 700; color: #1e293b;
    background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 8px;
    padding: 6px 8px; outline: none;
}
.pip-pf-label:focus { border-color: #242424; box-shadow: 0 0 0 3px rgba(36,36,36,0.10); }
.pip-pf-remove {
    flex: 0 0 auto; width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fef2f2; color: #dc2626; border: 1px solid #fecaca;
    border-radius: 8px; cursor: pointer; transition: background 0.15s;
}
.pip-pf-remove:hover { background: #fee2e2; }

.pip-pf-inputs { display: flex; gap: 6px; align-items: stretch; }
.pip-pf-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pip-pf-item label { font-size: 0.72rem; font-weight: 600; color: #475569; }
.pip-pf-qty {
    width: 100%; text-align: center;
    font-size: 1.1rem; font-weight: 700; color: #1e293b;
    background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 8px;
    padding: 6px 2px; outline: none; box-sizing: border-box;
    -moz-appearance: textfield;
}
.pip-pf-qty::-webkit-inner-spin-button,
.pip-pf-qty::-webkit-outer-spin-button { -webkit-appearance: none; }
.pip-pf-qty:focus { border-color: #242424; box-shadow: 0 0 0 3px rgba(36,36,36,0.10); }
.pip-pf-total {
    flex: 0 0 auto; min-width: 54px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #242424; border-radius: 8px; padding: 6px 8px; gap: 1px;
}
.pip-pf-total-label { font-size: 0.58rem; font-weight: 700; letter-spacing: 0.08em; color: #9ca3af; }
.pip-pf-total-val { font-size: 1.2rem; font-weight: 800; color: #fff; line-height: 1; }

.pip-pf-order { font-size: 0.78rem; font-weight: 600; }
.pip-pf-order-warn { color: #b45309; display: inline-flex; align-items: center; gap: 5px; }
.pip-pf-order-ok { color: #16a34a; display: inline-flex; align-items: center; gap: 5px; }

.pip-pf-summary {
    background: #fff; border: 1.5px solid #e2e8f0; border-radius: 12px;
    padding: 14px 16px; box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.pip-pf-summary.is-ok {
    display: flex; align-items: center; gap: 8px;
    color: #16a34a; font-weight: 600; font-size: 0.88rem;
    background: #f0fdf4; border-color: #bbf7d0;
}
.pip-pf-summary-head {
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 800; color: #1e293b; font-size: 0.95rem; margin-bottom: 4px;
}
.pip-pf-summary-tot {
    background: #242424; color: #fff; border-radius: 999px;
    padding: 3px 12px; font-size: 0.82rem; font-weight: 700;
}
.pip-pf-summary-hint { margin: 0 0 12px; font-size: 0.76rem; color: #94a3b8; line-height: 1.4; }
.pip-pf-table { font-size: 0.85rem; }
.pip-pf-entro { text-align: center; font-weight: 600; color: #b45309; white-space: nowrap; padding: 8px 10px; }

/* Toolbar vista ordine: toggle vista + filtri sezione + ricerca + ordinamento */
.pip-pf-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    margin: 12px 0 10px; padding-bottom: 12px;
    border-bottom: 1px solid #eef2f7;
}
.pip-pf-viewtoggle { display: inline-flex; background: #f1f5f9; border-radius: 9px; padding: 3px; gap: 2px; }
.pip-pf-viewbtn {
    display: inline-flex; align-items: center; gap: 6px;
    border: none; background: transparent; cursor: pointer;
    font-size: 0.78rem; font-weight: 600; color: #64748b;
    padding: 6px 12px; border-radius: 7px; transition: background 0.15s, color 0.15s;
}
.pip-pf-viewbtn.is-active { background: #fff; color: #1e293b; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }

.pip-pf-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pip-pf-chip {
    border: 1.5px solid #e2e8f0; background: #fff; cursor: pointer;
    font-size: 0.76rem; font-weight: 600; color: #475569;
    padding: 6px 12px; border-radius: 999px; transition: all 0.15s;
}
.pip-pf-chip:hover { border-color: #cbd5e1; }
.pip-pf-chip.is-active { background: #242424; border-color: #242424; color: #fff; }

.pip-pf-tool-right { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.pip-pf-search {
    display: inline-flex; align-items: center; gap: 7px;
    background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 9px; padding: 0 10px;
}
.pip-pf-search:focus-within { border-color: #242424; box-shadow: 0 0 0 3px rgba(36,36,36,0.10); }
.pip-pf-search i { color: #94a3b8; font-size: 0.82rem; }
.pip-pf-search input {
    border: none; background: transparent; outline: none;
    font-size: 0.82rem; color: #1e293b; padding: 8px 0; width: 150px;
}
.pip-pf-sort { display: inline-flex; align-items: center; gap: 7px; font-size: 0.76rem; font-weight: 600; color: #64748b; }
.pip-pf-sort select {
    border: 1.5px solid #e2e8f0; background: #fff; border-radius: 9px;
    padding: 7px 10px; font-size: 0.8rem; font-weight: 600; color: #1e293b; cursor: pointer; outline: none;
}
.pip-pf-sort select:focus { border-color: #242424; box-shadow: 0 0 0 3px rgba(36,36,36,0.10); }

.pip-pf-body-tot { font-size: 0.78rem; color: #64748b; margin-bottom: 8px; }
.pip-pf-body-tot strong { color: #1e293b; }
.pip-pf-noresult {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    color: #94a3b8; font-size: 0.85rem; padding: 24px; text-align: center;
}

/* Carosello per mese */
.pip-pf-car-nav {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 11px;
    padding: 10px 12px; margin-bottom: 12px;
}
.pip-pf-car-btn {
    flex: 0 0 auto; width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #242424; color: #fff; border: none; border-radius: 9px; cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.pip-pf-car-btn:hover:not(:disabled) { background: #000; }
.pip-pf-car-btn:disabled { opacity: 0.3; cursor: default; }
.pip-pf-car-title { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.pip-pf-car-month { font-size: 1.05rem; font-weight: 800; color: #1e293b; }
.pip-pf-car-meta { font-size: 0.76rem; color: #64748b; }
.pip-pf-car-meta strong { color: #b45309; }
.pip-pf-dots { display: flex; justify-content: center; gap: 7px; margin-top: 12px; }
.pip-pf-dot {
    width: 9px; height: 9px; border-radius: 50%; border: none; padding: 0;
    background: #cbd5e1; cursor: pointer; transition: background 0.15s, transform 0.15s;
}
.pip-pf-dot:hover { background: #94a3b8; }
.pip-pf-dot.is-active { background: #242424; transform: scale(1.25); }

@media (max-width: 768px) {
    .pip-pf-grid { grid-template-columns: 1fr; }
    .pip-pf-table { min-width: 380px; }
    .pip-pf-toolbar { gap: 8px; }
    .pip-pf-tool-right { margin-left: 0; width: 100%; }
    .pip-pf-search { flex: 1; }
    .pip-pf-search input { width: 100%; }
}

/* --- Multi-select categorie (generico, riusabile: es. CRM Fornitori) --- */
.catms-box {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px; cursor: pointer;
    border: 1.5px solid #e2e8f0; border-radius: 9px; padding: 8px 34px 8px 10px;
    background: #f8fafc; position: relative; min-height: 42px;
}
.catms-placeholder { color: #94a3b8; font-size: 0.85rem; }
.catms-caret { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 0.8rem; }
.catms-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: #242424; color: #fff; border-radius: 999px; padding: 4px 6px 4px 11px; font-size: 0.76rem; font-weight: 600;
}
.catms-chip button { border: none; background: rgba(255,255,255,0.2); color: #fff; width: 18px; height: 18px; border-radius: 50%; cursor: pointer; line-height: 1; }
.catms-chip button:hover { background: rgba(255,255,255,0.4); }
.catms-dropdown { display: none; margin-top: 6px; border: 1.5px solid #e2e8f0; border-radius: 10px; overflow: hidden; }
.catms-dropdown.is-open { display: block; }
.catms-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 6px; max-height: 210px; overflow-y: auto; }
.catms-opt {
    display: flex; align-items: center; gap: 8px; text-align: left;
    border: none; background: transparent; cursor: pointer; padding: 8px 10px; border-radius: 7px;
    font-size: 0.82rem; color: #334155; font-weight: 500;
}
.catms-opt:hover { background: #f1f5f9; }
.catms-opt.is-on { color: #1e293b; font-weight: 700; }
.catms-opt.is-on i { color: #16a34a; }
.catms-opt i { color: #cbd5e1; }
.catms-add { display: flex; gap: 6px; padding: 8px; border-top: 1px solid #eef2f7; }
.catms-add input { flex: 1; border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 7px 10px; font-size: 0.82rem; outline: none; }
.catms-add input:focus { border-color: #242424; }
.catms-add button { border: none; background: #242424; color: #fff; border-radius: 8px; width: 38px; cursor: pointer; }

/* Chip di categoria mostrati nelle liste anagrafiche */
.crm-forn-cat { font-size: 0.7rem; font-weight: 600; color: #334155; background: #f1f5f9; border-radius: 999px; padding: 3px 9px; }
.crm-forn-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.crm-forn-filter-chip {
    border: 1.5px solid #e2e8f0; background: #fff; cursor: pointer;
    font-size: 0.75rem; font-weight: 600; color: #475569;
    padding: 5px 11px; border-radius: 999px; transition: all 0.15s;
}
.crm-forn-filter-chip:hover { border-color: #cbd5e1; }
.crm-forn-filter-chip.is-active { background: #242424; border-color: #242424; color: #fff; }

/* Badge origine fornitore */
.crm-forn-origin { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
.crm-forn-origin--estero { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.crm-forn-origin--eu { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* Header compatto premium anagrafiche CRM */
.crm-anag { padding: 4px 2px 24px; }
.crm-anag-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    background: #1e293b; background: linear-gradient(135deg, #242424, #1e293b);
    border-radius: 16px; padding: 16px 20px; margin-bottom: 14px;
}
.crm-anag-heading { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.crm-anag-kicker { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #94a3b8; }
.crm-anag-h1 { margin: 0; font-size: 1.35rem; font-weight: 800; color: #fff; line-height: 1.1; }
.crm-anag-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crm-anag-btn {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(255,255,255,0.08); color: #e2e8f0; border: 1px solid rgba(255,255,255,0.14);
    border-radius: 10px; padding: 8px 13px; font-size: 0.8rem; font-weight: 600; cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.crm-anag-btn:hover { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.28); }
.crm-anag-btn:active { transform: scale(0.97); }
.crm-anag-btn--primary { background: #fff; color: #1e293b; border-color: #fff; }
.crm-anag-btn--primary:hover { background: #f1f5f9; }
.crm-anag-btn--ghost { background: transparent; }

.crm-anag-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.crm-anag-count {
    font-size: 0.75rem; font-weight: 700; color: #475569;
    background: #f1f5f9; border-radius: 999px; padding: 6px 12px;
}
.crm-anag-viewtoggle { display: inline-flex; background: #f1f5f9; border-radius: 9px; padding: 3px; gap: 2px; }
.crm-anag-viewtoggle button {
    border: none; background: transparent; cursor: pointer; color: #64748b;
    width: 34px; height: 30px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.crm-anag-viewtoggle button.is-active { background: #fff; color: #1e293b; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.crm-anag-srcfilter { display: inline-flex; gap: 4px; }
.crm-anag-src {
    border: 1.5px solid #e2e8f0; background: #fff; cursor: pointer;
    font-size: 0.75rem; font-weight: 600; color: #475569; padding: 6px 12px; border-radius: 999px; transition: all 0.15s;
}
.crm-anag-src:hover { border-color: #cbd5e1; }
.crm-anag-src.is-active { background: #242424; border-color: #242424; color: #fff; }
.crm-anag-search {
    display: inline-flex; align-items: center; gap: 8px; margin-left: auto;
    background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 10px; padding: 0 12px; min-width: 220px;
}
.crm-anag-search:focus-within { border-color: #242424; box-shadow: 0 0 0 3px rgba(36,36,36,0.10); }
.crm-anag-search i { color: #94a3b8; font-size: 0.85rem; }
.crm-anag-search input { border: none; background: transparent; outline: none; padding: 9px 0; font-size: 0.85rem; color: #1e293b; width: 100%; }

@media (max-width: 640px) {
    .crm-anag-btn-lbl { display: none; }
    .crm-anag-search { margin-left: 0; width: 100%; }
}

@media (max-width: 640px) {
    .catms-opts { grid-template-columns: 1fr; }
}

/* --- Componenti & fornitori (modal Pipistrelli) --- */
.pip-pf-add--ghost { background: #fff; color: #242424; border: 1.5px solid #e2e8f0; }
.pip-pf-add--ghost:hover { background: #f8fafc; border-color: #cbd5e1; }

.pip-comp-overlay {
    position: fixed; inset: 0; z-index: 4000;
    background: rgba(15,23,42,0.55); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center; padding: 18px;
}
.pip-comp-modal {
    width: 100%; max-width: 820px; max-height: 92vh; overflow: hidden;
    background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(15,23,42,0.28);
    display: flex; flex-direction: column;
}
.pip-comp-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid #eef2f7;
}
.pip-comp-head h3 { margin: 0; font-size: 1.1rem; font-weight: 800; color: #1e293b; }
.pip-comp-head p { margin: 3px 0 0; font-size: 0.8rem; color: #64748b; }
.pip-comp-toolbar { padding: 12px 20px 0; }
.pip-comp-showall { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; color: #475569; cursor: pointer; }
.pip-comp-hint {
    margin: 12px 20px 0; padding: 10px 12px; border-radius: 10px;
    background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 0.8rem;
    display: flex; align-items: center; gap: 8px;
}
.pip-comp-tablewrap { padding: 12px 20px; overflow: auto; }
.pip-comp-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.pip-comp-table thead th {
    position: sticky; top: 0; background: #242424; color: #f9fafb;
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em;
    padding: 9px 10px; text-align: left; white-space: nowrap;
}
.pip-comp-table tbody tr { border-bottom: 1px solid #eef2f7; }
.pip-comp-sez td {
    background: #f1f5f9; font-weight: 800; font-size: 0.68rem; letter-spacing: 0.07em;
    text-transform: uppercase; color: #475569; padding: 6px 10px;
}
.pip-comp-mat { padding: 6px 10px; font-weight: 600; color: #1e293b; white-space: nowrap; }
.pip-comp-in, .pip-comp-sel {
    width: 100%; box-sizing: border-box; border: 1.5px solid #e2e8f0; border-radius: 7px;
    padding: 6px 8px; font-size: 0.82rem; color: #1e293b; background: #f8fafc; outline: none;
}
.pip-comp-in:focus, .pip-comp-sel:focus { border-color: #242424; box-shadow: 0 0 0 3px rgba(36,36,36,0.10); background: #fff; }
.pip-comp-foot {
    display: flex; align-items: center; justify-content: flex-end; gap: 8px;
    padding: 14px 20px; border-top: 1px solid #eef2f7;
}

@media (max-width: 720px) {
    .pip-comp-table { min-width: 620px; }
}

/* --- Ordini fornitori (messaggi copia-incolla) --- */
.pip-pf-summary-headright { display: inline-flex; align-items: center; gap: 10px; }
.pip-pf-ordini-btn { font-size: 0.76rem; padding: 6px 11px; }
.pip-ord-modal { max-width: 720px; }
.pip-ord-tpl { margin: 4px 20px 0; border: 1px solid #eef2f7; border-radius: 10px; padding: 8px 12px; }
.pip-ord-tpl summary { cursor: pointer; font-size: 0.82rem; font-weight: 700; color: #475569; }
.pip-ord-tpl-hint { font-size: 0.74rem; color: #94a3b8; margin: 8px 0; }
.pip-ord-tpl-hint code { background: #f1f5f9; padding: 1px 5px; border-radius: 5px; color: #334155; }
.pip-ord-tpl textarea, .pip-ord-msg {
    width: 100%; box-sizing: border-box; border: 1.5px solid #e2e8f0; border-radius: 9px;
    padding: 9px 11px; font-size: 0.82rem; color: #1e293b; background: #f8fafc; outline: none;
    font-family: inherit; resize: vertical;
}
.pip-ord-tpl textarea:focus, .pip-ord-msg:focus { border-color: #242424; box-shadow: 0 0 0 3px rgba(36,36,36,0.10); background: #fff; }
.pip-ord-tpl-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.pip-ord-senza {
    margin: 12px 20px 0; padding: 9px 12px; border-radius: 10px;
    background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 0.78rem;
    display: flex; align-items: center; gap: 8px;
}
.pip-ord-list { padding: 14px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.pip-ord-card { border: 1.5px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.pip-ord-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pip-ord-card-head h4 { margin: 0; font-size: 0.98rem; font-weight: 800; color: #1e293b; }
.pip-ord-contacts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.pip-ord-contact { font-size: 0.76rem; color: #475569; display: inline-flex; align-items: center; gap: 5px; }
.pip-ord-nocontact { font-size: 0.74rem; color: #b45309; }
.pip-ord-tot { flex: 0 0 auto; font-size: 0.72rem; font-weight: 700; color: #fff; background: #242424; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pip-ord-righe { display: flex; flex-direction: column; gap: 3px; }
.pip-ord-riga { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.82rem; color: #334155; padding: 3px 0; }
.pip-ord-riga small { color: #94a3b8; }
.pip-ord-copy1 { border: none; background: #f1f5f9; color: #475569; width: 26px; height: 26px; border-radius: 7px; cursor: pointer; flex: 0 0 auto; }
.pip-ord-copy1:hover { background: #e2e8f0; }
.pip-ord-actions { display: flex; justify-content: flex-end; }

/* --- Selettore stampa Pipistrelli --- */
.pip-stampa-modal { max-width: 560px; }
.pip-stampa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px 20px 20px; }
.pip-stampa-opt {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
    border: 1.5px solid #e2e8f0; background: #fff; border-radius: 12px; padding: 14px; cursor: pointer;
    transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.pip-stampa-opt:hover { border-color: #242424; box-shadow: 0 4px 14px rgba(15,23,42,0.08); }
.pip-stampa-opt:active { transform: scale(0.98); }
.pip-stampa-opt i { font-size: 1.2rem; color: #242424; margin-bottom: 4px; }
.pip-stampa-opt strong { font-size: 0.9rem; color: #1e293b; }
.pip-stampa-opt span { font-size: 0.74rem; color: #64748b; }

@media (max-width: 560px) { .pip-stampa-grid { grid-template-columns: 1fr; } }

/* --- TABELLA BOM --- */
.pip-table-wrap {
    background: #fff; border-radius: 14px;
    overflow: hidden; box-shadow: 0 1px 8px rgba(0,0,0,0.06);
    margin-bottom: 12px; overflow-x: auto;
}
.pip-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.pip-table thead tr { background: #242424; }
.pip-table thead th {
    color: #f9fafb; font-weight: 700; font-size: 0.7rem;
    letter-spacing: 0.06em; text-transform: uppercase;
    padding: 10px; text-align: center; white-space: nowrap;
}
.pip-table thead th:nth-child(2) { text-align: left; }
.pip-table tbody tr { border-bottom: 1px solid #e2e8f0; }
.pip-table tbody tr:last-child { border-bottom: none; }
.pip-table tbody tr:nth-child(even) { background: #f8fafc; }
.pip-table tbody tr:nth-child(odd)  { background: #ffffff; }
.pip-row-sez-start td { border-top: 2px solid #e2e8f0; }

/* Su mobile (portrait) nascondi le colonne xP / xM / xG â€” giÃ  calcolate nel FABBISOGNO */
@media (max-width: 768px) {
    .pip-col-coeff,
    .pip-coeff { display: none !important; }
    /* Font portati a livelli leggibili (era 0.72rem ≈ 8.6px) */
    .pip-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .pip-table { font-size: 14px; min-width: 480px; }
    .pip-table thead th { padding: 10px 8px; font-size: 11.5px; letter-spacing: 0.04em; }
    .pip-sez-cell { padding: 10px 8px; font-size: 12.5px; letter-spacing: 0; }
    .pip-mat   { padding: 10px 8px; white-space: normal; word-break: break-word; min-width: 110px; max-width: 160px; }
    .pip-fab, .pip-ord-manca, .pip-ord-ok, .pip-ord-zero {
        padding: 10px 8px;
        min-height: var(--touch-min, 44px);
    }
    .pip-car-cell { padding: 4px 3px; }
    .pip-car-input { width: 44px; font-size: 0.8rem; padding: 4px 2px; }
    .pip-car-liberi { font-size: 0.58rem; padding: 1px 3px; }
    .pip-qty-inputs { flex-wrap: wrap; gap: 10px; }
    .pip-qty-item { min-width: 80px; }
}

/* Pipistrelli: consenti orientamento landscape (override dell'overlay "ruota") */
body.page-pip #rotate-overlay { display: none !important; }

.pip-sez-cell {
    background: #242424 !important;
    color: #f9fafb; font-weight: 700; font-size: 0.72rem;
    letter-spacing: 0.07em; text-transform: uppercase;
    text-align: center; vertical-align: middle;
    padding: 8px 10px; white-space: nowrap;
}
.pip-mat {
    padding: 8px 10px; text-align: left;
    font-weight: 500; color: #1e293b; white-space: nowrap;
}

.pip-coeff { text-align: center; padding: 8px 6px; font-size: 0.9rem; }
.pip-coeff-on  { font-weight: 700; color: #1e293b; }
.pip-coeff-off { color: #cbd5e1; font-size: 0.85rem; }

/* FABBISOGNO â€” azzurro (funzionale: ok) */
.pip-fab      { text-align: center; padding: 8px 10px; font-weight: 700; color: #374151; background: #f1f5f9; white-space: nowrap; }
.pip-fab-zero { color: #9ca3af !important; background: #f1f5f9 !important; font-weight: 400 !important; }

/* CARICATO â€” verde (funzionale: ok) */
.pip-car-cell {
    text-align: center; padding: 5px 8px; background: #e8f5e9;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.pip-car-input {
    width: 70px; text-align: center;
    font-size: 0.95rem; font-weight: 700; color: #1b5e20;
    background: transparent; border: 1.5px solid #a5d6a7;
    border-radius: 7px; padding: 5px 4px; outline: none;
    -moz-appearance: textfield; transition: border-color 0.15s; box-sizing: border-box;
}
.pip-car-input::-webkit-inner-spin-button,
.pip-car-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.pip-car-input:focus { border-color: #388e3c; box-shadow: 0 0 0 3px rgba(56,142,60,.12); }
/* badge liberi (componenti non impegnati nei pronti) */
.pip-car-liberi {
    font-size: 0.65rem; font-weight: 700;
    color: #92400e; background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 4px; padding: 1px 5px;
    white-space: nowrap;
}

/* DA ORDINARE â€” rosso/verde (funzionale) */
.pip-ord-manca { text-align: center; padding: 8px 10px; font-weight: 800; font-size: 0.95rem; background: #ffcdd2; color: #b71c1c; }
.pip-ord-ok    { text-align: center; padding: 8px 10px; font-weight: 700; font-size: 0.9rem;  background: #c8e6c9; color: #2e7d32; }
.pip-ord-zero  { text-align: center; padding: 8px 10px; color: #9ca3af; font-size: 0.85rem; background: #f1f5f9; }

/* --- LEGENDA --- */
.pip-legend {
    display: flex; gap: 14px; flex-wrap: wrap;
    font-size: 0.78rem; padding: 0 4px; margin-bottom: 22px; color: #64748b;
}
.pip-leg-item { display: flex; align-items: center; gap: 4px; }

/* ================================================================
   CAPACITÀ DI SPEDIZIONE (widget real-time)
   ================================================================ */
.pip-sped-calc-card { margin-bottom: 20px; }

.pip-sped-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1.5px solid #e2e8f0;
}
.pip-sped-item {
    padding: 13px 14px;
    border-right: 1.5px solid #e2e8f0;
    display: flex; flex-direction: column; gap: 7px;
}
.pip-sped-item:last-child { border-right: none; }
.pip-sped-item-label {
    font-size: 0.78rem; font-weight: 800; color: #1e293b;
    display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
    margin-bottom: 2px;
}
.pip-sped-comp {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.74rem; color: #475569; padding: 1px 0;
}
.pip-sped-comp--bottleneck { color: #ef4444; font-weight: 700; }
.pip-sped-comp-num { font-weight: 800; font-family: monospace; font-size: 0.85rem; }
.pip-sped-result {
    margin-top: 4px; border-radius: 8px;
    padding: 7px 10px;
    display: flex; align-items: center; justify-content: center; gap: 7px;
}
.pip-sped-result--ok   { background: #dcfce7; color: #15803d; border: 1.5px solid #bbf7d0; }
.pip-sped-result--zero { background: #f1f5f9; color: #94a3b8; border: 1.5px solid #e2e8f0; }
.pip-sped-result-num { font-size: 1.4rem; font-weight: 900; font-family: monospace; line-height: 1; }
.pip-sped-result-lbl { font-size: 0.72rem; font-weight: 600; }

.pip-sped-alim {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 10px 16px; font-size: 0.82rem;
    border-bottom: 1.5px solid #f1f5f9;
}
.pip-sped-alim--ok   { background: #f0fdf4; color: #15803d; }
.pip-sped-alim--warn { background: #fffbeb; color: #92400e; }
.pip-sped-alim-ico   { font-size: 1rem; flex-shrink: 0; }
.pip-sped-alim-label { font-weight: 600; color: #1e293b; }
.pip-sped-alim-status { font-size: 0.78rem; margin-left: auto; display: flex; align-items: center; gap: 5px; }

.pip-sped-total {
    padding: 10px 16px; font-size: 0.84rem; color: #475569; text-align: center;
}
.pip-sped-total-num { color: #1e293b; font-size: 1.05rem; font-weight: 900; }
.pip-sped-total-sub { color: #d97706; font-size: 0.75rem; }
.pip-sped-empty {
    padding: 14px 16px; text-align: center;
    font-size: 0.82rem; color: #94a3b8;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}

@media (max-width: 540px) {
    .pip-sped-grid { grid-template-columns: 1fr; }
    .pip-sped-item { border-right: none; border-bottom: 1.5px solid #e2e8f0; }
    .pip-sped-item:last-child { border-bottom: none; }
    .pip-sped-alim-status { margin-left: 0; width: 100%; }
}

/* ================================================================
   SEZIONE MOVIMENTI  (carico / scarico magazzino)
   ================================================================ */
.pip-mov-section {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* â”€â”€ Scarico assemblati â”€â”€ */
.pip-assemb-card {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    padding: 0 0 16px;
}
.pip-assemb-title {
    background: #242424;
    padding: 12px 18px;
    font-size: 0.78rem; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: #f9fafb;
    display: flex; align-items: center; gap: 8px;
}
.pip-assemb-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 8px; align-items: end;
    background: #f8fafc; border-radius: 10px;
    padding: 12px; margin: 12px 16px 0;
    border: 1.5px solid #e2e8f0;
}
.pip-asm-select {
    background: #fff; border: 1.5px solid #e2e8f0;
    border-radius: 8px; padding: 8px 10px;
    font-size: 0.88rem; color: #1e293b; outline: none;
    transition: border-color 0.15s; box-sizing: border-box; width: 100%;
}
.pip-asm-select:focus { border-color: #242424; box-shadow: 0 0 0 3px rgba(36,36,36,0.10); }
.pip-assemb-preview {
    margin: 10px 16px 0;
    font-size: 0.75rem; color: #475569;
    background: #f1f5f9; border-radius: 8px;
    padding: 8px 12px;
    display: flex; flex-wrap: wrap; gap: 6px;
    min-height: 34px;
}
.pip-assemb-preview:empty { display: none; }
.pip-asm-comp-tag {
    background: #e2e8f0; color: #334155;
    border-radius: 5px; padding: 2px 8px;
    font-size: 0.72rem; font-weight: 600;
    white-space: nowrap;
}
.pip-asm-comp-tag.zero { opacity: 0.35; }
.pip-assemb-btn {
    background: #242424; color: #f8fafc;
    border: none; border-radius: 9px;
    padding: 11px 20px; margin: 10px 16px 0;
    font-size: 0.9rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; gap: 8px;
    width: calc(100% - 32px); justify-content: center;
    transition: background 0.15s;
}
.pip-assemb-btn:hover { background: #334155; }

/* â”€â”€ Card PRONTI DA SPEDIRE â”€â”€ */
.pip-pronti-hint {
    font-size: 0.68rem; color: #9ca3af; font-weight: 400;
    text-transform: none; letter-spacing: 0;
}
.pip-pronti-grid {
    display: flex; flex-direction: column; gap: 0;
    padding: 4px 0;
}
/* Sezione con titolo (Teste / Cordoni / Alimentatori) */
.pip-pronti-sezione {
    border-bottom: 2px solid #f1f5f9;
}
.pip-pronti-sezione:last-child { border-bottom: none; }
.pip-pronti-sezione-titolo {
    font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em;
    text-transform: uppercase; color: #94a3b8;
    padding: 7px 16px 3px;
    background: #f8fafc;
}
.pip-pronti-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid #f1f5f9;
}
.pip-pronti-row:last-child { border-bottom: none; }
.pip-pronti-lbl {
    font-size: 0.84rem; font-weight: 600; color: #1e293b;
    display: flex; align-items: center; gap: 6px;
}
.pip-pronti-ma {
    font-size: 0.72rem; font-weight: 700;
    background: #e2e8f0; color: #374151;
    border-radius: 4px; padding: 1px 6px;
    font-family: monospace;
}
.pip-pronti-ctrl {
    display: flex; align-items: center; gap: 10px;
}
.pip-pronti-btn {
    width: 30px; height: 30px; border-radius: 8px;
    border: 1.5px solid #e2e8f0; background: #f8fafc;
    font-size: 1.1rem; font-weight: 700; color: #374151;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    line-height: 1; transition: background 0.12s, border-color 0.12s;
}
.pip-pronti-btn:hover { background: #e2e8f0; border-color: #94a3b8; color: #0f172a; }
.pip-pronti-input {
    width: 52px; text-align: center;
    font-size: 1.0rem; font-weight: 800; color: #9ca3af;
    background: #f8fafc; border: 1.5px solid #e2e8f0;
    border-radius: 7px; padding: 4px 2px; outline: none;
    -moz-appearance: textfield; transition: border-color 0.15s, color 0.15s;
    box-sizing: border-box;
}
.pip-pronti-input::-webkit-inner-spin-button,
.pip-pronti-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.pip-pronti-input:focus { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.12); }
.pip-pronti-val-on { color: #f59e0b !important; border-color: #fde68a !important; background: #fffbeb !important; }

/* â”€â”€ Footer card Pronti da Spedire â”€â”€ */
.pip-pronti-footer {
    padding: 12px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pip-pronti-nota-input {
    width: 100%; box-sizing: border-box;
    background: #f8fafc; border: 1.5px solid #e2e8f0;
    border-radius: 9px; padding: 9px 12px;
    font-size: 0.86rem; color: #1e293b; outline: none;
    transition: border-color 0.15s;
}
.pip-pronti-nota-input:focus { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.1); }
.pip-pronti-nota-input::placeholder { color: #9ca3af; }
.pip-spedisci-btn {
    background: #15803d !important;
    margin: 0 !important;
    width: 100% !important;
}
.pip-spedisci-btn:hover { background: #166534 !important; }

/* â”€â”€ Modal conferma spedizione â”€â”€ */
.pip-sped-modal-box {
    max-width: 440px;
    width: 95%;
    padding: 0 0 0;
}
/* â”€â”€ Modal modifica movimento â”€â”€ */
.pip-edit-mov-box, .pip-del-mov-box {
    max-width: 400px;
    width: 95%;
    padding: 0;
}
.pip-edit-mov-mat {
    padding: 0 20px 12px;
    font-size: 0.9rem; color: #1e293b;
    display: flex; align-items: center; gap: 8px;
}
.pip-edit-mov-fields {
    display: flex; flex-direction: column; gap: 10px;
    padding: 0 20px 4px;
}
.pip-edit-mov-label {
    font-size: 0.75rem; font-weight: 700; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.05em;
    margin-bottom: -4px;
}
.pip-edit-mov-input {
    width: 100%; box-sizing: border-box;
    background: #f8fafc; border: 1.5px solid #e2e8f0;
    border-radius: 9px; padding: 10px 12px;
    font-size: 0.95rem; color: #1e293b; outline: none;
    transition: border-color 0.15s;
}
.pip-edit-mov-input:focus { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.1); }
.pip-del-mov-desc {
    padding: 4px 20px 10px;
    font-size: 0.9rem; color: #1e293b;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.pip-del-mov-warn {
    margin: 0 20px 8px;
    font-size: 0.82rem; color: #92400e;
    background: #fffbeb; border-radius: 8px;
    padding: 8px 12px; border: 1.5px solid #fde68a;
}
.pip-sped-modal-title {
    font-size: 1rem; font-weight: 800;
    color: #1e293b;
    display: flex; align-items: center; gap: 8px;
    padding: 20px 20px 4px;
    margin: 0;
}
.pip-sped-modal-sub {
    font-size: 0.82rem; color: #64748b;
    padding: 0 20px 10px;
    margin: 0;
}
.pip-sped-warning {
    margin: 0 16px 10px;
    background: #fffbeb; border: 1.5px solid #fde68a;
    border-radius: 9px; padding: 10px 14px;
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 0.82rem; color: #92400e; font-weight: 600;
}
.pip-sped-warning i { color: #f59e0b; flex-shrink: 0; margin-top: 2px; }
.pip-sped-items-list {
    display: flex; flex-direction: column;
    padding: 0 12px;
    gap: 4px;
    max-height: 280px; overflow-y: auto;
}
.pip-sped-item-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 10px;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.12s;
    border: 1.5px solid transparent;
}
.pip-sped-item-row:hover { background: #f1f5f9; }
.pip-sped-item-row input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: #15803d;
    cursor: pointer; flex-shrink: 0;
}
.pip-sped-item-row:has(input:checked) {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.pip-sped-item-info {
    display: flex; align-items: center; gap: 6px; flex: 1;
}
.pip-sped-item-emoji { font-size: 1.1rem; }
.pip-sped-item-label { font-size: 0.9rem; font-weight: 600; color: #1e293b; flex: 1; }
.pip-sped-item-qty {
    font-size: 1rem; font-weight: 800; color: #15803d;
    background: #dcfce7; border-radius: 6px;
    padding: 2px 9px;
}
.pip-sped-ok-btn {
    background: #15803d !important;
}
.pip-sped-ok-btn:disabled {
    background: #9ca3af !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.pip-sped-ma-pill {
    display: inline-block;
    background: #e2e8f0; color: #374151;
    border-radius: 4px; padding: 1px 6px;
    font-size: 0.7rem; font-weight: 700;
    font-family: monospace;
    margin-left: 3px;
    white-space: nowrap;
}

/* â”€â”€ Badge spedizione nel log â”€â”€ */
.pip-mov-badge.spedizione {
    background: #dcfce7; color: #15803d;
    border: 1px solid #bbf7d0;
}
.pip-sped-items-section {
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 6px;
    margin-bottom: 6px;
}
.pip-sped-item-row .pip-assemb-sub-mat { font-weight: 700; color: #1e293b; }
.pip-sped-bom-divider {
    font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: #94a3b8; padding: 2px 0 6px;
}

@media (max-width: 600px) {
    .pip-assemb-form { grid-template-columns: 1fr 1fr; }
}
.pip-mov-header {
    background: #242424;
    padding: 12px 18px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.pip-mov-header-title {
    font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: #f9fafb;
    display: flex; align-items: center; gap: 8px;
}
.pip-mov-toggle-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.16);
    color: #9ca3af; font-size: 0.78rem; border-radius: 7px;
    padding: 5px 12px; cursor: pointer; transition: background 0.15s;
}
.pip-mov-toggle-btn:hover { background: rgba(255,255,255,0.16); color: #fff; }

.pip-mov-body { padding: 14px 16px; }

/* Form */
.pip-mov-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 8px; align-items: end;
    background: #f8fafc; border-radius: 10px;
    padding: 12px; margin-bottom: 14px;
    border: 1.5px solid #e2e8f0;
}
.pip-mov-form-field { display: flex; flex-direction: column; gap: 4px; }
.pip-mov-form-label { font-size: 0.67rem; font-weight: 700; letter-spacing: 0.07em; color: #64748b; text-transform: uppercase; }
.pip-mov-form select,
.pip-mov-form input[type="number"],
.pip-mov-form input[type="text"] {
    background: #fff; border: 1.5px solid #e2e8f0;
    border-radius: 8px; padding: 8px 10px;
    font-size: 0.88rem; color: #1e293b; outline: none;
    transition: border-color 0.15s; box-sizing: border-box; width: 100%;
}
.pip-mov-form select:focus,
.pip-mov-form input:focus { border-color: #242424; box-shadow: 0 0 0 3px rgba(36,36,36,0.10); }

.pip-mov-btn-carico {
    background: #242424; color: #f9fafb;
    border: none; border-radius: 8px; padding: 9px 14px;
    font-size: 0.85rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    white-space: nowrap; transition: background 0.15s;
}
.pip-mov-btn-carico:hover { background: #333333; }

.pip-mov-btn-scarico {
    background: #f8fafc; color: #374151;
    border: 1.5px solid #cbd5e1; border-radius: 8px; padding: 9px 14px;
    font-size: 0.85rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    white-space: nowrap; transition: background 0.15s, border-color 0.15s;
}
.pip-mov-btn-scarico:hover { background: #f1f5f9; border-color: #94a3b8; }

/* Filter chip: pill trigger coerente con gli altri elementi 'stato-trigger' */
.pip-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #334155;
    white-space: nowrap;
    box-sizing: border-box;
}
.pip-filter-chip:hover { background: #f1f5f9; border-color: #cbd5e1; }
.pip-filter-chip.is-active {
    background: #242424;
    border-color: #242424;
    color: #f9fafb;
}

/* Badge per movimenti difettosi — usa palette 'danger' già presente nel progetto */
.pip-mov-badge.difettosi {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

/* Bottone 'Difettosi' nel form, coerente con gli altri bottoni (scarico/carico) */
.pip-mov-btn-difettosi {
    background: #fef2f2;
    color: #ef4444;
    border: 1.5px solid #fecaca;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: background 0.12s, border-color 0.12s;
}
.pip-mov-btn-difettosi:hover { background: #fee2e2; border-color: #fca5a5; }
.pip-mov-btn-difettosi:hover { background: #fee2e2; border-color: #fca5a5; }

/* Make filter selects visually consistent with the app's pill dropdowns */
.pip-mov-filters select,
.pip-mov-filters select#pip-mov-filter-component,
.pip-mov-filters select#pip-mov-filter-piano {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #334155;
    cursor: pointer;
    min-width: 160px;
    box-sizing: border-box;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2394a3b8' stroke-width='2'><path d='M6 8l4 4 4-4'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 36px;
}
.pip-mov-filters select:hover { background: #f1f5f9; border-color: #cbd5e1; }
.pip-mov-search {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    font-size: 0.95rem;
    color: #334155;
    box-sizing: border-box;
    min-width: 220px;
}
.pip-mov-search:focus { box-shadow: 0 0 0 3px rgba(36,36,36,0.06); border-color: #94a3b8; outline: none; }

/* Log movimenti */
.pip-mov-list { display: flex; flex-direction: column; gap: 6px; }
.pip-mov-empty { color: #9ca3af; font-size: 0.85rem; text-align: center; padding: 18px; }

.pip-mov-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 9px;
    border: 1.5px solid #e2e8f0; background: #fff;
    font-size: 0.85rem;
}
.pip-mov-item.carico  { border-left: 4px solid #242424; }
.pip-mov-item.scarico { border-left: 4px solid #64748b; }

.pip-mov-badge {
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.05em;
    text-transform: uppercase; border-radius: 5px; padding: 2px 7px;
    white-space: nowrap; flex-shrink: 0;
}
.pip-mov-badge.carico  { background: #f1f5f9; color: #1e293b; }
.pip-mov-badge.scarico { background: #f1f5f9; color: #374151; }

.pip-mov-mat  { font-weight: 600; color: #1e293b; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pip-mov-qty  { font-weight: 800; color: #1e293b; flex-shrink: 0; }
.pip-mov-qty.carico  { color: #1e293b; }
.pip-mov-qty.scarico { color: #374151; }
.pip-mov-nota { color: #64748b; font-size: 0.8rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pip-mov-ts   { color: #9ca3af; font-size: 0.75rem; flex-shrink: 0; white-space: nowrap; }
.pip-mov-del  {
    background: none; border: none; color: #cbd5e1;
    cursor: pointer; padding: 2px 4px; font-size: 0.85rem;
    border-radius: 4px; flex-shrink: 0; line-height: 1;
    transition: color 0.15s;
}
.pip-mov-del:hover { color: #ef4444; }
.pip-mov-edit {
    background: none; border: none; color: #cbd5e1;
    cursor: pointer; padding: 2px 4px; font-size: 0.85rem;
    border-radius: 4px; flex-shrink: 0; line-height: 1;
    transition: color 0.15s;
}
.pip-mov-edit:hover { color: #3b82f6; }

/* â”€â”€ Riga assemb espandibile â”€â”€ */
.pip-mov-assemb-group {
    border: 1.5px solid #e2e8f0;
    border-left: 4px solid #f59e0b;
    border-radius: 9px;
    background: #fff;
    overflow: hidden;
}
.pip-mov-assemb-summary {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.pip-mov-assemb-summary::-webkit-details-marker { display: none; }
.pip-mov-assemb-summary:hover { background: #fefce8; }
.pip-mov-assemb-label { font-weight: 700; color: #1e293b; flex: 1; }
.pip-mov-badge.assemb { background: #fef3c7; color: #b45309; }
.pip-assemb-chev {
    font-size: 0.68rem; color: #9ca3af; flex-shrink: 0;
    transition: transform 0.18s;
}
.pip-mov-assemb-group[open] .pip-assemb-chev { transform: rotate(180deg); }

.pip-assemb-sub-list {
    border-top: 1px solid #f1f5f9;
    padding: 6px 12px 10px 28px;
    display: flex; flex-direction: column; gap: 4px;
    background: #fafafa;
}
.pip-assemb-sub-row {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.8rem; color: #475569;
}
.pip-assemb-sub-mat { flex: 1; }

/* â”€â”€ Badge + riga reso â”€â”€ */
.pip-mov-badge.reso {
    background: #fef3c7; color: #b45309;
    border: 1px solid #fde68a;
}
.pip-mov-reso-group { border-left-color: #f59e0b; }
.pip-mov-reso-group .pip-mov-assemb-summary:hover { background: #fefce8; }

/* â”€â”€ Bottone Reso nell'header movimenti â”€â”€ */
.pip-reso-open-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.20);
    color: #fde68a;
    font-size: 0.78rem; font-weight: 700; border-radius: 7px;
    padding: 5px 12px; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    transition: background 0.15s;
}
.pip-reso-open-btn:hover { background: rgba(245,158,11,0.22); color: #fbbf24; }
.pip-mov-header-actions { display: flex; align-items: center; gap: 8px; }

/* â”€â”€ Modal Reso â”€â”€ */
.pip-reso-modal-box { max-width: 440px; width: 95%; padding: 0; }
.pip-reso-items-list {
    display: flex; flex-direction: column;
    padding: 0 12px; gap: 2px;
    max-height: 230px; overflow-y: auto;
}
.pip-reso-item-row {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 8px; border-radius: 8px;
    transition: background 0.12s;
}
.pip-reso-item-row:hover { background: #f8fafc; }
.pip-reso-item-emoji { font-size: 1rem; flex-shrink: 0; }
.pip-reso-item-label { font-size: 0.87rem; font-weight: 600; color: #1e293b; flex: 1; }
.pip-reso-qty-ctrl { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.pip-reso-qty-btn {
    width: 28px; height: 28px;
    background: #f1f5f9; border: 1.5px solid #e2e8f0;
    border-radius: 7px; color: #374151;
    font-size: 1rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.12s; line-height: 1;
}
.pip-reso-qty-btn:hover { background: #e2e8f0; color: #0f172a; }
.pip-reso-qty-inp {
    width: 54px; text-align: center;
    background: #fff; border: 1.5px solid #e2e8f0;
    border-radius: 7px; padding: 5px 4px;
    font-size: 0.9rem; font-weight: 700; color: #0f172a; outline: none;
    transition: border-color 0.15s;
}
.pip-reso-qty-inp:focus { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.1); }

/* Sezione checklist BOM */
.pip-reso-bom-section {
    margin: 10px 12px 0;
    background: #f8fafc; border-radius: 10px;
    border: 1.5px solid #e2e8f0; overflow: hidden;
}
.pip-reso-bom-title {
    font-size: 0.72rem; font-weight: 700;
    color: #475569; text-transform: uppercase; letter-spacing: 0.07em;
    padding: 8px 12px 6px; border-bottom: 1px solid #e2e8f0;
    background: #f1f5f9;
}
.pip-reso-bom-hint { font-weight: 400; color: #94a3b8; text-transform: none; letter-spacing: 0; }

/* ─── Manuali: file input stilato ────────────────────────────────────────── */
.manuale-file-input { display: none; }

.manuale-file-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    background: #242424;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    user-select: none;
    margin-top: 6px;
}
.manuale-file-label:hover {
    background: #ffffff;
    color: #242424;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

/* ── CSV Review inline blink ── */
@keyframes csvReviewPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.csv-review-blink {
    animation: csvReviewPulse 1.6s ease-in-out infinite;
    border-left: 4px solid #f59e0b !important;
}
.csv-review-blink.csv-review-missing {
    border-left-color: #eab308 !important;
    background: #fefce8 !important;
}
.csv-review-blink.csv-review-finish {
    border-left-color: #f97316 !important;
    background: #fff7ed !important;
}
.csv-review-order {
    box-shadow: 0 0 0 2px #f59e0b, 0 2px 12px rgba(245,158,11,0.18) !important;
    border-radius: 14px;
}
.csv-review-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.csv-review-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 6px;
    white-space: nowrap;
}
.csv-review-badge.missing {
    background: #fef9c3;
    color: #854d0e;
}
.csv-review-badge.finish {
    background: #fff7ed;
    color: #9a3412;
}
.btn-csv-resolve {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: #22c55e;
    color: #fff;
    transition: background 0.15s;
}
.btn-csv-resolve:hover { background: #16a34a; }
}
.manuale-file-label i { font-size: 12px; }
.pip-reso-bom-list {
    max-height: 180px; overflow-y: auto;
    display: flex; flex-direction: column;
    padding: 6px 10px; gap: 2px;
}
.pip-reso-bom-row {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 4px; border-radius: 6px; cursor: pointer;
    transition: background 0.1s;
}
.pip-reso-bom-row:hover { background: #e2e8f0; }
.pip-reso-bom-chk { width: 16px; height: 16px; cursor: pointer; accent-color: #15803d; flex-shrink: 0; }
.pip-reso-bom-mat { flex: 1; font-size: 0.82rem; color: #334155; }
.pip-reso-bom-qty {
    font-size: 0.82rem; font-weight: 800; color: #15803d;
    background: #dcfce7; border-radius: 5px; padding: 1px 7px; flex-shrink: 0;
}
.pip-reso-bom-empty { font-size: 0.8rem; color: #94a3b8; text-align: center; padding: 12px 8px; }

/* Bottone Registra Reso */
.pip-reso-ok-btn { background: #b45309 !important; }
.pip-reso-ok-btn:hover { background: #92400e !important; }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 600px) {
    .pip-page { padding: 6px 0 60px; }
    .pip-header { border-radius: 10px; padding: 12px; margin-bottom: 10px; }
    .pip-header-product { font-size: 0.88rem; }
    .pip-qty-card { border-radius: 10px; padding: 12px; }
    .pip-qty-inputs { gap: 8px; }
    .pip-qty-input { font-size: 1.3rem; padding: 6px 2px; }
    .pip-qty-total-box { min-width: 64px; padding: 6px 10px; }
    .pip-qty-total-val { font-size: 1.4rem; }
    .pip-table-wrap { border-radius: 10px; }
    .pip-table { font-size: 0.8rem; }
    .pip-table thead th { padding: 8px 6px; font-size: 0.62rem; }
    .pip-mat { font-size: 0.82rem; padding: 8px 6px; }
    .pip-fab { font-size: 0.82rem; padding: 6px 6px; }
    .pip-car-input { width: 56px; font-size: 0.88rem; }
    .pip-sez-cell { font-size: 0.65rem; padding: 6px 5px; }
    .pip-legend { font-size: 0.72rem; gap: 10px; }
    .pip-mov-form {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
    }
    .pip-mov-btn-carico,
    .pip-mov-btn-scarico { justify-content: center; }
    .pip-mov-item { flex-wrap: wrap; gap: 6px; }
    .pip-mov-nota { display: none; }
}


/* ============================================================
   GESTIONE POSTAZIONI QR â€” sezione impostazioni + modal edit
   ============================================================ */

/* â”€â”€ Lista postazioni in impostazioni â”€â”€ */
.qr-post-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: background 0.15s, box-shadow 0.15s;
}
.qr-post-row:last-child { margin-bottom: 0; }
.qr-post-row:hover { background: #f1f5f9; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.qr-post-canvas {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f1f5f9;
    display: block;
    border: 1px solid #e2e8f0;
}
.qr-post-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.qr-post-nome {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qr-post-codice {
    font-size: 10px;
    color: #64748b;
    font-family: monospace;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qr-post-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.qr-post-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.qr-post-btn:hover  { background: #e2e8f0; color: #0f172a; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.qr-post-btn:active { transform: scale(0.9); }
.qr-post-btn-print  { background: #f1f5f9; color: #374151; border-color: #e2e8f0; }
.qr-post-btn-print:hover { background: #e2e8f0; color: #0f172a; }
.qr-post-btn-danger { background: #fef2f2; color: #ef4444; border-color: #fecaca; }
.qr-post-btn-danger:hover { background: #fee2e2; color: #dc2626; }

.qr-post-footer-btns {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.qr-post-footer-btns button {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: background 0.15s, box-shadow 0.15s;
}
.qr-post-btn-add {
    background: #242424;
    color: #ffffff;
    border: none;
}
.qr-post-btn-add:hover { background: #1e293b; box-shadow: 0 3px 10px rgba(0,0,0,0.18); }
.qr-post-btn-print-all {
    background: #f8fafc;
    color: #374151;
    border: 1.5px solid #e2e8f0;
}
.qr-post-btn-print-all:hover { background: #e2e8f0; }

/* â”€â”€ Modal crea/modifica postazione â”€â”€ */
.qr-edit-content {
    max-width: 600px;
    max-height: 92dvh;
    overflow-y: auto;
    padding: 24px 22px 22px;
    background: #ffffff;
    border-radius: 20px;
}
.qr-edit-grid {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 20px;
    margin-top: 18px;
}
@media (max-width: 520px) {
    .qr-edit-grid { grid-template-columns: 1fr; }
    .qr-edit-preview { order: -1; }
}
.qr-edit-form {
    display: flex;
    flex-direction: column;
}
.qr-edit-emoji-input {
    font-size: 22px;
    text-align: center;
    padding: 8px 10px !important;
    max-width: 90px;
}
.qr-edit-codice-wrap {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════════════════════════════ */

.admin-panel {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px 8px;
}

.admin-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}

.admin-tab {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.admin-tab:hover { background: #f1f5f9; color: #334155; }
.admin-tab.active { background: #242424; color: #fff; }

.admin-content { min-height: 200px; }

.admin-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.admin-card h3 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}
.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.admin-card-header h3 { margin: 0; }

.admin-hint {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 12px;
}

.admin-field-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.15s;
}
.admin-input:focus { border-color: #242424; }

.admin-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
.admin-btn:hover { background: #e2e8f0; }
.admin-btn-save { background: #242424; color: #fff; }
.admin-btn-save:hover { background: #000; }

.admin-btn-sm {
    padding: 5px 10px;
    border: none;
    border-radius: 6px;
    background: #f1f5f9;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s;
}
.admin-btn-danger:hover { background: #fef2f2; }

.admin-table-wrap { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.admin-table th {
    text-align: left;
    padding: 8px 10px;
    color: #64748b;
    font-weight: 500;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.admin-table td {
    padding: 10px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-actions { text-align: right; }

/* Mobile: tabella admin con scroll orizzontale leggibile + touch comfort */
@media (max-width: 768px) {
    .admin-table-wrap { -webkit-overflow-scrolling: touch; }
    .admin-table { min-width: 560px; font-size: 14px; }
    .admin-table th { padding: 12px 10px; font-size: 11.5px; }
    .admin-table td { padding: 12px 10px; }
    .admin-table .admin-btn,
    .admin-table .admin-btn-danger {
        min-height: var(--touch-min, 44px);
        padding: 10px 14px;
        font-size: 14px;
    }
    .admin-badge { font-size: 12px; padding: 4px 10px; }
}

.admin-badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.admin-badge-master { background: #fef3c7; color: #92400e; }
.admin-badge-operatore { background: #e0f2fe; color: #0369a1; }
.admin-badge-commerciale { background: #f0fdf4; color: #166534; }

.admin-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.admin-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #334155;
}
.admin-tag-final { background: #dcfce7; color: #166534; }
.admin-tag-x {
    border: none;
    background: none;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.admin-tag-x:hover { color: #ef4444; }

.admin-moduli-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.admin-modulo-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s;
}
.admin-modulo-row:hover { background: #f8fafc; }
.admin-modulo-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #242424;
    flex-shrink: 0;
}
.admin-modulo-icon { font-size: 20px; flex-shrink: 0; }
.admin-modulo-label { font-weight: 600; font-size: 14px; color: #1e293b; }
.admin-modulo-desc { font-size: 12px; color: #94a3b8; margin-top: 2px; }

.admin-import-fields { display: flex; flex-direction: column; gap: 12px; }
.admin-import-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-import-label {
    flex: 0 0 140px;
    display: flex;
    flex-direction: column;
}
.admin-import-label strong { font-size: 13px; color: #1e293b; }
.admin-import-label .admin-hint { margin: 0; }
.admin-import-row .admin-input { flex: 1; font-family: monospace; font-size: 13px; }
.qr-edit-codice { flex: 1; }
.qr-edit-reset-code {
    width: 36px;
    height: 36px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f1f5f9;
    color: #475569;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.qr-edit-reset-code:hover { background: #e2e8f0; color: #0f172a; }

/* â”€â”€ Preview QR nel modal â”€â”€ */
.qr-edit-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.qr-preview-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #94a3b8;
    text-transform: uppercase;
}
.qr-preview-card {
    background: #f8fafc;
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    border: 1.5px solid #e2e8f0;
    width: 100%;
}
.qr-preview-card img, .qr-preview-card canvas {
    display: block;
    margin: 0 auto 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.qr-preview-nome {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 3px;
}
.qr-preview-codice {
    font-size: 9px;
    color: #64748b;
    font-family: monospace;
    word-break: break-all;
}
.qr-edit-print-single {
    border: 1.5px solid #e2e8f0;
    background: #f1f5f9;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    justify-content: center;
    transition: background 0.15s;
}
.qr-edit-print-single:hover { background: #e2e8f0; color: #0f172a; }


/* ============================================================
   QR CODE SCANNER â€” bottone topbar + modali
   ============================================================ */

/* â”€â”€ Avatar account nella top-bar mobile â”€â”€ */
.mobile-account-wrap {
    position: relative;
    flex-shrink: 0;
}

/* Stessa forma/colore dell'avatar desktop, ma funziona su sfondo chiaro */
.mobile-avatar-topbar-btn {
    position: relative !important; /* serve per il badge in posizione assoluta */
    margin-left: 6px !important;
}

/* Dropdown mobile: si apre verso IL BASSO (non verso l'alto come desktop) */
.account-dropdown-mob {
    bottom: auto !important;
    top: calc(100% + 8px) !important;
    left: auto !important;
    right: 0 !important;
    transform: translateY(-6px) !important;
    box-shadow: 0 8px 36px rgba(0,0,0,0.55) !important;
    z-index: 9999 !important;
    max-height: 80dvh !important;
    overflow-y: auto !important;
}
.account-dropdown-mob.open {
    transform: translateY(0) !important;
}

/* Badge notifiche dentro la voce "Notifiche" del menu mobile */
.badge-notif-menu {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* â”€â”€ Pulsante QR nella top-bar mobile â”€â”€ */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.btn-qr-scan {
    display: none; /* visibile solo su mobile via media query */
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: #242424;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transform: none;
    -webkit-transform: translateZ(0);
    transition: background 0.2s, box-shadow 0.18s;
    -webkit-tap-highlight-color: rgba(59,130,246,0.25);
}
.btn-qr-scan:active,
.btn-qr-scan:focus-visible {
    transform: none !important;
    background: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.35), 0 2px 8px rgba(0,0,0,0.25);
}
@media (max-width: 768px) {
    .btn-qr-scan { display: flex; }
}

/* â”€â”€ Modale scanner QR â”€â”€ */
.qr-scanner-overlay {
    background: rgba(0,0,0,0.88) !important;
    align-items: flex-end !important;
}
.qr-scanner-box {
    background: #242424;
    border-radius: 22px 22px 0 0;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 20px 36px;
    box-sizing: border-box;
    color: #f8fafc;
    animation: modalSpring 0.38s cubic-bezier(0.22,1,0.36,1) both;
}
.qr-scanner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.qr-scanner-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.qr-scanner-close {
    width: 32px; height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #f8fafc;
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* â”€â”€ Area video scanner â”€â”€ */
.qr-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 300px;
    overflow: hidden;
    border-radius: 16px;
    background: #000;
    margin-bottom: 14px;
}
#qr-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Cornici angolari del viewfinder */
.qr-overlay-frame {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.qr-corner {
    position: absolute;
    width: 34px; height: 34px;
    border-color: #4ade80;
    border-style: solid;
}
.qr-corner-tl { top: 20px;    left: 20px;    border-width: 3px 0 0 3px;  border-radius: 4px 0 0 0; }
.qr-corner-tr { top: 20px;    right: 20px;   border-width: 3px 3px 0 0;  border-radius: 0 4px 0 0; }
.qr-corner-bl { bottom: 20px; left: 20px;    border-width: 0 0 3px 3px;  border-radius: 0 0 0 4px; }
.qr-corner-br { bottom: 20px; right: 20px;   border-width: 0 3px 3px 0;  border-radius: 0 0 4px 0; }
/* Linea di scansione animata */
.qr-scan-line {
    position: absolute;
    left: 20px; right: 20px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4ade80, transparent);
    top: 20px;
    animation: qrScanMove 2s ease-in-out infinite;
    border-radius: 2px;
}
@keyframes qrScanMove {
    0%   { top: 20px;    opacity: 1; }
    48%  { opacity: 1; }
    50%  { top: calc(100% - 22px); opacity: 0.6; }
    52%  { opacity: 1; }
    100% { top: 20px;    opacity: 1; }
}
.qr-hint-txt {
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
    margin: 0 0 10px;
}
.qr-error-msg {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.4);
    border-radius: 10px;
    color: #fca5a5;
    font-size: 13px;
    padding: 10px 14px;
    margin-bottom: 10px;
    line-height: 1.5;
}
/* Sezione inserimento manuale */
.qr-manual-wrap {
    margin-top: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
}
.qr-manual-toggle {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #9ca3af;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.qr-manual-toggle::-webkit-details-marker { display: none; }
.qr-manual-body {
    padding: 0 14px 14px;
}
.qr-manual-body .input-field-modern {
    background: #1e293b;
    color: #f8fafc;
    border-color: rgba(255,255,255,0.15);
}

/* â”€â”€ Modale azione postazione â”€â”€ */
.qr-azione-content {
    max-height: 88dvh;
    overflow-y: auto;
    padding: 22px 20px 24px;
}
.qr-postazione-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #242424;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 5px 12px;
    border-radius: 99px;
    margin-bottom: 6px;
}
.qr-postazione-badge i {
    font-size: 11px;
    opacity: 0.7;
}

/* Header ordine selezionato */
.qr-ordine-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 13px;
}
.qr-ord-lbl { font-weight: 700; color: #0f172a; }
.qr-cli-lbl { color: #475569; }

/* Bottoni Seleziona Tutti / Nessuno */
.qr-articoli-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.qr-sel-btn {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.15s;
}
.qr-sel-btn:active { background: #e2e8f0; }

/* Lista articoli con checkbox */
.qr-articoli-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 2px;
}
.qr-articolo-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
    transition: background 0.15s, border-color 0.15s;
}
.qr-articolo-row:has(.qr-art-chk:checked) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.qr-articolo-row input[type="checkbox"] {
    width: 17px; height: 17px;
    cursor: pointer;
    accent-color: #242424;
    flex-shrink: 0;
}
.qr-art-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}
.qr-art-codice {
    font-weight: 700;
    font-size: 13px;
    color: #0f172a;
}
.qr-art-qty {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}
.qr-art-stato-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    border: 1.5px solid;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* Pill selezione stato di destinazione */
.qr-stato-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.qr-stato-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 99px;
    border: 1.5px solid;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    letter-spacing: 0.02em;
    transition: background 0.18s, color 0.18s, transform 0.12s;
}
.qr-stato-pill:active { transform: scale(0.95); }
.qr-pill-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Spinner caricamento articoli */
.qr-loading {
    text-align: center;
    padding: 16px;
    color: #64748b;
    font-size: 13px;
}


/* ============================================================
   ORDINI FORNITORI – Dashboard Acquisti da CSV
   ============================================================ */

/* --- Riepilogo inline sopra la lista ordini fornitori --- */
.of-inline-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}

.of-inline-chip {
    min-width: 0;
    min-height: 44px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 16px;
    border: 1px solid rgba(148,163,184,0.18);
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(244,239,233,0.96) 100%);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.05);
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.of-inline-chip i {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 9px;
    background: rgba(15,23,42,0.08);
    color: #475569;
    font-size: 0.72rem;
}

/* --- Badge data consegna nell'header ordine --- */
.of-data-badge {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 20px;
}
.of-data-badge i {
    margin-right: 3px;
    opacity: .6;
}

/* Mini progress bar nell'header ordine */
.of-progress-mini {
    width: 70px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}
.of-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width .4s ease;
}

/* Chevron di espansione */
.dettagli-chevron {
    font-size: 11px;
    color: #94a3b8;
    transition: transform 0.3s ease;
    margin-left: 2px;
}
.riga-ordine.open .dettagli-chevron {
    transform: rotate(180deg);
}

/* --- Card articolo OF: stessa griglia delle card produzione --- */
.of-item-card {
    grid-template-columns: 1.1fr 2.2fr 0.7fr 0.7fr 0.8fr 0.9fr !important;
    cursor: pointer;
}
/* Variante senza importo (utenti non-master): le 5 celle restanti si espandono */
.of-item-card.of-item-card-no-importo {
    grid-template-columns: 1.2fr 2.5fr 0.8fr 0.8fr 1fr !important;
}
.of-item-card b {
    font-size: 0.92rem;
    color: #1e293b;
    font-weight: 600;
}
.of-prodotto-text {
    font-size: 0.84rem;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.of-cell-importo b {
    color: #3b82f6 !important;
}

/* --- Modal dettaglio OF --- */
.of-modal-content {
    max-width: 480px;
    padding: 24px 28px;
}
.of-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
}
.of-modal-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.of-modal-field-wide {
    grid-column: 1 / -1;
}
.of-modal-label {
    font-size: .72rem;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: .5px;
}
.of-modal-value {
    font-size: .92rem;
    color: #1e293b;
}
.of-modal-sep {
    grid-column: 1 / -1;
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}
.of-modal-qty {
    text-align: center;
}
.of-modal-big {
    font-size: 1.3rem;
    font-weight: 700;
}

/* --- Mobile responsive OF --- */
@media (max-width: 768px) {
    .of-inline-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 12px;
    }

    .of-inline-chip {
        min-height: 40px;
        padding: 0 12px;
        border-radius: 14px;
        font-size: 0.76rem;
    }

    .of-inline-chip i {
        width: 24px;
        height: 24px;
        border-radius: 8px;
        font-size: 0.7rem;
    }

    .of-data-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
    .of-progress-mini {
        width: 50px;
    }

    .pip-row-salcavi td {
        background: #f8fafc;
    }
    .pip-salcavi-um {
        color: #94a3b8;
        font-weight: 600;
        margin-left: 3px;
    }

    /*
     * Card articolo OF: griglia 3 colonne con posizionamento esplicito.
     * Le regole !important sono necessarie per sovrascrivere le regole generiche
     * .item-card > div:nth-child(N) definite più in alto nel file.
     *
     * Layout risultante (3 col × 3 righe):
     *   [ CODICE          ] [ IMPORTO (col 2-3, allineato dx) ]
        .pip-cavo-row {
            grid-template-columns: 1fr;
            gap: 8px;
        }
        .pip-cavo-metrics { align-items: flex-start; text-align: left; }
     *   [ PRODOTTO  –  full width su tutta la riga            ]
     *   [ ORDINATA ] [ EVASA ] [ DA CONSEGNARE ]
     */
    .of-item-card {
        grid-template-columns: 1fr 1fr 1fr !important;
        grid-template-rows: auto auto auto !important;
        gap: 8px 10px !important;
        padding: 12px 12px 10px !important;
    }

    .of-item-card > div:nth-child(1) { /* CODICE */
        grid-column: 1 !important;
        grid-row: 1 !important;
    }
    .of-item-card > div:nth-child(2) { /* PRODOTTO */
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
    }
    .of-item-card > div:nth-child(3) { /* ORDINATA */
        grid-column: 1 !important;
        grid-row: 3 !important;
    }
    .of-item-card > div:nth-child(4) { /* EVASA */
        grid-column: 2 !important;
        grid-row: 3 !important;
    }
    .of-item-card > div:nth-child(5) { /* DA CONSEGNARE */
        grid-column: 3 !important;
        grid-row: 3 !important;
    }
    .of-item-card > div:last-child {   /* IMPORTO: riga 1, col 2-3, allineato a destra */
        grid-column: 2 / span 2 !important;
        grid-row: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: flex-end !important;
    }
    /* Variante senza importo: le 3 celle quantità occupano tutto lo spazio */
    .of-item-card.of-item-card-no-importo {
        grid-template-columns: 1fr 1fr 1fr !important;
    }
    .of-item-card.of-item-card-no-importo > div:nth-child(1) {
        grid-column: 1 / -1 !important; /* CODICE occupa tutta la riga 1 */
        grid-row: 1 !important;
    }

    /* Testo prodotto: max 2 righe con ellissi */
    .of-prodotto-text {
        white-space: normal !important;
        overflow: hidden;
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    /* Tipografia */
    .of-item-card .label-sm {
        font-size: 9px !important;
        margin-bottom: 1px !important;
    }
    .of-item-card b {
        font-size: 12px !important;
    }
    .of-cell-importo b {
        font-size: 13px !important;
    }

    /* Modal dettaglio */
    .of-modal-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .of-modal-content {
        padding: 18px 16px;
    }
}

/* ============================================================
   IMPOSTAZIONI — LAYOUT A DUE PANNELLI (redesign premium)
   Nav categorie a sinistra + pannello dettaglio a destra.
   Tema-neutro: usa le variabili, eredita l'accento per tema.
   ============================================================ */
.settings-page-shell.settings-v2 {
    max-width: 1180px;
    margin: 0 auto;
    padding: 8px 4px 48px;
}

/* ── Hero ── */
.settings-v2 .set-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 4px 22px;
}
.settings-v2 .set-hero-copy { min-width: 0; }
.settings-v2 .settings-page-kicker {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted, #78716c);
    margin-bottom: 6px;
}
.settings-v2 .settings-page-title {
    margin: 0;
    font-size: clamp(1.5rem, 2vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main, #111111);
}
.settings-v2 .set-save-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    border-radius: 14px;
    background: var(--accent-dark, #111111);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    transition: transform 0.16s cubic-bezier(0.22,1,0.36,1), box-shadow 0.2s ease, background 0.2s ease;
}
.settings-v2 .set-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(0,0,0,0.16);
}
.settings-v2 .set-save-btn:active { transform: scale(0.97); }

/* ── Layout master-detail ── */
.settings-v2 .set-layout {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

/* ── Nav categorie ── */
.settings-v2 .set-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 12px;
}
.settings-v2 .set-nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}
.settings-v2 .set-nav-item:hover {
    background: var(--bg-surface-soft, rgba(0,0,0,0.03));
}
.settings-v2 .set-nav-item:active { transform: scale(0.985); }
.settings-v2 .set-nav-ico {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--bg-surface-soft, rgba(0,0,0,0.04));
    color: var(--text-muted, #78716c);
    font-size: 15px;
    transition: background 0.16s ease, color 0.16s ease;
}
.settings-v2 .set-nav-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.settings-v2 .set-nav-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main, #111111);
    line-height: 1.2;
}
.settings-v2 .set-nav-desc {
    font-size: 11.5px;
    color: var(--text-muted, #9ca3af);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.settings-v2 .set-nav-count {
    flex-shrink: 0;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 99px;
    background: var(--bg-surface-soft, rgba(0,0,0,0.05));
    color: var(--text-muted, #78716c);
    font-size: 11px;
    font-weight: 700;
}
.settings-v2 .set-nav-item.is-active {
    background: var(--accent-soft, rgba(132,204,22,0.12));
    border-color: color-mix(in srgb, var(--accent-color, #84cc16) 35%, transparent);
}
.settings-v2 .set-nav-item.is-active .set-nav-ico {
    background: var(--accent-color, #84cc16);
    color: #0d0d0d;
}
.settings-v2 .set-nav-item.is-active .set-nav-label {
    color: var(--text-main, #111111);
}
.settings-v2 .set-nav-item.is-active .set-nav-count {
    background: var(--accent-color, #84cc16);
    color: #0d0d0d;
}

/* ── Pannelli dettaglio ── */
.settings-v2 .set-panel { display: none; }
.settings-v2 .set-panel.is-active {
    display: block;
    animation: setPanelIn 0.28s cubic-bezier(0.22,1,0.36,1);
}
@keyframes setPanelIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.settings-v2 .set-panel-head {
    margin-bottom: 14px;
    padding: 0 2px;
}
.settings-v2 .set-panel-head h2 {
    margin: 0 0 4px;
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    color: var(--text-main, #111111);
}
.settings-v2 .set-panel-head p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted, #78716c);
    line-height: 1.5;
}

/* ── Lista impostazioni: UNA superficie, righe con divisori ── */
.settings-v2 .settings-list {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(0,0,0,0.06));
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.03);
}

/* Le ex-card diventano righe piatte nella lista */
.settings-v2 .settings-list .settings-section-slot {
    display: block;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.05)) !important;
}
.settings-v2 .settings-list .settings-section-slot:last-child {
    border-bottom: none !important;
}
.settings-v2 .settings-list .settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px;
    background: transparent;
    cursor: pointer;
    transition: background 0.16s ease;
}
.settings-v2 .settings-list .settings-row:hover {
    background: var(--bg-surface-soft, rgba(0,0,0,0.025));
}
.settings-v2 .settings-list .settings-row-active {
    background: var(--accent-soft, rgba(132,204,22,0.08));
}
.settings-v2 .settings-list .settings-row-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.settings-v2 .settings-list .settings-row-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--bg-surface-soft, rgba(0,0,0,0.04));
    color: var(--text-muted, #78716c);
    font-size: 15px;
}
.settings-v2 .settings-list .settings-row-overline {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 1px;
}
.settings-v2 .settings-list .settings-row-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-main, #111111);
    line-height: 1.25;
}
.settings-v2 .settings-list .settings-row-sub {
    font-size: 12.5px;
    color: var(--text-muted, #78716c);
    line-height: 1.4;
}
.settings-v2 .settings-list .settings-row-side {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.settings-v2 .settings-list .settings-row-pill {
    padding: 4px 11px;
    border-radius: 99px;
    background: var(--bg-surface-soft, rgba(0,0,0,0.05));
    color: var(--text-muted, #57534e);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}
.settings-v2 .settings-list .settings-row-arrow {
    color: var(--text-muted, #9ca3af);
    font-size: 13px;
    transition: transform 0.22s cubic-bezier(0.22,1,0.36,1);
}
.settings-v2 .settings-list .settings-section-body {
    padding: 0 20px 20px;
    border-top: 1px solid var(--border-color, rgba(0,0,0,0.05));
}
.settings-v2 .settings-list .settings-section-body .card-settings {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 18px 0 0;
}
.settings-v2 .settings-list .settings-section-slot-danger .settings-row-icon {
    background: rgba(220,38,38,0.10);
    color: #dc2626;
}

/* ── Modal mode: nessun hero, padding azzerati, layout subito a piena vista ── */
.settings-v2.is-in-modal {
    max-width: none;
    margin: 0;
    padding: 0;
}
.settings-v2.is-in-modal .set-hero { display: none; }
.settings-v2.is-in-modal .set-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin: 0;
}
.settings-v2.is-in-modal .set-nav {
    top: 0;
    position: static;
}
.settings-v2.is-in-modal .set-panel-head {
    margin-bottom: 10px;
}
.settings-v2.is-in-modal .set-panel-head h2 {
    font-size: 1.08rem;
}
.settings-v2.is-in-modal .set-panel-head p {
    font-size: 12.5px;
}
.settings-v2.is-in-modal .settings-list {
    border-radius: 16px;
}
.settings-v2.is-in-modal .settings-list .settings-row {
    padding: 14px 18px;
}
.settings-v2.is-in-modal .set-nav-item {
    padding: 10px 12px;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE: nav chip orizzontali scrollabili + tap target 44px
   Pattern Linear/Notion: scroll-snap, pill attiva lime piena,
   indicatore di scroll (fade laterale).
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .settings-v2 .set-layout {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    /* Nav chip orizzontali */
    .settings-v2 .set-nav {
        position: sticky;
        top: 0;
        z-index: 5;
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px 14px 10px;
        margin: 0 -14px;
        background: linear-gradient(180deg, var(--bg-surface, #fff) 0%, var(--bg-surface, #fff) 70%, transparent 100%);
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 14px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .settings-v2 .set-nav::-webkit-scrollbar { display: none; }

    /* Chip = pill orizzontale */
    .settings-v2 .set-nav-item {
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        min-height: var(--touch-min, 44px);
        padding: 10px 14px;
        border-radius: 999px;
        border: 1px solid var(--border-color, rgba(0,0,0,0.08));
        background: var(--bg-surface, #fff);
        scroll-snap-align: start;
    }
    .settings-v2 .set-nav-ico {
        width: 24px;
        height: 24px;
        font-size: 12px;
        border-radius: 50%;
    }
    .settings-v2 .set-nav-text {
        flex-direction: row;
        align-items: center;
        gap: 6px;
        flex: 0 0 auto;
    }
    .settings-v2 .set-nav-label {
        font-size: 13.5px;
        white-space: nowrap;
    }
    .settings-v2 .set-nav-desc { display: none; }
    .settings-v2 .set-nav-count {
        position: static;
        margin: 0;
        min-width: 20px;
        height: 20px;
        font-size: 10.5px;
    }
    /* Pill attiva piena (lime in prod-v2 via accent-color) */
    .settings-v2 .set-nav-item.is-active {
        background: var(--accent-color, #84cc16) !important;
        border-color: var(--accent-color, #84cc16) !important;
    }
    .settings-v2 .set-nav-item.is-active .set-nav-label,
    .settings-v2 .set-nav-item.is-active .set-nav-ico {
        color: #0d0d0d !important;
        background: rgba(255,255,255,0.30) !important;
    }
    .settings-v2 .set-nav-item.is-active .set-nav-count {
        background: rgba(13,13,13,0.18) !important;
        color: #0d0d0d !important;
    }

    /* Pannello dettaglio */
    .settings-v2 .set-panel-head {
        margin-bottom: 10px;
        padding: 4px 0 0;
    }
    .settings-v2 .set-panel-head h2 {
        font-size: 1.05rem;
    }
    .settings-v2 .set-panel-head p {
        font-size: 12.5px;
    }

    /* Settings row: touch comfort */
    .settings-v2 .settings-list .settings-row {
        min-height: var(--touch-min, 44px);
        padding: 14px 16px !important;
    }
    .settings-v2 .settings-list .settings-row-icon {
        width: 36px;
        height: 36px;
    }
    .settings-v2 .settings-list .settings-section-body {
        padding: 0 16px 18px;
    }

    /* Hero (solo pagina full, non in modal) */
    .settings-v2 .set-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    .settings-v2 .set-save-btn {
        justify-content: center;
        min-height: var(--touch-min, 44px);
    }

    /* In modal: layout senza padding extra esterno */
    .settings-v2.is-in-modal .set-nav {
        margin: 0 -20px;
        padding-inline: 20px;
    }
}

/* Schermi molto piccoli: stringi padding ulteriormente */
@media (max-width: 420px) {
    .settings-v2 .set-nav { margin: 0 -12px; padding-inline: 12px; }
    .settings-v2.is-in-modal .set-nav { margin: 0 -16px; padding-inline: 16px; }
    .settings-v2 .set-nav-item { padding: 9px 12px; }
    .settings-v2 .set-nav-label { font-size: 13px; }
    .settings-v2 .settings-list .settings-row { padding: 13px 14px !important; }
}
