/* Gestionale DR.DEXTER - Stile Apple: minimal, pulito, professionale */
:root {
    --neon-green: #2563eb;
    --neon-green-soft: #dbeafe;
    --purple: #64748b;
    --purple-soft: #e2e8f0;
    --black: #1f2937;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --bg: #f8f9fa;
    --bg-card: #ffffff;
    --border: #dee2e6;
    --text: #1a1a1a;
    --text-secondary: #5a5a5a;
    --radius: 8px;
    --radius-sm: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* No underline across app links/buttons */
a, a:hover, a:focus, a:active {
    text-decoration: none !important;
}

/* Larghezza fluida: sfrutta il viewport (PC/tablet/smartphone); padding reattivo */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    min-width: 0;
    padding-top: max(1rem, env(safe-area-inset-top, 0px));
    padding-left: max(clamp(0.65rem, 2.5vw, 1.75rem), env(safe-area-inset-left, 0px));
    padding-right: max(clamp(0.65rem, 2.5vw, 1.75rem), env(safe-area-inset-right, 0px));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
}
.logo-img { height: 40px; width: auto; display: block; background: transparent !important; }
.logo-no-bg { background: transparent !important; }
.logo-fallback { font-size: 1.25rem; font-weight: 700; color: #0f172a; display: none; margin-left: 0.5rem; }
.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    margin-left: 0.5rem;
    display: none;
}
.logo-link:not(:has(.logo-img[style*="none"])) .logo-text { display: none; }
.logo-link:has(.logo-img[style*="display: none"]) .logo-text,
.logo-link .logo-img[style*="display: none"] + .logo-text { display: inline; }
.top-menu { position: relative; }
.top-menu-trigger {
    cursor: pointer;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #0f172a;
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
    font-size: 0.9rem;
    font-weight: 600;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}
.top-menu-inline { position: static; transform: none; }
.top-menu-hamburger {
    padding: 0.5rem 0.65rem;
    min-width: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 1.15rem;
}
.hamburger-icon span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}
.menu-drawer-bridges {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(226, 232, 240, 0.85);
}
.menu-drawer-bridges-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.55rem;
}
.menu-drawer-bridge-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}
.menu-bridge-btn {
    appearance: none;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 0.55rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s, background 0.15s, transform 0.12s;
    font: inherit;
    color: #0f172a;
}
.menu-bridge-btn-wide { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 0.45rem; }
.menu-bridge-btn:active { transform: scale(0.98); }
.menu-bridge-btn.is-on {
    border-color: rgba(34, 197, 94, 0.55);
    background: linear-gradient(165deg, #ecfdf5 0%, #f0fdf4 100%);
}
.menu-bridge-btn.is-off {
    border-color: rgba(239, 68, 68, 0.45);
    background: linear-gradient(165deg, #fef2f2 0%, #fff 100%);
}
.menu-bridge-btn.is-busy { opacity: 0.75; pointer-events: none; }
.menu-bridge-icon { font-size: 1.15rem; line-height: 1; }
.menu-bridge-label { font-size: 0.72rem; font-weight: 700; text-align: center; line-height: 1.15; }
.menu-bridge-led {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 2px #fff;
}
.menu-bridge-btn.is-on .menu-bridge-led { background: #22c55e; }
.menu-bridge-btn.is-off .menu-bridge-led { background: #ef4444; }
.menu-bridge-btn.is-busy .menu-bridge-led { background: #f59e0b; animation: bridgeLedPulse 0.9s ease infinite; }
@keyframes bridgeLedPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}
.menu-drawer-bridges-hint {
    margin: 0.55rem 0 0;
    font-size: 0.72rem;
    line-height: 1.35;
    color: #64748b;
}
.menu-drawer-bridges-more {
    display: inline-block;
    margin-top: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f766e;
    text-decoration: none;
}
.menu-drawer-bridges-more:hover {
    text-decoration: underline;
}
.top-chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.95rem;
}
.top-chrome-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.top-chrome-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}
.top-chrome-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 2.5rem;
}
.drdex-notif-hub {
    position: relative;
}
.drdex-notif-trigger {
    appearance: none;
    border: none;
    background: transparent;
    color: #334155;
    padding: 0.35rem;
    border-radius: 10px;
    cursor: pointer;
    line-height: 0;
    position: relative;
    transition: background 0.15s, color 0.15s;
}
.drdex-notif-trigger:hover,
.drdex-notif-trigger:focus {
    background: #f1f5f9;
    color: #0f172a;
    outline: none;
}
.drdex-notif-icon {
    display: block;
}
.drdex-notif-badge {
    position: absolute;
    top: -1px;
    right: -1px;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.05rem;
    text-align: center;
    box-sizing: border-box;
}
.drdex-notif-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: min(92vw, 340px);
    max-height: min(70vh, 420px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.14);
    z-index: 2000;
    overflow: hidden;
}
.drdex-notif-panel[hidden] {
    display: none !important;
}
.drdex-notif-panel-head {
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.drdex-notif-list {
    overflow-y: auto;
    flex: 1;
    min-height: 120px;
    max-height: 320px;
}
.drdex-notif-empty {
    padding: 1rem 0.85rem;
    font-size: 0.88rem;
    color: #64748b;
}
.drdex-notif-item {
    display: block;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
    transition: background 0.12s;
}
a.drdex-notif-item:hover {
    background: #f8fafc;
}
.drdex-notif-item.is-unread {
    background: #f0fdf4;
    border-left: 3px solid #22c55e;
    padding-left: calc(0.75rem - 3px);
}
.drdex-notif-item-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.2rem;
}
.drdex-notif-item-msg {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.35;
}
.drdex-notif-panel-foot {
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
    border-top: 1px solid #e2e8f0;
    background: #fafafa;
}
.drdex-notif-panel-foot a {
    color: #15803d;
    text-decoration: none;
}
.drdex-notif-panel-foot a:hover {
    text-decoration: underline;
}
.inline-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    min-height: 30px;
}
.inline-logo-img {
    height: 78px;
    width: auto;
    display: block;
}
.inline-logo-fallback {
    display: none;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
}
.menu-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(10px) saturate(1.15);
    -webkit-backdrop-filter: blur(10px) saturate(1.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 1200;
}
.menu-drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.menu-drawer {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    height: 100dvh;
    width: min(82vw, 320px);
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(22px) saturate(1.25);
    -webkit-backdrop-filter: blur(22px) saturate(1.25);
    border-right: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
    transform: translateX(-102%);
    transition: transform 0.24s ease;
    z-index: 1210;
    padding: 0;
    overflow: hidden;
}
.menu-drawer.is-open { transform: translateX(0); }
.menu-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 0.9rem 0.9rem 0.65rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}
.menu-drawer-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0.65rem 0.9rem 1rem;
}
.menu-drawer-close {
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 999px;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}
.menu-drawer-nav { display: grid; gap: 0.35rem; }
.menu-drawer-nav a,
.menu-drawer-nav button.header-refresh-btn {
    color: #334155;
    text-decoration: none;
    font-size: 0.94rem;
    border-radius: 10px;
    padding: 0.48rem 0.62rem;
}
.menu-drawer-nav a:hover { background: rgba(248, 250, 252, 0.85); color: #0f172a; }
.menu-drawer-section-label {
    margin: 0.5rem 0 0.15rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}
.menu-drawer-foot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(226, 232, 240, 0.85);
}
.menu-drawer-foot .header-refresh-btn { margin: 0; }
.menu-drawer-foot a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.88rem;
    padding: 0.35rem 0.5rem;
}
.header-refresh-btn {
    appearance: none;
    border: 1px solid #d1d5db;
    background: #f8fafc;
    color: #334155;
    border-radius: 999px;
    padding: 0.35rem 0.55rem;
    font-size: 1rem;
    line-height: 1.1;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.header-refresh-btn:hover,
.header-refresh-btn:focus {
    background: #eef2ff;
    border-color: #cbd5e1;
    color: #1e3a8a;
    outline: none;
}

/* Card con sezioni colorate */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    max-width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
}
.card-clienti { border-left: 4px solid var(--neon-green); }
.card-dispositivo { border-left: 4px solid var(--purple); }
.card-interventi { border-left: 4px solid #9e9e9e; }
.card-note { border-left: 4px solid #ff9800; }
.note-apple-style { background: #fff9e6 !important; border-color: #f5e6b8; }
.card-firme { border-left: 4px solid #e91e63; }
.card h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* Form */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.25rem; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
input, select, textarea {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: max(16px, 1rem);
    min-height: 44px;
}
input[type="checkbox"],
input[type="radio"],
input[type="file"],
input[type="hidden"],
input[type="button"],
input[type="submit"],
input[type="reset"] {
    min-height: 0;
    font-size: inherit;
}
textarea {
    min-height: 80px;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 2px rgba(155,89,255,0.2);
}
textarea { resize: vertical; }

/* Interventi tabella dinamica */
.card-interventi { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.interventi-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; table-layout: fixed; min-width: 0; }
.interventi-table th, .interventi-table td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; box-sizing: border-box; }
.interventi-table td { height: 48px; }
.interventi-table th { font-size: 0.8rem; color: var(--text-secondary); font-weight: 600; }
.interventi-table input { width: 100%; box-sizing: border-box; }
.interventi-table .col-intervento { width: 52%; }
.interventi-table .col-importo { width: 34%; }
.interventi-table .col-importo-cell { width: 34%; }
.interventi-table .col-rimuovi { width: 3rem; min-width: 3rem; max-width: 3rem; padding-left: 0.35rem; padding-right: 0.35rem; text-align: center; }
.btn-rimuovi-row { background: #fee2e2; color: #b91c1c; border: none; border-radius: 4px; width: 1.75rem; height: 1.75rem; min-width: 1.75rem; max-width: 1.75rem; margin: 0 auto; padding: 0; cursor: pointer; font-size: 1.1rem; line-height: 1; display: block; box-sizing: border-box; }
.btn-rimuovi-row:hover { background: #fecaca; }
.interventi-table .col-importo-cell input { text-align: right; }
.btn-add-row {
    margin-top: 0.5rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    background: var(--purple-soft);
    color: var(--purple);
    border: 1px dashed var(--purple);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.btn-add-row:hover { background: var(--purple); color: white; }

/* Importo pulito - placeholder 0 che sparisce al focus */
.importo-input { text-align: right; }
.importo-input::placeholder { color: #999; }

/* Bottoni */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: #e2e8f0; color: #0f172a; border: 1px solid #cbd5e1; }
.btn-primary:hover { background: #dbeafe; border-color: #bfdbfe; }
.btn-secondary { background: #f8fafc; color: #334155; border: 1px solid #dbe1ea; }
.btn-secondary:hover { background: #eef2f7; }
.btn-cancella { background: #fee; color: #c00; border: 1px solid #fcc; margin-top: 0.5rem; }

/* Azioni tabella - stile Apple: pulito, ben distanziati */
.azioni-cell {
    white-space: nowrap;
    padding: 0.75rem 1rem;
}
.azioni-cell .btn-azione {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 980px;
    transition: all 0.2s ease;
}
.btn-vedi {
    color: #0071e3;
    background: transparent;
}
.btn-vedi:hover {
    color: #0077ed;
    text-decoration: underline;
}
.btn-modifica {
    color: #fff;
    background: #0071e3;
}
.btn-modifica:hover {
    background: #0077ed;
}
.btn-pdf {
    color: #1d1d1f;
    background: #f5f5f7;
}
.btn-pdf:hover {
    background: #e8e8ed;
}
#btnGeneraPdf.btn-pdf-with-photos {
    background: linear-gradient(180deg, #059669 0%, #047857 100%) !important;
    color: #fff !important;
    border-color: #047857 !important;
    box-shadow: 0 1px 3px rgba(4, 120, 87, 0.35);
}
#btnGeneraPdf.btn-pdf-with-photos:hover {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%) !important;
    color: #fff !important;
}
#btnGeneraPdf.is-generating {
    opacity: 0.88;
    pointer-events: none;
    cursor: wait;
}
.btn-delete {
    color: #b91c1c;
    background: #fee2e2;
}
.btn-delete:hover {
    background: #fecaca;
}
/* Elenco riparazioni: riga cliccabile (scheda), WhatsApp nelle azioni */
tbody tr.repair-row-nav {
    cursor: pointer;
}
tbody tr.repair-row-nav:hover td {
    filter: brightness(0.96);
}
tbody tr.repair-row-nav .azioni-cell {
    cursor: default;
}
tbody tr.repair-row-nav .azioni-cell .btn-azione {
    cursor: pointer;
}
a.repair-scheda-link {
    color: inherit;
    text-decoration: none;
}
a.repair-scheda-link:hover,
a.repair-scheda-link:focus {
    text-decoration: underline;
}
.btn-wa-chat {
    padding: 0.3rem 0.4rem !important;
    line-height: 0;
    vertical-align: middle;
    border: 2px solid #25d366;
    border-radius: 999px;
    background: #fff !important;
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.28);
}
.btn-wa-chat:hover {
    background: #ecfdf5 !important;
    box-shadow: 0 2px 9px rgba(37, 211, 102, 0.38);
}
.btn-wa-chat-img {
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
    vertical-align: middle;
}
.btn-whatsapp { background: #ecfdf5 !important; color: #065f46 !important; border: 1px solid #a7f3d0 !important; }
.btn-whatsapp:hover { background: #d1fae5 !important; color: #065f46 !important; }
.btn-whatsapp-icon {
    border-radius: 999px;
    min-width: 112px;
    justify-content: center;
    gap: 0.45rem;
}
.wa-icon-svg {
    width: 16px;
    height: 16px;
    display: inline-block;
    color: #10b981;
}
.wa-icon { font-size: 0.95rem; line-height: 1; }

/* Menu WhatsApp scheda: un solo pulsante con logo ufficiale + tendina */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.wa-ready-pickup-form {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.wa-dropdown-group {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    vertical-align: middle;
}
.wa-dropdown {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}
.wa-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    padding: 0.25rem;
    margin: 0;
    border: 2px solid #25d366;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.wa-dropdown-trigger:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
}
.wa-dropdown.is-open .wa-dropdown-trigger {
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.35);
}
/* Invio indiretto (wa.me): stesso logo, blu gestionale */
.wa-dropdown-trigger-indirect {
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.wa-dropdown-trigger-indirect:hover {
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}
.wa-dropdown-indirect.is-open .wa-dropdown-trigger-indirect {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}
.wa-dropdown-logo {
    width: 34px;
    height: 34px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}
.wa-dropdown-logo-indirect {
    filter: hue-rotate(195deg) saturate(1.35) brightness(0.95);
}
.wa-dropdown-panel {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 5000;
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}
.wa-dropdown-indirect .wa-dropdown-panel {
    left: auto;
    right: 0;
}
.wa-dropdown-item {
    display: flex;
    width: 100%;
    align-items: center;
    padding: 0.65rem 1rem;
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    color: #0f172a;
    background: #fff;
    border: none;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
}
.wa-dropdown-item:last-child {
    border-bottom: none;
}
.wa-dropdown-direct a.wa-dropdown-item:hover,
.wa-dropdown-direct button.wa-dropdown-item:hover {
    background: #ecfdf5;
    color: #065f46;
}
.wa-dropdown-indirect a.wa-dropdown-item:hover,
.wa-dropdown-indirect button.wa-dropdown-item:hover {
    background: #eff6ff;
    color: #1d4ed8;
}
.wa-dropdown-item-submit {
    color: #0f172a;
}
.wa-dropdown-hint {
    display: block;
    padding: 0.4rem 1rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

/* Lavori in background (angolo) — mai overlay a tutta pagina */
.drdex-bg-jobs {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 99990;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(280px, calc(100vw - 28px));
    pointer-events: none;
}
.drdex-bg-jobs[hidden] { display: none !important; }
.drdex-bg-jobs-card {
    pointer-events: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
    padding: 0.65rem 0.75rem 0.55rem;
    animation: drdexBgJobIn 0.22s ease;
}
.drdex-bg-jobs-upload { border-left: 3px solid #2563eb; }
.drdex-bg-jobs-wa { border-left: 3px solid #25d366; }
.drdex-bg-jobs-info { border-left: 3px solid #64748b; }
.drdex-bg-jobs-err { border-left: 3px solid #dc2626; }
.drdex-bg-jobs-row {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
}
.drdex-bg-jobs-icon {
    font-size: 1.05rem;
    line-height: 1.2;
    flex-shrink: 0;
}
.drdex-bg-jobs-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.drdex-bg-jobs-text strong {
    font-size: 0.82rem;
    color: #0f172a;
    font-weight: 700;
}
.drdex-bg-jobs-text span {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.drdex-bg-jobs-track {
    margin-top: 0.45rem;
    height: 4px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}
.drdex-bg-jobs-bar {
    height: 100%;
    background: linear-gradient(90deg, #25d366, #128c7e);
    border-radius: 999px;
    transition: width 0.2s ease;
}
.drdex-bg-jobs-upload .drdex-bg-jobs-bar {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}
.drdex-bg-jobs-spin {
    margin-top: 0.45rem;
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #e2e8f0 0%, #25d366 40%, #e2e8f0 80%);
    background-size: 200% 100%;
    animation: drdexBgJobShine 1.1s linear infinite;
}
@keyframes drdexBgJobIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes drdexBgJobShine {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}
@media (max-width: 640px) {
    .drdex-bg-jobs {
        right: 10px;
        bottom: 10px;
        width: min(260px, calc(100vw - 20px));
    }
}
.btn-nav-circle {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #dbe1ea;
    color: #334155;
    text-decoration: none;
    font-weight: 600;
}
.menu-drawer-open main.container {
    /* Evitare filter su iOS: può far apparire la tastiera iPad fluttuante piccola */
    opacity: 0.92;
    transition: opacity 0.18s ease;
}
html.drdex-ios-keyboard .menu-drawer-open main.container {
    opacity: 1;
}
.link-accent { color: #0071e3; text-decoration: none; }
.link-accent:hover { text-decoration: underline; }
.btn-cancella:hover { background: #fdd; }
.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.btn-group-salva { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Tabella riparazioni - stile Apple */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap th, .table-wrap td { padding: 1rem 1.25rem; text-align: left; border-bottom: 1px solid var(--border); }
.table-wrap th { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.02em; }
.table-wrap tbody tr:hover { background: #f9f9f9; }

/* Tabelle fluide leggibili: niente puntini, scroll orizzontale solo quando serve */
.table-wrap--fluid table.data-list-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}
.table-wrap--fluid .data-list-table th,
.table-wrap--fluid .data-list-table td {
    vertical-align: middle;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    padding: 0.85rem 0.85rem;
}
.table-wrap--fluid .data-list-table .azioni-cell {
    white-space: nowrap;
}
.table-wrap--fluid .repairs-list-table th:nth-child(1),
.table-wrap--fluid .repairs-list-table td:nth-child(1) { min-width: 7.5rem; }
.table-wrap--fluid .repairs-list-table th:nth-child(2),
.table-wrap--fluid .repairs-list-table td:nth-child(2) { min-width: 11rem; }
.table-wrap--fluid .repairs-list-table th:nth-child(3),
.table-wrap--fluid .repairs-list-table td:nth-child(3) { min-width: 10rem; }
.table-wrap--fluid .repairs-list-table th:nth-child(4),
.table-wrap--fluid .repairs-list-table td:nth-child(4) { min-width: 5.5rem; }
.table-wrap--fluid .repairs-list-table th:nth-child(5),
.table-wrap--fluid .repairs-list-table td:nth-child(5) { min-width: 8.5rem; }
.table-wrap--fluid .repairs-list-table th:nth-child(6),
.table-wrap--fluid .repairs-list-table td:nth-child(6) { min-width: 8.5rem; }
.table-wrap--fluid .repairs-list-table th:nth-child(7),
.table-wrap--fluid .repairs-list-table td:nth-child(7) { min-width: 15rem; }
.table-wrap--fluid .clients-list-table th:nth-child(1),
.table-wrap--fluid .clients-list-table td:nth-child(1) { min-width: 8rem; }
.table-wrap--fluid .clients-list-table th:nth-child(2),
.table-wrap--fluid .clients-list-table td:nth-child(2) { min-width: 8rem; }
.table-wrap--fluid .clients-list-table th:nth-child(3),
.table-wrap--fluid .clients-list-table td:nth-child(3) { min-width: 8rem; }
.table-wrap--fluid .clients-list-table th:nth-child(4),
.table-wrap--fluid .clients-list-table td:nth-child(4) { min-width: 13rem; }
.table-wrap--fluid .clients-list-table th:nth-child(5),
.table-wrap--fluid .clients-list-table td:nth-child(5) { min-width: 8rem; }
.table-wrap--fluid .clients-list-table th:nth-child(6),
.table-wrap--fluid .clients-list-table td:nth-child(6) { min-width: 9rem; }
.table-wrap--fluid .clients-list-table th:nth-child(7),
.table-wrap--fluid .clients-list-table td:nth-child(7) { min-width: 12rem; }

/* Firma - modal overlay, Cancella sempre visibile */
.btn-firma-apri { margin-top: 0.25rem; }
.signature-block { margin-bottom: 1.5rem; }
/* Etichette + pulsante spostati a destra; anteprima firma centrata sotto */
.firma-riga-etichetta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    width: 100%;
    padding-left: min(38%, 14rem);
    box-sizing: border-box;
}
.firma-riga-etichetta label { text-align: right; margin: 0; font-weight: 600; }
.firma-thumb {
    margin-top: 0.65rem;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.firma-thumb img { max-height: 118px; display: block; border: none; border-radius: var(--radius-sm); }
.modal-firma-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.72); z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem; box-sizing: border-box;
    overscroll-behavior: contain;
    touch-action: none;
}
#modalViewSign.modal-firma-overlay {
    z-index: 12050;
}
#modalPdfSchedaLab [data-pdf-share],
#modalPdfScheda [data-pdf-share] {
    display: none !important;
}
.modal-firma-overlay-sign {
    z-index: 13000;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
/* iPad modal firma: blocca double-tap / menu sistema su canvas */
.signature-canvas,
.signature-modal-container {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    touch-action: none !important;
    -webkit-tap-highlight-color: transparent !important;
}
/* Area firma iPad: niente menu Copia/Cerca/Traduci al polso sul canvas */
.drdex-area-firma,
.modal-firma-overlay-sign .modal-firma-box-sign,
.modal-firma-overlay-sign .signature-wrapper-line,
.modal-firma-overlay-sign .signature-pad,
.modal-firma-overlay-sign .signature-pad canvas {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    touch-action: none !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
}
.modal-firma-overlay-sign .sign-fab {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
    touch-action: manipulation !important;
}
.modal-firma-overlay-sign .modal-firma-hint,
.modal-firma-overlay-sign h3 {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}
.modal-firma-box {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 1.25rem; max-width: 760px; width: min(96vw, 760px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    touch-action: none;
}
/* Scanner barcode: modale quasi a schermo intero, video “contain” + guida centrale */
.barcode-scanner-overlay {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
}
.barcode-scanner-box.barcode-scanner-box-full {
    max-width: none;
    width: 100%;
    min-height: 100%;
    max-height: none;
    height: 100%;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    padding: 0.65rem 0.85rem calc(1rem + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    touch-action: none;
}
.barcode-scanner-box-full h3 {
    flex-shrink: 0;
    margin-bottom: 0.25rem;
}
.barcode-scanner-box-full .modal-firma-hint {
    flex-shrink: 0;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}
.barcode-scanner-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.barcode-scanner-video-wrap {
    position: relative;
    flex: 1;
    min-height: min(72vh, 640px);
    width: 100%;
    background: #0b1220;
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.barcode-scanner-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    background: #0b1220;
}
.barcode-scanner-reader {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: min(72vh, 640px);
    background: #0b1220;
}
.barcode-scanner-reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block;
}
/* Rettangolo guida: area dove mettere il codice; intorno resta visibile (solo leggermente attenuato) */
.barcode-scanner-focus-ring {
    position: absolute;
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
    width: min(94vw, 920px);
    height: clamp(88px, 16vh, 168px);
    border: 3px solid rgba(52, 211, 153, 0.95);
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    z-index: 2;
}
@media (max-width: 520px) {
    .barcode-scanner-focus-ring {
        width: min(96vw, 100%);
        height: clamp(76px, 14vh, 140px);
    }
}
.barcode-scanner-status {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
}
.modal-firma-box h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.modal-firma-hint { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 1rem; }
.modal-firma-actions {
    display: flex; gap: 0.75rem; margin-top: 1rem;
    flex-wrap: wrap; justify-content: flex-start;
}
.modal-firma-box-sign {
    max-width: min(96vw, 980px);
    width: min(96vw, 980px);
    max-height: 92vh;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.modal-firma-box-sign .signature-wrapper-line {
    overflow: visible;
}
.modal-firma-box-sign .modal-firma-actions {
    margin-top: 0.8rem;
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    border-top: 1px solid #e5e7eb;
    padding-top: 0.7rem;
    z-index: 5;
}
.sign-fab-actions {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: nowrap;
    gap: 1rem;
}
.sign-fab-cluster {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.sign-fab {
    border: none;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    line-height: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.sign-fab-sm {
    width: 48px;
    height: 48px;
    font-size: 1.35rem;
    font-weight: 600;
}
.sign-fab-lg {
    width: 64px;
    height: 64px;
    font-size: 1.85rem;
    font-weight: 700;
}
.sign-fab-undo {
    background: #f1f5f9;
    color: #334155;
}
.sign-fab-dismiss {
    background: #fee2e2;
    color: #b91c1c;
    font-size: 1.5rem;
    font-weight: 700;
    padding-bottom: 2px;
}
.sign-fab-confirm {
    background: #16a34a;
    color: #fff;
}
.sign-fab:active {
    transform: scale(0.96);
}
.signature-wrapper {
    height: min(52vh, 420px);
    margin-bottom: 0;
    position: relative;
}
.signature-pad {
    position: relative;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}
.signature-pad canvas { display: block; width: 100%; height: 100%; }
.signature-pad::before {
    content: 'Firma qui';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #ccc;
    pointer-events: none;
}
.signature-pad.has-signature::before { display: none; }
.signature-wrapper-line {
    height: clamp(180px, 30vh, 260px);
    flex-shrink: 0;
    position: relative;
    margin-bottom: 0.65rem;
    overflow: visible;
}
.signature-wrapper-line .signature-pad {
    height: 100%;
    box-sizing: border-box;
}
.remote-signature-wrap {
    height: clamp(170px, 30vh, 220px);
}
.drdex-client-public-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 1rem 0.35rem;
    box-sizing: border-box;
}
.drdex-client-public-logo {
    height: 78px;
    width: auto;
    max-width: min(280px, 72vw);
    object-fit: contain;
    display: block;
}
.drdex-client-public-logo-fallback {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
}
.drdex-client-public-footer {
    text-align: center;
    padding: 1.25rem 1rem 2rem;
    color: #718096;
    font-size: 0.88rem;
    margin-top: 0.5rem;
}
.sign-remote-pdf-launch {
    margin: 0 0 1rem;
}
.sign-remote-pdf-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    max-width: 420px;
    margin: 1.25rem auto 1rem;
    padding: 1.35rem 1.15rem 1.2rem;
    border: 2px solid #2563eb;
    border-radius: 14px;
    background: linear-gradient(165deg, #eff6ff 0%, #dbeafe 55%, #bfdbfe 100%);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.18);
    cursor: pointer;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}
.sign-remote-pdf-gate.is-pending {
    border-color: #dc2626;
    background: linear-gradient(165deg, #fef2f2 0%, #fee2e2 50%, #fecaca 100%);
    box-shadow: 0 8px 26px rgba(220, 38, 38, 0.22);
    animation: sign-remote-pdf-pulse 2s ease-in-out infinite;
}
.sign-remote-pdf-gate.is-pending .sign-remote-pdf-gate-title {
    color: #991b1b;
}
.sign-remote-pdf-gate.is-pending .sign-remote-pdf-gate-desc {
    color: #7f1d1d;
}
.sign-remote-pdf-gate-pickup.is-pending {
    border-color: #dc2626;
    background: linear-gradient(165deg, #fef2f2 0%, #fee2e2 50%, #fecaca 100%);
    box-shadow: 0 8px 26px rgba(220, 38, 38, 0.22);
    animation: sign-remote-pdf-pulse 2s ease-in-out infinite;
}
.sign-remote-pdf-gate-pickup.is-pending .sign-remote-pdf-gate-title {
    color: #991b1b;
}
@keyframes sign-remote-pdf-pulse {
    0%, 100% { box-shadow: 0 8px 26px rgba(220, 38, 38, 0.2); }
    50% { box-shadow: 0 10px 32px rgba(220, 38, 38, 0.38); }
}
.sign-remote-pdf-gate:hover,
.sign-remote-pdf-gate:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.24);
    outline: none;
}
.sign-remote-pdf-gate.is-done {
    border-color: #16a34a;
    background: linear-gradient(165deg, #f0fdf4 0%, #dcfce7 55%, #bbf7d0 100%);
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.15);
}
.sign-remote-pdf-gate-icon {
    display: none;
}
.sign-remote-pdf-gate-title {
    font-size: 1.05rem;
    color: #1e3a8a;
}
.sign-remote-pdf-gate-desc {
    font-size: 0.86rem;
    color: #334155;
    line-height: 1.4;
    max-width: 34ch;
}
.sign-remote-pdf-gate-badge {
    display: inline-block;
    margin-top: 0.15rem;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #fff;
    background: #dc2626;
}
.sign-remote-pdf-gate-badge.is-done {
    background: #16a34a;
    animation: none;
}
.sign-remote-pdf-gate-badge.is-pending {
    background: #dc2626;
    animation: sign-remote-blink 0.85s ease-in-out infinite;
}
@keyframes sign-remote-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.96); }
}
.sign-remote-step1-complete .sign-remote-step1-complete-label {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
/* Evidenziazione azioni (stesso linguaggio del riquadro PDF) */
.sign-remote-pdf-gate.is-pending,
.sign-remote-pdf-gate-pickup.is-pending,
button.sign-remote-action-gate.is-pending,
label.sign-remote-action-gate.is-pending,
.sign-remote-delegato-mode.sign-remote-action-gate.is-pending {
    animation: sign-remote-pdf-pulse 2s ease-in-out infinite, sign-remote-blink 0.85s ease-in-out infinite;
}
.sign-remote-action-gate.is-pending {
    border: 2px solid #dc2626 !important;
    background: linear-gradient(165deg, #fef2f2 0%, #fee2e2 50%, #fecaca 100%) !important;
    color: #991b1b !important;
    box-shadow: 0 8px 26px rgba(220, 38, 38, 0.22) !important;
    opacity: 1 !important;
    filter: none !important;
}
.sign-remote-action-gate.is-done {
    border: 2px solid #16a34a !important;
    background: linear-gradient(165deg, #f0fdf4 0%, #dcfce7 55%, #bbf7d0 100%) !important;
    color: #166534 !important;
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.18) !important;
    animation: none !important;
}
button.sign-remote-btn-open-sign.sign-remote-action-gate.is-pending {
    background: linear-gradient(165deg, #fef2f2 0%, #fee2e2 50%, #fecaca 100%) !important;
    color: #991b1b !important;
    border-color: #dc2626 !important;
}
button.sign-remote-btn-open-sign.sign-remote-action-gate.is-done {
    background: linear-gradient(165deg, #f0fdf4 0%, #dcfce7 55%, #bbf7d0 100%) !important;
    color: #166534 !important;
    border-color: #16a34a !important;
}
label.sign-remote-terms-check.sign-remote-action-gate.is-pending,
label.sign-remote-terms-check.sign-remote-action-gate.is-done {
    padding: 0.65rem 0.85rem;
    border-radius: 14px;
    overflow: hidden;
    box-sizing: border-box;
}
.sign-remote-delegato-mode.sign-remote-action-gate.is-pending,
.sign-remote-delegato-mode.sign-remote-action-gate.is-done {
    padding: 0.55rem;
    border-radius: 14px;
    overflow: hidden;
    box-sizing: border-box;
}
button.sign-remote-action-gate.is-pending,
button.sign-remote-action-gate.is-done {
    border-radius: 14px;
    overflow: hidden;
    box-sizing: border-box;
}
.sign-remote-delegato-mode-btn.sign-remote-action-gate.is-pending,
.sign-remote-delegato-mode-btn.sign-remote-action-gate.is-done {
    font-weight: 700;
}
.sign-remote-delegato-prompt {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 2px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
}
.sign-remote-delegato-prompt.is-animating {
    animation: sign-remote-prompt-pulse 1.1s ease-in-out infinite;
}
@keyframes sign-remote-prompt-pulse {
    0%, 100% { border-color: #f59e0b; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35); }
    50% { border-color: #dc2626; box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.12); }
}
.sign-remote-delegato-mode--pending .sign-remote-delegato-mode-btn {
    opacity: 0.72;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
}
.sign-remote-delegato-mode--pending .sign-remote-delegato-mode-btn.is-active {
    opacity: 1;
}
.sign-remote-btn-open-sign--locked:not(.sign-remote-action-gate.is-pending) {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    filter: grayscale(0.35);
}
.sign-remote-rotate-hint {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    background: rgba(240, 253, 244, 0.92);
    border: 1px solid rgba(167, 243, 208, 0.55);
    color: #166534;
    font-size: 0.84rem;
    line-height: 1.45;
    animation: sign-remote-rotate-hint-glow 2.6s ease-in-out infinite;
}
@keyframes sign-remote-rotate-hint-glow {
    0%, 100% {
        background: rgba(245, 255, 250, 0.94);
        border-color: rgba(187, 247, 208, 0.45);
        box-shadow: 0 0 0 0 rgba(134, 239, 172, 0);
    }
    50% {
        background: rgba(220, 252, 231, 0.98);
        border-color: rgba(110, 231, 183, 0.62);
        box-shadow: 0 0 14px 3px rgba(134, 239, 172, 0.22);
    }
}
.sign-remote-rotate-hint.is-hidden,
.sign-remote-rotate-hint[hidden] {
    display: none !important;
    animation: none;
}
.sign-remote-rotate-icon-wrap {
    flex-shrink: 0;
    width: auto;
    height: auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background: transparent;
    border: none;
    overflow: visible;
    box-shadow: none;
    animation: none;
    padding: 0;
}
.sign-remote-rotate-img {
    width: 84px;
    height: 84px;
    max-width: 84px;
    max-height: 84px;
    flex-shrink: 0;
    object-fit: contain;
    object-position: center;
    display: block;
    border-radius: 0;
    background: transparent !important;
    background-color: transparent !important;
    opacity: 1;
    filter: none;
    mix-blend-mode: normal;
    transform-origin: center center;
    will-change: transform;
}
.sign-remote-rotate-hint:not(.is-hidden):not([hidden]) .sign-remote-rotate-img {
    animation: sign-remote-phone-tilt 2.4s ease-in-out infinite;
}
@keyframes sign-remote-phone-tilt {
    0%, 18% {
        transform: rotate(0deg);
    }
    32%, 68% {
        transform: rotate(90deg);
    }
    82%, 100% {
        transform: rotate(0deg);
    }
}
@media (prefers-reduced-motion: reduce) {
    .sign-remote-rotate-hint,
    .sign-remote-rotate-icon-wrap {
        animation: none;
    }
    .sign-remote-rotate-img {
        animation: none !important;
    }
}
@media (min-width: 1024px) and (pointer: fine) {
    .sign-remote-rotate-hint {
        display: none !important;
    }
}
.sign-remote-step1-complete {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: 0.75rem 0 0.35rem;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: #ecfdf5;
    color: #166534;
    font-size: 0.9rem;
    font-weight: 600;
}
.sign-remote-step1-complete.is-visible {
    display: flex;
}
.sign-remote-step1-complete[hidden] {
    display: none !important;
}
.sign-remote-pdf-gate-pickup {
    border-color: #d97706;
    background: linear-gradient(165deg, #fffbeb 0%, #fef3c7 55%, #fde68a 100%);
    box-shadow: 0 8px 24px rgba(217, 119, 6, 0.16);
}
.sign-remote-pdf-gate-pickup .sign-remote-pdf-gate-title {
    color: #92400e;
}
.sign-remote-pdf-gate-pickup.is-done {
    border-color: #16a34a;
    background: linear-gradient(165deg, #f0fdf4 0%, #dcfce7 55%, #bbf7d0 100%);
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.15);
}
.sign-remote-pickup-summary {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.sign-remote-pickup-summary h4 {
    margin: 0 0 0.55rem;
    font-size: 0.92rem;
    color: #0f172a;
}
.sign-remote-pickup-summary dl {
    display: grid;
    grid-template-columns: minmax(7rem, 38%) 1fr;
    gap: 0.35rem 0.65rem;
    margin: 0;
    font-size: 0.86rem;
}
.sign-remote-pickup-summary dt {
    color: #64748b;
    font-weight: 600;
}
.sign-remote-pickup-summary dd {
    margin: 0;
    color: #0f172a;
}

.sign-remote-delegato-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
}
.sign-remote-delegato-mode-btn {
    flex: 1 1 9rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.sign-remote-delegato-mode-btn.is-active {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}
.sign-remote-delegato-fields {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}
.sign-remote-delegato-hint {
    margin: 0 0 0.65rem;
    font-size: 0.88rem;
    color: #64748b;
}
.modal-lab-sign-flow {
    position: fixed;
    inset: 0;
    z-index: 10500;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top, 12px)) 12px max(16px, env(safe-area-inset-bottom, 16px));
    background: rgba(15, 23, 42, 0.55);
    overflow-y: auto;
}
.modal-lab-sign-flow.is-open {
    display: flex !important;
}
.modal-lab-sign-flow-inner {
    position: relative;
    width: min(100%, 720px);
    margin: 0 auto;
}
.modal-lab-sign-flow-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}
.sign-remote-wizard-lab {
    margin-top: 0.25rem;
}
.sign-remote-step1-complete-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    min-width: 1.375rem;
    min-height: 1.375rem;
    aspect-ratio: 1 / 1;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 50%;
    box-sizing: border-box;
    line-height: 1;
    font-size: 0.75rem;
    font-weight: 700;
    vertical-align: middle;
    background: #16a34a;
    color: #fff;
    -webkit-text-size-adjust: 100%;
}
.sign-remote-step1-complete {
    flex-wrap: nowrap;
}
.sign-remote-step1-complete > span:not(.sign-remote-step1-complete-icon) {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}
.sign-remote-btn-step1-continue {
    width: 100%;
    margin-top: 0.85rem;
    font-weight: 600;
}
.sign-remote-btn-step1-continue:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.modal-pdf-viewport {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #525659;
    touch-action: none;
}
.modal-pdf-viewport iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #525659;
}
.modal-pdf-review-wizard .modal-pdf-viewport {
    flex: 1 1 auto;
}
.modal-pdf-review-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: center;
    padding: max(10px, env(safe-area-inset-bottom, 10px)) 12px max(14px, env(safe-area-inset-bottom, 14px));
    background: rgba(15, 23, 42, 0.92);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-pdf-review-footer .btn {
    min-width: min(100%, 200px);
    font-weight: 600;
}
.modal-pdf-review-footer .modal-pdf-share-btn,
.modal-pdf-review-footer .modal-pdf-download-btn {
    min-width: min(100%, 168px);
}
.modal-pdf-genera-overlay .modal-pdf-review-footer {
    position: relative;
    z-index: 5;
    flex-shrink: 0;
}
.modal-pdf-review-footer .btn.btn-whatsapp {
    background: #059669 !important;
    border-color: #047857 !important;
    color: #fff !important;
}
.modal-pdf-review-btn-ok {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #fff !important;
}
.modal-pdf-review-footer .btn.modal-pdf-confirm-blink,
.modal-pdf-review-btn-ok.modal-pdf-confirm-blink {
    background: #dc2626 !important;
    border: 2px solid #b91c1c !important;
    color: #fff !important;
    opacity: 1 !important;
    animation: modal-pdf-confirm-blink-kf 0.75s ease-in-out infinite !important;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55);
}
@keyframes modal-pdf-confirm-blink-kf {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55);
        filter: brightness(1);
    }
    50% {
        opacity: 0.72;
        transform: scale(1.03);
        box-shadow: 0 0 14px 4px rgba(220, 38, 38, 0.65);
        filter: brightness(1.15);
    }
}
.modal-pdf-review-btn-ok.sign-remote-action-gate.is-pending,
.modal-pdf-review-btn-ok.modal-pdf-confirm-blink.sign-remote-action-gate.is-pending {
    background: linear-gradient(165deg, #fef2f2 0%, #fee2e2 50%, #fecaca 100%) !important;
    border: 2px solid #dc2626 !important;
    color: #991b1b !important;
}
.modal-pdf-review-btn-ok.sign-remote-action-gate.is-done,
.modal-pdf-review-btn-ok.modal-pdf-confirm-done {
    background: linear-gradient(165deg, #f0fdf4 0%, #dcfce7 55%, #bbf7d0 100%) !important;
    border: 2px solid #16a34a !important;
    color: #166534 !important;
    animation: none !important;
}
.modal-pdf-scheda-overlay.pdf-review-dimmed iframe,
.modal-pdf-scheda-overlay.pdf-review-dimmed .modal-pdf-scheda-close-wrap,
.modal-pdf-scheda-overlay.pdf-review-dimmed .modal-pdf-review-footer {
    filter: brightness(0.55);
    pointer-events: none;
}
.sign-remote-anag-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top, 12px)) 12px max(16px, env(safe-area-inset-bottom, 16px));
    background: rgba(15, 23, 42, 0.45);
    overflow-y: auto;
}
.sign-remote-anag-sheet {
    width: min(100%, 520px);
    margin: auto 0;
    padding: 1rem 1rem 1.1rem;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.sign-remote-anag-sheet h3 {
    margin: 0 0 0.35rem;
    font-size: 1.02rem;
    color: #0f172a;
}
.sign-remote-anag-lead {
    margin: 0 0 0.75rem;
    font-size: 0.86rem;
    color: #475569;
    line-height: 1.4;
}
.sign-remote-anag-grid {
    margin-bottom: 0.65rem;
}
.sign-remote-anag-sheet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: flex-end;
}
.btn-view-pdf-scheda {
    width: 100%;
    max-width: 100%;
    font-weight: 600;
}
.modal-pdf-scheda-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    background: #0f172a;
    display: none;
    flex-direction: column;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    zoom: 1;
}
body.drdex-pdf-modal-open .modal-pdf-scheda-close-wrap,
body.drdex-pdf-modal-open .modal-pdf-review-footer {
    transform: none;
}
.modal-pdf-review-wizard {
    position: fixed;
}
.modal-pdf-review-wizard .sign-remote-anag-overlay {
    position: absolute;
}
.modal-pdf-scheda-close-wrap {
    position: absolute;
    top: max(12px, env(safe-area-inset-top, 12px));
    right: max(12px, env(safe-area-inset-right, 12px));
    z-index: 2;
}
.modal-pdf-scheda-overlay > .modal-pdf-viewport {
    flex: 1 1 auto;
    min-height: 0;
}
.modal-pdf-scheda-overlay iframe {
    border: 0;
}
@media (orientation: landscape) and (max-height: 520px) {
    .modal-pdf-scheda-overlay {
        height: 100dvh;
        max-height: 100dvh;
    }
    .modal-pdf-scheda-overlay .modal-pdf-viewport {
        flex: 1 1 auto;
        min-height: 0;
    }
    .modal-pdf-review-footer {
        flex-shrink: 0;
        padding-top: 6px;
        padding-bottom: max(6px, env(safe-area-inset-bottom, 6px));
    }
    .modal-pdf-review-footer .btn {
        min-width: min(48%, 200px);
        padding-top: 0.55rem;
        padding-bottom: 0.55rem;
    }
}
body.drdex-modal-open {
    overflow: hidden;
    /* Non usare touch-action:none sul body: su iPad può far apparire la tastiera fluttuante piccola */
}
/* Riquadro firma: pagina sotto non cliccabile; modal sempre visibile (anche se dentro main) */
body.drdex-sign-modal-open header,
body.drdex-sign-modal-open footer,
body.drdex-sign-modal-open .drdex-client-public-header,
body.drdex-sign-modal-open .drdex-client-public-footer {
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
}
body.drdex-sign-modal-open main {
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
}
body.drdex-sign-modal-open .modal-firma-overlay-sign {
    pointer-events: auto !important;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
body.drdex-sign-modal-open .modal-firma-overlay-sign .modal-firma-box-sign,
body.drdex-sign-modal-open .modal-firma-overlay-sign .signature-wrapper-line,
body.drdex-sign-modal-open .modal-firma-overlay-sign .signature-pad,
body.drdex-sign-modal-open .modal-firma-overlay-sign .signature-pad canvas,
body.drdex-sign-modal-open .modal-firma-overlay-sign .modal-firma-actions,
body.drdex-sign-modal-open .modal-firma-overlay-sign .sign-fab {
    pointer-events: auto !important;
}
body.drdex-sign-modal-open .modal-firma-overlay-sign .signature-pad,
body.drdex-sign-modal-open .modal-firma-overlay-sign .signature-pad canvas {
    touch-action: none;
}
body.drdex-sign-modal-open .modal-firma-overlay-sign .sign-fab {
    touch-action: manipulation;
}
body.drdex-sign-modal-open .modal-firma-overlay-sign .modal-firma-hint,
body.drdex-sign-modal-open .modal-firma-overlay-sign h3,
body.drdex-sign-modal-open .modal-firma-overlay-sign .signature-line-guide {
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}
/* Linea continua a 62%; freccia sottile all'inizio riga */
.signature-line-guide {
    position: absolute;
    left: 7%;
    right: 7%;
    top: 62%;
    height: 0;
    overflow: visible;
    pointer-events: none;
    z-index: 5;
}
.modal-firma-overlay-sign .signature-wrapper-line {
    overflow: visible;
}
.modal-firma-overlay-sign .signature-line-guide {
    z-index: 6;
}
.signature-line-full {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 0;
    border-top: 1px solid rgba(30, 41, 59, 0.55);
}
.signature-line-arrow {
    position: absolute;
    left: 0;
    top: 0;
    width: 36px;
    height: 36px;
    margin: 0;
    transform: translate(-2px, calc(-100% - 10px));
    z-index: 6;
    overflow: visible;
    animation: signature-line-arrow-blink 0.9s ease-in-out infinite;
}
.signature-line-arrow-stroke {
    fill: none;
    stroke: #dc2626;
    stroke-width: 1.35;
    stroke-linecap: round;
    stroke-linejoin: round;
}
@keyframes signature-line-arrow-blink {
    0%, 100% {
        opacity: 0.35;
    }
    50% {
        opacity: 1;
    }
}
@media (prefers-reduced-motion: reduce) {
    .signature-line-arrow {
        animation: none;
        opacity: 0.85;
    }
}
@media (orientation: landscape), (min-width: 641px) {
    .signature-wrapper-line .signature-line-guide {
        top: 72%;
    }
}
.signature-pad-line {
    background: #fff;
    border: 1px solid #e5e7eb;
    position: relative;
    z-index: 2;
}
.signature-pad-line::before {
    content: '';
    top: 62%;
    left: 50%;
    bottom: auto;
    transform: translate(-50%, 2px);
    color: rgba(100, 116, 139, 0.56);
    font-size: 0.86rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    z-index: 5;
    opacity: 0;
}

/* Firma su smartphone in landscape: evita overflow e pulsanti fuori pagina */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        padding-top: 0.7rem;
        padding-bottom: 0.7rem;
    }
    .card {
        padding: 0.85rem;
    }
    .signature-wrapper-line,
    .remote-signature-wrap {
        height: min(56vh, 210px);
        min-height: 168px;
        margin-bottom: 0.45rem;
    }
    .modal-firma-overlay-sign .modal-firma-box-sign {
        max-height: 98vh;
        width: min(94vw, 820px);
        padding: 0.7rem 0.95rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
    }
    .signature-line-guide {
        top: 70%;
    }
    .signature-pad-line::before {
        top: 70%;
        transform: translate(-50%, 1px);
    }
    .modal-firma-actions.sign-fab-actions {
        margin-top: 0.2rem !important;
        padding-top: 0.45rem;
    }
    .sign-fab-sm {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
    .sign-fab-lg {
        width: 54px;
        height: 54px;
        font-size: 1.55rem;
    }
    .termini-container {
        max-height: 94px;
    }
}
.btn-sign-emoji {
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 999px;
}
.btn-sign-emoji-accept {
    background: #16a34a;
    color: #fff;
}
.btn-sign-emoji-pickup {
    background: #dc2626;
    color: #fff;
}

/* Termini */
.termini-container {
    max-height: 160px;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    line-height: 1.48;
    -webkit-overflow-scrolling: touch;
}
.termini-container.termini-container-wizard {
    max-height: min(52vh, 380px);
    font-size: 0.88rem;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}
.termini-container .termini-section-title {
    display: block;
    margin-top: 0.65rem;
    margin-bottom: 0.15rem;
}
.sign-remote-wizard {
    margin-top: 0.25rem;
}
.sign-remote-steps {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.35rem;
    margin: 0 0 1.15rem;
    padding: 0;
    list-style: none;
}
.sign-remote-step {
    flex: 1;
    text-align: center;
    position: relative;
    min-width: 0;
}
.sign-remote-step::after {
    content: '';
    position: absolute;
    top: 17px;
    left: calc(50% + 18px);
    right: calc(-50% + 18px);
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}
.sign-remote-step:last-child::after {
    display: none;
}
.sign-remote-step.is-done::after {
    background: #86efac;
}
.sign-remote-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 0.82rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #64748b;
    position: relative;
    z-index: 1;
    margin-bottom: 0.35rem;
}
.sign-remote-step.is-active .sign-remote-step-num {
    background: #1d4ed8;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.2);
}
.sign-remote-step.is-done .sign-remote-step-num {
    background: #16a34a;
    color: #fff;
}
.sign-remote-step-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.25;
    padding: 0 0.15rem;
}
.sign-remote-step.is-active .sign-remote-step-label {
    color: #0f172a;
}
.sign-remote-panel {
    display: none;
}
.sign-remote-panel.is-active {
    display: block;
}
.sign-remote-panel-title {
    font-size: 1.02rem;
    font-weight: 700;
    margin: 0 0 0.45rem;
    color: #0f172a;
}
.sign-remote-panel-lead {
    margin: 0 0 0.85rem;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.45;
}
.sign-remote-anagrafica-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    margin: 0.85rem 0 0;
}
.sign-remote-btn-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: #16a34a;
    color: #fff;
    font-size: 1.55rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
    flex-shrink: 0;
}
.sign-remote-btn-confirm:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}
.sign-remote-btn-confirm:not(:disabled):active {
    transform: scale(0.96);
}
.sign-remote-confirm-hint {
    font-size: 0.85rem;
    color: #475569;
    flex: 1;
    min-width: 10rem;
}
.sign-remote-field[readonly] {
    background: #f8fafc;
    pointer-events: none;
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
}
.sign-remote-field.is-editing,
.sign-remote-field:not([readonly]) {
    background: #fff;
    pointer-events: auto;
    -webkit-user-select: text;
    user-select: text;
    font-size: 16px;
    min-height: 48px;
}
.sign-remote-step-nav {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    align-items: stretch;
}
.sign-remote-btn-back {
    align-self: flex-start;
    font-weight: 600;
}
.sign-remote-btn-step2:disabled {
    background: #e2e8f0 !important;
    color: #94a3b8 !important;
    border-color: #e2e8f0 !important;
    opacity: 1;
    cursor: not-allowed;
    box-shadow: none;
}
.sign-remote-btn-step2.is-ready:not(:disabled) {
    background: var(--primary, #1d4ed8);
    color: #fff;
}
.sign-remote-edit-fab-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.sign-remote-edit-fab-row[hidden],
.sign-remote-btn-confirm[hidden] {
    display: none !important;
}
.sign-remote-terms-check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.88rem;
    color: #334155;
    margin-top: 0.75rem;
    cursor: pointer;
}
.sign-remote-terms-check input {
    margin-top: 0.2rem;
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}
.termini-letti { display: flex; align-items: center; gap: 0.5rem; margin: 1rem 0; }
.termini-letti input { width: 18px; height: 18px; }

/* Alert */
.alert { padding: 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #d1fae5; color: #065f46; }
.field-error { color: #dc3545; font-size: 0.8rem; margin-top: 0.25rem; }

/* Badge, totale */
.totale-box { display: flex; gap: 2rem; margin-top: 1rem; padding: 1rem; background: #f8f9fa; border-radius: var(--radius-sm); }

/* Margine netto riparazione */
.card-margine-netto { margin-top: 0.5rem; }
.drdex-margine-hint { font-size: 0.88rem; color: #64748b; margin: 0 0 1rem; line-height: 1.45; }
.drdex-margine-inputs .field-hint { display: block; font-size: 0.8rem; color: #94a3b8; margin-top: 0.35rem; }
.drdex-margine-preview {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-sm);
}
.drdex-margine-preview--neg {
    background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
    border-color: #fecaca;
}
.drdex-margine-preview-title { font-weight: 600; margin-bottom: 0.65rem; color: #166534; }
.drdex-margine-preview--neg .drdex-margine-preview-title { color: #991b1b; }
.drdex-margine-dl {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem 1.25rem;
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
}
.drdex-margine-dl dt { color: #475569; margin: 0; }
.drdex-margine-dl dd { margin: 0; font-weight: 500; text-align: right; }
.drdex-margine-result { margin: 0; font-size: 1.05rem; }
.drdex-margine-ok { color: #15803d; }
.drdex-margine-neg { color: #b91c1c; }
.drdex-margine-zero { color: #64748b; }
.drdex-margine-view-box {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0;
}
.badge { padding: 0.2rem 0.5rem; font-size: 0.75rem; border-radius: 4px; }
.badge-bozza { background: rgba(148, 163, 184, 0.22); color: #64748b; }
.badge-da_ordinare { background: rgba(255, 225, 25, 0.35); color: #6b5f00; font-weight: 600; }
.badge-in_attesa_ricambio { background: rgba(66, 212, 244, 0.22); color: #0a6f8a; font-weight: 600; }
.badge-da_riparare { background: rgba(230, 25, 75, 0.16); color: #E6194B; font-weight: 600; }
.badge-fare_preventivo { background: rgba(145, 30, 180, 0.18); color: #911EB4; font-weight: 600; }
.badge-in_attesa_cliente { background: rgba(245, 130, 49, 0.22); color: #F58231; font-weight: 600; }
.badge-da_ritirare { background: rgba(67, 99, 216, 0.16); color: #4363D8; font-weight: 600; }
.badge-completati,
.badge-completata { background: rgba(60, 180, 75, 0.2); color: #3CB44B; font-weight: 600; }
.badge-annullata { background: rgba(169, 169, 169, 0.35); color: #5a5a5a; font-weight: 600; }
.badge-accettata { background: rgba(245, 130, 49, 0.18); color: #F58231; font-weight: 600; }
.badge-ritirata { background: rgba(60, 180, 75, 0.15); color: #2d8f38; font-weight: 600; }
.badge-in_attesa_dispositivo { background: rgba(66, 212, 244, 0.18); color: #0a6f8a; font-weight: 600; }
.badge-ricambi_da_ordinare { background: rgba(66, 212, 244, 0.18); color: #0a6f8a; font-weight: 600; }
.badge-in_lavorazione { background: rgba(67, 99, 216, 0.12); color: #4363D8; font-weight: 600; }
.table-wrap tbody tr.stato-da_ordinare td { background: rgba(255, 225, 25, 0.22) !important; }
.table-wrap tbody tr.stato-in_attesa_ricambio td { background: rgba(66, 212, 244, 0.14) !important; }
.table-wrap tbody tr.stato-da_riparare td { background: rgba(230, 25, 75, 0.1) !important; }
.table-wrap tbody tr.stato-fare_preventivo td { background: rgba(145, 30, 180, 0.12) !important; }
.table-wrap tbody tr.stato-in_attesa_cliente td { background: rgba(245, 130, 49, 0.16) !important; }
.table-wrap tbody tr.stato-da_ritirare td { background: rgba(67, 99, 216, 0.12) !important; }
.table-wrap tbody tr.stato-completati td,
.table-wrap tbody tr.stato-completata td { background: rgba(60, 180, 75, 0.14) !important; }

/* Stato: menù personalizzato (colori visibili anche a tendina aperta) */
select.status-color-select { font-weight: 700; }
.status-color-select-shell {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
}
.status-color-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.status-color-select-trigger {
  display: inline-flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.35rem;
  padding: 0.45rem 0.75rem !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: var(--radius-sm) !important;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.15s ease, filter 0.15s ease;
}
.status-color-select-trigger::after {
  content: '▾';
  flex-shrink: 0;
  font-size: 0.75rem;
  opacity: 0.65;
  line-height: 1;
}
.status-color-select-shell.is-open .status-color-select-trigger {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}
.status-color-select-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 100;
  max-height: min(320px, 70vh);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}
.status-color-select-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.85rem;
  border: none;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.35;
}
.status-color-select-option:last-child {
  border-bottom: none;
}
.status-color-select-option:hover:not(:disabled) {
  filter: brightness(0.97);
}
.status-color-select-option:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.table-wrap tbody tr.stato-annullata td { background: rgba(169, 169, 169, 0.22) !important; }
.table-wrap tbody tr.stato-accettata td { background: rgba(245, 130, 49, 0.12) !important; }
.table-wrap tbody tr.stato-completata td { background: rgba(60, 180, 75, 0.12) !important; }
.table-wrap tbody tr.stato-ritirata td { background: rgba(60, 180, 75, 0.1) !important; }
.table-wrap tbody tr.stato-in_attesa_dispositivo td { background: rgba(66, 212, 244, 0.12) !important; }
.table-wrap tbody tr.stato-ricambi_da_ordinare td { background: rgba(66, 212, 244, 0.12) !important; }
.note-apple-style, .card-note textarea { background: #fffef5; border-color: #f5e6b3; }
.card-note { background: linear-gradient(to bottom, #fffef8, #fffef0); border-left-color: #f0c674; }
.col-rimuovi { width: 40px; }
.btn-rimuovi-row { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 4px; width: 28px; height: 28px; cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 0; }
.btn-rimuovi-row:hover { background: #fecaca; }
.wrap-text { word-wrap: break-word; overflow-wrap: break-word; word-break: break-word; white-space: pre-wrap; max-width: 100%; }
/* Ensure riparazioni_precedenti and note wrap in view */
.riparazioni-precedenti, .note-wrap { word-break: break-word; overflow-wrap: break-word; }

/* Home dashboard */
.home-dashboard { padding: 0.5rem 0; width: 100%; min-width: 0; }
.home-grid-hint {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: #64748b;
  text-align: center;
}
.home-grid-reorder-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e40af;
}
.home-grid-reorder-bar[hidden] {
  display: none !important;
}
body.home-grid-reorder-active .home-grid-hint {
  display: none;
}
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 158px), 1fr));
    gap: 1rem;
    width: 100%;
    min-width: 0;
}
.home-grid--reorder-mode {
  gap: 1.05rem;
}
.home-grid--reorder-mode .home-card-tile {
  animation: home-tile-wiggle 0.22s ease-in-out infinite alternate;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  transition: box-shadow 0.15s ease, transform 0.12s ease;
}
.home-grid--reorder-mode .home-card-tile:hover {
  transform: none;
}
@keyframes home-tile-wiggle {
  0% {
    transform: rotate(-1.4deg) scale(1);
  }
  100% {
    transform: rotate(1.4deg) scale(1);
  }
}
.home-grid--reorder-mode .home-card-tile.is-dragging {
  animation: none;
  transform: scale(1.07) rotate(0deg) !important;
  z-index: 50;
  cursor: grabbing;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.28);
  opacity: 0.96;
}
.home-card {
    display: block;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
}
.home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
}
.home-card-tile {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 0.85rem;
  min-height: 0;
}
.home-card-tile--repair {
  background: linear-gradient(135deg, rgba(57, 255, 20, 0.14), #fff);
}
.home-card-tile--links {
  background: linear-gradient(145deg, rgba(147, 51, 234, 0.13), #fff);
}
.home-card-tile--cassa {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.16), #fff);
}
.home-card-tile--list {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.13), #fff);
}
.home-card-tile--clients {
  background: linear-gradient(145deg, rgba(244, 114, 182, 0.14), #fff);
}
.home-card-tile--stock {
  background: linear-gradient(145deg, rgba(20, 184, 166, 0.14), #fff);
}
.home-card-tile--report {
  background: linear-gradient(145deg, rgba(2, 132, 199, 0.15), #fff);
}
.home-card-tile--gsx {
  background: linear-gradient(145deg, rgba(55, 65, 81, 0.12), #fff);
}
.home-card-tile--gsx .home-card-icon::before {
  content: '';
  display: block;
  width: 2.4rem;
  height: 2.4rem;
  margin: 0 auto 0.35rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512' fill='%23111827'%3E%3Cpath d='M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.9 107.2 125.2 25-.3 43-16.9 75.8-16.9 31.8 0 48.3 16.9 76.4 16.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.apple-gsx-causale-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  min-width: 12rem;
}
.apple-gsx-causale-wrap .gsx-causale-field {
  flex: 1 1 10rem;
  min-width: 0;
  font-size: 0.78rem;
}
.apple-gsx-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.apple-gsx-panel {
  margin-top: 1rem;
  border-radius: var(--radius);
}
.apple-gsx-panel-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}
.apple-gsx-panel--ordine {
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.07), #fff);
  border: 1px solid #e2e8f0;
  border-left: 4px solid #6366f1;
}
.apple-gsx-panel--email {
  background: linear-gradient(145deg, rgba(13, 148, 136, 0.06), #fff);
  border: 1px solid #e2e8f0;
  border-left: 4px solid #0d9488;
}
.apple-gsx-email-slot {
  margin-top: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
}
.apple-gsx-panel--email-a {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.apple-gsx-panel--email-b {
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
}
.apple-gsx-email-slot-title {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #334155;
}
.apple-gsx-field-block {
  margin-bottom: 0.75rem;
}
.apple-gsx-field-block:last-child {
  margin-bottom: 0;
}
.apple-gsx-field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.3rem;
}
.apple-gsx-copy-block {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}
.apple-gsx-copy-field {
  flex: 1 1 280px;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.4;
}
.apple-gsx-copy-field--single {
  flex: 1 1 100%;
}
.apple-gsx-lines-table input { font-size: 0.9rem; }
.apple-gsx-delete-form { margin-top: 1.5rem; }
.apple-gsx-workflow {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
}
.apple-gsx-panel--bonifico { border-left: 4px solid #f59e0b; }
.apple-gsx-panel--excel { border-left: 4px solid #10b981; }
.apple-gsx-panel--email { border-left: 4px solid #3b82f6; }
.apple-gsx-email-shared { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #e2e8f0; }
.apple-gsx-email-recipients { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.repair-status-focus {
  border: 2px solid #ef4444;
  animation: repair-status-focus-blink 1s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35);
}
.repair-status-focus--ordinare { background: linear-gradient(165deg, #fff5f5 0%, #fff 55%); }
.repair-status-focus--riparare { background: linear-gradient(165deg, #fff7ed 0%, #fff 55%); }
.repair-status-focus h2 { margin-top: 0; color: #b91c1c; }
.repair-status-focus-dl { display: grid; grid-template-columns: minmax(8rem, auto) 1fr; gap: 0.45rem 1rem; margin: 0; }
.repair-status-focus-dl dt { font-weight: 600; color: #991b1b; margin: 0; }
.repair-status-focus-dl dd { margin: 0; }
.repair-status-focus-list { margin: 0; padding-left: 1.1rem; }
@keyframes repair-status-focus-blink {
  0%, 100% { border-color: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
  50% { border-color: #fca5a5; box-shadow: 0 0 12px 2px rgba(239, 68, 68, 0.35); }
}
.repair-gsx-linked-list { margin: 0; padding-left: 1.1rem; }
.repair-gsx-linked-list a { font-weight: 600; }
.repair-garanzia-wrap--blink {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 2px solid #ef4444;
  animation: repair-status-focus-blink 1s ease-in-out infinite;
  background: #fffbeb;
}
.repair-garanzia-wrap--blink select { font-weight: 600; }
.repair-warranty-status-box { padding: 0.85rem 1rem; border-radius: 10px; border: 1px solid #e2e8f0; background: #f8fafc; }
.repair-warranty-status--ok { border-color: #86efac; background: #ecfdf5; }
.repair-warranty-status--expired { border-color: #fca5a5; background: #fef2f2; }
.repair-warranty-status--warn { border-color: #fde68a; background: #fffbeb; }
.repair-warranty-hint { font-size: 0.88rem; color: #b45309; margin: 0.5rem 0 0; }
.repair-gsx-edit-card { margin-top: 1.25rem; }
.repair-gsx-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.repair-gsx-tab { flex: 1; padding: 0.45rem 0.6rem; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; cursor: pointer; font-size: 0.9rem; }
.repair-gsx-tab.is-active { background: #eff6ff; border-color: #3b82f6; font-weight: 600; }

/* GSX — tendina scheda riparazione */
.repair-gsx-collapsible {
    padding: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.repair-gsx-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: none;
    background: linear-gradient(180deg, #fafafa 0%, #f4f4f5 100%);
    cursor: pointer;
    text-align: left;
    font: inherit;
}
.repair-gsx-trigger:hover { background: #f4f4f5; }
.repair-gsx-trigger:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}
.repair-gsx-collapsible.is-open .repair-gsx-trigger {
    border-bottom: 1px solid #e2e8f0;
}
.repair-gsx-trigger-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}
.repair-gsx-trigger-icon { flex-shrink: 0; }
.repair-gsx-trigger-text { min-width: 0; }
.repair-gsx-trigger-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    font-size: 0.98rem;
    color: #0f172a;
}
.repair-gsx-trigger-sub {
    display: block;
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.repair-gsx-trigger-chevron {
    flex-shrink: 0;
    color: #64748b;
    transition: transform 0.2s ease;
}
.repair-gsx-collapsible.is-open .repair-gsx-trigger-chevron,
.repair-gsx-trigger.is-open .repair-gsx-trigger-chevron {
    transform: rotate(180deg);
}
.repair-gsx-panel-inner {
    padding: 1rem 1rem 1.15rem;
}
.repair-gsx-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.repair-gsx-united-title {
    margin: 0 0 0.35rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #5b21b6;
}
.form-grid--gsx { margin-bottom: 0.75rem; }

/* GSX — email unificata */
.apple-gsx-email-card {
    margin-top: 1.25rem;
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid #bfdbfe;
    background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
}
.apple-gsx-email-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.apple-gsx-email-card-title {
    margin: 0;
    font-size: 1rem;
    color: #1e3a8a;
}
.apple-gsx-email-card-total {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
}
.apple-gsx-email-card-hint {
    margin: 0 0 1rem;
    font-size: 0.82rem;
    color: #64748b;
}
.apple-gsx-email-field { margin-bottom: 0.85rem; }
.apple-gsx-email-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    margin-bottom: 0.35rem;
}
.apple-gsx-copy-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}
.apple-gsx-copy-row--stack { flex-direction: column; align-items: stretch; }
.apple-gsx-copy-row .apple-gsx-copy-field { flex: 1; min-width: 0; }
.apple-gsx-email-recipients {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #cbd5e1;
}
.apple-gsx-email-recipients-title {
    margin: 0 0 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}
.apple-gsx-email-recipients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
}

/* GSX — pagina elenco ordini */
.apple-gsx-page { max-width: 100%; }
.apple-gsx-page-title { margin: 0 0 0.2rem; font-size: 1.35rem; }
.apple-gsx-page-sub { margin: 0; font-size: 0.88rem; color: #64748b; }
.apple-gsx-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.apple-gsx-list-card { padding: 0; overflow: hidden; }
.apple-gsx-list-card .table-wrap { margin: 0; }
.apple-gsx-unite-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    background: #fdf2f8;
    border: 1px solid #f9a8d4;
}
.apple-gsx-unite-count { font-weight: 600; font-size: 0.9rem; }
.apple-gsx-empty { padding: 1.5rem !important; text-align: center; color: #64748b; }
tbody tr.apple-gsx-row-nav { cursor: pointer; }
tbody tr.apple-gsx-row-nav:hover td { filter: brightness(0.97); }
tbody tr.apple-gsx-row-nav .azioni-cell { cursor: default; }
.apple-gsx-row-order { font-weight: 700; }
.apple-gsx-file-icons span {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: #ecfdf5;
    color: #047857;
    margin-right: 0.25rem;
}
.repair-gsx-link-bar { margin-bottom: 0.85rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.apple-gsx-link-scheda { display: block; font-size: 0.82rem; color: #64748b; margin-top: 0.1rem; }

.repairs-gsx-filter-btn {
    font-weight: 800;
    border: 2px solid var(--gsx-filter-color, #D81B60);
    color: var(--gsx-filter-color, #D81B60);
    background: #fff;
    letter-spacing: 0.04em;
}
.repairs-gsx-filter-btn.is-active {
    background: var(--gsx-filter-color, #D81B60);
    color: #fff;
}
.repairs-gsx-unite-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    background: #fdf2f8;
    border: 1px solid #f9a8d4;
}
.repairs-gsx-check-col {
    width: 2rem;
    text-align: center;
}
.repair-gsx-badge,
.repair-gsx-union-badge {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 0.35rem;
}
.repair-gsx-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.repair-gsx-panel-head h2 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
}
.repair-gsx-panel-logo { display: inline-flex; }
.repair-gsx-united-info {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #f5f3ff;
    border: 1px solid #c4b5fd;
}
.repair-gsx-united-num {
    color: #64748b;
    font-size: 0.85rem;
}
.repair-row--gsx .repair-scheda-link { margin-right: 0.15rem; }
.repair-view-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}
.apple-gsx-stock-label {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #9d174d;
    background: #fce7f3;
    border: 1px solid #f9a8d4;
    border-radius: 6px;
    padding: 0.15rem 0.45rem;
}
.apple-gsx-row--united td:first-child + td {
    /* badge spacing */
}
.interventi-view-cliente { width: 100%; border-collapse: collapse; }
.interventi-view-cliente th,
.interventi-view-cliente td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}
.totale-box--cliente {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}
.home-card-tile .home-card-icon { margin-bottom: 0.5rem; }
.home-card-tile h3 { font-size: 1rem; margin-bottom: 0.2rem; line-height: 1.25; }
.home-card-tile p { font-size: 0.82rem; line-height: 1.25; margin: 0; }
button.home-card {
  font: inherit;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}
button.home-card:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.home-logo-row {
  display: flex;
  justify-content: center;
  margin: 0.25rem 0 1rem;
}
.home-logo-img {
  max-width: min(78vw, 460px);
  max-height: 132px;
  width: auto;
  height: auto;
}
.home-calendar-card {
  border: none;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
  margin-bottom: 1.25rem;
}
.home-calendar-head { margin-bottom: 0.35rem; }
.home-calendar-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0 0 0.65rem;
  line-height: 1.4;
}
.home-cal-toolbar {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}
.home-cal-period {
  font-size: 0.92rem;
  color: #475569;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.home-cal-today-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: #1d4ed8;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  margin-bottom: 0.5rem;
}
.home-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}
.home-cal-weekdays--1 { grid-template-columns: 1fr; }
.home-cal-weekday {
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  color: #64748b;
}
.home-cal-grid-month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.45rem;
}
.home-cal-grid-week {
  display: grid;
  gap: 0.45rem;
}
.home-cal-grid-week--1 { grid-template-columns: 1fr; }
.home-cal-grid-week--7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.home-cal-month-scroll {
  width: 100%;
  min-width: 0;
}
.home-cal-month-scroll-inner {
  width: 100%;
  min-width: 0;
}
.home-cal-cell {
  border: none;
  border-radius: 12px;
  padding: 0.45rem;
  min-height: 72px;
}
.home-cal-cell-empty {
  min-height: 48px;
  border: none;
  background: transparent;
}
.home-cal-cell--pickable {
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(37, 99, 235, 0.12);
  touch-action: manipulation;
}
.home-cal-cell--pickable:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.home-cal-cell--today {
  animation: home-cal-today-blink 1.15s ease-in-out infinite;
}
@keyframes home-cal-today-blink {
  0%,
  100% {
    box-shadow: inset 0 0 0 2px rgba(220, 38, 38, 0.75);
  }
  50% {
    box-shadow: inset 0 0 0 3px rgba(220, 38, 38, 1);
  }
}
.home-cal-today-tag {
  display: inline-block;
  margin-left: 0.2rem;
  font-size: 0.62rem;
  font-weight: 800;
  color: #dc2626;
  vertical-align: middle;
}
.home-cal-cell-dow {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.15rem;
}
.home-cal-daynum {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #0f172a;
}
.home-cal-daynum--week { font-size: 0.78rem; color: #334155; }
.home-ap-chip {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.32rem 0.38rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  text-decoration: none;
  color: #1e3a8a;
  margin-bottom: 0.28rem;
  font-size: 0.72rem;
  line-height: 1.25;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}
.home-ap-chip:hover {
  background: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}
.home-ap-time {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.home-ap-text {
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}

.home-cal-modal {
  position: fixed;
  inset: 0;
  z-index: 9600;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.75rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}
.home-cal-modal[hidden] {
  display: none !important;
}
.home-cal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.home-cal-modal-box {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  max-height: min(92vh, 640px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.22);
}
body.home-cal-modal-open {
  overflow: hidden;
}
.home-cal-modal-title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}
.home-cal-modal-date {
  margin: 0 0 0.85rem;
  font-weight: 700;
  color: #dc2626;
  font-size: 0.95rem;
}
.home-cal-modal-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 16px;
}
.home-cal-repair-results {
  margin-top: 0.45rem;
  max-height: 11rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  background: #f8fafc;
}
.home-cal-repair-pick {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border: none;
  border-bottom: 1px solid #e2e8f0;
  background: transparent;
  font-size: 0.86rem;
  cursor: pointer;
  touch-action: manipulation;
}
.home-cal-repair-pick:last-child {
  border-bottom: none;
}
.home-cal-repair-pick:active,
.home-cal-repair-pick:hover {
  background: #e0e7ff;
}
.home-cal-repair-pick-sub {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.15rem;
}
.home-cal-repair-empty {
  margin: 0;
  padding: 0.65rem;
  font-size: 0.85rem;
  color: #64748b;
}
.home-cal-repair-selected {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1d4ed8;
}
.home-cal-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.home-cal-toolbar .btn-sm {
  min-height: 2.35rem;
  touch-action: manipulation;
}

/* Home calendario: iPhone / schermi stretti */
@media (max-width: 700px) {
  .home-calendar-card {
    min-width: 0;
  }
  .home-cal-toolbar {
    gap: 0.35rem;
  }
  .home-cal-toolbar .btn-sm {
    flex: 1 1 calc(50% - 0.35rem);
    min-width: 0;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    font-size: 0.78rem;
  }
  .home-cal-month-scroll {
    overflow: visible;
    margin: 0;
    padding: 0;
  }
  .home-cal-month-scroll-inner {
    min-width: 0;
    width: 100%;
  }
  .home-cal-grid-month {
    gap: 0.22rem;
  }
  .home-cal-weekdays {
    gap: 0.22rem;
    margin-bottom: 0.25rem;
  }
  .home-cal-weekday {
    font-size: 0.68rem;
  }
  .home-cal-cell {
    min-height: 3.4rem;
    padding: 0.22rem;
  }
  .home-cal-daynum {
    font-size: 0.72rem;
    margin-bottom: 0.15rem;
  }
  .home-ap-chip {
    font-size: 0.62rem;
    padding: 0.18rem 0.22rem;
    margin-bottom: 0.12rem;
  }
  .home-cal-modal {
    align-items: flex-end;
  }
  .home-cal-grid-week--7 {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
  .home-cal-weekdays--7 {
    display: none;
  }
  .home-cal-grid-week--7 .home-cal-cell {
    min-height: 0;
    padding: 0.65rem 0.75rem;
  }
  .home-cal-grid-week--7 .home-cal-cell-dow {
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
  }
  .home-cal-grid-week--7 .home-cal-daynum--week {
    font-size: 0.9rem;
    margin-bottom: 0.45rem;
  }
  .home-cal-grid-week--7 .home-ap-chip {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8rem;
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.4rem;
  }
  .home-cal-grid-week--7 .home-ap-time {
    flex-shrink: 0;
    min-width: 2.85rem;
  }
  .home-cal-grid-week--7 .home-ap-text {
    flex: 1;
    min-width: 0;
    font-size: 0.84rem;
    line-height: 1.35;
    word-break: normal;
    overflow-wrap: break-word;
  }
}

/* Modale link al cliente */
.home-link-kit-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem;
  overflow: auto;
}
.home-link-kit-overlay[hidden] { display: none !important; }
.home-link-kit-dialog {
  position: relative;
  width: min(520px, 100%);
  margin-top: 4vh;
  background: var(--bg-card);
  border: none;
  border-radius: 16px;
  padding: 1.35rem 1.35rem 1.5rem;
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.18);
}
.home-link-kit-dialog--minimal {
  padding-top: 2rem;
}
.home-link-kit-title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}
.home-link-kit-lead {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0 0 1rem;
}
.home-link-kit-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.home-link-kit-menu li {
  border-top: 1px solid var(--border);
}
.home-link-kit-menu li:first-child {
  border-top: none;
}
.home-link-kit-menu-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  padding: 0.85rem 0.15rem;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  cursor: pointer;
  color: inherit;
}
.home-link-kit-menu-btn:hover {
  color: #2563eb;
}
.home-link-kit-tag {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.home-link-kit-back {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0 0 0.75rem;
  margin-bottom: 0.25rem;
}
.home-link-kit-back:hover {
  color: #2563eb;
}
.home-link-kit-clientline {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}
.home-link-kit-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.home-link-kit-repairs-block {
  margin-top: 1rem;
}
.home-link-kit-repairs-hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0 0 0.5rem;
}
.home-link-repair-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.home-link-repair-line:last-child {
  border-bottom: none;
}
.home-link-repair-label {
  flex: 1 1 140px;
  font-size: 0.88rem;
  font-weight: 500;
}
.home-link-kind-select {
  font-size: 0.82rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  max-width: 100%;
}
.home-link-kit-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  border: none;
  background: transparent;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.15rem 0.35rem;
}
.home-link-kit-close:hover { color: #0f172a; }
.home-link-kit-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}
.home-link-kit-search {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
}
.home-link-kit-suggest {
  display: none;
  margin-top: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 220px;
  overflow: auto;
  background: var(--bg-card);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.home-link-kit-pick {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-size: 0.92rem;
}
.home-link-kit-pick:last-child { border-bottom: none; }
.home-link-kit-pick:hover { background: #f1f5f9; }
.home-link-kit-suggest-empty {
  padding: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.home-link-kit-phone { margin: 0 0 1rem; font-size: 0.85rem; color: var(--text-secondary); }

/* Hub cassa fiscale (menu a riquadri) */
.cassa-hub { max-width: 1100px; margin: 0 auto; }
.cassa-hub-title { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.35rem; }
.cassa-hub-sub { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.5; margin-bottom: 1.5rem; }
.cassa-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.cassa-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 1.25rem 1.35rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, #fafbfc 0%, #f4f6f8 100%);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  min-height: 132px;
}
.cassa-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  border-color: rgba(99, 102, 241, 0.35);
}
.cassa-tile-icon { font-size: 1.85rem; line-height: 1; margin-bottom: 0.65rem; }
.cassa-tile-title { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.35rem 0; }
.cassa-tile-desc { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.4; margin: 0; }

.cassa-section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 2rem 0 0.85rem 0;
  letter-spacing: 0.02em;
}
.cassa-featured-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.1rem;
  margin-bottom: 0.5rem;
}
.cassa-tile-featured-form {
  margin: 0;
  display: block;
}
.cassa-tile-featured-form .cassa-tile-featured {
  width: 100%;
  height: 100%;
  min-height: 200px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}
.cassa-tile-featured {
  min-height: 200px;
  padding: 1.5rem 1.4rem;
  border-radius: 20px;
  border-width: 2px;
}
.cassa-tile-featured .cassa-tile-icon { font-size: 2.4rem; margin-bottom: 0.85rem; }
.cassa-tile-featured .cassa-tile-title { font-size: 1.28rem; margin-bottom: 0.45rem; }
.cassa-tile-featured .cassa-tile-desc { font-size: 0.92rem; }
.cassa-tile-scontrino {
  background: linear-gradient(165deg, #ecfdf5 0%, #d1fae5 45%, #f0fdf4 100%);
  border-color: rgba(16, 185, 129, 0.45);
}
.cassa-tile-cassetto {
  background: linear-gradient(165deg, #eff6ff 0%, #dbeafe 50%, #f8fafc 100%);
  border-color: rgba(59, 130, 246, 0.45);
}
.cassa-tile-cassetto.is-sending {
  opacity: 0.82;
  transform: scale(0.98);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.cassa-pending-row--flash {
  animation: cassaPendingFlash 0.9s ease;
}
@keyframes cassaPendingFlash {
  0% { background: rgba(59, 130, 246, 0.18); }
  100% { background: transparent; }
}
.cassa-hub-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%) translateY(120%);
  z-index: 12000;
  max-width: min(92vw, 420px);
  padding: 0.75rem 1.1rem;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.18);
  pointer-events: none;
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.cassa-hub-toast--ok {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.cassa-hub-toast--err {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.cassa-hub-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.cassa-tile-chiusura {
  background: linear-gradient(165deg, #fff7ed 0%, #ffedd5 50%, #fffbeb 100%);
  border-color: rgba(234, 88, 12, 0.4);
}
.cassa-tile-lista-ordine {
  background: linear-gradient(165deg, #f5f3ff 0%, #ede9fe 45%, #faf5ff 100%);
  border-color: rgba(124, 58, 237, 0.42);
}
.cassa-tile-grid-secondary .cassa-tile-small {
  min-height: 118px;
  padding: 1rem 1.1rem;
}
.cassa-tile-grid-secondary .cassa-tile-icon { font-size: 1.45rem; }
.cassa-tile-grid-secondary .cassa-tile-title { font-size: 0.98rem; }

.cassa-pending-card { margin-bottom: 1.35rem; }
.cassa-pending-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cassa-pending-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.cassa-pending-row:last-child { border-bottom: 0; }
.cassa-pending-dot {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fbbf24, #f59e0b);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}
.cassa-pending-body { flex: 1; min-width: 0; }
.cassa-pending-label { font-weight: 600; font-size: 0.95rem; }
.cassa-pending-sub { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.15rem; }
.cassa-pending-del { margin: 0; flex-shrink: 0; }
.cassa-pending-x {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.12s;
}
.cassa-pending-x:hover {
  background: #fee2e2;
  transform: scale(1.05);
}

.cassa-pdf-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.cassa-pdf-link:hover {
  background: #dbeafe;
  color: #1d4ed8;
  transform: translateY(-1px);
}
.cassa-coda-pdf-cell { width: 52px; text-align: center; vertical-align: middle; }
.cassa-pdf-link-compact {
  width: 34px;
  height: 34px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  margin-right: 0.25rem;
}

@media (max-width: 900px) {
  .cassa-featured-row {
    grid-template-columns: 1fr;
  }
  .cassa-tile-featured { min-height: 160px; }
}

/* Foto riparazione (DR.DEXTER): toolbar, selezione, lightbox */
.repair-photos-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
}
.repair-photos-selection-count {
  flex: 1 1 120px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted, #475569);
  min-width: 0;
  line-height: 1.2;
}
.repair-fab-svg {
  display: block;
  pointer-events: none;
}
.repair-fab {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.repair-fab:active {
  transform: scale(0.96);
}
.repair-fab--select {
  background: linear-gradient(145deg, #6366f1, #4f46e5);
  color: #fff;
}
.repair-fab--select[aria-pressed="true"] {
  background: linear-gradient(145deg, #22c55e, #15803d);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}
.repair-fab--trash {
  background: linear-gradient(145deg, #f87171, #dc2626);
  color: #fff;
  margin-left: auto;
}
.repair-fab--trash:hover {
  filter: brightness(1.06);
}
.repair-photos-hint {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 0.65rem;
  line-height: 1.4;
}
.repair-upload-queue-hint {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0.55rem 0 0.75rem;
  line-height: 1.4;
  max-width: 52rem;
}
.repair-photo-cell--uploading {
  cursor: default;
}
.repair-photo-cell--uploading .repair-photo-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 10px;
}
.repair-photo-cell--uploading .repair-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.repair-upload-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: rgba(15, 23, 42, 0.35);
  z-index: 4;
  border-radius: 0 0 10px 10px;
  overflow: hidden;
}
.repair-upload-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 0.12s ease-out;
}
.repair-photo-cell--upload-fail {
  outline: 2px solid #ef4444;
  outline-offset: 0;
}
.repair-upload-error {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fef2f2;
  background: rgba(220, 38, 38, 0.92);
  padding: 0.2rem 0.35rem;
  z-index: 5;
}
.repair-lightbox-hint {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0 0 0.45rem;
  line-height: 1.35;
}
.repair-photos-section:not(.is-select-on) .repair-photo-select {
  display: none !important;
}

.repair-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.7rem;
  margin-top: 0.55rem;
}
.repair-photo-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  cursor: grab;
}
.repair-photos-section.is-select-on .repair-photo-cell {
  cursor: default;
}
.repair-photos-section.is-select-on .repair-photo-thumb {
  cursor: pointer;
}
.repair-photo-cell--collage .repair-photo-thumb {
  border-color: #a7f3d0;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.3);
}
.repair-photo-select {
  position: absolute;
  right: 7px;
  bottom: 7px;
  top: auto;
  left: auto;
  z-index: 4;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.repair-photo-select input.repair-photo-check {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.repair-photo-select-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.32);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}
.repair-photo-check:checked + .repair-photo-select-ring {
  background: #007aff;
  border-color: #007aff;
  box-shadow: 0 1px 6px rgba(0, 122, 255, 0.45);
}
.repair-photo-select-check {
  color: #fff;
  display: block;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.repair-photo-check:checked + .repair-photo-select-ring .repair-photo-select-check {
  opacity: 1;
  transform: scale(1);
}
.repair-photo-cell.is-selected .repair-photo-thumb {
  box-shadow: inset 0 0 0 3px rgba(0, 122, 255, 0.55);
}
.repair-photo-cell:active {
  cursor: grabbing;
}
.repair-photo-cell--dragging {
  opacity: 0.55;
}
.repair-lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  min-height: min(82vh, 900px);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.repair-lightbox-stage:active {
  cursor: grabbing;
}
.repair-lightbox-img-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  height: min(82vh, 900px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.repair-lightbox-img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 1;
  transition: opacity 0.18s ease;
  pointer-events: auto;
  transform-origin: center center;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-user-drag: none;
}
.repair-collage-editor-box {
  max-width: min(96vw, 920px);
  width: min(96vw, 920px);
  max-height: 92vh;
  overflow: auto;
  touch-action: manipulation;
}
.repair-collage-layouts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}
.repair-collage-layout-chip {
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  border-radius: 999px;
  border: 1px solid var(--border, #cbd5e1);
  background: var(--bg-card, #fff);
  color: var(--text, #0f172a);
  cursor: pointer;
  line-height: 1.2;
}
.repair-collage-swap-btn.is-active {
  background: #1d4ed8;
  color: #fff;
  border-color: #1e40af;
}

.repair-collage-canvas-wrap canvas.repair-collage-canvas--swap-mode {
  cursor: grab;
}

.repair-collage-canvas-wrap canvas.repair-collage-canvas--swap-mode:active {
  cursor: grabbing;
}

.repair-collage-layout-chip.is-active {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}
.repair-collage-toolbar--slots {
  margin-bottom: 0.45rem;
}
.repair-collage-slot-btn.is-active {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}
.repair-collage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}
.repair-collage-layer-btn.is-active {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}
.repair-collage-canvas-wrap {
  background: #0f172a;
  border-radius: 8px;
  padding: 0.35rem;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}
/* width:100% + max-height distorting the bitmap: use proporzioni intrinseche del canvas */
.repair-collage-canvas-wrap canvas {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(58vh, 640px);
  display: block;
  vertical-align: top;
  object-fit: contain;
  touch-action: none;
  cursor: grab;
}
.repair-collage-canvas-wrap canvas:active {
  cursor: grabbing;
}
.repair-photo-extract-form {
  position: absolute;
  top: 4px;
  left: 4px;
  right: auto;
  margin: 0;
  padding: 0;
  z-index: 2;
}
.repair-photo-extract-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  line-height: 1;
  font-size: 0.95rem;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  cursor: pointer;
}
.repair-photo-extract-btn:hover { background: #0ea5e9; }
.repair-photo-thumb {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
  width: 100%;
  height: 100%;
}
.repair-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.repair-photo-has-caption {
  position: absolute;
  left: 6px;
  bottom: 6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  pointer-events: none;
  z-index: 1;
}
.repair-photo-collage-badge {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: auto;
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(5, 150, 105, 0.9);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  pointer-events: none;
  z-index: 1;
}

.repair-image-view-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.repair-caption-readonly-text {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.repair-caption-empty {
  margin: 0;
  color: #64748b;
}
.repair-caption-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.repair-image-view-title {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}
.repair-image-view-hero {
  position: relative;
  max-width: min(100%, 1100px);
  margin: 0 auto 1.25rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f172a;
}
.repair-image-view-img-link {
  display: block;
  cursor: zoom-in;
  outline: none;
}
.repair-image-view-img-link:focus-visible {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.45);
  border-radius: 12px;
}
.repair-image-view-img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}
.repair-image-view-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.5rem 1rem 1rem;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.45) 55%, transparent 100%);
  color: #f8fafc;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  line-height: 1.45;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.repair-image-view-overlay-inner {
  max-width: 52rem;
  margin: 0 auto;
  word-wrap: break-word;
}
.repair-image-view-caption-card h3 {
  margin-top: 0;
}
.repair-image-view-caption-form textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.repair-image-editor-card h3 {
  margin-top: 0;
}
.repair-image-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.repair-image-editor-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  background: #fff;
}
.repair-toolbar-icon-btn {
  width: 36px;
  height: 34px;
  min-width: 36px;
  border-radius: 4px;
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #b9bec5;
  background: linear-gradient(#f8f8f8, #ececec);
  color: #7f8792;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}
.repair-toolbar-icon-btn:hover {
  color: #4f5762;
  background: linear-gradient(#fefefe, #e7e7e7);
}
.repair-toolbar-icon-btn svg {
  width: 18px;
  height: 18px;
}
.repair-image-editor-stage {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
  max-height: min(78vh, 820px);
  min-height: min(52vh, 480px);
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem;
}
.repair-image-editor-canvas-wrap {
  position: relative;
  display: inline-block;
  max-width: min(100%, 96vw);
  max-height: min(74vh, 760px);
  line-height: 0;
}
#repairImageEditorCanvas {
  display: block;
  /* Anteprima adattata allo schermo; pixel interni del canvas restano full HD. */
  max-width: min(100%, 96vw);
  max-height: min(74vh, 760px);
  width: auto !important;
  height: auto !important;
  touch-action: none;
  background: #111827;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  image-rendering: auto;
}
.repair-image-editor-overlay {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
  border-radius: 8px;
}
.repair-image-editor-overlay.is-crop-active,
.repair-image-editor-overlay .repair-text-layer,
.repair-image-editor-overlay .repair-crop-ui {
  pointer-events: auto;
}
.repair-crop-ui {
  position: absolute;
  inset: 0;
  touch-action: none;
}
.repair-crop-shade {
  position: absolute;
  background: rgba(0, 0, 0, 0.48);
  pointer-events: none;
}
.repair-crop-box {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.35);
  cursor: move;
  touch-action: none;
}
.repair-crop-edge {
  position: absolute;
  background: transparent;
  touch-action: none;
}
.repair-crop-edge--n {
  left: 12px;
  right: 12px;
  top: -10px;
  height: 20px;
  cursor: ns-resize;
}
.repair-crop-edge--s {
  left: 12px;
  right: 12px;
  bottom: -10px;
  height: 20px;
  cursor: ns-resize;
}
.repair-crop-edge--e {
  top: 12px;
  bottom: 12px;
  right: -10px;
  width: 20px;
  cursor: ew-resize;
}
.repair-crop-edge--w {
  top: 12px;
  bottom: 12px;
  left: -10px;
  width: 20px;
  cursor: ew-resize;
}
.repair-crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 2px;
  touch-action: none;
}
.repair-crop-handle[data-handle="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.repair-crop-handle[data-handle="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.repair-crop-handle[data-handle="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.repair-crop-handle[data-handle="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.repair-text-layer {
  position: absolute;
  box-sizing: border-box;
  min-width: 80px;
  min-height: 40px;
  border: 1.5px dashed rgba(255, 255, 255, 0.85);
  background: rgba(15, 23, 42, 0.18);
  border-radius: 6px;
  touch-action: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}
.repair-text-layer.is-dragging {
  border-style: solid;
  border-color: #93c5fd;
}
.repair-text-layer-chrome {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 22px;
  cursor: move;
  background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.04));
  border-radius: 5px 5px 0 0;
}
.repair-text-layer-body {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 24px;
  bottom: 6px;
  overflow: auto;
  outline: none;
  color: #fff;
  font-weight: 700;
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.2;
  word-break: break-word;
  cursor: text;
  -webkit-user-select: text;
  user-select: text;
  text-align: center;
  display: block;
}
.repair-text-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  background: #fff;
  border-radius: 2px;
  touch-action: none;
}
.repair-text-handle[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.repair-text-handle[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.repair-text-handle[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.repair-text-handle[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.cassa-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.cassa-breadcrumb-title { font-size: 1rem; font-weight: 600; color: var(--text-secondary); }
.cassa-recent-card { margin-top: 0.5rem; }
.cassa-recent-list { list-style: none; padding: 0; margin: 0; }
.cassa-recent-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.cassa-recent-list li:last-child { border-bottom: 0; }
.cassa-recent-date { float: right; color: var(--text-secondary); font-size: 0.82rem; }
.cassa-guida-dl { margin: 0; }
.cassa-guida-dl dt { font-weight: 700; margin-top: 1rem; color: var(--text); }
.cassa-guida-dl dt:first-child { margin-top: 0; }
.cassa-guida-dl dd { margin: 0.35rem 0 0 0; color: var(--text-secondary); line-height: 1.5; }
.text-muted { color: var(--text-secondary); font-size: 0.9rem; }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.875rem; }
.search-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.search-input { flex: 1; min-width: 200px; }
.stock-low-row td { background: rgba(254, 226, 226, 0.45) !important; }
.stock-ok-row td { background: rgba(220, 252, 231, 0.35) !important; }
.stock-low-badge,
.stock-ok-badge {
    display: inline-block;
    padding: 0.14rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.82rem;
}
.stock-low-badge {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}
.stock-ok-badge {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

/* Pagina: logo + barra verde; sfondo leggero + blur (nessun riquadro) */
.drdex-page-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    background: rgba(248, 250, 252, 0.5);
    backdrop-filter: blur(12px) saturate(1.05);
    -webkit-backdrop-filter: blur(12px) saturate(1.05);
    transition: opacity 0.42s ease, visibility 0.42s ease;
    visibility: visible;
    opacity: 1;
}
.drdex-page-loader.is-finished {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.drdex-page-loader-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(env(safe-area-inset-top), 12px) 1rem max(env(safe-area-inset-bottom), 12px);
    width: 100%;
    max-width: min(92vw, 320px);
}
.drdex-page-loader-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}
.drdex-page-loader-track {
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.28);
    overflow: hidden;
}
.drdex-page-loader-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #15803d, #22c55e, #4ade80);
    transition: width 0.18s ease-out;
    animation: none;
}
.drdex-page-loader-pct {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #15803d;
    font-variant-numeric: tabular-nums;
}
.drdex-page-loader.is-finished .drdex-page-loader-bar {
    animation: none;
    width: 100%;
    opacity: 0;
    transition: width 0.35s ease, opacity 0.35s ease;
}
.drdex-page-loader.is-finished .drdex-page-loader-pct {
    opacity: 0;
    transition: opacity 0.35s ease;
}
.drdex-page-loader-logo {
    width: min(44vw, 168px);
    height: auto;
    max-height: 28vh;
    object-fit: contain;
    filter: grayscale(1) brightness(0.9) contrast(0.96);
    transition: filter 1s cubic-bezier(0.33, 1, 0.68, 1);
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}
.drdex-page-loader.is-dom-ready .drdex-page-loader-logo {
    filter: grayscale(0) brightness(1) contrast(1);
}
.drdex-page-loader--lite .drdex-page-loader-track--solo {
    width: min(72vw, 220px);
}
.drdex-page-loader--lite .drdex-page-loader-stack {
    gap: 0;
}
body.drdex-page-loading {
    overflow: hidden;
}

/* Overlay “occupato”: pagina sotto sfocata, solo logo + barra verde (nessun riquadro) */
.drdex-action-busy {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 2147483640;
    background: rgba(248, 250, 252, 0.35);
    backdrop-filter: blur(14px) saturate(1.05);
    -webkit-backdrop-filter: blur(14px) saturate(1.05);
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.drdex-action-busy.is-immediate {
    transition: none !important;
}
@media (pointer: coarse) {
    .drdex-action-busy {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(248, 250, 252, 0.82);
    }
    .drdex-action-busy .drdex-action-busy-logo,
    .drdex-page-loader .drdex-page-loader-logo {
        display: none;
    }
    .drdex-action-busy-track,
    .drdex-page-loader-track {
        width: min(70vw, 200px);
    }
}
.drdex-action-busy[hidden] {
    display: none !important;
}
.drdex-action-busy-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(env(safe-area-inset-top), 12px) 1.25rem max(env(safe-area-inset-bottom), 12px);
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    min-width: 0;
    width: min(88vw, 280px);
    max-width: 100%;
}
.drdex-action-busy-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
}
.drdex-action-busy-track {
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.3);
    overflow: hidden;
}
.drdex-action-busy-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #15803d, #22c55e, #4ade80);
    transition: width 0.16s ease-out;
    animation: none;
}
.drdex-action-busy-pct {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #15803d;
    font-variant-numeric: tabular-nums;
}
.drdex-action-busy-logo {
    width: min(36vw, 140px);
    height: auto;
    max-height: 22vh;
    object-fit: contain;
    filter: none;
    animation: none;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}
body.drdex-action-busy-open {
    cursor: wait;
}
button.is-busy,
.btn.is-busy,
input[type="submit"].is-busy {
    opacity: 0.65;
    cursor: wait !important;
}
.drdex-fragment-busy {
    position: relative;
    min-height: 2.5rem;
    opacity: 0.55;
    pointer-events: none;
}
.drdex-fragment-busy::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 1.25rem;
    width: 2rem;
    height: 2rem;
    margin-left: -1rem;
    border: 3px solid rgba(34, 197, 94, 0.25);
    border-top-color: #16a34a;
    border-radius: 50%;
    animation: drdexFragmentSpin 0.75s linear infinite;
}
@keyframes drdexFragmentSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Pagina Link al cliente */
.link-hub-page {
    max-width: 960px;
    margin: 0 auto;
}
.link-hub-hero {
    margin-bottom: 1.25rem;
    border-left: 4px solid #9333ea;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.06), #fff);
}
.link-hub-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
}
.link-hub-lead {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: 0.95rem;
}
.link-hub-section {
    margin-bottom: 1.25rem;
}
.link-hub-h2 {
    font-size: 1.05rem;
    margin: 0 0 0.35rem;
}
.link-hub-h3 {
    font-size: 0.98rem;
    margin: 1.25rem 0 0.5rem;
}
.link-hub-sub {
    margin: 0 0 1rem;
}
.link-hub-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-left: 0.35rem;
}
.link-hub-table {
    width: 100%;
    border-collapse: collapse;
}
.link-hub-table th,
.link-hub-table td {
    padding: 0.75rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.link-hub-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    background: #f8fafc;
}
.link-hub-actions {
    white-space: nowrap;
    text-align: right !important;
}
.link-hub-actions .btn {
    margin-left: 0.35rem;
}
.link-hub-search-row {
    position: relative;
    margin-bottom: 1rem;
    max-width: 32rem;
}
.link-hub-label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
}
.link-hub-search {
    width: 100%;
    box-sizing: border-box;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 1rem;
}
.link-hub-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 0.25rem;
    z-index: 40;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    max-height: 220px;
    overflow: auto;
}
.link-hub-pick {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.75rem;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    font-size: 0.92rem;
}
.link-hub-pick:last-child {
    border-bottom: none;
}
.link-hub-pick:hover {
    background: #f1f5f9;
}
.link-hub-suggest-empty {
    padding: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.link-hub-empty {
    padding: 0.75rem 0;
}
.link-hub-cliente-head {
    margin: 0 0 1rem;
    font-size: 1rem;
}
.link-hub-kind {
    font-size: 0.88rem;
    padding: 0.35rem 0.45rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    max-width: 100%;
}
.link-hub-modal {
    position: fixed;
    inset: 0;
    z-index: 6000;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.25rem;
    overflow: auto;
}
.link-hub-modal[hidden] {
    display: none !important;
}
.link-hub-modal-dialog {
    position: relative;
    width: min(480px, 100%);
    margin-top: 8vh;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.35rem 1.25rem 1.25rem;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.2);
}
.link-hub-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}
.link-hub-modal-title {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
}
.link-hub-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(165deg, #f8fafc 0%, #eef2f7 48%, #e2e8f0 100%);
}
.login-shell { width: 100%; max-width: 420px; }
.login-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 2.1rem 1.85rem 1.9rem;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}
.login-brand {
    text-align: center;
    margin-bottom: 1.35rem;
}
.login-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 76px;
    margin: 0 auto 0.55rem;
}
.login-logo-img {
    display: block;
    margin: 0 auto;
    width: auto;
    height: auto;
    max-width: min(72vw, 200px);
    max-height: clamp(40px, 12vw, 58px);
    object-fit: contain;
    object-position: center center;
}
@media (max-width: 480px) {
    .login-shell { max-width: min(100%, 380px); }
    .login-box { padding: 1.65rem 1.2rem 1.5rem; border-radius: 16px; }
    .login-logo-wrap { min-height: 44px; margin-bottom: 0.45rem; }
    .login-logo-img {
        max-width: min(58vw, 150px);
        max-height: clamp(34px, 9.5vw, 44px);
    }
    .login-kicker { font-size: 0.86rem; }
}
.difetto-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}
.difetto-field-head label { margin-bottom: 0; }
.difetto-field-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}
.difetto-suggest-overlay { z-index: 11000; }
.difetto-suggest-box {
    max-width: 720px;
    width: min(96vw, 720px);
    max-height: min(88vh, 900px);
    overflow: auto;
    touch-action: auto;
}
.difetto-suggest-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}
.difetto-suggest-head h3 { margin: 0; font-size: 1.15rem; }
.difetto-suggest-close {
    border: none;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 0 0.15rem;
}
.difetto-suggest-device {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    color: #0f172a;
}
.difetto-suggest-queries {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    color: #64748b;
}
.difetto-suggest-summary {
    margin: 0 0 0.85rem;
    color: #475569;
    font-size: 0.92rem;
}
.difetto-suggest-section { margin-bottom: 0.95rem; }
.difetto-suggest-section h4 {
    margin: 0 0 0.35rem;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}
.difetto-suggest-list,
.difetto-suggest-sources {
    margin: 0;
    padding-left: 1.15rem;
}
.difetto-suggest-list li,
.difetto-suggest-sources li { margin-bottom: 0.35rem; }
.difetto-suggest-interventions {
    list-style: none;
    margin: 0;
    padding: 0;
}
.difetto-suggest-interventions li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid #e2e8f0;
}
.difetto-suggest-intervention-text {
    flex: 1;
    font-size: 0.95rem;
}
.difetto-suggest-sources a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}
.difetto-suggest-source-snippet {
    display: block;
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 0.15rem;
}
.difetto-suggest-empty {
    margin: 0;
    font-size: 0.88rem;
    color: #94a3b8;
}
.difetto-suggest-use-btn.is-added,
.difetto-suggest-use-btn:disabled.is-added {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
    cursor: default;
    opacity: 1;
}
.difetto-suggest-intervention-added {
    background: #f0fdf4;
    border-radius: 8px;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}
.difetto-suggest-field-added {
    outline: 2px solid #22c55e;
    outline-offset: 1px;
    background: #f0fdf4;
    transition: outline-color 0.2s ease, background 0.2s ease;
}
.difetto-suggest-toast {
    position: fixed;
    left: 50%;
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    transform: translateX(-50%) translateY(12px);
    z-index: 2147483645;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    background: #166534;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.difetto-suggest-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.login-kicker {
    margin: 0;
    color: #64748b;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.login-alert { margin-bottom: 1rem; }
.login-form .form-group { margin-bottom: 1rem; }
.login-form label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: #475569;
}
.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid #dbe1ea;
    padding: 0.72rem 0.85rem;
    font-size: 1rem;
    background: #fff;
}
.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    outline: none;
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}
.login-remember-row { margin-bottom: 0.9rem; }
.login-remember-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #334155;
    font-size: 0.9rem;
}
.login-remember-label input { width: auto; margin: 0; }
.login-remember-hint {
    display: block;
    margin-top: 0.28rem;
    margin-left: 1.55rem;
    color: #94a3b8;
    font-size: 0.8rem;
}
.login-submit {
    margin-top: 0.15rem;
    padding: 0.78rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
}
.login-2fa-hint {
    font-size: 0.92rem;
    color: #64748b;
    margin: 0 0 1rem;
    line-height: 1.5;
    text-align: center;
}
.login-2fa-code-input {
    font-size: 1.4rem;
    letter-spacing: 0.32em;
    text-align: center;
    font-variant-numeric: tabular-nums;
    border-radius: 12px;
    padding: 0.8rem 0.85rem;
}
.login-2fa-secondary { margin-top: 0.65rem; }
.login-2fa-cancel { color: #64748b; font-size: 0.9rem; }
.login-2fa-cancel.btn-link {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0.35rem 0;
}
.login-2fa-cancel.btn-link:hover { background: transparent; text-decoration: underline; }
.btn-block { width: 100%; display: block; }

.settings-page { max-width: 800px; width: 100%; margin-left: auto; margin-right: auto; box-sizing: border-box; }
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 1.25rem;
    width: 100%;
    min-width: 0;
}
.settings-card { border-left: 4px solid var(--purple); min-width: 0; max-width: 100%; }
.settings-form .form-group { margin-bottom: 1rem; }
.settings-form .btn { margin-top: 0.5rem; }
.settings-hint { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 1rem; }
.settings-card--wide { grid-column: 1 / -1; }
.settings-staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 0.75rem 1rem;
}
.settings-staff-row-wrap {
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
    margin-top: 1rem;
}
.settings-staff-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
    margin-top: 0.35rem;
}
.settings-staff-delete-form { margin-top: 0.55rem; }
.settings-staff-delete-btn { color: #b91c1c; border-color: #fecaca; }
.settings-path-label {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    display: block;
}
.settings-backup-path {
    display: block;
    margin: 0;
    padding: 0.55rem 0.7rem;
    background: #f1f5f9;
    border-radius: var(--radius-sm);
    font-size: 0.76rem;
    line-height: 1.45;
    word-break: break-all;
    overflow-wrap: anywhere;
    max-width: 100%;
    box-sizing: border-box;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #334155;
}

@media (max-width: 768px) {
    .logo-img { max-height: 32px; height: auto; width: auto; max-width: 140px; object-fit: contain; }
    nav { display: flex; flex-wrap: wrap; gap: 0.5rem; }
    nav a { margin-left: 0; margin-right: 0; font-size: 0.85rem; padding: 0.25rem 0; }
    .container {
        padding-top: max(0.8rem, env(safe-area-inset-top, 0px));
        padding-left: max(0.85rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.85rem, env(safe-area-inset-right, 0px));
        padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    }
    .inline-logo-img { height: 60px; }
    .settings-grid { gap: 1rem; }
}

@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
    .logo-img { max-height: 28px; max-width: 120px; }
    nav a { margin-left: 0; margin-right: 1rem; }
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .btn-group { flex-wrap: wrap; }
    .btn-group .btn { min-width: auto; }
    .top-chrome {
        flex-wrap: wrap;
        margin-bottom: 0.75rem;
        position: relative;
        padding-right: 2.75rem;
        gap: 0.45rem;
        align-items: flex-start;
    }
    .top-chrome-actions { order: 0; width: 100%; min-width: 0; }
    .top-chrome-center { order: 1; width: 100%; justify-content: center; min-width: 0; }
    .top-chrome-right { position: absolute; right: 0; top: 0; }
    .inline-logo-link { order: 1; margin-left: auto; max-width: calc(100% - 3rem); }
    .inline-logo-img { height: 52px; max-width: min(200px, 46vw); width: auto; object-fit: contain; }
    .search-input { min-width: 0 !important; flex: 1 1 auto; max-width: 100%; }
    .card { padding: 1.1rem 1rem; }
    .settings-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Prezzo consigliato (magazzino / cassa) */
.badge-prezzo-consigliato {
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    background: #dc2626;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.2;
}
.prezzo-consigliato-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
}
.btn-apply-prezzo-suggerito {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
}

/* Interventi con economia per riga */
.interventi-table--economia { width: 100%; }
.interventi-table--economia .intervento-group + .intervento-group tr.intervento-row-main td {
    border-top: 2px solid #e2e8f0;
    padding-top: 0.85rem;
}
.interventi-table--economia .intervento-row-costi td {
    padding: 0 0.5rem 0.85rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.intervento-costi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.65rem 0.85rem;
    align-items: end;
}
.intervento-costi-grid .form-group { margin: 0; }
.intervento-costi-grid label {
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0.25rem;
    display: block;
}
.intervento-costi-grid input[type="text"],
.intervento-costi-grid input[type="number"] {
    font-size: max(16px, 1rem);
    padding: 0.55rem 0.65rem;
    min-height: 44px;
}
.intervento-costo-field--iva .intervento-iva-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    margin: 0;
    cursor: pointer;
}
.intervento-slot-label {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}
.drdex-prezzi-guida {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin: 0.4rem 0 0;
}
.drdex-prezzi-guida--empty .drdex-prezzo-box-val { color: #94a3b8; }
.drdex-prezzo-box {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    border: 1px solid transparent;
}
.drdex-prezzo-box--consigliato {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #6ee7b7;
}
.drdex-prezzo-box--minimo {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fdba74;
}
.drdex-prezzo-box-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #475569;
}
.drdex-prezzo-box--consigliato .drdex-prezzo-box-label { color: #047857; }
.drdex-prezzo-box--minimo .drdex-prezzo-box-label { color: #9a3412; }
.drdex-prezzo-box-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}
.drdex-prezzo-box--consigliato .drdex-prezzo-box-val { color: #065f46; }
.drdex-prezzo-box--minimo .drdex-prezzo-box-val { color: #9a3412; }
.drdex-importo--sotto-minimo { border-color: #f87171 !important; background: #fef2f2; }
.drdex-importo--sotto-consigliato { border-color: #fdba74 !important; background: #fffbeb; }
.drdex-importo--ok { border-color: #6ee7b7 !important; }
.drdex-economia-voce--azzerata {
    color: #9a3412;
    font-weight: 700;
}
.drdex-economia-voce-ideale {
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 400;
}
@media (max-width: 520px) {
    .drdex-prezzi-guida { grid-template-columns: 1fr; }
}
.drdex-economia-detail[data-modalita="minimo_assoluto"] [data-k="ricarico"] {
    font-weight: 600;
}
.drdex-intervento-economia-wrap { margin-top: 0.25rem; }
.drdex-economia-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0.35rem 0 0;
    padding: 0;
    border: 0;
    background: none;
    color: #2563eb;
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: underline;
}
.drdex-economia-toggle.is-open::before { content: '▾ '; }
.drdex-economia-toggle:not(.is-open)::before { content: '▸ '; }
.drdex-economia-detail {
    margin-top: 0.5rem;
    padding: 0.65rem 0.75rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.82rem;
}
.drdex-economia-dl {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 0.75rem;
    margin: 0;
}
.drdex-economia-dl dt { color: #64748b; margin: 0; }
.drdex-economia-dl dd { margin: 0; text-align: right; font-weight: 500; }
.drdex-economia-dl dt.drdex-economia-sub,
.drdex-economia-dl dd.drdex-economia-sub {
  font-size: 0.82rem;
  color: #94a3b8;
  padding-left: 0.35rem;
}
.drdex-economia-utile-label { font-weight: 600; color: #334155; }
.drdex-economia-utile { font-weight: 700; }
.drdex-economia-dl dt.drdex-economia-totale-vivi,
.drdex-economia-dl dd.drdex-economia-totale-vivi {
  font-weight: 600;
  color: #334155;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.35rem;
  margin-top: 0.15rem;
}
.drdex-economia-quadratura-hint {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.35;
}
.drdex-economia-quadratura.drdex-margine-ok { color: #15803d; }
.interventi-view-economia { width: 100%; font-size: 0.92rem; }
.interventi-view-economia-detail { font-size: 0.85rem; color: #475569; line-height: 1.45; }
.badge-iva {
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    margin-left: 0.25rem;
}

/* Report guadagni */
.guadagni-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.guadagni-hint {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 1rem;
    line-height: 1.45;
}
.guadagni-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
}
.guadagni-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.guadagni-kpi {
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0;
}
.guadagni-kpi--highlight {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.guadagni-kpi-label {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}
.guadagni-kpi-value { font-size: 1.15rem; }
.guadagni-kpi-cost { color: #b45309; }
.guadagni-table th.num,
.guadagni-table td.num { text-align: right; white-space: nowrap; }
.report-interventi-cell { max-width: 280px; font-size: 0.88rem; line-height: 1.35; }
.guadagni-excel-sync-ok { color: #0d9488; font-weight: 600; }
.guadagni-scheda-ref {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
}
.guadagni-totals-row {
    background: #f1f5f9;
    font-weight: 600;
}
.guadagni-totals-row td {
    border-top: 2px solid #cbd5e1;
    padding-top: 0.75rem;
}
@media (max-width: 768px) {
    .intervento-costi-grid { grid-template-columns: 1fr 1fr; }
    .guadagni-table { font-size: 0.82rem; }
}

/* BI reportistica / soglia spese */
.bi-vista-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}
.bi-vista-tab {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    text-decoration: none;
    font-size: 0.88rem;
}
.bi-vista-tab:hover { background: #f8fafc; }
.bi-vista-tab.is-active {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
    font-weight: 600;
}
.bi-riepilogo-card .bi-riepilogo-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.bi-riepilogo-meta { margin: 0; font-size: 0.88rem; color: #64748b; }
.bi-riepilogo-kpi {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}
.bi-riepilogo-more { margin: 0.75rem 0 0; font-size: 0.88rem; }
/* Vista cliente mobile: niente report in elenco; accesso solo da tile Home (staff) */
body.drdex-mobile-client .bi-riepilogo-card,
body.drdex-mobile-client .main-nav a[href*="guadagni.php"] { display: none !important; }
/* iPad / iPhone: campi grandi, niente effetti compositing sui contenitori */
html.drdex-ios-keyboard input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
html.drdex-ios-keyboard textarea,
html.drdex-ios-keyboard select {
    font-size: 17px !important;
    line-height: 1.35 !important;
    min-height: 48px !important;
    -webkit-appearance: none;
    appearance: none;
}
html.drdex-ios-keyboard .form-grid .form-group input,
html.drdex-ios-keyboard .form-grid .form-group textarea,
html.drdex-ios-keyboard .form-grid .form-group select {
    width: 100% !important;
    max-width: 100% !important;
}
html.drdex-ios-keyboard .menu-drawer-backdrop {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
html.drdex-ios-keyboard.drdex-ios-keyboard-focus .scheda-pdf-preview iframe {
    pointer-events: none;
}

body.drdex-mobile-client .home-dashboard a.home-card-tile--report {
  display: flex !important;
}
.bi-soglia-badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.bi-soglia-badge--sotto { background: #fef3c7; color: #92400e; }
.bi-soglia-badge--ok { background: #d1fae5; color: #065f46; }
.drdex-soglia-banner {
    margin: 0.5rem 0 0.75rem;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    font-size: 0.82rem;
    line-height: 1.35;
}
.drdex-soglia-banner--sotto {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #78350f;
}
.drdex-soglia-banner--sopra {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}
.drdex-economia-staff-only {
    border-left: 3px solid #6366f1;
    padding-left: 0.5rem;
    margin-top: 0.35rem;
}
.drdex-economia-staff-only .drdex-economia-toggle {
    font-size: 0.78rem;
    color: #4338ca;
}

/* ============================================================
   MAGAZZINO — scansione rapida (mobile-first)
   ============================================================ */
.mag-scan-hero {
    border: 1px solid #bbf7d0;
    background: linear-gradient(180deg, #f0fdf4, #ffffff);
    border-radius: 16px;
    padding: 0.85rem 0.9rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}
.mag-scan-hero-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}
.mag-scan-hero-icon {
    font-size: 1.5rem;
    line-height: 1;
}
.mag-scan-hero-title {
    display: block;
    font-size: 1.05rem;
    color: #065f46;
}
.mag-scan-hero-sub {
    display: block;
    font-size: 0.82rem;
    color: #4b5563;
}
.mag-scan-hero-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}
.mag-scan-capture {
    flex: 1;
    min-width: 0;
    font-size: 1.05rem;
    padding: 0.7rem 0.85rem;
    border: 2px solid #34d399;
    border-radius: 12px;
    background: #fff;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.mag-scan-capture:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}
.mag-scan-cam-btn {
    flex: 0 0 auto;
    width: 3.1rem;
    border: none;
    border-radius: 12px;
    background: #059669;
    color: #fff;
    font-size: 1.35rem;
    cursor: pointer;
}
.mag-scan-cam-btn:active {
    transform: scale(0.96);
}
.mag-manual-details {
    margin-bottom: 0.5rem;
}
.mag-manual-details > summary {
    cursor: pointer;
    font-weight: 600;
    color: #374151;
    padding: 0.55rem 0.2rem;
    list-style: revert;
}

/* selettore vista elenco / riquadri */
.mag-view-toggle {
    display: inline-flex;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.mag-view-btn {
    border: none;
    background: #fff;
    color: #374151;
    padding: 0.5rem 0.85rem;
    font-size: 0.88rem;
    cursor: pointer;
    font-weight: 600;
}
.mag-view-btn + .mag-view-btn {
    border-left: 1px solid #e5e7eb;
}
.mag-view-btn.is-active {
    background: #111827;
    color: #fff;
}
.mag-filter-nuovi.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.mag-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 .28rem;
    margin-left: .25rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1;
}
.mag-filter-nuovi.is-active .mag-filter-count {
    background: #fff;
    color: #2563eb;
}
.mag-nuovo-badge {
    position: absolute;
    top: .45rem;
    left: .45rem;
    z-index: 2;
    background: #2563eb;
    color: #fff;
    font-size: .62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .15rem .38rem;
    border-radius: 999px;
    pointer-events: none;
}
.mag-card,
.mag-row {
    position: relative;
}

/* griglia stile "riquadri" */
.mag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.85rem;
}
.mag-card {
    display: flex;
    flex-direction: column;
    text-align: left;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.1s ease;
}
.mag-card:hover {
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.1);
}
.mag-card:active {
    transform: scale(0.985);
}
.mag-card-photo {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.mag-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.mag-card-noimg {
    font-size: 2.4rem;
    opacity: 0.45;
}
.mag-card-body {
    padding: 0.55rem 0.6rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.mag-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mag-card-code {
    font-size: 0.74rem;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}
.mag-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.25rem;
}
.mag-card-price {
    font-weight: 700;
    color: #047857;
    font-size: 0.92rem;
}

/* elenco magazzino (stile fornitore) + selezione Apple */
.mag-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.15rem;
}
.mag-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    padding: 0.5rem 0.65rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    transition: box-shadow 0.12s ease, border-color 0.12s ease;
}
.mag-row:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.mag-row-img {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.mag-row-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.mag-row-main {
    flex: 1;
    min-width: 0;
}
.mag-row-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mag-row-side {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}
.mag-card,
.mag-row {
    position: relative;
}
.mag-stock-section:not(.is-select-on) .mag-item-select {
    display: none !important;
}
.mag-stock-section.is-select-on .mag-card,
.mag-stock-section.is-select-on .mag-row {
    cursor: pointer;
}
.mag-item-select {
    position: absolute;
    right: 7px;
    bottom: 7px;
    z-index: 4;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mag-item-select input.mag-item-cb {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}
.mag-item-select-ring {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.95);
    background: rgba(0, 0, 0, 0.32);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}
.mag-item-cb:checked + .mag-item-select-ring {
    background: #007aff;
    border-color: #007aff;
    box-shadow: 0 1px 6px rgba(0, 122, 255, 0.45);
}
.mag-item-select-check {
    color: #fff;
    display: block;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.12s ease, transform 0.12s ease;
}
.mag-item-cb:checked + .mag-item-select-ring .mag-item-select-check {
    opacity: 1;
    transform: scale(1);
}
.mag-item.is-selected.mag-card {
    box-shadow: inset 0 0 0 3px rgba(0, 122, 255, 0.55);
}
.mag-item.is-selected.mag-row {
    border-color: #007aff;
    box-shadow: inset 0 0 0 2px rgba(0, 122, 255, 0.45), 0 1px 2px rgba(15, 23, 42, 0.04);
}
.mag-item.stock-row-mag-highlight.mag-card,
.mag-item.stock-row-mag-highlight.mag-row {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
    background: #eff6ff !important;
    box-shadow: inset 3px 0 0 #2563eb, 0 1px 2px rgba(15, 23, 42, 0.04);
}
.mag-selection-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: #007aff;
    white-space: nowrap;
}
.mag-select-mode-btn[aria-pressed="true"] {
    background: #007aff;
    border-color: #007aff;
    color: #fff;
}
@media (max-width: 560px) {
    .mag-row-side {
        flex: 0 0 5.5rem;
    }
}

/* popup scheda articolo */
.mag-scan-modal {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.mag-scan-modal.is-open {
    display: flex;
}
body.mag-scan-lock {
    overflow: hidden;
}
.mag-scan-sheet {
    width: min(94vw, 460px);
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    padding: 0.9rem 1rem 1.1rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    border-top: 6px solid #10b981;
}
.mag-scan--scarico .mag-scan-sheet {
    border-top-color: #ef4444;
}
.mag-scan-top {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 0.4rem;
}
.mag-scan-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}
.mag-scan-badge--ok {
    background: #d1fae5;
    color: #065f46;
}
.mag-scan-badge--new {
    background: #fef3c7;
    color: #92400e;
}
.mag-scan-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
    margin-bottom: 0.6rem;
}
.mag-scan-grid2 {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 0.75rem;
    align-items: start;
    margin-bottom: 0.75rem;
}
.mag-scan-photo {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mag-scan-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mag-scan-photo-ph {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1.7rem;
    color: #94a3b8;
}
.mag-scan-photo-ph small {
    font-size: 0.6rem;
    margin-top: 0.1rem;
}
.mag-scan-photo-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    border: none;
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.82);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.2rem 0.45rem;
    cursor: pointer;
}
.mag-scan-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.mag-scan-info-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px dashed #e5e7eb;
    padding-bottom: 0.25rem;
}
.mag-scan-info-row span {
    color: #6b7280;
    font-size: 0.82rem;
}
.mag-scan-info-row b {
    font-size: 1rem;
    color: #111827;
    font-variant-numeric: tabular-nums;
}
#magScanQtaStock {
    font-size: 1.15rem;
    color: #047857;
}
.mag-scan-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-bottom: 0.7rem;
}
.mag-scan-mode-btn {
    border: 2px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    border-radius: 12px;
    padding: 0.6rem;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
}
#magScanModeCarico.is-active {
    border-color: #10b981;
    background: #d1fae5;
    color: #065f46;
}
#magScanModeScarico.is-active {
    border-color: #ef4444;
    background: #fee2e2;
    color: #991b1b;
}
.mag-scan-field {
    margin-bottom: 0.6rem;
}
.mag-scan-field label {
    display: block;
    font-size: 0.8rem;
    color: #4b5563;
    margin-bottom: 0.2rem;
    font-weight: 600;
}
.mag-scan-field input {
    width: 100%;
    font-size: 1rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
}
.mag-scan-qty-block {
    margin: 0.4rem 0 0.7rem;
}
.mag-scan-qty-label {
    display: block;
    font-size: 0.8rem;
    color: #4b5563;
    margin-bottom: 0.3rem;
    font-weight: 600;
}
.mag-qty {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}
.mag-qty-step {
    flex: 0 0 auto;
    width: 3.2rem;
    border: none;
    border-radius: 12px;
    background: #111827;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}
.mag-qty-step:active {
    transform: scale(0.95);
}
.mag-qty-input {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 1.7rem;
    font-weight: 700;
    padding: 0.45rem;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    font-variant-numeric: tabular-nums;
}
.mag-qty-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.mag-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    margin-top: 0.5rem;
}
.mag-keypad button {
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 10px;
    padding: 0.65rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
}
.mag-keypad button:active {
    background: #e5e7eb;
}
.mag-keypad-aux {
    color: #b91c1c !important;
}
.mag-scan-hint {
    color: #b91c1c;
    font-size: 0.85rem;
    margin: 0 0 0.6rem;
}
.mag-scan-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.4rem;
}
.mag-round {
    border: none;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.mag-round--red {
    width: 3.6rem;
    height: 3.6rem;
    background: #ef4444;
    font-size: 1.6rem;
}
.mag-round--red:active {
    background: #dc2626;
    transform: scale(0.94);
}
.mag-round--green {
    min-width: 9rem;
    height: 3.6rem;
    padding: 0 1.3rem;
    background: #10b981;
    font-size: 1rem;
    font-weight: 700;
    gap: 0.45rem;
}
.mag-round--green:active {
    background: #059669;
    transform: scale(0.97);
}
.mag-round--green:disabled {
    background: #9ca3af;
    box-shadow: none;
    cursor: not-allowed;
}
.mag-round-check {
    font-size: 1.5rem;
    line-height: 1;
}
.mag-round--green.is-busy {
    opacity: 0.75;
    pointer-events: none;
}

/* toast feedback */
.mag-scan-toast {
    position: fixed;
    left: 50%;
    bottom: 1.4rem;
    transform: translate(-50%, 1.5rem);
    background: #111827;
    color: #fff;
    padding: 0.7rem 1.1rem;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 600;
    z-index: 12000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    max-width: 90vw;
    text-align: center;
}
.mag-scan-toast.is-on {
    opacity: 1;
    transform: translate(-50%, 0);
}
.mag-scan-toast--err {
    background: #b91c1c;
}
.mag-scan-toast--warn {
    background: #b45309;
}

/* prezzo consigliato dentro al popup / scheda */
.mag-scan-sug-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

/* link "apri scheda" nell'elenco */
.mag-row-scheda-link {
    color: #2563eb;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}
.mag-row-scheda-link:hover {
    text-decoration: underline;
}

/* ============================================================
   SCHEDA PRODOTTO (stile Amazon, full page)
   ============================================================ */
.mag-scheda {
    max-width: 1040px;
    margin: 0 auto;
}
.mag-scheda-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}
.mag-scheda-cat {
    flex: 1;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    font-weight: 700;
}
.mag-scheda-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

/* galleria */
.mag-scheda-gallery {
    position: sticky;
    top: 1rem;
}
.mag-gallery-main {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mag-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}
.mag-gallery-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    font-size: 3rem;
    color: #cbd5e1;
}
.mag-gallery-empty span {
    font-size: 0.9rem;
}
.mag-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.4rem;
    height: 2.4rem;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #111827;
}
.mag-gallery-prev { left: 0.5rem; }
.mag-gallery-next { right: 0.5rem; }
.mag-gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.6rem 0.1rem 0.2rem;
    scroll-snap-type: x mandatory;
}
.mag-gallery-thumb {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    background: #fff;
    padding: 0;
    cursor: pointer;
    scroll-snap-align: start;
}
.mag-gallery-thumb.is-active {
    border-color: #2563eb;
}
.mag-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mag-gallery-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

/* info / edit */
.mag-scheda-title {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
    line-height: 1.25;
}
.mag-scheda-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.mag-scheda-code {
    color: #6b7280;
    font-size: 0.9rem;
}
.mag-scheda-price {
    font-size: 2rem;
    font-weight: 800;
    color: #047857;
    margin-bottom: 1rem;
}
.mag-scheda-mov {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 0.9rem;
    margin-bottom: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    background: #fafafa;
}
.mag-scheda-mov-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}
.mag-scheda-mov-modes .mag-scan-mode-btn#magSchedaCarico.is-active {
    border-color: #10b981;
    background: #d1fae5;
    color: #065f46;
}
.mag-scheda-mov-modes .mag-scan-mode-btn#magSchedaScarico.is-active {
    border-color: #ef4444;
    background: #fee2e2;
    color: #991b1b;
}
.mag-scheda-mov .mag-round {
    align-self: center;
}
.mag-scheda-edit {
    border-top: 1px solid #e5e7eb;
    padding-top: 0.9rem;
}
.mag-scheda-edit h3 {
    margin: 0 0 0.7rem;
    font-size: 1.05rem;
}
.mag-scheda-edit textarea {
    width: 100%;
    font-size: 1rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    resize: vertical;
    font-family: inherit;
}
.mag-scheda-edit-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}
.mag-scheda-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    color: #4b5563;
    margin: 0.6rem 0 0.8rem;
    cursor: pointer;
}
.mag-scheda-save-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.mag-scheda-savemsg {
    font-size: 0.85rem;
    color: #6b7280;
}
.mag-scheda-savemsg.is-ok { color: #047857; }
.mag-scheda-savemsg.is-err { color: #b91c1c; }

@media (max-width: 820px) {
    .mag-scheda-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .mag-scheda-gallery {
        position: static;
    }
    .mag-scheda-title {
        font-size: 1.3rem;
    }
}

/* bottom sheet su smartphone */
@media (max-width: 640px) {
    .mag-scan-modal {
        align-items: flex-end;
        padding: 0;
    }
    .mag-scan-sheet {
        width: 100%;
        max-height: 96vh;
        border-radius: 20px 20px 0 0;
        padding-bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
    }
    .mag-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.55rem;
    }
    .mag-scan-actions {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding-top: 0.5rem;
    }
    .mag-scheda-edit-row {
        grid-template-columns: 1fr;
    }
}

/* ===== Pagina Fornitore (feed Mobiparts) ===== */
.forn-sync-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.forn-sync-status {
    font-size: .9rem;
    color: #374151;
}
.forn-search-row {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: flex-end;
    max-width: 40rem;
}
.forn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .85rem;
    margin-top: .9rem;
}
.forn-card-img {
    position: relative;
}
.forn-badge {
    position: absolute;
    top: .4rem;
    left: .4rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    padding: .15rem .4rem;
    border-radius: 999px;
    color: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .25);
}
.forn-badge--acc { background: #2563eb; }
.forn-badge--ric { background: #d97706; }
.forn-counter {
    margin: .25rem 0 0;
    font-size: .82rem;
    color: #64748b;
}
.forn-progress {
    margin: .8rem 0 .2rem;
    max-width: 36rem;
}
.forn-progress-track {
    width: 100%;
    height: 14px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}
.forn-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #2563eb, #06b6d4);
    border-radius: 999px;
    transition: width .4s ease;
}
.forn-progress-label {
    margin-top: .35rem;
    font-size: .85rem;
    font-weight: 600;
    color: #1f2937;
}
/* vista elenco fornitore */
.forn-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: .9rem;
}
.forn-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    padding: .5rem .65rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.forn-row-img {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.forn-row-img img { width: 100%; height: 100%; object-fit: contain; }
.forn-row-main { flex: 1; min-width: 0; }
.forn-row-name {
    font-weight: 600;
    font-size: .9rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.forn-row-side {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .25rem;
}
.forn-row-side .forn-add-btn {
    width: auto;
    margin-top: .15rem;
    padding: .35rem .6rem;
    font-size: .82rem;
}
@media (max-width: 560px) {
    .forn-row-side { flex: 0 0 7.5rem; }
    .forn-row-side .forn-add-btn { width: 100%; }
}
.forn-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.forn-card-img {
    aspect-ratio: 1 / 1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.forn-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.forn-card-noimg {
    font-size: 2.4rem;
    opacity: .4;
}
.forn-card-body {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: .6rem .7rem .7rem;
    flex: 1;
}
.forn-card-name {
    font-weight: 600;
    font-size: .92rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.forn-card-meta {
    font-size: .78rem;
    color: #6b7280;
}
.forn-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}
.forn-card-price {
    font-weight: 700;
    color: #0f172a;
}
.forn-card-stock {
    font-size: .78rem;
    color: #047857;
}
.forn-add-btn {
    margin-top: .45rem;
    width: 100%;
    font-size: .85rem;
    padding: .45rem .5rem;
}
@media (max-width: 640px) {
    .forn-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: .6rem;
    }
    .forn-card-name { font-size: .85rem; }
}

/* Pulsante chiudi rosso (×) — standard gestionale */
button.soft-clear-btn,
.soft-clear-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    border-radius: 50% !important;
    border: 1px solid #fecaca !important;
    background: #fff1f2 !important;
    color: #be123c !important;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.35rem !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    flex-shrink: 0;
    box-sizing: border-box;
    aspect-ratio: 1 / 1;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
button.soft-clear-btn:hover,
.soft-clear-btn:hover {
    background: #ffe4e6 !important;
    border-color: #fda4af !important;
    transform: scale(1.05);
}
.repair-image-editor-head .soft-clear-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    font-size: 1.5rem !important;
}

.repair-lightbox-edit-btn { font-weight: 600; }
.repair-image-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}
.repair-image-editor-head h3 { margin: 0; font-size: 1.1rem; }
.repair-image-editor-toolbar--modern {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.7rem;
    padding: 0.4rem;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 14px;
}
.repair-editor-tool-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}
.repair-editor-tool-group + .repair-editor-tool-group {
    padding-left: 0.35rem;
    margin-left: 0.05rem;
    border-left: 1px solid #e5e9f0;
}
.repair-editor-tool-group--meta { margin-left: auto; }
.repair-editor-tool {
    border: 1px solid transparent;
    background: transparent;
    color: #334155;
    border-radius: 9px;
    padding: 0.42rem 0.62rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.repair-editor-tool:hover { background: #eef2f7; }
.repair-editor-tool:active { transform: scale(0.97); }
.repair-editor-tool.is-active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}
.repair-editor-tool.is-crop-apply {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}
.repair-editor-tool.is-crop-apply:hover { background: #15803d; }
.repair-editor-tool.is-reset,
.repair-editor-tool.is-watermark { color: #64748b; }
.repair-editor-tool[disabled] { opacity: 0.4; cursor: not-allowed; }
.repair-image-editor-inline {
    border: 1px solid #e6eaf0;
    background: #fff;
}
.repair-image-editor-hint {
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 0 0 0.6rem;
    line-height: 1.45;
}
.repair-image-edit-toggle.is-active {
    background: #dbeafe;
    border-color: #60a5fa;
    color: #1e40af;
}
.repair-image-editor-save { margin-top: 0.75rem; }

.repair-internal-notes-card {
    padding: 0;
    overflow: hidden;
    border-left: 4px solid #6366f1;
}
.repair-internal-notes-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 1rem 1.2rem;
    margin: 0;
    border: none;
    border-radius: 0;
    background: linear-gradient(180deg, #fafbff 0%, #f8fafc 100%);
    color: #1e293b;
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: background 0.18s ease;
}
.repair-internal-notes-trigger:hover {
    background: linear-gradient(180deg, #f5f7ff 0%, #f1f5f9 100%);
}
.repair-internal-notes-trigger:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: -2px;
}
.repair-internal-notes-card.is-open .repair-internal-notes-trigger {
    border-bottom: 1px solid #e2e8f0;
}
.repair-internal-notes-trigger-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}
.repair-internal-notes-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 10px;
    background: #eef2ff;
    color: #4f46e5;
}
.repair-internal-notes-trigger-text {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}
.repair-internal-notes-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.25;
}
.repair-internal-notes-sub {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.3;
}
.repair-internal-notes-chevron {
    flex-shrink: 0;
    display: inline-flex;
    color: #94a3b8;
    transition: transform 0.22s ease, color 0.18s ease;
}
.repair-internal-notes-card.is-open .repair-internal-notes-chevron,
.repair-internal-notes-trigger.is-open .repair-internal-notes-chevron {
    transform: rotate(180deg);
    color: #6366f1;
}
.repair-internal-notes-panel {
    display: none;
    padding: 0.95rem 1.2rem 1.15rem;
    background: #fff;
}
.repair-internal-notes-card.is-open .repair-internal-notes-panel {
    display: block;
}
.repair-internal-notes-body {
    white-space: pre-wrap;
    line-height: 1.55;
    color: #334155;
    font-size: 0.92rem;
    padding: 0.85rem 0.95rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* ===== Collassabile generico (usato per Foto riparazione) ===== */
.repair-collapse-card {
    padding: 0;
    overflow: hidden;
    border-left: 4px solid #0ea5e9;
}
.repair-collapse-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 1rem 1.2rem;
    margin: 0;
    border: none;
    border-radius: 0;
    background: linear-gradient(180deg, #f6fbff 0%, #f8fafc 100%);
    color: #1e293b;
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: background 0.18s ease;
}
.repair-collapse-trigger:hover {
    background: linear-gradient(180deg, #eef8ff 0%, #f1f5f9 100%);
}
.repair-collapse-trigger:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: -2px;
}
.repair-collapse-card.is-open .repair-collapse-trigger {
    border-bottom: 1px solid #e2e8f0;
}
.repair-collapse-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}
.repair-collapse-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 10px;
    background: #e0f2fe;
    color: #0284c7;
}
.repair-collapse-text {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}
.repair-collapse-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.25;
}
.repair-collapse-sub {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.3;
}
.repair-collapse-chevron {
    flex-shrink: 0;
    display: inline-flex;
    color: #94a3b8;
    transition: transform 0.22s ease, color 0.18s ease;
}
.repair-collapse-card.is-open .repair-collapse-chevron,
.repair-collapse-trigger.is-open .repair-collapse-chevron {
    transform: rotate(180deg);
    color: #0ea5e9;
}
.repair-collapse-panel {
    padding: 1.1rem 1.2rem 1.25rem;
    background: #fff;
}

/* ===== Area clienti e sito web (dentro tendina foto) ===== */
.repair-visibility-block {
    margin-top: 1.35rem;
    padding-top: 1.15rem;
    border-top: 1px solid #eef2f7;
}
.repair-visibility-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}
.repair-visibility-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}
.repair-visibility-portal-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: #0284c7;
    text-decoration: none;
    white-space: nowrap;
}
.repair-visibility-portal-link:hover {
    text-decoration: underline;
}
.repair-visibility-switches {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.repair-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    user-select: none;
}
.repair-switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}
.repair-switch-track {
    position: relative;
    flex-shrink: 0;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 0.18s ease;
}
.repair-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
    transition: transform 0.18s ease;
}
.repair-switch input:checked + .repair-switch-track {
    background: #16a34a;
}
.repair-switch input:checked + .repair-switch-track .repair-switch-thumb {
    transform: translateX(18px);
}
.repair-switch input:focus-visible + .repair-switch-track {
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.4);
}
.repair-switch-label {
    font-size: 0.9rem;
    color: #334155;
    font-weight: 500;
}
.repair-visibility-hint {
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 0 0 0.75rem;
    line-height: 1.45;
}
.repair-visibility-actions {
    margin-top: 0.35rem;
    display: flex;
    justify-content: flex-end;
}

/* Pillole Cliente/Sito sotto ogni foto nella griglia */
.repair-photo-vis {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 4px;
    display: flex;
    gap: 0.25rem;
    z-index: 3;
    pointer-events: auto;
}
.repair-photos-section.is-select-on .repair-photo-vis {
    display: none;
}
.repair-photo-vis-pill {
    flex: 1;
    border: none;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.28rem 0.2rem;
    border-radius: 7px;
    color: #fff;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: background 0.14s ease, transform 0.1s ease;
}
.repair-photo-vis-pill:active {
    transform: scale(0.95);
}
.repair-photo-vis-pill[data-vis-role="cliente"][aria-pressed="true"] {
    background: #16a34a;
}
.repair-photo-vis-pill[data-vis-role="sito"][aria-pressed="true"] {
    background: #0ea5e9;
}

/* ===== Fornitori multi-provider (elenco) ===== */
.forn-provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: .85rem;
    margin-top: .5rem;
}
.forn-provider-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    padding: .9rem 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.forn-provider-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
}
.forn-provider-card-head h3 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.25;
}
.forn-provider-card .forn-badge {
    position: static;
    box-shadow: none;
    flex-shrink: 0;
}
.forn-provider-site {
    margin: 0;
    font-size: .82rem;
    word-break: break-all;
}
.forn-provider-site a { color: #2563eb; }
.forn-provider-meta,
.forn-provider-sync {
    margin: 0;
    font-size: .82rem;
    color: #64748b;
    line-height: 1.35;
}
.forn-provider-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .35rem;
}

/* ===== Modal ricerca ricambi in scheda riparazione ===== */
.repair-parts-overlay .repair-parts-box {
    width: min(1120px, 98vw);
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.repair-parts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .6rem;
}
.repair-parts-head h3 { margin: 0; font-size: 1.15rem; }
.repair-parts-close {
    border: none;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 0 .2rem;
}
.repair-parts-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .55rem .75rem;
    align-items: end;
    margin-bottom: .5rem;
}
.repair-parts-filters .form-group { margin: 0; }
.repair-parts-hint {
    margin: 0 0 .55rem;
    font-size: .85rem;
    color: #64748b;
}
.repair-parts-grid {
    flex: 1;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .75rem;
    min-height: 10rem;
    max-height: 58vh;
    padding: .15rem .2rem .35rem 0;
}
.repair-parts-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    padding: .55rem .6rem .6rem;
    background: #fff;
    min-height: 280px;
    transition: box-shadow .2s ease, border-color .2s ease;
}
.repair-parts-card:hover {
    box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
}
.repair-parts-card--best {
    border-color: #dc2626;
    animation: repair-parts-pulse 1.4s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, .35);
}
@keyframes repair-parts-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .28); }
    50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, .06); }
}
.repair-parts-best-badge {
    position: absolute;
    top: .45rem;
    right: .45rem;
    z-index: 2;
    background: #dc2626;
    color: #fff;
    font-size: .62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .2rem .45rem;
    border-radius: 999px;
}
.repair-parts-card-top {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .45rem;
    min-height: 24px;
}
.repair-parts-card-logo {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
}
.repair-parts-card-logo-fallback {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    color: #fff;
    font-size: .58rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.repair-parts-card-supplier {
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
    line-height: 1.1;
}
.repair-parts-card-img {
    width: 100%;
    height: 120px;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: .5rem;
}
.repair-parts-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: .35rem;
}
.repair-parts-noimg { font-size: 2rem; opacity: .45; }
.repair-parts-card-name {
    margin: 0;
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.28;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.2em;
}
.repair-parts-card-meta {
    font-size: .72rem;
    color: #64748b;
    margin-top: .2rem;
    min-height: 1em;
    word-break: break-all;
}
.repair-parts-card-foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .35rem;
    margin-top: auto;
    padding-top: .45rem;
}
.repair-parts-price {
    font-weight: 800;
    color: #047857;
    font-size: 1rem;
}
.repair-parts-price--muted {
    color: #64748b;
    font-size: .82rem;
    font-weight: 700;
}
.repair-parts-stock { font-size: .72rem; white-space: nowrap; }
.repair-parts-stock--ok { color: #047857; }
.repair-parts-stock--no { color: #b91c1c; }
.repair-parts-card-actions {
    display: flex;
    gap: .35rem;
    justify-content: flex-end;
    margin-top: .45rem;
}
.repair-parts-loading,
.repair-parts-empty {
    grid-column: 1 / -1;
    margin: .5rem 0;
    color: #64748b;
    font-size: .9rem;
}
.repair-parts-toast {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%) translateY(12px);
    background: #0f172a;
    color: #fff;
    padding: .55rem 1rem;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 600;
    z-index: 12000;
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .28);
}
.repair-parts-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
@media (max-width: 640px) {
    .repair-parts-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .repair-parts-card { min-height: 250px; }
    .repair-parts-card-img { height: 96px; }
}

/* Dispositivi usati — acquisto / etichette */
.disp-acq-page { max-width: 960px; }
.disp-acq-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: 1rem;
}
.disp-acq-header h2 { margin: 0 0 .25rem; font-size: 1.35rem; }
.disp-acq-grid {
    display: grid;
    grid-template-columns: minmax(260px, 340px) 1fr;
    gap: 1rem;
    align-items: start;
}
.disp-acq-scan-card h3,
.disp-acq-form h3 { margin: 0 0 .75rem; font-size: 1.05rem; }
.disp-acq-scan-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .65rem;
}
.disp-acq-scanner {
    margin: .5rem 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: #0f172a;
}
.disp-acq-scanner #dispScannerReader { min-height: 220px; }
.disp-acq-status {
    margin: .5rem 0 0;
    font-size: .88rem;
    color: #047857;
    font-weight: 600;
}
.disp-acq-status.is-error { color: #b91c1c; }
.disp-acq-messages {
    margin: .35rem 0 0;
    padding-left: 1.1rem;
    font-size: .82rem;
    color: #64748b;
}
.disp-acq-inline-btn { margin-top: .35rem; }
.disp-acq-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
}
.disp-acq-search {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: flex-end;
    margin-bottom: 1rem;
    padding: .85rem 1rem;
}
.disp-acq-info-card { margin-top: 1.25rem; }
.disp-acq-info-card h3 { margin: 0 0 .5rem; font-size: 1rem; }
.disp-acq-tips {
    margin: 0;
    padding-left: 1.15rem;
    font-size: .9rem;
    color: var(--text-secondary);
}
.disp-acq-tips li { margin-bottom: .35rem; }
.disp-acq-tips code {
    background: #f1f5f9;
    padding: .1rem .35rem;
    border-radius: 4px;
    font-size: .85em;
}
.home-card-tile--usati {
    --home-tile-accent: #0d9488;
    --home-tile-bg: linear-gradient(145deg, #ccfbf1 0%, #f0fdfa 100%);
}
@media (max-width: 820px) {
    .disp-acq-grid { grid-template-columns: 1fr; }
}
.disp-acq-usb-banner {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .65rem;
    margin-bottom: .65rem;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    font-weight: 600;
    color: #047857;
}
.disp-acq-usb-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: disp-usb-pulse 1.4s ease-in-out infinite;
}
@keyframes disp-usb-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}
.disp-bridge-code {
    background: #0f172a;
    color: #e2e8f0;
    padding: .65rem .85rem;
    border-radius: var(--radius-sm);
    font-size: .82rem;
    overflow-x: auto;
    margin: .35rem 0 .65rem;
}
.disp-bridge-status-card { margin-top: 1rem; }

.bridges-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.bridges-status-card h3,
.bridges-actions-card h3 { margin: 0 0 .5rem; font-size: 1.05rem; }

/* --- WhatsApp negozio --- */
.wa-page-chat {
  --wa-green: #128c7e;
  --wa-green-soft: #25d366;
  --wa-ink: #0f172a;
  --wa-muted: #64748b;
  --wa-line: #e2e8f0;
  max-width: 1100px;
}
.wa-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--wa-line);
}
.wa-topbar-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.wa-topbar-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--wa-green-soft), var(--wa-green));
  box-shadow: 0 4px 14px rgba(18, 140, 126, 0.28);
  flex-shrink: 0;
}
.wa-topbar-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--wa-ink);
  line-height: 1.2;
}
.wa-topbar-sub {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--wa-muted);
}
.wa-topbar-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}
.wa-topbar-me {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--wa-muted);
}
.wa-topbar-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.wa-badge {
  display: inline-block;
  font-weight: 700;
  padding: .35rem .75rem;
  border-radius: 999px;
  font-size: .82rem;
  margin: 0;
}
.wa-badge-ok { background: #dcfce7; color: #166534; }
.wa-badge-wait { background: #fef9c3; color: #854d0e; }
.wa-badge-loading { background: #e2e8f0; color: #334155; }
.wa-badge-off { background: #f1f5f9; color: #64748b; }
.wa-badge-err { background: #fee2e2; color: #991b1b; }
.wa-qr-panel {
  margin: 0 0 1rem;
  padding: 1.25rem;
  border: 1px solid var(--wa-line);
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fafc, #fff);
  text-align: center;
}
.wa-qr-panel-inner { max-width: 360px; margin: 0 auto; }
.wa-qr-panel h2 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  color: var(--wa-ink);
}
.wa-qr-panel p {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--wa-muted);
  line-height: 1.45;
}
.wa-qr-img {
  width: min(220px, 52vw);
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--wa-line);
  border-radius: 12px;
  padding: 8px;
  background: #fff;
  object-fit: contain;
}
.wa-qr-update {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #b45309;
}
.wa-counts { margin: 0.65rem 0; display: flex; gap: .4rem; flex-wrap: wrap; }
.wa-pill {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
}
.wa-pill-ok { background: #dcfce7; color: #166534; }
.wa-pill-wait { background: #fef9c3; color: #854d0e; }
.wa-pill-err { background: #fee2e2; color: #991b1b; }
.wa-log-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.wa-log-table th, .wa-log-table td { padding: .45rem .5rem; border-bottom: 1px solid #eef2f7; text-align: left; vertical-align: top; }
.wa-err { color: #b91c1c; }
.wa-empty-hint { color: var(--wa-muted); font-size: 0.88rem; margin: 0.75rem; }
.wa-empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  text-align: center;
  padding: 1.5rem;
}
.wa-page-foot {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--wa-muted);
  line-height: 1.45;
}
.wa-icon-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid var(--wa-line);
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: #334155;
}
.wa-icon-btn:hover { background: #f8fafc; }

.link-hub-send {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.link-hub-phone {
  width: 7.5rem;
  max-width: 28vw;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 8px;
  font-size: 0.85rem;
}
.wa-chat-shell {
  display: grid;
  grid-template-columns: minmax(240px, 34%) 1fr;
  min-height: min(72vh, 680px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--wa-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}
.wa-chat-list {
  border-right: 1px solid var(--wa-line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fafbfc;
}
.wa-chat-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--wa-line);
  background: #fff;
}
.wa-chat-list-head strong {
  font-size: 0.92rem;
  color: var(--wa-ink);
}
.wa-chat-list-actions { display: flex; gap: 0.35rem; align-items: center; }
.wa-unread {
  display: inline-block;
  margin-left: 0.4rem;
  min-width: 1.25rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--wa-green-soft);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}
.wa-attach-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  font-size: 1.35rem;
  font-weight: 500;
  color: #475569;
  flex-shrink: 0;
}
.wa-attach-btn:hover { border-color: var(--wa-green); color: var(--wa-green); }
.wa-compose-main { flex: 1; display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.wa-attach-preview {
  font-size: 0.78rem;
  color: #334155;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
}
.wa-media-load {
  display: inline-block;
  margin-top: 0.25rem;
  border: 0;
  background: rgba(15,23,42,0.06);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}
.wa-inline-media {
  display: block;
  max-width: min(100%, 280px);
  border-radius: 8px;
  margin-top: 0.25rem;
}
.wa-inline-media-link {
  display: inline-block;
  margin-top: 0.25rem;
  color: #0369a1;
  font-size: 0.85rem;
}
.wa-chat-list-body {
  overflow-y: auto;
  flex: 1;
  padding: 0.4rem;
}
.wa-chat-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
  cursor: pointer;
  margin-bottom: 0.15rem;
  transition: background 0.12s ease;
}
.wa-chat-item:hover { background: #f1f5f9; }
.wa-chat-item.is-active {
  background: #ecfdf5;
  box-shadow: inset 3px 0 0 var(--wa-green-soft);
}
.wa-chat-item-title { display: block; font-weight: 700; font-size: 0.92rem; color: var(--wa-ink); }
.wa-chat-item-preview {
  display: block;
  font-size: 0.78rem;
  color: var(--wa-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}
.wa-chat-item-meta { display: block; font-size: 0.7rem; color: #94a3b8; margin-top: 0.2rem; }
.wa-chat-thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #e8ebe6;
  background-image:
    radial-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 16px 16px;
}
.wa-chat-thread-head {
  padding: 0.85rem 1.1rem;
  background: #fff;
  border-bottom: 1px solid var(--wa-line);
}
.wa-chat-thread-head strong {
  font-size: 1rem;
  color: var(--wa-ink);
}
.wa-thread-sub {
  font-size: 0.78rem;
  color: var(--wa-muted);
  margin-top: 0.15rem;
}
.wa-chat-thread-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.wa-bubble {
  max-width: min(78%, 420px);
  padding: 0.55rem 0.75rem 0.35rem;
  border-radius: 12px;
  box-shadow: 0 1px 1px rgba(0,0,0,.06);
  font-size: 0.92rem;
  line-height: 1.35;
  word-break: break-word;
}
.wa-bubble-in { align-self: flex-start; background: #fff; border-top-left-radius: 4px; }
.wa-bubble-out { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 4px; }
.wa-bubble-time { font-size: 0.68rem; color: #64748b; text-align: right; margin-top: 0.25rem; }
.wa-bubble-media { font-size: 0.78rem; color: #475569; margin-top: 0.2rem; }
.wa-bubble-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}
.wa-bubble-tipo {
  font-size: 0.68rem;
  font-weight: 650;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.wa-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-top: 0.28rem;
  flex-wrap: wrap;
}
.wa-bubble-meta .wa-bubble-time { margin-top: 0; }
.wa-bubble-meta .wa-pill {
  font-size: 0.62rem;
  padding: 0.08rem 0.4rem;
}
.wa-bubble-queued {
  opacity: 0.92;
  border: 1px dashed rgba(15, 118, 110, 0.35);
}
.wa-bubble-failed {
  border: 1px solid rgba(185, 28, 28, 0.25);
  background: #fee2e2;
}
.wa-bubble-del {
  margin-left: auto;
}
.wa-ticks {
  font-size: 0.72rem;
  letter-spacing: -0.12em;
  line-height: 1;
  font-weight: 700;
}
.wa-ticks-wait { color: #94a3b8; letter-spacing: 0; font-weight: 500; }
.wa-ticks-sent { color: #64748b; }
.wa-ticks-delivered { color: #64748b; }
.wa-ticks-read { color: #53bdeb; }
.wa-ticks-err { color: #b91c1c; letter-spacing: 0; }
.wa-queue-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.35rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  vertical-align: middle;
}
.wa-queue-bar {
  margin: 0;
  border: 0;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 0;
  max-height: none;
  overflow: visible;
  background: rgba(248, 250, 252, 0.95);
  padding: 0.55rem 1rem 0.65rem;
}
.wa-queue-bar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.wa-queue-alert-inline {
  margin-top: 0.45rem;
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: #64748b;
}
.wa-queue-alert-inline strong { color: #0f172a; font-size: 0.82rem; }
.wa-chat-compose {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  padding: 0.7rem 0.85rem;
  background: #f0f2f5;
  border-top: 1px solid var(--wa-line);
}
.wa-chat-compose textarea {
  flex: 1;
  resize: none;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 0.6rem 0.85rem;
  font: inherit;
  min-height: 2.55rem;
  max-height: 120px;
  background: #fff;
}
.wa-chat-compose textarea:focus {
  outline: none;
  border-color: var(--wa-green);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.18);
}
.wa-compose-send {
  flex-shrink: 0;
  min-width: 4.5rem;
}
.wa-compose-numero {
  width: 8.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.5rem 0.55rem;
  font: inherit;
  background: #fff;
}
.wa-log-details {
  margin-top: 1.1rem;
  border: 1px solid var(--wa-line);
  border-radius: 12px;
  padding: 0.65rem 1rem 0.85rem;
  background: #fff;
}
.wa-log-details summary {
  cursor: pointer;
  font-weight: 700;
  padding: 0.35rem 0;
  color: var(--wa-ink);
  list-style-position: outside;
}
.wa-log-summary-hint {
  font-weight: 500;
  color: var(--wa-muted);
  font-size: 0.85rem;
}
.wa-log-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin: 0.5rem 0 0.35rem;
}
.wa-queue-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.65rem 0 0.4rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
}
.wa-queue-alert strong {
  display: block;
  color: #991b1b;
  font-size: 0.95rem;
}
.wa-queue-alert p {
  margin: 0.25rem 0 0;
  font-size: 0.84rem;
  color: #7f1d1d;
  line-height: 1.4;
}
.wa-queue-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.wa-queue-hold-hint {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #b45309;
  max-width: 28rem;
}
.wa-queue-del-cell {
  width: 48px;
  text-align: center;
  vertical-align: middle;
}
.wa-log-row-open {
  background: #fffbeb;
}
.wa-queue-x {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.12s;
}
.wa-queue-x:hover {
  background: #fee2e2;
  transform: scale(1.05);
}
.wa-queue-x:disabled {
  opacity: 0.5;
  cursor: wait;
}
.wa-need-qr {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fffbeb, #fff);
}
.wa-need-qr .btn { margin-top: 0.35rem; }
.wa-connecting-box {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #eff6ff, #fff);
}
.wa-connecting-spinner {
  width: 36px;
  height: 36px;
  margin: 0.75rem auto 0;
  border-radius: 50%;
  border: 3px solid #dbeafe;
  border-top-color: #2563eb;
  animation: waSpin 0.8s linear infinite;
}
@keyframes waSpin {
  to { transform: rotate(360deg); }
}

/* Overlay WhatsApp stile Apple */
.wa-apple-modal {
  position: fixed;
  inset: 0;
  z-index: 95000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.wa-apple-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.wa-apple-modal[hidden] { display: none !important; }
.wa-apple-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}
.wa-apple-sheet {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: min(90vh, 820px);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  animation: waAppleIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes waAppleIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.wa-apple-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.55);
}
.wa-apple-head-left {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}
.wa-apple-dot {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 10px;
  background: linear-gradient(145deg, #25d366, #128c7e);
  flex-shrink: 0;
}
.wa-apple-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}
.wa-apple-status {
  margin: 0.2rem 0 0;
  font-size: 0.72rem !important;
  padding: 0.15rem 0.5rem !important;
}
.wa-apple-head-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.wa-apple-head-actions {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.wa-apple-close {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  border: 0;
  background: rgba(15, 23, 42, 0.07);
  color: #334155;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.wa-apple-close:hover { background: rgba(15, 23, 42, 0.12); }
.wa-apple-shell {
  flex: 1;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: min(52vh, 480px);
}
.wa-apple-qr {
  margin: 0.5rem 1rem;
  flex-shrink: 0;
  overflow: auto;
  max-height: min(58vh, 420px);
}
.wa-apple-modal.is-showing-qr .wa-apple-sheet {
  max-height: min(92vh, 760px);
}
.wa-apple-modal.is-showing-qr .wa-apple-shell {
  display: none;
}
.wa-apple-modal.is-showing-qr .wa-apple-queue {
  display: none;
}
.wa-apple-modal.is-showing-qr .wa-apple-qr {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: none;
  margin: 0.75rem 1.25rem 1.25rem;
  overflow: auto;
}
.wa-apple-modal.is-showing-qr .wa-qr-panel-inner {
  max-width: 280px;
}
.wa-apple-modal.is-showing-qr .wa-qr-img {
  width: min(240px, 56vw, 42vh);
}
.wa-apple-queue {
  margin: 0;
  border: 0;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 0;
  background: rgba(248, 250, 252, 0.9);
}
body.wa-apple-open { overflow: hidden; }
.wa-chat-thread.is-dragover {
  outline: 2px dashed #25d366;
  outline-offset: -6px;
  background: rgba(37, 211, 102, 0.08);
}
.wa-drop-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  padding: 0.75rem 1.1rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-weight: 650;
  font-size: 0.9rem;
  pointer-events: none;
}
.wa-chat-thread { position: relative; }

/* Notifica centrata esito invio */
.drdex-center-notice {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.drdex-center-notice.is-visible { opacity: 1; }
.drdex-center-notice[hidden] { display: none !important; }
.drdex-center-notice-card {
  min-width: min(320px, 86vw);
  max-width: 420px;
  padding: 1.35rem 1.5rem 1.25rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
  text-align: center;
  animation: waAppleIn 0.28s ease;
}
.drdex-center-notice-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.65rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}
.drdex-center-notice.is-ok .drdex-center-notice-icon { background: #16a34a; }
.drdex-center-notice.is-err .drdex-center-notice-icon { background: #dc2626; }
.drdex-center-notice-card strong {
  display: block;
  font-size: 1.1rem;
  color: #0f172a;
}
.drdex-center-notice-card p {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.4;
}

@media (max-width: 820px) {
  .wa-chat-shell { grid-template-columns: 1fr; min-height: 0; }
  .wa-chat-list { max-height: 220px; border-right: 0; border-bottom: 1px solid var(--wa-line); }
  .wa-topbar-status { align-items: flex-start; }
  .wa-apple-sheet { max-height: 94vh; border-radius: 16px; }
  .wa-apple-shell { min-height: 48vh; }
  .link-hub-actions { white-space: normal; }
  .link-hub-send { display: flex; margin: 0.35rem 0 0; }
}

/* --- Notifiche a schermo intero bloccanti --- */
.drdex-fs-notif-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.drdex-fs-notif-overlay.is-visible { display: flex; animation: drdexFsFade .18s ease-out; }
@keyframes drdexFsFade { from { opacity: 0; } to { opacity: 1; } }
.drdex-fs-notif-card {
  width: min(560px, 94vw);
  background: #ffffff;
  border-radius: 22px;
  padding: 2rem 1.75rem 1.6rem;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  animation: drdexFsPop .2s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes drdexFsPop { from { transform: scale(.94); opacity: .6; } to { transform: scale(1); opacity: 1; } }
.drdex-fs-notif-count {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
  font-size: .78rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.drdex-fs-notif-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: .6rem;
}
.drdex-fs-notif-title { margin: 0 0 .6rem; font-size: 1.4rem; color: #0f172a; }
.drdex-fs-notif-msg { color: #334155; font-size: 1.02rem; line-height: 1.5; white-space: normal; word-break: break-word; }
.drdex-fs-notif-time { color: #94a3b8; font-size: .8rem; margin-top: .9rem; }
.drdex-fs-notif-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: .6rem;
  justify-content: center;
  flex-wrap: wrap;
}
.drdex-fs-notif-actions .btn { min-width: 150px; font-size: 1.02rem; padding: .7rem 1.2rem; }
.drdex-fs-notif-ok { font-weight: 700; }

/* --- Modale conferma invio WhatsApp cambio stato --- */
.drdex-wa-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.drdex-wa-confirm-overlay.is-visible { display: flex; }
.drdex-wa-confirm-card {
  width: min(520px, 94vw);
  background: #fff;
  border-radius: 20px;
  padding: 1.6rem 1.5rem 1.35rem;
  box-shadow: 0 24px 70px rgba(0,0,0,.32);
}
.drdex-wa-confirm-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.drdex-wa-confirm-head .wa-ico { font-size: 1.6rem; }
.drdex-wa-confirm-head h3 { margin: 0; font-size: 1.2rem; color: #0f172a; }
.drdex-wa-confirm-sub { color: #64748b; font-size: .9rem; margin: 0 0 .8rem; }
.drdex-wa-confirm-preview {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: .8rem .9rem;
  color: #14532d;
  font-size: .92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
}
.drdex-wa-confirm-to { color: #334155; font-size: .86rem; margin: .7rem 0 0; }
.drdex-wa-confirm-actions { margin-top: 1.2rem; display: flex; gap: .55rem; justify-content: flex-end; flex-wrap: wrap; }
.drdex-wa-confirm-actions .btn { min-width: 130px; }


/* —— Ricambi hub stile Foneday Parti —— */
.ricambi-hub { max-width: 1100px; margin: 0 auto; }
.ricambi-hub-bar {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}
.ricambi-hub-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.15rem;
  color: #0f2744;
}
.ricambi-hub-sub {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}
.ricambi-hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.ricambi-fd {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(220px, 1fr) minmax(240px, 1.2fr);
  min-height: 420px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(15, 39, 68, 0.06);
}
.ricambi-fd-col {
  border-right: 1px solid #e8eef5;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}
.ricambi-fd-col:last-child { border-right: 0; }
.ricambi-fd-colhead {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 0.9rem 0.7rem;
  border-bottom: 1px solid #eef2f7;
}
.ricambi-fd-colhead strong {
  font-size: 0.95rem;
  color: #0f2744;
  font-weight: 700;
}
.ricambi-fd-search {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
}
.ricambi-fd-search-ico { color: #94a3b8; font-size: 0.95rem; line-height: 1; }
.ricambi-fd-search input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.86rem;
  color: #0f2744;
  padding: 0.15rem 0;
}
.ricambi-fd-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  overflow: auto;
  flex: 1;
}
.ricambi-fd-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.72rem 1rem;
  text-decoration: none;
  color: #0f2744;
  font-size: 0.95rem;
  font-weight: 500;
  border-right: 3px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.ricambi-fd-item:hover { background: #f5f9ff; }
.ricambi-fd-item.is-active {
  background: #e8f1ff;
  border-right-color: #2f6fed;
  font-weight: 650;
}
.ricambi-fd-item--muted { color: #64748b; font-weight: 500; font-size: 0.88rem; }
.ricambi-fd-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
}
.ricambi-fd-count {
  margin-left: auto;
  font-style: normal;
  font-size: 0.78rem;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}
.ricambi-fd-empty {
  padding: 2rem 1.2rem;
  color: #94a3b8;
  font-size: 0.92rem;
}
.ricambi-fd-all { margin-top: 0.35rem; border-top: 1px solid #eef2f7; padding-top: 0.25rem; }
.ricambi-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.65rem 0.8rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.ricambi-filter-bar a { font-weight: 500; }
.mag-scheda-tax-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.mag-scheda-tax-row--3 { grid-template-columns: 1fr 1fr 1fr; }
.mag-scheda-tax-row--2 { grid-template-columns: 1fr 1fr; }
.mag-scheda-models-field #magSchedaModelFilter {
  width: 100%;
  margin-bottom: 0.4rem;
}
.mag-scheda-models-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}
.mag-scheda-models-box {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.55rem;
  background: #fafbfc;
}
.mag-scheda-model-chk {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0;
  font-size: 0.9rem;
  cursor: pointer;
}
.mag-scheda-model-chk input { margin: 0; width: 1rem; height: 1rem; }
.mag-scheda-models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.15rem 0.75rem;
}
.mag-scheda-tax-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.75rem;
  align-items: center;
}
.mag-scheda-tax-add input { max-width: 10rem; font-size: 0.85rem; }
.repair-model-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}
.repair-model-row input { flex: 1; min-width: 160px; }
.mag-scheda-models-empty {
  margin: 0.35rem 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.mag-scheda-compat {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.35;
}
@media (max-width: 900px) {
  .ricambi-fd {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .ricambi-fd-col {
    border-right: 0;
    border-bottom: 1px solid #e8eef5;
    max-height: 280px;
  }
  .ricambi-fd-col:last-child { border-bottom: 0; }
  .ricambi-fd-item.is-active { border-right-color: transparent; border-left: 3px solid #2f6fed; }
  .mag-scheda-tax-row--3,
  .mag-scheda-tax-row--2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .mag-scheda-tax-row { grid-template-columns: 1fr; }
}


/* —— Ricambi catalogo Foneday (sidebar + tipi) —— */
.ricambi-catalog {
  display: grid;
  grid-template-columns: minmax(240px, 280px) 1fr;
  gap: 1.1rem;
  align-items: start;
  max-width: 1280px;
  margin: 0 auto 1.5rem;
}
.ricambi-side {
  position: sticky;
  top: 0.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1rem 0.9rem 1.1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  overflow: visible;
}
.ricambi-side-models .ricambi-acc {
  max-height: min(52vh, 420px);
  overflow: auto;
}
.ricambi-side-block { margin-bottom: 1.1rem; }
.ricambi-side-block:last-child { margin-bottom: 0; }
.ricambi-side-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.45rem;
}
.ricambi-assort { display: flex; flex-direction: column; gap: 0.4rem; }
.ricambi-assort-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f2744;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.ricambi-assort-btn.is-active {
  background: #0f2744;
  border-color: #0f2744;
  color: #fff;
}
.ricambi-side-select {
  width: 100%;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  background: #fff;
  color: #0f2744;
}
.ricambi-side-hint { margin: 0; color: #94a3b8; font-size: 0.86rem; }
.ricambi-acc-item {
  border: 1px solid #e8eef5;
  border-radius: 12px;
  margin-bottom: 0.4rem;
  overflow: hidden;
  background: #fff;
}
.ricambi-acc-item summary {
  list-style: none;
  cursor: pointer;
  padding: 0.7rem 0.85rem;
  font-weight: 650;
  color: #0f2744;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ricambi-acc-item summary::-webkit-details-marker { display: none; }
.ricambi-acc-item summary::after {
  content: "+";
  color: #94a3b8;
  font-weight: 700;
}
.ricambi-acc-item[open] summary::after { content: "−"; }
.ricambi-acc-body {
  max-height: 260px;
  overflow: auto;
  padding: 0 0.35rem 0.55rem;
  border-top: 1px solid #f1f5f9;
}
.ricambi-radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #1e293b;
}
.ricambi-radio:hover { background: #f8fafc; }
.ricambi-radio input { accent-color: #2f6fed; }
.ricambi-catalog-main { min-width: 0; }
.ricambi-cat-head { margin-bottom: 0.85rem; }
.ricambi-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.86rem;
  color: #64748b;
  margin-bottom: 0.35rem;
}
.ricambi-crumbs a { color: #2f6fed; text-decoration: none; font-weight: 500; }
.ricambi-cat-title {
  margin: 0 0 0.2rem;
  font-size: 1.55rem;
  font-weight: 750;
  color: #0f2744;
  letter-spacing: -0.02em;
}
.ricambi-cat-sub { margin: 0 0 0.65rem; color: #64748b; font-size: 0.92rem; }
.ricambi-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ricambi-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #eef4ff;
  color: #1e3a8a;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid #dbe7ff;
}
.ricambi-chip-reset { background: #fff; color: #0f2744; border-color: #e2e8f0; }
.ricambi-types {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  margin: 0 0 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 0.45rem 0.4rem;
}
.ricambi-types-track {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  flex: 1;
  padding: 0.2rem 0.15rem 0.35rem;
  scrollbar-width: thin;
}
.ricambi-type {
  flex: 0 0 auto;
  min-width: 92px;
  max-width: 120px;
  text-align: center;
  text-decoration: none;
  color: #0f2744;
  padding: 0.35rem 0.45rem 0.55rem;
  border-bottom: 3px solid transparent;
  border-radius: 8px 8px 0 0;
}
.ricambi-type img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
  margin: 0 auto 0.3rem;
  border-radius: 8px;
  background: #f8fafc;
}
.ricambi-type span {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.25;
}
.ricambi-type.is-active { border-bottom-color: #e11d48; }
.ricambi-type:hover { background: #f8fafc; }
.ricambi-types-nav {
  border: 0;
  background: #f1f5f9;
  color: #334155;
  width: 2rem;
  border-radius: 10px;
  font-size: 1.25rem;
  cursor: pointer;
  flex-shrink: 0;
}
.ricambi-types-nav:hover { background: #e2e8f0; }
.ricambi-cat-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}
@media (max-width: 900px) {
  .ricambi-catalog { grid-template-columns: 1fr; }
  .ricambi-side {
    position: static;
    max-height: none;
  }
}

.ricambi-type { position: relative; }
.ricambi-type-badge {
  position: absolute;
  top: 2px;
  right: 6px;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.15rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(225, 29, 72, 0.35);
  z-index: 1;
}
.mag-card-del, .mag-row-del { margin-top: 0.45rem; }
.mag-del-btn { padding: 0.25rem 0.55rem !important; font-size: 0.78rem !important; }
.ricambi-side-select { position: relative; z-index: 5; }

.mag-scheda-lotti {
  margin: 0.85rem 0 1rem;
  padding: 0.85rem 0.95rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.mag-scheda-lotti h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.mag-scheda-lotti-empty { margin: 0; color: #94a3b8; font-size: 0.88rem; }
.mag-scheda-lotti-list { list-style: none; margin: 0; padding: 0; }
.mag-scheda-lotti-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #eef2f7;
  font-size: 0.92rem;
}
.mag-scheda-lotti-list li:last-child { border-bottom: 0; }
.mag-scheda-barcodes { margin: 0.9rem 0 1rem; }
.mag-scheda-barcodes h3 { margin: 0 0 0.45rem; font-size: 0.95rem; }
.mag-scheda-bc-list { list-style: none; margin: 0 0 0.55rem; padding: 0; }
.mag-scheda-bc-list li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0;
}
.mag-scheda-bc-list code {
  font-size: 0.9rem;
  background: #f1f5f9;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}
.mag-scheda-bc-main {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
}
.mag-scheda-bc-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.mag-scheda-bc-add input {
  flex: 1;
  min-width: 10rem;
}
.mag-scheda-bc-list li {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  margin-bottom: .35rem;
}
.mag-scheda-bc-forn, .mag-scheda-bc-prezzo {
  max-width: 8rem;
  font-size: .85rem;
}
.repair-mag-panel-wrap {
  margin: .75rem 0 1rem;
  display: none;
}
.repair-mag-panel-head {
  margin-bottom: .4rem;
  font-size: .92rem;
}
.mag-donatore-row { text-decoration: none; color: inherit; }
.mag-donatore-row:hover { border-color: #86efac; }
.mag-kind-filter {
  display: inline-flex;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
  padding: 0.25rem;
  background: #f1f5f9;
  border-radius: 999px;
}
.mag-kind-btn {
  border: 0;
  background: transparent;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
}
.mag-kind-btn.is-active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.mag-don-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.2rem;
  font-size: 0.95rem;
  line-height: 1;
  filter: saturate(1.4);
}
.mag-item--donatore .mag-row-name,
.mag-item--donatore .mag-card-name { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }

.don-sheet { max-width: 820px; margin: 0 auto 2rem; padding: 0 0.5rem; }
.don-sheet-top { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.1rem; }
.don-sheet-heading { flex: 1; min-width: 0; }
.don-sheet-kicker { margin: 0; font-size: 0.78rem; font-weight: 600; color: #16a34a; letter-spacing: 0.02em; }
.don-sheet-title { margin: 0.15rem 0 0; font-size: 1.35rem; font-weight: 700; color: #0f172a; line-height: 1.25; }
.don-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1rem 1.1rem 1.15rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.don-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.65rem; }
.don-card-title { margin: 0 0 0.75rem; font-size: 0.92rem; font-weight: 700; color: #334155; }
.don-card-head .don-card-title { margin: 0; }
.don-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.don-field { display: grid; gap: 0.3rem; }
.don-field--wide { grid-column: 1 / -1; }
.don-field span { font-size: 0.78rem; font-weight: 600; color: #64748b; }
.don-field input, .don-field select, .don-notes {
  width: 100%; padding: 0.55rem 0.7rem; border: 1px solid #d1d5db; border-radius: 12px;
  font-size: 0.95rem; background: #fff;
}
.don-notes { resize: vertical; min-height: 4.5rem; font-family: inherit; }
.don-comp-list { display: flex; flex-direction: column; gap: 0.55rem; }
.don-comp-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.55rem;
  align-items: start;
  padding: 0.7rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fafbfc;
}
.don-comp-main { min-width: 0; display: grid; gap: 0.4rem; }
.don-comp-nome {
  width: 100%; padding: 0.45rem 0.6rem; border: 1px solid #d1d5db; border-radius: 10px; font-size: 0.92rem; font-weight: 600;
}
.don-stato-seg { display: flex; flex-direction: column; gap: 0.28rem; min-width: 8.5rem; }
.don-stato-opt {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border: 1px solid #e2e8f0; background: #fff; border-radius: 999px;
  padding: 0.28rem 0.55rem; font-size: 0.72rem; font-weight: 600; color: #64748b; cursor: pointer;
}
.don-stato-dot {
  width: 0.7rem; height: 0.7rem; border-radius: 50%;
  background: #cbd5e1; position: relative; flex: 0 0 auto;
}
.don-stato-opt--ok.is-on { border-color: #86efac; background: #f0fdf4; color: #166534; }
.don-stato-opt--ok.is-on .don-stato-dot { background: #22c55e; }
.don-stato-opt--ok.is-on .don-stato-dot::after,
.don-stato-opt--warn.is-on .don-stato-dot::after,
.don-stato-opt--bad.is-on .don-stato-dot::after {
  content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 0.55rem; font-weight: 800; color: #fff; line-height: 1;
}
.don-stato-opt--warn.is-on { border-color: #fde68a; background: #fffbeb; color: #a16207; }
.don-stato-opt--warn.is-on .don-stato-dot { background: #eab308; }
.don-stato-opt--bad.is-on { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.don-stato-opt--bad.is-on .don-stato-dot { background: #ef4444; }
.don-comp-del {
  border: 0; background: transparent; color: #94a3b8; font-size: 1.25rem; line-height: 1;
  cursor: pointer; padding: 0.15rem 0.35rem; border-radius: 8px;
}
.don-comp-del:hover { background: #fee2e2; color: #b91c1c; }
.don-sheet-actions { display: flex; justify-content: flex-end; margin-top: 0.5rem; }
@media (max-width: 720px) {
  .don-grid { grid-template-columns: 1fr; }
  .don-comp-row { grid-template-columns: 1fr auto; }
  .don-stato-seg { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
}
.don-comp-compat-cell { min-width: 12rem; }
.don-comp-compat-chips { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.25rem; }
.don-comp-chip { display: inline-flex; align-items: center; gap: 0.15rem; background: #eef2ff; border-radius: 999px; padding: 0.1rem 0.45rem; font-size: 0.75rem; }
.don-comp-chip-x { border: 0; background: transparent; cursor: pointer; padding: 0; line-height: 1; }
.drdex-tax-dialog-overlay { z-index: 12050; }
.drdex-tax-dialog { max-width: 420px; width: min(92vw, 420px); text-align: left; }
.drdex-tax-dialog-fields { display: grid; gap: 0.75rem; margin: 0.75rem 0 1rem; }
.drdex-tax-dialog-field { display: grid; gap: 0.3rem; }
.drdex-tax-dialog-field span { font-size: 0.82rem; font-weight: 600; color: #475569; }
.drdex-tax-dialog-field input {
  width: 100%; padding: 0.55rem 0.65rem; border: 1px solid #d1d5db; border-radius: 10px; font-size: 0.95rem;
}
.drdex-tax-dialog-actions { justify-content: flex-end; gap: 0.5rem; }
.repair-mag-card--don .repair-mag-don-pick-label { display: grid; gap: 0.25rem; margin: 0.45rem 0; font-size: 0.78rem; color: #64748b; }
.repair-mag-card--don .repair-mag-don-pick { width: 100%; padding: 0.4rem 0.5rem; border-radius: 8px; border: 1px solid #cbd5e1; }
.repair-mag-section {
  grid-column: 1 / -1;
  margin: 0.35rem 0 0.15rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}
.repair-mag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .5rem;
}
.repair-mag-card {
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: .55rem .65rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.repair-mag-badge {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #0f766e;
}
.repair-mag-badge--don { color: #7c3aed; }
.preventivo-righe-table { table-layout: auto; }
.preventivo-righe-table .col-qta { width: 4.5rem; }
.preventivo-righe-table .col-importo { width: 8.5rem; }
.preventivo-righe-table .col-riga-tot { width: 8.5rem; }
.preventivo-righe-table .prev-qta { text-align: center; }
.preventivo-righe-table .prev-prezzo,
.preventivo-righe-table .prev-riga-tot { text-align: right; }
.preventivo-righe-table td { height: auto; vertical-align: middle; }

