
/* ============================================================
   1. VARIABILI GLOBALI E FONDAMENTA
   ============================================================ */
:root {
    --primary: #111111;
    --sidebar-bg: #ffffff;
    --sidebar-text: #78716c;
    --bg-body: #f4f3f1;
    --text-main: #111111;
    --text-muted: #78716c;
    --border-color: rgba(0, 0, 0, 0.05);
    --accent-color: #84cc16;
    --accent-dark: #0f172a;

    /* Ombre e Arrotondamenti Premium */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 26px;

    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.02), 0 10px 30px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 10px 30px rgba(0, 0, 0, 0.04), 0 20px 50px rgba(0, 0, 0, 0.08);
    --shadow-premium: 0 20px 40px rgba(0, 0, 0, 0.06), 0 30px 60px rgba(0, 0, 0, 0.1);

    /* Transition & easing tokens */
    --transition-fast:   0.2s;
    --transition-medium: 0.28s;
    --transition-slow:   0.4s;
    --ease-enter: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-exit:  cubic-bezier(0.4, 0, 1, 1);
    --ease-std:   cubic-bezier(0.4, 0, 0.2, 1);

    /* Semantic feedback colors */
    --color-success: #16a34a;
    --color-warning: #d97706;
    --color-error:   #dc2626;
    --color-info:    #2563eb;

    /* Touch target & safe-area (mobile) */
    --touch-min:     44px;   /* WCAG AA */
    --touch-comfort: 48px;   /* Material */
    --safe-bottom:   env(safe-area-inset-bottom, 0px);
    --safe-top:      env(safe-area-inset-top, 0px);
    --safe-left:     env(safe-area-inset-left, 0px);
    --safe-right:    env(safe-area-inset-right, 0px);

    /* Breakpoint canonici (documentazione - non @custom-media perche non supportato) */
    --bp-sm: 480px;
    --bp-md: 768px;
    --bp-lg: 1024px;
}

body {
    font-family: 'Inter', 'Geist', sans-serif;
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.5;
    background-color: var(--bg-body, #f4f3f1);
    color: var(--text-main, #111111);
}

/*Â Global smooth scrolling for internal anchors */
html {
    scroll-behavior: smooth;
}

/* Utility for fade-in when content is replaced */
.fade-in {
    animation: pageEnter 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Animazione navigazione pagine */
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes modalSpring {
    0%   { opacity: 0; transform: scale(0.84) translateY(22px); }
    60%  { opacity: 1; transform: scale(1.01) translateY(-2px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes toastSlide {
    from { opacity: 0; transform: translateX(28px) scale(0.93); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes popIn {
    0%   { transform: scale(0.8); opacity: 0; }
    70%  { transform: scale(1.06); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE: touch target ≥44px + safe-area su elementi fissi
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Guard: niente scroll orizzontale non intenzionale */
    html, body { overflow-x: clip; }

    /* Touch comfort sui controlli primari (escludi micro-controlli marcati [data-compact]) */
    .btn-modal-send,
    .btn-modal-cancel,
    .btn-login,
    .btn-primary,
    .btn-floating,
    .menu-item,
    .top-menu-item,
    .acq-tab,
    .req-tab,
    .pip-tab,
    .crm-tab {
        min-height: var(--touch-min, 44px);
    }
    .btn-modal-send:not([data-compact]),
    .btn-modal-cancel:not([data-compact]),
    .btn-login:not([data-compact]) {
        padding-block: 12px;
    }

    /* FAB e bottoni floating: distanza dalla safe-area iOS */
    .ai-assistant-shell { bottom: calc(88px + var(--safe-bottom, 0px)); }
    #floating-cart-btn,
    .btn-floating {
        bottom: calc(20px + var(--safe-bottom, 0px));
    }
}

/* apply to buttons and interactive elements */
button, .menu-item, .btn-sos, .btn-login, .btn-modal-send {
    transition: background-color 0.22s ease, color 0.22s ease, opacity 0.22s ease,
                transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
}

button, [role="button"], .menu-item, .btn-sos, .btn-login,
.btn-modal-send, .btn-modal-cancel, a[href] {
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--accent-color, #84cc16);
    outline-offset: 2px;
}
:focus:not(:focus-visible) {
    outline: none;
}
/* Click feedback su tutti i pulsanti primari */
.btn-login:active, .btn-modal-send:active, .btn-primary:active, .btn-sos:active {
    transform: scale(0.95) !important;
    transition: transform 0.08s ease !important;
}
.menu-item:active { transform: scale(0.97) !important; }













/* ============================================================
   2. PAGINA DEL LOGIN
   ============================================================ */

/* SFONDO LOGIN - Slice 1: tono premium coerente con la landing ma pensato per una UI operativa. */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 18% 18%, rgba(255,255,255,0.12), transparent 28%),
        radial-gradient(circle at 82% 14%, rgba(255,255,255,0.06), transparent 24%),
        linear-gradient(180deg, rgba(5,5,5,0.96) 0%, rgba(10,10,10,0.98) 38%, rgba(18,18,18,1) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200000;
    overflow: hidden;
}

#login-overlay::before,
#login-overlay::after {
    content: "";
    position: absolute;
    inset: auto;
    pointer-events: none;
}

#login-overlay::before {
    width: min(42vw, 420px);
    height: min(42vw, 420px);
    top: 10%;
    left: -6%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 72%);
    filter: blur(18px);
}

#login-overlay::after {
    width: min(36vw, 360px);
    height: min(36vw, 360px);
    right: -4%;
    bottom: 8%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 72%);
    filter: blur(22px);
}

/* Mostra il login solo quando richiesto (classe impostata inline in index.html) */
.needs-login #login-overlay {
    display: flex;
    animation: loginOverlayEntra 0.35s ease-out both;
}

@keyframes loginOverlayEntra {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.needs-login .login-card {
    animation: loginCardEntra 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes loginCardEntra {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* CARD DI LOGIN */
.login-card {
    position: relative;
    isolation: isolate;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%),
        linear-gradient(180deg, rgba(13,13,13,0.95) 0%, rgba(24,24,24,0.98) 100%);
    padding: 30px;
    border-radius: 32px;
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.42);
    width: 90%;
    max-width: 430px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(125deg, rgba(255,255,255,0.12) 0%, transparent 32%, transparent 68%, rgba(255,255,255,0.06) 100%);
    opacity: 0.72;
    pointer-events: none;
    z-index: 0;
}

.login-card > * {
    position: relative;
    z-index: 1;
}

.login-brand-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: #d4d4d4;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.login-brand-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, #a3a3a3 100%);
    box-shadow: 0 0 16px rgba(255,255,255,0.38);
}

/* LOGO NEL LOGIN - PIÃ™ GRANDE */
.login-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.login-logo-img {
    width: 144px;
    height: auto;
    filter: none !important;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 12px 30px rgba(0,0,0,0.35)) !important;
}

/* Testi login: font display per i titoli, font UI per i campi e le azioni. */
.login-heading-block {
    margin-bottom: 14px;
    text-align: center;
}

.login-main-title {
    margin: 0;
    color: #ffffff;
    font-family: 'Inter', 'Roboto', sans-serif;
    font-size: clamp(1.5rem, 3.4vw, 1.85rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 700;
}

.login-main-copy {
    color: #a3a3a3;
    font-family: 'Inter', 'Roboto', sans-serif;
    font-size: 15px;
    line-height: 1.65;
    margin: 10px 0 0;
    max-width: 34ch;
}

.login-view-title {
    color: #ffffff;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px;
}

.login-view-copy {
    color: #a3a3a3;
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 18px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-field {
    display: block;
}

.login-field-label {
    display: block;
    color: #b5b5b5;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* BOTTONE LOGIN */
.btn-login {
    width: 100%;
    min-height: 52px;
    background: linear-gradient(180deg, #ffffff 0%, #d4d4d4 100%);
    color: #111111;
    padding: 15px 18px;
    border-radius: 16px;
    border: none;
    font-weight: 700;
    font-family: 'Inter', 'Roboto', sans-serif;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.22s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 18px 38px rgba(255,255,255,0.12);
}

.btn-login:hover {
    background: linear-gradient(180deg, #ffffff 0%, #e5e5e5 100%);
    color: #111111;
    box-shadow: 0 24px 48px rgba(255,255,255,0.16);
    transform: translateY(-1px);
}

/* INPUT FIELD - Override locale al login, cosi' gli altri form dell'app restano invariati. */
#login-overlay .input-field-modern {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 0;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(17,17,17,0.84);
    color: #f8fafc;
    font-family: inherit;
    box-sizing: border-box;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

#login-overlay .input-field-modern:focus {
    border-color: rgba(255,255,255,0.34);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.08);
    outline: none;
}

#login-overlay .input-field-modern::placeholder {
    color: #8f8f8f;
}

.login-error-msg {
    color: #fda4af;
    font-size: 13px;
    font-weight: 600;
    margin-top: 12px;
    min-height: 20px;
}

.login-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.login-trust-row span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    color: #d4d4d4;
    font-size: 11px;
    font-weight: 600;
}

.login-trust-row i {
    color: #b5b5b5;
}

/* STILE PULSANTE LOGOUT ELEGANTE (POSIZIONE TOP) */

/* ============================================================
   SIDEBAR COLLASSABILE
   ============================================================ */

/* --- Sidebar expanded (default) --- */
.sidebar {
    transition: width 0.28s cubic-bezier(0.4,0,0.2,1) !important;
    overflow: visible !important;
    z-index: 200 !important;
}

/* --- Sidebar COLLAPSED --- */
.sidebar.collapsed {
    width: 72px !important;
    padding: 18px 8px !important;
}

/* Nascondi testi sidebar quando collapsed */
.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed #user-info-top,
.sidebar.collapsed .menu-item .menu-label {
    display: none !important;
    width: 0 !important;
    overflow: hidden !important;
}

/* Menu item centrato su emoji quando collapsed */
.sidebar.collapsed .menu-item {
    justify-content: center !important;
    padding: 12px 0 !important;
}
.sidebar.collapsed .menu-content {
    gap: 0 !important;
    justify-content: center !important;
}

/* Brand home button quando collapsed: solo icona centrata */
.sidebar.collapsed .sidebar-brand-home-btn {
    justify-content: center !important;
    padding: 10px 0 !important;
}

/* Avatar centrato quando collapsed */
.sidebar.collapsed .sidebar-user-section {
    justify-content: center !important;
    padding: 12px 0 !important;
}
/* Nascondi badge inline quando collapsed */
.sidebar.collapsed .badge-sidebar-inline {
    display: none !important;
}

/* Emoji nelle voci menu: 5px piÃ¹ grandi del testo */
.menu-content > span:first-child {
    font-size: 18px !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

/* main-content si sposta a seconda dello stato --- */
/* (gestito via JS con classe su body) */
body.sidebar-collapsed .main-content {
    margin-left: 82px !important;
    width: calc(100% - 92px) !important;
}

/* ---- FINE SIDEBAR COLLASSABILE ---- */
.user-avatar-btn {
    position: relative !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: var(--avatar-user-color, #8fe45e) !important;
    border: 2.5px solid rgba(255,255,255,0.25) !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s !important;
    padding: 0 !important;
    outline: none !important;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--avatar-user-color, #8fe45e) 40%, transparent) !important;
}
.user-avatar-btn:hover {
    border-color: rgba(255,255,255,0.55) !important;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--avatar-user-color, #8fe45e) 65%, transparent) !important;
    transform: scale(1.06) !important;
}
.user-avatar-btn:active {
    transform: scale(0.97) !important;
}

/* Indicatore presenza utenti online */
#online-indicator,
#online-indicator-mob {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    border: 1.5px solid var(--color-background-primary, #1a2030);
    pointer-events: none;
    z-index: 10;
}

/* ---- ACCOUNT DROPDOWN ----  */
.sidebar-user-section {
    position: relative !important;
}
.account-dropdown {
    position: absolute !important;
    bottom: calc(100% + 8px) !important;
    left: 0 !important;
    width: 240px !important;
    background: #1c1c1e !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
    border-radius: 14px !important;
    box-shadow: 0 -8px 36px rgba(0,0,0,0.55) !important;
    z-index: 9999 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(6px) !important;
    transition: opacity 0.18s ease, transform 0.18s ease !important;
}
.account-dropdown.open {
    opacity: 1 !important;
    pointer-events: all !important;
    transform: translateY(0) !important;
}
/* Quando collapsed: dropdown si apre a destra della sidebar */
.sidebar.collapsed .account-dropdown {
    bottom: 0 !important;
    left: calc(100% + 10px) !important;
    transform: translateX(-6px) !important;
}
.sidebar.collapsed .account-dropdown.open {
    transform: translateX(0) !important;
}
.account-dropdown-header {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 16px 16px 14px !important;
}
.account-ddrop-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: #8fe45e !important;
    color: #ffffff !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}
.account-ddrop-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    overflow: hidden !important;
}
.account-ddrop-name {
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.account-ddrop-role {
    color: #6b7280 !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}
.account-dropdown-divider {
    height: 1px !important;
    background: rgba(255,255,255,0.07) !important;
    margin: 0 !important;
}
.account-menu-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 12px 16px !important;
    background: transparent !important;
    border: none !important;
    color: #d1d5db !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    text-align: left !important;
    transition: background 0.15s, color 0.15s !important;
}
.account-menu-item:hover {
    background: rgba(255,255,255,0.07) !important;
    color: #ffffff !important;
}
.account-menu-item i {
    width: 16px !important;
    text-align: center !important;
    font-size: 14px !important;
    opacity: 0.75 !important;
}
.account-menu-logout {
    color: #f87171 !important;
}
.account-menu-logout:hover {
    background: rgba(244,63,94,0.12) !important;
    color: #fb7185 !important;
}
/* ---- AVATAR COLOR PICKER ---- */
.avatar-color-section {
    padding: 10px 16px 12px !important;
    border-top: 1px solid rgba(255,255,255,0.07) !important;
}
.avatar-color-label {
    font-size: 10px !important;
    font-weight: 600 !important;
    color: #6b7280 !important;
    letter-spacing: .06em !important;
    text-transform: uppercase !important;
    margin-bottom: 8px !important;
    display: block !important;
}
.avatar-color-swatches {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    align-items: center !important;
}
#avatar-custom-swatches,
#avatar-predefined-swatches {
    display: contents !important;
}
.avatar-color-swatch {
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    border: 2px solid transparent !important;
    cursor: pointer !important;
    transition: transform 0.15s, border-color 0.15s !important;
    flex-shrink: 0 !important;
    outline: none !important;
}
.avatar-color-swatch:hover {
    transform: scale(1.18) !important;
}
.avatar-color-swatch.active {
    border-color: #ffffff !important;
    transform: scale(1.14) !important;
}
/* Pulsante aggiungi colore custom */
.avatar-color-add-btn {
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    border: 2px dashed #4b5563 !important;
    background: transparent !important;
    color: #6b7280 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    outline: none !important;
    padding: 0 !important;
    line-height: 1 !important;
    transition: border-color 0.15s, color 0.15s !important;
}
.avatar-color-add-btn:hover {
    border-color: #9ca3af !important;
    color: #d1d5db !important;
}
/* Editor inline colore */
.avatar-color-editor {
    display: none;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 0 2px !important;
}
.avatar-color-editor input[type=color] {
    width: 36px !important;
    height: 28px !important;
    border: 2px solid rgba(255,255,255,0.15) !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    background: transparent !important;
    padding: 2px !important;
    outline: none !important;
}
.avatar-editor-btn {
    width: 28px !important;
    height: 28px !important;
    border-radius: 6px !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 13px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.15s !important;
    outline: none !important;
}
.avatar-editor-ok  { background: #22c55e !important; color: #fff !important; }
.avatar-editor-ok:hover { background: #16a34a !important; }
.avatar-editor-cancel { background: rgba(255,255,255,0.10) !important; color: #d1d5db !important; }
.avatar-editor-cancel:hover { background: rgba(255,255,255,0.18) !important; }
/* Link ripristina predefiniti */
.avatar-ripristina-btn {
    background: none !important;
    border: none !important;
    color: #4b5563 !important;
    font-size: 10px !important;
    cursor: pointer !important;
    padding: 4px 0 0 !important;
    display: block !important;
    text-align: left !important;
    font-family: inherit !important;
    transition: color 0.15s !important;
    outline: none !important;
}
.avatar-ripristina-btn:hover { color: #9ca3af !important; }














/* ============================================================
   3. PAGINA PRINCIPALE: SIDEBAR
   ============================================================ */

   /* --- SIDEBAR PRINCIPALE --- */
   /* 1. Forza la Sidebar a essere il punto di riferimento */
.sidebar {
    width: 240px;
    height: 100vh !important;
    position: fixed !important;
    top: 0;
    left: 0;
    background: #242424;
    box-sizing: border-box;
    padding: 15px;
}

/* 2. Posizionamento ASSOLUTO per il footer */
/* 1. SEZIONE UTENTE (IN BASSO nel footer) */
.sidebar-user-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 8px;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 0;
}

.user-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.user-avatar-top {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--avatar-user-color, #8fe45e);
}

.user-info-top, #user-info-top {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-grow: 1;
    color: var(--sidebar-text, #9ca3af);
}

.user-name { font-size: 13px; font-weight: 700; color: var(--sidebar-text, #9ca3af); }

#user-name-display {
    color: var(--sidebar-text, #9ca3af);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.user-role { font-size: 10px; color: color-mix(in srgb, var(--sidebar-text, #9ca3af) 78%, transparent); text-transform: uppercase; }

/* 2. MENU CENTRALE [cite: 40] */

#badge-carrello-count {
    background: #d4d4d4;
    color: #111111;
}
.menu-section-label {
    color: #6b7280;
    font-size: 10px;
    font-weight: 700;
    margin: 10px 0 5px 10px;
    text-transform: uppercase;
    margin-top: 20px;
    letter-spacing: 0.05em;
}

.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Spinge il badge a destra */
    padding: 11px 12px;
    color: #a3a3a3;
    cursor: pointer;
    border-radius: 14px;
    border: 1px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

button.menu-item {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    font: inherit;
    text-align: left;
    width: 100%;
}

.menu-item:hover {
    background: rgba(255,255,255,0.06);
    color: #ffffff;
    border-color: rgba(255,255,255,0.04);
}

.menu-item.active {
    background: #f5f5f4 !important;
    color: #111111 !important;
    border-color: #f5f5f4 !important;
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.menu-item.active .badge-sidebar-inline {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
}

.menu-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
    overflow: hidden;
    white-space: nowrap;
}

/* Il testo delle label del menu (da nascondere in collapsed) */
.menu-label {
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.2s, width 0.2s;
}

/* Badge rosso accanto a Richieste [cite: 44] */
.badge-sidebar-inline {
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 0 7px;
    border-radius: 99px;
    border: 1px solid rgba(255,255,255,0.08);
    display: none; /* Si mostra solo se > 0 [cite: 45] */
    transition: background 0.3s, color 0.2s;
    box-shadow: none;
    letter-spacing: 0.01em;
}
/* Sollecito: il badge diventa arancione e lampeggia */
@keyframes badge-pulse {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%       { transform: scale(1.2); opacity: 0.75; }
}
.badge-sidebar-inline.badge-sollecito-attivo {
    background: #ffffff;
    color: #111111;
    animation: badge-pulse 1.4s ease-in-out infinite;
}

/* FOOTER [cite: 45] */
/* Assicuriamoci che la sidebar sia un contenitore flex alto tutto lo schermo */
.sidebar {
    width: 260px;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    background: #242424;
    padding: 20px 15px !important;
    box-sizing: border-box;
    overflow: visible;
}

/* FOOTER SIDEBAR â€” brand block stile Linear/Notion */
.sidebar-footer {
    margin-top: auto !important;
    width: 100% !important;
    padding: 10px 0 0 0;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* ---- BRAND HOME BUTTON (in cima alla sidebar) ---- */
.sidebar-brand-home-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 11px !important;
    padding: 14px 10px !important;
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.07) !important;
    margin-bottom: 12px !important;
    cursor: pointer !important;
    outline: none !important;
    text-decoration: none !important;
}
.sidebar-brand-home-btn:hover,
.sidebar-brand-home-btn:focus {
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

/* La sidebar-footer ora contiene l'account */
.sidebar-footer-brand {
    display: none !important;
}

.sidebar-brand-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
}

.sidebar-brand-img {
    width: 36px !important;
    height: 36px !important;
    object-fit: contain !important;
}

.sidebar-brand-text {
    display: flex !important;
    align-items: center !important;
    overflow: hidden !important;
}

.sidebar-brand-name {
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    letter-spacing: 0.12em !important;
    white-space: nowrap !important;
    line-height: 1 !important;
}
















/* ============================================================
   4. AREA CONTENUTO PRINCIPALE (MAIN CONTENT)
   ============================================================ */

/* search bar previously styled inline */
.search-container {
    position: relative;
    margin-bottom: 20px;
    max-width: 450px;
}
.search-container > i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}
.search-container input {
    width: 100%;
    padding: 10px 42px 10px 40px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 13px;
    outline: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}
/* Pulsante filtro articoli mobile â€” posizionato a destra nell'input */
.btn-filtro-articoli-mobile {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1.5px solid #e2e8f0;
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-filtro-articoli-mobile:hover {
    background: #f1f5ff;
    color: #2563eb;
    border-color: #2563eb;
}
.btn-filtro-articoli-mobile.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

/* --- MAIN CONTENT --- */
.main-content {
    flex-grow: 1;
    padding: 32px 40px;
    overflow-y: auto;
    position: relative;
    box-sizing: border-box;
    min-width: 0;
}

#contenitore-dati {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    border-bottom: 1px solid #f0f4f8;
    padding-bottom: 16px;
}

h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.03em;
}















/* ============================================================
   5. PAGINA PROGRAMMA PRODUZIONE
   ============================================================ */

/* --- CARD ORDINE --- */
.riga-ordine {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 12px;
    position: relative;
}
.riga-ordine b,
.riga-ordine span[style*="font-weight:800"] {
    font-size: 0.95rem !important; /* Non troppo grande */
}

.riga-ordine:hover {
    transform: translateY(-3px) scale(1.003);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: var(--border-color);
}
.riga-ordine.op-aperto-ord:hover,
.riga-ordine.stato-aperto-ord:hover,
.riga-ordine.azioni-aperto-ord:hover {
    transform: none;
}

.riga-ordine.open {
    border-left: 6px solid #242424;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
    background: #fafafa;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.dettagli-container {
    display: none;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    padding: 20px 30px;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out;
    overflow: visible; /* permette ai popup dei dropdown di uscire dal contenitore */
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.99); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.item-card {
    display: grid;
    grid-template-columns: 2fr 0.8fr 1.6fr 1.6fr auto;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow var(--transition-fast) ease, transform var(--transition-fast) ease;
    min-width: 0;
    position: relative; /* necessario per z-index */
    z-index: 0;         /* stacking context esplicito e neutro */
}

/* Quando un dropdown Ã¨ aperto, porta la card in primo piano sopra le sorelle */
.item-card.stato-aperto, .item-card.op-aperto {
    z-index: 50 !important;
}

/* Stesso per il dropdown nelle righe header ordine */
.riga-ordine.op-aperto-ord,
.riga-ordine.stato-aperto-ord,
.riga-ordine.azioni-aperto-ord {
    z-index: 50;
    transform: none !important;
}

@media (max-width: 768px) {
    .ov-kanban-summary-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        color: #475569;
        font-size: 0.85rem;
        font-weight: 700;
        cursor: pointer;
        user-select: none;
        margin-bottom: 12px;
        width: 100%;
        box-sizing: border-box;
    }
    .ov-kanban-summary-mobile::-webkit-details-marker { display: none; }
}
@media (min-width: 769px) {
    .ov-kanban-summary-mobile { display: none !important; }
}

.item-card:hover {
    transform: translateY(-2px) scale(1.005);
    box-shadow: 0 10px 26px -4px rgba(0,0,0,0.11);
}





















/* ============================================================
   6. PAGINA ARCHIVIO ORDINI
   ============================================================ */

/* Griglia specifica per le card dell'archivio */
.item-card.archivio-layout {
    display: grid !important;
    grid-template-columns: 1.5fr 0.8fr 1.2fr 1.2fr 180px;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

/* Miglioriamo le etichette per farle stare sopra il valore */
.label-sm {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
}

.item-card-product-col {
    min-width: 0;
}

.item-card-product-name {
    margin-top: 4px;
    color: #475569;
    font-size: 12px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

/* Forza i bottoni dell'archivio a non allargarsi troppo */
.btn-archive-action {
    width: 100%;
    padding: 6px 10px !important;
    font-size: 11px !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: all 0.2s;
}

/* utility per card archivio */
.archivio-codice {
    color: #1e293b;
}
.archivio-qty {
    text-align: center;
}
.archivio-qty-val {
    font-size: 16px;
}
.archivio-stato {
    color: #64748b;
    font-weight: 700;
}
.archivio-operatore {
    color: #64748b;
    font-weight: 600;
}


/* ============================================================
   SELECT STATO CUSTOM DROPDOWN
   ============================================================ */

/* Manteniamo select-interattivo per retrocompatibilitÃ  mobile */
.select-interattivo {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-color: #f8fafc;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    padding: 8px 35px 8px 15px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

/* Wrapper relativo */
.stato-dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* Pill trigger - nessun color-mix, colori statici stabili */
.stato-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 7px 12px 7px 10px;
    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.5px;
    color: #334155;
    white-space: nowrap;
    box-sizing: border-box;
    /* nessuna transition sul trigger stesso: il dot fornisce il colore */
}
.stato-trigger:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.stato-dropdown.open .stato-trigger {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* Dot colorato â€” il colore viene impostato via style inline JS */
.stato-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #94a3b8; /* sovrascritta da style="background:â€¦" inline */
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.9);
    box-sizing: content-box;
}

/* Testo stato */
.stato-label-txt {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chevron */
.stato-chevron {
    font-size: 9px;
    flex-shrink: 0;
    color: #94a3b8;
    transition: transform 0.2s ease;
}
.stato-dropdown.open .stato-chevron {
    transform: rotate(180deg);
}

/* Popup */
.stato-popup {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 210px;
    width: max-content;
    max-width: min(280px, calc(100vw - 24px));
    max-height: min(320px, calc(100dvh - 120px));
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 10002;
    padding: 5px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
    pointer-events: none;
}
.stato-dropdown.open .stato-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0s;
    pointer-events: auto;
}

/* Singola opzione â€” hover semplice senza color-mix */
.stato-option {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #334155;
    cursor: pointer;
    text-align: left;
    width: 100%;
}
.stato-option:hover {
    background: #f1f5f9;
}
.stato-option.is-selected {
    background: #f0f9ff;
    color: #0369a1;
    font-weight: 700;
}

/* Dot opzione â€” colore da style inline */
.stato-opt-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #94a3b8; /* sovrascritta da style inline */
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.85);
    box-sizing: content-box;
}

/* Check sull'opzione selezionata */
.stato-check-icon {
    margin-left: auto;
    font-size: 10px;
    color: #0369a1;
}

/* â”€â”€ Variante header-ordine del dropdown stato â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.stato-dropdown-ord {
    width: 160px;
    flex-shrink: 0;
}
.stato-dropdown-ord .stato-trigger {
    width: 100%;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 11px;
}
/* Popup della variante ordine: ancorato a destra per non uscire dallo schermo */
.stato-dropdown-ord .stato-popup {
    left: auto;
    right: 0;
}
/* â”€â”€ z-index: eleva il wrapper quando qualsiasi dropdown Ã¨ aperto â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ordine-wrapper:has(.stato-dropdown.open),
.ordine-wrapper:has(.op-dropdown.open),
.ordine-wrapper:has(.ord-azioni-menu.open) {
    position: relative;
    z-index: 20;
}

.scroll-wrapper { text-align: right; margin: 10px 0; }
.scroll-btn {
    background: #242424;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transition: background 0.2s, color 0.2s;
}
.scroll-btn:hover { background: #ffffff; color: #242424; box-shadow: 0 2px 10px rgba(0,0,0,0.15); }

/* Step 2: Chiedi/Assegna e Archivia - palette nero/bianco */
.btn-chiedi-assegna {
    background: #242424!important;
    color: #ffffff !important;
    border: none !important;
    transition: background 0.2s, color 0.2s !important;
}
.btn-chiedi-assegna:hover {
    background: #ffffff !important;
    color: #242424!important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important;
}
.btn-archivia-prod {
    background: #242424!important;
    color: #ffffff !important;
    border: none !important;
    transition: background 0.2s, color 0.2s !important;
}
.btn-archivia-prod:hover {
    background: #ffffff !important;
    color: #242424!important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important;
}

/* â”€â”€ QuantitÃ  evasa / parziale â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.qty-cell { display: flex; flex-direction: column; gap: 3px; }
.qty-row  { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.btn-qty-evasa-toggle {
    background: none;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 2px 5px;
    cursor: pointer;
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-qty-evasa-toggle:hover,
.btn-qty-evasa-toggle.active {
    background: #f59e0b22;
    border-color: #f59e0b;
    color: #f59e0b;
}
.qty-evasa-block {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}
.qty-evasa-input {
    width: 62px;
    padding: 3px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.82rem;
    background: #f8fafc;
    color: #1e293b;
    text-align: center;
    outline: none;
    transition: border-color 0.15s;
}
.qty-evasa-input:focus { border-color: #f59e0b; background: #fff; }
.qty-rimanente-wrap {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.78rem;
    background: #f1f5f9;
    border-radius: 5px;
    padding: 2px 7px;
    white-space: nowrap;
}
.qty-rim-lbl { color: #94a3b8; font-size: 0.72rem; }
.qty-rimanente { color: #0f172a; font-size: 0.82rem; font-weight: 700; }
/* Tasto Sollecita (commerciali) */
.btn-sollecita {
    background: #d97706 !important;
    color: #ffffff !important;
    border: none !important;
    transition: background 0.2s, color 0.2s !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 12px !important;
    border-radius: 6px;
    font-size: 11px !important;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.btn-sollecita:hover { background: #b45309 !important; }
/* Tasto Ripristina (archivio ordine) */
.btn-ripristina {
    background: #242424!important;
    color: #ffffff !important;
    border: none !important;
    transition: background 0.2s, color 0.2s !important;
}
.btn-ripristina:hover {
    background: #ffffff !important;
    color: #242424!important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important;
}

/* â”€â”€ Helper visibilitÃ  desktop/mobile â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.hide-mobile  { /* visibile di default, nascosto da @media â‰¤600 */ }
.show-mobile-flex { display: none; } /* mostrato da @media â‰¤600 */

/* â”€â”€ Menu azioni (tre puntini) â€“ visibile sempre â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ord-azioni-menu {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.ord-azioni-trigger {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.ord-azioni-trigger:hover {
    background: #f1f5f9;
    color: #334155;
}
.ord-azioni-menu.open .ord-azioni-trigger {
    background: #f1f5f9;
    color: #334155;
}
.ord-azioni-popup {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 10001;
    min-width: 160px;
    overflow: hidden;
    flex-direction: column;
    padding: 4px;
}
.ord-azioni-menu.open .ord-azioni-popup { display: flex; }
.ord-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    background: none;
    color: #334155;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    text-align: left;
    border-radius: 8px;
    transition: background 0.12s;
    font-family: inherit;
    box-sizing: border-box;
}
.ord-menu-item i { width: 14px; text-align: center; flex-shrink: 0; color: #64748b; }
.ord-menu-item:hover { background: #f1f5f9; }
.ord-menu-item + .ord-menu-item { border-top: none; }
.ord-menu-item--danger { color: #dc2626; }
.ord-menu-item--danger i { color: #dc2626; }
.ord-menu-item--danger:hover { background: #fef2f2; }
.ord-menu-item--warn { color: #d97706; }
.ord-menu-item--warn i { color: #d97706; }
.ord-menu-item--warn:hover { background: #fffbeb; }
.ord-menu-item--success { color: #15803d; }
.ord-menu-item--success i { color: #15803d; }
.ord-menu-item--success:hover { background: #f0fdf4; }




















/* ============================================================
   7. BOTTONI SUPPORTO E AZIONI (SOS)
   ============================================================ */

.btn-sos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 15px;
    background: transparent;
    color: #ef4444;
    border: 1px solid #fee2e2;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sos:hover {
    background: #fef2f2;
}

.btn-sos-small {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fee2e2;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px !important;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    min-width: 140px;  /* Forza i tasti ad avere la stessa larghezza */
    text-align: center;
    justify-content: center;
    white-space: nowrap;
}

.badge-count {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    min-width: 80px;   /* Allinea anche il badge finale */
    text-align: center;
}

















/* ============================================================
   8. MODAL SUPPORTO (FINESTRA DI DIALOGO)
   ============================================================ */

/* ============================================================
   AUTOCOMPLETE ORDINE (modal nuova richiesta)
   ============================================================ */
.modal-ordine-row { margin-bottom: 14px; }
.ordine-autocomplete-wrapper {
    position: relative;
}
.ordine-autocomplete-wrapper .input-field-modern {
    width: 100%;
    box-sizing: border-box;
}
.ordine-autocomplete-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 99999;
    overflow: hidden;
    max-height: 240px;
    overflow-y: auto;
}
.autocomplete-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    gap: 10px;
    transition: background 0.12s;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: #f0f9ff; }
.ac-ordine { font-weight: 700; font-size: 13px; color: #1e293b; white-space: nowrap; }
.ac-cliente { font-size: 12px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }

.modal-ordine-row .input-field-modern {
    margin-top: 6px;
    width: 100%;
    box-sizing: border-box;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 28px 56px -8px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.04);
    opacity: 0;
    transform: scale(0.84) translateY(22px);
}

.modal-overlay.active .modal-content {
    opacity: 1;
    transform: scale(1) translateY(0);
    animation: modalSpring 0.46s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ─── Modal X close button (universal) ───────────────────────── */
.modal-close-x {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: color 0.15s ease, background 0.15s ease;
    z-index: 10;
}
.modal-close-x:hover {
    color: #1e293b;
    background: #f1f5f9;
}

/* Ensure modal-content has position:relative for absolute X button */
.modal-content {
    position: relative;
}

.btn-tipo {
    flex: 1;
    padding: 12px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    transition: all 0.2s;
    text-transform: uppercase;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.btn-tipo.active {
    background: #242424;
    color: white;
    border-color: #242424;
}

#wrapper-operatori {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 10px 0;
}

.op-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    font-size: 13px;
}

.op-label:hover {
    background: #f8fafc;
}

.modal-chooser-azione-produzione {
    width: 560px;
    max-width: min(92vw, 560px);
    padding: 26px;
}
.modal-chooser-sottotitolo {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.45;
}
.modal-chooser-sezione {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}
.modal-chooser-lista-articoli {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
    padding-right: 4px;
}
.chooser-azione-target {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    text-align: left;
    font-size: 0.86rem;
    font-weight: 700;
    transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}
.chooser-azione-target:hover {
    border-color: rgba(17,17,17,0.16);
    background: #f8fafc;
    box-shadow: 0 10px 20px rgba(15,23,42,0.08);
}
.chooser-azione-target:active {
    transform: scale(0.99);
}
.chooser-azione-target-ordine {
    background: linear-gradient(180deg, #111111 0%, #262626 100%);
    border-color: #111111;
    color: #ffffff;
}
.chooser-azione-target-ordine:hover {
    background: #ffffff;
    color: #111111;
}
.chooser-azione-target-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.chooser-azione-target-copy strong {
    color: inherit;
    font-size: 0.84rem;
    line-height: 1.25;
}
.chooser-azione-target-copy small {
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1.3;
}
.chooser-azione-target-ordine .chooser-azione-target-copy small {
    color: rgba(255,255,255,0.72);
}
.modal-chooser-empty {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.84rem;
}














/* ============================================================
   9. GESTIONE MESSAGGI (INBOX) E STATISTICHE
   ============================================================ */

.inbox-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.messaggio-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.border-assegna {
    border-left: 5px solid #242424;
}

.border-domanda {
    border-left: 5px solid #f59e0b;
}

.badge-tipo {
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
}

.card-stat {
    background: white;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 14px;
}















/* ============================================================
   10. STILE CHAT MODERNA
   ============================================================ */

/* utility classes moved from inline templates */
.empty-msg {
    padding: 20px;
    color: #94a3b8;
    text-align: center;
}
.hidden-search { display: none !important; }

/* Risultati secondari (contengono il termine ma non iniziano con esso) */
.search-secondary {
    opacity: 0.62;
    border-style: dashed !important;
}
.separatore-archivio {
    margin: 60px 0 30px 0;
    text-align: center;
    border-top: 2px dashed #e2e8f0;
    position: relative;
}
.separatore-archivio span {
    background: #f8fafc;
    color: #94a3b8;
    padding: 5px 20px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid #e2e8f0;
}
.sezione-archiviata { opacity: 0.9; }
.slim { display: inline-block; }
.flex-grow { flex-grow: 1; min-width: 0; overflow: hidden; }
.order-info { display: flex; align-items: center; gap: 10px; }
.order-number { color: #94a3b8; margin-left: 15px; }
.order-title { font-weight: 800; font-size: 0.92rem; color: var(--order-color, inherit); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%; }
/* Badge con ordine + articoli combinati */
.badge-ord-num { font-weight: 800; opacity: 0.85; margin-right: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; display: inline-block; vertical-align: middle; }
.badge-ord-cliente { font-weight: 600; opacity: 0.72; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; display: inline-block; vertical-align: middle; }
.badge-sep { margin: 0 5px; opacity: 0.4; font-size: 10px; }
.dettagli-container.hidden { display: none; padding: 10px; background: #f1f5f9; }

/* sos button variants */
.btn-sos-small.warning {
    background: #f97316;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
}
.btn-sos-small.success {
    background: #22c55e;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
}


.chat-card {
    background: #ffffff;
    border-radius: 14px;
    margin-bottom: 12px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
}
/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ TAB BAR ACQUISTI â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#acq-tab-bar,
#req-tab-bar,
#kit-tab-bar {
    display: none;
    gap: 4px;
    padding: 8px 16px 0;
    background: transparent;
    flex-shrink: 0;
}
.acq-tab {
    flex: 1;
    padding: 9px 12px;
    border: none;
    border-radius: 10px 10px 0 0;
    background: #f1f5f9;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: background 0.18s, color 0.18s;
    position: relative;
}
.acq-tab:hover { background: #e2e8f0; color: #334155; }
.acq-tab.active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 -2px 0 0 #6366f1 inset;
}
.badge-acq-tab {
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 1.4;
}

@media (max-width: 480px) {
    #acq-tab-bar,
#req-tab-bar,
    #kit-tab-bar {
        gap: 6px;
        padding: 6px 10px 0;
    }

    .acq-tab {
        min-width: 0;
        padding: 8px 8px;
        font-size: 11px;
        gap: 5px;
        flex-wrap: wrap;
        line-height: 1.1;
        text-align: center;
    }

    .badge-acq-tab {
        padding: 1px 5px;
        font-size: 9px;
    }

    .sezione-header {
        padding: 10px 12px !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    .sezione-header-left {
        gap: 8px !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .sezione-header-right {
        flex-shrink: 0 !important;
        padding-top: 1px;
    }
}


/* Hub Acquisti */
.acq-hub-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 14px 16px 26px;
}

.acq-hub-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
    gap: 16px;
}

.acq-hub-hero-copy,
.acq-hub-ai-panel,
.acq-hub-card,
.acq-hub-metric,
.acq-hub-warning {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.acq-hub-hero-copy {
    padding: 22px 24px;
}

.acq-hub-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.acq-hub-hero-copy h2 {
    margin: 16px 0 10px;
    color: #0f172a;
    font-size: 28px;
    line-height: 1.15;
}

.acq-hub-hero-copy p,
.acq-hub-card-head p,
.acq-hub-warning,
.acq-hub-ai-panel p {
    color: #475569;
}

.acq-hub-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.acq-hub-ai-panel {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
    border-color: #1e293b;
    color: #e2e8f0;
}

.acq-hub-ai-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #f8fafc;
    font-weight: 700;
}

.acq-hub-ai-panel ul {
    margin: 0;
    padding-left: 18px;
    color: #cbd5e1;
    line-height: 1.45;
}

.acq-hub-ai-status {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
}

.acq-hub-ai-status.is-ready {
    background: rgba(16, 185, 129, 0.16);
    color: #d1fae5;
}

.acq-hub-ai-status.is-warning {
    background: rgba(245, 158, 11, 0.18);
    color: #fef3c7;
}

.acq-hub-warning {
    padding: 14px 16px;
    border-color: #fcd34d;
    background: linear-gradient(180deg, #fffdf5 0%, #fffbeb 100%);
}

.acq-hub-warning-detail {
    margin-top: 8px;
    color: #92400e;
    font-size: 13px;
    line-height: 1.45;
}

.acq-hub-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.acq-hub-metric {
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.acq-hub-metric strong {
    font-size: 28px;
    line-height: 1;
    color: #0f172a;
}

.acq-hub-metric-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.acq-hub-metric small {
    color: #475569;
}

.acq-hub-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.acq-hub-card {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.acq-hub-card-wide {
    grid-column: span 2;
}

.acq-hub-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.acq-hub-card-head h3,
.acq-hub-inline-panel h4 {
    margin: 0;
    color: #0f172a;
}

.acq-hub-card-head p,
.acq-hub-inline-panel p {
    margin: 4px 0 0;
    font-size: 14px;
    line-height: 1.45;
}

.acq-hub-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.acq-hub-list-item,
.acq-hub-inline-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.acq-hub-list-item strong,
.acq-hub-inline-item strong {
    color: #0f172a;
}

.acq-hub-list-item p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

.acq-hub-list-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    color: #475569;
    font-size: 12px;
    text-align: right;
}

.acq-hub-inline-panel {
    border-top: 1px solid #e2e8f0;
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.acq-hub-inline-item {
    align-items: center;
}

.acq-hub-empty {
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    font-size: 14px;
}

.acq-hub-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.acq-hub-badge.tone-success {
    background: #dcfce7;
    color: #166534;
}

.acq-hub-badge.tone-warning {
    background: #fef3c7;
    color: #92400e;
}

.acq-hub-badge.tone-dark {
    background: #e2e8f0;
    color: #334155;
}

.acq-hub-badge.tone-neutral {
    background: #e0f2fe;
    color: #075985;
}

@media (max-width: 1080px) {
    .acq-hub-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .acq-hub-grid,
    .acq-hub-hero {
        grid-template-columns: 1fr;
    }

    .acq-hub-card-wide {
        grid-column: span 1;
    }
}

/* Mobile: padding card ridotti, font metrica scalata per 375px */
@media (max-width: 600px) {
    .acq-hub-card,
    .acq-hub-ai-panel,
    .acq-hub-warning {
        padding: 16px;
    }
    .acq-hub-metric { padding: 16px 14px; }
    .acq-hub-metric strong { font-size: 22px; }
    .acq-hub-metric-label { font-size: 11px; letter-spacing: 0.03em; }
}

@media (max-width: 640px) {
    .acq-hub-shell {
        padding: 10px 10px 20px;
        gap: 14px;
    }

    .acq-hub-hero-copy,
    .acq-hub-ai-panel,
    .acq-hub-card,
    .acq-hub-metric,
    .acq-hub-warning {
        border-radius: 16px;
    }

    .acq-hub-hero-copy {
        padding: 18px;
    }

    .acq-hub-hero-copy h2 {
        font-size: 24px;
    }

    .acq-hub-metrics {
        grid-template-columns: 1fr;
    }

    .acq-hub-card-head,
    .acq-hub-list-item,
    .acq-hub-inline-item {
        flex-direction: column;
    }

    .acq-hub-list-meta {
        justify-content: flex-start;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .sezione-nome {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #floating-cart-btn {
        padding: 10px 12px !important;
        gap: 6px !important;
        border-radius: 10px !important;
        font-size: 13px !important;
    }

    #floating-cart-btn span {
        white-space: nowrap;
    }

    #modal-carrello > div {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        max-height: min(88dvh, calc(100dvh - 16px));
        padding: 16px 14px;
        border-radius: 20px;
        overflow-y: auto;
        box-sizing: border-box;
    }

    #modal-carrello .modal-header {
        gap: 10px;
    }

    #modal-carrello .modal-footer {
        flex-wrap: wrap;
    }

    #modal-carrello .modal-footer > * {
        flex: 1 1 100%;
    }

    .cart-item-row {
        align-items: flex-start;
        gap: 8px;
    }

    .cart-item-name,
    .cart-item-details {
        overflow-wrap: anywhere;
    }

    .cart-item-details {
        line-height: 1.35;
    }

    .btn-inline-trash {
        flex-shrink: 0;
        align-self: flex-start;
    }
}

@media (max-width: 390px) {
    .acq-tab {
        padding: 8px 6px;
        font-size: 10px;
        gap: 4px;
    }
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ PAGINA ORDINI ACQUISTI â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ordini-acq-page { padding-bottom: 40px; }
.ordini-groups { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

.ordine-group {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.ordine-group.all-done { opacity: 0.7; }
.ordine-group[open] { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.ordine-group-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    cursor: pointer;
    user-select: none;
    background: #f8fafc;
    border-bottom: 1px solid transparent;
    list-style: none;
    transition: background 0.15s;
}
.ordine-group-summary::-webkit-details-marker { display: none; }
.ordine-group[open] .ordine-group-summary { background: #f1f5f9; border-bottom-color: #e2e8f0; }
.ordine-group-summary:hover { background: #eff3f7; }

.og-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.og-operatore { font-size: 13px; font-weight: 800; color: #1e293b; }
.og-data { font-size: 12px; color: #64748b; }
.og-progress { font-size: 11px; font-weight: 700; background: #f1f5f9; color: #475569; padding: 2px 8px; border-radius: 20px; }
.og-done-badge { font-size: 11px; font-weight: 700; color: #15803d; background: #dcfce7; padding: 2px 8px; border-radius: 20px; }
.og-done-badge i { margin-right: 3px; }
.og-chevron { font-size: 11px; color: #94a3b8; transition: transform 0.25s; }
.ordine-group[open] .og-chevron { transform: rotate(180deg); }

.ordine-items { display: flex; flex-direction: column; gap: 0; }

.ordine-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.ordine-item:last-child { border-bottom: none; }
.ordine-item.is-ordinato { background: #f0fdf4; }
.ordine-item:hover { background: #f8fafc; }
.ordine-item.is-ordinato:hover { background: #ecfdf5; }

.oi-check-btn {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: transparent;
    color: #94a3b8;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    padding: 0;
}
.oi-check-btn:hover { border-color: #22c55e; color: #22c55e; }
.oi-check-btn.checked { border-color: #22c55e; color: #22c55e; background: #dcfce7; }
.oi-check-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.oi-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}
.ordine-item.is-ordinato .oi-thumb { opacity: 0.45; }


    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-ordinato { background: #22c55e; }
.dot-attesa   { background: #94a3b8; }

.oi-info { flex: 1; min-width: 0; }
.oi-nome { display: block; font-size: 14px; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ordine-item.is-ordinato .oi-nome { text-decoration: line-through; color: #64748b; }
.oi-details { font-size: 12px; color: #94a3b8; }

.oi-stato-badge { flex-shrink: 0; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 20px; letter-spacing: 0.3px; white-space: nowrap; }
.badge-ordinato-sm { background: #dcfce7; color: #15803d; }
.badge-attesa-sm   { background: #f1f5f9; color: #64748b; }
.badge-ordinato-sm i { margin-right: 3px; }
/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ fine ordini acquisti â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* â”€â”€â”€ GRUPPI RICHIESTE â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.req-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 8px;
}
.req-group {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}
.req-group[open] { box-shadow: 0 4px 16px rgba(0,0,0,0.07); }
.req-group-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    background: #f8fafc;
    border-bottom: 1px solid transparent;
    transition: background 0.15s;
    list-style: none;
}
.req-group-summary::-webkit-details-marker { display: none; }
.req-group[open] .req-group-summary { border-bottom-color: #e2e8f0; background: #f1f5f9; }
.req-group-summary:hover { background: #eff3f7; }
.rg-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.rg-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
}
.rg-icon-assegna { background: #dcfce7; color: #16a34a; }
.rg-icon-domanda  { background: #fee2e2; color: #dc2626; }
.rg-icon-scadenza { background: #fef3c7; color: #d97706; }
.rg-icon-fabbisogno { background: #dbeafe; color: #1d4ed8; }
.rg-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: #374151;
    text-transform: uppercase;
}
.rg-count, .rg-count-dom {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    background: #dcfce7;
    color: #15803d;
}
.rg-count-dom   { background: #fee2e2; color: #b91c1c; }
.rg-count-scad  { background: #fef3c7; color: #b45309; }
.rg-count-fabb  { background: #dbeafe; color: #1d4ed8; }
.rg-chevron {
    font-size: 11px;
    color: #94a3b8;
    transition: transform 0.25s ease;
}
.req-group[open] .rg-chevron { transform: rotate(180deg); }
.req-group .chat-inbox {
    padding: 12px 14px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}
.fabprod-list {
    padding: 8px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fabprod-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #dbe7f5;
    border-radius: 10px;
    padding: 8px 11px;
    box-shadow: 0 2px 8px rgba(29,78,216,0.05);
}
.fabprod-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}
.fabprod-name {
    color: #1e293b;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.25;
}
.fabprod-code {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    margin-right: 6px;
}
.fabprod-qty {
    flex-shrink: 0;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
}
.fabprod-orders {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.fabprod-order-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 6px;
    border-radius: 999px;
    background: #eff6ff;
    color: #475569;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.fabprod-order-pill--click {
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.fabprod-order-pill--click:hover {
    background: #dbeafe;
    color: #1d4ed8;
}
.fabprod-pill-cliente {
    font-weight: 500;
    opacity: 0.72;
}

/* Mobile: card compatta (solo codice + qty), tocco apre modal */
@media (max-width: 768px) {
    .fabprod-orders { display: none; }
    .fabprod-card { cursor: pointer; }
}

/* â”€â”€â”€ FABBISOGNO MODALS â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.fabprod-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.fabprod-modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 22px 20px 18px;
    max-width: 340px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.22);
    position: relative;
}
.fabprod-modal-box--art { max-width: 400px; }
.fabprod-modal-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.fabprod-modal-body {
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 20px;
    line-height: 1.4;
}
.fabprod-modal-sub {
    display: block;
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 5px;
    font-weight: 400;
}
.fabprod-modal-btns {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.fabprod-btn-cancel {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
}
.fabprod-btn-confirm {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    background: #1d4ed8;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.fabprod-btn-confirm:active { opacity: 0.85; }
.fabprod-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    font-size: 0.75rem;
}
.fabprod-modal-art-code {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 3px;
    letter-spacing: 0.03em;
}
.fabprod-modal-art-name {
    font-size: 1rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 10px;
    line-height: 1.3;
}
.fabprod-modal-art-qty {
    font-size: 0.82rem;
    color: #1d4ed8;
    font-weight: 700;
    background: #dbeafe;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 14px;
}
.fabprod-modal-art-orders {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* â”€â”€â”€ CARD QUADRATE RICHIESTE â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.req-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 13px 14px 11px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: calc(50% - 5px);
    min-width: 150px;
    box-sizing: border-box;
    transition: box-shadow 0.18s, border-color 0.18s;
}
.req-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.09); border-color: #c7d2fe; }
.req-card.archiviata { opacity: 0.75; border-color: #f1f5f9; }

@keyframes sollecito-pulse-rc {
    0%   { border-color: #e2e8f0; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
    50%  { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }
    100% { border-color: #e2e8f0; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
}
.req-card.sollecitata { animation: sollecito-pulse-rc 2s ease-in-out infinite; border-color: #fca5a5; }

/* Top: ordine + badge */
.rc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.rc-ordine-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
}
.rc-ordine {
    font-size: 13px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.rc-tipo {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 900;
    flex-shrink: 0;
}
.rc-tipo-assegna  { background: #dcfce7; color: #16a34a; }
.rc-tipo-segnalazione { background: #ffedd5; color: #ea580c; }
.rc-tipo-scadenza { background: #fef3c7; color: #d97706; }

/* ---- SCADENZE CARD ---- */
.scad-card {
    background: #ffffff;
    border: 1.5px solid #fde68a;
    border-radius: 16px;
    padding: 13px 14px 11px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: calc(50% - 5px);
    min-width: 150px;
    box-sizing: border-box;
    transition: box-shadow 0.18s, border-color 0.18s;
}
.scad-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.09); }
.scad-card.scad-urgente { border-color: #fca5a5; background: #fff5f5; }
.scad-card.scad-scaduta { border-color: #ef4444; background: #fff1f2; opacity: 0.85; }
.scad-card.scad-vicina  { border-color: #fdba74; background: #fffbeb; }
.scad-card.scad-ok      { border-color: #fde68a; }

.scad-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.scad-ordine-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.scad-art {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}
.scad-int-ord { opacity: 0.5; font-style: italic; }
.scad-date-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.scad-date-badge.scad-ok       { background: #fef9c3; color: #92400e; }
.scad-date-badge.scad-vicina   { background: #fed7aa; color: #9a3412; }
.scad-date-badge.scad-urgente  { background: #fecaca; color: #991b1b; }
.scad-date-badge.scad-scaduta  { background: #fca5a5; color: #7f1d1d; }
.scad-nota {
    font-size: 12px;
    color: #475569;
    line-height: 1.45;
    word-break: break-word;
}
.scad-no-nota { opacity: 0.4; font-style: italic; }
/* ---- FINE SCADENZE CARD ---- */
.rc-tipo-domanda  { background: #fee2e2; color: #dc2626; }
.rc-arch-badge {
    font-size: 10px;
    font-weight: 800;
    color: #16a34a;
    background: #dcfce7;
    padding: 1px 7px;
    border-radius: 20px;
}
.badge-sollecito-sm {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 20px;
    background: #fee2e2;
    color: #dc2626;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

/* Cliente */
.rc-cliente {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.rc-no-val { color: #94a3b8; }

/* Info rows: Da / A */
.rc-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.rc-info-row {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-size: 12px;
    min-width: 0;
}
.rc-lbl {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.4px;
    flex-shrink: 0;
    width: 16px;
}
.rc-vals-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 4px;
    min-width: 0;
    align-items: center;
}
.rc-val {
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.rc-val-a { color: #4f46e5; }

/* Footer: data + conteggio msg */
.rc-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
}
.rc-date {
    font-size: 10px;
    color: #94a3b8;
}
.rc-msgcount {
    font-size: 10px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Pulsanti azione icona */
.rc-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 4px;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
}
.rc-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.rc-btn-reply  { background: #eff6ff; color: #3b82f6; }
.rc-btn-reply:hover  { background: #dbeafe; color: #1d4ed8; }
.rc-btn-cal    { background: #fff7ed; color: #f59e0b; }
.rc-btn-cal:hover    { background: #fef3c7; color: #d97706; }
.rc-btn-sol    { background: #fef3c7; color: #d97706; }
.rc-btn-sol:hover    { background: #fde68a; color: #b45309; }
.rc-btn-arch   { background: #f0fdf4; color: #16a34a; }
.rc-btn-arch:hover   { background: #dcfce7; color: #15803d; }

/* Su schermi grandi: 3 card per riga */
@media (min-width: 768px) {
    .req-card { width: calc(33.333% - 7px); }
}
@media (min-width: 1200px) {
    .req-card { width: calc(25% - 8px); }
}

/* â”€â”€â”€ Reply / conferma DENTRO req-card (layout compatto) â”€â”€â”€â”€ */
/* Il box risposta non ha padding desktop pesante dentro la card stretta */
.req-card .box-risposta {
    padding: 10px 8px 12px;
    border-radius: 12px;
    border-top: 1.5px solid #e2e8f0;
    background: #f8fafc;
}
/* Footer risposta: stack verticale cosÃ¬ hint e pulsante non traboccano */
.req-card .reply-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.req-card .btn-reply-send {
    justify-content: center;
    width: 100%;
}
/* Textarea piÃ¹ compatta */
.req-card .reply-input {
    min-height: 64px;
    font-size: 13px;
    padding: 8px 10px;
}
/* Bubble dentro card: evita overflow laterale */
.req-card .chat-bubble {
    max-width: 100%;
    word-break: break-word;
}
.req-card .chat-bubble-text {
    word-break: break-word;
    overflow-wrap: anywhere;
}
/* Su telefoni molto stretti: singola colonna */
@media (max-width: 400px) {
    .req-card { width: 100%; }
}
/* Expand button */
.rc-expand-btn {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 5px 0;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background 0.15s, color 0.15s;
}
.rc-expand-btn:hover { background: #eff6ff; color: #3b82f6; border-color: #bfdbfe; }
.rc-expand-btn .fa-chevron-down { transition: transform 0.22s; font-size: 10px; }
.rc-expand-btn.open { background: #eff6ff; color: #3b82f6; border-color: #bfdbfe; }
.rc-expand-btn.open .fa-chevron-down { transform: rotate(180deg); }

/* Body messaggi nascosto */
.rc-body {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0 4px;
    border-top: 1px solid #f1f5f9;
    margin-top: 2px;
    animation: rc-body-in 0.18s ease;
}
.rc-body.open { display: flex; }
@keyframes rc-body-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* â”€â”€â”€ fine card richieste â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* â”€â”€â”€ fine gruppi â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.chat-card.archiviata { opacity: 0.8; }
.chat-card.archiviata.sollecitata { animation: none !important; border-color: #f1f5f9 !important; }
.chat-card.archiviata .badge-sollecito { display: none !important; }

/* --- SOLLECITO: lampeggio card + badge --- */
@keyframes sollecito-pulse {
    0%   { box-shadow: 0 4px 12px rgba(0,0,0,0.05); border-color: #f1f5f9; }
    50%  { box-shadow: 0 0 0 4px rgba(239,68,68,0.18), 0 4px 20px rgba(239,68,68,0.15); border-color: #ef4444; }
    100% { box-shadow: 0 4px 12px rgba(0,0,0,0.05); border-color: #f1f5f9; }
}
.chat-card.sollecitata {
    animation: sollecito-pulse 2s ease-in-out infinite;
    border-color: #fca5a5;
}
.badge-sollecito {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 800;
    color: #dc2626;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-left: 6px;
    vertical-align: middle;
}
/* --- fine sollecito --- */

.chat-header { background: transparent; padding: 10px 14px; }
.chat-header.archiviata { background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.chat-badge-type { font-size: 10px; font-weight: 800; color: #475569; text-transform: uppercase; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; }
/* Dot icona tipo (sostituisce badge testuale) */
.chat-tipo-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 900;
    vertical-align: middle;
    flex-shrink: 0;
}
.chat-tipo-assegna { background: #dcfce7; color: #16a34a; }
.chat-tipo-domanda { background: #fee2e2; color: #dc2626; }
/* Pulsanti solo icona nelle chat-actions */
.btn-icon-only {
    width: 34px;
    height: 34px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
}
.chat-order-label { font-size: 13px; font-weight: 800; margin-left: 8px; }
.chat-date { font-size: 11px; color: #94a3b8; }
.chat-body { padding: 10px 14px; background: #fcfcfc; display: flex; flex-direction: column; gap: 8px; }
.box-hidden { display: none; opacity: 0; transform: translateY(-10px); transition: all 0.3s ease; }
.box-conferma { background: #fff7ed; border-top: 1px solid #ffedd5; text-align: center; }
.box-risposta {
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    padding: 16px 20px 18px;
    border-radius: 0 0 16px 16px;
}
.reply-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.reply-input {
    width: 100%;
    border-radius: 12px;
    border: 1.5px solid #cbd5e1;
    padding: 12px 16px;
    font-size: 14px;
    min-height: 80px;
    max-height: 200px;
    resize: vertical;
    outline: none;
    font-family: inherit;
    background: #fff;
    color: #1e293b;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}
.reply-input:focus {
    border-color: #242424;
    box-shadow: 0 0 0 3px rgba(36,36,36,0.10);
}
.reply-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.reply-hint {
    font-size: 12px;
    color: #94a3b8;
}
.reply-hint b { color: #475569; font-weight: 700; }
.btn-reply-send {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    background: #242424;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}
.btn-reply-send:hover {
    background: #ffffff;
    color: #242424;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.btn-reply-send:active {
    transform: scale(0.97);
}
.box-message { font-size: 13px; font-weight: 700; color: #9a3412; margin-bottom: 10px; }
.box-actions { display: flex; gap: 10px; justify-content: center; }
.button-small { padding: 6px 15px; border-radius: 8px; font-size: 11px; font-weight: 700; cursor: pointer; }
.btn-cancel { background: #242424!important; color: #ffffff !important; border: none !important; transition: background 0.2s, color 0.2s !important; }
.btn-cancel:hover { background: #ffffff !important; color: #242424!important; box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important; }
.btn-archive-action { background: #242424; color: #ffffff; border: none; transition: background 0.2s, color 0.2s; }
.btn-archive-action:hover { background: #ffffff; color: #242424; box-shadow: 0 2px 10px rgba(0,0,0,0.15); }
.btn-reply { background: #242424!important; color: #ffffff !important; border: none !important; transition: background 0.2s, color 0.2s !important; }
.btn-reply:hover { background: #ffffff !important; color: #242424!important; box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important; }
.btn-alert { background: #242424!important; color: #ffffff !important; border: none !important; transition: background 0.2s, color 0.2s !important; }
.btn-alert:hover { background: #ffffff !important; color: #242424!important; box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important; }
.btn-archive { background: #242424!important; color: #ffffff !important; border: none !important; transition: background 0.2s, color 0.2s !important; }
.btn-archive:hover { background: #ffffff !important; color: #242424!important; box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important; }
.chat-to { font-size: 10px; color: #94a3b8; margin-left: auto; }
.chat-archiviata-note { padding: 10px 20px; border-top: 1px solid #f1f5f9; background: #f8fafc; text-align: right; }
.chat-archiviata-label { font-size: 11px; color: #242424; font-weight: 700; }


.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0;
}

.info-ordine b {
    color: #1e293b;
    font-size: 15px;
    margin-left: 5px;
}

.badge-tipo-chat {
    background: #f1f5f9;
    color: #475569;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    font-weight: 800;
    font-size: 10px;
    letter-spacing: 0.5px;
}

.chat-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f0f2f5; /* Grigio chiaro tipo sfondo WhatsApp */
    padding: 20px;
    border-radius: 12px;
}

/* --- BOLLE MESSAGGIO --- */
.chat-bubble-wrapper {
    display: flex;
    width: 100%;
}

/* Ricevuto (Operatore) - Allineato a SINISTRA */
.chat-bubble-wrapper.received {
    justify-content: flex-start;
}

.chat-bubble-wrapper.received .chat-bubble {
    background: white;
    color: #333;
    border-radius: 0px 15px 15px 15px; /* Angolo tagliato in alto a sx */
    border: 1px solid #e2e8f0;
}

/* Inviato (Master/Ufficio) - Allineato a DESTRA */
.chat-bubble-wrapper.sent {
    justify-content: flex-end;
}

.chat-bubble-wrapper.sent .chat-bubble {
    background: #242424;
    color: white;
    border-radius: 15px 15px 0px 15px; /* Angolo tagliato in basso a dx */
}

.chat-bubble {
    max-width: 75%;
    padding: 10px 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Nome Autore dentro la bolla */
.chat-bubble-name {
    font-size: 10px;
    font-weight: 800;
    margin-bottom: 3px;
    text-transform: uppercase;
    display: block;
}

.chat-bubble-text {
    font-size: 14px;
    line-height: 1.4;
}

.received .chat-bubble-name { color: #242424; text-align: left; }
.sent .chat-bubble-name { color: #9ca3af; text-align: right; }

.chat-bubble-time {
    font-size: 10px;
    opacity: 0.55;
    margin-top: 5px;
    display: block;
    text-align: right;
    letter-spacing: 0.02em;
}
.received .chat-bubble-time { color: #64748b; }
.sent .chat-bubble-time { color: #cbd5e1; }













/* ============================================================
   11. AZIONI CHAT E NOTIFICHE
   ============================================================ */

.chat-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}
.chat-to-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.chat-to-dest {
    font-size: 11px;
    color: #475569;
    font-weight: 600;
}
.chat-to-ord {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.chat-action-btns {
    display: flex;
    gap: 6px;
    align-items: center;
}
.chat-cliente-label {
    font-size: 11px;
    color: #64748b;
    font-style: italic;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.btn-chat-action {
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-chat-action.reply { background: #242424; color: #ffffff; }
.btn-chat-action.reply:hover { background: #ffffff; color: #242424; box-shadow: 0 2px 10px rgba(0,0,0,0.15); }
.btn-chat-action.alert { background: #242424; color: #ffffff; }
.btn-chat-action.alert:hover { background: #ffffff; color: #242424; box-shadow: 0 2px 10px rgba(0,0,0,0.15); }
.btn-chat-action.done { background: #242424; color: #ffffff; }
.btn-chat-action.done:hover { background: #ffffff; color: #242424; box-shadow: 0 2px 10px rgba(0,0,0,0.15); }

.reply-input-wrapper {
    display: flex;
    background: #ffffff;
    padding: 8px;
    border-radius: 25px;
    border: 1px solid #e2e8f0;
    margin-top: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.reply-input-wrapper input {
    flex: 1;
    background: none;
    border: none;
    padding: 5px 15px;
    outline: none;
    font-size: 14px;
}

.reply-input-wrapper button {
    background: #242424;
    color: white;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.reply-input-wrapper button:hover {
    transform: scale(1.05);
    background: #3f3f3f;
}

.notification-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
    padding: 10px;
}

.notification-bell {
    font-size: 24px;
    color: #64748b;
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #ef4444; /* Rosso notifica */
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid white;
    display: none; /* Nascosto se 0 */
}















/* --- ANIMAZIONI --- */

/* Animazione per il sollecito */
.shake {
    animation: shake 0.5s;
    animation-iteration-count: infinite;
}

@keyframes shake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

@keyframes pulse-new {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(36, 36, 36, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(36, 36, 36, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(36, 36, 36, 0); }
}

.badge-new-anim {
    animation: pulse-new 2s infinite;
    background: #242424 !important;
}

.loader-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #242424;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



















/* ============================================================
   12. IMPOSTAZIONI PREMIUM OPTIMIZED
   ============================================================ */

/* ============================================================
   IMPOSTAZIONI: Accordion
   ============================================================ */
.settings-accordion {
    background: white;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    max-width: 680px;
    margin: 0 auto;
}
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
    user-select: none;
}
.settings-row:last-of-type { border-bottom: none; }
.settings-row:hover { background: #f8fafc; }
.settings-row.open { background: #f0f9ff; }
.settings-row.open .settings-row-arrow { transform: rotate(180deg); }
.settings-row-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.settings-row-icon {
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #242424;
    font-size: 16px;
    flex-shrink: 0;
}
.settings-row.open .settings-row-icon { background: #e2e8f0; color: #242424; }
.settings-row-title { font-weight: 700; font-size: 15px; color: #1e293b; }
.settings-row-sub { font-size: 12px; color: #94a3b8; margin-top: 1px; }
.settings-row-arrow { color: #94a3b8; font-size: 13px; transition: transform 0.2s; flex-shrink: 0; }

.settings-section-body { border-bottom: 1px solid #f1f5f9; }
.settings-section-body .card-settings {
    border-radius: 0;
    border: none;
    box-shadow: none;
    border-top: 1px solid #e2e8f0;
    background: #fafbfc;
}

.settings-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.card-settings {
    background: white;
    flex: 1;
    min-width: 320px;
    max-width: 100%;
    padding: 24px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
    box-sizing: border-box;
}

.card-settings h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-row-modern {
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid #f1f5f9;
    box-sizing: border-box;
    width: 100%;
}

.input-flat {
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 11px;
    color: #334155;
    outline: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex: 1;
    min-width: 0;
    font-family: inherit;
}

.input-field-modern {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: #475569;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.input-field-modern:focus {
    border-color: var(--primary);
    outline: none;
}

.status-dot-custom {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.9);
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    cursor: pointer;
    background: var(--bg-color, #e2e8f0);
    flex-shrink: 0;
    box-sizing: content-box;
}

/* additional classes for script refactor */
.archivio-wrapper { border-color: #cbd5e1; margin-bottom: 15px; }
.archivio-header { background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.order-info-col { text-align: right; display: flex; flex-direction: column; justify-content: center; gap: 5px; }

.iop-code-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.iop-code-main {
    color: #0f172a;
    font-weight: 700;
}

.iop-code-desc {
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}
.btn-archive-action.primary { background:#242424!important; color:#ffffff !important; border:none !important; }
.btn-archive-action.primary:hover { background:#ffffff !important; color:#242424!important; box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important; }
.btn-archive-action.warning { background:#242424!important; color:#ffffff !important; border:none !important; }
.btn-archive-action.warning:hover { background:#ffffff !important; color:#242424!important; box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important; }
.color-picker-wrapper { position: relative; width: 16px; height: 16px; }
.color-overlay { position: absolute; opacity:0; width:100%; height:100%; cursor:pointer; z-index:2; }

.status-select { border-left: 5px solid var(--border-color); }
.config-row-modern.row {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 7px 12px 7px 10px;
    margin-bottom: 8px;
}
.settings-actions-row { display: flex; align-items: center; justify-content: space-between; }
.settings-options-row { display: flex; align-items: center; gap: 10px; }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; }
.gap-8 { gap: 8px; }
.centered-fullwidth { width:100%; text-align:center; }
.my-30 { margin: 30px 0; }
.acquisti-header.header-flex { margin-bottom:20px; display:flex; justify-content:space-between; align-items:center; padding:0 10px; }
.acquisti-actions-wrapper { display: flex; align-items: center; gap: 8px; }
.acquisti-title { margin:0; font-size:22px; font-weight:800; color:#242424; letter-spacing:-0.02em; }
.acquisti-subtitle { color:#94a3b8; font-size:13px; margin:4px 0 0; }

/* nuovo: acquisition page utilities */
.hidden { display: none; }
.acquisti-actions-row { display:flex; gap:10px; align-items:center; }
.materiali-grid { display:grid; gap:18px; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); }

/* ============================================================
   IMPOSTAZIONI — page scoped redesign
   ============================================================ */
.settings-page-shell {
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 4px 0 28px;
    box-sizing: border-box;
}

.settings-page-shell .settings-page-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.settings-page-shell .settings-page-hero {
    display: flex;
    gap: 14px;
    align-items: stretch;
    width: 100%;
    flex-wrap: wrap;
}

.settings-page-shell .settings-page-title-group {
    flex: 1 1 300px;
    min-width: 260px;
    padding: 22px 24px;
    border-radius: 24px;
    background: linear-gradient(135deg, #111111 0%, #1f2937 100%);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.settings-page-shell .settings-page-kicker {
    display: block;
    margin-bottom: 6px;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.settings-page-shell .settings-page-title {
    margin: 0;
    color: #ffffff;
    font-size: 1.7rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.settings-page-shell .settings-page-subtitle {
    margin: 10px 0 0;
    max-width: 54ch;
    color: #d4d4d8;
    font-size: 0.95rem;
    line-height: 1.5;
}

.settings-page-shell .settings-page-stats {
    flex: 1 1 540px;
    min-width: 320px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.settings-category-block {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border-radius: 28px;
    border: 1px solid rgba(15,23,42,0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.96) 100%);
    box-shadow: 0 18px 40px rgba(15,23,42,0.06);
}

.settings-category-block.is-workspace {
    border-color: rgba(59,130,246,0.14);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.settings-category-block.is-team {
    border-color: rgba(15,118,110,0.12);
    background: linear-gradient(180deg, #ffffff 0%, #f8fcfb 100%);
}

.settings-category-block.is-operations {
    border-color: rgba(217,119,6,0.12);
    background: linear-gradient(180deg, #ffffff 0%, #fffaf3 100%);
}

.settings-category-block.is-personal {
    border-color: rgba(99,102,241,0.12);
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
}

.settings-category-block.is-support {
    border-color: rgba(100,116,139,0.16);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.settings-category-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.settings-category-copy {
    min-width: 0;
}

.settings-category-kicker {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-category-title {
    margin: 0;
    color: #0f172a;
    font-size: 1.18rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.settings-category-description {
    margin: 8px 0 0;
    max-width: 68ch;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.55;
}

.settings-category-meta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.26);
    background: rgba(255,255,255,0.8);
    color: #334155;
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.settings-category-grid .settings-section-slot {
    background: rgba(255,255,255,0.92);
}

.settings-page-shell .settings-stat-chip {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "icon value"
        "icon label"
        "icon meta";
    gap: 2px 10px;
    align-content: center;
    min-width: 0;
    padding: 13px 14px;
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #f6f7fb 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), 0 10px 22px rgba(15,23,42,0.08);
}

.settings-page-shell .settings-stat-chip i {
    grid-area: icon;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #111111;
    color: #ffffff;
    font-size: 0.8rem;
}

.settings-page-shell .settings-stat-chip.is-highlight {
    background: #111111;
    border-color: #111111;
    box-shadow: 0 16px 30px rgba(17,17,17,0.18);
}

.settings-page-shell .settings-stat-chip.is-highlight i {
    background: rgba(255,255,255,0.1);
}

.settings-page-shell .settings-stat-chip.is-highlight .settings-stat-value,
.settings-page-shell .settings-stat-chip.is-highlight .settings-stat-label,
.settings-page-shell .settings-stat-chip.is-highlight .settings-stat-meta {
    color: #ffffff;
}

.settings-page-shell .settings-stat-value {
    grid-area: value;
    color: #0f172a;
    font-size: 1.08rem;
    font-weight: 900;
    line-height: 1;
}

.settings-page-shell .settings-stat-label {
    grid-area: label;
    color: #1f2937;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.2;
}

.settings-page-shell .settings-stat-meta {
    grid-area: meta;
    color: #64748b;
    font-size: 0.72rem;
    line-height: 1.35;
}

.settings-page-shell .settings-accordion {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    max-width: none;
    margin: 0;
    overflow: visible;
}

.settings-page-shell .settings-page-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
}

.settings-page-shell .settings-section-slot {
    grid-column: span 6;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 12px 26px rgba(15,23,42,0.07);
}

.settings-page-shell .settings-section-slot-wide {
    grid-column: 1 / -1;
}

.settings-page-shell .settings-section-slot-danger {
    border-color: #fecaca;
    box-shadow: 0 12px 26px rgba(220,38,38,0.08);
}

.settings-page-shell .settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border: none;
    background: #ffffff;
    transition: background .18s ease, box-shadow .18s ease;
}

.settings-page-shell .settings-row:hover {
    background: #fafcff;
}

.settings-page-shell .settings-row-active {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.settings-page-shell .settings-row-danger {
    background: linear-gradient(180deg, #fff8f8 0%, #ffffff 100%);
}

.settings-page-shell .settings-row-left {
    min-width: 0;
    gap: 14px;
}

.settings-page-shell .settings-row-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
}

.settings-page-shell .settings-row-danger .settings-row-icon {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #dc2626;
}

.settings-page-shell .settings-row-copy {
    min-width: 0;
}

.settings-page-shell .settings-row-overline {
    margin-bottom: 3px;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-page-shell .settings-row-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}

.settings-page-shell .settings-row-sub {
    margin-top: 4px;
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.4;
}

.settings-page-shell .settings-row-side {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.settings-page-shell .settings-row-pill {
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid #dbe4f0;
    background: #f8fafc;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.settings-page-shell .settings-row-arrow {
    color: #94a3b8;
    font-size: 0.82rem;
}

.settings-page-shell .settings-row-active .settings-row-arrow:not(.settings-row-arrow-static) {
    transform: rotate(180deg);
}

.settings-page-shell .settings-row-arrow-static {
    transform: none !important;
}

.settings-page-shell .settings-section-body {
    border-top: 1px solid #eef2f7;
    border-bottom: none;
    background: linear-gradient(180deg, #fcfdff 0%, #f8fafc 100%);
}

.settings-page-shell .settings-row-active + .settings-section-body {
    border-top-color: #dbeafe;
}

.settings-page-shell .settings-section-body .card-settings {
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding: 20px;
}

.settings-page-shell .settings-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
}

.settings-page-shell .settings-panel-aside {
    display: flex;
    align-items: flex-start;
}

.settings-page-shell .settings-panel-copy h3 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    color: #0f172a;
}

.settings-page-shell .settings-panel-copy p {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.55;
    max-width: 60ch;
}

.settings-page-shell .settings-panel-kicker {
    display: block;
    margin-bottom: 5px;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-page-shell .settings-panel-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.settings-page-shell .settings-list-stack,
.settings-page-shell .settings-users-list,
.settings-page-shell .settings-qr-list,
.settings-page-shell .settings-module-list,
.settings-page-shell .settings-form-stack {
    display: grid;
    gap: 10px;
}

.settings-page-shell .config-row-modern {
    background: rgba(255,255,255,0.9);
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.settings-page-shell .config-row-modern.row {
    padding: 10px 12px 10px 11px;
    margin-bottom: 0;
    border-radius: 18px;
}

.settings-page-shell .input-flat {
    font-size: 0.8rem;
    color: #0f172a;
    letter-spacing: 0.03em;
}

.settings-page-shell .input-field-modern {
    min-height: 42px;
    border-radius: 14px;
    border-color: #d9e2ec;
    color: #0f172a;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

.settings-page-shell .input-field-modern:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.12);
}

.settings-page-shell .settings-inline-check {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid #dbe4f0;
    background: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.settings-page-shell .settings-inline-check i {
    color: #64748b;
}

.settings-page-shell .settings-panel-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.settings-page-shell .settings-panel-footer-right {
    justify-content: flex-end;
}

.settings-page-shell .settings-panel-footer-stack {
    align-items: stretch;
}

.settings-page-shell .settings-add-btn,
.settings-page-shell .btn-add-dashed {
    width: auto;
    border-radius: 14px;
    padding: 11px 16px;
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

.settings-page-shell .btn-add-dashed:hover {
    background: #f8fafc;
}

.settings-page-shell .settings-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.settings-page-shell .settings-toolbar-input {
    flex: 1 1 220px;
    min-width: 220px;
}

.settings-page-shell .settings-toolbar-actions {
    margin-top: 12px;
    margin-bottom: 0;
}

.settings-page-shell .settings-secondary-btn,
.settings-page-shell .settings-warning-btn,
.settings-page-shell .settings-danger-btn,
.settings-page-shell .settings-ghost-btn,
.settings-page-shell .settings-icon-btn {
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 13px;
    border: 1px solid #dbe4f0;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.settings-page-shell .settings-secondary-btn:hover,
.settings-page-shell .settings-warning-btn:hover,
.settings-page-shell .settings-danger-btn:hover,
.settings-page-shell .settings-ghost-btn:hover,
.settings-page-shell .settings-icon-btn:hover {
    background: #f8fafc;
    box-shadow: 0 6px 14px rgba(15,23,42,0.08);
}

.settings-page-shell .settings-secondary-btn-strong {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.settings-page-shell .settings-warning-btn {
    background: #fffbea;
    border-color: #fde68a;
    color: #92400e;
}

.settings-page-shell .settings-danger-btn {
    background: #fff5f5;
    border-color: #fecaca;
    color: #b91c1c;
}

.settings-page-shell .settings-ghost-btn {
    background: #f8fafc;
    color: #334155;
}

.settings-page-shell .settings-ghost-btn-full {
    width: 100%;
    justify-content: center;
}

.settings-page-shell .settings-icon-btn {
    width: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.settings-page-shell .settings-upload-shell {
    display: grid;
    gap: 10px;
}

.settings-page-shell .settings-upload-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1.5px dashed #94a3b8;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    cursor: pointer;
}

.settings-page-shell .settings-upload-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
    flex-shrink: 0;
}

.settings-page-shell .settings-upload-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.settings-page-shell .settings-upload-copy strong {
    color: #0f172a;
    font-size: 0.9rem;
}

.settings-page-shell .settings-upload-copy small,
.settings-page-shell .settings-upload-filename,
.settings-page-shell .settings-inline-hint,
.settings-page-shell .settings-subpanel-note,
.settings-page-shell .settings-empty-state {
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.5;
}

.settings-page-shell .settings-upload-result {
    display: block;
}

.settings-page-shell .settings-subpanel {
    margin-top: 16px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    background: rgba(255,255,255,0.85);
}

.settings-page-shell .settings-subpanel-title {
    margin-bottom: 6px;
    color: #0f172a;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-page-shell .settings-status-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.settings-page-shell .settings-status-dot,
.settings-page-shell .settings-device-card-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.settings-page-shell .settings-status-text {
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
}

.settings-page-shell .settings-action-btn {
    width: 100%;
    min-height: 50px;
    justify-content: center;
    border: 1px solid #111111;
    border-radius: 16px;
    background: #111111;
    color: #ffffff;
    font-size: 0.94rem;
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(17,17,17,0.14);
}

.settings-page-shell .settings-action-btn:hover {
    background: #1f2937;
    border-color: #1f2937;
}

.settings-page-shell .notif-pref-row {
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #edf2f7;
    color: #1e293b;
}

.settings-page-shell .notif-pref-row input[type="checkbox"] {
    margin-top: 2px;
}

.settings-page-shell .settings-notif-group {
    padding: 14px 14px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
}

.settings-page-shell .settings-notif-group-title {
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 800;
}

.settings-page-shell .settings-notif-group-desc,
.settings-page-shell .settings-notif-event-hint {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 0.75rem;
    line-height: 1.45;
}

.settings-page-shell .settings-field-block {
    display: grid;
    gap: 6px;
}

.settings-page-shell .settings-field-label {
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
}

.settings-page-shell .settings-time-grid,
.settings-page-shell .settings-inline-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.settings-page-shell .settings-inline-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.settings-page-shell .settings-divider {
    height: 1px;
    margin: 16px 0;
    background: linear-gradient(90deg, transparent 0%, #e2e8f0 14%, #e2e8f0 86%, transparent 100%);
}

.settings-page-shell .settings-device-card {
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

.settings-page-shell .settings-device-card.is-current {
    background: #f8fafc;
}

.settings-page-shell .settings-device-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.settings-page-shell .settings-device-card-title {
    color: #0f172a;
    font-size: 0.84rem;
    font-weight: 800;
}

.settings-page-shell .settings-device-card-sub,
.settings-page-shell .settings-device-card-meta {
    color: #64748b;
    font-size: 0.74rem;
    line-height: 1.45;
}

.settings-page-shell .settings-device-card-meta {
    margin-top: 6px;
}

.settings-page-shell .settings-user-row {
    gap: 10px;
}

.settings-page-shell .settings-user-row-muted {
    opacity: 0.8;
}

.settings-page-shell .settings-user-head,
.settings-page-shell .settings-user-ident,
.settings-page-shell .settings-user-actions,
.settings-page-shell .settings-user-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-page-shell .settings-user-head {
    justify-content: space-between;
}

.settings-page-shell .settings-user-ident {
    min-width: 0;
    flex: 1;
}

.settings-page-shell .settings-user-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.settings-page-shell .settings-user-name,
.settings-page-shell .settings-user-name-input {
    color: #0f172a;
    font-size: 0.86rem;
    font-weight: 800;
}

.settings-page-shell .settings-user-note {
    color: #64748b;
    font-size: 0.75rem;
}

.settings-page-shell .settings-user-role,
.settings-page-shell .settings-user-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 800;
}

.settings-page-shell .settings-user-role-virtual {
    background: #eef2f7;
    color: #475569;
}

.settings-page-shell .settings-user-grid,
.settings-page-shell .settings-user-field-single {
    margin-top: 10px;
}

.settings-page-shell .form-nuovo-utente,
.settings-page-shell .settings-form-panel {
    margin-top: 2px;
    padding: 16px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
}

.settings-page-shell .settings-session-summary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.settings-page-shell .settings-session-chip {
    padding: 7px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.74rem;
    font-weight: 700;
}

.settings-page-shell .settings-session-chip strong {
    font-weight: 900;
}

.settings-page-shell .settings-session-table {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
}

.settings-page-shell .settings-session-table-head,
.settings-page-shell .settings-session-table-row {
    display: grid;
    grid-template-columns: 1.2fr .6fr .8fr;
    gap: 10px;
    padding: 10px 12px;
    font-size: 0.78rem;
}

.settings-page-shell .settings-session-table-head {
    background: #f8fafc;
    color: #475569;
    font-weight: 800;
}

.settings-page-shell .settings-session-table-row {
    border-top: 1px solid #f1f5f9;
    color: #0f172a;
}

.settings-page-shell .settings-session-empty {
    padding: 12px;
    color: #64748b;
    font-size: 0.8rem;
}

.settings-page-shell .settings-module-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
}

.settings-page-shell .settings-module-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #111111;
}

.settings-page-shell .settings-module-row i {
    width: 16px;
    color: #64748b;
}

.settings-page-shell .settings-module-row span {
    color: #0f172a;
    font-size: 0.86rem;
    font-weight: 700;
}

.settings-page-shell .settings-form-grid,
.settings-page-shell .settings-mapping-grid,
.settings-page-shell .settings-diagnostic-grid {
    display: grid;
    gap: 10px 12px;
    align-items: center;
}

.settings-page-shell .settings-form-grid,
.settings-page-shell .settings-diagnostic-grid {
    grid-template-columns: 160px 1fr;
}

.settings-page-shell .settings-mapping-grid {
    grid-template-columns: 120px 1fr;
}

.settings-page-shell .settings-diagnostic-value {
    color: #0f172a;
    font-size: 0.82rem;
    line-height: 1.5;
}

.settings-page-shell .settings-alert-note {
    margin: 0;
    color: #7f1d1d;
    font-size: 0.84rem;
    line-height: 1.6;
    background: #fff7f7;
    border: 1px solid #fecaca;
    border-radius: 16px;
    padding: 14px 16px;
}

.settings-page-shell .settings-alert-note strong {
    display: inline-block;
    margin-top: 6px;
    color: #b91c1c;
}

.settings-page-shell .qr-post-row {
    padding: 12px 14px;
    margin-bottom: 0;
    border-radius: 18px;
    background: rgba(255,255,255,0.9);
}

.settings-page-shell .qr-post-canvas {
    width: 58px;
    height: 58px;
    border-radius: 12px;
}

.settings-page-shell .qr-post-footer-btns {
    margin-top: 16px;
}

.settings-page-shell .settings-save-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid #e2e8f0;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 12px 24px rgba(15,23,42,0.08);
}

.settings-page-shell .settings-save-kicker {
    display: block;
    margin-bottom: 5px;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-page-shell .settings-save-copy p {
    margin: 0;
    color: #475569;
    font-size: 0.84rem;
    line-height: 1.5;
}

.settings-page-shell .settings-save-btn {
    white-space: nowrap;
}

.settings-page-shell .settings-mobile-quickbar {
    display: none;
}

.settings-page-shell .settings-mobile-action {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #0f172a;
    text-align: left;
    box-shadow: 0 10px 22px rgba(15,23,42,0.08);
    cursor: pointer;
}

.settings-page-shell .settings-mobile-action i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #f8fafc;
    color: #111111;
    flex-shrink: 0;
}

.settings-page-shell .settings-mobile-action-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.settings-page-shell .settings-mobile-action-copy strong {
    color: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
}

.settings-page-shell .settings-mobile-action-copy small {
    color: #64748b;
    font-size: 0.71rem;
    line-height: 1.35;
}

.settings-page-shell .settings-mobile-action.is-primary {
    background: #111111;
    border-color: #111111;
    color: #ffffff;
    box-shadow: 0 14px 26px rgba(17,17,17,0.16);
}

.settings-page-shell .settings-mobile-action.is-primary i {
    background: rgba(255,255,255,0.12);
    color: #ffffff;
}

.settings-page-shell .settings-mobile-action.is-primary small {
    color: rgba(255,255,255,0.72);
}

@media (max-width: 1080px) {
    .settings-page-shell .settings-page-hero {
        flex-direction: column;
    }

    .settings-page-shell .settings-page-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
    }
}

@media (max-width: 920px) {
    .settings-page-shell .settings-page-grid {
        grid-template-columns: 1fr;
    }

    .settings-page-shell .settings-section-slot,
    .settings-page-shell .settings-section-slot-wide {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .settings-page-shell {
        gap: 12px;
        padding-bottom: 18px;
    }

    .settings-page-shell .settings-page-body {
        gap: 12px;
    }

    .settings-page-shell .settings-page-hero {
        display: block;
    }

    .settings-page-shell .settings-page-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: start;
    }

    .settings-category-block {
        gap: 12px;
        padding: 14px;
        border-radius: 22px;
    }

    .settings-category-head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .settings-category-title {
        font-size: 1.02rem;
    }

    .settings-category-description {
        font-size: 0.82rem;
        line-height: 1.45;
        max-width: none;
    }

    .settings-category-meta {
        align-self: flex-start;
    }

    .settings-page-shell .settings-page-title-group {
        min-width: 0;
        padding: 16px;
        border-radius: 18px;
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14);
    }

    .settings-page-shell .settings-page-kicker {
        margin-bottom: 4px;
        font-size: 0.64rem;
    }

    .settings-page-shell .settings-page-title {
        font-size: 1.32rem;
    }

    .settings-page-shell .settings-section-slot,
    .settings-page-shell .settings-section-slot-wide,
    .settings-page-shell .settings-section-slot.settings-section-slot-open,
    .settings-page-shell .settings-section-slot-secondary,
    .settings-page-shell .settings-section-slot-primary.settings-section-slot-wide:not(.settings-section-slot-open) {
        grid-column: 1 / -1;
    }

    .settings-page-shell .settings-section-slot > .settings-row,
    .settings-page-shell .settings-section-slot-secondary:not(.settings-section-slot-open) > .settings-row,
    .settings-page-shell .settings-section-slot-primary:not(.settings-section-slot-open) > .settings-row,
    .settings-page-shell .settings-section-slot.settings-section-slot-open > .settings-row {
        min-height: auto;
        aspect-ratio: auto;
        position: static;
    }

    .settings-page-shell .settings-section-slot .settings-row-left,
    .settings-page-shell .settings-section-slot.settings-section-slot-open .settings-row-left,
    .settings-page-shell .settings-section-slot-secondary:not(.settings-section-slot-open) .settings-row-left,
    .settings-page-shell .settings-section-slot-primary:not(.settings-section-slot-open) .settings-row-left {
        width: auto;
        min-width: 0;
    }

    .settings-page-shell .settings-section-slot .settings-row-copy,
    .settings-page-shell .settings-section-slot.settings-section-slot-open .settings-row-copy,
    .settings-page-shell .settings-section-slot-secondary:not(.settings-section-slot-open) .settings-row-copy,
    .settings-page-shell .settings-section-slot-primary:not(.settings-section-slot-open) .settings-row-copy {
        width: auto;
        min-width: 0;
    }

    .settings-page-shell .settings-section-slot .settings-row-icon,
    .settings-page-shell .settings-section-slot.settings-section-slot-open .settings-row-icon,
    .settings-page-shell .settings-section-slot-secondary:not(.settings-section-slot-open) .settings-row-icon,
    .settings-page-shell .settings-section-slot-primary:not(.settings-section-slot-open) .settings-row-icon {
        width: 36px;
        height: 36px;
        border-radius: 11px;
    }

    .settings-page-shell .settings-section-slot .settings-row-overline,
    .settings-page-shell .settings-section-slot.settings-section-slot-open .settings-row-overline,
    .settings-page-shell .settings-section-slot-secondary:not(.settings-section-slot-open) .settings-row-overline,
    .settings-page-shell .settings-section-slot-primary:not(.settings-section-slot-open) .settings-row-overline {
        display: block;
    }

    .settings-page-shell .settings-section-slot .settings-row-title,
    .settings-page-shell .settings-section-slot.settings-section-slot-open .settings-row-title,
    .settings-page-shell .settings-section-slot-secondary:not(.settings-section-slot-open) .settings-row-title,
    .settings-page-shell .settings-section-slot-primary:not(.settings-section-slot-open) .settings-row-title {
        font-size: 0.84rem;
        width: auto;
        line-height: 1.25;
        white-space: normal;
    }

    .settings-page-shell .settings-section-slot .settings-row-sub,
    .settings-page-shell .settings-section-slot.settings-section-slot-open .settings-row-sub,
    .settings-page-shell .settings-section-slot-secondary:not(.settings-section-slot-open) .settings-row-sub,
    .settings-page-shell .settings-section-slot-primary:not(.settings-section-slot-open) .settings-row-sub {
        margin-top: 3px;
        color: #64748b;
        font-size: 0.72rem;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
        overflow: hidden;
    }

    .settings-page-shell .settings-section-slot .settings-row-side,
    .settings-page-shell .settings-section-slot.settings-section-slot-open .settings-row-side,
    .settings-page-shell .settings-section-slot-secondary:not(.settings-section-slot-open) .settings-row-side,
    .settings-page-shell .settings-section-slot-primary:not(.settings-section-slot-open) .settings-row-side {
        width: auto;
        justify-content: flex-end;
        align-items: center;
        gap: 8px;
    }

    .settings-page-shell .settings-section-slot .settings-row-pill,
    .settings-page-shell .settings-section-slot.settings-section-slot-open .settings-row-pill,
    .settings-page-shell .settings-section-slot-secondary:not(.settings-section-slot-open) .settings-row-pill,
    .settings-page-shell .settings-section-slot-primary:not(.settings-section-slot-open) .settings-row-pill {
        display: block;
        overflow: visible;
        -webkit-line-clamp: initial;
        max-width: 14ch;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.66rem;
    }

    .settings-page-shell .settings-section-slot .settings-row-arrow,
    .settings-page-shell .settings-section-slot.settings-section-slot-open .settings-row-arrow,
    .settings-page-shell .settings-section-slot-secondary:not(.settings-section-slot-open) .settings-row-arrow,
    .settings-page-shell .settings-section-slot-primary:not(.settings-section-slot-open) .settings-row-arrow {
        position: static;
        transform: none !important;
    }

    .settings-page-shell .settings-section-slot.settings-section-slot-open > .settings-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 12px;
        padding: 15px 16px;
    }

    .settings-page-shell .settings-section-slot.settings-section-slot-open .settings-row-left {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 12px;
        align-items: start;
    }

    .settings-page-shell .settings-section-slot.settings-section-slot-open .settings-row-icon {
        width: 40px;
        height: 40px;
        border-radius: 13px;
    }

    .settings-page-shell .settings-section-slot.settings-section-slot-open .settings-row-overline {
        display: block;
    }

    .settings-page-shell .settings-section-slot.settings-section-slot-open .settings-row-title {
        font-size: 0.94rem;
        line-height: 1.28;
        white-space: normal;
    }

    .settings-page-shell .settings-section-slot.settings-section-slot-open .settings-row-sub {
        margin-top: 3px;
        font-size: 0.76rem;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }

    .settings-page-shell .settings-section-slot.settings-section-slot-open .settings-row-side {
        gap: 8px;
        align-items: flex-end;
    }

    .settings-page-shell .settings-section-slot.settings-section-slot-open .settings-row-pill {
        max-width: 18ch;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.67rem;
        padding: 6px 9px;
    }

    .settings-page-shell .settings-section-body .card-settings {
        padding: 16px;
    }

    .settings-page-shell .settings-panel-head {
        gap: 10px;
        margin-bottom: 14px;
    }

    .settings-page-shell .settings-panel-copy h3 {
        font-size: 0.94rem;
    }

    .settings-page-shell .settings-panel-copy p {
        margin-top: 6px;
        font-size: 0.78rem;
        line-height: 1.45;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }

    .settings-page-shell .settings-panel-kicker {
        font-size: 0.64rem;
    }

    .settings-page-shell .settings-panel-pill {
        padding: 7px 10px;
        font-size: 0.68rem;
    }

    .settings-page-shell .settings-toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .settings-page-shell .settings-toolbar > * {
        min-width: 0;
    }

    .settings-page-shell .settings-toolbar-input {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .settings-page-shell .settings-toolbar .settings-icon-btn {
        width: 100%;
    }

    .settings-page-shell .settings-secondary-btn,
    .settings-page-shell .settings-warning-btn,
    .settings-page-shell .settings-danger-btn,
    .settings-page-shell .settings-ghost-btn,
    .settings-page-shell .settings-icon-btn {
        min-height: 38px;
        padding: 10px 12px;
        font-size: 0.76rem;
        justify-content: center;
    }

    .settings-page-shell .settings-action-btn {
        min-height: 46px;
        font-size: 0.88rem;
    }

    .settings-page-shell .settings-subpanel,
    .settings-page-shell .settings-form-panel,
    .settings-page-shell .form-nuovo-utente {
        padding: 14px;
        border-radius: 16px;
    }

    .settings-page-shell .settings-device-card-head,
    .settings-page-shell .settings-user-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .settings-page-shell .settings-user-actions,
    .settings-page-shell .settings-user-meta-row {
        flex-wrap: wrap;
    }

    .settings-page-shell .settings-session-summary {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .settings-page-shell .settings-session-chip {
        text-align: center;
    }

    .settings-page-shell .settings-session-table {
        border: none;
        background: transparent;
    }

    .settings-page-shell .settings-session-table-head {
        display: none;
    }

    .settings-page-shell .settings-session-table-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px 14px;
        margin-bottom: 8px;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        background: #ffffff;
    }

    .settings-page-shell .settings-session-table-row > div {
        display: grid;
        gap: 2px;
    }

    .settings-page-shell .settings-session-table-row > div::before {
        color: #94a3b8;
        font-size: 0.64rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .settings-page-shell .settings-session-table-row > div:nth-child(1)::before {
        content: 'Utente';
    }

    .settings-page-shell .settings-session-table-row > div:nth-child(2)::before {
        content: 'Sessioni';
    }

    .settings-page-shell .settings-session-table-row > div:nth-child(3)::before {
        content: 'Ultimo accesso';
    }

    .settings-page-shell .settings-diagnostic-value {
        word-break: break-word;
    }

    .settings-page-shell .qr-post-row {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 10px 12px;
        align-items: start;
        padding: 12px;
    }

    .settings-page-shell .qr-post-canvas {
        width: 52px;
        height: 52px;
    }

    .settings-page-shell .qr-post-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .settings-page-shell .qr-post-btn {
        width: 100%;
        height: 36px;
    }

    .settings-page-shell .qr-post-footer-btns {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .settings-page-shell .qr-post-footer-btns button {
        width: 100%;
        justify-content: center;
    }

    .settings-page-shell .settings-save-bar {
        padding: 12px;
        border-radius: 18px;
    }

    .settings-page-shell .settings-save-copy p {
        font-size: 0.78rem;
    }
}

@media (max-width: 680px) {
    .settings-page-shell .settings-page-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-page-shell .settings-panel-head,
    .settings-page-shell .settings-save-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .settings-page-shell .settings-form-grid,
    .settings-page-shell .settings-mapping-grid,
    .settings-page-shell .settings-diagnostic-grid,
    .settings-page-shell .settings-time-grid,
    .settings-page-shell .settings-inline-form {
        grid-template-columns: 1fr;
    }

    .settings-page-shell .settings-session-table-head,
    .settings-page-shell .settings-session-table-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 430px) {
    .settings-page-shell .settings-page-stats,
    .settings-page-shell .settings-session-summary,
    .settings-page-shell .settings-toolbar,
    .settings-page-shell .qr-post-footer-btns {
        grid-template-columns: 1fr;
    }

    .settings-page-shell .settings-mobile-action {
        min-height: 90px;
    }

    .settings-page-shell .settings-page-grid,
    .settings-page-shell .settings-mobile-quickbar {
        grid-template-columns: 1fr;
    }

    .settings-category-block {
        padding: 12px;
        border-radius: 20px;
    }

    .settings-page-shell .settings-section-slot > .settings-row {
        padding: 14px;
    }
}


/* utility helpers introduced in script */
.position-relative { position: relative; }
.text-danger { color: #ef4444; }
.scale-120 { transform: scale(1.2); }
.mr-5 { margin-right: 5px; }
.img-reset-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(239,68,68,0.92);
    color: white;
    border-radius: 20px;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    z-index: 20;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(239,68,68,0.4);
    border: none;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}
.img-reset-btn::before { content: 'Ã—'; font-size: 14px; font-weight: 400; line-height: 1; }
.img-reset-btn::after { content: 'Rimuovi'; }
.img-reset-btn
.img-reset-btn::after { content: 'Rimuovi'; }
.img-reset-btn:hover {
    background: rgba(220,38,38,0.97);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(239,68,68,0.5);
}
.cart-item-row { display:flex; align-items:center; gap:10px; padding:10px; border-bottom:1px solid #f1f5f9; }
.cart-item-photo { width:40px; height:40px; object-fit:cover; border-radius:5px; }
.cart-item-placeholder { width:40px; height:40px; background:#f8fafc; border-radius:5px; display:flex; align-items:center; justify-content:center; }
.cart-item-icon { color:#cbd5e1; font-size:12px; }
.cart-item-name { font-weight:700; font-size:13px; }
.cart-item-details { font-size:11px; color:#64748b; }
.btn-inline-trash { background:none; border:none; color:#ef4444; cursor:pointer; }
.empty-cart-msg { text-align:center; padding:20px; color:#64748b; }

/* === ModalitÃ  selezione multipla: toggle via classe sul grid === */
/* Nasconde bottone â‹®, mostra checkbox */
.grid-sel-mode .btn-opt-trigger { display: none !important; }
.grid-sel-mode .mat-sel-chk {
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    cursor: pointer !important;
    accent-color: #242424 !important;
}

/* === Wobble mode Sposta (iPhone-style) === */
@keyframes mat-jiggle {
    0%   { transform: rotate(0deg) scale(1); }
    25%  { transform: rotate(-1.2deg) scale(1.01); }
    75%  { transform: rotate(1.2deg) scale(1.01); }
    100% { transform: rotate(0deg) scale(1); }
}
.mat-wobble {
    animation: mat-jiggle 0.45s ease-in-out infinite;
    transform-origin: center center;
    cursor: grab !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18) !important;
    border-color: #cbd5e1 !important;
    user-select: none;
}
.mat-wobble:nth-child(even) {
    animation-delay: 0.2s;
    animation-direction: alternate-reverse;
}
.mat-wobble:nth-child(3n) { animation-delay: 0.1s; }
.mat-wobble:active { cursor: grabbing !important; animation: none !important; }

/* Bottone Sposta attivo */
.btn-active-sposta {
    background: #242424 !important;
    color: white !important;
    border-color: #242424 !important;
}
.btn-active-sposta:hover {
    background: #3f3f3f !important;
}

/* Drag and Drop */
.dnd-dragging {
    opacity: 0.35;
    transform: scale(0.98);
    box-shadow: 0 8px 25px rgba(0,0,0,0.18) !important;
    position: relative;
    z-index: 50;
}
.dnd-handle, .drag-handle {
    color: #cbd5e1;
    cursor: grab;
    flex-shrink: 0;
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.2s;
}
.dnd-handle:hover, .drag-handle:hover { color: #94a3b8; }
.dnd-handle:active, .drag-handle:active { cursor: grabbing; }

/* additional utilities used after refactor */
.icon-muted { color:#94a3b8; }
.overlay-img { max-width:90%; max-height:90%; border-radius:10px; box-shadow:0 0 20px rgba(0,0,0,0.5); }
.align-end { align-items: flex-end; }
.gap-5 { gap: 5px; }

/* message utility classes */
.inline-msg { padding:20px; color:#64748b; }
.inline-error { padding:20px; color:red; }
.centered-msg { text-align:center; padding:50px; color:#94a3b8; }
.centered-error-bold { text-align:center; padding:50px; color:#ef4444; font-weight:bold; }



/* img-preview generico (modale, ecc.) */
.img-preview-container {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
}
.img-preview-container i {
    color: #94a3b8;
    font-size: 18px;
    pointer-events: none;
}

/* img-preview container modifiers */
.img-preview-container.dashed { border:1px dashed #cbd5e1; }
.img-preview-container.large { width:60px; height:60px; }

.avatar-circle {
    width: 34px;
    height: 34px;
    background: #8fe45e;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 13px;
}

.btn-trash-modern {
    background: transparent;
    color: #94a3b8;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-trash-modern:hover {
    background: #fff1f2;
    color: #f43f5e;
}

/* Kanban visibility checkbox in stati settings */
.kanban-check-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    color: #94a3b8;
    font-size: 13px;
    transition: all 0.15s;
    white-space: nowrap;
    user-select: none;
}
.kanban-check-label:has(input:checked) {
    border-color: #6366f1;
    color: #6366f1;
    background: #eef2ff;
}
.kanban-check-label input[type="checkbox"] {
    display: none;
}

.btn-add-dashed {
    width: 100%;
    margin-top: 5px;
    padding: 12px;
    font-size: 13px;
    border: 2px dashed #e2e8f0;
    background: transparent;
    border-radius: 14px;
    color: #94a3b8;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.btn-add-dashed:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0f7ff;
}

.visualizza-operatori {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 30px;
    align-items: center;
}

/* ---- OPERATORE DROPDOWN (stessa struttura del stato-dropdown) ---- */
.op-dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
}
.op-dropdown.op-dropdown-ord {
    width: 160px;
}
.op-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 7px 12px 7px 10px;
    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.5px;
    color: #334155;
    white-space: nowrap;
    box-sizing: border-box;
}
.op-trigger:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.op-trigger-ord {
    padding: 6px 10px;
    border-radius: 16px;
    font-size: 10px;
    background: rgba(255,255,255,0.85);
    border-color: rgba(0,0,0,0.18);
    color: #1e293b;
}
.op-trigger-ord:hover {
    background: rgba(255,255,255,0.97);
    border-color: rgba(0,0,0,0.32);
    color: #0f172a;
}
.op-dropdown.open .op-trigger    { background: #f1f5f9; border-color: #94a3b8; }
.op-dropdown.open .op-trigger-ord { background: #fff; border-color: #94a3b8; color: #0f172a; }
.op-icon { font-size: 11px; flex-shrink: 0; color: #64748b; }
.op-trigger-ord .op-icon { color: #64748b; }
.op-trigger-label { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.op-chevron { font-size: 9px; flex-shrink: 0; color: #94a3b8; transition: transform 0.2s ease; }
.op-dropdown.open .op-chevron { transform: rotate(180deg); }
.op-popup {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 180px;
    width: max-content;
    max-width: min(280px, calc(100vw - 24px));
    max-height: min(320px, calc(100dvh - 120px));
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 9999;
    padding: 5px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
    pointer-events: none;
}
.op-dropdown.open .op-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0s;
    pointer-events: auto;
}
.op-option {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #334155;
    cursor: pointer;
    text-align: left;
    width: 100%;
}
.op-option:hover    { background: #f1f5f9; }
.op-option.is-selected { background: #f0fdf4; color: #166534; font-weight: 700; }
.op-opt-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #94a3b8; flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.85); box-sizing: content-box;
}
.op-check-icon { margin-left: auto; font-size: 10px; color: #166534; }

/* stato-dropdown-ord specific overrides are in the earlier section */

/* Pulsante Assegnami per operatori */
.btn-assegnami {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #1e40af;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.2s;
    white-space: nowrap;
}
.btn-assegnami:hover { background: #1d4ed8; }
.btn-assegnami-ord {
    padding: 5px 10px;
    border-radius: 14px;
    font-size: 11px;
    gap: 4px;
    background: rgba(30,64,175,0.85);
    border: 1.5px solid rgba(255,255,255,0.25);
    margin-top: 0;
}
.btn-assegnami-ord:hover { background: #1d4ed8; }

.btn-csv-resolve-ord {
    padding: 5px 10px;
    border-radius: 14px;
    font-size: 11px;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.16);
    animation: csvResolvePulse 1.4s ease-in-out infinite;
}

@keyframes csvResolvePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.16);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22);
    }
}
/* ---- FINE OPERATORE DROPDOWN ---- */

/* Pulsante lazy-render "Carica altri N ordini" */
.btn-carica-altri-prod {
    display: block;
    width: 100%;
    margin: 16px 0 8px;
    padding: 10px 0;
    background: #f1f5f9;
    color: #334155;
    border: 1.5px dashed #cbd5e1;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, border-color 0.15s;
}
.btn-carica-altri-prod:hover { background: #e2e8f0; border-color: #94a3b8; }
.btn-carica-altri-prod i { margin-right: 6px; }

.badge-operatore {
    background: #242424;
    color: #ffffff;
    padding: 2px 6px 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid #242424;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-rimuovi-op {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    margin: 0;
    font-weight: 700;
    transition: color 0.15s;
    flex-shrink: 0;
}

.btn-rimuovi-op:hover {
    color: #ffffff;
}

.btn-chiedi-assegna {
    background: #242424;
    color: white;
    border: none;
    padding: 6px 12px !important;
    border-radius: 6px;
    font-size: 11px !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 140px;  /* Forza i tasti ad avere la stessa larghezza */
    text-align: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-chiedi-assegna:hover {
    background: #ffffff;
    color: #242424;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}








/* additional rules moved from index.html inline styles */
#modal-titolo {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    color: #1e293b;
}

/* reset headings inside modals to remove default margins */
#modal-carrello h3,
.modal-articoli-box h3 {
    margin: 0;
}
.modal-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.modal-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 5px;
}
#messaggio-aiuto {
    width: 100%;
    height: 80px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    resize: none;
    outline: none;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
}
.btn-modal-cancel {
    background: #242424;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}
.btn-modal-cancel:hover {
    background: #ffffff;
    color: #242424;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.btn-modal-send {
    background: #242424;
    color: #ffffff;
    border: none;
    padding: 10px 25px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.btn-modal-send:hover {
    background: #ffffff;
    color: #242424;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

#floating-cart-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #242424;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 8px 15px rgba(0,0,0,0.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid rgba(255,255,255,0.15);
    pointer-events: auto !important;
    transition: background 0.18s, box-shadow 0.18s;
}
#floating-cart-btn:hover {
    background: #ffffff;
    color: #242424;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    border-color: #242424;
}
/* === MODAL CARRELLO â€” fade overlay + slide-up box === */
#modal-carrello {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    z-index: 100000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    backdrop-filter: blur(0px);
    transition: opacity 0.28s ease, backdrop-filter 0.28s ease;
    pointer-events: none;
}
#modal-carrello.cart-open {
    opacity: 1;
    backdrop-filter: blur(3px);
    pointer-events: auto;
}
#modal-carrello > div {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 28px 60px rgba(0,0,0,0.3);
    transform: translateY(36px) scale(0.92);
    transition: transform 0.44s cubic-bezier(0.22, 1, 0.36, 1);
}
#modal-carrello.cart-open > div {
    transform: translateY(0) scale(1);
}
#modal-carrello .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
    margin-bottom: 15px;
}
#modal-carrello .btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}
#modal-carrello .modal-footer {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* gestione articolo modal */
.modal-articoli-box h3 {
    margin-top: 0;
    color: #1e293b;
    font-size: 18px;
}
.modal-articolo-field {
    margin-bottom: 12px;
}
.modal-articolo-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 4px;
}
.modal-articolo-field input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.modal-articolo-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.btn-modal-art-cancel {
    background: #242424;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.btn-modal-art-cancel:hover {
    background: #ffffff;
    color: #242424;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.btn-modal-art-send {
    background: #242424;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.btn-modal-art-send:hover {
    background: #ffffff;
    color: #242424;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

/* mobile header adjustments */
.mobile-header {
    display: none; /* nascosto su desktop, visibile via @media */
    align-items: center;
    background: #242424;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    z-index: 9000;
    box-sizing: border-box;
    padding: 0 16px;
    gap: 12px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}
.mobile-menu-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    line-height: 1;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mobile-menu-btn i { font-size: 20px; }
.mobile-header-title {
    flex: 1;
    text-align: center;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: white;
}
.mobile-header-right {
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}
.badge-mobile-notif {
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}
